@gtkx/react 0.2.7 → 0.3.1

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.
@@ -71,7 +71,7 @@ export class ColumnViewNode extends Node {
71
71
  const baseSorter = this.widget.getSorter();
72
72
  if (!baseSorter)
73
73
  return;
74
- const sorter = getObject(baseSorter.ptr, Gtk.ColumnViewSorter);
74
+ const sorter = getObject(baseSorter.id);
75
75
  const column = sorter.getPrimarySortColumn();
76
76
  const order = sorter.getPrimarySortOrder();
77
77
  const columnId = column?.getId() ?? null;
@@ -244,8 +244,8 @@ export class ColumnViewColumnNode extends Node {
244
244
  column.setFixedWidth(props.fixedWidth);
245
245
  }
246
246
  factory.connect("setup", (_self, listItemObj) => {
247
- const listItem = getObject(listItemObj.ptr, Gtk.ListItem);
248
- const id = getObjectId(listItemObj.ptr);
247
+ const listItem = getObject(listItemObj.id);
248
+ const id = getObjectId(listItemObj.id);
249
249
  const box = new Gtk.Box(Gtk.Orientation.VERTICAL, 0);
250
250
  listItem.setChild(box);
251
251
  const fiberRoot = createFiberRoot(box);
@@ -254,8 +254,8 @@ export class ColumnViewColumnNode extends Node {
254
254
  reconciler.getInstance().updateContainer(element, fiberRoot, null, () => { });
255
255
  });
256
256
  factory.connect("bind", (_self, listItemObj) => {
257
- const listItem = getObject(listItemObj.ptr, Gtk.ListItem);
258
- const id = getObjectId(listItemObj.ptr);
257
+ const listItem = getObject(listItemObj.id);
258
+ const id = getObjectId(listItemObj.id);
259
259
  const info = this.state.listItemCache.get(id);
260
260
  if (!info)
261
261
  return;
@@ -268,14 +268,14 @@ export class ColumnViewColumnNode extends Node {
268
268
  }
269
269
  });
270
270
  factory.connect("unbind", (_self, listItemObj) => {
271
- const id = getObjectId(listItemObj.ptr);
271
+ const id = getObjectId(listItemObj.id);
272
272
  const info = this.state.listItemCache.get(id);
273
273
  if (!info)
274
274
  return;
275
275
  reconciler.getInstance().updateContainer(null, info.fiberRoot, null, () => { });
276
276
  });
277
277
  factory.connect("teardown", (_self, listItemObj) => {
278
- const id = getObjectId(listItemObj.ptr);
278
+ const id = getObjectId(listItemObj.id);
279
279
  const info = this.state.listItemCache.get(id);
280
280
  if (info) {
281
281
  reconciler.getInstance().updateContainer(null, info.fiberRoot, null, () => { });
@@ -309,8 +309,8 @@ export class ColumnViewColumnNode extends Node {
309
309
  const columnView = this.columnView;
310
310
  const wrappedSortFn = (stringObjPtrA, stringObjPtrB) => {
311
311
  const items = columnView.getItems();
312
- const stringObjA = getObject(stringObjPtrA, Gtk.StringObject);
313
- const stringObjB = getObject(stringObjPtrB, Gtk.StringObject);
312
+ const stringObjA = getObject(stringObjPtrA);
313
+ const stringObjB = getObject(stringObjPtrB);
314
314
  const indexA = Number.parseInt(stringObjA.getString(), 10);
315
315
  const indexB = Number.parseInt(stringObjB.getString(), 10);
316
316
  if (Number.isNaN(indexA) || Number.isNaN(indexB))
@@ -28,8 +28,8 @@ export class ListViewNode extends Node {
28
28
  this.state.selectionModel = selectionModel;
29
29
  this.state.factory = factory;
30
30
  factory.connect("setup", (_self, listItemObj) => {
31
- const listItem = getObject(listItemObj.ptr, Gtk.ListItem);
32
- const id = getObjectId(listItemObj.ptr);
31
+ const listItem = getObject(listItemObj.id);
32
+ const id = getObjectId(listItemObj.id);
33
33
  const box = new Gtk.Box(Gtk.Orientation.VERTICAL, 0);
34
34
  listItem.setChild(box);
35
35
  const fiberRoot = createFiberRoot(box);
@@ -38,8 +38,8 @@ export class ListViewNode extends Node {
38
38
  reconciler.getInstance().updateContainer(element, fiberRoot, null, () => { });
39
39
  });
40
40
  factory.connect("bind", (_self, listItemObj) => {
41
- const listItem = getObject(listItemObj.ptr, Gtk.ListItem);
42
- const id = getObjectId(listItemObj.ptr);
41
+ const listItem = getObject(listItemObj.id);
42
+ const id = getObjectId(listItemObj.id);
43
43
  const info = this.state.listItemCache.get(id);
44
44
  if (!info)
45
45
  return;
@@ -49,14 +49,14 @@ export class ListViewNode extends Node {
49
49
  reconciler.getInstance().updateContainer(element, info.fiberRoot, null, () => { });
50
50
  });
51
51
  factory.connect("unbind", (_self, listItemObj) => {
52
- const id = getObjectId(listItemObj.ptr);
52
+ const id = getObjectId(listItemObj.id);
53
53
  const info = this.state.listItemCache.get(id);
54
54
  if (!info)
55
55
  return;
56
56
  reconciler.getInstance().updateContainer(null, info.fiberRoot, null, () => { });
57
57
  });
58
58
  factory.connect("teardown", (_self, listItemObj) => {
59
- const id = getObjectId(listItemObj.ptr);
59
+ const id = getObjectId(listItemObj.id);
60
60
  const info = this.state.listItemCache.get(id);
61
61
  if (info) {
62
62
  reconciler.getInstance().updateContainer(null, info.fiberRoot, null, () => { });
@@ -33,7 +33,7 @@ export class SlotNode extends Node {
33
33
  const setterName = `set${this.slotName}`;
34
34
  const setter = parentWidget[setterName];
35
35
  if (typeof setter === "function") {
36
- setter.call(parentWidget, childWidget?.ptr ?? null);
36
+ setter.call(parentWidget, childWidget?.id ?? null);
37
37
  }
38
38
  }
39
39
  appendChild(child) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gtkx/react",
3
- "version": "0.2.7",
3
+ "version": "0.3.1",
4
4
  "description": "Build GTK4 desktop applications with React and TypeScript",
5
5
  "keywords": [
6
6
  "gtk",
@@ -36,10 +36,10 @@
36
36
  ],
37
37
  "dependencies": {
38
38
  "react-reconciler": "0.33.0",
39
- "@gtkx/ffi": "0.2.7"
39
+ "@gtkx/ffi": "0.3.1"
40
40
  },
41
41
  "devDependencies": {
42
- "@gtkx/gir": "0.2.7"
42
+ "@gtkx/gir": "0.3.1"
43
43
  },
44
44
  "peerDependencies": {
45
45
  "react": "^19"