1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
|
/*
* tkTreeElem.h --
*
* This module is the header for elements in treectrl widgets.
*
* Copyright (c) 2002-2006 Tim Baker
*
* RCS: @(#) $Id: tkTreeElem.h,v 1.25 2007/01/23 22:41:31 treectrl Exp $
*/
typedef struct TreeElementType TreeElementType;
typedef struct TreeElement_ TreeElement_;
typedef struct TreeElementArgs TreeElementArgs;
struct TreeElementArgs
{
TreeCtrl *tree;
TreeElement elem;
int state;
struct {
TreeItem item;
TreeItemColumn column;
} create;
struct {
int noop;
} delete;
struct {
int objc;
Tcl_Obj *CONST *objv;
int flagSelf;
TreeItem item;
TreeItemColumn column;
} config;
struct {
int x;
int y;
int width;
int height;
#define STICKY_W 0x1000 /* These values must match ELF_STICKY_xxx */
#define STICKY_N 0x2000
#define STICKY_E 0x4000
#define STICKY_S 0x8000
int sticky;
Drawable drawable;
int bounds[4];
} display;
struct {
int fixedWidth;
int fixedHeight;
int maxWidth;
int maxHeight;
int width;
int height;
} needed;
struct {
int fixedWidth;
int height;
} height;
struct {
int flagTree;
int flagMaster;
int flagSelf;
} change;
struct {
int state1;
int state2;
int draw1;
int draw2;
int visible1;
int visible2;
} states;
struct {
Tcl_Obj *obj;
} actual;
struct {
int visible;
} screen;
};
struct TreeElementType
{
char *name; /* "image", "text" */
int size; /* size of an TreeElement */
Tk_OptionSpec *optionSpecs;
Tk_OptionTable optionTable;
int (*createProc)(TreeElementArgs *args);
void (*deleteProc)(TreeElementArgs *args);
int (*configProc)(TreeElementArgs *args);
void (*displayProc)(TreeElementArgs *args);
void (*neededProc)(TreeElementArgs *args);
void (*heightProc)(TreeElementArgs *args);
int (*changeProc)(TreeElementArgs *args);
int (*stateProc)(TreeElementArgs *args);
int (*undefProc)(TreeElementArgs *args);
int (*actualProc)(TreeElementArgs *args);
void (*onScreenProc)(TreeElementArgs *args);
TreeElementType *next;
};
/* list of these for each style */
struct TreeElement_
{
Tk_Uid name; /* "elem2", "eText" etc */
TreeElementType *typePtr;
TreeElement master; /* NULL if this is master */
DynamicOption *options; /* Dynamically-allocated options. */
/* type-specific data here */
};
extern TreeElementType TreeElemTypeBitmap;
extern TreeElementType TreeElemTypeBorder;
extern TreeElementType TreeElemTypeCheckButton;
extern TreeElementType TreeElemTypeImage;
extern TreeElementType TreeElemTypeRect;
extern TreeElementType TreeElemTypeText;
extern TreeElementType TreeElemTypeWindow;
#define ELEMENT_TYPE_MATCHES(t1,t2) ((t1)->name == (t2)->name)
/***** ***** *****/
extern int TreeElement_GetSortData(TreeCtrl *tree, TreeElement elem, int type, long *lv, double *dv, char **sv);
typedef struct TreeIterate_ *TreeIterate;
extern int TreeElement_TypeFromObj(TreeCtrl *tree, Tcl_Obj *objPtr, TreeElementType **typePtrPtr);
extern void Tree_RedrawElement(TreeCtrl *tree, TreeItem item, TreeElement elem);
extern TreeIterate Tree_ElementIterateBegin(TreeCtrl *tree, TreeElementType *elemTypePtr);
extern TreeIterate Tree_ElementIterateNext(TreeIterate iter_);
extern TreeElement Tree_ElementIterateGet(TreeIterate iter_);
extern void Tree_ElementIterateChanged(TreeIterate iter_, int mask);
extern void Tree_ElementChangedItself(TreeCtrl *tree, TreeItem item,
TreeItemColumn column, TreeElement elem, int flags, int mask);
typedef struct TreeCtrlStubs TreeCtrlStubs;
struct TreeCtrlStubs
{
int (*TreeCtrl_RegisterElementType)(Tcl_Interp *interp, TreeElementType *typePtr);
void (*Tree_RedrawElement)(TreeCtrl *tree, TreeItem item, TreeElement elem);
TreeIterate (*Tree_ElementIterateBegin)(TreeCtrl *tree, TreeElementType *elemTypePtr);
TreeIterate (*Tree_ElementIterateNext)(TreeIterate iter_);
TreeElement (*Tree_ElementIterateGet)(TreeIterate iter_);
void (*Tree_ElementIterateChanged)(TreeIterate iter_, int mask);
void (*PerStateInfo_Free)(TreeCtrl *tree, PerStateType *typePtr, PerStateInfo *pInfo);
int (*PerStateInfo_FromObj)(TreeCtrl *tree, StateFromObjProc proc, PerStateType *typePtr, PerStateInfo *pInfo);
PerStateData *(*PerStateInfo_ForState)(TreeCtrl *tree, PerStateType *typePtr, PerStateInfo *pInfo, int state, int *match);
Tcl_Obj *(*PerStateInfo_ObjForState)(TreeCtrl *tree, PerStateType *typePtr, PerStateInfo *pInfo, int state, int *match);
int (*PerStateInfo_Undefine)(TreeCtrl *tree, PerStateType *typePtr, PerStateInfo *pInfo, int state);
PerStateType *pstBoolean;
int (*PerStateBoolean_ForState)(TreeCtrl *tree, PerStateInfo *pInfo, int state, int *match);
void (*PSTSave)(PerStateInfo *pInfo, PerStateInfo *pSave);
void (*PSTRestore)(TreeCtrl *tree, PerStateType *typePtr, PerStateInfo *pInfo, PerStateInfo *pSave);
int (*TreeStateFromObj)(TreeCtrl *tree, Tcl_Obj *obj, int *stateOff, int *stateOn);
int (*BooleanCO_Init)(Tk_OptionSpec *optionTable, CONST char *optionName);
int (*StringTableCO_Init)(Tk_OptionSpec *optionTable, CONST char *optionName, CONST char **tablePtr);
};
|