1/* 2 * Author: William Chia-Wei Cheng (bill.cheng@acm.org) 3 * 4 * Copyright (C) 2001-2009, William Chia-Wei Cheng. 5 * 6 * This file may be distributed under the terms of the Q Public License 7 * as defined by Trolltech AS of Norway and appearing in the file 8 * LICENSE.QPL included in the packaging of this file. 9 * 10 * THIS FILE IS PROVIDED AS IS WITH NO WARRANTY OF ANY KIND, INCLUDING 11 * THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR 12 * PURPOSE. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, 13 * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING 14 * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, 15 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION 16 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 * 18 * @(#)$Header: /mm2/home/cvs/bc-src/tgif/tdgtbmpl.e,v 1.6 2011/05/16 16:21:59 william Exp $ 19 */ 20 21#ifndef _TDGTBMPL_E_ 22#define _TDGTBMPL_E_ 23 24#include "tidget.h" 25 26#include "list.e" 27 28#define TDGTBMPL_DEF_H_PAD 0 29#define TDGTBMPL_DEF_V_PAD 0 30 31struct tagBmpListItemInfo; 32 33typedef void (TdgtBmpListFreeItemCallbackFunc)ARGS_DECL(( 34 struct tagBmpListItemInfo *)); 35 36typedef struct tagBmpListItemInfo { 37 Pixmap pixmap; 38 int width, height, depth; 39 void *pv_userdata; 40 41 /* callback functions */ 42 TdgtBmpListFreeItemCallbackFunc *pf_free_callback; 43} BmpListItemInfo; 44 45typedef struct tagTdgtBmpList { 46 TidgetInfo *pti; 47 48 Window dsp_win, scr_win; 49 SimpleWinInfo dsp_win_info, scr_win_info; 50 51 int can_select; /* if FALSE, cannot select an item */ 52 53 int one_bmp_w, one_bmp_h; /* width and height of one bitmap */ 54 int gap; /* gap between bitmaps, both horizontal and vertical */ 55 56 int first_index; 57 int marked_index; 58 59 int num_cols; 60 int num_visible_lines; 61 62 CVList list; 63 64 MouseOverStatusInfo mosi; 65 66 /* temporary variables */ 67 int scr_dir; /* which direction it's scrolling */ 68 Time last_selected_index; /* for double-clicking */ 69 Time last_clicked_time; /* for double-clicking */ 70} TdgtBmpList; 71 72#ifdef _INCLUDE_FROM_TDGTBMPL_C_ 73#undef extern 74#define extern 75#endif /*_INCLUDE_FROM_TDGTBMPL_C_*/ 76 77extern void TdgtBmpListReset ARGS_DECL((TdgtBmpList*)); 78extern TdgtBmpList *CreateTdgtBmpList ARGS_DECL((Window parent_win, 79 TidgetInfo *parent_tidgetinfo, int ctl_ld, 80 int x, int y, int h_pad, int v_pad, int bmp_w, 81 int bmp_h, int num_cols, int num_visible_lines, 82 int gap, int can_select, 83 MouseOverStatusInfo *pmosi)); 84 85extern int TdgtBmpListCleanUpEntries ARGS_DECL((TdgtBmpList*)); 86extern int TdgtBmpListScrollToBottom ARGS_DECL((TdgtBmpList*)); 87extern int TdgtBmpListAddItem ARGS_DECL((TdgtBmpList*, BmpListItemInfo*)); 88 89extern int InitTdgtBmpList ARGS_DECL((void)); 90extern void CleanUpTdgtBmpList ARGS_DECL((void)); 91 92#ifdef _INCLUDE_FROM_TDGTBMPL_C_ 93#undef extern 94#ifndef _NO_RECURSIVE_EXTERN 95#define extern extern 96#endif /* ~_NO_RECURSIVE_EXTERN */ 97#endif /*_INCLUDE_FROM_TDGTBMPL_C_*/ 98 99#endif /*_TDGTBMPL_E_*/ 100