@girs/amtk-4 4.0.0-4.0.0-beta.39 → 4.0.0-4.0.0-beta.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/amtk-4.d.ts +330 -173
- package/package.json +15 -15
- package/tsconfig.json +45 -1
- package/typedoc.json +3 -1
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|

|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
GJS TypeScript type definitions for Amtk-4, generated from library version 4.0.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.0.0-beta.
|
|
8
|
+
GJS TypeScript type definitions for Amtk-4, generated from library version 4.0.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.0.0-beta.41.
|
|
9
9
|
|
|
10
10
|
## Install
|
|
11
11
|
|
package/amtk-4.d.ts
CHANGED
|
@@ -30,20 +30,21 @@ export namespace Amtk {
|
|
|
30
30
|
*/
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
|
-
* A wrapper function for g_action_map_add_action_entries() that checks
|
|
33
|
+
* A wrapper function for `g_action_map_add_action_entries()` that checks
|
|
34
34
|
* duplicates.
|
|
35
35
|
*
|
|
36
36
|
* This function first checks - for each entry - that the `action_map` doesn't
|
|
37
|
-
* already contain a
|
|
37
|
+
* already contain a {@link Gio.Action} with the same name. A warning is printed if an old
|
|
38
38
|
* action will be dropped. In any case, it then calls
|
|
39
|
-
* g_action_map_add_action_entries() with the same arguments as passed to this
|
|
39
|
+
* `g_action_map_add_action_entries()` with the same arguments as passed to this
|
|
40
40
|
* function.
|
|
41
41
|
*
|
|
42
42
|
* This function also checks if there are duplicates in the `entries` array
|
|
43
43
|
* itself.
|
|
44
|
-
* @param action_map a
|
|
45
|
-
* @param entries a pointer to the first item in an array of
|
|
44
|
+
* @param action_map a {@link Gio.ActionMap}.
|
|
45
|
+
* @param entries a pointer to the first item in an array of {@link Gio.ActionEntry} structs.
|
|
46
46
|
* @param user_data the user data for signal connections.
|
|
47
|
+
* @since 2.0
|
|
47
48
|
*/
|
|
48
49
|
function action_map_add_action_entries_check_dups(
|
|
49
50
|
action_map: Gio.ActionMap,
|
|
@@ -56,71 +57,81 @@ export namespace Amtk {
|
|
|
56
57
|
*
|
|
57
58
|
* It is not mandatory to call this function, it's just to be friendlier to
|
|
58
59
|
* memory debugging tools. This function is meant to be called at the end of
|
|
59
|
-
* main()
|
|
60
|
+
* `main()`. It can be called several times.
|
|
61
|
+
* @since 3.0
|
|
60
62
|
*/
|
|
61
63
|
function finalize(): void;
|
|
62
64
|
/**
|
|
63
65
|
* Initializes the Amtk library (e.g. for the internationalization).
|
|
64
66
|
*
|
|
65
67
|
* This function can be called several times, but is meant to be called at the
|
|
66
|
-
* beginning of main()
|
|
68
|
+
* beginning of `main()`, before any other Amtk function call.
|
|
69
|
+
* @since 3.0
|
|
67
70
|
*/
|
|
68
71
|
function init(): void;
|
|
72
|
+
/**
|
|
73
|
+
* @param menu_item a {@link Gtk.MenuItem}.
|
|
74
|
+
* @returns the long description of `menu_item`, previously set with `amtk_menu_item_set_long_description()`.
|
|
75
|
+
* @since 2.0
|
|
76
|
+
*/
|
|
69
77
|
function menu_item_get_long_description(menu_item: Gtk.MenuItem): string | null;
|
|
70
78
|
/**
|
|
71
|
-
* Sets an icon to a
|
|
79
|
+
* Sets an icon to a {@link Gtk.MenuItem}.
|
|
72
80
|
*
|
|
73
|
-
* If the child widget of `item` is already a
|
|
74
|
-
* inside that box are first destroyed. A
|
|
81
|
+
* If the child widget of `item` is already a {@link Gtk.Box}, all {@link Gtk.Image} widgets
|
|
82
|
+
* inside that box are first destroyed. A {@link Gtk.Image} for `icon_name` is then
|
|
75
83
|
* inserted to the box.
|
|
76
84
|
*
|
|
77
|
-
* If the child widget of `item` is not a
|
|
78
|
-
*
|
|
79
|
-
* is inserted to the
|
|
85
|
+
* If the child widget of `item` is not a {@link Gtk.Box} (it's usually the
|
|
86
|
+
* {@link Gtk.AccelLabel}), it is replaced by a new {@link Gtk.Box} and the initial child widget
|
|
87
|
+
* is inserted to the {@link Gtk.Box}, alongside the icon.
|
|
80
88
|
*
|
|
81
|
-
* As a consequence, if you want to call functions on the
|
|
89
|
+
* As a consequence, if you want to call functions on the {@link Gtk.AccelLabel}, it's
|
|
82
90
|
* easier to do it before calling this function.
|
|
83
|
-
* @param item a
|
|
91
|
+
* @param item a {@link Gtk.MenuItem}.
|
|
84
92
|
* @param icon_name an icon name.
|
|
93
|
+
* @since 2.0
|
|
85
94
|
*/
|
|
86
95
|
function menu_item_set_icon_name(item: Gtk.MenuItem, icon_name: string): void;
|
|
87
96
|
/**
|
|
88
97
|
* Sets the long description of `menu_item`. A possible use-case is to display it
|
|
89
|
-
* in a
|
|
90
|
-
* @param menu_item a
|
|
91
|
-
* @param long_description the long description, or
|
|
98
|
+
* in a {@link Gtk.Statusbar}, or as a tooltip.
|
|
99
|
+
* @param menu_item a {@link Gtk.MenuItem}.
|
|
100
|
+
* @param long_description the long description, or `null` to unset it.
|
|
101
|
+
* @since 2.0
|
|
92
102
|
*/
|
|
93
103
|
function menu_item_set_long_description(menu_item: Gtk.MenuItem, long_description?: string | null): void;
|
|
94
104
|
/**
|
|
95
|
-
* Utility function to be able to port an application gradually to
|
|
96
|
-
* when
|
|
105
|
+
* Utility function to be able to port an application gradually to {@link Gio.Action},
|
|
106
|
+
* when {@link Gtk.UIManager} and {@link Gtk.Action} are still used. Porting to {@link Gio.Action} should
|
|
97
107
|
* be the first step.
|
|
98
108
|
*
|
|
99
|
-
* For `detailed_g_action_name_without_prefix
|
|
100
|
-
* g_action_parse_detailed_name() function. The `"app."` or `"win."` prefix (or
|
|
101
|
-
* any other
|
|
109
|
+
* For `detailed_g_action_name_without_prefix`, see the
|
|
110
|
+
* `g_action_parse_detailed_name()` function. The `"app."` or `"win."` prefix (or
|
|
111
|
+
* any other {@link Gio.ActionMap} prefix) must not be included in
|
|
102
112
|
* `detailed_g_action_name_without_prefix`. For example a valid
|
|
103
113
|
* `detailed_g_action_name_without_prefix` is `"open"` or
|
|
104
114
|
* `"insert-command::foobar"`.
|
|
105
115
|
*
|
|
106
|
-
* The same
|
|
107
|
-
* parameter values for the
|
|
108
|
-
*
|
|
116
|
+
* The same {@link Gio.Action} can be bound to several {@link Gtk.Action}'s (with different
|
|
117
|
+
* parameter values for the {@link Gio.Action}), but the reverse is not true, one
|
|
118
|
+
* {@link Gtk.Action} cannot be bound to several {@link Gio.Action}'s.
|
|
109
119
|
*
|
|
110
120
|
* This function:
|
|
111
|
-
* - Calls g_action_activate() when the
|
|
121
|
+
* - Calls `g_action_activate()` when the {@link Gtk.Action} {@link Gtk.Action.SignalSignatures.activate | Gtk.Action::activate} signal
|
|
112
122
|
* is emitted.
|
|
113
|
-
* - Binds the
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
* the
|
|
123
|
+
* - Binds the {@link Gio.Action} {@link Gio.Action.enabled} property to the {@link Gtk.Action}
|
|
124
|
+
* {@link Gtk.Action.sensitive} property. The binding is done with the
|
|
125
|
+
* {@link GObject.BindingFlags.BIDIRECTIONAL} and {@link GObject.BindingFlags.SYNC_CREATE} flags, the source is
|
|
126
|
+
* the {@link Gio.Action} and the target is the {@link Gtk.Action}.
|
|
117
127
|
*
|
|
118
|
-
* When using this function, you should set the callback to
|
|
119
|
-
* corresponding
|
|
120
|
-
* @param g_action_map a
|
|
121
|
-
* @param detailed_g_action_name_without_prefix a detailed
|
|
122
|
-
* @param gtk_action_group a
|
|
123
|
-
* @param gtk_action_name a
|
|
128
|
+
* When using this function, you should set the callback to `null` in the
|
|
129
|
+
* corresponding {@link Gtk.ActionEntry}.
|
|
130
|
+
* @param g_action_map a {@link Gio.ActionMap}.
|
|
131
|
+
* @param detailed_g_action_name_without_prefix a detailed {@link Gio.Action} name without the {@link Gio.ActionMap} prefix; the {@link Gio.Action} must be present in `g_action_map`.
|
|
132
|
+
* @param gtk_action_group a {@link Gtk.ActionGroup}.
|
|
133
|
+
* @param gtk_action_name a {@link Gtk.Action} name present in `gtk_action_group`.
|
|
134
|
+
* @since 4.0
|
|
124
135
|
*/
|
|
125
136
|
function utils_bind_g_action_to_gtk_action(
|
|
126
137
|
g_action_map: Gio.ActionMap,
|
|
@@ -129,28 +140,29 @@ export namespace Amtk {
|
|
|
129
140
|
gtk_action_name: string,
|
|
130
141
|
): void;
|
|
131
142
|
/**
|
|
132
|
-
* Utility function to be able to port an application gradually to
|
|
133
|
-
*
|
|
134
|
-
* step further compared to amtk_utils_bind_g_action_to_gtk_action()
|
|
135
|
-
* amtk_utils_bind_g_action_to_gtk_action()
|
|
136
|
-
* amtk_utils_create_gtk_action()
|
|
137
|
-
* exist (so typically you need to convert the
|
|
138
|
-
*
|
|
143
|
+
* Utility function to be able to port an application gradually to {@link Gio.Action} and
|
|
144
|
+
* {@link Amtk.ActionInfo}, when {@link Gtk.UIManager} is still used. This function goes one
|
|
145
|
+
* step further compared to `amtk_utils_bind_g_action_to_gtk_action()`. With
|
|
146
|
+
* `amtk_utils_bind_g_action_to_gtk_action()`, only the {@link Gio.Action} must exist. With
|
|
147
|
+
* `amtk_utils_create_gtk_action()`, both the {@link Gio.Action} and {@link Amtk.ActionInfo} must
|
|
148
|
+
* exist (so typically you need to convert the {@link Gtk.ActionEntry}'s into
|
|
149
|
+
* {@link Amtk.ActionInfoEntry}'s).
|
|
139
150
|
*
|
|
140
|
-
* This function creates a
|
|
141
|
-
*
|
|
151
|
+
* This function creates a {@link Gtk.Action} from a {@link Gio.Action} plus its corresponding
|
|
152
|
+
* {@link Amtk.ActionInfo}.
|
|
142
153
|
*
|
|
143
|
-
* The
|
|
144
|
-
*
|
|
154
|
+
* The {@link Gtk.Action} is created with the information provided by the
|
|
155
|
+
* {@link Amtk.ActionInfo} (retrieved with `amtk_action_info_central_store_lookup()` with
|
|
145
156
|
* `detailed_g_action_name_with_prefix` as argument). Only the first accelerator
|
|
146
157
|
* is taken into account.
|
|
147
158
|
*
|
|
148
|
-
* Once the
|
|
149
|
-
* amtk_utils_bind_g_action_to_gtk_action() is called.
|
|
150
|
-
* @param g_action_map a
|
|
151
|
-
* @param detailed_g_action_name_with_prefix a detailed
|
|
152
|
-
* @param gtk_action_group a
|
|
153
|
-
* @param gtk_action_name the name of the
|
|
159
|
+
* Once the {@link Gtk.Action} is created, it is added to the `gtk_action_group`, and
|
|
160
|
+
* `amtk_utils_bind_g_action_to_gtk_action()` is called.
|
|
161
|
+
* @param g_action_map a {@link Gio.ActionMap}.
|
|
162
|
+
* @param detailed_g_action_name_with_prefix a detailed {@link Gio.Action} name with the {@link Gio.ActionMap} prefix; the {@link Gio.Action} must be present in `g_action_map`.
|
|
163
|
+
* @param gtk_action_group a {@link Gtk.ActionGroup}.
|
|
164
|
+
* @param gtk_action_name the name of the {@link Gtk.Action} to create and add to `gtk_action_group`.
|
|
165
|
+
* @since 4.0
|
|
154
166
|
*/
|
|
155
167
|
function utils_create_gtk_action(
|
|
156
168
|
g_action_map: Gio.ActionMap,
|
|
@@ -160,36 +172,37 @@ export namespace Amtk {
|
|
|
160
172
|
): void;
|
|
161
173
|
/**
|
|
162
174
|
* Gets the URI of `item`. `item` must be a child of `menu`. `menu` must be a
|
|
163
|
-
*
|
|
175
|
+
* {@link Gtk.RecentChooserMenu}.
|
|
164
176
|
*
|
|
165
177
|
* This function has been written because the value returned by
|
|
166
|
-
* gtk_recent_chooser_get_current_uri() is not updated when
|
|
167
|
-
*
|
|
168
|
-
* @param menu a
|
|
169
|
-
* @param item a
|
|
170
|
-
* @returns the URI of
|
|
178
|
+
* `gtk_recent_chooser_get_current_uri()` is not updated when {@link Gtk.MenuItem}'s of a
|
|
179
|
+
* {@link Gtk.RecentChooserMenu} are selected/deselected.
|
|
180
|
+
* @param menu a {@link Gtk.RecentChooserMenu}.
|
|
181
|
+
* @param item a {@link Gtk.MenuItem}.
|
|
182
|
+
* @returns the URI of `item`. Free with `g_free()` when no longer needed.
|
|
183
|
+
* @since 2.0
|
|
171
184
|
*/
|
|
172
185
|
function utils_recent_chooser_menu_get_item_uri(menu: Gtk.RecentChooserMenu, item: Gtk.MenuItem): string;
|
|
173
186
|
/**
|
|
174
|
-
*
|
|
175
|
-
* object, to ignore some steps.
|
|
176
|
-
*/
|
|
177
|
-
|
|
178
|
-
/**
|
|
179
|
-
* #AmtkFactoryFlags permits to control how a factory function creates the
|
|
180
|
-
* object, to ignore some steps.
|
|
187
|
+
* @gir-type Flags
|
|
181
188
|
*/
|
|
182
189
|
export namespace FactoryFlags {
|
|
183
190
|
export const $gtype: GObject.GType<FactoryFlags>;
|
|
184
191
|
}
|
|
185
192
|
|
|
193
|
+
/**
|
|
194
|
+
* {@link Amtk.FactoryFlags} permits to control how a factory function creates the
|
|
195
|
+
* object, to ignore some steps.
|
|
196
|
+
* @gir-type Flags
|
|
197
|
+
* @since 3.0
|
|
198
|
+
*/
|
|
186
199
|
enum FactoryFlags {
|
|
187
200
|
/**
|
|
188
201
|
* No flags.
|
|
189
202
|
*/
|
|
190
203
|
FLAGS_NONE,
|
|
191
204
|
/**
|
|
192
|
-
* Do not call gtk_actionable_set_action_name()
|
|
205
|
+
* Do not call `gtk_actionable_set_action_name()`.
|
|
193
206
|
*/
|
|
194
207
|
IGNORE_GACTION,
|
|
195
208
|
/**
|
|
@@ -211,15 +224,16 @@ export namespace Amtk {
|
|
|
211
224
|
/**
|
|
212
225
|
* Ignore the accelerators for
|
|
213
226
|
* documentation purposes only. For example do not add/configure a
|
|
214
|
-
*
|
|
227
|
+
* {@link Gtk.AccelLabel}.
|
|
215
228
|
*/
|
|
216
229
|
IGNORE_ACCELS_FOR_DOC,
|
|
217
230
|
/**
|
|
218
231
|
* Do not call
|
|
219
|
-
* gtk_application_set_accels_for_action()
|
|
232
|
+
* `gtk_application_set_accels_for_action()`.
|
|
220
233
|
*/
|
|
221
234
|
IGNORE_ACCELS_FOR_APP,
|
|
222
235
|
}
|
|
236
|
+
|
|
223
237
|
namespace ActionInfoCentralStore {
|
|
224
238
|
// Signal signatures
|
|
225
239
|
interface SignalSignatures extends GObject.Object.SignalSignatures {}
|
|
@@ -229,6 +243,9 @@ export namespace Amtk {
|
|
|
229
243
|
interface ConstructorProps extends GObject.Object.ConstructorProps {}
|
|
230
244
|
}
|
|
231
245
|
|
|
246
|
+
/**
|
|
247
|
+
* @gir-type Class
|
|
248
|
+
*/
|
|
232
249
|
class ActionInfoCentralStore extends GObject.Object {
|
|
233
250
|
static $gtype: GObject.GType<ActionInfoCentralStore>;
|
|
234
251
|
|
|
@@ -249,16 +266,19 @@ export namespace Amtk {
|
|
|
249
266
|
|
|
250
267
|
// Signals
|
|
251
268
|
|
|
269
|
+
/** @signal */
|
|
252
270
|
connect<K extends keyof ActionInfoCentralStore.SignalSignatures>(
|
|
253
271
|
signal: K,
|
|
254
272
|
callback: GObject.SignalCallback<this, ActionInfoCentralStore.SignalSignatures[K]>,
|
|
255
273
|
): number;
|
|
256
274
|
connect(signal: string, callback: (...args: any[]) => any): number;
|
|
275
|
+
/** @signal */
|
|
257
276
|
connect_after<K extends keyof ActionInfoCentralStore.SignalSignatures>(
|
|
258
277
|
signal: K,
|
|
259
278
|
callback: GObject.SignalCallback<this, ActionInfoCentralStore.SignalSignatures[K]>,
|
|
260
279
|
): number;
|
|
261
280
|
connect_after(signal: string, callback: (...args: any[]) => any): number;
|
|
281
|
+
/** @signal */
|
|
262
282
|
emit<K extends keyof ActionInfoCentralStore.SignalSignatures>(
|
|
263
283
|
signal: K,
|
|
264
284
|
...args: GObject.GjsParameters<ActionInfoCentralStore.SignalSignatures[K]> extends [any, ...infer Q]
|
|
@@ -273,6 +293,10 @@ export namespace Amtk {
|
|
|
273
293
|
|
|
274
294
|
// Methods
|
|
275
295
|
|
|
296
|
+
/**
|
|
297
|
+
* @param action_name an action name.
|
|
298
|
+
* @returns the found {@link Amtk.ActionInfo}, or `null`.
|
|
299
|
+
*/
|
|
276
300
|
lookup(action_name: string): ActionInfo;
|
|
277
301
|
}
|
|
278
302
|
|
|
@@ -285,6 +309,9 @@ export namespace Amtk {
|
|
|
285
309
|
interface ConstructorProps extends GObject.Object.ConstructorProps {}
|
|
286
310
|
}
|
|
287
311
|
|
|
312
|
+
/**
|
|
313
|
+
* @gir-type Class
|
|
314
|
+
*/
|
|
288
315
|
class ActionInfoStore extends GObject.Object {
|
|
289
316
|
static $gtype: GObject.GType<ActionInfoStore>;
|
|
290
317
|
|
|
@@ -307,16 +334,19 @@ export namespace Amtk {
|
|
|
307
334
|
|
|
308
335
|
// Signals
|
|
309
336
|
|
|
337
|
+
/** @signal */
|
|
310
338
|
connect<K extends keyof ActionInfoStore.SignalSignatures>(
|
|
311
339
|
signal: K,
|
|
312
340
|
callback: GObject.SignalCallback<this, ActionInfoStore.SignalSignatures[K]>,
|
|
313
341
|
): number;
|
|
314
342
|
connect(signal: string, callback: (...args: any[]) => any): number;
|
|
343
|
+
/** @signal */
|
|
315
344
|
connect_after<K extends keyof ActionInfoStore.SignalSignatures>(
|
|
316
345
|
signal: K,
|
|
317
346
|
callback: GObject.SignalCallback<this, ActionInfoStore.SignalSignatures[K]>,
|
|
318
347
|
): number;
|
|
319
348
|
connect_after(signal: string, callback: (...args: any[]) => any): number;
|
|
349
|
+
/** @signal */
|
|
320
350
|
emit<K extends keyof ActionInfoStore.SignalSignatures>(
|
|
321
351
|
signal: K,
|
|
322
352
|
...args: GObject.GjsParameters<ActionInfoStore.SignalSignatures[K]> extends [any, ...infer Q] ? Q : never
|
|
@@ -326,27 +356,27 @@ export namespace Amtk {
|
|
|
326
356
|
// Methods
|
|
327
357
|
|
|
328
358
|
/**
|
|
329
|
-
* Inserts `info` into `store` and into the
|
|
359
|
+
* Inserts `info` into `store` and into the {@link Amtk.ActionInfoCentralStore}. Both the
|
|
330
360
|
* `store` and central store must <emphasis>not</emphasis> already contain an
|
|
331
|
-
*
|
|
361
|
+
* {@link Amtk.ActionInfo} with the same action name. The stores take their own
|
|
332
362
|
* reference on `info`.
|
|
333
|
-
* @param info an
|
|
363
|
+
* @param info an {@link Amtk.ActionInfo}.
|
|
334
364
|
*/
|
|
335
365
|
add(info: ActionInfo): void;
|
|
336
366
|
/**
|
|
337
|
-
* Calls amtk_action_info_store_add() for each entry.
|
|
367
|
+
* Calls `amtk_action_info_store_add()` for each entry.
|
|
338
368
|
*
|
|
339
|
-
* If `translation_domain` is not
|
|
340
|
-
* `label` and `tooltip` of each entry before setting them to the
|
|
369
|
+
* If `translation_domain` is not `null`, `g_dgettext()` is used to translate the
|
|
370
|
+
* `label` and `tooltip` of each entry before setting them to the {@link Amtk.ActionInfo}.
|
|
341
371
|
*
|
|
342
|
-
* An API similar to g_action_map_add_action_entries()
|
|
343
|
-
* @param entries a pointer to the first item in an array of
|
|
344
|
-
* @param translation_domain a gettext domain, or
|
|
372
|
+
* An API similar to `g_action_map_add_action_entries()`.
|
|
373
|
+
* @param entries a pointer to the first item in an array of {@link Amtk.ActionInfoEntry} structs.
|
|
374
|
+
* @param translation_domain a gettext domain, or `null`.
|
|
345
375
|
*/
|
|
346
376
|
add_entries(entries: ActionInfoEntry[], translation_domain?: string | null): void;
|
|
347
377
|
/**
|
|
348
|
-
* Checks for each
|
|
349
|
-
* amtk_action_info_has_been_used()). If an
|
|
378
|
+
* Checks for each {@link Amtk.ActionInfo} of `store` that it has been used (see
|
|
379
|
+
* `amtk_action_info_has_been_used()`). If an {@link Amtk.ActionInfo} has not been used, a
|
|
350
380
|
* warning is printed and might indicate dead code.
|
|
351
381
|
*
|
|
352
382
|
* You probably want to call this function on the application store after
|
|
@@ -354,6 +384,10 @@ export namespace Amtk {
|
|
|
354
384
|
* by a library, to easily see which actions are not used by the application.
|
|
355
385
|
*/
|
|
356
386
|
check_all_used(): void;
|
|
387
|
+
/**
|
|
388
|
+
* @param action_name an action name.
|
|
389
|
+
* @returns the found {@link Amtk.ActionInfo}, or `null`.
|
|
390
|
+
*/
|
|
357
391
|
lookup(action_name: string): ActionInfo;
|
|
358
392
|
}
|
|
359
393
|
|
|
@@ -373,21 +407,29 @@ export namespace Amtk {
|
|
|
373
407
|
}
|
|
374
408
|
}
|
|
375
409
|
|
|
410
|
+
/**
|
|
411
|
+
* @gir-type Class
|
|
412
|
+
*/
|
|
376
413
|
class ApplicationWindow extends GObject.Object {
|
|
377
414
|
static $gtype: GObject.GType<ApplicationWindow>;
|
|
378
415
|
|
|
379
416
|
// Properties
|
|
380
417
|
|
|
381
418
|
/**
|
|
382
|
-
* The
|
|
419
|
+
* The {@link Gtk.ApplicationWindow}.
|
|
420
|
+
* @since 2.0
|
|
421
|
+
* @construct-only
|
|
383
422
|
*/
|
|
384
423
|
get application_window(): Gtk.ApplicationWindow;
|
|
385
424
|
/**
|
|
386
|
-
* The
|
|
425
|
+
* The {@link Gtk.ApplicationWindow}.
|
|
426
|
+
* @since 2.0
|
|
427
|
+
* @construct-only
|
|
387
428
|
*/
|
|
388
429
|
get applicationWindow(): Gtk.ApplicationWindow;
|
|
389
430
|
/**
|
|
390
|
-
* The
|
|
431
|
+
* The {@link Gtk.Statusbar}. `null` by default.
|
|
432
|
+
* @since 2.0
|
|
391
433
|
*/
|
|
392
434
|
get statusbar(): Gtk.Statusbar;
|
|
393
435
|
set statusbar(val: Gtk.Statusbar);
|
|
@@ -409,16 +451,19 @@ export namespace Amtk {
|
|
|
409
451
|
|
|
410
452
|
// Signals
|
|
411
453
|
|
|
454
|
+
/** @signal */
|
|
412
455
|
connect<K extends keyof ApplicationWindow.SignalSignatures>(
|
|
413
456
|
signal: K,
|
|
414
457
|
callback: GObject.SignalCallback<this, ApplicationWindow.SignalSignatures[K]>,
|
|
415
458
|
): number;
|
|
416
459
|
connect(signal: string, callback: (...args: any[]) => any): number;
|
|
460
|
+
/** @signal */
|
|
417
461
|
connect_after<K extends keyof ApplicationWindow.SignalSignatures>(
|
|
418
462
|
signal: K,
|
|
419
463
|
callback: GObject.SignalCallback<this, ApplicationWindow.SignalSignatures[K]>,
|
|
420
464
|
): number;
|
|
421
465
|
connect_after(signal: string, callback: (...args: any[]) => any): number;
|
|
466
|
+
/** @signal */
|
|
422
467
|
emit<K extends keyof ApplicationWindow.SignalSignatures>(
|
|
423
468
|
signal: K,
|
|
424
469
|
...args: GObject.GjsParameters<ApplicationWindow.SignalSignatures[K]> extends [any, ...infer Q] ? Q : never
|
|
@@ -428,65 +473,71 @@ export namespace Amtk {
|
|
|
428
473
|
// Static methods
|
|
429
474
|
|
|
430
475
|
/**
|
|
431
|
-
* Returns the
|
|
476
|
+
* Returns the {@link Amtk.ApplicationWindow} of `gtk_window`. The returned object is
|
|
432
477
|
* guaranteed to be the same for the lifetime of `gtk_window`.
|
|
433
|
-
* @param gtk_window a
|
|
478
|
+
* @param gtk_window a {@link Gtk.ApplicationWindow}.
|
|
434
479
|
*/
|
|
435
480
|
static get_from_gtk_application_window(gtk_window: Gtk.ApplicationWindow): ApplicationWindow;
|
|
436
481
|
|
|
437
482
|
// Methods
|
|
438
483
|
|
|
439
484
|
/**
|
|
440
|
-
* Connects to the
|
|
441
|
-
*
|
|
442
|
-
* long description of
|
|
485
|
+
* Connects to the {@link Amtk.MenuShell.SignalSignatures.menu_item_selected | Amtk.MenuShell::menu-item-selected} and
|
|
486
|
+
* {@link Amtk.MenuShell.SignalSignatures.menu_item_deselected | Amtk.MenuShell::menu-item-deselected} signals of `menu_shell` to push/pop the
|
|
487
|
+
* long description of {@link Gtk.MenuItem}'s to the {@link Amtk.ApplicationWindow.statusbar}.
|
|
443
488
|
*
|
|
444
|
-
* The long description is retrieved with amtk_menu_item_get_long_description()
|
|
445
|
-
* So amtk_menu_item_set_long_description() must have been called, which is the
|
|
446
|
-
* case if the
|
|
447
|
-
* @param menu_shell a
|
|
489
|
+
* The long description is retrieved with `amtk_menu_item_get_long_description()`.
|
|
490
|
+
* So `amtk_menu_item_set_long_description()` must have been called, which is the
|
|
491
|
+
* case if the {@link Gtk.MenuItem} has been created with {@link Amtk.Factory}.
|
|
492
|
+
* @param menu_shell a {@link Gtk.MenuShell}.
|
|
448
493
|
*/
|
|
449
494
|
connect_menu_to_statusbar(menu_shell: Gtk.MenuShell): void;
|
|
450
495
|
/**
|
|
451
|
-
* An alternative to gtk_recent_chooser_set_show_tips()
|
|
452
|
-
* the
|
|
496
|
+
* An alternative to `gtk_recent_chooser_set_show_tips()`. Shows the full path in
|
|
497
|
+
* the {@link Amtk.ApplicationWindow.statusbar} when a {@link Gtk.MenuItem} of `menu` is
|
|
453
498
|
* selected.
|
|
454
499
|
*
|
|
455
500
|
* The full path is retrieved with
|
|
456
|
-
* amtk_utils_recent_chooser_menu_get_item_uri()
|
|
457
|
-
* @param menu a
|
|
501
|
+
* `amtk_utils_recent_chooser_menu_get_item_uri()`.
|
|
502
|
+
* @param menu a {@link Gtk.RecentChooserMenu}.
|
|
458
503
|
*/
|
|
459
504
|
connect_recent_chooser_menu_to_statusbar(menu: Gtk.RecentChooserMenu): void;
|
|
460
505
|
/**
|
|
461
|
-
* Creates a simple and generic
|
|
506
|
+
* Creates a simple and generic {@link Gtk.RecentChooserMenu}.
|
|
462
507
|
*
|
|
463
|
-
* The
|
|
464
|
-
* current application, as returned by g_get_application_name()
|
|
465
|
-
* are added to the default
|
|
466
|
-
* gtk_recent_manager_add_item()
|
|
467
|
-
*
|
|
508
|
+
* The {@link Gtk.RecentChooser} is configured to show files only recently used with the
|
|
509
|
+
* current application, as returned by `g_get_application_name()`. If recent files
|
|
510
|
+
* are added to the default {@link Gtk.RecentManager} with
|
|
511
|
+
* `gtk_recent_manager_add_item()`, the files will normally show up in the
|
|
512
|
+
* {@link Gtk.RecentChooserMenu}.
|
|
468
513
|
*
|
|
469
|
-
* The
|
|
470
|
-
* amtk_application_window_connect_recent_chooser_menu_to_statusbar()
|
|
514
|
+
* The {@link Gtk.RecentChooserMenu} is connected to the statusbar with
|
|
515
|
+
* `amtk_application_window_connect_recent_chooser_menu_to_statusbar()`.
|
|
471
516
|
*
|
|
472
|
-
* When the
|
|
473
|
-
* g_application_open() is called (with an empty hint), so the
|
|
474
|
-
* must have the
|
|
475
|
-
* @returns a new
|
|
517
|
+
* When the {@link Gtk.RecentChooser.SignalSignatures.item_activated | Gtk.RecentChooser::item-activated} signal is emitted,
|
|
518
|
+
* `g_application_open()` is called (with an empty hint), so the {@link Gio.Application}
|
|
519
|
+
* must have the {@link Gio.ApplicationFlags.HANDLES_OPEN} flag set.
|
|
520
|
+
* @returns a new {@link Gtk.RecentChooserMenu}.
|
|
476
521
|
*/
|
|
477
522
|
create_open_recent_menu(): Gtk.Widget;
|
|
478
523
|
/**
|
|
479
|
-
* Creates a
|
|
480
|
-
* submenu. The
|
|
481
|
-
* amtk_application_window_create_open_recent_menu()
|
|
482
|
-
* @returns a new
|
|
524
|
+
* Creates a {@link Gtk.MenuItem} with a simple and generic {@link Gtk.RecentChooserMenu} as
|
|
525
|
+
* submenu. The {@link Gtk.RecentChooserMenu} is created with
|
|
526
|
+
* `amtk_application_window_create_open_recent_menu()`.
|
|
527
|
+
* @returns a new {@link Gtk.MenuItem}.
|
|
483
528
|
*/
|
|
484
529
|
create_open_recent_menu_item(): Gtk.Widget;
|
|
530
|
+
/**
|
|
531
|
+
* @returns the {@link Gtk.ApplicationWindow} of `amtk_window`.
|
|
532
|
+
*/
|
|
485
533
|
get_application_window(): Gtk.ApplicationWindow;
|
|
534
|
+
/**
|
|
535
|
+
* @returns the {@link Amtk.ApplicationWindow.statusbar}.
|
|
536
|
+
*/
|
|
486
537
|
get_statusbar(): Gtk.Statusbar | null;
|
|
487
538
|
/**
|
|
488
|
-
* Sets the
|
|
489
|
-
* @param statusbar a
|
|
539
|
+
* Sets the {@link Amtk.ApplicationWindow.statusbar} property.
|
|
540
|
+
* @param statusbar a {@link Gtk.Statusbar}, or `null`.
|
|
490
541
|
*/
|
|
491
542
|
set_statusbar(statusbar?: Gtk.Statusbar | null): void;
|
|
492
543
|
}
|
|
@@ -507,23 +558,30 @@ export namespace Amtk {
|
|
|
507
558
|
}
|
|
508
559
|
}
|
|
509
560
|
|
|
561
|
+
/**
|
|
562
|
+
* @gir-type Class
|
|
563
|
+
*/
|
|
510
564
|
class Factory extends GObject.Object {
|
|
511
565
|
static $gtype: GObject.GType<Factory>;
|
|
512
566
|
|
|
513
567
|
// Properties
|
|
514
568
|
|
|
515
569
|
/**
|
|
516
|
-
* The associated
|
|
517
|
-
*
|
|
570
|
+
* The associated {@link Gtk.Application} (it is optional, it can be `null`).
|
|
571
|
+
* {@link Amtk.Factory} has a weak reference to the {@link Gtk.Application}.
|
|
572
|
+
* @since 3.0
|
|
573
|
+
* @construct-only
|
|
518
574
|
*/
|
|
519
575
|
get application(): Gtk.Application;
|
|
520
576
|
/**
|
|
521
|
-
* The default
|
|
577
|
+
* The default {@link Amtk.FactoryFlags}.
|
|
578
|
+
* @since 3.0
|
|
522
579
|
*/
|
|
523
580
|
get default_flags(): FactoryFlags;
|
|
524
581
|
set default_flags(val: FactoryFlags);
|
|
525
582
|
/**
|
|
526
|
-
* The default
|
|
583
|
+
* The default {@link Amtk.FactoryFlags}.
|
|
584
|
+
* @since 3.0
|
|
527
585
|
*/
|
|
528
586
|
get defaultFlags(): FactoryFlags;
|
|
529
587
|
set defaultFlags(val: FactoryFlags);
|
|
@@ -549,16 +607,19 @@ export namespace Amtk {
|
|
|
549
607
|
|
|
550
608
|
// Signals
|
|
551
609
|
|
|
610
|
+
/** @signal */
|
|
552
611
|
connect<K extends keyof Factory.SignalSignatures>(
|
|
553
612
|
signal: K,
|
|
554
613
|
callback: GObject.SignalCallback<this, Factory.SignalSignatures[K]>,
|
|
555
614
|
): number;
|
|
556
615
|
connect(signal: string, callback: (...args: any[]) => any): number;
|
|
616
|
+
/** @signal */
|
|
557
617
|
connect_after<K extends keyof Factory.SignalSignatures>(
|
|
558
618
|
signal: K,
|
|
559
619
|
callback: GObject.SignalCallback<this, Factory.SignalSignatures[K]>,
|
|
560
620
|
): number;
|
|
561
621
|
connect_after(signal: string, callback: (...args: any[]) => any): number;
|
|
622
|
+
/** @signal */
|
|
562
623
|
emit<K extends keyof Factory.SignalSignatures>(
|
|
563
624
|
signal: K,
|
|
564
625
|
...args: GObject.GjsParameters<Factory.SignalSignatures[K]> extends [any, ...infer Q] ? Q : never
|
|
@@ -568,84 +629,90 @@ export namespace Amtk {
|
|
|
568
629
|
// Methods
|
|
569
630
|
|
|
570
631
|
/**
|
|
571
|
-
* Creates a new
|
|
572
|
-
*
|
|
632
|
+
* Creates a new {@link Gtk.CheckMenuItem} for `action_name` with the
|
|
633
|
+
* {@link Amtk.Factory.default_flags}.
|
|
573
634
|
*
|
|
574
|
-
* See the documentation of amtk_factory_create_check_menu_item_full() for more
|
|
635
|
+
* See the documentation of `amtk_factory_create_check_menu_item_full()` for more
|
|
575
636
|
* information.
|
|
576
637
|
* @param action_name an action name.
|
|
577
|
-
* @returns a new
|
|
638
|
+
* @returns a new {@link Gtk.CheckMenuItem} for `action_name`.
|
|
578
639
|
*/
|
|
579
640
|
create_check_menu_item(action_name: string): Gtk.Widget;
|
|
580
641
|
/**
|
|
581
|
-
* This function ignores the
|
|
642
|
+
* This function ignores the {@link Amtk.Factory.default_flags} property and takes the
|
|
582
643
|
* `flags` argument instead.
|
|
583
644
|
*
|
|
584
|
-
* Note that since it is a
|
|
585
|
-
* would be possible with amtk_menu_item_set_icon_name()
|
|
645
|
+
* Note that since it is a {@link Gtk.CheckMenuItem} the icon is not set, even if it
|
|
646
|
+
* would be possible with `amtk_menu_item_set_icon_name()`.
|
|
586
647
|
*
|
|
587
648
|
* If the action controls a boolean property, think about using
|
|
588
|
-
*
|
|
649
|
+
* {@link Gio.PropertyAction}.
|
|
589
650
|
* @param action_name an action name.
|
|
590
|
-
* @param flags
|
|
591
|
-
* @returns a new
|
|
651
|
+
* @param flags {@link Amtk.FactoryFlags}.
|
|
652
|
+
* @returns a new {@link Gtk.CheckMenuItem} for `action_name`.
|
|
592
653
|
*/
|
|
593
654
|
create_check_menu_item_full(action_name: string, flags: FactoryFlags | null): Gtk.Widget;
|
|
594
655
|
/**
|
|
595
|
-
* Creates a new
|
|
596
|
-
*
|
|
656
|
+
* Creates a new {@link Gtk.MenuItem} for `action_name` with the
|
|
657
|
+
* {@link Amtk.Factory.default_flags}.
|
|
597
658
|
* @param action_name an action name.
|
|
598
|
-
* @returns a new
|
|
659
|
+
* @returns a new {@link Gtk.MenuItem} for `action_name`.
|
|
599
660
|
*/
|
|
600
661
|
create_menu_item(action_name: string): Gtk.Widget;
|
|
601
662
|
/**
|
|
602
|
-
* This function ignores the
|
|
663
|
+
* This function ignores the {@link Amtk.Factory.default_flags} property and takes the
|
|
603
664
|
* `flags` argument instead.
|
|
604
665
|
* @param action_name an action name.
|
|
605
|
-
* @param flags
|
|
606
|
-
* @returns a new
|
|
666
|
+
* @param flags {@link Amtk.FactoryFlags}.
|
|
667
|
+
* @returns a new {@link Gtk.MenuItem} for `action_name`.
|
|
607
668
|
*/
|
|
608
669
|
create_menu_item_full(action_name: string, flags: FactoryFlags | null): Gtk.Widget;
|
|
609
670
|
/**
|
|
610
|
-
* Creates a new
|
|
611
|
-
*
|
|
671
|
+
* Creates a new {@link Gtk.MenuToolButton} for `action_name` with the
|
|
672
|
+
* {@link Amtk.Factory.default_flags}.
|
|
612
673
|
*
|
|
613
|
-
* See the documentation of amtk_factory_create_menu_tool_button_full() for more
|
|
674
|
+
* See the documentation of `amtk_factory_create_menu_tool_button_full()` for more
|
|
614
675
|
* information.
|
|
615
676
|
* @param action_name an action name.
|
|
616
|
-
* @returns a new
|
|
677
|
+
* @returns a new {@link Gtk.MenuToolButton} for `action_name`.
|
|
617
678
|
*/
|
|
618
679
|
create_menu_tool_button(action_name: string): Gtk.MenuToolButton;
|
|
619
680
|
/**
|
|
620
|
-
* This function ignores the
|
|
681
|
+
* This function ignores the {@link Amtk.Factory.default_flags} property and takes the
|
|
621
682
|
* `flags` argument instead.
|
|
622
683
|
*
|
|
623
|
-
* After calling this function, you need to use the
|
|
684
|
+
* After calling this function, you need to use the {@link Gtk.MenuToolButton} API to
|
|
624
685
|
* set the menu and also possibly set a tooltip to the arrow.
|
|
625
686
|
* @param action_name an action name.
|
|
626
|
-
* @param flags
|
|
627
|
-
* @returns a new
|
|
687
|
+
* @param flags {@link Amtk.FactoryFlags}.
|
|
688
|
+
* @returns a new {@link Gtk.MenuToolButton} for `action_name`.
|
|
628
689
|
*/
|
|
629
690
|
create_menu_tool_button_full(action_name: string, flags: FactoryFlags | null): Gtk.MenuToolButton;
|
|
630
691
|
/**
|
|
631
|
-
* Creates a new
|
|
632
|
-
*
|
|
692
|
+
* Creates a new {@link Gtk.ToolButton} for `action_name` with the
|
|
693
|
+
* {@link Amtk.Factory.default_flags}.
|
|
633
694
|
* @param action_name an action name.
|
|
634
|
-
* @returns a new
|
|
695
|
+
* @returns a new {@link Gtk.ToolButton} for `action_name`.
|
|
635
696
|
*/
|
|
636
697
|
create_tool_button(action_name: string): Gtk.ToolItem;
|
|
637
698
|
/**
|
|
638
|
-
* This function ignores the
|
|
699
|
+
* This function ignores the {@link Amtk.Factory.default_flags} property and takes the
|
|
639
700
|
* `flags` argument instead.
|
|
640
701
|
* @param action_name an action name.
|
|
641
|
-
* @param flags
|
|
642
|
-
* @returns a new
|
|
702
|
+
* @param flags {@link Amtk.FactoryFlags}.
|
|
703
|
+
* @returns a new {@link Gtk.ToolButton} for `action_name`.
|
|
643
704
|
*/
|
|
644
705
|
create_tool_button_full(action_name: string, flags: FactoryFlags | null): Gtk.ToolItem;
|
|
706
|
+
/**
|
|
707
|
+
* @returns the {@link Amtk.Factory.application}.
|
|
708
|
+
*/
|
|
645
709
|
get_application(): Gtk.Application | null;
|
|
710
|
+
/**
|
|
711
|
+
* @returns the {@link Amtk.Factory.default_flags}.
|
|
712
|
+
*/
|
|
646
713
|
get_default_flags(): FactoryFlags;
|
|
647
714
|
/**
|
|
648
|
-
* Sets the
|
|
715
|
+
* Sets the {@link Amtk.Factory.default_flags} property.
|
|
649
716
|
* @param default_flags the new value.
|
|
650
717
|
*/
|
|
651
718
|
set_default_flags(default_flags: FactoryFlags | null): void;
|
|
@@ -654,7 +721,23 @@ export namespace Amtk {
|
|
|
654
721
|
namespace MenuShell {
|
|
655
722
|
// Signal signatures
|
|
656
723
|
interface SignalSignatures extends GObject.Object.SignalSignatures {
|
|
724
|
+
/**
|
|
725
|
+
* The ::menu-item-deselected signal is emitted when the
|
|
726
|
+
* {@link Gtk.MenuItem.SignalSignatures.deselect | Gtk.MenuItem::deselect} signal is emitted on a {@link Gtk.MenuItem} belonging
|
|
727
|
+
* (directly or indirectly through submenus) to `amtk_menu_shell`.
|
|
728
|
+
* @signal
|
|
729
|
+
* @since 2.0
|
|
730
|
+
* @run-first
|
|
731
|
+
*/
|
|
657
732
|
'menu-item-deselected': (arg0: Gtk.MenuItem) => void;
|
|
733
|
+
/**
|
|
734
|
+
* The ::menu-item-selected signal is emitted when the
|
|
735
|
+
* {@link Gtk.MenuItem.SignalSignatures.select | Gtk.MenuItem::select} signal is emitted on a {@link Gtk.MenuItem} belonging
|
|
736
|
+
* (directly or indirectly through submenus) to `amtk_menu_shell`.
|
|
737
|
+
* @signal
|
|
738
|
+
* @since 2.0
|
|
739
|
+
* @run-first
|
|
740
|
+
*/
|
|
658
741
|
'menu-item-selected': (arg0: Gtk.MenuItem) => void;
|
|
659
742
|
'notify::menu-shell': (pspec: GObject.ParamSpec) => void;
|
|
660
743
|
}
|
|
@@ -667,17 +750,24 @@ export namespace Amtk {
|
|
|
667
750
|
}
|
|
668
751
|
}
|
|
669
752
|
|
|
753
|
+
/**
|
|
754
|
+
* @gir-type Class
|
|
755
|
+
*/
|
|
670
756
|
class MenuShell extends GObject.Object {
|
|
671
757
|
static $gtype: GObject.GType<MenuShell>;
|
|
672
758
|
|
|
673
759
|
// Properties
|
|
674
760
|
|
|
675
761
|
/**
|
|
676
|
-
* The
|
|
762
|
+
* The {@link Gtk.MenuShell}.
|
|
763
|
+
* @since 2.0
|
|
764
|
+
* @construct-only
|
|
677
765
|
*/
|
|
678
766
|
get menu_shell(): Gtk.MenuShell;
|
|
679
767
|
/**
|
|
680
|
-
* The
|
|
768
|
+
* The {@link Gtk.MenuShell}.
|
|
769
|
+
* @since 2.0
|
|
770
|
+
* @construct-only
|
|
681
771
|
*/
|
|
682
772
|
get menuShell(): Gtk.MenuShell;
|
|
683
773
|
|
|
@@ -698,16 +788,19 @@ export namespace Amtk {
|
|
|
698
788
|
|
|
699
789
|
// Signals
|
|
700
790
|
|
|
791
|
+
/** @signal */
|
|
701
792
|
connect<K extends keyof MenuShell.SignalSignatures>(
|
|
702
793
|
signal: K,
|
|
703
794
|
callback: GObject.SignalCallback<this, MenuShell.SignalSignatures[K]>,
|
|
704
795
|
): number;
|
|
705
796
|
connect(signal: string, callback: (...args: any[]) => any): number;
|
|
797
|
+
/** @signal */
|
|
706
798
|
connect_after<K extends keyof MenuShell.SignalSignatures>(
|
|
707
799
|
signal: K,
|
|
708
800
|
callback: GObject.SignalCallback<this, MenuShell.SignalSignatures[K]>,
|
|
709
801
|
): number;
|
|
710
802
|
connect_after(signal: string, callback: (...args: any[]) => any): number;
|
|
803
|
+
/** @signal */
|
|
711
804
|
emit<K extends keyof MenuShell.SignalSignatures>(
|
|
712
805
|
signal: K,
|
|
713
806
|
...args: GObject.GjsParameters<MenuShell.SignalSignatures[K]> extends [any, ...infer Q] ? Q : never
|
|
@@ -717,22 +810,36 @@ export namespace Amtk {
|
|
|
717
810
|
// Static methods
|
|
718
811
|
|
|
719
812
|
/**
|
|
720
|
-
* Returns the
|
|
813
|
+
* Returns the {@link Amtk.MenuShell} of `gtk_menu_shell`. The returned object is
|
|
721
814
|
* guaranteed to be the same for the lifetime of `gtk_menu_shell`.
|
|
722
|
-
* @param gtk_menu_shell a
|
|
815
|
+
* @param gtk_menu_shell a {@link Gtk.MenuShell}.
|
|
723
816
|
*/
|
|
724
817
|
static get_from_gtk_menu_shell(gtk_menu_shell: Gtk.MenuShell): MenuShell;
|
|
725
818
|
|
|
726
819
|
// Virtual methods
|
|
727
820
|
|
|
821
|
+
/**
|
|
822
|
+
* @param menu_item
|
|
823
|
+
* @virtual
|
|
824
|
+
*/
|
|
728
825
|
vfunc_menu_item_deselected(menu_item: Gtk.MenuItem): void;
|
|
826
|
+
/**
|
|
827
|
+
* @param menu_item
|
|
828
|
+
* @virtual
|
|
829
|
+
*/
|
|
729
830
|
vfunc_menu_item_selected(menu_item: Gtk.MenuItem): void;
|
|
730
831
|
|
|
731
832
|
// Methods
|
|
732
833
|
|
|
834
|
+
/**
|
|
835
|
+
* @returns the {@link Gtk.MenuShell} of `amtk_menu_shell`.
|
|
836
|
+
*/
|
|
733
837
|
get_menu_shell(): Gtk.MenuShell;
|
|
734
838
|
}
|
|
735
839
|
|
|
840
|
+
/**
|
|
841
|
+
* @gir-type Struct
|
|
842
|
+
*/
|
|
736
843
|
class ActionInfo {
|
|
737
844
|
static $gtype: GObject.GType<ActionInfo>;
|
|
738
845
|
|
|
@@ -746,44 +853,56 @@ export namespace Amtk {
|
|
|
746
853
|
|
|
747
854
|
// Methods
|
|
748
855
|
|
|
856
|
+
/**
|
|
857
|
+
* @returns a copy of `info`. The copy will have a reference count of one.
|
|
858
|
+
*/
|
|
749
859
|
copy(): ActionInfo;
|
|
750
860
|
/**
|
|
751
|
-
* Returns the accelerators. This function never returns
|
|
752
|
-
* returns a
|
|
753
|
-
* gtk_application_set_accels_for_action()
|
|
754
|
-
* @returns a
|
|
861
|
+
* Returns the accelerators. This function never returns `null`, it always
|
|
862
|
+
* returns a `null`-terminated array, to be suitable for
|
|
863
|
+
* `gtk_application_set_accels_for_action()`.
|
|
864
|
+
* @returns a `null`-terminated array of accelerators in the format understood by `gtk_accelerator_parse()`.
|
|
755
865
|
*/
|
|
756
866
|
get_accels(): string[];
|
|
867
|
+
/**
|
|
868
|
+
* @returns the action name, or `null`. Example: `"win.save"`.
|
|
869
|
+
*/
|
|
757
870
|
get_action_name(): string | null;
|
|
871
|
+
/**
|
|
872
|
+
* @returns the icon name, or `null`.
|
|
873
|
+
*/
|
|
758
874
|
get_icon_name(): string | null;
|
|
759
875
|
/**
|
|
760
876
|
* Gets the label. The label has normally a mnemonic.
|
|
761
|
-
* @returns the label (i.e. a short description), or
|
|
877
|
+
* @returns the label (i.e. a short description), or `null`.
|
|
762
878
|
*/
|
|
763
879
|
get_label(): string | null;
|
|
880
|
+
/**
|
|
881
|
+
* @returns the tooltip (i.e. a long description), or `null`.
|
|
882
|
+
*/
|
|
764
883
|
get_tooltip(): string | null;
|
|
765
884
|
/**
|
|
766
|
-
* Returns whether `info` has been used (for example by an
|
|
767
|
-
* function). See also amtk_action_info_store_check_all_used()
|
|
768
|
-
* @returns whether
|
|
885
|
+
* Returns whether `info` has been used (for example by an {@link Amtk.Factory}
|
|
886
|
+
* function). See also `amtk_action_info_store_check_all_used()`.
|
|
887
|
+
* @returns whether `info` has been used.
|
|
769
888
|
*/
|
|
770
889
|
has_been_used(): boolean;
|
|
771
890
|
/**
|
|
772
|
-
* Mark `info` as used. An
|
|
773
|
-
* should call this function. See amtk_action_info_store_check_all_used()
|
|
891
|
+
* Mark `info` as used. An {@link Amtk.Factory} function that uses an {@link Amtk.ActionInfo}
|
|
892
|
+
* should call this function. See `amtk_action_info_store_check_all_used()`.
|
|
774
893
|
*/
|
|
775
894
|
mark_as_used(): void;
|
|
776
895
|
/**
|
|
777
896
|
* Increments the reference count of `info` by one.
|
|
778
|
-
* @returns the passed in
|
|
897
|
+
* @returns the passed in `info`.
|
|
779
898
|
*/
|
|
780
899
|
ref(): ActionInfo;
|
|
781
900
|
/**
|
|
782
|
-
* A function similar to gtk_application_set_accels_for_action()
|
|
901
|
+
* A function similar to `gtk_application_set_accels_for_action()`.
|
|
783
902
|
*
|
|
784
|
-
* `accels` must not be
|
|
785
|
-
* consistent with gtk_application_set_accels_for_action()
|
|
786
|
-
* @param accels a
|
|
903
|
+
* `accels` must not be `null`, it must be a `null`-terminated array, to be
|
|
904
|
+
* consistent with `gtk_application_set_accels_for_action()`.
|
|
905
|
+
* @param accels a `null`-terminated array of accelerators in the format understood by `gtk_accelerator_parse()`.
|
|
787
906
|
*/
|
|
788
907
|
set_accels(accels: string[]): void;
|
|
789
908
|
/**
|
|
@@ -791,12 +910,18 @@ export namespace Amtk {
|
|
|
791
910
|
* @param action_name the action name.
|
|
792
911
|
*/
|
|
793
912
|
set_action_name(action_name: string): void;
|
|
913
|
+
/**
|
|
914
|
+
* @param icon_name the icon name, or `null`.
|
|
915
|
+
*/
|
|
794
916
|
set_icon_name(icon_name?: string | null): void;
|
|
795
917
|
/**
|
|
796
918
|
* Sets the label with a mnemonic.
|
|
797
|
-
* @param label the label (i.e. a short description), or
|
|
919
|
+
* @param label the label (i.e. a short description), or `null`.
|
|
798
920
|
*/
|
|
799
921
|
set_label(label?: string | null): void;
|
|
922
|
+
/**
|
|
923
|
+
* @param tooltip the tooltip (i.e. a long description), or `null`.
|
|
924
|
+
*/
|
|
800
925
|
set_tooltip(tooltip?: string | null): void;
|
|
801
926
|
/**
|
|
802
927
|
* Decrements the reference count of `info` by one. If the reference count drops
|
|
@@ -805,18 +930,26 @@ export namespace Amtk {
|
|
|
805
930
|
unref(): void;
|
|
806
931
|
}
|
|
807
932
|
|
|
933
|
+
/**
|
|
934
|
+
* @gir-type Alias
|
|
935
|
+
*/
|
|
808
936
|
type ActionInfoCentralStoreClass = typeof ActionInfoCentralStore;
|
|
937
|
+
/**
|
|
938
|
+
* @gir-type Struct
|
|
939
|
+
*/
|
|
809
940
|
abstract class ActionInfoCentralStorePrivate {
|
|
810
941
|
static $gtype: GObject.GType<ActionInfoCentralStorePrivate>;
|
|
811
942
|
}
|
|
812
943
|
|
|
813
944
|
/**
|
|
814
945
|
* This struct defines a set of information for a single action. It is for use
|
|
815
|
-
* with amtk_action_info_store_add_entries()
|
|
946
|
+
* with `amtk_action_info_store_add_entries()`.
|
|
816
947
|
*
|
|
817
|
-
* Like
|
|
818
|
-
* order to leave some of the later values as
|
|
948
|
+
* Like {@link Gio.ActionEntry}, it is permissible to use an incomplete initialiser in
|
|
949
|
+
* order to leave some of the later values as `null`. Additional optional fields
|
|
819
950
|
* may be added in the future.
|
|
951
|
+
* @gir-type Struct
|
|
952
|
+
* @since 2.0
|
|
820
953
|
*/
|
|
821
954
|
class ActionInfoEntry {
|
|
822
955
|
static $gtype: GObject.GType<ActionInfoEntry>;
|
|
@@ -842,22 +975,46 @@ export namespace Amtk {
|
|
|
842
975
|
);
|
|
843
976
|
}
|
|
844
977
|
|
|
978
|
+
/**
|
|
979
|
+
* @gir-type Alias
|
|
980
|
+
*/
|
|
845
981
|
type ActionInfoStoreClass = typeof ActionInfoStore;
|
|
982
|
+
/**
|
|
983
|
+
* @gir-type Struct
|
|
984
|
+
*/
|
|
846
985
|
abstract class ActionInfoStorePrivate {
|
|
847
986
|
static $gtype: GObject.GType<ActionInfoStorePrivate>;
|
|
848
987
|
}
|
|
849
988
|
|
|
989
|
+
/**
|
|
990
|
+
* @gir-type Alias
|
|
991
|
+
*/
|
|
850
992
|
type ApplicationWindowClass = typeof ApplicationWindow;
|
|
993
|
+
/**
|
|
994
|
+
* @gir-type Struct
|
|
995
|
+
*/
|
|
851
996
|
abstract class ApplicationWindowPrivate {
|
|
852
997
|
static $gtype: GObject.GType<ApplicationWindowPrivate>;
|
|
853
998
|
}
|
|
854
999
|
|
|
1000
|
+
/**
|
|
1001
|
+
* @gir-type Alias
|
|
1002
|
+
*/
|
|
855
1003
|
type FactoryClass = typeof Factory;
|
|
1004
|
+
/**
|
|
1005
|
+
* @gir-type Struct
|
|
1006
|
+
*/
|
|
856
1007
|
abstract class FactoryPrivate {
|
|
857
1008
|
static $gtype: GObject.GType<FactoryPrivate>;
|
|
858
1009
|
}
|
|
859
1010
|
|
|
1011
|
+
/**
|
|
1012
|
+
* @gir-type Alias
|
|
1013
|
+
*/
|
|
860
1014
|
type MenuShellClass = typeof MenuShell;
|
|
1015
|
+
/**
|
|
1016
|
+
* @gir-type Struct
|
|
1017
|
+
*/
|
|
861
1018
|
abstract class MenuShellPrivate {
|
|
862
1019
|
static $gtype: GObject.GType<MenuShellPrivate>;
|
|
863
1020
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@girs/amtk-4",
|
|
3
|
-
"version": "4.0.0-4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-4.0.0-beta.41",
|
|
4
4
|
"description": "GJS TypeScript type definitions for Amtk-4, generated from library version 4.0.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "amtk-4.js",
|
|
@@ -31,20 +31,20 @@
|
|
|
31
31
|
"test": "tsc --project tsconfig.json"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@girs/gjs": "4.0.0-beta.
|
|
35
|
-
"@girs/gtk-3.0": "3.24.51-4.0.0-beta.
|
|
36
|
-
"@girs/xlib-2.0": "2.0.0-4.0.0-beta.
|
|
37
|
-
"@girs/gdk-3.0": "3.24.51-4.0.0-beta.
|
|
38
|
-
"@girs/cairo-1.0": "1.0.0-4.0.0-beta.
|
|
39
|
-
"@girs/gobject-2.0": "2.
|
|
40
|
-
"@girs/glib-2.0": "2.
|
|
41
|
-
"@girs/pango-1.0": "1.57.0-4.0.0-beta.
|
|
42
|
-
"@girs/harfbuzz-0.0": "
|
|
43
|
-
"@girs/freetype2-2.0": "2.0.0-4.0.0-beta.
|
|
44
|
-
"@girs/gio-2.0": "2.
|
|
45
|
-
"@girs/gmodule-2.0": "2.0.0-4.0.0-beta.
|
|
46
|
-
"@girs/gdkpixbuf-2.0": "2.0.0-4.0.0-beta.
|
|
47
|
-
"@girs/atk-1.0": "2.
|
|
34
|
+
"@girs/gjs": "4.0.0-beta.41",
|
|
35
|
+
"@girs/gtk-3.0": "3.24.51-4.0.0-beta.41",
|
|
36
|
+
"@girs/xlib-2.0": "2.0.0-4.0.0-beta.41",
|
|
37
|
+
"@girs/gdk-3.0": "3.24.51-4.0.0-beta.41",
|
|
38
|
+
"@girs/cairo-1.0": "1.0.0-4.0.0-beta.41",
|
|
39
|
+
"@girs/gobject-2.0": "2.88.0-4.0.0-beta.41",
|
|
40
|
+
"@girs/glib-2.0": "2.88.0-4.0.0-beta.41",
|
|
41
|
+
"@girs/pango-1.0": "1.57.0-4.0.0-beta.41",
|
|
42
|
+
"@girs/harfbuzz-0.0": "12.3.2-4.0.0-beta.41",
|
|
43
|
+
"@girs/freetype2-2.0": "2.0.0-4.0.0-beta.41",
|
|
44
|
+
"@girs/gio-2.0": "2.88.0-4.0.0-beta.41",
|
|
45
|
+
"@girs/gmodule-2.0": "2.0.0-4.0.0-beta.41",
|
|
46
|
+
"@girs/gdkpixbuf-2.0": "2.0.0-4.0.0-beta.41",
|
|
47
|
+
"@girs/atk-1.0": "2.60.0-4.0.0-beta.41" },
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"typescript": "*"
|
|
50
50
|
},
|
package/tsconfig.json
CHANGED
|
@@ -17,7 +17,51 @@
|
|
|
17
17
|
"inlineSources": false,
|
|
18
18
|
"newLine": "LF",
|
|
19
19
|
// Show diagnostics
|
|
20
|
-
"diagnostics": true
|
|
20
|
+
"diagnostics": true,
|
|
21
|
+
"paths": {
|
|
22
|
+
"@girs/gtk-3.0": [
|
|
23
|
+
"../gtk-3.0/index.d.ts"
|
|
24
|
+
],
|
|
25
|
+
"@girs/xlib-2.0": [
|
|
26
|
+
"../xlib-2.0/index.d.ts"
|
|
27
|
+
],
|
|
28
|
+
"@girs/gdk-3.0": [
|
|
29
|
+
"../gdk-3.0/index.d.ts"
|
|
30
|
+
],
|
|
31
|
+
"@girs/cairo-1.0": [
|
|
32
|
+
"../cairo-1.0/index.d.ts"
|
|
33
|
+
],
|
|
34
|
+
"@girs/gobject-2.0": [
|
|
35
|
+
"../gobject-2.0/index.d.ts"
|
|
36
|
+
],
|
|
37
|
+
"@girs/glib-2.0": [
|
|
38
|
+
"../glib-2.0/index.d.ts"
|
|
39
|
+
],
|
|
40
|
+
"@girs/pango-1.0": [
|
|
41
|
+
"../pango-1.0/index.d.ts"
|
|
42
|
+
],
|
|
43
|
+
"@girs/harfbuzz-0.0": [
|
|
44
|
+
"../harfbuzz-0.0/index.d.ts"
|
|
45
|
+
],
|
|
46
|
+
"@girs/freetype2-2.0": [
|
|
47
|
+
"../freetype2-2.0/index.d.ts"
|
|
48
|
+
],
|
|
49
|
+
"@girs/gio-2.0": [
|
|
50
|
+
"../gio-2.0/index.d.ts"
|
|
51
|
+
],
|
|
52
|
+
"@girs/gmodule-2.0": [
|
|
53
|
+
"../gmodule-2.0/index.d.ts"
|
|
54
|
+
],
|
|
55
|
+
"@girs/gdkpixbuf-2.0": [
|
|
56
|
+
"../gdkpixbuf-2.0/index.d.ts"
|
|
57
|
+
],
|
|
58
|
+
"@girs/atk-1.0": [
|
|
59
|
+
"../atk-1.0/index.d.ts"
|
|
60
|
+
],
|
|
61
|
+
"@girs/gjs": [
|
|
62
|
+
"../gjs/index.d.ts"
|
|
63
|
+
]
|
|
64
|
+
}
|
|
21
65
|
},
|
|
22
66
|
"include": ["./amtk-4.d.ts"]
|
|
23
67
|
}
|
package/typedoc.json
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
"entryPoints": ["./amtk-4.d.ts"],
|
|
3
3
|
"readme": "./README.md",
|
|
4
4
|
"name": "Amtk-4",
|
|
5
|
-
"tsconfig": "./tsconfig.json"
|
|
5
|
+
"tsconfig": "./tsconfig.json",
|
|
6
|
+
"skipErrorChecking": true,
|
|
7
|
+
"highlightLanguages": ["typescript", "javascript", "c", "cpp", "xml", "bash", "json", "css"]
|
|
6
8
|
}
|
|
7
9
|
|