@gtkx/react 0.19.0 → 0.21.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.
Files changed (289) hide show
  1. package/README.md +26 -62
  2. package/dist/components/compound.d.ts +40 -0
  3. package/dist/components/compound.d.ts.map +1 -0
  4. package/dist/components/compound.js +46 -0
  5. package/dist/components/compound.js.map +1 -0
  6. package/dist/components/list.d.ts +75 -0
  7. package/dist/components/list.d.ts.map +1 -0
  8. package/dist/components/list.js +81 -0
  9. package/dist/components/list.js.map +1 -0
  10. package/dist/components/slot-widget.d.ts +15 -0
  11. package/dist/components/slot-widget.d.ts.map +1 -0
  12. package/dist/components/slot-widget.js +37 -0
  13. package/dist/components/slot-widget.js.map +1 -0
  14. package/dist/errors.d.ts +6 -0
  15. package/dist/errors.d.ts.map +1 -1
  16. package/dist/errors.js +8 -6
  17. package/dist/errors.js.map +1 -1
  18. package/dist/generated/compounds.d.ts +2672 -0
  19. package/dist/generated/compounds.d.ts.map +1 -0
  20. package/dist/generated/compounds.js +2624 -0
  21. package/dist/generated/compounds.js.map +1 -0
  22. package/dist/generated/internal.d.ts +6 -7
  23. package/dist/generated/internal.d.ts.map +1 -1
  24. package/dist/generated/internal.js +3054 -1838
  25. package/dist/generated/internal.js.map +1 -1
  26. package/dist/generated/jsx.d.ts +2096 -4970
  27. package/dist/generated/jsx.d.ts.map +1 -1
  28. package/dist/generated/jsx.js +979 -3862
  29. package/dist/generated/jsx.js.map +1 -1
  30. package/dist/generated/registry.d.ts +1 -0
  31. package/dist/generated/registry.d.ts.map +1 -1
  32. package/dist/generated/registry.js +0 -1
  33. package/dist/generated/registry.js.map +1 -1
  34. package/dist/host-config.d.ts.map +1 -1
  35. package/dist/host-config.js +2 -0
  36. package/dist/host-config.js.map +1 -1
  37. package/dist/index.d.ts +2 -0
  38. package/dist/index.d.ts.map +1 -1
  39. package/dist/index.js +2 -0
  40. package/dist/index.js.map +1 -1
  41. package/dist/jsx.d.ts +157 -518
  42. package/dist/jsx.d.ts.map +1 -1
  43. package/dist/jsx.js +6 -393
  44. package/dist/jsx.js.map +1 -1
  45. package/dist/metadata.d.ts +1 -1
  46. package/dist/metadata.d.ts.map +1 -1
  47. package/dist/metadata.js +7 -3
  48. package/dist/metadata.js.map +1 -1
  49. package/dist/node.d.ts +0 -4
  50. package/dist/node.d.ts.map +1 -1
  51. package/dist/node.js +19 -41
  52. package/dist/node.js.map +1 -1
  53. package/dist/nodes/alert-dialog.d.ts +14 -0
  54. package/dist/nodes/alert-dialog.d.ts.map +1 -0
  55. package/dist/nodes/alert-dialog.js +41 -0
  56. package/dist/nodes/alert-dialog.js.map +1 -0
  57. package/dist/nodes/animation.d.ts +5 -4
  58. package/dist/nodes/animation.d.ts.map +1 -1
  59. package/dist/nodes/animation.js +65 -49
  60. package/dist/nodes/animation.js.map +1 -1
  61. package/dist/nodes/application.d.ts.map +1 -1
  62. package/dist/nodes/application.js +4 -0
  63. package/dist/nodes/application.js.map +1 -1
  64. package/dist/nodes/column-view-column.d.ts +19 -19
  65. package/dist/nodes/column-view-column.d.ts.map +1 -1
  66. package/dist/nodes/column-view-column.js +130 -119
  67. package/dist/nodes/column-view-column.js.map +1 -1
  68. package/dist/nodes/container-slot.d.ts +3 -1
  69. package/dist/nodes/container-slot.d.ts.map +1 -1
  70. package/dist/nodes/container-slot.js +28 -16
  71. package/dist/nodes/container-slot.js.map +1 -1
  72. package/dist/nodes/drawing-area.d.ts +3 -1
  73. package/dist/nodes/drawing-area.d.ts.map +1 -1
  74. package/dist/nodes/drawing-area.js +20 -22
  75. package/dist/nodes/drawing-area.js.map +1 -1
  76. package/dist/nodes/event-controller.d.ts.map +1 -1
  77. package/dist/nodes/event-controller.js +6 -16
  78. package/dist/nodes/event-controller.js.map +1 -1
  79. package/dist/nodes/fixed-child.d.ts +1 -0
  80. package/dist/nodes/fixed-child.d.ts.map +1 -1
  81. package/dist/nodes/fixed-child.js +13 -0
  82. package/dist/nodes/fixed-child.js.map +1 -1
  83. package/dist/nodes/grid-child.d.ts +1 -0
  84. package/dist/nodes/grid-child.d.ts.map +1 -1
  85. package/dist/nodes/grid-child.js +13 -0
  86. package/dist/nodes/grid-child.js.map +1 -1
  87. package/dist/nodes/internal/accessible.d.ts.map +1 -1
  88. package/dist/nodes/internal/accessible.js.map +1 -1
  89. package/dist/nodes/internal/bound-item.d.ts +4 -0
  90. package/dist/nodes/internal/bound-item.d.ts.map +1 -0
  91. package/dist/nodes/internal/bound-item.js +2 -0
  92. package/dist/nodes/internal/bound-item.js.map +1 -0
  93. package/dist/nodes/internal/construct.d.ts +1 -8
  94. package/dist/nodes/internal/construct.d.ts.map +1 -1
  95. package/dist/nodes/internal/construct.js +30 -54
  96. package/dist/nodes/internal/construct.js.map +1 -1
  97. package/dist/nodes/internal/widget.d.ts.map +1 -1
  98. package/dist/nodes/internal/widget.js +9 -10
  99. package/dist/nodes/internal/widget.js.map +1 -1
  100. package/dist/nodes/list-item-node.d.ts +12 -0
  101. package/dist/nodes/list-item-node.d.ts.map +1 -0
  102. package/dist/nodes/list-item-node.js +45 -0
  103. package/dist/nodes/list-item-node.js.map +1 -0
  104. package/dist/nodes/list.d.ts +100 -0
  105. package/dist/nodes/list.d.ts.map +1 -0
  106. package/dist/nodes/list.js +950 -0
  107. package/dist/nodes/list.js.map +1 -0
  108. package/dist/nodes/notebook-page.d.ts.map +1 -1
  109. package/dist/nodes/notebook-page.js +6 -2
  110. package/dist/nodes/notebook-page.js.map +1 -1
  111. package/dist/nodes/overlay-child.d.ts +2 -0
  112. package/dist/nodes/overlay-child.d.ts.map +1 -1
  113. package/dist/nodes/overlay-child.js +29 -8
  114. package/dist/nodes/overlay-child.js.map +1 -1
  115. package/dist/nodes/spin-row.d.ts +14 -0
  116. package/dist/nodes/spin-row.d.ts.map +1 -0
  117. package/dist/nodes/spin-row.js +46 -0
  118. package/dist/nodes/spin-row.js.map +1 -0
  119. package/dist/nodes/switch-row.d.ts +11 -0
  120. package/dist/nodes/switch-row.d.ts.map +1 -0
  121. package/dist/nodes/switch-row.js +15 -0
  122. package/dist/nodes/switch-row.js.map +1 -0
  123. package/dist/nodes/text-anchor.d.ts.map +1 -1
  124. package/dist/nodes/text-anchor.js +10 -0
  125. package/dist/nodes/text-anchor.js.map +1 -1
  126. package/dist/nodes/text-tag.d.ts.map +1 -1
  127. package/dist/nodes/text-tag.js +45 -39
  128. package/dist/nodes/text-tag.js.map +1 -1
  129. package/dist/nodes/toggle-group.d.ts +12 -6
  130. package/dist/nodes/toggle-group.d.ts.map +1 -1
  131. package/dist/nodes/toggle-group.js +53 -4
  132. package/dist/nodes/toggle-group.js.map +1 -1
  133. package/dist/nodes/widget.d.ts.map +1 -1
  134. package/dist/nodes/widget.js +16 -22
  135. package/dist/nodes/widget.js.map +1 -1
  136. package/dist/nodes/window.d.ts.map +1 -1
  137. package/dist/nodes/window.js +2 -2
  138. package/dist/nodes/window.js.map +1 -1
  139. package/dist/registry.d.ts +0 -2
  140. package/dist/registry.d.ts.map +1 -1
  141. package/dist/registry.js +11 -18
  142. package/dist/registry.js.map +1 -1
  143. package/dist/types.d.ts +3 -2
  144. package/dist/types.d.ts.map +1 -1
  145. package/dist/use-property.d.ts +29 -0
  146. package/dist/use-property.d.ts.map +1 -0
  147. package/dist/use-property.js +44 -0
  148. package/dist/use-property.js.map +1 -0
  149. package/dist/use-setting.d.ts +36 -0
  150. package/dist/use-setting.d.ts.map +1 -0
  151. package/dist/use-setting.js +68 -0
  152. package/dist/use-setting.js.map +1 -0
  153. package/package.json +5 -4
  154. package/src/components/compound.tsx +57 -0
  155. package/src/components/list.tsx +140 -0
  156. package/src/components/slot-widget.tsx +46 -0
  157. package/src/errors.ts +8 -7
  158. package/src/generated/compounds.ts +2741 -0
  159. package/src/generated/internal.ts +3059 -1840
  160. package/src/generated/jsx.ts +2509 -5350
  161. package/src/generated/registry.ts +2 -1
  162. package/src/host-config.ts +2 -0
  163. package/src/index.ts +2 -0
  164. package/src/jsx.ts +167 -581
  165. package/src/metadata.ts +7 -4
  166. package/src/node.ts +23 -39
  167. package/src/nodes/alert-dialog.ts +55 -0
  168. package/src/nodes/animation.ts +67 -60
  169. package/src/nodes/application.ts +5 -0
  170. package/src/nodes/column-view-column.ts +125 -128
  171. package/src/nodes/container-slot.ts +30 -17
  172. package/src/nodes/drawing-area.ts +23 -32
  173. package/src/nodes/event-controller.ts +6 -18
  174. package/src/nodes/fixed-child.ts +13 -0
  175. package/src/nodes/grid-child.ts +13 -0
  176. package/src/nodes/internal/accessible.ts +0 -1
  177. package/src/nodes/internal/bound-item.ts +4 -0
  178. package/src/nodes/internal/construct.ts +38 -68
  179. package/src/nodes/internal/widget.ts +9 -13
  180. package/src/nodes/list-item-node.ts +53 -0
  181. package/src/nodes/list.ts +1082 -0
  182. package/src/nodes/notebook-page.ts +6 -2
  183. package/src/nodes/overlay-child.ts +30 -9
  184. package/src/nodes/spin-row.ts +72 -0
  185. package/src/nodes/switch-row.ts +26 -0
  186. package/src/nodes/text-anchor.ts +9 -0
  187. package/src/nodes/text-tag.ts +45 -40
  188. package/src/nodes/toggle-group.ts +63 -9
  189. package/src/nodes/widget.ts +14 -26
  190. package/src/nodes/window.ts +2 -2
  191. package/src/registry.ts +18 -24
  192. package/src/types.ts +8 -2
  193. package/src/use-property.ts +58 -0
  194. package/src/use-setting.ts +96 -0
  195. package/dist/fiber-root.d.ts +0 -4
  196. package/dist/fiber-root.d.ts.map +0 -1
  197. package/dist/fiber-root.js +0 -6
  198. package/dist/fiber-root.js.map +0 -1
  199. package/dist/nodes/column-view.d.ts +0 -37
  200. package/dist/nodes/column-view.d.ts.map +0 -1
  201. package/dist/nodes/column-view.js +0 -205
  202. package/dist/nodes/column-view.js.map +0 -1
  203. package/dist/nodes/drop-down.d.ts +0 -37
  204. package/dist/nodes/drop-down.d.ts.map +0 -1
  205. package/dist/nodes/drop-down.js +0 -231
  206. package/dist/nodes/drop-down.js.map +0 -1
  207. package/dist/nodes/grid-view.d.ts +0 -30
  208. package/dist/nodes/grid-view.d.ts.map +0 -1
  209. package/dist/nodes/grid-view.js +0 -90
  210. package/dist/nodes/grid-view.js.map +0 -1
  211. package/dist/nodes/internal/base-item-renderer.d.ts +0 -28
  212. package/dist/nodes/internal/base-item-renderer.d.ts.map +0 -1
  213. package/dist/nodes/internal/base-item-renderer.js +0 -85
  214. package/dist/nodes/internal/base-item-renderer.js.map +0 -1
  215. package/dist/nodes/internal/grid-item-renderer.d.ts +0 -20
  216. package/dist/nodes/internal/grid-item-renderer.d.ts.map +0 -1
  217. package/dist/nodes/internal/grid-item-renderer.js +0 -66
  218. package/dist/nodes/internal/grid-item-renderer.js.map +0 -1
  219. package/dist/nodes/internal/header-item-renderer.d.ts +0 -23
  220. package/dist/nodes/internal/header-item-renderer.d.ts.map +0 -1
  221. package/dist/nodes/internal/header-item-renderer.js +0 -87
  222. package/dist/nodes/internal/header-item-renderer.js.map +0 -1
  223. package/dist/nodes/internal/header-renderer-manager.d.ts +0 -13
  224. package/dist/nodes/internal/header-renderer-manager.d.ts.map +0 -1
  225. package/dist/nodes/internal/header-renderer-manager.js +0 -20
  226. package/dist/nodes/internal/header-renderer-manager.js.map +0 -1
  227. package/dist/nodes/internal/list-item-renderer.d.ts +0 -27
  228. package/dist/nodes/internal/list-item-renderer.d.ts.map +0 -1
  229. package/dist/nodes/internal/list-item-renderer.js +0 -131
  230. package/dist/nodes/internal/list-item-renderer.js.map +0 -1
  231. package/dist/nodes/internal/list-store.d.ts +0 -21
  232. package/dist/nodes/internal/list-store.d.ts.map +0 -1
  233. package/dist/nodes/internal/list-store.js +0 -90
  234. package/dist/nodes/internal/list-store.js.map +0 -1
  235. package/dist/nodes/internal/sectioned-list-store.d.ts +0 -50
  236. package/dist/nodes/internal/sectioned-list-store.d.ts.map +0 -1
  237. package/dist/nodes/internal/sectioned-list-store.js +0 -250
  238. package/dist/nodes/internal/sectioned-list-store.js.map +0 -1
  239. package/dist/nodes/internal/selection-helpers.d.ts +0 -12
  240. package/dist/nodes/internal/selection-helpers.d.ts.map +0 -1
  241. package/dist/nodes/internal/selection-helpers.js +0 -25
  242. package/dist/nodes/internal/selection-helpers.js.map +0 -1
  243. package/dist/nodes/internal/selection-model-controller.d.ts +0 -26
  244. package/dist/nodes/internal/selection-model-controller.d.ts.map +0 -1
  245. package/dist/nodes/internal/selection-model-controller.js +0 -82
  246. package/dist/nodes/internal/selection-model-controller.js.map +0 -1
  247. package/dist/nodes/internal/simple-list-store.d.ts +0 -15
  248. package/dist/nodes/internal/simple-list-store.d.ts.map +0 -1
  249. package/dist/nodes/internal/simple-list-store.js +0 -110
  250. package/dist/nodes/internal/simple-list-store.js.map +0 -1
  251. package/dist/nodes/internal/tree-store.d.ts +0 -37
  252. package/dist/nodes/internal/tree-store.d.ts.map +0 -1
  253. package/dist/nodes/internal/tree-store.js +0 -253
  254. package/dist/nodes/internal/tree-store.js.map +0 -1
  255. package/dist/nodes/list-item.d.ts +0 -24
  256. package/dist/nodes/list-item.d.ts.map +0 -1
  257. package/dist/nodes/list-item.js +0 -83
  258. package/dist/nodes/list-item.js.map +0 -1
  259. package/dist/nodes/list-section.d.ts +0 -27
  260. package/dist/nodes/list-section.d.ts.map +0 -1
  261. package/dist/nodes/list-section.js +0 -43
  262. package/dist/nodes/list-section.js.map +0 -1
  263. package/dist/nodes/list-view.d.ts +0 -32
  264. package/dist/nodes/list-view.d.ts.map +0 -1
  265. package/dist/nodes/list-view.js +0 -123
  266. package/dist/nodes/list-view.js.map +0 -1
  267. package/dist/nodes/models/list.d.ts +0 -39
  268. package/dist/nodes/models/list.d.ts.map +0 -1
  269. package/dist/nodes/models/list.js +0 -207
  270. package/dist/nodes/models/list.js.map +0 -1
  271. package/src/fiber-root.ts +0 -20
  272. package/src/nodes/column-view.ts +0 -262
  273. package/src/nodes/drop-down.ts +0 -284
  274. package/src/nodes/grid-view.ts +0 -119
  275. package/src/nodes/internal/base-item-renderer.ts +0 -107
  276. package/src/nodes/internal/grid-item-renderer.ts +0 -78
  277. package/src/nodes/internal/header-item-renderer.ts +0 -105
  278. package/src/nodes/internal/header-renderer-manager.ts +0 -33
  279. package/src/nodes/internal/list-item-renderer.ts +0 -162
  280. package/src/nodes/internal/list-store.ts +0 -107
  281. package/src/nodes/internal/sectioned-list-store.ts +0 -287
  282. package/src/nodes/internal/selection-helpers.ts +0 -35
  283. package/src/nodes/internal/selection-model-controller.ts +0 -119
  284. package/src/nodes/internal/simple-list-store.ts +0 -116
  285. package/src/nodes/internal/tree-store.ts +0 -289
  286. package/src/nodes/list-item.ts +0 -107
  287. package/src/nodes/list-section.ts +0 -64
  288. package/src/nodes/list-view.ts +0 -164
  289. package/src/nodes/models/list.ts +0 -250
@@ -0,0 +1,2741 @@
1
+ import { createContainerSlotChild, createMenuChild, createNavigationPageChild, createVirtualChild } from "../components/compound.js";
2
+ import { createSlotWidget } from "../components/slot-widget.js";
3
+ import { type FixedChildProps, type GridChildProps, type MenuItemProps, type MenuSectionProps, type MenuSubmenuProps, type NavigationSplitViewPageProps, type NavigationViewPageProps, type NotebookPageProps, type NotebookPageTabProps, type OverlayChildProps, type ShortcutProps, type StackPageProps, type TextAnchorProps, type TextPaintableProps, type TextTagProps } from "../jsx.js";
4
+ import { type AdwActionRowProps, type AdwAlertDialogProps, type AdwApplicationWindowProps, type AdwBottomSheetProps, type AdwEntryRowProps, type AdwExpanderRowProps, type AdwFlapProps, type AdwHeaderBarProps, type AdwMessageDialogProps, type AdwNavigationSplitViewProps, type AdwNavigationViewProps, type AdwOverlaySplitViewProps, type AdwPreferencesGroupProps, type AdwPreferencesPageProps, type AdwSplitButtonProps, type AdwTabBarProps, type AdwToolbarViewProps, type AdwViewStackProps, type AdwWindowProps, type GtkActionBarProps, type GtkCenterBoxProps, type GtkExpanderProps, type GtkFixedProps, type GtkFrameProps, type GtkGridProps, type GtkHeaderBarProps, type GtkMenuButtonProps, type GtkNotebookProps, type GtkOverlayProps, type GtkPanedProps, type GtkPopoverMenuBarProps, type GtkPopoverMenuProps, type GtkShortcutControllerProps, type GtkSourceViewProps, type GtkStackProps, type GtkTextViewProps, type GtkWindowProps } from "./jsx.js";
5
+ import { type ReactNode } from "react";
6
+
7
+ /**
8
+ * A [`Gtk.ListBoxRow`](https://docs.gtk.org/gtk4/class.ListBoxRow.html) used to present actions.
9
+ *
10
+ * ![action-row](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/action-row.png)
11
+ *
12
+ * The `AdwActionRow` widget can have a title, a subtitle and an icon. The row
13
+ * can receive additional widgets at its end, or prefix widgets at its start.
14
+ *
15
+ * It is convenient to present a preference and its related actions.
16
+ *
17
+ * `AdwActionRow` is unactivatable by default, giving it an activatable widget
18
+ * will automatically make it activatable, but unsetting it won't change the
19
+ * row's activatability.
20
+ *
21
+ * ## AdwActionRow as GtkBuildable
22
+ *
23
+ * The `AdwActionRow` implementation of the [`Gtk.Buildable`](https://docs.gtk.org/gtk4/iface.Buildable.html) interface
24
+ * supports adding a child at its end by specifying “suffix” or omitting the
25
+ * “type” attribute of a `<child>` element.
26
+ *
27
+ * It also supports adding a child as a prefix widget by specifying “prefix” as
28
+ * the “type” attribute of a `<child>` element.
29
+ *
30
+ * ## CSS nodes
31
+ *
32
+ * `AdwActionRow` has a main CSS node with name `row`.
33
+ *
34
+ * It contains the subnode `box.header` for its main horizontal box, and
35
+ * `box.title` for the vertical box containing the title and subtitle labels.
36
+ *
37
+ * It contains subnodes `label.title` and `label.subtitle` representing
38
+ * respectively the title label and subtitle label.
39
+ *
40
+ * ## Style classes
41
+ *
42
+ * `AdwActionRow` can use the `.property`
43
+ * style class to emphasize the row subtitle instead of the row title, which is
44
+ * useful for displaying read-only properties.
45
+ *
46
+ * ![property-row](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property-row.png)
47
+ *
48
+ * When used together with the `.monospace` style class, only the subtitle
49
+ * becomes monospace, not the title or any extra widgets.
50
+ */
51
+ export const AdwActionRow: ((props: AdwActionRowProps) => ReactNode) & {
52
+ AddPrefix: (props: { children?: ReactNode }) => ReactNode;
53
+ AddSuffix: (props: { children?: ReactNode }) => ReactNode;
54
+ } = Object.assign(createSlotWidget<AdwActionRowProps>("AdwActionRow", []), {
55
+ AddPrefix: createContainerSlotChild("addPrefix"),
56
+ AddSuffix: createContainerSlotChild("addSuffix"),
57
+ });
58
+
59
+ /**
60
+ * A dialog presenting a message or a question.
61
+ *
62
+ * ![alert-dialog](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/alert-dialog.png)
63
+ *
64
+ * Alert dialogs have a heading, a body, an optional child widget, and one or
65
+ * multiple responses, each presented as a button.
66
+ *
67
+ * Each response has a unique string ID, and a button label. Additionally, each
68
+ * response can be enabled or disabled, and can have a suggested or destructive
69
+ * appearance.
70
+ *
71
+ * When one of the responses is activated, or the dialog is closed, the
72
+ * [`AlertDialog.:response`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/signal.AlertDialog.response.html) signal will be emitted. This signal is
73
+ * detailed, and the detail, as well as the `response` parameter will be set to
74
+ * the ID of the activated response, or to the value of the
75
+ * [`AlertDialog.close-response`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.AlertDialog.close-response.html) property if the dialog had been closed
76
+ * without activating any of the responses.
77
+ *
78
+ * Response buttons can be presented horizontally or vertically depending on
79
+ * available space.
80
+ *
81
+ * When a response is activated, `AdwAlertDialog` is closed automatically.
82
+ *
83
+ * An example of using an alert dialog:
84
+ *
85
+ * ```c
86
+ * AdwDialog *dialog;
87
+ *
88
+ * dialog = adw_alert_dialog_new (_("Replace File?"), NULL);
89
+ *
90
+ * adw_alert_dialog_format_body (ADW_ALERT_DIALOG (dialog),
91
+ * _("A file named “%s” already exists. Do you want to replace it?"),
92
+ * filename);
93
+ *
94
+ * adw_alert_dialog_add_responses (ADW_ALERT_DIALOG (dialog),
95
+ * "cancel", _("_Cancel"),
96
+ * "replace", _("_Replace"),
97
+ * NULL);
98
+ *
99
+ * adw_alert_dialog_set_response_appearance (ADW_ALERT_DIALOG (dialog),
100
+ * "replace",
101
+ * ADW_RESPONSE_DESTRUCTIVE);
102
+ *
103
+ * adw_alert_dialog_set_default_response (ADW_ALERT_DIALOG (dialog), "cancel");
104
+ * adw_alert_dialog_set_close_response (ADW_ALERT_DIALOG (dialog), "cancel");
105
+ *
106
+ * g_signal_connect (dialog, "response", G_CALLBACK (response_cb), self);
107
+ *
108
+ * adw_dialog_present (dialog, parent);
109
+ * ```
110
+ *
111
+ * ## Async API
112
+ *
113
+ * `AdwAlertDialog` can also be used via the [`AlertDialog.choose`](https://docs.gtk.org/alertdialog/method.choose.html) method.
114
+ * This API follows the GIO async pattern, for example:
115
+ *
116
+ * ```c
117
+ * static void
118
+ * dialog_cb (AdwAlertDialog *dialog,
119
+ * GAsyncResult *result,
120
+ * MyWindow *self)
121
+ * {
122
+ * const char *response = adw_alert_dialog_choose_finish (dialog, result);
123
+ *
124
+ * // ...
125
+ * }
126
+ *
127
+ * static void
128
+ * show_dialog (MyWindow *self)
129
+ * {
130
+ * AdwDialog *dialog;
131
+ *
132
+ * dialog = adw_alert_dialog_new (_("Replace File?"), NULL);
133
+ *
134
+ * adw_alert_dialog_format_body (ADW_ALERT_DIALOG (dialog),
135
+ * _("A file named “%s” already exists. Do you want to replace it?"),
136
+ * filename);
137
+ *
138
+ * adw_alert_dialog_add_responses (ADW_ALERT_DIALOG (dialog),
139
+ * "cancel", _("_Cancel"),
140
+ * "replace", _("_Replace"),
141
+ * NULL);
142
+ *
143
+ * adw_alert_dialog_set_response_appearance (ADW_ALERT_DIALOG (dialog),
144
+ * "replace",
145
+ * ADW_RESPONSE_DESTRUCTIVE);
146
+ *
147
+ * adw_alert_dialog_set_default_response (ADW_ALERT_DIALOG (dialog), "cancel");
148
+ * adw_alert_dialog_set_close_response (ADW_ALERT_DIALOG (dialog), "cancel");
149
+ *
150
+ * adw_alert_dialog_choose (ADW_ALERT_DIALOG (dialog), GTK_WIDGET (self),
151
+ * NULL, (GAsyncReadyCallback) dialog_cb, self);
152
+ * }
153
+ * ```
154
+ *
155
+ * ## AdwAlertDialog as GtkBuildable
156
+ *
157
+ * `AdwAlertDialog` supports adding responses in UI definitions by via the
158
+ * `<responses>` element that may contain multiple `<response>` elements, each
159
+ * representing a response.
160
+ *
161
+ * Each of the `<response>` elements must have the `id` attribute specifying the
162
+ * response ID. The contents of the element are used as the response label.
163
+ *
164
+ * Response labels can be translated with the usual `translatable`, `context`
165
+ * and `comments` attributes.
166
+ *
167
+ * The `<response>` elements can also have `enabled` and/or `appearance`
168
+ * attributes. See [`AlertDialog.set_response_enabled`](https://docs.gtk.org/alertdialog/method.set_response_enabled.html) and
169
+ * [`AlertDialog.set_response_appearance`](https://docs.gtk.org/alertdialog/method.set_response_appearance.html) for details.
170
+ *
171
+ * Example of an `AdwAlertDialog` UI definition:
172
+ *
173
+ * ```xml
174
+ * <object class="AdwAlertDialog" id="dialog">
175
+ * <property name="heading" translatable="yes">Save Changes?</property>
176
+ * <property name="body" translatable="yes">Open documents contain unsaved changes. Changes which are not saved will be permanently lost.</property>
177
+ * <property name="default-response">save</property>
178
+ * <property name="close-response">cancel</property>
179
+ * <signal name="response" handler="response_cb"/>
180
+ * <responses>
181
+ * <response id="cancel" translatable="yes">_Cancel</response>
182
+ * <response id="discard" translatable="yes" appearance="destructive">_Discard</response>
183
+ * <response id="save" translatable="yes" appearance="suggested" enabled="false">_Save</response>
184
+ * </responses>
185
+ * </object>
186
+ * ```
187
+ */
188
+ export const AdwAlertDialog: (props: AdwAlertDialogProps) => ReactNode = createSlotWidget<AdwAlertDialogProps>("AdwAlertDialog", ["extraChild"]);
189
+
190
+ /**
191
+ * A freeform application window.
192
+ *
193
+ * ![application-window](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/application-window.png)
194
+ *
195
+ * `AdwApplicationWindow` is a [`Gtk.ApplicationWindow`](https://docs.gtk.org/gtk4/class.ApplicationWindow.html) subclass providing
196
+ * the same features as [`Window`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/class.Window.html).
197
+ *
198
+ * See [`Window`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/class.Window.html) for details.
199
+ *
200
+ * Example of an `AdwApplicationWindow` UI definition:
201
+ *
202
+ * ```xml
203
+ * <object class="AdwApplicationWindow">
204
+ * <property name="content">
205
+ * <object class="AdwToolbarView">
206
+ * <child type="top">
207
+ * <object class="AdwHeaderBar"/>
208
+ * </child>
209
+ * <property name="content">
210
+ * <!-- ... -->
211
+ * </property>
212
+ * </object>
213
+ * </property>
214
+ * </object>
215
+ * ```
216
+ *
217
+ * Using [`Gtk.Application.menubar`](https://docs.gtk.org/gtk4/property.Application.menubar.html) is not supported and may result in
218
+ * visual glitches.
219
+ */
220
+ export const AdwApplicationWindow: (props: AdwApplicationWindowProps) => ReactNode = createSlotWidget<AdwApplicationWindowProps>("AdwApplicationWindow", ["content"]);
221
+
222
+ /**
223
+ * A bottom sheet with an optional bottom bar.
224
+ *
225
+ * ![bottom-sheet](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/bottom-sheet.png)
226
+ *
227
+ * `AdwBottomSheet` has three child widgets. [`BottomSheet.content`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.BottomSheet.content.html) is
228
+ * shown persistently. [`BottomSheet.sheet`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.BottomSheet.sheet.html) is displayed above it when
229
+ * it's open, and [`BottomSheet.bottom-bar`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.BottomSheet.bottom-bar.html) is displayed when it's not.
230
+ *
231
+ * Bottom sheet and bottom bar are attached to the bottom edge of the widget.
232
+ * They take the full width by default, but can only take a portion of it if
233
+ * [`BottomSheet.full-width`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.BottomSheet.full-width.html) is set to `FALSE`. In this case,
234
+ * [`BottomSheet.align`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.BottomSheet.align.html) determines where along the bottom edge they are
235
+ * placed.
236
+ *
237
+ * Bottom bar can be hidden using the [`BottomSheet.reveal-bottom-bar`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.BottomSheet.reveal-bottom-bar.html)
238
+ * property.
239
+ *
240
+ * `AdwBottomSheet` can be useful for applications such as music players, that
241
+ * want to have a persistent bottom bar that expands into a bottom sheet when
242
+ * clicked. It's meant for cases where a bottom sheet is tightly integrated into
243
+ * the UI. For more transient bottom sheets, see [`Dialog`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/class.Dialog.html).
244
+ *
245
+ * To open or close the bottom sheet, use the [`BottomSheet.open`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.BottomSheet.open.html)
246
+ * property.
247
+ *
248
+ * By default, the bottom sheet has an overlaid drag handle. It can be disabled
249
+ * by setting [`BottomSheet.show-drag-handle`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.BottomSheet.show-drag-handle.html) to `FALSE`. Note that the
250
+ * handle also controls whether the sheet can be dragged using a pointer.
251
+ *
252
+ * Bottom sheets are modal by default, meaning that the content is dimmed and
253
+ * cannot be accessed while the sheet is open. Set [`BottomSheet.modal`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.BottomSheet.modal.html)
254
+ * to `FALSE` if this behavior is unwanted.
255
+ *
256
+ * To disable user interactions for opening or closing the bottom sheet (such as
257
+ * swipes or clicking the bottom bar or close button), set
258
+ * [`BottomSheet.can-open`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.BottomSheet.can-open.html) or [`BottomSheet.can-close`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.BottomSheet.can-close.html) to
259
+ * `FALSE`.
260
+ *
261
+ * In some cases, particularly when using a full-width bottom bar, it may be
262
+ * necessary to shift [`BottomSheet.content`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.BottomSheet.content.html) upwards. Use the
263
+ * [`BottomSheet.bottom-bar-height`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.BottomSheet.bottom-bar-height.html) and
264
+ * [`BottomSheet.sheet-height`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.BottomSheet.sheet-height.html) for that.
265
+ *
266
+ * `AdwBottomSheet` is not adaptive, and for larger window sizes applications
267
+ * may want to replace it with another UI, such as a sidebar. This can be done
268
+ * using [`MultiLayoutView`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/class.MultiLayoutView.html).
269
+ *
270
+ * ## Sizing
271
+ *
272
+ * Unlike [`Dialog`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/class.Dialog.html) presented as a bottom sheet, `AdwBottomSheet` just
273
+ * follows the content's natural size, and it's up to the applications to make
274
+ * sure their content provides one. For example, when using
275
+ * [`Gtk.ScrolledWindow`](https://docs.gtk.org/gtk4/class.ScrolledWindow.html), make sure to set
276
+ * [`Gtk.ScrolledWindow.propagate-natural-height`](https://docs.gtk.org/gtk4/property.ScrolledWindow.propagate-natural-height.html) to `TRUE`.
277
+ *
278
+ * ## Header Bar Integration
279
+ *
280
+ * When placed inside an `AdwBottomSheet`, [`HeaderBar`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/class.HeaderBar.html) will not show the
281
+ * title when [`BottomSheet.show-drag-handle`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.BottomSheet.show-drag-handle.html) is `TRUE`, regardless of
282
+ * [`HeaderBar.show-title`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.HeaderBar.show-title.html). This only applies to the default title,
283
+ * titles set with [`HeaderBar.title-widget`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.HeaderBar.title-widget.html) will still be shown.
284
+ *
285
+ * ## `AdwBottomSheet` as `GtkBuildable`:
286
+ *
287
+ * The `AdwBottomSheet` implementation of the [`Gtk.Buildable`](https://docs.gtk.org/gtk4/iface.Buildable.html) interface
288
+ * supports setting the sheet widget by specifying “sheet” as the “type”
289
+ * attribute of a ``<child>`` element, and the bottom bar by specifying
290
+ * “bottom-bar”. Specifying “content” or omitting the child type results in
291
+ * setting the content child.
292
+ */
293
+ export const AdwBottomSheet: (props: AdwBottomSheetProps) => ReactNode = createSlotWidget<AdwBottomSheetProps>("AdwBottomSheet", ["bottomBar","content","sheet"]);
294
+
295
+ /**
296
+ * A [`Gtk.ListBoxRow`](https://docs.gtk.org/gtk4/class.ListBoxRow.html) with an embedded text entry.
297
+ *
298
+ * ![entry-row](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/entry-row.png)
299
+ *
300
+ * `AdwEntryRow` has a title that doubles as placeholder text. It shows an icon
301
+ * indicating that it's editable and can receive additional widgets before or
302
+ * after the editable part.
303
+ *
304
+ * If [`EntryRow.show-apply-button`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.EntryRow.show-apply-button.html) is set to `TRUE`, `AdwEntryRow` can
305
+ * show an apply button when editing its contents. This can be useful if
306
+ * changing its contents can result in an expensive operation, such as network
307
+ * activity.
308
+ *
309
+ * `AdwEntryRow` provides only minimal API and should be used with the
310
+ * [`Gtk.Editable`](https://docs.gtk.org/gtk4/iface.Editable.html) API.
311
+ *
312
+ * See also [`PasswordEntryRow`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/class.PasswordEntryRow.html).
313
+ *
314
+ * ## AdwEntryRow as GtkBuildable
315
+ *
316
+ * The `AdwEntryRow` implementation of the [`Gtk.Buildable`](https://docs.gtk.org/gtk4/iface.Buildable.html) interface
317
+ * supports adding a child at its end by specifying “suffix” or omitting the
318
+ * “type” attribute of a `<child>` element.
319
+ *
320
+ * It also supports adding a child as a prefix widget by specifying “prefix” as
321
+ * the “type” attribute of a `<child>` element.
322
+ *
323
+ * ## CSS nodes
324
+ *
325
+ * `AdwEntryRow` has a single CSS node with name `row` and the `.entry` style
326
+ * class.
327
+ */
328
+ export const AdwEntryRow: ((props: AdwEntryRowProps) => ReactNode) & {
329
+ AddPrefix: (props: { children?: ReactNode }) => ReactNode;
330
+ AddSuffix: (props: { children?: ReactNode }) => ReactNode;
331
+ } = Object.assign(createSlotWidget<AdwEntryRowProps>("AdwEntryRow", []), {
332
+ AddPrefix: createContainerSlotChild("addPrefix"),
333
+ AddSuffix: createContainerSlotChild("addSuffix"),
334
+ });
335
+
336
+ /**
337
+ * A [`Gtk.ListBoxRow`](https://docs.gtk.org/gtk4/class.ListBoxRow.html) used to reveal widgets.
338
+ *
339
+ * ![expander-row](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/expander-row.png)
340
+ *
341
+ * The `AdwExpanderRow` widget allows the user to reveal or hide widgets below
342
+ * it. It also allows the user to enable the expansion of the row, allowing to
343
+ * disable all that the row contains.
344
+ *
345
+ * ## AdwExpanderRow as GtkBuildable
346
+ *
347
+ * The `AdwExpanderRow` implementation of the [`Gtk.Buildable`](https://docs.gtk.org/gtk4/iface.Buildable.html) interface
348
+ * supports adding a child as an suffix widget by specifying “suffix” as the
349
+ * “type” attribute of a `<child>` element.
350
+ *
351
+ * It also supports adding it as a prefix widget by specifying “prefix” as the
352
+ * “type” attribute of a `<child>` element.
353
+ *
354
+ * ## CSS nodes
355
+ *
356
+ * `AdwExpanderRow` has a main CSS node with name `row` and the `.expander`
357
+ * style class. It has the `.empty` style class when it contains no children.
358
+ *
359
+ * It contains the subnodes `row.header` for its main embedded row,
360
+ * `list.nested` for the list it can expand, and `image.expander-row-arrow` for
361
+ * its arrow.
362
+ *
363
+ * ## Style classes
364
+ *
365
+ * `AdwExpanderRow` can use the `.`
366
+ * style class to emphasize the row subtitle instead of the row title, which is
367
+ * useful for displaying read-only properties.
368
+ *
369
+ * When used together with the `.monospace` style class, only the subtitle
370
+ * becomes monospace, not the title or any extra widgets.
371
+ */
372
+ export const AdwExpanderRow: ((props: AdwExpanderRowProps) => ReactNode) & {
373
+ AddPrefix: (props: { children?: ReactNode }) => ReactNode;
374
+ AddSuffix: (props: { children?: ReactNode }) => ReactNode;
375
+ AddRow: (props: { children?: ReactNode }) => ReactNode;
376
+ AddAction: (props: { children?: ReactNode }) => ReactNode;
377
+ } = Object.assign(createSlotWidget<AdwExpanderRowProps>("AdwExpanderRow", []), {
378
+ AddPrefix: createContainerSlotChild("addPrefix"),
379
+ AddSuffix: createContainerSlotChild("addSuffix"),
380
+ AddRow: createContainerSlotChild("addRow"),
381
+ AddAction: createContainerSlotChild("addAction"),
382
+ });
383
+
384
+ /**
385
+ * An adaptive container acting like a box or an overlay.
386
+ *
387
+ * ![flap-wide](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/flap-wide.png)
388
+ * ![flap-narrow](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/flap-narrow.png)
389
+ *
390
+ * The `AdwFlap` widget can display its children like a [`Gtk.Box`](https://docs.gtk.org/gtk4/class.Box.html) does or
391
+ * like a [`Gtk.Overlay`](https://docs.gtk.org/gtk4/class.Overlay.html) does, according to the
392
+ * [`Flap.fold-policy`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.Flap.fold-policy.html) value.
393
+ *
394
+ * `AdwFlap` has at most three children: [`Flap.content`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.Flap.content.html),
395
+ * [`Flap.flap`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.Flap.flap.html) and [`Flap.separator`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.Flap.separator.html). Content is the primary
396
+ * child, flap is displayed next to it when unfolded, or overlays it when
397
+ * folded. Flap can be shown or hidden by changing the
398
+ * [`Flap.reveal-flap`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.Flap.reveal-flap.html) value, as well as via swipe gestures if
399
+ * [`Flap.swipe-to-open`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.Flap.swipe-to-open.html) and/or [`Flap.swipe-to-close`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.Flap.swipe-to-close.html) are set
400
+ * to `TRUE`.
401
+ *
402
+ * Optionally, a separator can be provided, which would be displayed between
403
+ * the content and the flap when there's no shadow to separate them, depending
404
+ * on the transition type.
405
+ *
406
+ * [`Flap.flap`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.Flap.flap.html) is transparent by default; add the
407
+ * `.background` style class to it if this is
408
+ * unwanted.
409
+ *
410
+ * If [`Flap.modal`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.Flap.modal.html) is set to `TRUE`, content becomes completely
411
+ * inaccessible when the flap is revealed while folded.
412
+ *
413
+ * The position of the flap and separator children relative to the content is
414
+ * determined by orientation, as well as the [`Flap.flap-position`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.Flap.flap-position.html)
415
+ * value.
416
+ *
417
+ * Folding the flap will automatically hide the flap widget, and unfolding it
418
+ * will automatically reveal it. If this behavior is not desired, the
419
+ * [`Flap.locked`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.Flap.locked.html) property can be used to override it.
420
+ *
421
+ * Common use cases include sidebars, header bars that need to be able to
422
+ * overlap the window content (for example, in fullscreen mode) and bottom
423
+ * sheets.
424
+ *
425
+ * ## AdwFlap as GtkBuildable
426
+ *
427
+ * The `AdwFlap` implementation of the [`Gtk.Buildable`](https://docs.gtk.org/gtk4/iface.Buildable.html) interface supports
428
+ * setting the flap child by specifying “flap” as the “type” attribute of a
429
+ * ``<child>`` element, and separator by specifying “separator”. Specifying
430
+ * “content” child type or omitting it results in setting the content child.
431
+ *
432
+ * ## CSS nodes
433
+ *
434
+ * `AdwFlap` has a single CSS node with name `flap`. The node will get the style
435
+ * classes `.folded` when it is folded, and `.unfolded` when it's not.
436
+ */
437
+ export const AdwFlap: (props: AdwFlapProps) => ReactNode = createSlotWidget<AdwFlapProps>("AdwFlap", ["content","flap","separator"]);
438
+
439
+ /**
440
+ * A title bar widget.
441
+ *
442
+ * ![header-bar](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/header-bar.png)
443
+ *
444
+ * `AdwHeaderBar` is similar to [`Gtk.HeaderBar`](https://docs.gtk.org/gtk4/class.HeaderBar.html), but provides additional
445
+ * features compared to it. Refer to `GtkHeaderBar` for details. It is typically
446
+ * used as a top bar within [`ToolbarView`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/class.ToolbarView.html).
447
+ *
448
+ * ## Dialog Integration
449
+ *
450
+ * When placed inside an [`Dialog`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/class.Dialog.html), `AdwHeaderBar` will display the dialog
451
+ * title instead of window title. It will also adjust the decoration layout to
452
+ * ensure it always has a close button and nothing else. Set
453
+ * [`HeaderBar.show-start-title-buttons`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.HeaderBar.show-start-title-buttons.html) and
454
+ * [`HeaderBar.show-end-title-buttons`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.HeaderBar.show-end-title-buttons.html) to `FALSE` to remove it if it's
455
+ * unwanted.
456
+ *
457
+ * ## Navigation View Integration
458
+ *
459
+ * When placed inside an [`NavigationPage`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/class.NavigationPage.html), `AdwHeaderBar` will display the
460
+ * page title instead of window title.
461
+ *
462
+ * When used together with [`NavigationView`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/class.NavigationView.html) or [`NavigationSplitView`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/class.NavigationSplitView.html),
463
+ * it will also display a back button that can be used to go back to the previous
464
+ * page. The button also has a context menu, allowing to pop multiple pages at
465
+ * once, potentially across multiple navigation views.
466
+ *
467
+ * Set [`HeaderBar.show-back-button`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.HeaderBar.show-back-button.html) to `FALSE` to disable this behavior
468
+ * in rare scenarios where it's unwanted.
469
+ *
470
+ * ## Split View Integration
471
+ *
472
+ * When placed inside [`NavigationSplitView`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/class.NavigationSplitView.html) or [`OverlaySplitView`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/class.OverlaySplitView.html),
473
+ * `AdwHeaderBar` will automatically hide the title buttons other than at the
474
+ * edges of the window.
475
+ *
476
+ * ## Bottom Sheet Integration
477
+ *
478
+ * When played inside [`BottomSheet`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/class.BottomSheet.html), `AdwHeaderBar` will not show the title
479
+ * unless [`BottomSheet.show-drag-handle`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.BottomSheet.show-drag-handle.html) is set to `FALSE`, regardless
480
+ * of [`HeaderBar.show-title`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.HeaderBar.show-title.html). This only applies to the default title,
481
+ * titles set with [`HeaderBar.title-widget`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.HeaderBar.title-widget.html) will still be shown.
482
+ *
483
+ * ## Centering Policy
484
+ *
485
+ * [`HeaderBar.centering-policy`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.HeaderBar.centering-policy.html) allows to enforce strict centering of
486
+ * the title widget. This can be useful for entries inside [`Clamp`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/class.Clamp.html).
487
+ *
488
+ * ## Title Buttons
489
+ *
490
+ * Unlike `GtkHeaderBar`, `AdwHeaderBar` allows to toggle title button
491
+ * visibility for each side individually, using the
492
+ * [`HeaderBar.show-start-title-buttons`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.HeaderBar.show-start-title-buttons.html) and
493
+ * [`HeaderBar.show-end-title-buttons`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.HeaderBar.show-end-title-buttons.html) properties.
494
+ *
495
+ * ## CSS nodes
496
+ *
497
+ * ```
498
+ * headerbar
499
+ * ╰── windowhandle
500
+ * ╰── box
501
+ * ├── widget
502
+ * │ ╰── box.start
503
+ * │ ├── windowcontrols.start
504
+ * │ ├── widget
505
+ * │ │ ╰── [button.back]
506
+ * │ ╰── [other children]
507
+ * ├── widget
508
+ * │ ╰── [Title Widget]
509
+ * ╰── widget
510
+ * ╰── box.end
511
+ * ├── [other children]
512
+ * ╰── windowcontrols.end
513
+ * ```
514
+ *
515
+ * `AdwHeaderBar`'s CSS node is called `headerbar`. It contains a `windowhandle`
516
+ * subnode, which contains a `box` subnode, which contains three `widget`
517
+ * subnodes at the start, center and end of the header bar. The start and end
518
+ * subnodes contain a `box` subnode with the `.start` and `.end` style classes
519
+ * respectively, and the center node contains a node that represents the title.
520
+ *
521
+ * Each of the boxes contains a `windowcontrols` subnode, see
522
+ * [`Gtk.WindowControls`](https://docs.gtk.org/gtk4/class.WindowControls.html) for details, as well as other children.
523
+ *
524
+ * When [`HeaderBar.show-back-button`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.HeaderBar.show-back-button.html) is `TRUE`, the start box also
525
+ * contains a node with the name `widget` that contains a node with the name
526
+ * `button` and `.back` style class.
527
+ *
528
+ * ## Accessibility
529
+ *
530
+ * `AdwHeaderBar` uses the `GTK_ACCESSIBLE_ROLE_GROUP` role.
531
+ */
532
+ export const AdwHeaderBar: ((props: AdwHeaderBarProps) => ReactNode) & {
533
+ PackStart: (props: { children?: ReactNode }) => ReactNode;
534
+ PackEnd: (props: { children?: ReactNode }) => ReactNode;
535
+ } = Object.assign(createSlotWidget<AdwHeaderBarProps>("AdwHeaderBar", ["titleWidget"]), {
536
+ PackStart: createContainerSlotChild("packStart"),
537
+ PackEnd: createContainerSlotChild("packEnd"),
538
+ });
539
+
540
+ /**
541
+ * A dialog presenting a message or a question.
542
+ *
543
+ * ![message-dialog](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/message-dialog.png)
544
+ *
545
+ * Message dialogs have a heading, a body, an optional child widget, and one or
546
+ * multiple responses, each presented as a button.
547
+ *
548
+ * Each response has a unique string ID, and a button label. Additionally, each
549
+ * response can be enabled or disabled, and can have a suggested or destructive
550
+ * appearance.
551
+ *
552
+ * When one of the responses is activated, or the dialog is closed, the
553
+ * [`MessageDialog.:response`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/signal.MessageDialog.response.html) signal will be emitted. This signal is
554
+ * detailed, and the detail, as well as the `response` parameter will be set to
555
+ * the ID of the activated response, or to the value of the
556
+ * [`MessageDialog.close-response`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.MessageDialog.close-response.html) property if the dialog had been
557
+ * closed without activating any of the responses.
558
+ *
559
+ * Response buttons can be presented horizontally or vertically depending on
560
+ * available space.
561
+ *
562
+ * When a response is activated, `AdwMessageDialog` is closed automatically.
563
+ *
564
+ * An example of using a message dialog:
565
+ *
566
+ * ```c
567
+ * GtkWidget *dialog;
568
+ *
569
+ * dialog = adw_message_dialog_new (parent, _("Replace File?"), NULL);
570
+ *
571
+ * adw_message_dialog_format_body (ADW_MESSAGE_DIALOG (dialog),
572
+ * _("A file named “%s” already exists. Do you want to replace it?"),
573
+ * filename);
574
+ *
575
+ * adw_message_dialog_add_responses (ADW_MESSAGE_DIALOG (dialog),
576
+ * "cancel", _("_Cancel"),
577
+ * "replace", _("_Replace"),
578
+ * NULL);
579
+ *
580
+ * adw_message_dialog_set_response_appearance (ADW_MESSAGE_DIALOG (dialog), "replace", ADW_RESPONSE_DESTRUCTIVE);
581
+ *
582
+ * adw_message_dialog_set_default_response (ADW_MESSAGE_DIALOG (dialog), "cancel");
583
+ * adw_message_dialog_set_close_response (ADW_MESSAGE_DIALOG (dialog), "cancel");
584
+ *
585
+ * g_signal_connect (dialog, "response", G_CALLBACK (response_cb), self);
586
+ *
587
+ * gtk_window_present (GTK_WINDOW (dialog));
588
+ * ```
589
+ *
590
+ * ## Async API
591
+ *
592
+ * `AdwMessageDialog` can also be used via the [`MessageDialog.choose`](https://docs.gtk.org/messagedialog/method.choose.html)
593
+ * method. This API follows the GIO async pattern, for example:
594
+ *
595
+ * ```c
596
+ * static void
597
+ * dialog_cb (AdwMessageDialog *dialog,
598
+ * GAsyncResult *result,
599
+ * MyWindow *self)
600
+ * {
601
+ * const char *response = adw_message_dialog_choose_finish (dialog, result);
602
+ *
603
+ * // ...
604
+ * }
605
+ *
606
+ * static void
607
+ * show_dialog (MyWindow *self)
608
+ * {
609
+ * GtkWidget *dialog;
610
+ *
611
+ * dialog = adw_message_dialog_new (GTK_WINDOW (self), _("Replace File?"), NULL);
612
+ *
613
+ * adw_message_dialog_format_body (ADW_MESSAGE_DIALOG (dialog),
614
+ * _("A file named “%s” already exists. Do you want to replace it?"),
615
+ * filename);
616
+ *
617
+ * adw_message_dialog_add_responses (ADW_MESSAGE_DIALOG (dialog),
618
+ * "cancel", _("_Cancel"),
619
+ * "replace", _("_Replace"),
620
+ * NULL);
621
+ *
622
+ * adw_message_dialog_set_response_appearance (ADW_MESSAGE_DIALOG (dialog), "replace", ADW_RESPONSE_DESTRUCTIVE);
623
+ *
624
+ * adw_message_dialog_set_default_response (ADW_MESSAGE_DIALOG (dialog), "cancel");
625
+ * adw_message_dialog_set_close_response (ADW_MESSAGE_DIALOG (dialog), "cancel");
626
+ *
627
+ * adw_message_dialog_choose (ADW_MESSAGE_DIALOG (dialog), NULL, (GAsyncReadyCallback) dialog_cb, self);
628
+ * }
629
+ * ```
630
+ *
631
+ * ## AdwMessageDialog as GtkBuildable
632
+ *
633
+ * `AdwMessageDialog` supports adding responses in UI definitions by via the
634
+ * `<responses>` element that may contain multiple `<response>` elements, each
635
+ * representing a response.
636
+ *
637
+ * Each of the `<response>` elements must have the `id` attribute specifying the
638
+ * response ID. The contents of the element are used as the response label.
639
+ *
640
+ * Response labels can be translated with the usual `translatable`, `context`
641
+ * and `comments` attributes.
642
+ *
643
+ * The `<response>` elements can also have `enabled` and/or `appearance`
644
+ * attributes. See [`MessageDialog.set_response_enabled`](https://docs.gtk.org/messagedialog/method.set_response_enabled.html) and
645
+ * [`MessageDialog.set_response_appearance`](https://docs.gtk.org/messagedialog/method.set_response_appearance.html) for details.
646
+ *
647
+ * Example of an `AdwMessageDialog` UI definition:
648
+ *
649
+ * ```xml
650
+ * <object class="AdwMessageDialog" id="dialog">
651
+ * <property name="heading" translatable="yes">Save Changes?</property>
652
+ * <property name="body" translatable="yes">Open documents contain unsaved changes. Changes which are not saved will be permanently lost.</property>
653
+ * <property name="default-response">save</property>
654
+ * <property name="close-response">cancel</property>
655
+ * <signal name="response" handler="response_cb"/>
656
+ * <responses>
657
+ * <response id="cancel" translatable="yes">_Cancel</response>
658
+ * <response id="discard" translatable="yes" appearance="destructive">_Discard</response>
659
+ * <response id="save" translatable="yes" appearance="suggested" enabled="false">_Save</response>
660
+ * </responses>
661
+ * </object>
662
+ * ```
663
+ *
664
+ * ## Accessibility
665
+ *
666
+ * `AdwMessageDialog` uses the `GTK_ACCESSIBLE_ROLE_DIALOG` role.
667
+ */
668
+ export const AdwMessageDialog: (props: AdwMessageDialogProps) => ReactNode = createSlotWidget<AdwMessageDialogProps>("AdwMessageDialog", ["extraChild"]);
669
+
670
+ /**
671
+ * A widget presenting sidebar and content side by side or as a navigation view.
672
+ *
673
+ * ![navigation-split-view](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/navigation-split-view.png)
674
+ * ![navigation-split-view-collapsed](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/navigation-split-view-collapsed.png)
675
+ *
676
+ * `AdwNavigationSplitView` has two [`NavigationPage`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/class.NavigationPage.html) children: sidebar and
677
+ * content, and displays them side by side.
678
+ *
679
+ * When [`NavigationSplitView.collapsed`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.NavigationSplitView.collapsed.html) is set to `TRUE`, it instead
680
+ * puts both children inside an [`NavigationView`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/class.NavigationView.html). The
681
+ * [`NavigationSplitView.show-content`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.NavigationSplitView.show-content.html) controls which child is visible
682
+ * while collapsed.
683
+ *
684
+ * See also [`OverlaySplitView`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/class.OverlaySplitView.html).
685
+ *
686
+ * `AdwNavigationSplitView` is typically used together with an [`Breakpoint`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/class.Breakpoint.html)
687
+ * setting the `collapsed` property to `TRUE` on small widths, as follows:
688
+ *
689
+ * ```xml
690
+ * <object class="AdwWindow">
691
+ * <property name="width-request">280</property>
692
+ * <property name="height-request">200</property>
693
+ * <property name="default-width">800</property>
694
+ * <property name="default-height">800</property>
695
+ * <child>
696
+ * <object class="AdwBreakpoint">
697
+ * <condition>max-width: 400sp</condition>
698
+ * <setter object="split_view" property="collapsed">True</setter>
699
+ * </object>
700
+ * </child>
701
+ * <property name="content">
702
+ * <object class="AdwNavigationSplitView" id="split_view">
703
+ * <property name="sidebar">
704
+ * <object class="AdwNavigationPage">
705
+ * <property name="title" translatable="yes">Sidebar</property>
706
+ * <property name="child">
707
+ * <!-- ... -->
708
+ * </property>
709
+ * </object>
710
+ * </property>
711
+ * <property name="content">
712
+ * <object class="AdwNavigationPage">
713
+ * <property name="title" translatable="yes">Content</property>
714
+ * <property name="child">
715
+ * <!-- ... -->
716
+ * </property>
717
+ * </object>
718
+ * </property>
719
+ * </object>
720
+ * </property>
721
+ * </object>
722
+ * ```
723
+ *
724
+ * ## Sizing
725
+ *
726
+ * When not collapsed, `AdwNavigationSplitView` changes the sidebar width
727
+ * depending on its own width.
728
+ *
729
+ * If possible, it tries to allocate a fraction of the total width, controlled
730
+ * with the [`NavigationSplitView.sidebar-width-fraction`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.NavigationSplitView.sidebar-width-fraction.html) property.
731
+ *
732
+ * The sidebar also has minimum and maximum sizes, controlled with the
733
+ * [`NavigationSplitView.min-sidebar-width`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.NavigationSplitView.min-sidebar-width.html) and
734
+ * [`NavigationSplitView.max-sidebar-width`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.NavigationSplitView.max-sidebar-width.html) properties.
735
+ *
736
+ * The minimum and maximum sizes are using the length unit specified with the
737
+ * [`NavigationSplitView.sidebar-width-unit`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.NavigationSplitView.sidebar-width-unit.html).
738
+ *
739
+ * By default, sidebar is using 25% of the total width, with 180sp as the
740
+ * minimum size and 280sp as the maximum size.
741
+ *
742
+ * ## Header Bar Integration
743
+ *
744
+ * When used inside `AdwNavigationSplitView`, [`HeaderBar`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/class.HeaderBar.html) will
745
+ * automatically hide the window buttons in the middle.
746
+ *
747
+ * When collapsed, it also displays a back button for the content widget, as
748
+ * well as the page titles. See [`NavigationView`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/class.NavigationView.html) documentation for details.
749
+ *
750
+ * ## Actions
751
+ *
752
+ * `AdwNavigationSplitView` defines the same actions as `AdwNavigationView`, but
753
+ * they can be used even when the split view is not collapsed:
754
+ *
755
+ * - `navigation.push` takes a string parameter specifying the tag of the page
756
+ * to push. If it matches the tag of the content widget, it sets
757
+ * [`NavigationSplitView.show-content`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.NavigationSplitView.show-content.html) to `TRUE`.
758
+ *
759
+ * - `navigation.pop` doesn't take any parameters and sets
760
+ * [`NavigationSplitView.show-content`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.NavigationSplitView.show-content.html) to `FALSE`.
761
+ *
762
+ * ## `AdwNavigationSplitView` as `GtkBuildable`
763
+ *
764
+ * The `AdwNavigationSplitView` implementation of the [`Gtk.Buildable`](https://docs.gtk.org/gtk4/iface.Buildable.html)
765
+ * interface supports setting the sidebar widget by specifying “sidebar” as the
766
+ * “type” attribute of a ``<child>`` element, Specifying “content” child type or
767
+ * omitting it results in setting the content widget.
768
+ *
769
+ * ## CSS nodes
770
+ *
771
+ * `AdwNavigationSplitView` has a single CSS node with the name
772
+ * `navigation-split-view`.
773
+ *
774
+ * When collapsed, it contains a child node with the name `navigation-view`
775
+ * containing both children.
776
+ *
777
+ * ```
778
+ * navigation-split-view
779
+ * ╰── navigation-view
780
+ * ├── [sidebar child]
781
+ * ╰── [content child]
782
+ * ```
783
+ *
784
+ * When not collapsed, it contains two nodes with the name `widget`, one with
785
+ * the `.sidebar-pane` style class, the other one with `.content-view` style
786
+ * class, containing the sidebar and content children respectively.
787
+ *
788
+ * ```
789
+ * navigation-split-view
790
+ * ├── widget.sidebar-pane
791
+ * │ ╰── [sidebar child]
792
+ * ╰── widget.content-pane
793
+ * ╰── [content child]
794
+ * ```
795
+ *
796
+ * ## Accessibility
797
+ *
798
+ * `AdwNavigationSplitView` uses the `GTK_ACCESSIBLE_ROLE_GROUP` role.
799
+ */
800
+ export const AdwNavigationSplitView: ((props: AdwNavigationSplitViewProps) => ReactNode) & {
801
+ Page: (props: NavigationSplitViewPageProps) => ReactNode;
802
+ } = Object.assign(createSlotWidget<AdwNavigationSplitViewProps>("AdwNavigationSplitView", ["content","sidebar"]), {
803
+ Page: createNavigationPageChild<NavigationSplitViewPageProps>("AdwNavigationSplitView"),
804
+ });
805
+
806
+ /**
807
+ * A page-based navigation container.
808
+ *
809
+ * ![navigation-view](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/navigation-view.png)
810
+ *
811
+ * `AdwNavigationView` presents one child at a time, similar to
812
+ * [`Gtk.Stack`](https://docs.gtk.org/gtk4/class.Stack.html).
813
+ *
814
+ * `AdwNavigationView` can only contain [`NavigationPage`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/class.NavigationPage.html) children.
815
+ *
816
+ * It maintains a navigation stack that can be controlled with
817
+ * [`NavigationView.push`](https://docs.gtk.org/navigationview/method.push.html) and [`NavigationView.pop`](https://docs.gtk.org/navigationview/method.pop.html). The whole
818
+ * navigation stack can also be replaced using [`NavigationView.replace`](https://docs.gtk.org/navigationview/method.replace.html).
819
+ *
820
+ * `AdwNavigationView` allows to manage pages statically or dynamically.
821
+ *
822
+ * Static pages can be added using the [`NavigationView.add`](https://docs.gtk.org/navigationview/method.add.html) method. The
823
+ * `AdwNavigationView` will keep a reference to these pages, but they aren't
824
+ * accessible to the user until [`NavigationView.push`](https://docs.gtk.org/navigationview/method.push.html) is called (except
825
+ * for the first page, which is pushed automatically). Use the
826
+ * [`NavigationView.remove`](https://docs.gtk.org/navigationview/method.remove.html) method to remove them. This is useful for
827
+ * applications that have a small number of unique pages and just need
828
+ * navigation between them.
829
+ *
830
+ * Dynamic pages are automatically destroyed once they are popped off the
831
+ * navigation stack. To add a page like this, push it using the
832
+ * [`NavigationView.push`](https://docs.gtk.org/navigationview/method.push.html) method without calling
833
+ * [`NavigationView.add`](https://docs.gtk.org/navigationview/method.add.html) first.
834
+ *
835
+ * ## Tags
836
+ *
837
+ * Static pages, as well as any pages in the navigation stack, can be accessed
838
+ * by their [`NavigationPage.tag`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.NavigationPage.tag.html). For example,
839
+ * [`NavigationView.push_by_tag`](https://docs.gtk.org/navigationview/method.push_by_tag.html) can be used to push a static page that's
840
+ * not in the navigation stack without having to keep a reference to it manually.
841
+ *
842
+ * ## Header Bar Integration
843
+ *
844
+ * When used inside `AdwNavigationView`, [`HeaderBar`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/class.HeaderBar.html) will automatically
845
+ * display a back button that can be used to go back to the previous page when
846
+ * possible. The button also has a context menu, allowing to pop multiple pages
847
+ * at once, potentially across multiple navigation views.
848
+ *
849
+ * Set [`HeaderBar.show-back-button`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.HeaderBar.show-back-button.html) to `FALSE` to disable this behavior
850
+ * in rare scenarios where it's unwanted.
851
+ *
852
+ * `AdwHeaderBar` will also display the title of the `AdwNavigationPage` it's
853
+ * placed into, so most applications shouldn't need to customize it at all.
854
+ *
855
+ * ## Shortcuts and Gestures
856
+ *
857
+ * `AdwNavigationView` supports the following shortcuts for going to the
858
+ * previous page:
859
+ *
860
+ * - `Escape` (unless [`NavigationView.pop-on-escape`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.NavigationView.pop-on-escape.html) is set to
861
+ * `FALSE`)
862
+ * - `Alt`+`←`
863
+ * - Back mouse button
864
+ *
865
+ * Additionally, it supports interactive gestures:
866
+ *
867
+ * - One-finger swipe towards the right on touchscreens
868
+ * - Scrolling towards the right on touchpads (usually two-finger swipe)
869
+ *
870
+ * These gestures have transitions enabled regardless of the
871
+ * [`NavigationView.animate-transitions`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.NavigationView.animate-transitions.html) value.
872
+ *
873
+ * Applications can also enable shortcuts for pushing another page onto the
874
+ * navigation stack via connecting to the [`NavigationView.:get-next-page`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/signal.NavigationView.get-next-page.html)
875
+ * signal, in that case the following shortcuts are supported:
876
+ *
877
+ * - `Alt`+`→`
878
+ * - Forward mouse button
879
+ * - Swipe/scrolling towards the left
880
+ *
881
+ * For right-to-left locales, the gestures and shortcuts are reversed.
882
+ *
883
+ * [`NavigationPage.can-pop`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.NavigationPage.can-pop.html) can be used to disable them, along with the
884
+ * header bar back buttons.
885
+ *
886
+ * ## Actions
887
+ *
888
+ * `AdwNavigationView` defines actions for controlling the navigation stack.
889
+ * actions for controlling the navigation stack:
890
+ *
891
+ * - `navigation.push` takes a string parameter specifying the tag of the page to
892
+ * push, and is equivalent to calling [`NavigationView.push_by_tag`](https://docs.gtk.org/navigationview/method.push_by_tag.html).
893
+ *
894
+ * - `navigation.pop` doesn't take any parameters and pops the current page from
895
+ * the navigation stack, equivalent to calling [`NavigationView.pop`](https://docs.gtk.org/navigationview/method.pop.html).
896
+ *
897
+ * ## `AdwNavigationView` as `GtkBuildable`
898
+ *
899
+ * `AdwNavigationView` allows to add pages as children, equivalent to using the
900
+ * [`NavigationView.add`](https://docs.gtk.org/navigationview/method.add.html) method.
901
+ *
902
+ * Example of an `AdwNavigationView` UI definition:
903
+ *
904
+ * ```xml
905
+ * <object class="AdwNavigationView">
906
+ * <child>
907
+ * <object class="AdwNavigationPage">
908
+ * <property name="title" translatable="yes">Page 1</property>
909
+ * <property name="child">
910
+ * <object class="AdwToolbarView">
911
+ * <child type="top">
912
+ * <object class="AdwHeaderBar"/>
913
+ * </child>
914
+ * <property name="content">
915
+ * <object class="GtkButton">
916
+ * <property name="label" translatable="yes">Open Page 2</property>
917
+ * <property name="halign">center</property>
918
+ * <property name="valign">center</property>
919
+ * <property name="action-name">navigation.push</property>
920
+ * <property name="action-target">'page-2'</property>
921
+ * <style>
922
+ * <class name="pill"/>
923
+ * </style>
924
+ * </object>
925
+ * </property>
926
+ * </object>
927
+ * </property>
928
+ * </object>
929
+ * </child>
930
+ * <child>
931
+ * <object class="AdwNavigationPage">
932
+ * <property name="title" translatable="yes">Page 2</property>
933
+ * <property name="tag">page-2</property>
934
+ * <property name="child">
935
+ * <object class="AdwToolbarView">
936
+ * <child type="top">
937
+ * <object class="AdwHeaderBar"/>
938
+ * </child>
939
+ * <property name="content">
940
+ * <!-- ... -->
941
+ * </property>
942
+ * </object>
943
+ * </property>
944
+ * </object>
945
+ * </child>
946
+ * </object>
947
+ * ```
948
+ *
949
+ * ![navigation-view-example](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/navigation-view-example.png)
950
+ *
951
+ * ## CSS nodes
952
+ *
953
+ * `AdwNavigationView` has a single CSS node with the name `navigation-view`.
954
+ *
955
+ * ## Accessibility
956
+ *
957
+ * `AdwNavigationView` uses the `GTK_ACCESSIBLE_ROLE_GROUP` role.
958
+ */
959
+ export const AdwNavigationView: ((props: AdwNavigationViewProps) => ReactNode) & {
960
+ Page: (props: NavigationViewPageProps) => ReactNode;
961
+ } = Object.assign(createSlotWidget<AdwNavigationViewProps>("AdwNavigationView", []), {
962
+ Page: createNavigationPageChild<NavigationViewPageProps>("AdwNavigationView"),
963
+ });
964
+
965
+ /**
966
+ * A widget presenting sidebar and content side by side or as an overlay.
967
+ *
968
+ * ![overlay-split-view](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/overlay-split-view.png)
969
+ * ![overlay-split-view-collapsed](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/overlay-split-view-collapsed.png)
970
+ *
971
+ * `AdwOverlaySplitView` has two children: sidebar and content, and displays
972
+ * them side by side.
973
+ *
974
+ * When [`OverlaySplitView.collapsed`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.OverlaySplitView.collapsed.html) is set to `TRUE`, the sidebar is
975
+ * instead shown as an overlay above the content widget.
976
+ *
977
+ * The sidebar can be hidden or shown using the
978
+ * [`OverlaySplitView.show-sidebar`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.OverlaySplitView.show-sidebar.html) property.
979
+ *
980
+ * Sidebar can be displayed before or after the content, this can be controlled
981
+ * with the [`OverlaySplitView.sidebar-position`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.OverlaySplitView.sidebar-position.html) property.
982
+ *
983
+ * Collapsing the split view automatically hides the sidebar widget, and
984
+ * uncollapsing it shows the sidebar. If this behavior is not desired, the
985
+ * [`OverlaySplitView.pin-sidebar`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.OverlaySplitView.pin-sidebar.html) property can be used to override it.
986
+ *
987
+ * `AdwOverlaySplitView` supports an edge swipe gesture for showing the sidebar,
988
+ * and a swipe from the sidebar for hiding it. Gestures are only supported on
989
+ * touchscreen, but not touchpad. Gestures can be controlled with the
990
+ * [`OverlaySplitView.enable-show-gesture`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.OverlaySplitView.enable-show-gesture.html) and
991
+ * [`OverlaySplitView.enable-hide-gesture`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.OverlaySplitView.enable-hide-gesture.html) properties.
992
+ *
993
+ * See also [`NavigationSplitView`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/class.NavigationSplitView.html).
994
+ *
995
+ * `AdwOverlaySplitView` is typically used together with an [`Breakpoint`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/class.Breakpoint.html)
996
+ * setting the `collapsed` property to `TRUE` on small widths, as follows:
997
+ *
998
+ * ```xml
999
+ * <object class="AdwWindow">
1000
+ * <property name="default-width">800</property>
1001
+ * <property name="default-height">800</property>
1002
+ * <child>
1003
+ * <object class="AdwBreakpoint">
1004
+ * <condition>max-width: 400sp</condition>
1005
+ * <setter object="split_view" property="collapsed">True</setter>
1006
+ * </object>
1007
+ * </child>
1008
+ * <property name="content">
1009
+ * <object class="AdwOverlaySplitView" id="split_view">
1010
+ * <property name="sidebar">
1011
+ * <!-- ... -->
1012
+ * </property>
1013
+ * <property name="content">
1014
+ * <!-- ... -->
1015
+ * </property>
1016
+ * </object>
1017
+ * </property>
1018
+ * </object>
1019
+ * ```
1020
+ *
1021
+ * `AdwOverlaySplitView` is often used for implementing the
1022
+ * utility pane
1023
+ * pattern.
1024
+ *
1025
+ * ## Sizing
1026
+ *
1027
+ * When not collapsed, `AdwOverlaySplitView` changes the sidebar width
1028
+ * depending on its own width.
1029
+ *
1030
+ * If possible, it tries to allocate a fraction of the total width, controlled
1031
+ * with the [`OverlaySplitView.sidebar-width-fraction`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.OverlaySplitView.sidebar-width-fraction.html) property.
1032
+ *
1033
+ * The sidebar also has minimum and maximum sizes, controlled with the
1034
+ * [`OverlaySplitView.min-sidebar-width`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.OverlaySplitView.min-sidebar-width.html) and
1035
+ * [`OverlaySplitView.max-sidebar-width`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.OverlaySplitView.max-sidebar-width.html) properties.
1036
+ *
1037
+ * The minimum and maximum sizes are using the length unit specified with the
1038
+ * [`OverlaySplitView.sidebar-width-unit`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.OverlaySplitView.sidebar-width-unit.html).
1039
+ *
1040
+ * By default, sidebar is using 25% of the total width, with 180sp as the
1041
+ * minimum size and 280sp as the maximum size.
1042
+ *
1043
+ * When collapsed, the preferred width fraction is ignored and the sidebar uses
1044
+ * [`OverlaySplitView.max-sidebar-width`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.OverlaySplitView.max-sidebar-width.html) when possible.
1045
+ *
1046
+ * ## Header Bar Integration
1047
+ *
1048
+ * When used inside `AdwOverlaySplitView`, [`HeaderBar`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/class.HeaderBar.html) will automatically
1049
+ * hide the window buttons in the middle.
1050
+ *
1051
+ * ## `AdwOverlaySplitView` as `GtkBuildable`
1052
+ *
1053
+ * The `AdwOverlaySplitView` implementation of the [`Gtk.Buildable`](https://docs.gtk.org/gtk4/iface.Buildable.html)
1054
+ * interface supports setting the sidebar widget by specifying “sidebar” as the
1055
+ * “type” attribute of a ``<child>`` element, Specifying “content” child type or
1056
+ * omitting it results in setting the content widget.
1057
+ *
1058
+ * ## CSS nodes
1059
+ *
1060
+ * `AdwOverlaySplitView` has a single CSS node with the name
1061
+ * `overlay-split-view`.
1062
+ *
1063
+ * It contains two nodes with the name `widget`, containing the sidebar and
1064
+ * content children.
1065
+ *
1066
+ * When not collapsed, they have the `.sidebar-view` and `.content-view` style
1067
+ * classes respectively.
1068
+ *
1069
+ * ```
1070
+ * overlay-split-view
1071
+ * ├── widget.sidebar-pane
1072
+ * │ ╰── [sidebar child]
1073
+ * ╰── widget.content-pane
1074
+ * ╰── [content child]
1075
+ * ```
1076
+ *
1077
+ * When collapsed, the one containing the sidebar child has the `.background`
1078
+ * style class and the other one has no style classes.
1079
+ *
1080
+ * ```
1081
+ * overlay-split-view
1082
+ * ├── widget.background
1083
+ * │ ╰── [sidebar child]
1084
+ * ╰── widget
1085
+ * ╰── [content child]
1086
+ * ```
1087
+ *
1088
+ * ## Accessibility
1089
+ *
1090
+ * `AdwOverlaySplitView` uses the `GTK_ACCESSIBLE_ROLE_GROUP` role.
1091
+ */
1092
+ export const AdwOverlaySplitView: (props: AdwOverlaySplitViewProps) => ReactNode = createSlotWidget<AdwOverlaySplitViewProps>("AdwOverlaySplitView", ["content","sidebar"]);
1093
+
1094
+ /**
1095
+ * A group of preference rows.
1096
+ *
1097
+ * ![preferences-group](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/preferences-group.png)
1098
+ *
1099
+ * An `AdwPreferencesGroup` represents a group or tightly related preferences,
1100
+ * which in turn are represented by [`PreferencesRow`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/class.PreferencesRow.html).
1101
+ *
1102
+ * To summarize the role of the preferences it gathers, a group can have both a
1103
+ * title and a description. The title will be used by [`PreferencesDialog`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/class.PreferencesDialog.html)
1104
+ * to let the user look for a preference.
1105
+ *
1106
+ * The [`PreferencesGroup.separate-rows`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.PreferencesGroup.separate-rows.html) property can be used to
1107
+ * separate the rows within the group, same as when using the
1108
+ * `.boxed-list-separate` style class
1109
+ * instead of `.boxed-list`.
1110
+ *
1111
+ * ## AdwPreferencesGroup as GtkBuildable
1112
+ *
1113
+ * The `AdwPreferencesGroup` implementation of the [`Gtk.Buildable`](https://docs.gtk.org/gtk4/iface.Buildable.html) interface
1114
+ * supports adding [`PreferencesRow`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/class.PreferencesRow.html)s to the list by omitting "type". If "type"
1115
+ * is omitted and the widget isn't a [`PreferencesRow`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/class.PreferencesRow.html) the child is added to
1116
+ * a box below the list.
1117
+ *
1118
+ * When the "type" attribute of a child is `header-suffix`, the child
1119
+ * is set as the suffix on the end of the title and description.
1120
+ *
1121
+ * ## CSS nodes
1122
+ *
1123
+ * `AdwPreferencesGroup` has a single CSS node with name `preferencesgroup`.
1124
+ *
1125
+ * ## Accessibility
1126
+ *
1127
+ * `AdwPreferencesGroup` uses the `GTK_ACCESSIBLE_ROLE_GROUP` role.
1128
+ */
1129
+ export const AdwPreferencesGroup: (props: AdwPreferencesGroupProps) => ReactNode = createSlotWidget<AdwPreferencesGroupProps>("AdwPreferencesGroup", ["headerSuffix"]);
1130
+
1131
+ /**
1132
+ * A page from [`PreferencesDialog`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/class.PreferencesDialog.html).
1133
+ *
1134
+ * ![preferences-page](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/preferences-page.png)
1135
+ *
1136
+ * The `AdwPreferencesPage` widget gathers preferences groups into a single page
1137
+ * of a preferences window.
1138
+ *
1139
+ * ## CSS nodes
1140
+ *
1141
+ * `AdwPreferencesPage` has a single CSS node with name `preferencespage`.
1142
+ *
1143
+ * ## Accessibility
1144
+ *
1145
+ * `AdwPreferencesPage` uses the `GTK_ACCESSIBLE_ROLE_GROUP` role.
1146
+ */
1147
+ export const AdwPreferencesPage: (props: AdwPreferencesPageProps) => ReactNode = createSlotWidget<AdwPreferencesPageProps>("AdwPreferencesPage", ["banner"]);
1148
+
1149
+ /**
1150
+ * A combined button and dropdown widget.
1151
+ *
1152
+ * ![split-button](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/split-button.png)
1153
+ *
1154
+ * `AdwSplitButton` is typically used to present a set of actions in a menu,
1155
+ * but allow access to one of them with a single click.
1156
+ *
1157
+ * The API is very similar to [`Gtk.Button`](https://docs.gtk.org/gtk4/class.Button.html) and [`Gtk.MenuButton`](https://docs.gtk.org/gtk4/class.MenuButton.html), see
1158
+ * their documentation for details.
1159
+ *
1160
+ * ## CSS nodes
1161
+ *
1162
+ * ```
1163
+ * splitbutton[.image-button][.text-button]
1164
+ * ├── button
1165
+ * │ ╰── <content>
1166
+ * ├── separator
1167
+ * ╰── menubutton
1168
+ * ╰── button.toggle
1169
+ * ╰── arrow
1170
+ * ```
1171
+ *
1172
+ * `AdwSplitButton`'s CSS node is called `splitbutton`. It contains the css
1173
+ * nodes: `button`, `separator`, `menubutton`. See [`Gtk.MenuButton`](https://docs.gtk.org/gtk4/class.MenuButton.html)
1174
+ * documentation for the `menubutton` contents.
1175
+ *
1176
+ * The main CSS node will contain the `.image-button` or `.text-button` style
1177
+ * classes matching the button contents. The nested button nodes will never
1178
+ * contain them.
1179
+ *
1180
+ * ## Style classes
1181
+ *
1182
+ * `AdwSplitButton` can use some of the same style classes as [`Gtk.Button`](https://docs.gtk.org/gtk4/class.Button.html):
1183
+ *
1184
+ * - `.suggested-action`
1185
+ * - `.destructive-action`
1186
+ * - `.flat`
1187
+ * - `.raised`
1188
+ *
1189
+ * Other style classes, like `.pill`, cannot be used.
1190
+ *
1191
+ * ## Accessibility
1192
+ *
1193
+ * `AdwSplitButton` uses the `GTK_ACCESSIBLE_ROLE_GROUP` role.
1194
+ */
1195
+ export const AdwSplitButton: (props: AdwSplitButtonProps) => ReactNode = createSlotWidget<AdwSplitButtonProps>("AdwSplitButton", ["popover"]);
1196
+
1197
+ /**
1198
+ * A tab bar for [`TabView`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/class.TabView.html).
1199
+ *
1200
+ * ![tab-bar](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/tab-bar.png)
1201
+ *
1202
+ * The `AdwTabBar` widget is a tab bar that can be used with conjunction with
1203
+ * `AdwTabView`. It is typically used as a top bar within [`ToolbarView`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/class.ToolbarView.html).
1204
+ *
1205
+ * `AdwTabBar` can autohide and can optionally contain action widgets on both
1206
+ * sides of the tabs.
1207
+ *
1208
+ * When there's not enough space to show all the tabs, `AdwTabBar` will scroll
1209
+ * them. Pinned tabs always stay visible and aren't a part of the scrollable
1210
+ * area.
1211
+ *
1212
+ * ## CSS nodes
1213
+ *
1214
+ * `AdwTabBar` has a single CSS node with name `tabbar`.
1215
+ *
1216
+ * ## Style classes
1217
+ *
1218
+ * By default `AdwTabBar` look like a part of an `AdwHeaderBar` and is intended
1219
+ * to be used directly attached to one or used as a [`ToolbarView`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/class.ToolbarView.html) toolbar.
1220
+ * The `.inline` style class removes its background,
1221
+ * so that it can be used in different contexts instead.
1222
+ *
1223
+ * ![tab-bar-inline](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/tab-bar-inline.png)
1224
+ */
1225
+ export const AdwTabBar: (props: AdwTabBarProps) => ReactNode = createSlotWidget<AdwTabBarProps>("AdwTabBar", ["endActionWidget","startActionWidget"]);
1226
+
1227
+ /**
1228
+ * A widget containing a page, as well as top and/or bottom bars.
1229
+ *
1230
+ * ![toolbar-view](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/toolbar-view.png)
1231
+ *
1232
+ * `AdwToolbarView` has a single content widget and one or multiple top and
1233
+ * bottom bars, shown at the top and bottom sides respectively.
1234
+ *
1235
+ * Example of an `AdwToolbarView` UI definition:
1236
+ * ```xml
1237
+ * <object class="AdwToolbarView">
1238
+ * <child type="top">
1239
+ * <object class="AdwHeaderBar"/>
1240
+ * </child>
1241
+ * <property name="content">
1242
+ * <object class="AdwPreferencesPage">
1243
+ * <!-- ... -->
1244
+ * </object>
1245
+ * </property>
1246
+ * </object>
1247
+ * ```
1248
+ *
1249
+ * The following kinds of top and bottom bars are supported:
1250
+ *
1251
+ * - [`HeaderBar`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/class.HeaderBar.html)
1252
+ * - [`TabBar`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/class.TabBar.html)
1253
+ * - [`ViewSwitcherBar`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/class.ViewSwitcherBar.html)
1254
+ * - [`Gtk.ActionBar`](https://docs.gtk.org/gtk4/class.ActionBar.html)
1255
+ * - [`Gtk.HeaderBar`](https://docs.gtk.org/gtk4/class.HeaderBar.html)
1256
+ * - [`Gtk.PopoverMenuBar`](https://docs.gtk.org/gtk4/class.PopoverMenuBar.html)
1257
+ * - [`Gtk.SearchBar`](https://docs.gtk.org/gtk4/class.SearchBar.html)
1258
+ * - Any [`Gtk.Box`](https://docs.gtk.org/gtk4/class.Box.html) or a similar widget with the
1259
+ * `.toolbar` style class
1260
+ *
1261
+ * By default, top and bottom bars are flat and scrolling content has a subtle
1262
+ * undershoot shadow, same as when using the
1263
+ * `.undershoot-top` and
1264
+ * `.undershoot-bottom` style
1265
+ * classes. This works well in most cases, e.g. with [`StatusPage`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/class.StatusPage.html) or
1266
+ * [`PreferencesPage`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/class.PreferencesPage.html), where the background at the top and bottom parts of
1267
+ * the page is uniform. Additionally, windows with sidebars should always use
1268
+ * this style.
1269
+ *
1270
+ * [`ToolbarView.top-bar-style`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.ToolbarView.top-bar-style.html) and
1271
+ * [`ToolbarView.bottom-bar-style`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.ToolbarView.bottom-bar-style.html) properties can be used add an opaque
1272
+ * background and a persistent shadow to top and bottom bars, this can be useful
1273
+ * for content such as utility panes,
1274
+ * where some elements are adjacent to the top/bottom bars, or [`TabView`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/class.TabView.html),
1275
+ * where each page can have a different background.
1276
+ *
1277
+ * ![toolbar-view-flat-1](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/toolbar-view-flat-1.png)
1278
+ * ![toolbar-view-flat-2](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/toolbar-view-flat-2.png)
1279
+ * ![toolbar-view-raised](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/toolbar-view-raised.png)
1280
+ *
1281
+ * `AdwToolbarView` ensures the top and bottom bars have consistent backdrop
1282
+ * styles and vertical spacing. For comparison:
1283
+ *
1284
+ * ![toolbar-view-spacing](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/toolbar-view-spacing.png)
1285
+ * ![toolbar-view-spacing-box](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/toolbar-view-spacing-box.png)
1286
+ *
1287
+ * Any top and bottom bars can also be dragged to move the window, equivalent
1288
+ * to putting them into a [`Gtk.WindowHandle`](https://docs.gtk.org/gtk4/class.WindowHandle.html).
1289
+ *
1290
+ * Content is typically place between top and bottom bars, but can also extend
1291
+ * behind them. This is controlled with the
1292
+ * [`ToolbarView.extend-content-to-top-edge`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.ToolbarView.extend-content-to-top-edge.html) and
1293
+ * [`ToolbarView.extend-content-to-bottom-edge`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.ToolbarView.extend-content-to-bottom-edge.html) properties.
1294
+ *
1295
+ * Top and bottom bars can be hidden and revealed with an animation using the
1296
+ * [`ToolbarView.reveal-top-bars`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.ToolbarView.reveal-top-bars.html) and
1297
+ * [`ToolbarView.reveal-bottom-bars`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.ToolbarView.reveal-bottom-bars.html) properties.
1298
+ *
1299
+ * ## `AdwToolbarView` as `GtkBuildable`
1300
+ *
1301
+ * The `AdwToolbarView` implementation of the [`Gtk.Buildable`](https://docs.gtk.org/gtk4/iface.Buildable.html) interface
1302
+ * supports adding a top bar by specifying “top” as the “type” attribute of a
1303
+ * ``<child>`` element, or adding a bottom bar by specifying “bottom”.
1304
+ *
1305
+ * ## Accessibility
1306
+ *
1307
+ * `AdwToolbarView` uses the `GTK_ACCESSIBLE_ROLE_GROUP` role.
1308
+ */
1309
+ export const AdwToolbarView: ((props: AdwToolbarViewProps) => ReactNode) & {
1310
+ AddTopBar: (props: { children?: ReactNode }) => ReactNode;
1311
+ AddBottomBar: (props: { children?: ReactNode }) => ReactNode;
1312
+ } = Object.assign(createSlotWidget<AdwToolbarViewProps>("AdwToolbarView", ["content"]), {
1313
+ AddTopBar: createContainerSlotChild("addTopBar"),
1314
+ AddBottomBar: createContainerSlotChild("addBottomBar"),
1315
+ });
1316
+
1317
+ /**
1318
+ * A view container for [`ViewSwitcher`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/class.ViewSwitcher.html).
1319
+ *
1320
+ * `AdwViewStack` is a container which only shows one page at a time.
1321
+ * It is typically used to hold an application's main views.
1322
+ *
1323
+ * It doesn't provide a way to transition between pages.
1324
+ * Instead, a separate widget such as [`ViewSwitcher`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/class.ViewSwitcher.html) can be used with
1325
+ * `AdwViewStack` to provide this functionality.
1326
+ *
1327
+ * `AdwViewStack` pages can have a title, an icon, an attention request, and a
1328
+ * numbered badge that [`ViewSwitcher`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/class.ViewSwitcher.html) will use to let users identify which
1329
+ * page is which. Set them using the [`ViewStackPage.title`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.ViewStackPage.title.html),
1330
+ * [`ViewStackPage.icon-name`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.ViewStackPage.icon-name.html),
1331
+ * [`ViewStackPage.needs-attention`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.ViewStackPage.needs-attention.html), and
1332
+ * [`ViewStackPage.badge-number`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.ViewStackPage.badge-number.html) properties.
1333
+ *
1334
+ * Unlike [`Gtk.Stack`](https://docs.gtk.org/gtk4/class.Stack.html), transitions between views can only be animated via
1335
+ * a crossfade and size changes are always interpolated. Animations are disabled
1336
+ * by default. Use [`ViewStack.enable-transitions`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.ViewStack.enable-transitions.html) to enable them.
1337
+ *
1338
+ * `AdwViewStack` maintains a [`ViewStackPage`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/class.ViewStackPage.html) object for each added child,
1339
+ * which holds additional per-child properties. You obtain the
1340
+ * [`ViewStackPage`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/class.ViewStackPage.html) for a child with [`ViewStack.get_page`](https://docs.gtk.org/viewstack/method.get_page.html) and you
1341
+ * can obtain a [`Gtk.SelectionModel`](https://docs.gtk.org/gtk4/iface.SelectionModel.html) containing all the pages with
1342
+ * [`ViewStack.get_pages`](https://docs.gtk.org/viewstack/method.get_pages.html).
1343
+ *
1344
+ * ## AdwViewStack as GtkBuildable
1345
+ *
1346
+ * To set child-specific properties in a .ui file, create
1347
+ * [`ViewStackPage`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/class.ViewStackPage.html) objects explicitly, and set the child widget as a
1348
+ * property on it:
1349
+ *
1350
+ * ```xml
1351
+ * <object class="AdwViewStack" id="stack">
1352
+ * <child>
1353
+ * <object class="AdwViewStackPage">
1354
+ * <property name="name">overview</property>
1355
+ * <property name="title">Overview</property>
1356
+ * <property name="child">
1357
+ * <object class="AdwStatusPage">
1358
+ * <property name="title">Welcome!</property>
1359
+ * </object>
1360
+ * </property>
1361
+ * </object>
1362
+ * </child>
1363
+ * </object>
1364
+ * ```
1365
+ *
1366
+ * ## CSS nodes
1367
+ *
1368
+ * `AdwViewStack` has a single CSS node named `stack`.
1369
+ *
1370
+ * ## Accessibility
1371
+ *
1372
+ * `AdwViewStack` uses the `GTK_ACCESSIBLE_ROLE_TAB_PANEL` for the stack pages
1373
+ * which are the accessible parent objects of the child widgets.
1374
+ */
1375
+ export const AdwViewStack: ((props: AdwViewStackProps) => ReactNode) & {
1376
+ Page: (props: StackPageProps) => ReactNode;
1377
+ } = Object.assign(createSlotWidget<AdwViewStackProps>("AdwViewStack", []), {
1378
+ Page: createVirtualChild<StackPageProps>("StackPage"),
1379
+ });
1380
+
1381
+ /**
1382
+ * A freeform window.
1383
+ *
1384
+ * ![window](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/window.png)
1385
+ *
1386
+ * The `AdwWindow` widget is a subclass of [`Gtk.Window`](https://docs.gtk.org/gtk4/class.Window.html) which has no
1387
+ * titlebar area. Instead, [`ToolbarView`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/class.ToolbarView.html) can be used together with
1388
+ * [`HeaderBar`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/class.HeaderBar.html) or [`Gtk.HeaderBar`](https://docs.gtk.org/gtk4/class.HeaderBar.html) as follows:
1389
+ *
1390
+ * ```xml
1391
+ * <object class="AdwWindow">
1392
+ * <property name="content">
1393
+ * <object class="AdwToolbarView">
1394
+ * <child type="top">
1395
+ * <object class="AdwHeaderBar"/>
1396
+ * </child>
1397
+ * <property name="content">
1398
+ * <!-- ... -->
1399
+ * </property>
1400
+ * </object>
1401
+ * </property>
1402
+ * </object>
1403
+ * ```
1404
+ *
1405
+ * Using [`Gtk.Window.titlebar`](https://docs.gtk.org/gtk4/property.Window.titlebar.html) or [`Gtk.Window.child`](https://docs.gtk.org/gtk4/property.Window.child.html)
1406
+ * is not supported and will result in a crash. Use [`Window.content`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.Window.content.html)
1407
+ * instead.
1408
+ *
1409
+ * ## Dialogs
1410
+ *
1411
+ * `AdwWindow` can contain [`Dialog`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/class.Dialog.html). Use [`Dialog.present`](https://docs.gtk.org/dialog/method.present.html) with the
1412
+ * window or a widget within a window to show a dialog.
1413
+ *
1414
+ * ## Breakpoints
1415
+ *
1416
+ * `AdwWindow` can be used with [`Breakpoint`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/class.Breakpoint.html) the same way as
1417
+ * [`BreakpointBin`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/class.BreakpointBin.html). Refer to that widget's documentation for details.
1418
+ *
1419
+ * Example:
1420
+ *
1421
+ * ```xml
1422
+ * <object class="AdwWindow">
1423
+ * <property name="content">
1424
+ * <object class="AdwToolbarView">
1425
+ * <child type="top">
1426
+ * <object class="AdwHeaderBar"/>
1427
+ * </child>
1428
+ * <property name="content">
1429
+ * <!-- ... -->
1430
+ * </property>
1431
+ * <child type="bottom">
1432
+ * <object class="GtkActionBar" id="bottom_bar">
1433
+ * <property name="revealed">True</property>
1434
+ * <property name="visible">False</property>
1435
+ * </object>
1436
+ * </child>
1437
+ * </object>
1438
+ * </property>
1439
+ * <child>
1440
+ * <object class="AdwBreakpoint">
1441
+ * <condition>max-width: 500px</condition>
1442
+ * <setter object="bottom_bar" property="visible">True</setter>
1443
+ * </object>
1444
+ * </child>
1445
+ * </object>
1446
+ * ```
1447
+ *
1448
+ * When breakpoints are used, the minimum size must be larger than the smallest
1449
+ * UI state. `AdwWindow` defaults to the minimum size of 360×200 px. If that's
1450
+ * too small, set the [`Gtk.Widget.width-request`](https://docs.gtk.org/gtk4/property.Widget.width-request.html) and
1451
+ * [`Gtk.Widget.height-request`](https://docs.gtk.org/gtk4/property.Widget.height-request.html) properties manually.
1452
+ *
1453
+ * ## Adaptive Preview
1454
+ *
1455
+ * `AdwWindow` has a debug tool called adaptive preview. It can be opened from
1456
+ * GTK Inspector or by pressing `Ctrl`+`Shift`+`M`,
1457
+ * and controlled via the [`Window.adaptive-preview`](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/property.Window.adaptive-preview.html) property.
1458
+ */
1459
+ export const AdwWindow: (props: AdwWindowProps) => ReactNode = createSlotWidget<AdwWindowProps>("AdwWindow", ["content"]);
1460
+
1461
+ /**
1462
+ * Presents contextual actions.
1463
+ *
1464
+ * ![An example GtkActionBar](https://docs.gtk.org/gtk4/action-bar.png)
1465
+ *
1466
+ * `GtkActionBar` is expected to be displayed below the content and expand
1467
+ * horizontally to fill the area.
1468
+ *
1469
+ * It allows placing children at the start or the end. In addition, it
1470
+ * contains an internal centered box which is centered with respect to
1471
+ * the full width of the box, even if the children at either side take
1472
+ * up different amounts of space.
1473
+ *
1474
+ * # GtkActionBar as GtkBuildable
1475
+ *
1476
+ * The `GtkActionBar` implementation of the `GtkBuildable` interface supports
1477
+ * adding children at the start or end sides by specifying “start” or “end” as
1478
+ * the “type” attribute of a ``<child>`` element, or setting the center widget
1479
+ * by specifying “center” value.
1480
+ *
1481
+ * # CSS nodes
1482
+ *
1483
+ * ```
1484
+ * actionbar
1485
+ * ╰── revealer
1486
+ * ╰── box
1487
+ * ├── box.start
1488
+ * │ ╰── [start children]
1489
+ * ├── [center widget]
1490
+ * ╰── box.end
1491
+ * ╰── [end children]
1492
+ * ```
1493
+ *
1494
+ * A `GtkActionBar`'s CSS node is called `actionbar`. It contains a `revealer`
1495
+ * subnode, which contains a `box` subnode, which contains two `box` subnodes at
1496
+ * the start and end of the action bar, with `start` and `end` style classes
1497
+ * respectively, as well as a center node that represents the center child.
1498
+ *
1499
+ * Each of the boxes contains children packed for that side.
1500
+ */
1501
+ export const GtkActionBar: ((props: GtkActionBarProps) => ReactNode) & {
1502
+ PackStart: (props: { children?: ReactNode }) => ReactNode;
1503
+ PackEnd: (props: { children?: ReactNode }) => ReactNode;
1504
+ } = Object.assign(createSlotWidget<GtkActionBarProps>("GtkActionBar", []), {
1505
+ PackStart: createContainerSlotChild("packStart"),
1506
+ PackEnd: createContainerSlotChild("packEnd"),
1507
+ });
1508
+
1509
+ /**
1510
+ * Arranges three children in a row, keeping the middle child
1511
+ * centered as well as possible.
1512
+ *
1513
+ * ![An example GtkCenterBox](https://docs.gtk.org/gtk4/centerbox.png)
1514
+ *
1515
+ * To add children to `GtkCenterBox`, use [`Gtk.CenterBox.set_start_widget`](https://docs.gtk.org/gtk4/method.CenterBox.set_start_widget.html),
1516
+ * [`Gtk.CenterBox.set_center_widget`](https://docs.gtk.org/gtk4/method.CenterBox.set_center_widget.html) and
1517
+ * [`Gtk.CenterBox.set_end_widget`](https://docs.gtk.org/gtk4/method.CenterBox.set_end_widget.html).
1518
+ *
1519
+ * The sizing and positioning of children can be influenced with the
1520
+ * align and expand properties of the children.
1521
+ *
1522
+ * # GtkCenterBox as GtkBuildable
1523
+ *
1524
+ * The `GtkCenterBox` implementation of the `GtkBuildable` interface
1525
+ * supports placing children in the 3 positions by specifying “start”, “center”
1526
+ * or “end” as the “type” attribute of a ``<child>`` element.
1527
+ *
1528
+ * # CSS nodes
1529
+ *
1530
+ * `GtkCenterBox` uses a single CSS node with the name “box”,
1531
+ *
1532
+ * The first child of the `GtkCenterBox` will be allocated depending on the
1533
+ * text direction, i.e. in left-to-right layouts it will be allocated on the
1534
+ * left and in right-to-left layouts on the right.
1535
+ *
1536
+ * In vertical orientation, the nodes of the children are arranged from top to
1537
+ * bottom.
1538
+ *
1539
+ * # Accessibility
1540
+ *
1541
+ * Until GTK 4.10, `GtkCenterBox` used the [`Gtk.AccessibleRole.group`](https://docs.gtk.org/gtk4/enum.AccessibleRole.group.html) role.
1542
+ *
1543
+ * Starting from GTK 4.12, `GtkCenterBox` uses the [`Gtk.AccessibleRole.generic`](https://docs.gtk.org/gtk4/enum.AccessibleRole.generic.html)
1544
+ * role.
1545
+ */
1546
+ export const GtkCenterBox: (props: GtkCenterBoxProps) => ReactNode = createSlotWidget<GtkCenterBoxProps>("GtkCenterBox", ["centerWidget","endWidget","startWidget"]);
1547
+
1548
+ /**
1549
+ * Allows the user to reveal or conceal a child widget.
1550
+ *
1551
+ * ![An example GtkExpander](https://docs.gtk.org/gtk4/expander.png)
1552
+ *
1553
+ * This is similar to the triangles used in a `GtkTreeView`.
1554
+ *
1555
+ * Normally you use an expander as you would use a frame; you create
1556
+ * the child widget and use [`Gtk.Expander.set_child`](https://docs.gtk.org/gtk4/method.Expander.set_child.html) to add it
1557
+ * to the expander. When the expander is toggled, it will take care of
1558
+ * showing and hiding the child automatically.
1559
+ *
1560
+ * # Special Usage
1561
+ *
1562
+ * There are situations in which you may prefer to show and hide the
1563
+ * expanded widget yourself, such as when you want to actually create
1564
+ * the widget at expansion time. In this case, create a `GtkExpander`
1565
+ * but do not add a child to it. The expander widget has an
1566
+ * [`Gtk.Expander.expanded`](https://docs.gtk.org/gtk4/property.Expander.expanded.html) property which can be used to
1567
+ * monitor its expansion state. You should watch this property with
1568
+ * a signal connection as follows:
1569
+ *
1570
+ * ```c
1571
+ * static void
1572
+ * expander_callback (GObject *object,
1573
+ * GParamSpec *param_spec,
1574
+ * gpointer user_data)
1575
+ * {
1576
+ * GtkExpander *expander;
1577
+ *
1578
+ * expander = GTK_EXPANDER (object);
1579
+ *
1580
+ * if (gtk_expander_get_expanded (expander))
1581
+ * {
1582
+ * // Show or create widgets
1583
+ * }
1584
+ * else
1585
+ * {
1586
+ * // Hide or destroy widgets
1587
+ * }
1588
+ * }
1589
+ *
1590
+ * static void
1591
+ * create_expander (void)
1592
+ * {
1593
+ * GtkWidget *expander = gtk_expander_new_with_mnemonic ("_More Options");
1594
+ * g_signal_connect (expander, "notify::expanded",
1595
+ * G_CALLBACK (expander_callback), NULL);
1596
+ *
1597
+ * // ...
1598
+ * }
1599
+ * ```
1600
+ *
1601
+ * # GtkExpander as GtkBuildable
1602
+ *
1603
+ * An example of a UI definition fragment with GtkExpander:
1604
+ *
1605
+ * ```xml
1606
+ * <object class="GtkExpander">
1607
+ * <property name="label-widget">
1608
+ * <object class="GtkLabel" id="expander-label"/>
1609
+ * </property>
1610
+ * <property name="child">
1611
+ * <object class="GtkEntry" id="expander-content"/>
1612
+ * </property>
1613
+ * </object>
1614
+ * ```
1615
+ *
1616
+ * # CSS nodes
1617
+ *
1618
+ * ```
1619
+ * expander-widget
1620
+ * ╰── box
1621
+ * ├── title
1622
+ * │ ├── expander
1623
+ * │ ╰── <label widget>
1624
+ * ╰── <child>
1625
+ * ```
1626
+ *
1627
+ * `GtkExpander` has a main node `expander-widget`, and subnode `box` containing
1628
+ * the title and child widget. The box subnode `title` contains node `expander`,
1629
+ * i.e. the expand/collapse arrow; then the label widget if any. The arrow of an
1630
+ * expander that is showing its child gets the `:checked` pseudoclass set on it.
1631
+ *
1632
+ * # Accessibility
1633
+ *
1634
+ * `GtkExpander` uses the [`Gtk.AccessibleRole.button`](https://docs.gtk.org/gtk4/enum.AccessibleRole.button.html) role.
1635
+ */
1636
+ export const GtkExpander: (props: GtkExpanderProps) => ReactNode = createSlotWidget<GtkExpanderProps>("GtkExpander", ["labelWidget"]);
1637
+
1638
+ /**
1639
+ * Places its child widgets at fixed positions and with fixed sizes.
1640
+ *
1641
+ * `GtkFixed` performs no automatic layout management.
1642
+ *
1643
+ * For most applications, you should not use this container! It keeps
1644
+ * you from having to learn about the other GTK containers, but it
1645
+ * results in broken applications. With `GtkFixed`, the following
1646
+ * things will result in truncated text, overlapping widgets, and
1647
+ * other display bugs:
1648
+ *
1649
+ * - Themes, which may change widget sizes.
1650
+ *
1651
+ * - Fonts other than the one you used to write the app will of course
1652
+ * change the size of widgets containing text; keep in mind that
1653
+ * users may use a larger font because of difficulty reading the
1654
+ * default, or they may be using a different OS that provides different fonts.
1655
+ *
1656
+ * - Translation of text into other languages changes its size. Also,
1657
+ * display of non-English text will use a different font in many
1658
+ * cases.
1659
+ *
1660
+ * In addition, `GtkFixed` does not pay attention to text direction and
1661
+ * thus may produce unwanted results if your app is run under right-to-left
1662
+ * languages such as Hebrew or Arabic. That is: normally GTK will order
1663
+ * containers appropriately for the text direction, e.g. to put labels to
1664
+ * the right of the thing they label when using an RTL language, but it can’t
1665
+ * do that with `GtkFixed`. So if you need to reorder widgets depending on
1666
+ * the text direction, you would need to manually detect it and adjust child
1667
+ * positions accordingly.
1668
+ *
1669
+ * Finally, fixed positioning makes it kind of annoying to add/remove
1670
+ * UI elements, since you have to reposition all the other elements. This
1671
+ * is a long-term maintenance problem for your application.
1672
+ *
1673
+ * If you know none of these things are an issue for your application,
1674
+ * and prefer the simplicity of `GtkFixed`, by all means use the
1675
+ * widget. But you should be aware of the tradeoffs.
1676
+ */
1677
+ export const GtkFixed: ((props: GtkFixedProps) => ReactNode) & {
1678
+ Child: (props: FixedChildProps) => ReactNode;
1679
+ } = Object.assign(createSlotWidget<GtkFixedProps>("GtkFixed", []), {
1680
+ Child: createVirtualChild<FixedChildProps>("FixedChild"),
1681
+ });
1682
+
1683
+ /**
1684
+ * Surrounds its child with a decorative frame and an optional label.
1685
+ *
1686
+ * ![An example GtkFrame](https://docs.gtk.org/gtk4/frame.png)
1687
+ *
1688
+ * If present, the label is drawn inside the top edge of the frame.
1689
+ * The horizontal position of the label can be controlled with
1690
+ * [`Gtk.Frame.set_label_align`](https://docs.gtk.org/gtk4/method.Frame.set_label_align.html).
1691
+ *
1692
+ * `GtkFrame` clips its child. You can use this to add rounded corners
1693
+ * to widgets, but be aware that it also cuts off shadows.
1694
+ *
1695
+ * # GtkFrame as GtkBuildable
1696
+ *
1697
+ * An example of a UI definition fragment with GtkFrame:
1698
+ *
1699
+ * ```xml
1700
+ * <object class="GtkFrame">
1701
+ * <property name="label-widget">
1702
+ * <object class="GtkLabel" id="frame_label"/>
1703
+ * </property>
1704
+ * <property name="child">
1705
+ * <object class="GtkEntry" id="frame_content"/>
1706
+ * </property>
1707
+ * </object>
1708
+ * ```
1709
+ *
1710
+ * # CSS nodes
1711
+ *
1712
+ * ```
1713
+ * frame
1714
+ * ├── <label widget>
1715
+ * ╰── <child>
1716
+ * ```
1717
+ *
1718
+ * `GtkFrame` has a main CSS node with name “frame”, which is used to draw the
1719
+ * visible border. You can set the appearance of the border using CSS properties
1720
+ * like “border-style” on this node.
1721
+ *
1722
+ * # Accessibility
1723
+ *
1724
+ * `GtkFrame` uses the [`Gtk.AccessibleRole.group`](https://docs.gtk.org/gtk4/enum.AccessibleRole.group.html) role.
1725
+ */
1726
+ export const GtkFrame: (props: GtkFrameProps) => ReactNode = createSlotWidget<GtkFrameProps>("GtkFrame", ["labelWidget"]);
1727
+
1728
+ /**
1729
+ * Arranges its child widgets in rows and columns.
1730
+ *
1731
+ * ![An example GtkGrid](https://docs.gtk.org/gtk4/grid.png)
1732
+ *
1733
+ * It supports arbitrary positions and horizontal/vertical spans.
1734
+ *
1735
+ * Children are added using [`Gtk.Grid.attach`](https://docs.gtk.org/gtk4/method.Grid.attach.html). They can span multiple
1736
+ * rows or columns. It is also possible to add a child next to an existing
1737
+ * child, using [`Gtk.Grid.attach_next_to`](https://docs.gtk.org/gtk4/method.Grid.attach_next_to.html). To remove a child from the
1738
+ * grid, use [`Gtk.Grid.remove`](https://docs.gtk.org/gtk4/method.Grid.remove.html).
1739
+ *
1740
+ * The behaviour of `GtkGrid` when several children occupy the same grid
1741
+ * cell is undefined.
1742
+ *
1743
+ * # GtkGrid as GtkBuildable
1744
+ *
1745
+ * Every child in a `GtkGrid` has access to a custom [`Gtk.Buildable`](https://docs.gtk.org/gtk4/iface.Buildable.html)
1746
+ * element, called `<layout>`. It can by used to specify a position in the
1747
+ * grid and optionally spans. All properties that can be used in the `<layout>`
1748
+ * element are implemented by [`Gtk.GridLayoutChild`](https://docs.gtk.org/gtk4/class.GridLayoutChild.html).
1749
+ *
1750
+ * It is implemented by `GtkWidget` using [`Gtk.LayoutManager`](https://docs.gtk.org/gtk4/class.LayoutManager.html).
1751
+ *
1752
+ * To showcase it, here is a simple example:
1753
+ *
1754
+ * ```xml
1755
+ * <object class="GtkGrid" id="my_grid">
1756
+ * <child>
1757
+ * <object class="GtkButton" id="button1">
1758
+ * <property name="label">Button 1</property>
1759
+ * <layout>
1760
+ * <property name="column">0</property>
1761
+ * <property name="row">0</property>
1762
+ * </layout>
1763
+ * </object>
1764
+ * </child>
1765
+ * <child>
1766
+ * <object class="GtkButton" id="button2">
1767
+ * <property name="label">Button 2</property>
1768
+ * <layout>
1769
+ * <property name="column">1</property>
1770
+ * <property name="row">0</property>
1771
+ * </layout>
1772
+ * </object>
1773
+ * </child>
1774
+ * <child>
1775
+ * <object class="GtkButton" id="button3">
1776
+ * <property name="label">Button 3</property>
1777
+ * <layout>
1778
+ * <property name="column">2</property>
1779
+ * <property name="row">0</property>
1780
+ * <property name="row-span">2</property>
1781
+ * </layout>
1782
+ * </object>
1783
+ * </child>
1784
+ * <child>
1785
+ * <object class="GtkButton" id="button4">
1786
+ * <property name="label">Button 4</property>
1787
+ * <layout>
1788
+ * <property name="column">0</property>
1789
+ * <property name="row">1</property>
1790
+ * <property name="column-span">2</property>
1791
+ * </layout>
1792
+ * </object>
1793
+ * </child>
1794
+ * </object>
1795
+ * ```
1796
+ *
1797
+ * It organizes the first two buttons side-by-side in one cell each.
1798
+ * The third button is in the last column but spans across two rows.
1799
+ * This is defined by the `row-span` property. The last button is
1800
+ * located in the second row and spans across two columns, which is
1801
+ * defined by the `column-span` property.
1802
+ *
1803
+ * # CSS nodes
1804
+ *
1805
+ * `GtkGrid` uses a single CSS node with name `grid`.
1806
+ *
1807
+ * # Accessibility
1808
+ *
1809
+ * Until GTK 4.10, `GtkGrid` used the [`Gtk.AccessibleRole.group`](https://docs.gtk.org/gtk4/enum.AccessibleRole.group.html) role.
1810
+ *
1811
+ * Starting from GTK 4.12, `GtkGrid` uses the [`Gtk.AccessibleRole.generic`](https://docs.gtk.org/gtk4/enum.AccessibleRole.generic.html) role.
1812
+ */
1813
+ export const GtkGrid: ((props: GtkGridProps) => ReactNode) & {
1814
+ Child: (props: GridChildProps) => ReactNode;
1815
+ } = Object.assign(createSlotWidget<GtkGridProps>("GtkGrid", []), {
1816
+ Child: createVirtualChild<GridChildProps>("GridChild"),
1817
+ });
1818
+
1819
+ /**
1820
+ * Creates a custom titlebar for a window.
1821
+ *
1822
+ * ![An example GtkHeaderBar](https://docs.gtk.org/gtk4/headerbar.png)
1823
+ *
1824
+ * `GtkHeaderBar` is similar to a horizontal `GtkCenterBox`. It allows
1825
+ * children to be placed at the start or the end. In addition, it allows
1826
+ * the window title to be displayed. The title will be centered with respect
1827
+ * to the width of the box, even if the children at either side take up
1828
+ * different amounts of space.
1829
+ *
1830
+ * `GtkHeaderBar` can add typical window frame controls, such as minimize,
1831
+ * maximize and close buttons, or the window icon.
1832
+ *
1833
+ * For these reasons, `GtkHeaderBar` is the natural choice for use as the
1834
+ * custom titlebar widget of a `GtkWindow` (see [`Gtk.Window.set_titlebar`](https://docs.gtk.org/gtk4/method.Window.set_titlebar.html)),
1835
+ * as it gives features typical of titlebars while allowing the addition of
1836
+ * child widgets.
1837
+ *
1838
+ * ## GtkHeaderBar as GtkBuildable
1839
+ *
1840
+ * The `GtkHeaderBar` implementation of the `GtkBuildable` interface supports
1841
+ * adding children at the start or end sides by specifying “start” or “end” as
1842
+ * the “type” attribute of a ``<child>`` element, or setting the title widget by
1843
+ * specifying “title” value.
1844
+ *
1845
+ * By default the `GtkHeaderBar` uses a `GtkLabel` displaying the title of the
1846
+ * window it is contained in as the title widget, equivalent to the following
1847
+ * UI definition:
1848
+ *
1849
+ * ```xml
1850
+ * <object class="GtkHeaderBar">
1851
+ * <property name="title-widget">
1852
+ * <object class="GtkLabel">
1853
+ * <property name="label" translatable="yes">Label</property>
1854
+ * <property name="single-line-mode">True</property>
1855
+ * <property name="ellipsize">end</property>
1856
+ * <property name="width-chars">5</property>
1857
+ * <style>
1858
+ * <class name="title"/>
1859
+ * </style>
1860
+ * </object>
1861
+ * </property>
1862
+ * </object>
1863
+ * ```
1864
+ *
1865
+ * # CSS nodes
1866
+ *
1867
+ * ```
1868
+ * headerbar
1869
+ * ╰── windowhandle
1870
+ * ╰── box
1871
+ * ├── box.start
1872
+ * │ ├── windowcontrols.start
1873
+ * │ ╰── [other children]
1874
+ * ├── [Title Widget]
1875
+ * ╰── box.end
1876
+ * ├── [other children]
1877
+ * ╰── windowcontrols.end
1878
+ * ```
1879
+ *
1880
+ * A `GtkHeaderBar`'s CSS node is called `headerbar`. It contains a `windowhandle`
1881
+ * subnode, which contains a `box` subnode, which contains two `box` subnodes at
1882
+ * the start and end of the header bar, as well as a center node that represents
1883
+ * the title.
1884
+ *
1885
+ * Each of the boxes contains a `windowcontrols` subnode, see
1886
+ * [`Gtk.WindowControls`](https://docs.gtk.org/gtk4/class.WindowControls.html) for details, as well as other children.
1887
+ *
1888
+ * # Accessibility
1889
+ *
1890
+ * `GtkHeaderBar` uses the [`Gtk.AccessibleRole.group`](https://docs.gtk.org/gtk4/enum.AccessibleRole.group.html) role.
1891
+ */
1892
+ export const GtkHeaderBar: ((props: GtkHeaderBarProps) => ReactNode) & {
1893
+ PackStart: (props: { children?: ReactNode }) => ReactNode;
1894
+ PackEnd: (props: { children?: ReactNode }) => ReactNode;
1895
+ } = Object.assign(createSlotWidget<GtkHeaderBarProps>("GtkHeaderBar", ["titleWidget"]), {
1896
+ PackStart: createContainerSlotChild("packStart"),
1897
+ PackEnd: createContainerSlotChild("packEnd"),
1898
+ });
1899
+
1900
+ /**
1901
+ * Displays a popup when clicked.
1902
+ *
1903
+ * ![An example GtkMenuButton](https://docs.gtk.org/gtk4/menu-button.png)
1904
+ *
1905
+ * This popup can be provided either as a `GtkPopover` or as an abstract
1906
+ * `GMenuModel`.
1907
+ *
1908
+ * The `GtkMenuButton` widget can show either an icon (set with the
1909
+ * [`Gtk.MenuButton.icon-name`](https://docs.gtk.org/gtk4/property.MenuButton.icon-name.html) property) or a label (set with the
1910
+ * [`Gtk.MenuButton.label`](https://docs.gtk.org/gtk4/property.MenuButton.label.html) property). If neither is explicitly set,
1911
+ * a [`Gtk.Image`](https://docs.gtk.org/gtk4/class.Image.html) is automatically created, using an arrow image oriented
1912
+ * according to [`Gtk.MenuButton.direction`](https://docs.gtk.org/gtk4/property.MenuButton.direction.html) or the generic
1913
+ * “open-menu-symbolic” icon if the direction is not set.
1914
+ *
1915
+ * The positioning of the popup is determined by the
1916
+ * [`Gtk.MenuButton.direction`](https://docs.gtk.org/gtk4/property.MenuButton.direction.html) property of the menu button.
1917
+ *
1918
+ * For menus, the [`Gtk.Widget.halign`](https://docs.gtk.org/gtk4/property.Widget.halign.html) and [`Gtk.Widget.valign`](https://docs.gtk.org/gtk4/property.Widget.valign.html)
1919
+ * properties of the menu are also taken into account. For example, when the
1920
+ * direction is %GTK_ARROW_DOWN and the horizontal alignment is %GTK_ALIGN_START,
1921
+ * the menu will be positioned below the button, with the starting edge
1922
+ * (depending on the text direction) of the menu aligned with the starting
1923
+ * edge of the button. If there is not enough space below the button, the
1924
+ * menu is popped up above the button instead. If the alignment would move
1925
+ * part of the menu offscreen, it is “pushed in”.
1926
+ *
1927
+ * | | start | center | end |
1928
+ * | - | --- | --- | --- |
1929
+ * | **down** | ![](https://docs.gtk.org/gtk4/down-start.png) | ![](https://docs.gtk.org/gtk4/down-center.png) | ![](https://docs.gtk.org/gtk4/down-end.png) |
1930
+ * | **up** | ![](https://docs.gtk.org/gtk4/up-start.png) | ![](https://docs.gtk.org/gtk4/up-center.png) | ![](https://docs.gtk.org/gtk4/up-end.png) |
1931
+ * | **left** | ![](https://docs.gtk.org/gtk4/left-start.png) | ![](https://docs.gtk.org/gtk4/left-center.png) | ![](https://docs.gtk.org/gtk4/left-end.png) |
1932
+ * | **right** | ![](https://docs.gtk.org/gtk4/right-start.png) | ![](https://docs.gtk.org/gtk4/right-center.png) | ![](https://docs.gtk.org/gtk4/right-end.png) |
1933
+ *
1934
+ * # CSS nodes
1935
+ *
1936
+ * ```
1937
+ * menubutton
1938
+ * ╰── button.toggle
1939
+ * ╰── <content>
1940
+ * ╰── [arrow]
1941
+ * ```
1942
+ *
1943
+ * `GtkMenuButton` has a single CSS node with name `menubutton`
1944
+ * which contains a `button` node with a `.toggle` style class.
1945
+ *
1946
+ * If the button contains an icon, it will have the `.image-button` style class,
1947
+ * if it contains text, it will have `.text-button` style class. If an arrow is
1948
+ * visible in addition to an icon, text or a custom child, it will also have
1949
+ * `.arrow-button` style class.
1950
+ *
1951
+ * Inside the toggle button content, there is an `arrow` node for
1952
+ * the indicator, which will carry one of the `.none`, `.up`, `.down`,
1953
+ * `.left` or `.right` style classes to indicate the direction that
1954
+ * the menu will appear in. The CSS is expected to provide a suitable
1955
+ * image for each of these cases using the `-gtk-icon-source` property.
1956
+ *
1957
+ * Optionally, the `menubutton` node can carry the `.circular` style class
1958
+ * to request a round appearance.
1959
+ *
1960
+ * # Accessibility
1961
+ *
1962
+ * `GtkMenuButton` uses the [`Gtk.AccessibleRole.button`](https://docs.gtk.org/gtk4/enum.AccessibleRole.button.html) role.
1963
+ */
1964
+ export const GtkMenuButton: ((props: GtkMenuButtonProps) => ReactNode) & {
1965
+ MenuItem: (props: MenuItemProps) => ReactNode;
1966
+ MenuSection: (props: MenuSectionProps) => ReactNode;
1967
+ MenuSubmenu: (props: MenuSubmenuProps) => ReactNode;
1968
+ } = Object.assign(createSlotWidget<GtkMenuButtonProps>("GtkMenuButton", ["popover"]), {
1969
+ MenuItem: createMenuChild<MenuItemProps>("MenuItem"),
1970
+ MenuSection: createMenuChild<MenuSectionProps>("MenuSection"),
1971
+ MenuSubmenu: createMenuChild<MenuSubmenuProps>("MenuSubmenu"),
1972
+ });
1973
+
1974
+ /**
1975
+ * Switches between children using tabs.
1976
+ *
1977
+ * ![An example GtkNotebook](https://docs.gtk.org/gtk4/notebook.png)
1978
+ *
1979
+ * There are many configuration options for `GtkNotebook`. Among
1980
+ * other things, you can choose on which edge the tabs appear
1981
+ * (see [`Gtk.Notebook.set_tab_pos`](https://docs.gtk.org/gtk4/method.Notebook.set_tab_pos.html)), whether, if there are
1982
+ * too many tabs to fit the notebook should be made bigger or scrolling
1983
+ * arrows added (see [`Gtk.Notebook.set_scrollable`](https://docs.gtk.org/gtk4/method.Notebook.set_scrollable.html)), and whether
1984
+ * there will be a popup menu allowing the users to switch pages.
1985
+ * (see [`Gtk.Notebook.popup_enable`](https://docs.gtk.org/gtk4/method.Notebook.popup_enable.html)).
1986
+ *
1987
+ * # GtkNotebook as GtkBuildable
1988
+ *
1989
+ * The `GtkNotebook` implementation of the `GtkBuildable` interface
1990
+ * supports placing children into tabs by specifying “tab” as the
1991
+ * “type” attribute of a ``<child>`` element. Note that the content
1992
+ * of the tab must be created before the tab can be filled.
1993
+ * A tab child can be specified without specifying a ``<child>``
1994
+ * type attribute.
1995
+ *
1996
+ * To add a child widget in the notebooks action area, specify
1997
+ * "action-start" or “action-end” as the “type” attribute of the
1998
+ * ``<child>`` element.
1999
+ *
2000
+ * An example of a UI definition fragment with `GtkNotebook`:
2001
+ *
2002
+ * ```xml
2003
+ * <object class="GtkNotebook">
2004
+ * <child>
2005
+ * <object class="GtkLabel" id="notebook-content">
2006
+ * <property name="label">Content</property>
2007
+ * </object>
2008
+ * </child>
2009
+ * <child type="tab">
2010
+ * <object class="GtkLabel" id="notebook-tab">
2011
+ * <property name="label">Tab</property>
2012
+ * </object>
2013
+ * </child>
2014
+ * </object>
2015
+ * ```
2016
+ *
2017
+ * # Shortcuts and Gestures
2018
+ *
2019
+ * `GtkNotebook` supports the following keyboard shortcuts:
2020
+ *
2021
+ * - `Shift`+`F10` or `Menu` opens the context menu.
2022
+ * - `Home` moves the focus to the first tab.
2023
+ * - `End` moves the focus to the last tab.
2024
+ *
2025
+ * Additionally, the following signals have default keybindings:
2026
+ *
2027
+ * - [`Gtk.Notebook.:change-current-page`](https://docs.gtk.org/gtk4/signal.Notebook.change-current-page.html)
2028
+ * - [`Gtk.Notebook.:focus-tab`](https://docs.gtk.org/gtk4/signal.Notebook.focus-tab.html)
2029
+ * - [`Gtk.Notebook.:move-focus-out`](https://docs.gtk.org/gtk4/signal.Notebook.move-focus-out.html)
2030
+ * - [`Gtk.Notebook.:reorder-tab`](https://docs.gtk.org/gtk4/signal.Notebook.reorder-tab.html)
2031
+ * - [`Gtk.Notebook.:select-page`](https://docs.gtk.org/gtk4/signal.Notebook.select-page.html)
2032
+ *
2033
+ * Tabs support drag-and-drop between notebooks sharing the same `group-name`,
2034
+ * or to new windows by handling the `::create-window` signal.
2035
+ *
2036
+ * # Actions
2037
+ *
2038
+ * `GtkNotebook` defines a set of built-in actions:
2039
+ *
2040
+ * - `menu.popup` opens the tabs context menu.
2041
+ *
2042
+ * # CSS nodes
2043
+ *
2044
+ * ```
2045
+ * notebook
2046
+ * ├── header.top
2047
+ * │ ├── [<action widget>]
2048
+ * │ ├── tabs
2049
+ * │ │ ├── [arrow]
2050
+ * │ │ ├── tab
2051
+ * │ │ │ ╰── <tab label>
2052
+ * ┊ ┊ ┊
2053
+ * │ │ ├── tab[.reorderable-page]
2054
+ * │ │ │ ╰── <tab label>
2055
+ * │ │ ╰── [arrow]
2056
+ * │ ╰── [<action widget>]
2057
+ * │
2058
+ * ╰── stack
2059
+ * ├── <child>
2060
+ * ┊
2061
+ * ╰── <child>
2062
+ * ```
2063
+ *
2064
+ * `GtkNotebook` has a main CSS node with name `notebook`, a subnode
2065
+ * with name `header` and below that a subnode with name `tabs` which
2066
+ * contains one subnode per tab with name `tab`.
2067
+ *
2068
+ * If action widgets are present, their CSS nodes are placed next
2069
+ * to the `tabs` node. If the notebook is scrollable, CSS nodes with
2070
+ * name `arrow` are placed as first and last child of the `tabs` node.
2071
+ *
2072
+ * The main node gets the `.frame` style class when the notebook
2073
+ * has a border (see [`Gtk.Notebook.set_show_border`](https://docs.gtk.org/gtk4/method.Notebook.set_show_border.html)).
2074
+ *
2075
+ * The header node gets one of the style class `.top`, `.bottom`,
2076
+ * `.left` or `.right`, depending on where the tabs are placed. For
2077
+ * reorderable pages, the tab node gets the `.reorderable-page` class.
2078
+ *
2079
+ * A `tab` node gets the `.dnd` style class while it is moved with drag-and-drop.
2080
+ *
2081
+ * The nodes are always arranged from left-to-right, regardless of text direction.
2082
+ *
2083
+ * # Accessibility
2084
+ *
2085
+ * `GtkNotebook` uses the following roles:
2086
+ *
2087
+ * - [`Gtk.AccessibleRole.group`](https://docs.gtk.org/gtk4/enum.AccessibleRole.group.html) for the notebook widget
2088
+ * - [`Gtk.AccessibleRole.tab_list`](https://docs.gtk.org/gtk4/enum.AccessibleRole.tab_list.html) for the list of tabs
2089
+ * - [`Gtk.AccessibleRole.tab`](https://docs.gtk.org/gtk4/enum.AccessibleRole.tab.html) role for each tab
2090
+ * - [`Gtk.AccessibleRole.tab_panel`](https://docs.gtk.org/gtk4/enum.AccessibleRole.tab_panel.html) for each page
2091
+ */
2092
+ export const GtkNotebook: ((props: GtkNotebookProps) => ReactNode) & {
2093
+ Page: (props: NotebookPageProps) => ReactNode;
2094
+ PageTab: (props: NotebookPageTabProps) => ReactNode;
2095
+ } = Object.assign(createSlotWidget<GtkNotebookProps>("GtkNotebook", []), {
2096
+ Page: createVirtualChild<NotebookPageProps>("NotebookPage"),
2097
+ PageTab: createVirtualChild<NotebookPageTabProps>("NotebookPageTab"),
2098
+ });
2099
+
2100
+ /**
2101
+ * Places “overlay” widgets on top of a single main child.
2102
+ *
2103
+ * ![An example GtkOverlay](https://docs.gtk.org/gtk4/overlay.png)
2104
+ *
2105
+ * The position of each overlay widget is determined by its
2106
+ * [`Gtk.Widget.halign`](https://docs.gtk.org/gtk4/property.Widget.halign.html) and [`Gtk.Widget.valign`](https://docs.gtk.org/gtk4/property.Widget.valign.html)
2107
+ * properties. E.g. a widget with both alignments set to %GTK_ALIGN_START
2108
+ * will be placed at the top left corner of the `GtkOverlay` container,
2109
+ * whereas an overlay with halign set to %GTK_ALIGN_CENTER and valign set
2110
+ * to %GTK_ALIGN_END will be placed a the bottom edge of the `GtkOverlay`,
2111
+ * horizontally centered. The position can be adjusted by setting the margin
2112
+ * properties of the child to non-zero values.
2113
+ *
2114
+ * More complicated placement of overlays is possible by connecting
2115
+ * to the [`Gtk.Overlay.:get-child-position`](https://docs.gtk.org/gtk4/signal.Overlay.get-child-position.html) signal.
2116
+ *
2117
+ * An overlay’s minimum and natural sizes are those of its main child.
2118
+ * The sizes of overlay children are not considered when measuring these
2119
+ * preferred sizes.
2120
+ *
2121
+ * # GtkOverlay as GtkBuildable
2122
+ *
2123
+ * The `GtkOverlay` implementation of the `GtkBuildable` interface
2124
+ * supports placing a child as an overlay by specifying “overlay” as
2125
+ * the “type” attribute of a ``<child>`` element.
2126
+ *
2127
+ * # CSS nodes
2128
+ *
2129
+ * `GtkOverlay` has a single CSS node with the name “overlay”. Overlay children
2130
+ * whose alignments cause them to be positioned at an edge get the style classes
2131
+ * “.left”, “.right”, “.top”, and/or “.bottom” according to their position.
2132
+ */
2133
+ export const GtkOverlay: ((props: GtkOverlayProps) => ReactNode) & {
2134
+ Child: (props: OverlayChildProps) => ReactNode;
2135
+ } = Object.assign(createSlotWidget<GtkOverlayProps>("GtkOverlay", []), {
2136
+ Child: createVirtualChild<OverlayChildProps>("OverlayChild"),
2137
+ });
2138
+
2139
+ /**
2140
+ * Arranges its children in two panes, horizontally or vertically.
2141
+ *
2142
+ * ![An example GtkPaned](https://docs.gtk.org/gtk4/panes.png)
2143
+ *
2144
+ * The division between the two panes is adjustable by the user
2145
+ * by dragging a handle.
2146
+ *
2147
+ * Child widgets are added to the panes of the widget with
2148
+ * [`Gtk.Paned.set_start_child`](https://docs.gtk.org/gtk4/method.Paned.set_start_child.html) and [`Gtk.Paned.set_end_child`](https://docs.gtk.org/gtk4/method.Paned.set_end_child.html).
2149
+ * The division between the two children is set by default from the size
2150
+ * requests of the children, but it can be adjusted by the user.
2151
+ *
2152
+ * A paned widget draws a separator between the two child widgets and a
2153
+ * small handle that the user can drag to adjust the division. It does not
2154
+ * draw any relief around the children or around the separator. (The space
2155
+ * in which the separator is called the gutter.) Often, it is useful to put
2156
+ * each child inside a [`Gtk.Frame`](https://docs.gtk.org/gtk4/class.Frame.html) so that the gutter appears as a
2157
+ * ridge. No separator is drawn if one of the children is missing.
2158
+ *
2159
+ * Each child has two options that can be set, "resize" and "shrink". If
2160
+ * "resize" is true then, when the `GtkPaned` is resized, that child will
2161
+ * expand or shrink along with the paned widget. If "shrink" is true, then
2162
+ * that child can be made smaller than its requisition by the user.
2163
+ * Setting "shrink" to false allows the application to set a minimum size.
2164
+ * If "resize" is false for both children, then this is treated as if
2165
+ * "resize" is true for both children.
2166
+ *
2167
+ * The application can set the position of the slider as if it were set
2168
+ * by the user, by calling [`Gtk.Paned.set_position`](https://docs.gtk.org/gtk4/method.Paned.set_position.html).
2169
+ *
2170
+ * # Shortcuts and Gestures
2171
+ *
2172
+ * The following signals have default keybindings:
2173
+ *
2174
+ * - [`Gtk.Paned.:accept-position`](https://docs.gtk.org/gtk4/signal.Paned.accept-position.html)
2175
+ * - [`Gtk.Paned.:cancel-position`](https://docs.gtk.org/gtk4/signal.Paned.cancel-position.html)
2176
+ * - [`Gtk.Paned.:cycle-child-focus`](https://docs.gtk.org/gtk4/signal.Paned.cycle-child-focus.html)
2177
+ * - [`Gtk.Paned.:cycle-handle-focus`](https://docs.gtk.org/gtk4/signal.Paned.cycle-handle-focus.html)
2178
+ * - [`Gtk.Paned.:move-handle`](https://docs.gtk.org/gtk4/signal.Paned.move-handle.html)
2179
+ * - [`Gtk.Paned.:toggle-handle-focus`](https://docs.gtk.org/gtk4/signal.Paned.toggle-handle-focus.html)
2180
+ *
2181
+ * # CSS nodes
2182
+ *
2183
+ * ```
2184
+ * paned
2185
+ * ├── <child>
2186
+ * ├── separator[.wide]
2187
+ * ╰── <child>
2188
+ * ```
2189
+ *
2190
+ * `GtkPaned` has a main CSS node with name paned, and a subnode for
2191
+ * the separator with name separator. The subnode gets a .wide style
2192
+ * class when the paned is supposed to be wide.
2193
+ *
2194
+ * In horizontal orientation, the nodes are arranged based on the text
2195
+ * direction, so in left-to-right mode, :first-child will select the
2196
+ * leftmost child, while it will select the rightmost child in
2197
+ * RTL layouts.
2198
+ *
2199
+ * ## Creating a paned widget with minimum sizes.
2200
+ *
2201
+ * ```c
2202
+ * GtkWidget *hpaned = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL);
2203
+ * GtkWidget *frame1 = gtk_frame_new (NULL);
2204
+ * GtkWidget *frame2 = gtk_frame_new (NULL);
2205
+ *
2206
+ * gtk_widget_set_size_request (hpaned, 200, -1);
2207
+ *
2208
+ * gtk_paned_set_start_child (GTK_PANED (hpaned), frame1);
2209
+ * gtk_paned_set_resize_start_child (GTK_PANED (hpaned), TRUE);
2210
+ * gtk_paned_set_shrink_start_child (GTK_PANED (hpaned), FALSE);
2211
+ * gtk_widget_set_size_request (frame1, 50, -1);
2212
+ *
2213
+ * gtk_paned_set_end_child (GTK_PANED (hpaned), frame2);
2214
+ * gtk_paned_set_resize_end_child (GTK_PANED (hpaned), FALSE);
2215
+ * gtk_paned_set_shrink_end_child (GTK_PANED (hpaned), FALSE);
2216
+ * gtk_widget_set_size_request (frame2, 50, -1);
2217
+ * ```
2218
+ */
2219
+ export const GtkPaned: (props: GtkPanedProps) => ReactNode = createSlotWidget<GtkPanedProps>("GtkPaned", ["endChild","startChild"]);
2220
+
2221
+ /**
2222
+ * A subclass of `GtkPopover` that implements menu behavior.
2223
+ *
2224
+ * ![An example GtkPopoverMenu](https://docs.gtk.org/gtk4/menu.png)
2225
+ *
2226
+ * `GtkPopoverMenu` treats its children like menus and allows switching
2227
+ * between them. It can open submenus as traditional, nested submenus,
2228
+ * or in a more touch-friendly sliding fashion.
2229
+ * The property [`Gtk.PopoverMenu.flags`](https://docs.gtk.org/gtk4/property.PopoverMenu.flags.html) controls this appearance.
2230
+ *
2231
+ * `GtkPopoverMenu` is meant to be used primarily with menu models,
2232
+ * using [`Gtk.PopoverMenu.new_from_model`](https://docs.gtk.org/gtk4/ctor.PopoverMenu.new_from_model.html). If you need to put
2233
+ * other widgets such as a `GtkSpinButton` or a `GtkSwitch` into a popover,
2234
+ * you can use [`Gtk.PopoverMenu.add_child`](https://docs.gtk.org/gtk4/method.PopoverMenu.add_child.html).
2235
+ *
2236
+ * For more dialog-like behavior, use a plain `GtkPopover`.
2237
+ *
2238
+ * ## Menu models
2239
+ *
2240
+ * The XML format understood by `GtkBuilder` for `GMenuModel` consists
2241
+ * of a toplevel `<menu>` element, which contains one or more ``<item>``
2242
+ * elements. Each ``<item>`` element contains ``<attribute>`` and `<link>`
2243
+ * elements with a mandatory name attribute. `<link>` elements have the
2244
+ * same content model as `<menu>`. Instead of `<link name="submenu">`
2245
+ * or `<link name="section">`, you can use `<submenu>` or `<section>`
2246
+ * elements.
2247
+ *
2248
+ * ```xml
2249
+ * <menu id='app-menu'>
2250
+ * <section>
2251
+ * <item>
2252
+ * <attribute name='label' translatable='yes'>_New Window</attribute>
2253
+ * <attribute name='action'>app.new</attribute>
2254
+ * </item>
2255
+ * <item>
2256
+ * <attribute name='label' translatable='yes'>_About Sunny</attribute>
2257
+ * <attribute name='action'>app.about</attribute>
2258
+ * </item>
2259
+ * <item>
2260
+ * <attribute name='label' translatable='yes'>_Quit</attribute>
2261
+ * <attribute name='action'>app.quit</attribute>
2262
+ * </item>
2263
+ * </section>
2264
+ * </menu>
2265
+ * ```
2266
+ *
2267
+ * Attribute values can be translated using gettext, like other `GtkBuilder`
2268
+ * content. ``<attribute>`` elements can be marked for translation with a
2269
+ * `translatable="yes"` attribute. It is also possible to specify message
2270
+ * context and translator comments, using the context and comments attributes.
2271
+ * To make use of this, the `GtkBuilder` must have been given the gettext
2272
+ * domain to use.
2273
+ *
2274
+ * The following attributes are used when constructing menu items:
2275
+ *
2276
+ * - "label": a user-visible string to display
2277
+ * - "use-markup": whether the text in the menu item includes Pango markup
2278
+ * - "action": the prefixed name of the action to trigger
2279
+ * - "target": the parameter to use when activating the action
2280
+ * - "icon" and "verb-icon": names of icons that may be displayed
2281
+ * - "submenu-action": name of an action that may be used to track
2282
+ * whether a submenu is open
2283
+ * - "hidden-when": a string used to determine when the item will be hidden.
2284
+ * Possible values include "action-disabled", "action-missing", "macos-menubar".
2285
+ * This is mainly useful for exported menus, see [`Gtk.Application.set_menubar`](https://docs.gtk.org/gtk4/method.Application.set_menubar.html).
2286
+ * - "custom": a string used to match against the ID of a custom child added with
2287
+ * [`Gtk.PopoverMenu.add_child`](https://docs.gtk.org/gtk4/method.PopoverMenu.add_child.html), [`Gtk.PopoverMenuBar.add_child`](https://docs.gtk.org/gtk4/method.PopoverMenuBar.add_child.html),
2288
+ * or in the ui file with `<child type="ID">`.
2289
+ *
2290
+ * The following attributes are used when constructing sections:
2291
+ *
2292
+ * - "label": a user-visible string to use as section heading
2293
+ * - "display-hint": a string used to determine special formatting for the section.
2294
+ * Possible values include "horizontal-buttons", "circular-buttons" and
2295
+ * "inline-buttons". They all indicate that section should be
2296
+ * displayed as a horizontal row of buttons.
2297
+ * - "text-direction": a string used to determine the `GtkTextDirection` to use
2298
+ * when "display-hint" is set to "horizontal-buttons". Possible values
2299
+ * include "rtl", "ltr", and "none".
2300
+ *
2301
+ * The following attributes are used when constructing submenus:
2302
+ *
2303
+ * - "label": a user-visible string to display
2304
+ * - "icon": icon name to display
2305
+ * - "gtk-macos-special": (macOS only, ignored by others) Add special meaning to a menu
2306
+ * in the macOS menu bar. See Using GTK on Apple macOS.
2307
+ *
2308
+ * Menu items will also show accelerators, which are usually associated
2309
+ * with actions via [`Gtk.Application.set_accels_for_action`](https://docs.gtk.org/gtk4/method.Application.set_accels_for_action.html),
2310
+ * [`WidgetClass.add_binding_action`](https://docs.gtk.org/widgetclass/method.add_binding_action.html) or
2311
+ * [`Gtk.ShortcutController.add_shortcut`](https://docs.gtk.org/gtk4/method.ShortcutController.add_shortcut.html).
2312
+ *
2313
+ * # Shortcuts and Gestures
2314
+ *
2315
+ * `GtkPopoverMenu` supports the following keyboard shortcuts:
2316
+ *
2317
+ * - `Space` activates the default widget.
2318
+ *
2319
+ * # CSS Nodes
2320
+ *
2321
+ * `GtkPopoverMenu` is just a subclass of `GtkPopover` that adds custom content
2322
+ * to it, therefore it has the same CSS nodes. It is one of the cases that add
2323
+ * a `.menu` style class to the main `popover` node.
2324
+ *
2325
+ * Menu items have nodes with name `button` and class `.model`. If a section
2326
+ * display-hint is set, the section gets a node `box` with class `horizontal`
2327
+ * plus a class with the same text as the display hint. Note that said box may
2328
+ * not be the direct ancestor of the item `button`s. Thus, for example, to style
2329
+ * items in an `inline-buttons` section, select `.inline-buttons button.model`.
2330
+ * Other things that may be of interest to style in menus include `label` nodes.
2331
+ *
2332
+ * # Accessibility
2333
+ *
2334
+ * `GtkPopoverMenu` uses the [`Gtk.AccessibleRole.menu`](https://docs.gtk.org/gtk4/enum.AccessibleRole.menu.html) role, and its
2335
+ * items use the [`Gtk.AccessibleRole.menu_item`](https://docs.gtk.org/gtk4/enum.AccessibleRole.menu_item.html),
2336
+ * [`Gtk.AccessibleRole.checkbox`](https://docs.gtk.org/gtk4/enum.AccessibleRole.checkbox.html) or [`Gtk.AccessibleRole.menu_item_radio`](https://docs.gtk.org/gtk4/enum.AccessibleRole.menu_item_radio.html)
2337
+ * roles, depending on the action they are connected to.
2338
+ */
2339
+ export const GtkPopoverMenu: ((props: GtkPopoverMenuProps) => ReactNode) & {
2340
+ MenuItem: (props: MenuItemProps) => ReactNode;
2341
+ MenuSection: (props: MenuSectionProps) => ReactNode;
2342
+ MenuSubmenu: (props: MenuSubmenuProps) => ReactNode;
2343
+ } = Object.assign(createSlotWidget<GtkPopoverMenuProps>("GtkPopoverMenu", []), {
2344
+ MenuItem: createMenuChild<MenuItemProps>("MenuItem"),
2345
+ MenuSection: createMenuChild<MenuSectionProps>("MenuSection"),
2346
+ MenuSubmenu: createMenuChild<MenuSubmenuProps>("MenuSubmenu"),
2347
+ });
2348
+
2349
+ /**
2350
+ * Presents a horizontal bar of items that pop up menus when clicked.
2351
+ *
2352
+ * ![An example GtkPopoverMenuBar](https://docs.gtk.org/gtk4/menubar.png)
2353
+ *
2354
+ * The only way to create instances of `GtkPopoverMenuBar` is
2355
+ * from a `GMenuModel`.
2356
+ *
2357
+ * # CSS nodes
2358
+ *
2359
+ * ```
2360
+ * menubar
2361
+ * ├── item[.active]
2362
+ * ┊ ╰── popover
2363
+ * ╰── item
2364
+ * ╰── popover
2365
+ * ```
2366
+ *
2367
+ * `GtkPopoverMenuBar` has a single CSS node with name menubar, below which
2368
+ * each item has its CSS node, and below that the corresponding popover.
2369
+ *
2370
+ * The item whose popover is currently open gets the .active
2371
+ * style class.
2372
+ *
2373
+ * # Accessibility
2374
+ *
2375
+ * `GtkPopoverMenuBar` uses the [`Gtk.AccessibleRole.menu_bar`](https://docs.gtk.org/gtk4/enum.AccessibleRole.menu_bar.html) role,
2376
+ * the menu items use the [`Gtk.AccessibleRole.menu_item`](https://docs.gtk.org/gtk4/enum.AccessibleRole.menu_item.html) role and
2377
+ * the menus use the [`Gtk.AccessibleRole.menu`](https://docs.gtk.org/gtk4/enum.AccessibleRole.menu.html) role.
2378
+ */
2379
+ export const GtkPopoverMenuBar: ((props: GtkPopoverMenuBarProps) => ReactNode) & {
2380
+ MenuItem: (props: MenuItemProps) => ReactNode;
2381
+ MenuSection: (props: MenuSectionProps) => ReactNode;
2382
+ MenuSubmenu: (props: MenuSubmenuProps) => ReactNode;
2383
+ } = Object.assign(createSlotWidget<GtkPopoverMenuBarProps>("GtkPopoverMenuBar", []), {
2384
+ MenuItem: createMenuChild<MenuItemProps>("MenuItem"),
2385
+ MenuSection: createMenuChild<MenuSectionProps>("MenuSection"),
2386
+ MenuSubmenu: createMenuChild<MenuSubmenuProps>("MenuSubmenu"),
2387
+ });
2388
+
2389
+ /**
2390
+ * Manages keyboard shortcuts and their activation.
2391
+ *
2392
+ * Most common shortcuts are using this controller implicitly, e.g. by
2393
+ * adding a mnemonic underline to a [`Gtk.Label`](https://docs.gtk.org/gtk4/class.Label.html), or by installing a key
2394
+ * binding using [`Gtk.WidgetClass.add_binding`](https://docs.gtk.org/gtk4/method.WidgetClass.add_binding.html), or by adding accelerators
2395
+ * to global actions using [`Gtk.Application.set_accels_for_action`](https://docs.gtk.org/gtk4/method.Application.set_accels_for_action.html).
2396
+ *
2397
+ * But it is possible to create your own shortcut controller, and add
2398
+ * shortcuts to it.
2399
+ *
2400
+ * `GtkShortcutController` implements [`Gio.ListModel`](https://docs.gtk.org/gio/iface.ListModel.html) for querying the
2401
+ * shortcuts that have been added to it.
2402
+ *
2403
+ * # GtkShortcutController as GtkBuildable
2404
+ *
2405
+ * `GtkShortcutController`s can be created in [`Gtk.Builder`](https://docs.gtk.org/gtk4/class.Builder.html) ui files, to set up
2406
+ * shortcuts in the same place as the widgets.
2407
+ *
2408
+ * An example of a UI definition fragment with `GtkShortcutController`:
2409
+ * ```xml
2410
+ * <object class='GtkButton'>
2411
+ * <child>
2412
+ * <object class='GtkShortcutController'>
2413
+ * <property name='scope'>managed</property>
2414
+ * <child>
2415
+ * <object class='GtkShortcut'>
2416
+ * <property name='trigger'>&lt;Control&gt;k</property>
2417
+ * <property name='action'>activate</property>
2418
+ * </object>
2419
+ * </child>
2420
+ * </object>
2421
+ * </child>
2422
+ * </object>
2423
+ * ```
2424
+ *
2425
+ * This example creates a [`Gtk.ActivateAction`](https://docs.gtk.org/gtk4/class.ActivateAction.html) for triggering the
2426
+ * `activate` signal of the [`Gtk.Button`](https://docs.gtk.org/gtk4/class.Button.html). See [`Gtk.ShortcutAction.parse_string`](https://docs.gtk.org/gtk4/ctor.ShortcutAction.parse_string.html)
2427
+ * for the syntax for other kinds of [`Gtk.ShortcutAction`](https://docs.gtk.org/gtk4/class.ShortcutAction.html). See
2428
+ * [`Gtk.ShortcutTrigger.parse_string`](https://docs.gtk.org/gtk4/ctor.ShortcutTrigger.parse_string.html) to learn more about the syntax
2429
+ * for triggers.
2430
+ */
2431
+ export const GtkShortcutController: ((props: GtkShortcutControllerProps) => ReactNode) & {
2432
+ Shortcut: (props: ShortcutProps) => ReactNode;
2433
+ } = Object.assign(createSlotWidget<GtkShortcutControllerProps>("GtkShortcutController", []), {
2434
+ Shortcut: createVirtualChild<ShortcutProps>("Shortcut"),
2435
+ });
2436
+
2437
+ /**
2438
+ * Subclass of [`Gtk.TextView`](https://docs.gtk.org/gtk4/class.TextView.html).
2439
+ *
2440
+ * `GtkSourceView` is the main class of the GtkSourceView library.
2441
+ * Use a [`Buffer`](https://docs.gtk.org/gtksource/class.Buffer.html) to display text with a `GtkSourceView`.
2442
+ *
2443
+ * This class provides:
2444
+ *
2445
+ * - Show the line numbers;
2446
+ * - Show a right margin;
2447
+ * - Highlight the current line;
2448
+ * - Indentation settings;
2449
+ * - Configuration for the Home and End keyboard keys;
2450
+ * - Configure and show line marks;
2451
+ * - And a few other things.
2452
+ *
2453
+ * An easy way to test all these features is to use the test-widget mini-program
2454
+ * provided in the GtkSourceView repository, in the tests/ directory.
2455
+ *
2456
+ * # GtkSourceView as GtkBuildable
2457
+ *
2458
+ * The GtkSourceView implementation of the [`Gtk.Buildable`](https://docs.gtk.org/gtk4/iface.Buildable.html) interface exposes the
2459
+ * [`View.completion`](https://docs.gtk.org/gtksource/property.View.completion.html) object with the internal-child "completion".
2460
+ *
2461
+ * An example of a UI definition fragment with GtkSourceView:
2462
+ * ```xml
2463
+ * <object class="GtkSourceView" id="source_view">
2464
+ * <property name="tab-width">4</property>
2465
+ * <property name="auto-indent">True</property>
2466
+ * <child internal-child="completion">
2467
+ * <object class="GtkSourceCompletion">
2468
+ * <property name="select-on-show">False</property>
2469
+ * </object>
2470
+ * </child>
2471
+ * </object>
2472
+ * ```
2473
+ *
2474
+ * # Changing the Font
2475
+ *
2476
+ * Gtk CSS provides the best way to change the font for a `GtkSourceView` in a
2477
+ * manner that allows for components like [`Map`](https://docs.gtk.org/gtksource/class.Map.html) to scale the desired
2478
+ * font.
2479
+ *
2480
+ * ```c
2481
+ * GtkCssProvider *provider = gtk_css_provider_new ();
2482
+ * gtk_css_provider_load_from_string (provider,
2483
+ * "textview { font-family: Monospace; font-size: 8pt; }");
2484
+ * gtk_style_context_add_provider (gtk_widget_get_style_context (view),
2485
+ * GTK_STYLE_PROVIDER (provider),
2486
+ * GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
2487
+ * g_object_unref (provider);
2488
+ * ```
2489
+ * ```python
2490
+ * provider = Gtk.CssProvider()
2491
+ * provider.load_from_string("textview { font-family: Monospace; font-size: 8pt; }")
2492
+ * style_context = view.get_style_context()
2493
+ * style_context.add_provider(provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION)
2494
+ * ```
2495
+ *
2496
+ * If you need to adjust the font or size of font within a portion of the
2497
+ * document only, you should use a [`Gtk.TextTag`](https://docs.gtk.org/gtk4/class.TextTag.html) with the [`Gtk.TextTag.family`](https://docs.gtk.org/gtk4/property.TextTag.family.html) or
2498
+ * [`Gtk.TextTag.scale`](https://docs.gtk.org/gtk4/property.TextTag.scale.html) set so that the font size may be scaled relative to
2499
+ * the default font set in CSS.
2500
+ */
2501
+ export const GtkSourceView: ((props: GtkSourceViewProps) => ReactNode) & {
2502
+ Tag: (props: TextTagProps) => ReactNode;
2503
+ Anchor: (props: TextAnchorProps) => ReactNode;
2504
+ Paintable: (props: TextPaintableProps) => ReactNode;
2505
+ } = Object.assign(createSlotWidget<GtkSourceViewProps>("GtkSourceView", []), {
2506
+ Tag: createVirtualChild<TextTagProps>("TextTag"),
2507
+ Anchor: createVirtualChild<TextAnchorProps>("TextAnchor"),
2508
+ Paintable: createVirtualChild<TextPaintableProps>("TextPaintable"),
2509
+ });
2510
+
2511
+ /**
2512
+ * Shows one of its children at a time.
2513
+ *
2514
+ * ![An example GtkStack](https://docs.gtk.org/gtk4/stack.png)
2515
+ *
2516
+ * In contrast to `GtkNotebook`, `GtkStack` does not provide a means
2517
+ * for users to change the visible child. Instead, a separate widget
2518
+ * such as [`Gtk.StackSwitcher`](https://docs.gtk.org/gtk4/class.StackSwitcher.html) or [`Gtk.StackSidebar`](https://docs.gtk.org/gtk4/class.StackSidebar.html) can
2519
+ * be used with `GtkStack` to provide this functionality.
2520
+ *
2521
+ * Transitions between pages can be animated as slides or fades. This
2522
+ * can be controlled with [`Gtk.Stack.set_transition_type`](https://docs.gtk.org/gtk4/method.Stack.set_transition_type.html).
2523
+ * These animations respect the [`Gtk.Settings.gtk-enable-animations`](https://docs.gtk.org/gtk4/property.Settings.gtk-enable-animations.html)
2524
+ * setting.
2525
+ *
2526
+ * `GtkStack` maintains a [`Gtk.StackPage`](https://docs.gtk.org/gtk4/class.StackPage.html) object for each added
2527
+ * child, which holds additional per-child properties. You
2528
+ * obtain the `GtkStackPage` for a child with [`Gtk.Stack.get_page`](https://docs.gtk.org/gtk4/method.Stack.get_page.html)
2529
+ * and you can obtain a `GtkSelectionModel` containing all the pages
2530
+ * with [`Gtk.Stack.get_pages`](https://docs.gtk.org/gtk4/method.Stack.get_pages.html).
2531
+ *
2532
+ * # GtkStack as GtkBuildable
2533
+ *
2534
+ * To set child-specific properties in a .ui file, create `GtkStackPage`
2535
+ * objects explicitly, and set the child widget as a property on it:
2536
+ *
2537
+ * ```xml
2538
+ * <object class="GtkStack" id="stack">
2539
+ * <child>
2540
+ * <object class="GtkStackPage">
2541
+ * <property name="name">page1</property>
2542
+ * <property name="title">In the beginning…</property>
2543
+ * <property name="child">
2544
+ * <object class="GtkLabel">
2545
+ * <property name="label">It was dark</property>
2546
+ * </object>
2547
+ * </property>
2548
+ * </object>
2549
+ * </child>
2550
+ * ```
2551
+ *
2552
+ * # CSS nodes
2553
+ *
2554
+ * `GtkStack` has a single CSS node named stack.
2555
+ *
2556
+ * # Accessibility
2557
+ *
2558
+ * `GtkStack` uses the [`Gtk.AccessibleRole.tab_panel`](https://docs.gtk.org/gtk4/enum.AccessibleRole.tab_panel.html) role for the stack
2559
+ * pages, which are the accessible parent objects of the child widgets.
2560
+ */
2561
+ export const GtkStack: ((props: GtkStackProps) => ReactNode) & {
2562
+ Page: (props: StackPageProps) => ReactNode;
2563
+ } = Object.assign(createSlotWidget<GtkStackProps>("GtkStack", []), {
2564
+ Page: createVirtualChild<StackPageProps>("StackPage"),
2565
+ });
2566
+
2567
+ /**
2568
+ * Displays the contents of a [`Gtk.TextBuffer`](https://docs.gtk.org/gtk4/class.TextBuffer.html).
2569
+ *
2570
+ * ![An example GtkTextView](https://docs.gtk.org/gtk4/multiline-text.png)
2571
+ *
2572
+ * You may wish to begin by reading the conceptual overview,
2573
+ * which gives an overview of all the objects and data types related to the
2574
+ * text widget and how they work together.
2575
+ *
2576
+ * ## Shortcuts and Gestures
2577
+ *
2578
+ * `GtkTextView` supports the following keyboard shortcuts:
2579
+ *
2580
+ * - `Shift`+`F10` or `Menu` opens the context menu.
2581
+ * - `Ctrl`+`Z` undoes the last modification.
2582
+ * - `Ctrl`+`Y` or `Ctrl`+`Shift`+`Z`
2583
+ * redoes the last undone modification.
2584
+ * - `Clear` clears the content.
2585
+ *
2586
+ * Additionally, the following signals have default keybindings:
2587
+ *
2588
+ * - [`Gtk.TextView.:backspace`](https://docs.gtk.org/gtk4/signal.TextView.backspace.html)
2589
+ * - [`Gtk.TextView.:copy-clipboard`](https://docs.gtk.org/gtk4/signal.TextView.copy-clipboard.html)
2590
+ * - [`Gtk.TextView.:cut-clipboard`](https://docs.gtk.org/gtk4/signal.TextView.cut-clipboard.html)
2591
+ * - [`Gtk.TextView.:delete-from-cursor`](https://docs.gtk.org/gtk4/signal.TextView.delete-from-cursor.html)
2592
+ * - [`Gtk.TextView.:insert-emoji`](https://docs.gtk.org/gtk4/signal.TextView.insert-emoji.html)
2593
+ * - [`Gtk.TextView.:move-cursor`](https://docs.gtk.org/gtk4/signal.TextView.move-cursor.html)
2594
+ * - [`Gtk.TextView.:paste-clipboard`](https://docs.gtk.org/gtk4/signal.TextView.paste-clipboard.html)
2595
+ * - [`Gtk.TextView.:select-all`](https://docs.gtk.org/gtk4/signal.TextView.select-all.html)
2596
+ * - [`Gtk.TextView.:toggle-cursor-visible`](https://docs.gtk.org/gtk4/signal.TextView.toggle-cursor-visible.html)
2597
+ * - [`Gtk.TextView.:toggle-overwrite`](https://docs.gtk.org/gtk4/signal.TextView.toggle-overwrite.html)
2598
+ *
2599
+ * ## Actions
2600
+ *
2601
+ * `GtkTextView` defines a set of built-in actions:
2602
+ *
2603
+ * - `clipboard.copy` copies the contents to the clipboard.
2604
+ * - `clipboard.cut` copies the contents to the clipboard and deletes it from
2605
+ * the widget.
2606
+ * - `clipboard.paste` inserts the contents of the clipboard into the widget.
2607
+ * - `menu.popup` opens the context menu.
2608
+ * - `misc.insert-emoji` opens the Emoji chooser.
2609
+ * - `selection.delete` deletes the current selection.
2610
+ * - `selection.select-all` selects all of the widgets content.
2611
+ * - `text.redo` redoes the last change to the contents.
2612
+ * - `text.undo` undoes the last change to the contents.
2613
+ * - `text.clear` clears the content.
2614
+ *
2615
+ * ## CSS nodes
2616
+ *
2617
+ * ```
2618
+ * textview.view
2619
+ * ├── border.top
2620
+ * ├── border.left
2621
+ * ├── text
2622
+ * │ ╰── [selection]
2623
+ * ├── border.right
2624
+ * ├── border.bottom
2625
+ * ╰── [window.popup]
2626
+ * ```
2627
+ *
2628
+ * `GtkTextView` has a main css node with name textview and style class .view,
2629
+ * and subnodes for each of the border windows, and the main text area,
2630
+ * with names border and text, respectively. The border nodes each get
2631
+ * one of the style classes .left, .right, .top or .bottom.
2632
+ *
2633
+ * A node representing the selection will appear below the text node.
2634
+ *
2635
+ * If a context menu is opened, the window node will appear as a subnode
2636
+ * of the main node.
2637
+ *
2638
+ * ## Accessibility
2639
+ *
2640
+ * `GtkTextView` uses the [`Gtk.AccessibleRole.text_box`](https://docs.gtk.org/gtk4/enum.AccessibleRole.text_box.html) role.
2641
+ */
2642
+ export const GtkTextView: ((props: GtkTextViewProps) => ReactNode) & {
2643
+ Tag: (props: TextTagProps) => ReactNode;
2644
+ Anchor: (props: TextAnchorProps) => ReactNode;
2645
+ Paintable: (props: TextPaintableProps) => ReactNode;
2646
+ } = Object.assign(createSlotWidget<GtkTextViewProps>("GtkTextView", []), {
2647
+ Tag: createVirtualChild<TextTagProps>("TextTag"),
2648
+ Anchor: createVirtualChild<TextAnchorProps>("TextAnchor"),
2649
+ Paintable: createVirtualChild<TextPaintableProps>("TextPaintable"),
2650
+ });
2651
+
2652
+ /**
2653
+ * A toplevel window which can contain other widgets.
2654
+ *
2655
+ * ![An example GtkWindow](https://docs.gtk.org/gtk4/window.png)
2656
+ *
2657
+ * Windows normally have decorations that are under the control
2658
+ * of the windowing system and allow the user to manipulate the window
2659
+ * (resize it, move it, close it,...).
2660
+ *
2661
+ * # GtkWindow as GtkBuildable
2662
+ *
2663
+ * The `GtkWindow` implementation of the [`Gtk.Buildable`](https://docs.gtk.org/gtk4/iface.Buildable.html) interface supports
2664
+ * setting a child as the titlebar by specifying “titlebar” as the “type”
2665
+ * attribute of a ``<child>`` element.
2666
+ *
2667
+ * # Shortcuts and Gestures
2668
+ *
2669
+ * `GtkWindow` supports the following keyboard shortcuts:
2670
+ *
2671
+ * - `F10` activates the menubar, if present.
2672
+ * - `Alt` makes the mnemonics visible while pressed.
2673
+ *
2674
+ * The following signals have default keybindings:
2675
+ *
2676
+ * - [`Gtk.Window.:activate-default`](https://docs.gtk.org/gtk4/signal.Window.activate-default.html)
2677
+ * - [`Gtk.Window.:activate-focus`](https://docs.gtk.org/gtk4/signal.Window.activate-focus.html)
2678
+ * - [`Gtk.Window.:enable-debugging`](https://docs.gtk.org/gtk4/signal.Window.enable-debugging.html)
2679
+ *
2680
+ * # Actions
2681
+ *
2682
+ * `GtkWindow` defines a set of built-in actions:
2683
+ *
2684
+ * - `default.activate` activates the default widget.
2685
+ * - `window.minimize` minimizes the window.
2686
+ * - `window.toggle-maximized` maximizes or restores the window.
2687
+ * - `window.close` closes the window.
2688
+ *
2689
+ * # CSS nodes
2690
+ *
2691
+ * ```
2692
+ * window.background [.csd / .solid-csd / .ssd] [.maximized / .fullscreen / .tiled]
2693
+ * ├── <child>
2694
+ * ╰── <titlebar child>.titlebar [.default-decoration]
2695
+ * ```
2696
+ *
2697
+ * `GtkWindow` has a main CSS node with name window and style class .background.
2698
+ *
2699
+ * Style classes that are typically used with the main CSS node are .csd (when
2700
+ * client-side decorations are in use), .solid-csd (for client-side decorations
2701
+ * without invisible borders), .ssd (used by mutter when rendering server-side
2702
+ * decorations). GtkWindow also represents window states with the following
2703
+ * style classes on the main node: .maximized, .fullscreen, .tiled (when supported,
2704
+ * also .tiled-top, .tiled-left, .tiled-right, .tiled-bottom).
2705
+ *
2706
+ * `GtkWindow` subclasses often add their own discriminating style classes,
2707
+ * such as .dialog, .popup or .tooltip.
2708
+ *
2709
+ * Generally, some CSS properties don't make sense on the toplevel window node,
2710
+ * such as margins or padding. When client-side decorations without invisible
2711
+ * borders are in use (i.e. the .solid-csd style class is added to the
2712
+ * main window node), the CSS border of the toplevel window is used for
2713
+ * resize drags. In the .csd case, the shadow area outside of the window
2714
+ * can be used to resize it.
2715
+ *
2716
+ * `GtkWindow` adds the .titlebar and .default-decoration style classes to the
2717
+ * widget that is added as a titlebar child.
2718
+ *
2719
+ * # Accessibility
2720
+ *
2721
+ * `GtkWindow` uses the [`Gtk.AccessibleRole.window`](https://docs.gtk.org/gtk4/enum.AccessibleRole.window.html) role.
2722
+ *
2723
+ * From GTK 4.12 to 4.18, it used the [`Gtk.AccessibleRole.application`](https://docs.gtk.org/gtk4/enum.AccessibleRole.application.html) role.
2724
+ */
2725
+ export const GtkWindow: (props: GtkWindowProps) => ReactNode = createSlotWidget<GtkWindowProps>("GtkWindow", ["titlebar"]);
2726
+
2727
+ /**
2728
+ * Type mapping widgets to their valid container slot method names.
2729
+ *
2730
+ * Each key is a JSX element name and each value is a union of method names
2731
+ * used by container slot compound components (e.g. `AdwHeaderBar.PackStart`).
2732
+ */
2733
+ export type ContainerSlotNames = {
2734
+ AdwActionRow: "addPrefix" | "addSuffix";
2735
+ AdwEntryRow: "addPrefix" | "addSuffix";
2736
+ AdwExpanderRow: "addPrefix" | "addSuffix" | "addRow" | "addAction";
2737
+ AdwHeaderBar: "packStart" | "packEnd";
2738
+ AdwToolbarView: "addTopBar" | "addBottomBar";
2739
+ GtkActionBar: "packStart" | "packEnd";
2740
+ GtkHeaderBar: "packStart" | "packEnd";
2741
+ };