-
Notifications
You must be signed in to change notification settings - Fork 0
/
listitemtemplate.go
337 lines (306 loc) · 12 KB
/
listitemtemplate.go
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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
package 炫彩基类
import (
"unsafe"
"github.com/888go/xcgui/common"
"github.com/888go/xcgui/xcc"
)
// 模板_加载从文件, 列表项模板文件载入, 返回模板句柄.
//
// nType: 模板类型, xcc.ListItemTemp_Type_.
//
// pFileName: 文件名.
func X模板_加载从文件(模板类型 炫彩常量类.ListItemTemp_Type_, 文件名 string) int {
r, _, _ := xTemp_Load.Call(uintptr(模板类型), 炫彩工具类.StrPtr(文件名))
return int(r)
}
// 模板_加载从ZIP, 加载列表项模板从zip压缩包中, 返回模板句柄.
//
// nType: 模板类型, xcc.ListItemTemp_Type_.
//
// pZipFile: zip文件.
//
// pFileName: 文件名.
//
// pPassword: zip密码.
func X模板_加载从ZIP(模板类型 炫彩常量类.ListItemTemp_Type_, zip文件 string, 文件名 string, zip密码 string) int {
r, _, _ := xTemp_LoadZip.Call(uintptr(模板类型), 炫彩工具类.StrPtr(zip文件), 炫彩工具类.StrPtr(文件名), 炫彩工具类.StrPtr(zip密码))
return int(r)
}
// 模板_加载从内存ZIP, 加载列表项模板从内存zip压缩包中, 返回模板句柄.
//
// nType: 模板类型, xcc.ListItemTemp_Type_.
//
// data: 模板文件数据.
//
// pFileName: 文件名.
//
// pPassword: zip密码.
func X模板_加载从内存ZIP(模板类型 炫彩常量类.ListItemTemp_Type_, 模板文件数据 []byte, 文件名 string, zip密码 string) int {
r, _, _ := xTemp_LoadZipMem.Call(uintptr(模板类型), 炫彩工具类.ByteSliceDataPtr(&模板文件数据), uintptr(len(模板文件数据)), 炫彩工具类.StrPtr(文件名), 炫彩工具类.StrPtr(zip密码))
return int(r)
}
// 模板_加载从文件扩展, 加载列表项模板从文件.
//
// nType: 模板类型, xcc.ListItemTemp_Type_.
//
// pFileName: 文件名.
//
// pOutTemp1: 返回模板句柄1, 项模板.
//
// pOutTemp2: 返回模板句柄2, 列表头模板或列表视组模板.
func X模板_加载从文件EX(模板类型 炫彩常量类.ListItemTemp_Type_, 文件名 string, 返回模板句柄1 *int, 返回模板句柄2 *int) bool {
r, _, _ := xTemp_LoadEx.Call(uintptr(模板类型), 炫彩工具类.StrPtr(文件名), uintptr(unsafe.Pointer(&返回模板句柄1)), uintptr(unsafe.Pointer(&返回模板句柄2)))
return r != 0
}
// 项模板_加载从内存. 加载列表项模板文件从内存, 返回模板句柄.
//
// nType: 模板类型, xcc.ListItemTemp_Type_.
//
// data: 模板文件数据.
func X项模板_加载从内存(模板类型 炫彩常量类.ListItemTemp_Type_, 模板文件数据 []byte) int {
r, _, _ := xTemp_LoadFromMem.Call(uintptr(模板类型), 炫彩工具类.ByteSliceDataPtr(&模板文件数据), uintptr(len(模板文件数据)))
return int(r)
}
// 项模板_加载从内存扩展. 加载列表项模板文件从内存.
//
// nType: 模板类型, xcc.ListItemTemp_Type_.
//
// data: 模板文件数据.
//
// pOutTemp1: 返回模板句柄1, 项模板.
//
// pOutTemp2: 返回模板句柄2, 列表头模板或列表视组模板.
func X项模板_加载从内存EX(模板类型 炫彩常量类.ListItemTemp_Type_, 模板文件数据 []byte, 返回模板句柄1 *int, 返回模板句柄2 *int) bool {
r, _, _ := xTemp_LoadFromMemEx.Call(uintptr(模板类型), 炫彩工具类.ByteSliceDataPtr(&模板文件数据), uintptr(len(模板文件数据)), uintptr(unsafe.Pointer(&返回模板句柄1)), uintptr(unsafe.Pointer(&返回模板句柄2)))
return r != 0
}
// 项模板_加载从资源ZIP. 加载列表项模板文件从RC资源ZIP, 返回模板句柄.
//
// nType: 模板类型, xcc.ListItemTemp_Type_.
//
// id: RC资源ID.
//
// pFileName: 模板文件名.
//
// pPassword: zip密码.
//
// hModule: 模块句柄, 可填0.
func X项模板_加载从资源ZIP(模板类型 炫彩常量类.ListItemTemp_Type_, RC资源ID int32, 模板文件名 string, zip密码 string, 模块句柄 uintptr) int {
r, _, _ := xTemp_LoadZipRes.Call(uintptr(模板类型), uintptr(RC资源ID), 炫彩工具类.StrPtr(模板文件名), 炫彩工具类.StrPtr(zip密码), 模块句柄)
return int(r)
}
// 项模板_加载从资源ZIP扩展. 加载列表项模板文件从RC资源ZIP, 返回模板句柄.
//
// nType: 模板类型, xcc.ListItemTemp_Type_.
//
// id: RC资源ID.
//
// pFileName: 模板文件名.
//
// pPassword: zip密码.
//
// pOutTemp1: 返回模板句柄1, 项模板.
//
// pOutTemp2: 返回模板句柄2, 列表头模板或列表视组模板.
//
// hModule: 模块句柄, 可填0.
func X项模板_加载从资源ZIPEX(模板类型 炫彩常量类.ListItemTemp_Type_, RC资源ID int32, 模板文件名 string, zip密码 string, 返回模板句柄1 *int, 返回模板句柄2 *int, 模块句柄 uintptr) int {
r, _, _ := xTemp_LoadZipResEx.Call(uintptr(模板类型), uintptr(RC资源ID), 炫彩工具类.StrPtr(模板文件名), 炫彩工具类.StrPtr(zip密码), uintptr(unsafe.Pointer(&返回模板句柄1)), uintptr(unsafe.Pointer(&返回模板句柄2)), 模块句柄)
return int(r)
}
// 模板_加载从ZIP扩展, 加载列表项模板从zip压缩包中.
//
// nType: 模板类型, xcc.ListItemTemp_Type_.
//
// pZipFile: zip文件.
//
// pFileName: 文件名.
//
// pPassword: zip密码.
//
// pOutTemp1: 返回模板句柄1, 项模板.
//
// pOutTemp2: 返回模板句柄2, 列表头模板或列表视组模板.
func X模板_加载从ZIPEX(模板类型 炫彩常量类.ListItemTemp_Type_, zip文件 string, 文件名 string, zip密码 string, 返回模板句柄1 *int, 返回模板句柄2 *int) bool {
r, _, _ := xTemp_LoadZipEx.Call(uintptr(模板类型), 炫彩工具类.StrPtr(zip文件), 炫彩工具类.StrPtr(文件名), 炫彩工具类.StrPtr(zip密码), uintptr(unsafe.Pointer(&返回模板句柄1)), uintptr(unsafe.Pointer(&返回模板句柄2)))
return r != 0
}
// 模板_加载从内存ZIP扩展, 加载列表项模板从内存zip压缩包中.
//
// nType: 模板类型, xcc.ListItemTemp_Type_.
//
// data: 模板文件数据.
//
// pFileName: 文件名.
//
// pPassword: zip密码.
//
// pOutTemp1: 返回模板句柄1, 项模板.
//
// pOutTemp2: 返回模板句柄2, 列表头模板或列表视组模板.
func X模板_加载从内存ZIPEX(模板类型 炫彩常量类.ListItemTemp_Type_, 模板文件数据 []byte, 文件名 string, zip密码 string, 返回模板句柄1 *int, 返回模板句柄2 *int) bool {
r, _, _ := xTemp_LoadZipMemEx.Call(uintptr(模板类型), 炫彩工具类.ByteSliceDataPtr(&模板文件数据), uintptr(len(模板文件数据)), 炫彩工具类.StrPtr(文件名), 炫彩工具类.StrPtr(zip密码), uintptr(unsafe.Pointer(&返回模板句柄1)), uintptr(unsafe.Pointer(&返回模板句柄2)))
return r != 0
}
// 模板_加载从字符串, 加载列表项模板文件从内存字符串.
//
// nType: 模板类型, xcc.ListItemTemp_Type_.
//
// pStringXML: 字符串.
func X模板_加载从字符串(模板类型 炫彩常量类.ListItemTemp_Type_, 字符串 string) int {
r, _, _ := xTemp_LoadFromString.Call(uintptr(模板类型), W2A(字符串))
return int(r)
}
// 模板_加载从字符串扩展, 加载列表项模板文件从内存字符串.
//
// nType: 模板类型, xcc.ListItemTemp_Type_.
//
// pStringXML: 字符串内容.
//
// pOutTemp1: 返回模板句柄1, 项模板.
//
// pOutTemp2: 返回模板句柄2, 列表头模板或列表视组模板.
func X模板_加载从字符串EX(模板类型 炫彩常量类.ListItemTemp_Type_, 字符串内容 string, 返回模板句柄1 *int, 返回模板句柄2 *int) bool {
r, _, _ := xTemp_LoadFromStringEx.Call(uintptr(模板类型), W2A(字符串内容), uintptr(unsafe.Pointer(&返回模板句柄1)), uintptr(unsafe.Pointer(&返回模板句柄2)))
return r != 0
}
// 模板_取类型, 获取列表项模板类型, 返回: xcc.ListItemTemp_Type_.
//
// hTemp: 列表项模板句柄.
func X模板_取类型(列表项模板句柄 int) 炫彩常量类.ListItemTemp_Type_ {
r, _, _ := xTemp_GetType.Call(uintptr(列表项模板句柄))
return 炫彩常量类.ListItemTemp_Type_(r)
}
// 模板_销毁, 项模板销毁.
//
// hTemp: 项模板句柄.
func X模板_销毁(项模板句柄 int) bool {
r, _, _ := xTemp_Destroy.Call(uintptr(项模板句柄))
return r != 0
}
// 模板_创建, 创建项模板, 返回模板句柄.
//
// nType: 模板类型, xcc.ListItemTemp_Type_.
func X模板_创建(模板类型 炫彩常量类.ListItemTemp_Type_) int {
r, _, _ := xTemp_Create.Call(uintptr(模板类型))
return int(r)
}
// 模板_添加根节点.
//
// hTemp: 项模板句柄.
//
// pNode: 节点指针.
func X模板_添加根节点(项模板句柄 int, 节点指针 int) bool {
r, _, _ := xTemp_AddNodeRoot.Call(uintptr(项模板句柄), uintptr(节点指针))
return r != 0
}
// 模板_添加子节点.
//
// pParentNode: 父节点指针.
//
// pNode: 节点指针.
func X模板_添加子节点(父节点指针 int, 节点指针 int) bool {
r, _, _ := xTemp_AddNode.Call(uintptr(父节点指针), uintptr(节点指针))
return r != 0
}
// 模板_创建节点.
//
// nType: 对象类型: xcc.XC_OBJECT_TYPE.
func X模板_创建节点(对象类型 炫彩常量类.XC_OBJECT_TYPE) int {
r, _, _ := xTemp_CreateNode.Call(uintptr(对象类型))
return int(r)
}
// 模板_置节点属性.
//
// pNode: 节点指针.
//
// pName: 属性名.
//
// pAttr: 属性值.
func X模板_置节点属性(节点指针 int, 属性名 string, 属性值 string) bool {
r, _, _ := xTemp_SetNodeAttribute.Call(uintptr(节点指针), 炫彩工具类.StrPtr(属性名), 炫彩工具类.StrPtr(属性值))
return r != 0
}
// 模板_置节点属性扩展.
//
// pNode: 节点指针.
//
// itemID: 模板项ID.
//
// pName: 属性名.
//
// pAttr: 属性值.
func X模板_置节点属性EX(节点指针 int, 模板项ID int32, 属性名 string, 属性值 string) bool {
r, _, _ := xTemp_SetNodeAttributeEx.Call(uintptr(节点指针), uintptr(模板项ID), 炫彩工具类.StrPtr(属性名), 炫彩工具类.StrPtr(属性值))
return r != 0
}
// 模板_取列表中的节点.
//
// hTemp: 模板句柄.
//
// index: 节点位置索引.
func X模板_取列表中的节点(模板句柄 int, 节点位置索引 int32) int {
r, _, _ := xTemp_List_GetNode.Call(uintptr(模板句柄), uintptr(节点位置索引))
return int(r)
}
// 模板_取节点, 获取节点, 根据itemID. 返回itemID对应的节点指针.
//
// pNode: 节点指针.
//
// itemID: ID.
func X模板_取节点(节点指针 int, ID int32) int {
r, _, _ := xTemp_GetNode.Call(uintptr(节点指针), uintptr(ID))
return int(r)
}
// 模板_克隆节点, 克隆一个节点, 返回克隆的节点.
//
// pNode: 节点指针.
func X模板_克隆节点(节点指针 int) int {
r, _, _ := xTemp_CloneNode.Call(uintptr(节点指针))
return int(r)
}
// 项模板_克隆, 复制一份新的项模板, 返回模板句柄.
//
// hTemp: 列表项模板句柄.
func X项模板_克隆(列表项模板句柄 int) int {
r, _, _ := xTemp_Clone.Call(uintptr(列表项模板句柄))
return int(r)
}
// 项模板_列表_插入节点.
//
// hTemp: 列表项模板句柄.
//
// index: 插入位置索引.
//
// pNode: 节点指针.
func X项模板_列表_插入节点(列表项模板句柄 int, 插入位置索引 int32, 节点指针 int) bool {
r, _, _ := xTemp_List_InsertNode.Call(uintptr(列表项模板句柄), uintptr(插入位置索引), uintptr(节点指针))
return r != 0
}
// 项模板_列表_删除节点.
//
// hTemp: 列表项模板句柄.
//
// index: 位置索引.
func X项模板_列表_删除节点(列表项模板句柄 int, 位置索引 int32) bool {
r, _, _ := xTemp_List_DeleteNode.Call(uintptr(列表项模板句柄), uintptr(位置索引))
return r != 0
}
// 项模板_列表_取数量, 取子节点数量, 只当前层子节点.
//
// hTemp: 列表项模板句柄.
func X项模板_列表_取数量(列表项模板句柄 int) int32 {
r, _, _ := xTemp_List_GetCount.Call(uintptr(列表项模板句柄))
return int32(r)
}
// 项模板_列表_移动列, 将指定列移动到目标位置.
//
// hTemp: 列表项模板句柄.
//
// iColSrc: 源列索引.
//
// iColDest: 目标列索引.
func X项模板_列表_移动列(列表项模板句柄 int, 源列索引, 目标列索引 int32) bool {
r, _, _ := xTemp_List_MoveColumn.Call(uintptr(列表项模板句柄), uintptr(源列索引), uintptr(目标列索引))
return r != 0
}