@gtkx/react 0.18.9 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/list.d.ts +35 -0
- package/dist/components/list.d.ts.map +1 -0
- package/dist/components/list.js +40 -0
- package/dist/components/list.js.map +1 -0
- package/dist/generated/internal.d.ts +8 -3
- package/dist/generated/internal.d.ts.map +1 -1
- package/dist/generated/internal.js +3553 -53
- package/dist/generated/internal.js.map +1 -1
- package/dist/generated/jsx.d.ts +178 -326
- package/dist/generated/jsx.d.ts.map +1 -1
- package/dist/generated/jsx.js +0 -324
- package/dist/generated/jsx.js.map +1 -1
- package/dist/host-config.d.ts.map +1 -1
- package/dist/host-config.js +48 -10
- package/dist/host-config.js.map +1 -1
- package/dist/jsx.d.ts +111 -54
- package/dist/jsx.d.ts.map +1 -1
- package/dist/jsx.js +3 -28
- package/dist/jsx.js.map +1 -1
- package/dist/metadata.d.ts +1 -0
- package/dist/metadata.d.ts.map +1 -1
- package/dist/metadata.js +7 -1
- package/dist/metadata.js.map +1 -1
- package/dist/node.d.ts +0 -2
- package/dist/node.d.ts.map +1 -1
- package/dist/node.js +19 -25
- package/dist/node.js.map +1 -1
- package/dist/nodes/application.d.ts.map +1 -1
- package/dist/nodes/application.js +4 -0
- package/dist/nodes/application.js.map +1 -1
- package/dist/nodes/column-view-column.d.ts +19 -16
- package/dist/nodes/column-view-column.d.ts.map +1 -1
- package/dist/nodes/column-view-column.js +129 -97
- package/dist/nodes/column-view-column.js.map +1 -1
- package/dist/nodes/event-controller.d.ts +1 -0
- package/dist/nodes/event-controller.d.ts.map +1 -1
- package/dist/nodes/event-controller.js +9 -7
- package/dist/nodes/event-controller.js.map +1 -1
- package/dist/nodes/fixed-child.d.ts +1 -2
- package/dist/nodes/fixed-child.d.ts.map +1 -1
- package/dist/nodes/fixed-child.js +21 -21
- package/dist/nodes/fixed-child.js.map +1 -1
- package/dist/nodes/font-dialog-button.d.ts +1 -1
- package/dist/nodes/font-dialog-button.d.ts.map +1 -1
- package/dist/nodes/font-dialog-button.js +8 -0
- package/dist/nodes/font-dialog-button.js.map +1 -1
- package/dist/nodes/internal/accessible.d.ts +5 -0
- package/dist/nodes/internal/accessible.d.ts.map +1 -0
- package/dist/nodes/internal/accessible.js +119 -0
- package/dist/nodes/internal/accessible.js.map +1 -0
- package/dist/nodes/internal/bound-item.d.ts +4 -0
- package/dist/nodes/internal/bound-item.d.ts.map +1 -0
- package/dist/nodes/internal/bound-item.js +2 -0
- package/dist/nodes/internal/bound-item.js.map +1 -0
- package/dist/nodes/internal/construct.d.ts +3 -0
- package/dist/nodes/internal/construct.d.ts.map +1 -0
- package/dist/nodes/internal/construct.js +44 -0
- package/dist/nodes/internal/construct.js.map +1 -0
- package/dist/nodes/internal/text-buffer-controller.d.ts +4 -0
- package/dist/nodes/internal/text-buffer-controller.d.ts.map +1 -1
- package/dist/nodes/internal/text-buffer-controller.js +49 -9
- package/dist/nodes/internal/text-buffer-controller.js.map +1 -1
- package/dist/nodes/internal/widget.d.ts.map +1 -1
- package/dist/nodes/internal/widget.js +4 -1
- package/dist/nodes/internal/widget.js.map +1 -1
- package/dist/nodes/list-item-node.d.ts +12 -0
- package/dist/nodes/list-item-node.d.ts.map +1 -0
- package/dist/nodes/list-item-node.js +23 -0
- package/dist/nodes/list-item-node.js.map +1 -0
- package/dist/nodes/list.d.ts +100 -0
- package/dist/nodes/list.d.ts.map +1 -0
- package/dist/nodes/list.js +950 -0
- package/dist/nodes/list.js.map +1 -0
- package/dist/nodes/notebook-page.d.ts.map +1 -1
- package/dist/nodes/notebook-page.js +4 -0
- package/dist/nodes/notebook-page.js.map +1 -1
- package/dist/nodes/shortcut.d.ts +3 -2
- package/dist/nodes/shortcut.d.ts.map +1 -1
- package/dist/nodes/shortcut.js +19 -4
- package/dist/nodes/shortcut.js.map +1 -1
- package/dist/nodes/text-anchor.d.ts.map +1 -1
- package/dist/nodes/text-anchor.js +7 -1
- package/dist/nodes/text-anchor.js.map +1 -1
- package/dist/nodes/text-tag.d.ts.map +1 -1
- package/dist/nodes/text-tag.js +5 -1
- package/dist/nodes/text-tag.js.map +1 -1
- package/dist/nodes/text-view.d.ts +1 -0
- package/dist/nodes/text-view.d.ts.map +1 -1
- package/dist/nodes/text-view.js +4 -0
- package/dist/nodes/text-view.js.map +1 -1
- package/dist/nodes/widget.d.ts +0 -2
- package/dist/nodes/widget.d.ts.map +1 -1
- package/dist/nodes/widget.js +51 -67
- package/dist/nodes/widget.js.map +1 -1
- package/dist/nodes/window.d.ts.map +1 -1
- package/dist/nodes/window.js +2 -2
- package/dist/nodes/window.js.map +1 -1
- package/dist/registry.d.ts +0 -2
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +4 -13
- package/dist/registry.js.map +1 -1
- package/dist/types.d.ts +2 -2
- package/dist/types.d.ts.map +1 -1
- package/package.json +5 -4
- package/src/components/list.tsx +83 -0
- package/src/generated/internal.ts +3559 -49
- package/src/generated/jsx.ts +178 -326
- package/src/host-config.ts +43 -10
- package/src/jsx.ts +121 -62
- package/src/metadata.ts +8 -1
- package/src/node.ts +23 -25
- package/src/nodes/application.ts +5 -0
- package/src/nodes/column-view-column.ts +125 -104
- package/src/nodes/event-controller.ts +8 -8
- package/src/nodes/fixed-child.ts +24 -23
- package/src/nodes/font-dialog-button.ts +10 -0
- package/src/nodes/internal/accessible.ts +155 -0
- package/src/nodes/internal/bound-item.ts +4 -0
- package/src/nodes/internal/construct.ts +60 -0
- package/src/nodes/internal/text-buffer-controller.ts +51 -8
- package/src/nodes/internal/widget.ts +3 -1
- package/src/nodes/list-item-node.ts +29 -0
- package/src/nodes/list.ts +1082 -0
- package/src/nodes/notebook-page.ts +4 -0
- package/src/nodes/shortcut.ts +22 -5
- package/src/nodes/text-anchor.ts +6 -1
- package/src/nodes/text-tag.ts +7 -1
- package/src/nodes/text-view.ts +5 -0
- package/src/nodes/widget.ts +47 -69
- package/src/nodes/window.ts +2 -2
- package/src/registry.ts +11 -17
- package/src/types.ts +7 -2
- package/dist/fiber-root.d.ts +0 -4
- package/dist/fiber-root.d.ts.map +0 -1
- package/dist/fiber-root.js +0 -6
- package/dist/fiber-root.js.map +0 -1
- package/dist/nodes/column-view.d.ts +0 -36
- package/dist/nodes/column-view.d.ts.map +0 -1
- package/dist/nodes/column-view.js +0 -175
- package/dist/nodes/column-view.js.map +0 -1
- package/dist/nodes/drop-down.d.ts +0 -27
- package/dist/nodes/drop-down.d.ts.map +0 -1
- package/dist/nodes/drop-down.js +0 -85
- package/dist/nodes/drop-down.js.map +0 -1
- package/dist/nodes/grid-view.d.ts +0 -29
- package/dist/nodes/grid-view.d.ts.map +0 -1
- package/dist/nodes/grid-view.js +0 -85
- package/dist/nodes/grid-view.js.map +0 -1
- package/dist/nodes/internal/base-item-renderer.d.ts +0 -28
- package/dist/nodes/internal/base-item-renderer.d.ts.map +0 -1
- package/dist/nodes/internal/base-item-renderer.js +0 -86
- package/dist/nodes/internal/base-item-renderer.js.map +0 -1
- package/dist/nodes/internal/grid-item-renderer.d.ts +0 -20
- package/dist/nodes/internal/grid-item-renderer.d.ts.map +0 -1
- package/dist/nodes/internal/grid-item-renderer.js +0 -66
- package/dist/nodes/internal/grid-item-renderer.js.map +0 -1
- package/dist/nodes/internal/list-item-renderer.d.ts +0 -27
- package/dist/nodes/internal/list-item-renderer.d.ts.map +0 -1
- package/dist/nodes/internal/list-item-renderer.js +0 -131
- package/dist/nodes/internal/list-item-renderer.js.map +0 -1
- package/dist/nodes/internal/list-store.d.ts +0 -22
- package/dist/nodes/internal/list-store.d.ts.map +0 -1
- package/dist/nodes/internal/list-store.js +0 -91
- package/dist/nodes/internal/list-store.js.map +0 -1
- package/dist/nodes/internal/selection-model-controller.d.ts +0 -26
- package/dist/nodes/internal/selection-model-controller.d.ts.map +0 -1
- package/dist/nodes/internal/selection-model-controller.js +0 -79
- package/dist/nodes/internal/selection-model-controller.js.map +0 -1
- package/dist/nodes/internal/simple-list-store.d.ts +0 -20
- package/dist/nodes/internal/simple-list-store.d.ts.map +0 -1
- package/dist/nodes/internal/simple-list-store.js +0 -87
- package/dist/nodes/internal/simple-list-store.js.map +0 -1
- package/dist/nodes/internal/tree-store.d.ts +0 -34
- package/dist/nodes/internal/tree-store.d.ts.map +0 -1
- package/dist/nodes/internal/tree-store.js +0 -208
- package/dist/nodes/internal/tree-store.js.map +0 -1
- package/dist/nodes/list-item.d.ts +0 -24
- package/dist/nodes/list-item.d.ts.map +0 -1
- package/dist/nodes/list-item.js +0 -83
- package/dist/nodes/list-item.js.map +0 -1
- package/dist/nodes/list-view.d.ts +0 -29
- package/dist/nodes/list-view.d.ts.map +0 -1
- package/dist/nodes/list-view.js +0 -83
- package/dist/nodes/list-view.js.map +0 -1
- package/dist/nodes/models/grid.d.ts +0 -28
- package/dist/nodes/models/grid.d.ts.map +0 -1
- package/dist/nodes/models/grid.js +0 -69
- package/dist/nodes/models/grid.js.map +0 -1
- package/dist/nodes/models/list.d.ts +0 -31
- package/dist/nodes/models/list.d.ts.map +0 -1
- package/dist/nodes/models/list.js +0 -93
- package/dist/nodes/models/list.js.map +0 -1
- package/dist/nodes/shortcut-controller.d.ts +0 -10
- package/dist/nodes/shortcut-controller.d.ts.map +0 -1
- package/dist/nodes/shortcut-controller.js +0 -23
- package/dist/nodes/shortcut-controller.js.map +0 -1
- package/src/fiber-root.ts +0 -20
- package/src/nodes/column-view.ts +0 -217
- package/src/nodes/drop-down.ts +0 -108
- package/src/nodes/grid-view.ts +0 -109
- package/src/nodes/internal/base-item-renderer.ts +0 -108
- package/src/nodes/internal/grid-item-renderer.ts +0 -78
- package/src/nodes/internal/list-item-renderer.ts +0 -162
- package/src/nodes/internal/list-store.ts +0 -105
- package/src/nodes/internal/selection-model-controller.ts +0 -115
- package/src/nodes/internal/simple-list-store.ts +0 -99
- package/src/nodes/internal/tree-store.ts +0 -237
- package/src/nodes/list-item.ts +0 -107
- package/src/nodes/list-view.ts +0 -113
- package/src/nodes/models/grid.ts +0 -105
- package/src/nodes/models/list.ts +0 -140
- package/src/nodes/shortcut-controller.ts +0 -27
|
@@ -1,237 +0,0 @@
|
|
|
1
|
-
import * as Gtk from "@gtkx/ffi/gtk";
|
|
2
|
-
|
|
3
|
-
type TreeItemUpdatedCallback = (id: string) => void;
|
|
4
|
-
|
|
5
|
-
export type TreeItemData<T = unknown> = {
|
|
6
|
-
value: T;
|
|
7
|
-
indentForDepth?: boolean;
|
|
8
|
-
indentForIcon?: boolean;
|
|
9
|
-
hideExpander?: boolean;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export class TreeStore {
|
|
13
|
-
private rootIds: string[] = [];
|
|
14
|
-
private rootIdToIndex = new Map<string, number>();
|
|
15
|
-
private children = new Map<string, string[]>();
|
|
16
|
-
private childIdToIndex = new Map<string, Map<string, number>>();
|
|
17
|
-
private rootModel = new Gtk.StringList();
|
|
18
|
-
private childModels = new Map<string, Gtk.StringList>();
|
|
19
|
-
private items = new Map<string, TreeItemData>();
|
|
20
|
-
private onItemUpdated: TreeItemUpdatedCallback | null = null;
|
|
21
|
-
private pendingBatch: string[] | null = null;
|
|
22
|
-
|
|
23
|
-
public setOnItemUpdated(callback: TreeItemUpdatedCallback | null): void {
|
|
24
|
-
this.onItemUpdated = callback;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
public beginBatch(): void {
|
|
28
|
-
this.pendingBatch = [];
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
public flushBatch(): void {
|
|
32
|
-
const batch = this.pendingBatch;
|
|
33
|
-
this.pendingBatch = null;
|
|
34
|
-
if (batch && batch.length > 0) {
|
|
35
|
-
this.rootModel.splice(0, 0, batch);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
public updateItem(id: string, item: TreeItemData): void {
|
|
40
|
-
if (this.items.has(id)) {
|
|
41
|
-
this.items.set(id, item);
|
|
42
|
-
this.onItemUpdated?.(id);
|
|
43
|
-
} else {
|
|
44
|
-
this.addItem(id, item);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
public addItem(id: string, data: TreeItemData, parentId?: string): void {
|
|
49
|
-
this.items.set(id, data);
|
|
50
|
-
|
|
51
|
-
if (parentId === undefined) {
|
|
52
|
-
const existingIndex = this.rootIdToIndex.get(id);
|
|
53
|
-
if (existingIndex !== undefined) {
|
|
54
|
-
this.rootModel.remove(existingIndex);
|
|
55
|
-
this.rootIds.splice(existingIndex, 1);
|
|
56
|
-
this.rebuildRootIndices(existingIndex);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
this.rootIdToIndex.set(id, this.rootIds.length);
|
|
60
|
-
this.rootIds.push(id);
|
|
61
|
-
|
|
62
|
-
if (this.pendingBatch) {
|
|
63
|
-
this.pendingBatch.push(id);
|
|
64
|
-
} else {
|
|
65
|
-
this.rootModel.append(id);
|
|
66
|
-
}
|
|
67
|
-
} else {
|
|
68
|
-
let siblings = this.children.get(parentId);
|
|
69
|
-
let indexMap = this.childIdToIndex.get(parentId);
|
|
70
|
-
if (!siblings) {
|
|
71
|
-
siblings = [];
|
|
72
|
-
this.children.set(parentId, siblings);
|
|
73
|
-
}
|
|
74
|
-
if (!indexMap) {
|
|
75
|
-
indexMap = new Map();
|
|
76
|
-
this.childIdToIndex.set(parentId, indexMap);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
const existingIndex = indexMap.get(id);
|
|
80
|
-
if (existingIndex !== undefined) {
|
|
81
|
-
const model = this.childModels.get(parentId);
|
|
82
|
-
if (model) {
|
|
83
|
-
model.remove(existingIndex);
|
|
84
|
-
}
|
|
85
|
-
siblings.splice(existingIndex, 1);
|
|
86
|
-
this.rebuildChildIndices(siblings, indexMap, existingIndex);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
indexMap.set(id, siblings.length);
|
|
90
|
-
siblings.push(id);
|
|
91
|
-
|
|
92
|
-
let model = this.childModels.get(parentId);
|
|
93
|
-
if (!model) {
|
|
94
|
-
model = new Gtk.StringList();
|
|
95
|
-
this.childModels.set(parentId, model);
|
|
96
|
-
}
|
|
97
|
-
model.append(id);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
public removeItem(id: string, parentId?: string): void {
|
|
102
|
-
this.items.delete(id);
|
|
103
|
-
this.children.delete(id);
|
|
104
|
-
this.childIdToIndex.delete(id);
|
|
105
|
-
this.childModels.delete(id);
|
|
106
|
-
|
|
107
|
-
if (parentId === undefined) {
|
|
108
|
-
const index = this.rootIdToIndex.get(id);
|
|
109
|
-
if (index !== undefined) {
|
|
110
|
-
this.rootIds.splice(index, 1);
|
|
111
|
-
this.rootIdToIndex.delete(id);
|
|
112
|
-
this.rebuildRootIndices(index);
|
|
113
|
-
this.rootModel.remove(index);
|
|
114
|
-
}
|
|
115
|
-
} else {
|
|
116
|
-
const siblings = this.children.get(parentId);
|
|
117
|
-
const indexMap = this.childIdToIndex.get(parentId);
|
|
118
|
-
if (siblings && indexMap) {
|
|
119
|
-
const index = indexMap.get(id);
|
|
120
|
-
if (index !== undefined) {
|
|
121
|
-
siblings.splice(index, 1);
|
|
122
|
-
indexMap.delete(id);
|
|
123
|
-
this.rebuildChildIndices(siblings, indexMap, index);
|
|
124
|
-
const model = this.childModels.get(parentId);
|
|
125
|
-
if (model) {
|
|
126
|
-
model.remove(index);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
if (siblings.length === 0) {
|
|
130
|
-
this.children.delete(parentId);
|
|
131
|
-
this.childIdToIndex.delete(parentId);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
public insertItemBefore(id: string, beforeId: string, data: TreeItemData, parentId?: string): void {
|
|
138
|
-
this.items.set(id, data);
|
|
139
|
-
|
|
140
|
-
if (parentId === undefined) {
|
|
141
|
-
const existingIndex = this.rootIdToIndex.get(id);
|
|
142
|
-
if (existingIndex !== undefined) {
|
|
143
|
-
this.rootModel.remove(existingIndex);
|
|
144
|
-
this.rootIds.splice(existingIndex, 1);
|
|
145
|
-
this.rootIdToIndex.delete(id);
|
|
146
|
-
this.rebuildRootIndices(existingIndex);
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
const beforeIndex = this.rootIdToIndex.get(beforeId);
|
|
150
|
-
if (beforeIndex === undefined) {
|
|
151
|
-
this.rootIdToIndex.set(id, this.rootIds.length);
|
|
152
|
-
this.rootIds.push(id);
|
|
153
|
-
this.rootModel.append(id);
|
|
154
|
-
} else {
|
|
155
|
-
this.rootIds.splice(beforeIndex, 0, id);
|
|
156
|
-
this.rebuildRootIndices(beforeIndex);
|
|
157
|
-
this.rootModel.splice(beforeIndex, 0, [id]);
|
|
158
|
-
}
|
|
159
|
-
} else {
|
|
160
|
-
let siblings = this.children.get(parentId);
|
|
161
|
-
let indexMap = this.childIdToIndex.get(parentId);
|
|
162
|
-
if (!siblings) {
|
|
163
|
-
siblings = [];
|
|
164
|
-
this.children.set(parentId, siblings);
|
|
165
|
-
}
|
|
166
|
-
if (!indexMap) {
|
|
167
|
-
indexMap = new Map();
|
|
168
|
-
this.childIdToIndex.set(parentId, indexMap);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
let model = this.childModels.get(parentId);
|
|
172
|
-
if (!model) {
|
|
173
|
-
model = new Gtk.StringList();
|
|
174
|
-
this.childModels.set(parentId, model);
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
const existingIndex = indexMap.get(id);
|
|
178
|
-
if (existingIndex !== undefined) {
|
|
179
|
-
model.remove(existingIndex);
|
|
180
|
-
siblings.splice(existingIndex, 1);
|
|
181
|
-
indexMap.delete(id);
|
|
182
|
-
this.rebuildChildIndices(siblings, indexMap, existingIndex);
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
const beforeIndex = indexMap.get(beforeId);
|
|
186
|
-
if (beforeIndex === undefined) {
|
|
187
|
-
indexMap.set(id, siblings.length);
|
|
188
|
-
siblings.push(id);
|
|
189
|
-
model.append(id);
|
|
190
|
-
} else {
|
|
191
|
-
siblings.splice(beforeIndex, 0, id);
|
|
192
|
-
this.rebuildChildIndices(siblings, indexMap, beforeIndex);
|
|
193
|
-
model.splice(beforeIndex, 0, [id]);
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
public getItem(id: string): TreeItemData | undefined {
|
|
199
|
-
return this.items.get(id);
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
public getRootModel(): Gtk.StringList {
|
|
203
|
-
return this.rootModel;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
public getChildrenModel(parentId: string): Gtk.StringList | null {
|
|
207
|
-
const childIds = this.children.get(parentId);
|
|
208
|
-
if (!childIds || childIds.length === 0) {
|
|
209
|
-
return null;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
let model = this.childModels.get(parentId);
|
|
213
|
-
if (!model) {
|
|
214
|
-
model = new Gtk.StringList(childIds);
|
|
215
|
-
this.childModels.set(parentId, model);
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
return model;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
public hasChildren(parentId: string): boolean {
|
|
222
|
-
const childIds = this.children.get(parentId);
|
|
223
|
-
return childIds !== undefined && childIds.length > 0;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
private rebuildRootIndices(fromIndex: number): void {
|
|
227
|
-
for (let i = fromIndex; i < this.rootIds.length; i++) {
|
|
228
|
-
this.rootIdToIndex.set(this.rootIds[i] as string, i);
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
private rebuildChildIndices(siblings: string[], indexMap: Map<string, number>, fromIndex: number): void {
|
|
233
|
-
for (let i = fromIndex; i < siblings.length; i++) {
|
|
234
|
-
indexMap.set(siblings[i] as string, i);
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
}
|
package/src/nodes/list-item.ts
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import type { ListItemProps } from "../jsx.js";
|
|
2
|
-
import type { Node } from "../node.js";
|
|
3
|
-
import { hasChanged } from "./internal/props.js";
|
|
4
|
-
import { type TreeItemData, TreeStore } from "./internal/tree-store.js";
|
|
5
|
-
import { VirtualNode } from "./virtual.js";
|
|
6
|
-
|
|
7
|
-
type ItemStore = { updateItem(id: string, value: unknown): void };
|
|
8
|
-
|
|
9
|
-
export class ListItemNode extends VirtualNode<ListItemProps, Node, ListItemNode> {
|
|
10
|
-
private store: ItemStore | null = null;
|
|
11
|
-
private parentItemId: string | null = null;
|
|
12
|
-
|
|
13
|
-
public static createItemData(props: ListItemProps): TreeItemData {
|
|
14
|
-
return {
|
|
15
|
-
value: props.value,
|
|
16
|
-
indentForDepth: props.indentForDepth,
|
|
17
|
-
indentForIcon: props.indentForIcon,
|
|
18
|
-
hideExpander: props.hideExpander,
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
public override isValidChild(child: Node): boolean {
|
|
23
|
-
return child instanceof ListItemNode;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
public override appendChild(child: ListItemNode): void {
|
|
27
|
-
super.appendChild(child);
|
|
28
|
-
child.setParentItemId(this.props.id);
|
|
29
|
-
|
|
30
|
-
if (this.store instanceof TreeStore) {
|
|
31
|
-
this.store.addItem(child.props.id, ListItemNode.createItemData(child.props), this.props.id);
|
|
32
|
-
child.setStore(this.store);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
public override insertBefore(child: ListItemNode, before: ListItemNode): void {
|
|
37
|
-
super.insertBefore(child, before);
|
|
38
|
-
child.setParentItemId(this.props.id);
|
|
39
|
-
|
|
40
|
-
if (this.store instanceof TreeStore) {
|
|
41
|
-
this.store.insertItemBefore(
|
|
42
|
-
child.props.id,
|
|
43
|
-
before.props.id,
|
|
44
|
-
ListItemNode.createItemData(child.props),
|
|
45
|
-
this.props.id,
|
|
46
|
-
);
|
|
47
|
-
child.setStore(this.store);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
public override removeChild(child: ListItemNode): void {
|
|
52
|
-
if (this.store instanceof TreeStore) {
|
|
53
|
-
this.store.removeItem(child.props.id, this.props.id);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
child.setStore(null);
|
|
57
|
-
child.setParentItemId(null);
|
|
58
|
-
super.removeChild(child);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
public override commitUpdate(oldProps: ListItemProps | null, newProps: ListItemProps): void {
|
|
62
|
-
super.commitUpdate(oldProps, newProps);
|
|
63
|
-
this.applyOwnProps(oldProps, newProps);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
private applyOwnProps(oldProps: ListItemProps | null, newProps: ListItemProps): void {
|
|
67
|
-
if (!this.store) return;
|
|
68
|
-
|
|
69
|
-
if (this.store instanceof TreeStore) {
|
|
70
|
-
const propsChanged =
|
|
71
|
-
hasChanged(oldProps, newProps, "id") ||
|
|
72
|
-
hasChanged(oldProps, newProps, "value") ||
|
|
73
|
-
hasChanged(oldProps, newProps, "indentForDepth") ||
|
|
74
|
-
hasChanged(oldProps, newProps, "indentForIcon") ||
|
|
75
|
-
hasChanged(oldProps, newProps, "hideExpander");
|
|
76
|
-
|
|
77
|
-
if (propsChanged) {
|
|
78
|
-
this.store.updateItem(newProps.id, ListItemNode.createItemData(newProps));
|
|
79
|
-
}
|
|
80
|
-
} else {
|
|
81
|
-
if (hasChanged(oldProps, newProps, "id") || hasChanged(oldProps, newProps, "value")) {
|
|
82
|
-
this.store.updateItem(newProps.id, newProps.value);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
public setStore(store: ItemStore | null): void {
|
|
88
|
-
this.store = store;
|
|
89
|
-
if (store === null || store instanceof TreeStore) {
|
|
90
|
-
for (const child of this.children) {
|
|
91
|
-
child.setStore(store);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
public getChildNodes(): readonly ListItemNode[] {
|
|
97
|
-
return this.children;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
public setParentItemId(parentId: string | null): void {
|
|
101
|
-
this.parentItemId = parentId;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
public getParentItemId(): string | null {
|
|
105
|
-
return this.parentItemId;
|
|
106
|
-
}
|
|
107
|
-
}
|
package/src/nodes/list-view.ts
DELETED
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import type * as Gtk from "@gtkx/ffi/gtk";
|
|
2
|
-
import type { GtkListViewProps } from "../jsx.js";
|
|
3
|
-
import type { Node } from "../node.js";
|
|
4
|
-
import type { Container } from "../types.js";
|
|
5
|
-
import { ContainerSlotNode } from "./container-slot.js";
|
|
6
|
-
import { EventControllerNode } from "./event-controller.js";
|
|
7
|
-
import { ListItemRenderer } from "./internal/list-item-renderer.js";
|
|
8
|
-
import { filterProps, hasChanged } from "./internal/props.js";
|
|
9
|
-
import { ListItemNode } from "./list-item.js";
|
|
10
|
-
import { ListModel, type ListModelProps } from "./models/list.js";
|
|
11
|
-
import { SlotNode } from "./slot.js";
|
|
12
|
-
import { WidgetNode } from "./widget.js";
|
|
13
|
-
|
|
14
|
-
const RENDERER_PROPS = ["renderItem", "estimatedItemHeight"] as const;
|
|
15
|
-
const OWN_PROPS = [...RENDERER_PROPS, "autoexpand", "selectionMode", "selected", "onSelectionChanged"] as const;
|
|
16
|
-
|
|
17
|
-
type ListViewProps = Pick<GtkListViewProps, (typeof RENDERER_PROPS)[number]> & ListModelProps;
|
|
18
|
-
|
|
19
|
-
type ListViewChild = ListItemNode | EventControllerNode | SlotNode | ContainerSlotNode;
|
|
20
|
-
|
|
21
|
-
export class ListViewNode extends WidgetNode<Gtk.ListView, ListViewProps, ListViewChild> {
|
|
22
|
-
private itemRenderer: ListItemRenderer;
|
|
23
|
-
private list: ListModel;
|
|
24
|
-
|
|
25
|
-
public override isValidChild(child: Node): boolean {
|
|
26
|
-
return (
|
|
27
|
-
child instanceof ListItemNode ||
|
|
28
|
-
child instanceof EventControllerNode ||
|
|
29
|
-
child instanceof SlotNode ||
|
|
30
|
-
child instanceof ContainerSlotNode
|
|
31
|
-
);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
constructor(typeName: string, props: ListViewProps, container: Gtk.ListView, rootContainer: Container) {
|
|
35
|
-
super(typeName, props, container, rootContainer);
|
|
36
|
-
this.list = new ListModel(
|
|
37
|
-
{ owner: this, signalStore: this.signalStore },
|
|
38
|
-
{
|
|
39
|
-
autoexpand: props.autoexpand,
|
|
40
|
-
selectionMode: props.selectionMode,
|
|
41
|
-
selected: props.selected,
|
|
42
|
-
onSelectionChanged: props.onSelectionChanged,
|
|
43
|
-
},
|
|
44
|
-
);
|
|
45
|
-
this.itemRenderer = new ListItemRenderer(this.signalStore);
|
|
46
|
-
this.itemRenderer.setStore(this.list.getStore());
|
|
47
|
-
this.list.getStore().setOnItemUpdated((id) => this.itemRenderer.rebindItem(id));
|
|
48
|
-
this.container.setFactory(this.itemRenderer.getFactory());
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
public override appendChild(child: ListViewChild): void {
|
|
52
|
-
super.appendChild(child);
|
|
53
|
-
if (child instanceof ListItemNode) {
|
|
54
|
-
this.list.appendChild(child);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
public override insertBefore(child: ListViewChild, before: ListViewChild): void {
|
|
59
|
-
super.insertBefore(child, before);
|
|
60
|
-
if (child instanceof ListItemNode && before instanceof ListItemNode) {
|
|
61
|
-
this.list.insertBefore(child, before);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
public override removeChild(child: ListViewChild): void {
|
|
66
|
-
if (child instanceof ListItemNode) {
|
|
67
|
-
this.list.removeChild(child);
|
|
68
|
-
}
|
|
69
|
-
super.removeChild(child);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
public override finalizeInitialChildren(props: ListViewProps): boolean {
|
|
73
|
-
super.finalizeInitialChildren(props);
|
|
74
|
-
return true;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
public override commitUpdate(oldProps: ListViewProps | null, newProps: ListViewProps): void {
|
|
78
|
-
super.commitUpdate(oldProps ? filterProps(oldProps, OWN_PROPS) : null, filterProps(newProps, OWN_PROPS));
|
|
79
|
-
this.applyOwnProps(oldProps, newProps);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
public override commitMount(): void {
|
|
83
|
-
super.commitMount();
|
|
84
|
-
this.list.flushBatch();
|
|
85
|
-
this.container.setModel(this.list.getSelectionModel());
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
public override detachDeletedInstance(): void {
|
|
89
|
-
this.itemRenderer.dispose();
|
|
90
|
-
super.detachDeletedInstance();
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
private applyOwnProps(oldProps: ListViewProps | null, newProps: ListViewProps): void {
|
|
94
|
-
if (hasChanged(oldProps, newProps, "renderItem")) {
|
|
95
|
-
this.itemRenderer.setRenderFn(newProps.renderItem ?? null);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
if (hasChanged(oldProps, newProps, "estimatedItemHeight")) {
|
|
99
|
-
this.itemRenderer.setEstimatedItemHeight(newProps.estimatedItemHeight ?? null);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
const previousModel = this.list.getSelectionModel();
|
|
103
|
-
this.list.updateProps(
|
|
104
|
-
oldProps ? filterProps(oldProps, RENDERER_PROPS) : null,
|
|
105
|
-
filterProps(newProps, RENDERER_PROPS),
|
|
106
|
-
);
|
|
107
|
-
const currentModel = this.list.getSelectionModel();
|
|
108
|
-
|
|
109
|
-
if (previousModel !== currentModel) {
|
|
110
|
-
this.container.setModel(currentModel);
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
package/src/nodes/models/grid.ts
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import * as Gtk from "@gtkx/ffi/gtk";
|
|
2
|
-
import type { GtkGridViewProps } from "../../jsx.js";
|
|
3
|
-
import { ListStore } from "../internal/list-store.js";
|
|
4
|
-
import { SelectionModelController } from "../internal/selection-model-controller.js";
|
|
5
|
-
import type { SignalStore } from "../internal/signal-store.js";
|
|
6
|
-
import type { ListItemNode } from "../list-item.js";
|
|
7
|
-
|
|
8
|
-
export type GridModelProps = Pick<GtkGridViewProps, "selectionMode" | "selected" | "onSelectionChanged">;
|
|
9
|
-
|
|
10
|
-
type GridModelConfig = {
|
|
11
|
-
owner: object;
|
|
12
|
-
signalStore: SignalStore;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export class GridModel {
|
|
16
|
-
private config: GridModelConfig;
|
|
17
|
-
private store: ListStore;
|
|
18
|
-
private selectionManager: SelectionModelController;
|
|
19
|
-
|
|
20
|
-
private initialSelected: string[] | null | undefined;
|
|
21
|
-
|
|
22
|
-
constructor(config: GridModelConfig, props: GridModelProps = {}) {
|
|
23
|
-
this.config = config;
|
|
24
|
-
this.store = new ListStore();
|
|
25
|
-
this.store.beginBatch();
|
|
26
|
-
this.initialSelected = props.selected;
|
|
27
|
-
this.selectionManager = new SelectionModelController(
|
|
28
|
-
{ ...config, ...props },
|
|
29
|
-
this.store.getModel(),
|
|
30
|
-
() => this.getSelection(),
|
|
31
|
-
(ids) => this.resolveSelectionIndices(ids),
|
|
32
|
-
() => this.store.getModel().getNItems(),
|
|
33
|
-
);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
public flushBatch(): void {
|
|
37
|
-
this.store.flushBatch();
|
|
38
|
-
this.selectionManager.reapplySelection(this.initialSelected);
|
|
39
|
-
this.initialSelected = undefined;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
public getStore(): ListStore {
|
|
43
|
-
return this.store;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
public getSelectionModel(): Gtk.NoSelection | Gtk.SingleSelection | Gtk.MultiSelection {
|
|
47
|
-
return this.selectionManager.getSelectionModel();
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
public appendChild(child: ListItemNode): void {
|
|
51
|
-
child.setStore(this.store);
|
|
52
|
-
this.store.addItem(child.props.id, child.props.value);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
public insertBefore(child: ListItemNode, before: ListItemNode): void {
|
|
56
|
-
child.setStore(this.store);
|
|
57
|
-
this.store.insertItemBefore(child.props.id, before.props.id, child.props.value);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
public removeChild(child: ListItemNode): void {
|
|
61
|
-
this.store.removeItem(child.props.id);
|
|
62
|
-
child.setStore(null);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
public updateProps(oldProps: GridModelProps | null, newProps: GridModelProps): void {
|
|
66
|
-
this.selectionManager.update(
|
|
67
|
-
oldProps ? { ...this.config, ...oldProps } : null,
|
|
68
|
-
{ ...this.config, ...newProps },
|
|
69
|
-
this.store.getModel(),
|
|
70
|
-
);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
private getSelection(): string[] {
|
|
74
|
-
const model = this.store.getModel();
|
|
75
|
-
const selection = this.selectionManager.getSelectionModel().getSelection();
|
|
76
|
-
const size = selection.getSize();
|
|
77
|
-
const ids: string[] = [];
|
|
78
|
-
|
|
79
|
-
for (let i = 0; i < size; i++) {
|
|
80
|
-
const index = selection.getNth(i);
|
|
81
|
-
const id = model.getString(index);
|
|
82
|
-
|
|
83
|
-
if (id !== null) {
|
|
84
|
-
ids.push(id);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
return ids;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
private resolveSelectionIndices(ids: string[]): Gtk.Bitset {
|
|
92
|
-
const model = this.store.getModel();
|
|
93
|
-
const nItems = model.getNItems();
|
|
94
|
-
const selected = new Gtk.Bitset();
|
|
95
|
-
|
|
96
|
-
for (const id of ids) {
|
|
97
|
-
const index = model.find(id);
|
|
98
|
-
if (index < nItems) {
|
|
99
|
-
selected.add(index);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
return selected;
|
|
104
|
-
}
|
|
105
|
-
}
|
package/src/nodes/models/list.ts
DELETED
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
import type * as Gio from "@gtkx/ffi/gio";
|
|
2
|
-
import type * as GObject from "@gtkx/ffi/gobject";
|
|
3
|
-
import * as Gtk from "@gtkx/ffi/gtk";
|
|
4
|
-
import type { GtkListViewProps } from "../../jsx.js";
|
|
5
|
-
import { SelectionModelController } from "../internal/selection-model-controller.js";
|
|
6
|
-
import type { SignalStore } from "../internal/signal-store.js";
|
|
7
|
-
import { TreeStore } from "../internal/tree-store.js";
|
|
8
|
-
import { ListItemNode } from "../list-item.js";
|
|
9
|
-
|
|
10
|
-
export type ListModelProps = Pick<GtkListViewProps, "autoexpand" | "selectionMode" | "selected" | "onSelectionChanged">;
|
|
11
|
-
|
|
12
|
-
type ListModelConfig = {
|
|
13
|
-
owner: object;
|
|
14
|
-
signalStore: SignalStore;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export class ListModel {
|
|
18
|
-
private config: ListModelConfig;
|
|
19
|
-
private store: TreeStore;
|
|
20
|
-
private treeListModel: Gtk.TreeListModel;
|
|
21
|
-
private selectionManager: SelectionModelController;
|
|
22
|
-
|
|
23
|
-
private initialSelected: string[] | null | undefined;
|
|
24
|
-
|
|
25
|
-
constructor(config: ListModelConfig, props: ListModelProps = {}) {
|
|
26
|
-
this.config = config;
|
|
27
|
-
this.store = new TreeStore();
|
|
28
|
-
this.store.beginBatch();
|
|
29
|
-
this.initialSelected = props.selected;
|
|
30
|
-
|
|
31
|
-
this.treeListModel = new Gtk.TreeListModel(
|
|
32
|
-
this.store.getRootModel(),
|
|
33
|
-
false,
|
|
34
|
-
props.autoexpand ?? false,
|
|
35
|
-
(item: GObject.Object) => this.createChildModel(item),
|
|
36
|
-
);
|
|
37
|
-
|
|
38
|
-
this.selectionManager = new SelectionModelController(
|
|
39
|
-
{ ...config, ...props },
|
|
40
|
-
this.treeListModel,
|
|
41
|
-
() => this.getSelection(),
|
|
42
|
-
(ids) => this.resolveSelectionIndices(ids),
|
|
43
|
-
() => this.treeListModel.getNItems(),
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
public flushBatch(): void {
|
|
48
|
-
this.store.flushBatch();
|
|
49
|
-
this.selectionManager.reapplySelection(this.initialSelected);
|
|
50
|
-
this.initialSelected = undefined;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
private createChildModel(item: GObject.Object): Gio.ListModel | null {
|
|
54
|
-
if (!(item instanceof Gtk.StringObject)) return null;
|
|
55
|
-
const parentId = item.getString();
|
|
56
|
-
return this.store.getChildrenModel(parentId);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
public getStore(): TreeStore {
|
|
60
|
-
return this.store;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
public getSelectionModel(): Gtk.NoSelection | Gtk.SingleSelection | Gtk.MultiSelection {
|
|
64
|
-
return this.selectionManager.getSelectionModel();
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
public appendChild(child: ListItemNode): void {
|
|
68
|
-
child.setStore(this.store);
|
|
69
|
-
this.addItemWithChildren(child);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
private addItemWithChildren(node: ListItemNode, parentId?: string): void {
|
|
73
|
-
const id = node.props.id;
|
|
74
|
-
|
|
75
|
-
for (const child of node.getChildNodes()) {
|
|
76
|
-
this.addItemWithChildren(child, id);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
this.store.addItem(id, ListItemNode.createItemData(node.props), parentId);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
public insertBefore(child: ListItemNode, before: ListItemNode): void {
|
|
83
|
-
child.setStore(this.store);
|
|
84
|
-
this.store.insertItemBefore(child.props.id, before.props.id, ListItemNode.createItemData(child.props));
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
public removeChild(child: ListItemNode): void {
|
|
88
|
-
this.store.removeItem(child.props.id);
|
|
89
|
-
child.setStore(null);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
public updateProps(oldProps: ListModelProps | null, newProps: ListModelProps): void {
|
|
93
|
-
if (!oldProps || oldProps.autoexpand !== newProps.autoexpand) {
|
|
94
|
-
this.treeListModel.setAutoexpand(newProps.autoexpand ?? false);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
this.selectionManager.update(
|
|
98
|
-
oldProps ? { ...this.config, ...oldProps } : null,
|
|
99
|
-
{ ...this.config, ...newProps },
|
|
100
|
-
this.treeListModel,
|
|
101
|
-
);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
private getSelection(): string[] {
|
|
105
|
-
const selection = this.selectionManager.getSelectionModel().getSelection();
|
|
106
|
-
const size = selection.getSize();
|
|
107
|
-
const ids: string[] = [];
|
|
108
|
-
|
|
109
|
-
for (let i = 0; i < size; i++) {
|
|
110
|
-
const index = selection.getNth(i);
|
|
111
|
-
const row = this.treeListModel.getRow(index);
|
|
112
|
-
if (!row) continue;
|
|
113
|
-
|
|
114
|
-
const item = row.getItem();
|
|
115
|
-
if (item instanceof Gtk.StringObject) {
|
|
116
|
-
ids.push(item.getString());
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
return ids;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
private resolveSelectionIndices(ids: string[]): Gtk.Bitset {
|
|
124
|
-
const nItems = this.treeListModel.getNItems();
|
|
125
|
-
const selected = new Gtk.Bitset();
|
|
126
|
-
const idSet = new Set(ids);
|
|
127
|
-
|
|
128
|
-
for (let i = 0; i < nItems; i++) {
|
|
129
|
-
const row = this.treeListModel.getRow(i);
|
|
130
|
-
if (!row) continue;
|
|
131
|
-
|
|
132
|
-
const item = row.getItem();
|
|
133
|
-
if (item instanceof Gtk.StringObject && idSet.has(item.getString())) {
|
|
134
|
-
selected.add(i);
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
return selected;
|
|
139
|
-
}
|
|
140
|
-
}
|