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
|
//PORTABLE
#ifndef _COMPBUCK_H
#define _COMPBUCK_H
#include <api/wnd/wndclass/clickwnd.h>
#include <api/skin/widgets/text.h>
#include <api/wnd/wndclass/guiobjwnd.h>
#include <api/service/svc_enum.h>
#include <api/script/objects/guiobj.h>
#include <api/service/svcs/svc_wndcreate.h>
// {97AA3E4D-F4D0-4fa8-817B-0AF22A454983}
static const GUID cbucketGuid =
{ 0x97aa3e4d, 0xf4d0, 0x4fa8, { 0x81, 0x7b, 0xa, 0xf2, 0x2a, 0x45, 0x49, 0x83 } };
#define COMPONENTBUCKET2_PARENT GuiObjectWnd
#define COMPONENTBUCKET2_XMLPARENT GuiObjectWnd
class CompBucketScriptController: public GuiObjectScriptController {
public:
virtual const wchar_t *getClassName();
virtual const wchar_t *getAncestorClassName();
virtual ScriptObjectController *getAncestorController() { return guiController; }
virtual int getNumFunctions();
virtual const function_descriptor_struct *getExportedFunctions();
virtual GUID getClassGuid();
virtual ScriptObject *instantiate();
virtual void destroy(ScriptObject *o);
virtual void *encapsulate(ScriptObject *o);
virtual void deencapsulate(void *o);
private:
static function_descriptor_struct exportedFunction[];
};
extern CompBucketScriptController *cbucketController;
class Layout;
class ServiceWndHolder;
class ComponentBucket2 : public COMPONENTBUCKET2_PARENT {
public:
ComponentBucket2();
virtual ~ComponentBucket2();
virtual int onInit();
virtual int setXuiParam(int _xuihandle, int id, const wchar_t *name, const wchar_t *strval);
/* virtual int getAutoHeight();
virtual int getAutoWidth();*/
virtual void timerCallback(int id);
virtual int childNotify(ifc_window *child, int msg, intptr_t p1, intptr_t p2);
virtual int onResize();
virtual void setLMargin(int i);
virtual void setRMargin(int i);
virtual void setSpacing(int i);
virtual int getLMargin(void);
virtual int getRMargin(void);
virtual int getSpacing(void);
void next_page();
void prev_page();
void next_down();
void next_up();
void prev_down();
void prev_up();
static void next_down(Group *l); // next_down on all compbucks in this group
static void next_up(Group *l); // next_up on all compbucks in this group
static void prev_down(Group *l); // prev_down on all compbucks in this group
static void prev_up(Group *l); // prev_up on all compbucks in this group
static void prev_page(Group *l); // prev_down on all compbucks in this group
static void next_page(Group *l); // prev_up on all compbucks in this group
void setText(const wchar_t *txt);
static void setText(ifc_window *cb , const wchar_t *txt); // set this text for this compbuck's rootwnd
static void registerText(Text *t, const wchar_t *id=NULL); // id=NULL => register for all compbucks in this group
static void unRegisterText(Text *t, const wchar_t *id=NULL); // id=NULL => unregister for all compbucks in this group
static ComponentBucket2 *getComponentBucket(const wchar_t *cb);
int getMaxWidth();
int getMaxHeight();
void setVertical(int v);
void setScroll(int v);
int getScroll();
int getNumChildren();
GuiObject *enumChildren(int i);
protected:
/*static */void CreateXMLParameters(int master_handle);
enum {
COMPBUCK_LEFTMARGIN=0,
COMPBUCK_RIGHTMARGIN,
COMPBUCK_SPACING,
COMPBUCK_VERTICAL,
COMPBUCK_WNDTYPE,
};
private:
void load();
void addItems(svc_windowCreate *wc);
void doRegisterText(Text *t);
void doUnregisterText(Text *t);
int timeron;
static PtrList<ComponentBucket2> cblist;
PtrList<Text> txtlist;
StringW id;
PtrList<ServiceWndHolder> myclients;
int lmargin;
int rmargin;
int spacing;
int xscroll;
int direction;
int timerset;
void startScrollTimer();
void stopScrollTimer();
uint32_t lastticcount;
int vertical;
int xuihandle;
static XMLParamPair params[];
StringW wndtype;
uint32_t scrollpage_starttime;
int scrollpage_timerset;
int scrollpage_start;
int scrollpage_target;
int scrollpage_speed;
public:
static scriptVar script_vcpu_fake(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
static scriptVar script_vcpu_getMaxWidth(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
static scriptVar script_vcpu_getMaxHeight(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
static scriptVar script_vcpu_getScroll(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
static scriptVar script_vcpu_setScroll(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar v);
static scriptVar script_vcpu_getNumChildren(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
static scriptVar script_vcpu_enumChildren(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar v);
};
extern const wchar_t componentBucketXuiObjectStr[];
extern char componentBucketXuiSvcName[];
class ComponentBucketXuiSvc : public XuiObjectSvc<ComponentBucket2, componentBucketXuiObjectStr, componentBucketXuiSvcName> {};
#endif
|