|
@@ -7,6 +7,7 @@ extern "C" {
|
7
|
7
|
|
8
|
8
|
typedef unsigned cmUiRC_t;
|
9
|
9
|
|
|
10
|
+ // cmUi result codes
|
10
|
11
|
enum
|
11
|
12
|
{
|
12
|
13
|
kOkUiRC = cmOkRC,
|
|
@@ -18,9 +19,12 @@ extern "C" {
|
18
|
19
|
kInvalidCtlOpUiRC,
|
19
|
20
|
kInvalidColRowUiRC,
|
20
|
21
|
kInvalidIdUiRC,
|
|
22
|
+ kSubSysFailUiRC,
|
|
23
|
+ kBufTooSmallUiRC,
|
|
24
|
+ kBufCorruptUiRC
|
21
|
25
|
};
|
22
|
26
|
|
23
|
|
-
|
|
27
|
+ // Built-in control types.
|
24
|
28
|
typedef enum
|
25
|
29
|
{
|
26
|
30
|
kInvalidUiCId,
|
|
@@ -37,46 +41,55 @@ extern "C" {
|
37
|
41
|
kMeterUiCId,
|
38
|
42
|
kFilenameUiCId,
|
39
|
43
|
kDirUiCId,
|
|
44
|
+ kMaxUiCId
|
40
|
45
|
} cmUiCId_t;
|
41
|
46
|
|
|
47
|
+ // Control selector id's
|
42
|
48
|
typedef enum
|
43
|
49
|
{
|
44
|
50
|
kInvalidDId,
|
45
|
51
|
kCreateCtlDId,
|
46
|
52
|
kDestroyCtlDId,
|
47
|
53
|
kSetValDId,
|
48
|
|
- kDestroyAllDId
|
|
54
|
+ kDestroyAllDId,
|
|
55
|
+ kMaxDId
|
49
|
56
|
} cmUiDId_t;
|
50
|
57
|
|
|
58
|
+ // Control flags.
|
51
|
59
|
enum
|
52
|
60
|
{
|
53
|
61
|
// All controls recognize kValUiFl and kLblUiFl
|
54
|
|
- kValUiFl = 0x000001,
|
55
|
|
- kLblUiFl = 0x000002,
|
|
62
|
+ kValUiFl = 0x0000001,
|
|
63
|
+ kLblUiFl = 0x0000002,
|
56
|
64
|
|
57
|
65
|
// Flags for Number,Progress,Meter
|
58
|
|
- kMinUiFl = 0x00004,
|
59
|
|
- kMaxUiFl = 0x00010,
|
60
|
|
- kIncUiFl = 0x00020,
|
|
66
|
+ kMinUiFl = 0x000004,
|
|
67
|
+ kMaxUiFl = 0x000010,
|
|
68
|
+ kIncUiFl = 0x000020,
|
61
|
69
|
kNumMask = kValUiFl | kMinUiFl | kMaxUiFl | kIncUiFl,
|
62
|
|
- kHorzUiFl = 0x00040,
|
63
|
|
- kVertUiFl = 0x00080,
|
|
70
|
+ kHorzUiFl = 0x000040,
|
|
71
|
+ kVertUiFl = 0x000080,
|
64
|
72
|
|
65
|
73
|
// Flags for Filename and Dir
|
66
|
|
- kFnPatUiFl = 0x00100, // file pattern string
|
67
|
|
- kFnDirUiFl = 0x00200, // toggle file btn type
|
|
74
|
+ kFnPatUiFl = 0x000100, // file pattern string
|
|
75
|
+ kFnDirUiFl = 0x000200, // toggle file btn type
|
68
|
76
|
kFnMask = kFnPatUiFl | kFnDirUiFl,
|
69
|
77
|
|
70
|
78
|
// Append list or menu element.
|
71
|
|
- kAppendUiFl = 0x00400,
|
|
79
|
+ kAppendUiFl = 0x000400,
|
|
80
|
+
|
|
81
|
+ kLeftUiFl = 0x001000,
|
|
82
|
+ kTopUiFl = 0x002000,
|
|
83
|
+ kRightUiFl = 0x004000,
|
|
84
|
+ kBottomUiFl = 0x008000,
|
|
85
|
+ kHCtrUiFl = 0x010000,
|
|
86
|
+ kVCtrUiFl = 0x020000,
|
|
87
|
+ kInsideUiFl = 0x040000,
|
72
|
88
|
|
73
|
|
- kLeftUiFl = 0x01000,
|
74
|
|
- kTopUiFl = 0x02000,
|
75
|
|
- kRightUiFl = 0x04000,
|
76
|
|
- kBottomUiFl = 0x08000,
|
77
|
|
- kHCtrUiFl = 0x10000,
|
78
|
|
- kVCtrUiFl = 0x20000,
|
79
|
|
- kInsideUiFl = 0x40000,
|
|
89
|
+ // Value flags indicate which value fields are valid
|
|
90
|
+ kIvalUiFl = 0x100000,
|
|
91
|
+ kFvalUiFl = 0x200000,
|
|
92
|
+ kSvalUiFl = 0x400000
|
80
|
93
|
|
81
|
94
|
};
|
82
|
95
|
|
|
@@ -88,23 +101,58 @@ extern "C" {
|
88
|
101
|
// because they are used internally as indexes.
|
89
|
102
|
typedef struct
|
90
|
103
|
{
|
91
|
|
- void* cbArg; //
|
92
|
|
- cmUiDId_t dId; // function selector id
|
93
|
|
- unsigned appId; // app id (plug-in instance id)
|
94
|
|
- unsigned usrId; // ctl id
|
95
|
|
- unsigned panelId; // parent panel id
|
96
|
|
- cmUiCId_t cId; // UI control type
|
97
|
|
- unsigned flags; // See kXXXUiFl above.
|
98
|
|
- int x;
|
99
|
|
- int y;
|
100
|
|
- int w;
|
101
|
|
- int h;
|
102
|
|
- int ival;
|
103
|
|
- double fval;
|
104
|
|
- const char* sval;
|
|
104
|
+ cmUiDId_t dId; // function selector id
|
|
105
|
+ unsigned appId; // app id (plug-in instance id)
|
|
106
|
+ unsigned usrId; // ctl id
|
|
107
|
+ unsigned panelId; // parent panel id
|
|
108
|
+ cmUiCId_t cId; // UI control type
|
|
109
|
+ unsigned flags; // See kXXXUiFl above.
|
|
110
|
+ int ival; // Valid if kIvalUiFl is set.
|
|
111
|
+ double fval; // Valid if kFvalUiFl is set.
|
|
112
|
+ const cmChar_t* sval; // Valid if kSvalUiFl is set.
|
|
113
|
+ int x;
|
|
114
|
+ int y;
|
|
115
|
+ int w;
|
|
116
|
+ int h;
|
105
|
117
|
} cmUiDriverArg_t;
|
106
|
118
|
|
107
|
|
- typedef cmUiRC_t (*cmUiDriverFunc_t)( const cmUiDriverArg_t* a );
|
|
119
|
+ typedef cmUiRC_t (*cmUiDriverFunc_t)( void* arg, const cmUiDriverArg_t* a );
|
|
120
|
+
|
|
121
|
+ void cmUiDriverArgSetup( cmUiDriverArg_t* a,
|
|
122
|
+ cmUiDId_t dId,
|
|
123
|
+ unsigned appId,
|
|
124
|
+ unsigned usrId,
|
|
125
|
+ unsigned panelId,
|
|
126
|
+ cmUiCId_t cId,
|
|
127
|
+ unsigned flags,
|
|
128
|
+ int ival,
|
|
129
|
+ double fval,
|
|
130
|
+ const cmChar_t* sval,
|
|
131
|
+ int x,
|
|
132
|
+ int y,
|
|
133
|
+ int w,
|
|
134
|
+ int h
|
|
135
|
+ );
|
|
136
|
+
|
|
137
|
+ unsigned cmUiDriverArgSerializeBufByteCount( const cmUiDriverArg_t* a );
|
|
138
|
+
|
|
139
|
+ // Returns kBufTooSmallUiRC if the buffer is too small otherwise returns kOkUiRC.
|
|
140
|
+ // This function does not call cmErrMsg() on error
|
|
141
|
+ // the caller is therefore responsible for generating errors.
|
|
142
|
+ cmUiRC_t cmUiDriverArgSerialize( const cmUiDriverArg_t* a, void* buf, unsigned bufByteCnt );
|
|
143
|
+
|
|
144
|
+ // Return kBufTooSmallUiRC or kBufCorruptUiRC if buffer corruption is detected
|
|
145
|
+ // otherwise returns kOkUiRC. This function does not call cmErrMsg() on error
|
|
146
|
+ // the caller is therefore responsible for generating errors.
|
|
147
|
+ cmUiRC_t cmUiDriverArgDeserialize( cmUiDriverArg_t* a, void* buf, unsigned bufByteCnt );
|
|
148
|
+
|
|
149
|
+ // Return an arg. value converted to the requiested type.
|
|
150
|
+ // Note that numeric values will be automatically converted but
|
|
151
|
+ // values will not be converted between string and numeric values.
|
|
152
|
+ int cmUiDriverArgGetInt( const cmUiDriverArg_t* a );
|
|
153
|
+ double cmUiDriverArgGetDouble( const cmUiDriverArg_t* a );
|
|
154
|
+ const cmChar_t* cmUiDriverArgGetString( const cmUiDriverArg_t* a );
|
|
155
|
+
|
108
|
156
|
|
109
|
157
|
#ifdef __cplusplus
|
110
|
158
|
}
|