@girs/garcon-1.0 4.18.2-4.0.0-beta.3
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 +86 -0
- package/garcon-1.0-ambient.d.ts +12 -0
- package/garcon-1.0-ambient.js +2 -0
- package/garcon-1.0-import.d.ts +12 -0
- package/garcon-1.0-import.js +3 -0
- package/garcon-1.0.d.ts +2885 -0
- package/garcon-1.0.js +6 -0
- package/package.json +56 -0
- package/tsconfig.json +23 -0
- package/typedoc.json +7 -0
package/garcon-1.0.d.ts
ADDED
|
@@ -0,0 +1,2885 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Type Definitions for Gjs (https://gjs.guide/)
|
|
3
|
+
*
|
|
4
|
+
* These type definitions are automatically generated, do not edit them by hand.
|
|
5
|
+
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import './garcon-1.0-ambient.d.ts';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Garcon-1.0
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import type Libxfce4util from '@girs/libxfce4util-1.0';
|
|
15
|
+
import type Gio from '@girs/gio-2.0';
|
|
16
|
+
import type GObject from '@girs/gobject-2.0';
|
|
17
|
+
import type GLib from '@girs/glib-2.0';
|
|
18
|
+
|
|
19
|
+
export namespace Garcon {
|
|
20
|
+
enum MenuLayoutMergeType {
|
|
21
|
+
MENUS,
|
|
22
|
+
FILES,
|
|
23
|
+
ALL,
|
|
24
|
+
}
|
|
25
|
+
enum MenuMergeFileType {
|
|
26
|
+
PATH,
|
|
27
|
+
PARENT,
|
|
28
|
+
}
|
|
29
|
+
enum MenuNodeType {
|
|
30
|
+
INVALID,
|
|
31
|
+
MENU,
|
|
32
|
+
NAME,
|
|
33
|
+
DIRECTORY,
|
|
34
|
+
DIRECTORYDIR,
|
|
35
|
+
DEFAULTDIRECTORYDIRS,
|
|
36
|
+
APPDIR,
|
|
37
|
+
DEFAULTAPPDIRS,
|
|
38
|
+
ONLYUNALLOCATED,
|
|
39
|
+
NOTONLYUNALLOCATED,
|
|
40
|
+
DELETED,
|
|
41
|
+
NOTDELETED,
|
|
42
|
+
INCLUDE,
|
|
43
|
+
EXCLUDE,
|
|
44
|
+
ALL,
|
|
45
|
+
FILENAME,
|
|
46
|
+
CATEGORY,
|
|
47
|
+
OR,
|
|
48
|
+
AND,
|
|
49
|
+
NOT,
|
|
50
|
+
MOVE,
|
|
51
|
+
OLD,
|
|
52
|
+
NEW,
|
|
53
|
+
DEFAULTLAYOUT,
|
|
54
|
+
LAYOUT,
|
|
55
|
+
MENUNAME,
|
|
56
|
+
SEPARATOR,
|
|
57
|
+
MERGE,
|
|
58
|
+
MERGEFILE,
|
|
59
|
+
MERGEDIR,
|
|
60
|
+
MERGEDIRS,
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Macro for garcon_set_environment or garcon_set_environment_xdg
|
|
64
|
+
* to set the Xfce Desktop Environment.
|
|
65
|
+
*/
|
|
66
|
+
const ENVIRONMENT_XFCE: string;
|
|
67
|
+
/**
|
|
68
|
+
* The major version number of the garcon library.
|
|
69
|
+
* Like garcon_major_version, but from the headers used at
|
|
70
|
+
* application compile time, rather than from the library
|
|
71
|
+
* linked against at application run time.
|
|
72
|
+
*/
|
|
73
|
+
const MAJOR_VERSION: number;
|
|
74
|
+
/**
|
|
75
|
+
* The micro version number of the garcon library.
|
|
76
|
+
* Like garcon_micro_version, but from the headers used at
|
|
77
|
+
* application compile time, rather than from the library
|
|
78
|
+
* linked against at application run time.
|
|
79
|
+
*/
|
|
80
|
+
const MICRO_VERSION: number;
|
|
81
|
+
/**
|
|
82
|
+
* The minor version number of the garcon library.
|
|
83
|
+
* Like garcon_minor_version, but from the headers used at
|
|
84
|
+
* application compile time, rather than from the library
|
|
85
|
+
* linked against at application run time.
|
|
86
|
+
*/
|
|
87
|
+
const MINOR_VERSION: number;
|
|
88
|
+
/**
|
|
89
|
+
* Checks that the <systemitem class="library">garcon</systemitem>
|
|
90
|
+
* library in use is compatible with the given version. Generally you
|
|
91
|
+
* would pass in the constants #GARCON_MAJOR_VERSION,
|
|
92
|
+
* #GARCON_MINOR_VERSION and #GARCON_MICRO_VERSION as the three
|
|
93
|
+
* arguments to this function; that produces a check that the library
|
|
94
|
+
* in use is compatible with the version of
|
|
95
|
+
* <systemitem class="library">garcon</systemitem> the application was
|
|
96
|
+
* compiled against.
|
|
97
|
+
*
|
|
98
|
+
* <example>
|
|
99
|
+
* <title>Checking the runtime version of the garcon library</title>
|
|
100
|
+
* <programlisting>
|
|
101
|
+
* const gchar *mismatch;
|
|
102
|
+
* mismatch = garcon_check_version (GARCON_VERSION_MAJOR,
|
|
103
|
+
* GARCON_VERSION_MINOR,
|
|
104
|
+
* GARCON_VERSION_MICRO);
|
|
105
|
+
* if (G_UNLIKELY (mismatch != NULL))
|
|
106
|
+
* g_error ("Version mismatch: %<!---->s", mismatch);
|
|
107
|
+
* </programlisting>
|
|
108
|
+
* </example>
|
|
109
|
+
* @param required_major the required major version.
|
|
110
|
+
* @param required_minor the required minor version.
|
|
111
|
+
* @param required_micro the required micro version.
|
|
112
|
+
* @returns %NULL if the library is compatible with the given version, or a string describing the version mismatch. The returned string is owned by the library and must not be freed or modified by the caller.
|
|
113
|
+
*/
|
|
114
|
+
function check_version(required_major: number, required_minor: number, required_micro: number): string;
|
|
115
|
+
function config_build_paths(filename: string): string[];
|
|
116
|
+
/**
|
|
117
|
+
* Looks for the filename in the users' config directory and then
|
|
118
|
+
* the system config directories.
|
|
119
|
+
* @param filename relative filename of the config resource.
|
|
120
|
+
* @returns the absolute path to the first file in the search path, that matches @filename or %NULL if no such file or directory could be found.
|
|
121
|
+
*/
|
|
122
|
+
function config_lookup(filename: string): string;
|
|
123
|
+
/**
|
|
124
|
+
* Get the environment set with garcon_set_environment().
|
|
125
|
+
* @returns Name of the desktop environment (e.g. XFCE, KDE, GNOME) which is used or %NULL.
|
|
126
|
+
*/
|
|
127
|
+
function get_environment(): string;
|
|
128
|
+
function marshal_VOID__OBJECT_OBJECT(
|
|
129
|
+
closure: GObject.Closure,
|
|
130
|
+
return_value: GObject.Value | any,
|
|
131
|
+
n_param_values: number,
|
|
132
|
+
param_values: GObject.Value | any,
|
|
133
|
+
invocation_hint?: any | null,
|
|
134
|
+
marshal_data?: any | null,
|
|
135
|
+
): void;
|
|
136
|
+
/**
|
|
137
|
+
* Sets (or unsets) the desktop environment for which menus will generated.
|
|
138
|
+
* Menus and menu items belonging to other desktop environments will be
|
|
139
|
+
* ignored. If set to %NULL, all menu items are used.
|
|
140
|
+
* @param env Name of the desktop environment for which menus will be generated (e.g. XFCE, KDE, GNOME or %NULL).
|
|
141
|
+
*/
|
|
142
|
+
function set_environment(env: string): void;
|
|
143
|
+
/**
|
|
144
|
+
* Set the desktop environment to the envvar XDG_CURRENT_DESKTOP.
|
|
145
|
+
* If this variables is not set, it falls back to `default_env`.
|
|
146
|
+
*
|
|
147
|
+
* For `fallback_env` you can use for example #GARCON_ENVIRONMENT_XFCE.
|
|
148
|
+
* @param fallback_env fallback value
|
|
149
|
+
*/
|
|
150
|
+
function set_environment_xdg(fallback_env: string): void;
|
|
151
|
+
module Menu {
|
|
152
|
+
// Signal callback interfaces
|
|
153
|
+
|
|
154
|
+
interface DirectoryChanged {
|
|
155
|
+
(object: MenuDirectory, p0: MenuDirectory): void;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
interface ReloadRequired {
|
|
159
|
+
(): void;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// Constructor properties interface
|
|
163
|
+
|
|
164
|
+
interface ConstructorProps extends GObject.Object.ConstructorProps, MenuElement.ConstructorProps {
|
|
165
|
+
directory: MenuDirectory;
|
|
166
|
+
file: Gio.File;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
class Menu extends GObject.Object implements MenuElement {
|
|
171
|
+
static $gtype: GObject.GType<Menu>;
|
|
172
|
+
|
|
173
|
+
// Own properties of Garcon.Menu
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* The directory entry associated with this menu.
|
|
177
|
+
*/
|
|
178
|
+
get directory(): MenuDirectory;
|
|
179
|
+
set directory(val: MenuDirectory);
|
|
180
|
+
/**
|
|
181
|
+
* The #GFile from which the %GarconMenu was loaded.
|
|
182
|
+
*/
|
|
183
|
+
get file(): Gio.File;
|
|
184
|
+
|
|
185
|
+
// Constructors of Garcon.Menu
|
|
186
|
+
|
|
187
|
+
constructor(properties?: Partial<Menu.ConstructorProps>, ...args: any[]);
|
|
188
|
+
|
|
189
|
+
_init(...args: any[]): void;
|
|
190
|
+
|
|
191
|
+
static ['new'](file: Gio.File): Menu;
|
|
192
|
+
|
|
193
|
+
static new_applications(): Menu;
|
|
194
|
+
|
|
195
|
+
static new_for_path(filename: string): Menu;
|
|
196
|
+
|
|
197
|
+
// Own signals of Garcon.Menu
|
|
198
|
+
|
|
199
|
+
connect(id: string, callback: (...args: any[]) => any): number;
|
|
200
|
+
connect_after(id: string, callback: (...args: any[]) => any): number;
|
|
201
|
+
emit(id: string, ...args: any[]): void;
|
|
202
|
+
connect(
|
|
203
|
+
signal: 'directory-changed',
|
|
204
|
+
callback: (_source: this, object: MenuDirectory, p0: MenuDirectory) => void,
|
|
205
|
+
): number;
|
|
206
|
+
connect_after(
|
|
207
|
+
signal: 'directory-changed',
|
|
208
|
+
callback: (_source: this, object: MenuDirectory, p0: MenuDirectory) => void,
|
|
209
|
+
): number;
|
|
210
|
+
emit(signal: 'directory-changed', object: MenuDirectory, p0: MenuDirectory): void;
|
|
211
|
+
connect(signal: 'reload-required', callback: (_source: this) => void): number;
|
|
212
|
+
connect_after(signal: 'reload-required', callback: (_source: this) => void): number;
|
|
213
|
+
emit(signal: 'reload-required'): void;
|
|
214
|
+
|
|
215
|
+
// Own methods of Garcon.Menu
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Adds `submenu` as a sub menu to `menu`.
|
|
219
|
+
* @param submenu a #GarconMenu
|
|
220
|
+
*/
|
|
221
|
+
add_menu(submenu: Menu): void;
|
|
222
|
+
/**
|
|
223
|
+
* Returns the #GarconMenuDirectory of `menu` or %NULL if `menu` has
|
|
224
|
+
* no valid directory element.
|
|
225
|
+
*
|
|
226
|
+
* The menu directory may contain a lot of useful information about
|
|
227
|
+
* the menu like the display and icon name, desktop environments it
|
|
228
|
+
* should show up in etc.
|
|
229
|
+
* @returns a #GarconMenuDirectory
|
|
230
|
+
*/
|
|
231
|
+
get_directory(): MenuDirectory | null;
|
|
232
|
+
/**
|
|
233
|
+
* Get all the menu element in `menu`. This contains sub menus, menu items
|
|
234
|
+
* and separators.
|
|
235
|
+
*
|
|
236
|
+
* Returns a list of #GarconMenuItem or %NULL. Free the list with
|
|
237
|
+
* g_list_free().
|
|
238
|
+
*/
|
|
239
|
+
get_elements(): MenuItem[] | null;
|
|
240
|
+
/**
|
|
241
|
+
* Get the file for `menu`. It refers to the .menu file from which
|
|
242
|
+
* `menu` was or will be loaded.
|
|
243
|
+
*
|
|
244
|
+
* The returned object should be unreffed with g_object_unref()
|
|
245
|
+
* when no longer needed.
|
|
246
|
+
* @returns a #GFile.
|
|
247
|
+
*/
|
|
248
|
+
get_file(): Gio.File;
|
|
249
|
+
/**
|
|
250
|
+
* Get the item pool of the menu. This pool contains all items in this
|
|
251
|
+
* menu (for that of its submenus).
|
|
252
|
+
* @returns a #GarconMenuItemPool.
|
|
253
|
+
*/
|
|
254
|
+
get_item_pool(): MenuItemPool;
|
|
255
|
+
/**
|
|
256
|
+
* Returns all #GarconMenuItem included in `menu`. The items are
|
|
257
|
+
* sorted by their display names in ascending order.
|
|
258
|
+
*
|
|
259
|
+
* The caller is responsible to free the returned list using
|
|
260
|
+
* g_list_free() when no longer needed.
|
|
261
|
+
* @returns list of #GarconMenuItem included in @menu.
|
|
262
|
+
*/
|
|
263
|
+
get_items(): MenuItem[];
|
|
264
|
+
/**
|
|
265
|
+
* Looks in `menu` for a submenu with `name` as name.
|
|
266
|
+
* @param name a sub menu name
|
|
267
|
+
* @returns a #GarconMenu or %NULL.
|
|
268
|
+
*/
|
|
269
|
+
get_menu_with_name(name: string): Menu | null;
|
|
270
|
+
/**
|
|
271
|
+
* Returns a sorted list of #GarconMenu submenus of `menu`. The list
|
|
272
|
+
* should be freed with g_list_free().
|
|
273
|
+
* @returns a sorted list of #GarconMenu.
|
|
274
|
+
*/
|
|
275
|
+
get_menus(): Menu[];
|
|
276
|
+
/**
|
|
277
|
+
* Returns the parent #GarconMenu or `menu`.
|
|
278
|
+
* @returns a #GarconMenu or %NULL if @menu is the root menu.
|
|
279
|
+
*/
|
|
280
|
+
get_parent(): Menu | null;
|
|
281
|
+
/**
|
|
282
|
+
* This function loads the entire menu tree from the file referred to
|
|
283
|
+
* by `menu`. It resolves merges, moves and everything else defined
|
|
284
|
+
* in the menu specification. The resulting tree information is
|
|
285
|
+
* stored within `menu` and can be accessed using the public #GarconMenu
|
|
286
|
+
* API afterwards.
|
|
287
|
+
*
|
|
288
|
+
* `cancellable` can be used to handle blocking I/O when reading data
|
|
289
|
+
* from files during the loading process.
|
|
290
|
+
*
|
|
291
|
+
* `error` should either be NULL or point to a #GError return location
|
|
292
|
+
* where errors should be stored in.
|
|
293
|
+
* @param cancellable a #GCancellable
|
|
294
|
+
* @returns %TRUE if the menu was loaded successfully or %FALSE if there was an error or the process was cancelled.
|
|
295
|
+
*/
|
|
296
|
+
load(cancellable?: Gio.Cancellable | null): boolean;
|
|
297
|
+
|
|
298
|
+
// Inherited methods
|
|
299
|
+
equal(b: MenuElement): boolean;
|
|
300
|
+
get_comment(): string;
|
|
301
|
+
get_icon_name(): string;
|
|
302
|
+
get_name(): string;
|
|
303
|
+
get_no_display(): boolean;
|
|
304
|
+
get_show_in_environment(): boolean;
|
|
305
|
+
get_visible(): boolean;
|
|
306
|
+
vfunc_equal(other: MenuElement): boolean;
|
|
307
|
+
vfunc_get_comment(): string;
|
|
308
|
+
vfunc_get_icon_name(): string;
|
|
309
|
+
vfunc_get_name(): string;
|
|
310
|
+
vfunc_get_no_display(): boolean;
|
|
311
|
+
vfunc_get_show_in_environment(): boolean;
|
|
312
|
+
vfunc_get_visible(): boolean;
|
|
313
|
+
/**
|
|
314
|
+
* Creates a binding between `source_property` on `source` and `target_property`
|
|
315
|
+
* on `target`.
|
|
316
|
+
*
|
|
317
|
+
* Whenever the `source_property` is changed the `target_property` is
|
|
318
|
+
* updated using the same value. For instance:
|
|
319
|
+
*
|
|
320
|
+
*
|
|
321
|
+
* ```c
|
|
322
|
+
* g_object_bind_property (action, "active", widget, "sensitive", 0);
|
|
323
|
+
* ```
|
|
324
|
+
*
|
|
325
|
+
*
|
|
326
|
+
* Will result in the "sensitive" property of the widget #GObject instance to be
|
|
327
|
+
* updated with the same value of the "active" property of the action #GObject
|
|
328
|
+
* instance.
|
|
329
|
+
*
|
|
330
|
+
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
|
|
331
|
+
* if `target_property` on `target` changes then the `source_property` on `source`
|
|
332
|
+
* will be updated as well.
|
|
333
|
+
*
|
|
334
|
+
* The binding will automatically be removed when either the `source` or the
|
|
335
|
+
* `target` instances are finalized. To remove the binding without affecting the
|
|
336
|
+
* `source` and the `target` you can just call g_object_unref() on the returned
|
|
337
|
+
* #GBinding instance.
|
|
338
|
+
*
|
|
339
|
+
* Removing the binding by calling g_object_unref() on it must only be done if
|
|
340
|
+
* the binding, `source` and `target` are only used from a single thread and it
|
|
341
|
+
* is clear that both `source` and `target` outlive the binding. Especially it
|
|
342
|
+
* is not safe to rely on this if the binding, `source` or `target` can be
|
|
343
|
+
* finalized from different threads. Keep another reference to the binding and
|
|
344
|
+
* use g_binding_unbind() instead to be on the safe side.
|
|
345
|
+
*
|
|
346
|
+
* A #GObject can have multiple bindings.
|
|
347
|
+
* @param source_property the property on @source to bind
|
|
348
|
+
* @param target the target #GObject
|
|
349
|
+
* @param target_property the property on @target to bind
|
|
350
|
+
* @param flags flags to pass to #GBinding
|
|
351
|
+
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
|
|
352
|
+
*/
|
|
353
|
+
bind_property(
|
|
354
|
+
source_property: string,
|
|
355
|
+
target: GObject.Object,
|
|
356
|
+
target_property: string,
|
|
357
|
+
flags: GObject.BindingFlags,
|
|
358
|
+
): GObject.Binding;
|
|
359
|
+
/**
|
|
360
|
+
* Complete version of g_object_bind_property().
|
|
361
|
+
*
|
|
362
|
+
* Creates a binding between `source_property` on `source` and `target_property`
|
|
363
|
+
* on `target,` allowing you to set the transformation functions to be used by
|
|
364
|
+
* the binding.
|
|
365
|
+
*
|
|
366
|
+
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
|
|
367
|
+
* if `target_property` on `target` changes then the `source_property` on `source`
|
|
368
|
+
* will be updated as well. The `transform_from` function is only used in case
|
|
369
|
+
* of bidirectional bindings, otherwise it will be ignored
|
|
370
|
+
*
|
|
371
|
+
* The binding will automatically be removed when either the `source` or the
|
|
372
|
+
* `target` instances are finalized. This will release the reference that is
|
|
373
|
+
* being held on the #GBinding instance; if you want to hold on to the
|
|
374
|
+
* #GBinding instance, you will need to hold a reference to it.
|
|
375
|
+
*
|
|
376
|
+
* To remove the binding, call g_binding_unbind().
|
|
377
|
+
*
|
|
378
|
+
* A #GObject can have multiple bindings.
|
|
379
|
+
*
|
|
380
|
+
* The same `user_data` parameter will be used for both `transform_to`
|
|
381
|
+
* and `transform_from` transformation functions; the `notify` function will
|
|
382
|
+
* be called once, when the binding is removed. If you need different data
|
|
383
|
+
* for each transformation function, please use
|
|
384
|
+
* g_object_bind_property_with_closures() instead.
|
|
385
|
+
* @param source_property the property on @source to bind
|
|
386
|
+
* @param target the target #GObject
|
|
387
|
+
* @param target_property the property on @target to bind
|
|
388
|
+
* @param flags flags to pass to #GBinding
|
|
389
|
+
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
|
|
390
|
+
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
|
|
391
|
+
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
|
|
392
|
+
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
|
|
393
|
+
*/
|
|
394
|
+
bind_property_full(
|
|
395
|
+
source_property: string,
|
|
396
|
+
target: GObject.Object,
|
|
397
|
+
target_property: string,
|
|
398
|
+
flags: GObject.BindingFlags,
|
|
399
|
+
transform_to?: GObject.BindingTransformFunc | null,
|
|
400
|
+
transform_from?: GObject.BindingTransformFunc | null,
|
|
401
|
+
notify?: GLib.DestroyNotify | null,
|
|
402
|
+
): GObject.Binding;
|
|
403
|
+
// Conflicted with GObject.Object.bind_property_full
|
|
404
|
+
bind_property_full(...args: never[]): any;
|
|
405
|
+
/**
|
|
406
|
+
* This function is intended for #GObject implementations to re-enforce
|
|
407
|
+
* a [floating][floating-ref] object reference. Doing this is seldom
|
|
408
|
+
* required: all #GInitiallyUnowneds are created with a floating reference
|
|
409
|
+
* which usually just needs to be sunken by calling g_object_ref_sink().
|
|
410
|
+
*/
|
|
411
|
+
force_floating(): void;
|
|
412
|
+
/**
|
|
413
|
+
* Increases the freeze count on `object`. If the freeze count is
|
|
414
|
+
* non-zero, the emission of "notify" signals on `object` is
|
|
415
|
+
* stopped. The signals are queued until the freeze count is decreased
|
|
416
|
+
* to zero. Duplicate notifications are squashed so that at most one
|
|
417
|
+
* #GObject::notify signal is emitted for each property modified while the
|
|
418
|
+
* object is frozen.
|
|
419
|
+
*
|
|
420
|
+
* This is necessary for accessors that modify multiple properties to prevent
|
|
421
|
+
* premature notification while the object is still being modified.
|
|
422
|
+
*/
|
|
423
|
+
freeze_notify(): void;
|
|
424
|
+
/**
|
|
425
|
+
* Gets a named field from the objects table of associations (see g_object_set_data()).
|
|
426
|
+
* @param key name of the key for that association
|
|
427
|
+
* @returns the data if found, or %NULL if no such data exists.
|
|
428
|
+
*/
|
|
429
|
+
get_data(key: string): any | null;
|
|
430
|
+
get_property(property_name: string): any;
|
|
431
|
+
/**
|
|
432
|
+
* This function gets back user data pointers stored via
|
|
433
|
+
* g_object_set_qdata().
|
|
434
|
+
* @param quark A #GQuark, naming the user data pointer
|
|
435
|
+
* @returns The user data pointer set, or %NULL
|
|
436
|
+
*/
|
|
437
|
+
get_qdata(quark: GLib.Quark): any | null;
|
|
438
|
+
/**
|
|
439
|
+
* Gets `n_properties` properties for an `object`.
|
|
440
|
+
* Obtained properties will be set to `values`. All properties must be valid.
|
|
441
|
+
* Warnings will be emitted and undefined behaviour may result if invalid
|
|
442
|
+
* properties are passed in.
|
|
443
|
+
* @param names the names of each property to get
|
|
444
|
+
* @param values the values of each property to get
|
|
445
|
+
*/
|
|
446
|
+
getv(names: string[], values: (GObject.Value | any)[]): void;
|
|
447
|
+
/**
|
|
448
|
+
* Checks whether `object` has a [floating][floating-ref] reference.
|
|
449
|
+
* @returns %TRUE if @object has a floating reference
|
|
450
|
+
*/
|
|
451
|
+
is_floating(): boolean;
|
|
452
|
+
/**
|
|
453
|
+
* Emits a "notify" signal for the property `property_name` on `object`.
|
|
454
|
+
*
|
|
455
|
+
* When possible, eg. when signaling a property change from within the class
|
|
456
|
+
* that registered the property, you should use g_object_notify_by_pspec()
|
|
457
|
+
* instead.
|
|
458
|
+
*
|
|
459
|
+
* Note that emission of the notify signal may be blocked with
|
|
460
|
+
* g_object_freeze_notify(). In this case, the signal emissions are queued
|
|
461
|
+
* and will be emitted (in reverse order) when g_object_thaw_notify() is
|
|
462
|
+
* called.
|
|
463
|
+
* @param property_name the name of a property installed on the class of @object.
|
|
464
|
+
*/
|
|
465
|
+
notify(property_name: string): void;
|
|
466
|
+
/**
|
|
467
|
+
* Emits a "notify" signal for the property specified by `pspec` on `object`.
|
|
468
|
+
*
|
|
469
|
+
* This function omits the property name lookup, hence it is faster than
|
|
470
|
+
* g_object_notify().
|
|
471
|
+
*
|
|
472
|
+
* One way to avoid using g_object_notify() from within the
|
|
473
|
+
* class that registered the properties, and using g_object_notify_by_pspec()
|
|
474
|
+
* instead, is to store the GParamSpec used with
|
|
475
|
+
* g_object_class_install_property() inside a static array, e.g.:
|
|
476
|
+
*
|
|
477
|
+
*
|
|
478
|
+
* ```c
|
|
479
|
+
* typedef enum
|
|
480
|
+
* {
|
|
481
|
+
* PROP_FOO = 1,
|
|
482
|
+
* PROP_LAST
|
|
483
|
+
* } MyObjectProperty;
|
|
484
|
+
*
|
|
485
|
+
* static GParamSpec *properties[PROP_LAST];
|
|
486
|
+
*
|
|
487
|
+
* static void
|
|
488
|
+
* my_object_class_init (MyObjectClass *klass)
|
|
489
|
+
* {
|
|
490
|
+
* properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
|
|
491
|
+
* 0, 100,
|
|
492
|
+
* 50,
|
|
493
|
+
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
|
494
|
+
* g_object_class_install_property (gobject_class,
|
|
495
|
+
* PROP_FOO,
|
|
496
|
+
* properties[PROP_FOO]);
|
|
497
|
+
* }
|
|
498
|
+
* ```
|
|
499
|
+
*
|
|
500
|
+
*
|
|
501
|
+
* and then notify a change on the "foo" property with:
|
|
502
|
+
*
|
|
503
|
+
*
|
|
504
|
+
* ```c
|
|
505
|
+
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
|
|
506
|
+
* ```
|
|
507
|
+
*
|
|
508
|
+
* @param pspec the #GParamSpec of a property installed on the class of @object.
|
|
509
|
+
*/
|
|
510
|
+
notify_by_pspec(pspec: GObject.ParamSpec): void;
|
|
511
|
+
/**
|
|
512
|
+
* Increases the reference count of `object`.
|
|
513
|
+
*
|
|
514
|
+
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
|
|
515
|
+
* of `object` will be propagated to the return type (using the GCC typeof()
|
|
516
|
+
* extension), so any casting the caller needs to do on the return type must be
|
|
517
|
+
* explicit.
|
|
518
|
+
* @returns the same @object
|
|
519
|
+
*/
|
|
520
|
+
ref(): GObject.Object;
|
|
521
|
+
/**
|
|
522
|
+
* Increase the reference count of `object,` and possibly remove the
|
|
523
|
+
* [floating][floating-ref] reference, if `object` has a floating reference.
|
|
524
|
+
*
|
|
525
|
+
* In other words, if the object is floating, then this call "assumes
|
|
526
|
+
* ownership" of the floating reference, converting it to a normal
|
|
527
|
+
* reference by clearing the floating flag while leaving the reference
|
|
528
|
+
* count unchanged. If the object is not floating, then this call
|
|
529
|
+
* adds a new normal reference increasing the reference count by one.
|
|
530
|
+
*
|
|
531
|
+
* Since GLib 2.56, the type of `object` will be propagated to the return type
|
|
532
|
+
* under the same conditions as for g_object_ref().
|
|
533
|
+
* @returns @object
|
|
534
|
+
*/
|
|
535
|
+
ref_sink(): GObject.Object;
|
|
536
|
+
/**
|
|
537
|
+
* Releases all references to other objects. This can be used to break
|
|
538
|
+
* reference cycles.
|
|
539
|
+
*
|
|
540
|
+
* This function should only be called from object system implementations.
|
|
541
|
+
*/
|
|
542
|
+
run_dispose(): void;
|
|
543
|
+
/**
|
|
544
|
+
* Each object carries around a table of associations from
|
|
545
|
+
* strings to pointers. This function lets you set an association.
|
|
546
|
+
*
|
|
547
|
+
* If the object already had an association with that name,
|
|
548
|
+
* the old association will be destroyed.
|
|
549
|
+
*
|
|
550
|
+
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
|
|
551
|
+
* This means a copy of `key` is kept permanently (even after `object` has been
|
|
552
|
+
* finalized) — so it is recommended to only use a small, bounded set of values
|
|
553
|
+
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
|
|
554
|
+
* @param key name of the key
|
|
555
|
+
* @param data data to associate with that key
|
|
556
|
+
*/
|
|
557
|
+
set_data(key: string, data?: any | null): void;
|
|
558
|
+
set_property(property_name: string, value: any): void;
|
|
559
|
+
/**
|
|
560
|
+
* Remove a specified datum from the object's data associations,
|
|
561
|
+
* without invoking the association's destroy handler.
|
|
562
|
+
* @param key name of the key
|
|
563
|
+
* @returns the data if found, or %NULL if no such data exists.
|
|
564
|
+
*/
|
|
565
|
+
steal_data(key: string): any | null;
|
|
566
|
+
/**
|
|
567
|
+
* This function gets back user data pointers stored via
|
|
568
|
+
* g_object_set_qdata() and removes the `data` from object
|
|
569
|
+
* without invoking its destroy() function (if any was
|
|
570
|
+
* set).
|
|
571
|
+
* Usually, calling this function is only required to update
|
|
572
|
+
* user data pointers with a destroy notifier, for example:
|
|
573
|
+
*
|
|
574
|
+
* ```c
|
|
575
|
+
* void
|
|
576
|
+
* object_add_to_user_list (GObject *object,
|
|
577
|
+
* const gchar *new_string)
|
|
578
|
+
* {
|
|
579
|
+
* // the quark, naming the object data
|
|
580
|
+
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
|
|
581
|
+
* // retrieve the old string list
|
|
582
|
+
* GList *list = g_object_steal_qdata (object, quark_string_list);
|
|
583
|
+
*
|
|
584
|
+
* // prepend new string
|
|
585
|
+
* list = g_list_prepend (list, g_strdup (new_string));
|
|
586
|
+
* // this changed 'list', so we need to set it again
|
|
587
|
+
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
|
|
588
|
+
* }
|
|
589
|
+
* static void
|
|
590
|
+
* free_string_list (gpointer data)
|
|
591
|
+
* {
|
|
592
|
+
* GList *node, *list = data;
|
|
593
|
+
*
|
|
594
|
+
* for (node = list; node; node = node->next)
|
|
595
|
+
* g_free (node->data);
|
|
596
|
+
* g_list_free (list);
|
|
597
|
+
* }
|
|
598
|
+
* ```
|
|
599
|
+
*
|
|
600
|
+
* Using g_object_get_qdata() in the above example, instead of
|
|
601
|
+
* g_object_steal_qdata() would have left the destroy function set,
|
|
602
|
+
* and thus the partial string list would have been freed upon
|
|
603
|
+
* g_object_set_qdata_full().
|
|
604
|
+
* @param quark A #GQuark, naming the user data pointer
|
|
605
|
+
* @returns The user data pointer set, or %NULL
|
|
606
|
+
*/
|
|
607
|
+
steal_qdata(quark: GLib.Quark): any | null;
|
|
608
|
+
/**
|
|
609
|
+
* Reverts the effect of a previous call to
|
|
610
|
+
* g_object_freeze_notify(). The freeze count is decreased on `object`
|
|
611
|
+
* and when it reaches zero, queued "notify" signals are emitted.
|
|
612
|
+
*
|
|
613
|
+
* Duplicate notifications for each property are squashed so that at most one
|
|
614
|
+
* #GObject::notify signal is emitted for each property, in the reverse order
|
|
615
|
+
* in which they have been queued.
|
|
616
|
+
*
|
|
617
|
+
* It is an error to call this function when the freeze count is zero.
|
|
618
|
+
*/
|
|
619
|
+
thaw_notify(): void;
|
|
620
|
+
/**
|
|
621
|
+
* Decreases the reference count of `object`. When its reference count
|
|
622
|
+
* drops to 0, the object is finalized (i.e. its memory is freed).
|
|
623
|
+
*
|
|
624
|
+
* If the pointer to the #GObject may be reused in future (for example, if it is
|
|
625
|
+
* an instance variable of another object), it is recommended to clear the
|
|
626
|
+
* pointer to %NULL rather than retain a dangling pointer to a potentially
|
|
627
|
+
* invalid #GObject instance. Use g_clear_object() for this.
|
|
628
|
+
*/
|
|
629
|
+
unref(): void;
|
|
630
|
+
/**
|
|
631
|
+
* This function essentially limits the life time of the `closure` to
|
|
632
|
+
* the life time of the object. That is, when the object is finalized,
|
|
633
|
+
* the `closure` is invalidated by calling g_closure_invalidate() on
|
|
634
|
+
* it, in order to prevent invocations of the closure with a finalized
|
|
635
|
+
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
|
|
636
|
+
* added as marshal guards to the `closure,` to ensure that an extra
|
|
637
|
+
* reference count is held on `object` during invocation of the
|
|
638
|
+
* `closure`. Usually, this function will be called on closures that
|
|
639
|
+
* use this `object` as closure data.
|
|
640
|
+
* @param closure #GClosure to watch
|
|
641
|
+
*/
|
|
642
|
+
watch_closure(closure: GObject.Closure): void;
|
|
643
|
+
vfunc_constructed(): void;
|
|
644
|
+
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
|
|
645
|
+
vfunc_dispose(): void;
|
|
646
|
+
vfunc_finalize(): void;
|
|
647
|
+
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
|
|
648
|
+
/**
|
|
649
|
+
* Emits a "notify" signal for the property `property_name` on `object`.
|
|
650
|
+
*
|
|
651
|
+
* When possible, eg. when signaling a property change from within the class
|
|
652
|
+
* that registered the property, you should use g_object_notify_by_pspec()
|
|
653
|
+
* instead.
|
|
654
|
+
*
|
|
655
|
+
* Note that emission of the notify signal may be blocked with
|
|
656
|
+
* g_object_freeze_notify(). In this case, the signal emissions are queued
|
|
657
|
+
* and will be emitted (in reverse order) when g_object_thaw_notify() is
|
|
658
|
+
* called.
|
|
659
|
+
* @param pspec
|
|
660
|
+
*/
|
|
661
|
+
vfunc_notify(pspec: GObject.ParamSpec): void;
|
|
662
|
+
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
|
|
663
|
+
disconnect(id: number): void;
|
|
664
|
+
set(properties: { [key: string]: any }): void;
|
|
665
|
+
block_signal_handler(id: number): any;
|
|
666
|
+
unblock_signal_handler(id: number): any;
|
|
667
|
+
stop_emission_by_name(detailedName: string): any;
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
module MenuDirectory {
|
|
671
|
+
// Constructor properties interface
|
|
672
|
+
|
|
673
|
+
interface ConstructorProps extends GObject.Object.ConstructorProps {
|
|
674
|
+
comment: string;
|
|
675
|
+
file: Gio.File;
|
|
676
|
+
icon_name: string;
|
|
677
|
+
iconName: string;
|
|
678
|
+
name: string;
|
|
679
|
+
no_display: boolean;
|
|
680
|
+
noDisplay: boolean;
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
class MenuDirectory extends GObject.Object {
|
|
685
|
+
static $gtype: GObject.GType<MenuDirectory>;
|
|
686
|
+
|
|
687
|
+
// Own properties of Garcon.MenuDirectory
|
|
688
|
+
|
|
689
|
+
/**
|
|
690
|
+
* Directory description (comment).
|
|
691
|
+
*/
|
|
692
|
+
get comment(): string;
|
|
693
|
+
set comment(val: string);
|
|
694
|
+
get file(): Gio.File;
|
|
695
|
+
/**
|
|
696
|
+
* Icon associated with this directory.
|
|
697
|
+
*/
|
|
698
|
+
get icon_name(): string;
|
|
699
|
+
set icon_name(val: string);
|
|
700
|
+
/**
|
|
701
|
+
* Icon associated with this directory.
|
|
702
|
+
*/
|
|
703
|
+
get iconName(): string;
|
|
704
|
+
set iconName(val: string);
|
|
705
|
+
/**
|
|
706
|
+
* Name of the directory.
|
|
707
|
+
*/
|
|
708
|
+
get name(): string;
|
|
709
|
+
set name(val: string);
|
|
710
|
+
/**
|
|
711
|
+
* Whether this menu item is hidden in menus.
|
|
712
|
+
*/
|
|
713
|
+
get no_display(): boolean;
|
|
714
|
+
set no_display(val: boolean);
|
|
715
|
+
/**
|
|
716
|
+
* Whether this menu item is hidden in menus.
|
|
717
|
+
*/
|
|
718
|
+
get noDisplay(): boolean;
|
|
719
|
+
set noDisplay(val: boolean);
|
|
720
|
+
|
|
721
|
+
// Constructors of Garcon.MenuDirectory
|
|
722
|
+
|
|
723
|
+
constructor(properties?: Partial<MenuDirectory.ConstructorProps>, ...args: any[]);
|
|
724
|
+
|
|
725
|
+
_init(...args: any[]): void;
|
|
726
|
+
|
|
727
|
+
static ['new'](file: Gio.File): MenuDirectory;
|
|
728
|
+
|
|
729
|
+
// Own methods of Garcon.MenuDirectory
|
|
730
|
+
|
|
731
|
+
/**
|
|
732
|
+
* Checks if both directories point to the same file.
|
|
733
|
+
* @param other a #GarconMenuDirectory
|
|
734
|
+
* @returns if files are equal %TRUE, else %FALSE.
|
|
735
|
+
*/
|
|
736
|
+
equal(other: MenuDirectory): boolean;
|
|
737
|
+
/**
|
|
738
|
+
* Get the comment of `directory`.
|
|
739
|
+
* @returns a the description for @directory.
|
|
740
|
+
*/
|
|
741
|
+
get_comment(): string;
|
|
742
|
+
/**
|
|
743
|
+
* Get the #GFile for `directory`. The returned object should be
|
|
744
|
+
* unreffed with g_object_unref() when no longer needed.
|
|
745
|
+
* @returns a #GFile
|
|
746
|
+
*/
|
|
747
|
+
get_file(): Gio.File;
|
|
748
|
+
/**
|
|
749
|
+
* Whether `directory` should be hidden.
|
|
750
|
+
* For applications you want to call garcon_menu_directory_get_visible().
|
|
751
|
+
* @returns a the hidden key for @directory.
|
|
752
|
+
*/
|
|
753
|
+
get_hidden(): boolean;
|
|
754
|
+
/**
|
|
755
|
+
* Get the icon name of `directory`.
|
|
756
|
+
* @returns a the icon-name key for @directory.
|
|
757
|
+
*/
|
|
758
|
+
get_icon_name(): string;
|
|
759
|
+
/**
|
|
760
|
+
* Get the name of `directory`.
|
|
761
|
+
* @returns a the name for @directory.
|
|
762
|
+
*/
|
|
763
|
+
get_name(): string;
|
|
764
|
+
/**
|
|
765
|
+
* Whether `directory` should be displayed.
|
|
766
|
+
* For applications you want to call garcon_menu_directory_get_visible().
|
|
767
|
+
* @returns a the no-display key for @directory.
|
|
768
|
+
*/
|
|
769
|
+
get_no_display(): boolean;
|
|
770
|
+
/**
|
|
771
|
+
* Whether `directory` is visible in the current environment
|
|
772
|
+
* which has been set by garcon_set_environment().
|
|
773
|
+
* For applications you want to call garcon_menu_directory_get_visible().
|
|
774
|
+
* @returns %TRUE is visible in environment, else %FALSE.
|
|
775
|
+
*/
|
|
776
|
+
get_show_in_environment(): boolean;
|
|
777
|
+
/**
|
|
778
|
+
* Check which runs the following checks:
|
|
779
|
+
* garcon_menu_directory_get_show_in_environment(),
|
|
780
|
+
* garcon_menu_directory_get_hidden() and
|
|
781
|
+
* garcon_menu_directory_get_no_display().
|
|
782
|
+
* @returns if visible %TRUE, else %FALSE.
|
|
783
|
+
*/
|
|
784
|
+
get_visible(): boolean;
|
|
785
|
+
/**
|
|
786
|
+
* Set the comment of `directory`.
|
|
787
|
+
* @param comment the new description for @directory.
|
|
788
|
+
*/
|
|
789
|
+
set_comment(comment: string): void;
|
|
790
|
+
/**
|
|
791
|
+
* Set the icon name of `directory`.
|
|
792
|
+
* @param icon_name the new icon name for @directory.
|
|
793
|
+
*/
|
|
794
|
+
set_icon_name(icon_name: string): void;
|
|
795
|
+
/**
|
|
796
|
+
* Set the name of `directory`.
|
|
797
|
+
* @param name the new name for @directory.
|
|
798
|
+
*/
|
|
799
|
+
set_name(name: string): void;
|
|
800
|
+
/**
|
|
801
|
+
* Set the NoDisplay key of `directory`.
|
|
802
|
+
* @param no_display whether @directory should be displayed.
|
|
803
|
+
*/
|
|
804
|
+
set_no_display(no_display: boolean): void;
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
module MenuItem {
|
|
808
|
+
// Signal callback interfaces
|
|
809
|
+
|
|
810
|
+
interface Changed {
|
|
811
|
+
(): void;
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
// Constructor properties interface
|
|
815
|
+
|
|
816
|
+
interface ConstructorProps extends GObject.Object.ConstructorProps, MenuElement.ConstructorProps {
|
|
817
|
+
command: string;
|
|
818
|
+
comment: string;
|
|
819
|
+
desktop_id: string;
|
|
820
|
+
desktopId: string;
|
|
821
|
+
file: Gio.File;
|
|
822
|
+
generic_name: string;
|
|
823
|
+
genericName: string;
|
|
824
|
+
hidden: boolean;
|
|
825
|
+
icon_name: string;
|
|
826
|
+
iconName: string;
|
|
827
|
+
name: string;
|
|
828
|
+
no_display: boolean;
|
|
829
|
+
noDisplay: boolean;
|
|
830
|
+
path: string;
|
|
831
|
+
prefers_non_default_gpu: boolean;
|
|
832
|
+
prefersNonDefaultGpu: boolean;
|
|
833
|
+
requires_terminal: boolean;
|
|
834
|
+
requiresTerminal: boolean;
|
|
835
|
+
supports_startup_notification: boolean;
|
|
836
|
+
supportsStartupNotification: boolean;
|
|
837
|
+
try_exec: string;
|
|
838
|
+
tryExec: string;
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
class MenuItem extends GObject.Object implements MenuElement {
|
|
843
|
+
static $gtype: GObject.GType<MenuItem>;
|
|
844
|
+
|
|
845
|
+
// Own properties of Garcon.MenuItem
|
|
846
|
+
|
|
847
|
+
/**
|
|
848
|
+
* Command to be executed when the menu item is clicked.
|
|
849
|
+
*/
|
|
850
|
+
get command(): string;
|
|
851
|
+
set command(val: string);
|
|
852
|
+
/**
|
|
853
|
+
* Comment/description for the application. To be displayed e.g. in tooltips of
|
|
854
|
+
* GtkMenuItems.
|
|
855
|
+
*/
|
|
856
|
+
get comment(): string;
|
|
857
|
+
set comment(val: string);
|
|
858
|
+
/**
|
|
859
|
+
* The desktop-file id of this application.
|
|
860
|
+
*/
|
|
861
|
+
get desktop_id(): string;
|
|
862
|
+
set desktop_id(val: string);
|
|
863
|
+
/**
|
|
864
|
+
* The desktop-file id of this application.
|
|
865
|
+
*/
|
|
866
|
+
get desktopId(): string;
|
|
867
|
+
set desktopId(val: string);
|
|
868
|
+
/**
|
|
869
|
+
* The #GFile from which the %GarconMenuItem was loaded.
|
|
870
|
+
*/
|
|
871
|
+
get file(): Gio.File;
|
|
872
|
+
/**
|
|
873
|
+
* GenericName of the application (will be displayed in menus etc.).
|
|
874
|
+
*/
|
|
875
|
+
get generic_name(): string;
|
|
876
|
+
set generic_name(val: string);
|
|
877
|
+
/**
|
|
878
|
+
* GenericName of the application (will be displayed in menus etc.).
|
|
879
|
+
*/
|
|
880
|
+
get genericName(): string;
|
|
881
|
+
set genericName(val: string);
|
|
882
|
+
/**
|
|
883
|
+
* It means the user deleted (at his level) something that was present
|
|
884
|
+
* (at an upper level, e.g. in the system dirs). It's strictly equivalent
|
|
885
|
+
* to the .desktop file not existing at all, as far as that user is concerned.
|
|
886
|
+
*/
|
|
887
|
+
get hidden(): boolean;
|
|
888
|
+
set hidden(val: boolean);
|
|
889
|
+
/**
|
|
890
|
+
* Name of the icon to be displayed for this menu item.
|
|
891
|
+
*/
|
|
892
|
+
get icon_name(): string;
|
|
893
|
+
set icon_name(val: string);
|
|
894
|
+
/**
|
|
895
|
+
* Name of the icon to be displayed for this menu item.
|
|
896
|
+
*/
|
|
897
|
+
get iconName(): string;
|
|
898
|
+
set iconName(val: string);
|
|
899
|
+
/**
|
|
900
|
+
* Name of the application (will be displayed in menus etc.).
|
|
901
|
+
*/
|
|
902
|
+
get name(): string;
|
|
903
|
+
set name(val: string);
|
|
904
|
+
/**
|
|
905
|
+
* Whether this menu item is hidden in menus.
|
|
906
|
+
*/
|
|
907
|
+
get no_display(): boolean;
|
|
908
|
+
set no_display(val: boolean);
|
|
909
|
+
/**
|
|
910
|
+
* Whether this menu item is hidden in menus.
|
|
911
|
+
*/
|
|
912
|
+
get noDisplay(): boolean;
|
|
913
|
+
set noDisplay(val: boolean);
|
|
914
|
+
/**
|
|
915
|
+
* Working directory the application should be started in.
|
|
916
|
+
*/
|
|
917
|
+
get path(): string;
|
|
918
|
+
set path(val: string);
|
|
919
|
+
/**
|
|
920
|
+
* If true, the application prefers to be run on a more powerful discrete GPU
|
|
921
|
+
* if available.
|
|
922
|
+
*/
|
|
923
|
+
get prefers_non_default_gpu(): boolean;
|
|
924
|
+
set prefers_non_default_gpu(val: boolean);
|
|
925
|
+
/**
|
|
926
|
+
* If true, the application prefers to be run on a more powerful discrete GPU
|
|
927
|
+
* if available.
|
|
928
|
+
*/
|
|
929
|
+
get prefersNonDefaultGpu(): boolean;
|
|
930
|
+
set prefersNonDefaultGpu(val: boolean);
|
|
931
|
+
/**
|
|
932
|
+
* Whether this application requires a terinal to be started in.
|
|
933
|
+
*/
|
|
934
|
+
get requires_terminal(): boolean;
|
|
935
|
+
set requires_terminal(val: boolean);
|
|
936
|
+
/**
|
|
937
|
+
* Whether this application requires a terinal to be started in.
|
|
938
|
+
*/
|
|
939
|
+
get requiresTerminal(): boolean;
|
|
940
|
+
set requiresTerminal(val: boolean);
|
|
941
|
+
get supports_startup_notification(): boolean;
|
|
942
|
+
set supports_startup_notification(val: boolean);
|
|
943
|
+
get supportsStartupNotification(): boolean;
|
|
944
|
+
set supportsStartupNotification(val: boolean);
|
|
945
|
+
/**
|
|
946
|
+
* Path to an executable file on disk used to determine if the program
|
|
947
|
+
* is actually installed. If the path is not an absolute path, the file
|
|
948
|
+
* is looked up in the $PATH environment variable. If the file is not
|
|
949
|
+
* present or if it is not executable, the entry may be ignored (not be
|
|
950
|
+
* used in menus, for example).
|
|
951
|
+
*/
|
|
952
|
+
get try_exec(): string;
|
|
953
|
+
set try_exec(val: string);
|
|
954
|
+
/**
|
|
955
|
+
* Path to an executable file on disk used to determine if the program
|
|
956
|
+
* is actually installed. If the path is not an absolute path, the file
|
|
957
|
+
* is looked up in the $PATH environment variable. If the file is not
|
|
958
|
+
* present or if it is not executable, the entry may be ignored (not be
|
|
959
|
+
* used in menus, for example).
|
|
960
|
+
*/
|
|
961
|
+
get tryExec(): string;
|
|
962
|
+
set tryExec(val: string);
|
|
963
|
+
|
|
964
|
+
// Constructors of Garcon.MenuItem
|
|
965
|
+
|
|
966
|
+
constructor(properties?: Partial<MenuItem.ConstructorProps>, ...args: any[]);
|
|
967
|
+
|
|
968
|
+
_init(...args: any[]): void;
|
|
969
|
+
|
|
970
|
+
static ['new'](file: Gio.File): MenuItem;
|
|
971
|
+
|
|
972
|
+
static new_for_path(filename: string): MenuItem;
|
|
973
|
+
|
|
974
|
+
static new_for_uri(uri: string): MenuItem;
|
|
975
|
+
|
|
976
|
+
// Own signals of Garcon.MenuItem
|
|
977
|
+
|
|
978
|
+
connect(id: string, callback: (...args: any[]) => any): number;
|
|
979
|
+
connect_after(id: string, callback: (...args: any[]) => any): number;
|
|
980
|
+
emit(id: string, ...args: any[]): void;
|
|
981
|
+
connect(signal: 'changed', callback: (_source: this) => void): number;
|
|
982
|
+
connect_after(signal: 'changed', callback: (_source: this) => void): number;
|
|
983
|
+
emit(signal: 'changed'): void;
|
|
984
|
+
|
|
985
|
+
// Own virtual methods of Garcon.MenuItem
|
|
986
|
+
|
|
987
|
+
vfunc_changed(): void;
|
|
988
|
+
|
|
989
|
+
// Own methods of Garcon.MenuItem
|
|
990
|
+
|
|
991
|
+
decrement_allocated(): void;
|
|
992
|
+
get_action(action_name: string): MenuItemAction | null;
|
|
993
|
+
get_actions(): MenuItemAction[];
|
|
994
|
+
get_allocated(): number;
|
|
995
|
+
/**
|
|
996
|
+
* Returns list of categories
|
|
997
|
+
*/
|
|
998
|
+
get_categories(): string[];
|
|
999
|
+
get_command(): string;
|
|
1000
|
+
get_comment(): string;
|
|
1001
|
+
get_desktop_id(): string;
|
|
1002
|
+
/**
|
|
1003
|
+
* Get the #GFile for `item`. The returned object should be
|
|
1004
|
+
* unreffed with g_object_unref() when no longer needed.
|
|
1005
|
+
* @returns a #GFile.
|
|
1006
|
+
*/
|
|
1007
|
+
get_file(): Gio.File;
|
|
1008
|
+
get_generic_name(): string;
|
|
1009
|
+
get_hidden(): boolean;
|
|
1010
|
+
get_icon_name(): string;
|
|
1011
|
+
get_keywords(): string[];
|
|
1012
|
+
get_name(): string;
|
|
1013
|
+
get_no_display(): boolean;
|
|
1014
|
+
get_path(): string;
|
|
1015
|
+
get_prefers_non_default_gpu(): boolean;
|
|
1016
|
+
get_show_in_environment(): boolean;
|
|
1017
|
+
get_try_exec(): string;
|
|
1018
|
+
get_uri(): string;
|
|
1019
|
+
has_action(action_name: string): boolean;
|
|
1020
|
+
has_category(category: string): boolean;
|
|
1021
|
+
has_keyword(keyword: string): boolean;
|
|
1022
|
+
increment_allocated(): void;
|
|
1023
|
+
only_show_in_environment(): boolean;
|
|
1024
|
+
ref(): void;
|
|
1025
|
+
// Conflicted with GObject.Object.ref
|
|
1026
|
+
ref(...args: never[]): any;
|
|
1027
|
+
reload(affects_the_outside: boolean): boolean;
|
|
1028
|
+
reload_from_file(file: Gio.File, affects_the_outside: boolean): boolean;
|
|
1029
|
+
set_action(action_name: string, action: MenuItemAction): void;
|
|
1030
|
+
set_categories(categories: string[]): void;
|
|
1031
|
+
set_command(command: string): void;
|
|
1032
|
+
set_comment(comment: string): void;
|
|
1033
|
+
set_desktop_id(desktop_id: string): void;
|
|
1034
|
+
set_generic_name(generic_name: string): void;
|
|
1035
|
+
set_hidden(hidden: boolean): void;
|
|
1036
|
+
set_icon_name(icon_name: string): void;
|
|
1037
|
+
set_keywords(keywords: string[]): void;
|
|
1038
|
+
set_name(name: string): void;
|
|
1039
|
+
set_no_display(no_display: boolean): void;
|
|
1040
|
+
set_path(path: string): void;
|
|
1041
|
+
set_prefers_non_default_gpu(prefers_non_default_gpu: boolean): void;
|
|
1042
|
+
set_requires_terminal(requires_terminal: boolean): void;
|
|
1043
|
+
set_supports_startup_notification(supports_startup_notification: boolean): void;
|
|
1044
|
+
set_try_exec(try_exec: string): void;
|
|
1045
|
+
unref(): void;
|
|
1046
|
+
|
|
1047
|
+
// Inherited methods
|
|
1048
|
+
equal(b: MenuElement): boolean;
|
|
1049
|
+
get_visible(): boolean;
|
|
1050
|
+
vfunc_equal(other: MenuElement): boolean;
|
|
1051
|
+
vfunc_get_comment(): string;
|
|
1052
|
+
vfunc_get_icon_name(): string;
|
|
1053
|
+
vfunc_get_name(): string;
|
|
1054
|
+
vfunc_get_no_display(): boolean;
|
|
1055
|
+
vfunc_get_show_in_environment(): boolean;
|
|
1056
|
+
vfunc_get_visible(): boolean;
|
|
1057
|
+
/**
|
|
1058
|
+
* Creates a binding between `source_property` on `source` and `target_property`
|
|
1059
|
+
* on `target`.
|
|
1060
|
+
*
|
|
1061
|
+
* Whenever the `source_property` is changed the `target_property` is
|
|
1062
|
+
* updated using the same value. For instance:
|
|
1063
|
+
*
|
|
1064
|
+
*
|
|
1065
|
+
* ```c
|
|
1066
|
+
* g_object_bind_property (action, "active", widget, "sensitive", 0);
|
|
1067
|
+
* ```
|
|
1068
|
+
*
|
|
1069
|
+
*
|
|
1070
|
+
* Will result in the "sensitive" property of the widget #GObject instance to be
|
|
1071
|
+
* updated with the same value of the "active" property of the action #GObject
|
|
1072
|
+
* instance.
|
|
1073
|
+
*
|
|
1074
|
+
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
|
|
1075
|
+
* if `target_property` on `target` changes then the `source_property` on `source`
|
|
1076
|
+
* will be updated as well.
|
|
1077
|
+
*
|
|
1078
|
+
* The binding will automatically be removed when either the `source` or the
|
|
1079
|
+
* `target` instances are finalized. To remove the binding without affecting the
|
|
1080
|
+
* `source` and the `target` you can just call g_object_unref() on the returned
|
|
1081
|
+
* #GBinding instance.
|
|
1082
|
+
*
|
|
1083
|
+
* Removing the binding by calling g_object_unref() on it must only be done if
|
|
1084
|
+
* the binding, `source` and `target` are only used from a single thread and it
|
|
1085
|
+
* is clear that both `source` and `target` outlive the binding. Especially it
|
|
1086
|
+
* is not safe to rely on this if the binding, `source` or `target` can be
|
|
1087
|
+
* finalized from different threads. Keep another reference to the binding and
|
|
1088
|
+
* use g_binding_unbind() instead to be on the safe side.
|
|
1089
|
+
*
|
|
1090
|
+
* A #GObject can have multiple bindings.
|
|
1091
|
+
* @param source_property the property on @source to bind
|
|
1092
|
+
* @param target the target #GObject
|
|
1093
|
+
* @param target_property the property on @target to bind
|
|
1094
|
+
* @param flags flags to pass to #GBinding
|
|
1095
|
+
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
|
|
1096
|
+
*/
|
|
1097
|
+
bind_property(
|
|
1098
|
+
source_property: string,
|
|
1099
|
+
target: GObject.Object,
|
|
1100
|
+
target_property: string,
|
|
1101
|
+
flags: GObject.BindingFlags,
|
|
1102
|
+
): GObject.Binding;
|
|
1103
|
+
/**
|
|
1104
|
+
* Complete version of g_object_bind_property().
|
|
1105
|
+
*
|
|
1106
|
+
* Creates a binding between `source_property` on `source` and `target_property`
|
|
1107
|
+
* on `target,` allowing you to set the transformation functions to be used by
|
|
1108
|
+
* the binding.
|
|
1109
|
+
*
|
|
1110
|
+
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
|
|
1111
|
+
* if `target_property` on `target` changes then the `source_property` on `source`
|
|
1112
|
+
* will be updated as well. The `transform_from` function is only used in case
|
|
1113
|
+
* of bidirectional bindings, otherwise it will be ignored
|
|
1114
|
+
*
|
|
1115
|
+
* The binding will automatically be removed when either the `source` or the
|
|
1116
|
+
* `target` instances are finalized. This will release the reference that is
|
|
1117
|
+
* being held on the #GBinding instance; if you want to hold on to the
|
|
1118
|
+
* #GBinding instance, you will need to hold a reference to it.
|
|
1119
|
+
*
|
|
1120
|
+
* To remove the binding, call g_binding_unbind().
|
|
1121
|
+
*
|
|
1122
|
+
* A #GObject can have multiple bindings.
|
|
1123
|
+
*
|
|
1124
|
+
* The same `user_data` parameter will be used for both `transform_to`
|
|
1125
|
+
* and `transform_from` transformation functions; the `notify` function will
|
|
1126
|
+
* be called once, when the binding is removed. If you need different data
|
|
1127
|
+
* for each transformation function, please use
|
|
1128
|
+
* g_object_bind_property_with_closures() instead.
|
|
1129
|
+
* @param source_property the property on @source to bind
|
|
1130
|
+
* @param target the target #GObject
|
|
1131
|
+
* @param target_property the property on @target to bind
|
|
1132
|
+
* @param flags flags to pass to #GBinding
|
|
1133
|
+
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
|
|
1134
|
+
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
|
|
1135
|
+
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
|
|
1136
|
+
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
|
|
1137
|
+
*/
|
|
1138
|
+
bind_property_full(
|
|
1139
|
+
source_property: string,
|
|
1140
|
+
target: GObject.Object,
|
|
1141
|
+
target_property: string,
|
|
1142
|
+
flags: GObject.BindingFlags,
|
|
1143
|
+
transform_to?: GObject.BindingTransformFunc | null,
|
|
1144
|
+
transform_from?: GObject.BindingTransformFunc | null,
|
|
1145
|
+
notify?: GLib.DestroyNotify | null,
|
|
1146
|
+
): GObject.Binding;
|
|
1147
|
+
// Conflicted with GObject.Object.bind_property_full
|
|
1148
|
+
bind_property_full(...args: never[]): any;
|
|
1149
|
+
/**
|
|
1150
|
+
* This function is intended for #GObject implementations to re-enforce
|
|
1151
|
+
* a [floating][floating-ref] object reference. Doing this is seldom
|
|
1152
|
+
* required: all #GInitiallyUnowneds are created with a floating reference
|
|
1153
|
+
* which usually just needs to be sunken by calling g_object_ref_sink().
|
|
1154
|
+
*/
|
|
1155
|
+
force_floating(): void;
|
|
1156
|
+
/**
|
|
1157
|
+
* Increases the freeze count on `object`. If the freeze count is
|
|
1158
|
+
* non-zero, the emission of "notify" signals on `object` is
|
|
1159
|
+
* stopped. The signals are queued until the freeze count is decreased
|
|
1160
|
+
* to zero. Duplicate notifications are squashed so that at most one
|
|
1161
|
+
* #GObject::notify signal is emitted for each property modified while the
|
|
1162
|
+
* object is frozen.
|
|
1163
|
+
*
|
|
1164
|
+
* This is necessary for accessors that modify multiple properties to prevent
|
|
1165
|
+
* premature notification while the object is still being modified.
|
|
1166
|
+
*/
|
|
1167
|
+
freeze_notify(): void;
|
|
1168
|
+
/**
|
|
1169
|
+
* Gets a named field from the objects table of associations (see g_object_set_data()).
|
|
1170
|
+
* @param key name of the key for that association
|
|
1171
|
+
* @returns the data if found, or %NULL if no such data exists.
|
|
1172
|
+
*/
|
|
1173
|
+
get_data(key: string): any | null;
|
|
1174
|
+
get_property(property_name: string): any;
|
|
1175
|
+
/**
|
|
1176
|
+
* This function gets back user data pointers stored via
|
|
1177
|
+
* g_object_set_qdata().
|
|
1178
|
+
* @param quark A #GQuark, naming the user data pointer
|
|
1179
|
+
* @returns The user data pointer set, or %NULL
|
|
1180
|
+
*/
|
|
1181
|
+
get_qdata(quark: GLib.Quark): any | null;
|
|
1182
|
+
/**
|
|
1183
|
+
* Gets `n_properties` properties for an `object`.
|
|
1184
|
+
* Obtained properties will be set to `values`. All properties must be valid.
|
|
1185
|
+
* Warnings will be emitted and undefined behaviour may result if invalid
|
|
1186
|
+
* properties are passed in.
|
|
1187
|
+
* @param names the names of each property to get
|
|
1188
|
+
* @param values the values of each property to get
|
|
1189
|
+
*/
|
|
1190
|
+
getv(names: string[], values: (GObject.Value | any)[]): void;
|
|
1191
|
+
/**
|
|
1192
|
+
* Checks whether `object` has a [floating][floating-ref] reference.
|
|
1193
|
+
* @returns %TRUE if @object has a floating reference
|
|
1194
|
+
*/
|
|
1195
|
+
is_floating(): boolean;
|
|
1196
|
+
/**
|
|
1197
|
+
* Emits a "notify" signal for the property `property_name` on `object`.
|
|
1198
|
+
*
|
|
1199
|
+
* When possible, eg. when signaling a property change from within the class
|
|
1200
|
+
* that registered the property, you should use g_object_notify_by_pspec()
|
|
1201
|
+
* instead.
|
|
1202
|
+
*
|
|
1203
|
+
* Note that emission of the notify signal may be blocked with
|
|
1204
|
+
* g_object_freeze_notify(). In this case, the signal emissions are queued
|
|
1205
|
+
* and will be emitted (in reverse order) when g_object_thaw_notify() is
|
|
1206
|
+
* called.
|
|
1207
|
+
* @param property_name the name of a property installed on the class of @object.
|
|
1208
|
+
*/
|
|
1209
|
+
notify(property_name: string): void;
|
|
1210
|
+
/**
|
|
1211
|
+
* Emits a "notify" signal for the property specified by `pspec` on `object`.
|
|
1212
|
+
*
|
|
1213
|
+
* This function omits the property name lookup, hence it is faster than
|
|
1214
|
+
* g_object_notify().
|
|
1215
|
+
*
|
|
1216
|
+
* One way to avoid using g_object_notify() from within the
|
|
1217
|
+
* class that registered the properties, and using g_object_notify_by_pspec()
|
|
1218
|
+
* instead, is to store the GParamSpec used with
|
|
1219
|
+
* g_object_class_install_property() inside a static array, e.g.:
|
|
1220
|
+
*
|
|
1221
|
+
*
|
|
1222
|
+
* ```c
|
|
1223
|
+
* typedef enum
|
|
1224
|
+
* {
|
|
1225
|
+
* PROP_FOO = 1,
|
|
1226
|
+
* PROP_LAST
|
|
1227
|
+
* } MyObjectProperty;
|
|
1228
|
+
*
|
|
1229
|
+
* static GParamSpec *properties[PROP_LAST];
|
|
1230
|
+
*
|
|
1231
|
+
* static void
|
|
1232
|
+
* my_object_class_init (MyObjectClass *klass)
|
|
1233
|
+
* {
|
|
1234
|
+
* properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
|
|
1235
|
+
* 0, 100,
|
|
1236
|
+
* 50,
|
|
1237
|
+
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
|
1238
|
+
* g_object_class_install_property (gobject_class,
|
|
1239
|
+
* PROP_FOO,
|
|
1240
|
+
* properties[PROP_FOO]);
|
|
1241
|
+
* }
|
|
1242
|
+
* ```
|
|
1243
|
+
*
|
|
1244
|
+
*
|
|
1245
|
+
* and then notify a change on the "foo" property with:
|
|
1246
|
+
*
|
|
1247
|
+
*
|
|
1248
|
+
* ```c
|
|
1249
|
+
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
|
|
1250
|
+
* ```
|
|
1251
|
+
*
|
|
1252
|
+
* @param pspec the #GParamSpec of a property installed on the class of @object.
|
|
1253
|
+
*/
|
|
1254
|
+
notify_by_pspec(pspec: GObject.ParamSpec): void;
|
|
1255
|
+
/**
|
|
1256
|
+
* Increase the reference count of `object,` and possibly remove the
|
|
1257
|
+
* [floating][floating-ref] reference, if `object` has a floating reference.
|
|
1258
|
+
*
|
|
1259
|
+
* In other words, if the object is floating, then this call "assumes
|
|
1260
|
+
* ownership" of the floating reference, converting it to a normal
|
|
1261
|
+
* reference by clearing the floating flag while leaving the reference
|
|
1262
|
+
* count unchanged. If the object is not floating, then this call
|
|
1263
|
+
* adds a new normal reference increasing the reference count by one.
|
|
1264
|
+
*
|
|
1265
|
+
* Since GLib 2.56, the type of `object` will be propagated to the return type
|
|
1266
|
+
* under the same conditions as for g_object_ref().
|
|
1267
|
+
* @returns @object
|
|
1268
|
+
*/
|
|
1269
|
+
ref_sink(): GObject.Object;
|
|
1270
|
+
/**
|
|
1271
|
+
* Releases all references to other objects. This can be used to break
|
|
1272
|
+
* reference cycles.
|
|
1273
|
+
*
|
|
1274
|
+
* This function should only be called from object system implementations.
|
|
1275
|
+
*/
|
|
1276
|
+
run_dispose(): void;
|
|
1277
|
+
/**
|
|
1278
|
+
* Each object carries around a table of associations from
|
|
1279
|
+
* strings to pointers. This function lets you set an association.
|
|
1280
|
+
*
|
|
1281
|
+
* If the object already had an association with that name,
|
|
1282
|
+
* the old association will be destroyed.
|
|
1283
|
+
*
|
|
1284
|
+
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
|
|
1285
|
+
* This means a copy of `key` is kept permanently (even after `object` has been
|
|
1286
|
+
* finalized) — so it is recommended to only use a small, bounded set of values
|
|
1287
|
+
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
|
|
1288
|
+
* @param key name of the key
|
|
1289
|
+
* @param data data to associate with that key
|
|
1290
|
+
*/
|
|
1291
|
+
set_data(key: string, data?: any | null): void;
|
|
1292
|
+
set_property(property_name: string, value: any): void;
|
|
1293
|
+
/**
|
|
1294
|
+
* Remove a specified datum from the object's data associations,
|
|
1295
|
+
* without invoking the association's destroy handler.
|
|
1296
|
+
* @param key name of the key
|
|
1297
|
+
* @returns the data if found, or %NULL if no such data exists.
|
|
1298
|
+
*/
|
|
1299
|
+
steal_data(key: string): any | null;
|
|
1300
|
+
/**
|
|
1301
|
+
* This function gets back user data pointers stored via
|
|
1302
|
+
* g_object_set_qdata() and removes the `data` from object
|
|
1303
|
+
* without invoking its destroy() function (if any was
|
|
1304
|
+
* set).
|
|
1305
|
+
* Usually, calling this function is only required to update
|
|
1306
|
+
* user data pointers with a destroy notifier, for example:
|
|
1307
|
+
*
|
|
1308
|
+
* ```c
|
|
1309
|
+
* void
|
|
1310
|
+
* object_add_to_user_list (GObject *object,
|
|
1311
|
+
* const gchar *new_string)
|
|
1312
|
+
* {
|
|
1313
|
+
* // the quark, naming the object data
|
|
1314
|
+
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
|
|
1315
|
+
* // retrieve the old string list
|
|
1316
|
+
* GList *list = g_object_steal_qdata (object, quark_string_list);
|
|
1317
|
+
*
|
|
1318
|
+
* // prepend new string
|
|
1319
|
+
* list = g_list_prepend (list, g_strdup (new_string));
|
|
1320
|
+
* // this changed 'list', so we need to set it again
|
|
1321
|
+
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
|
|
1322
|
+
* }
|
|
1323
|
+
* static void
|
|
1324
|
+
* free_string_list (gpointer data)
|
|
1325
|
+
* {
|
|
1326
|
+
* GList *node, *list = data;
|
|
1327
|
+
*
|
|
1328
|
+
* for (node = list; node; node = node->next)
|
|
1329
|
+
* g_free (node->data);
|
|
1330
|
+
* g_list_free (list);
|
|
1331
|
+
* }
|
|
1332
|
+
* ```
|
|
1333
|
+
*
|
|
1334
|
+
* Using g_object_get_qdata() in the above example, instead of
|
|
1335
|
+
* g_object_steal_qdata() would have left the destroy function set,
|
|
1336
|
+
* and thus the partial string list would have been freed upon
|
|
1337
|
+
* g_object_set_qdata_full().
|
|
1338
|
+
* @param quark A #GQuark, naming the user data pointer
|
|
1339
|
+
* @returns The user data pointer set, or %NULL
|
|
1340
|
+
*/
|
|
1341
|
+
steal_qdata(quark: GLib.Quark): any | null;
|
|
1342
|
+
/**
|
|
1343
|
+
* Reverts the effect of a previous call to
|
|
1344
|
+
* g_object_freeze_notify(). The freeze count is decreased on `object`
|
|
1345
|
+
* and when it reaches zero, queued "notify" signals are emitted.
|
|
1346
|
+
*
|
|
1347
|
+
* Duplicate notifications for each property are squashed so that at most one
|
|
1348
|
+
* #GObject::notify signal is emitted for each property, in the reverse order
|
|
1349
|
+
* in which they have been queued.
|
|
1350
|
+
*
|
|
1351
|
+
* It is an error to call this function when the freeze count is zero.
|
|
1352
|
+
*/
|
|
1353
|
+
thaw_notify(): void;
|
|
1354
|
+
/**
|
|
1355
|
+
* This function essentially limits the life time of the `closure` to
|
|
1356
|
+
* the life time of the object. That is, when the object is finalized,
|
|
1357
|
+
* the `closure` is invalidated by calling g_closure_invalidate() on
|
|
1358
|
+
* it, in order to prevent invocations of the closure with a finalized
|
|
1359
|
+
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
|
|
1360
|
+
* added as marshal guards to the `closure,` to ensure that an extra
|
|
1361
|
+
* reference count is held on `object` during invocation of the
|
|
1362
|
+
* `closure`. Usually, this function will be called on closures that
|
|
1363
|
+
* use this `object` as closure data.
|
|
1364
|
+
* @param closure #GClosure to watch
|
|
1365
|
+
*/
|
|
1366
|
+
watch_closure(closure: GObject.Closure): void;
|
|
1367
|
+
vfunc_constructed(): void;
|
|
1368
|
+
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
|
|
1369
|
+
vfunc_dispose(): void;
|
|
1370
|
+
vfunc_finalize(): void;
|
|
1371
|
+
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
|
|
1372
|
+
/**
|
|
1373
|
+
* Emits a "notify" signal for the property `property_name` on `object`.
|
|
1374
|
+
*
|
|
1375
|
+
* When possible, eg. when signaling a property change from within the class
|
|
1376
|
+
* that registered the property, you should use g_object_notify_by_pspec()
|
|
1377
|
+
* instead.
|
|
1378
|
+
*
|
|
1379
|
+
* Note that emission of the notify signal may be blocked with
|
|
1380
|
+
* g_object_freeze_notify(). In this case, the signal emissions are queued
|
|
1381
|
+
* and will be emitted (in reverse order) when g_object_thaw_notify() is
|
|
1382
|
+
* called.
|
|
1383
|
+
* @param pspec
|
|
1384
|
+
*/
|
|
1385
|
+
vfunc_notify(pspec: GObject.ParamSpec): void;
|
|
1386
|
+
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
|
|
1387
|
+
disconnect(id: number): void;
|
|
1388
|
+
set(properties: { [key: string]: any }): void;
|
|
1389
|
+
block_signal_handler(id: number): any;
|
|
1390
|
+
unblock_signal_handler(id: number): any;
|
|
1391
|
+
stop_emission_by_name(detailedName: string): any;
|
|
1392
|
+
}
|
|
1393
|
+
|
|
1394
|
+
module MenuItemAction {
|
|
1395
|
+
// Constructor properties interface
|
|
1396
|
+
|
|
1397
|
+
interface ConstructorProps extends GObject.Object.ConstructorProps {
|
|
1398
|
+
command: string;
|
|
1399
|
+
icon_name: string;
|
|
1400
|
+
iconName: string;
|
|
1401
|
+
name: string;
|
|
1402
|
+
}
|
|
1403
|
+
}
|
|
1404
|
+
|
|
1405
|
+
class MenuItemAction extends GObject.Object {
|
|
1406
|
+
static $gtype: GObject.GType<MenuItemAction>;
|
|
1407
|
+
|
|
1408
|
+
// Own properties of Garcon.MenuItemAction
|
|
1409
|
+
|
|
1410
|
+
/**
|
|
1411
|
+
* Command to be executed when the application action is clicked.
|
|
1412
|
+
*/
|
|
1413
|
+
get command(): string;
|
|
1414
|
+
set command(val: string);
|
|
1415
|
+
/**
|
|
1416
|
+
* Name of the custom icon associated with this action.
|
|
1417
|
+
*/
|
|
1418
|
+
get icon_name(): string;
|
|
1419
|
+
set icon_name(val: string);
|
|
1420
|
+
/**
|
|
1421
|
+
* Name of the custom icon associated with this action.
|
|
1422
|
+
*/
|
|
1423
|
+
get iconName(): string;
|
|
1424
|
+
set iconName(val: string);
|
|
1425
|
+
/**
|
|
1426
|
+
* Name of the application action (will be displayed in menus etc.).
|
|
1427
|
+
*/
|
|
1428
|
+
get name(): string;
|
|
1429
|
+
set name(val: string);
|
|
1430
|
+
|
|
1431
|
+
// Constructors of Garcon.MenuItemAction
|
|
1432
|
+
|
|
1433
|
+
constructor(properties?: Partial<MenuItemAction.ConstructorProps>, ...args: any[]);
|
|
1434
|
+
|
|
1435
|
+
_init(...args: any[]): void;
|
|
1436
|
+
|
|
1437
|
+
static ['new'](): MenuItemAction;
|
|
1438
|
+
|
|
1439
|
+
// Own virtual methods of Garcon.MenuItemAction
|
|
1440
|
+
|
|
1441
|
+
vfunc_changed(): void;
|
|
1442
|
+
|
|
1443
|
+
// Own methods of Garcon.MenuItemAction
|
|
1444
|
+
|
|
1445
|
+
get_command(): string;
|
|
1446
|
+
get_icon_name(): string;
|
|
1447
|
+
get_name(): string;
|
|
1448
|
+
ref(): void;
|
|
1449
|
+
// Conflicted with GObject.Object.ref
|
|
1450
|
+
ref(...args: never[]): any;
|
|
1451
|
+
set_command(command: string): void;
|
|
1452
|
+
set_icon_name(icon_name: string): void;
|
|
1453
|
+
set_name(name: string): void;
|
|
1454
|
+
unref(): void;
|
|
1455
|
+
}
|
|
1456
|
+
|
|
1457
|
+
module MenuItemCache {
|
|
1458
|
+
// Constructor properties interface
|
|
1459
|
+
|
|
1460
|
+
interface ConstructorProps extends GObject.Object.ConstructorProps {}
|
|
1461
|
+
}
|
|
1462
|
+
|
|
1463
|
+
class MenuItemCache extends GObject.Object {
|
|
1464
|
+
static $gtype: GObject.GType<MenuItemCache>;
|
|
1465
|
+
|
|
1466
|
+
// Constructors of Garcon.MenuItemCache
|
|
1467
|
+
|
|
1468
|
+
constructor(properties?: Partial<MenuItemCache.ConstructorProps>, ...args: any[]);
|
|
1469
|
+
|
|
1470
|
+
_init(...args: any[]): void;
|
|
1471
|
+
|
|
1472
|
+
static get_default(): MenuItemCache;
|
|
1473
|
+
|
|
1474
|
+
// Own methods of Garcon.MenuItemCache
|
|
1475
|
+
|
|
1476
|
+
foreach(func: GLib.HFunc): void;
|
|
1477
|
+
invalidate(): void;
|
|
1478
|
+
invalidate_file(file: Gio.File): void;
|
|
1479
|
+
lookup(uri: string, desktop_id: string): MenuItem | null;
|
|
1480
|
+
}
|
|
1481
|
+
|
|
1482
|
+
module MenuItemPool {
|
|
1483
|
+
// Constructor properties interface
|
|
1484
|
+
|
|
1485
|
+
interface ConstructorProps extends GObject.Object.ConstructorProps {}
|
|
1486
|
+
}
|
|
1487
|
+
|
|
1488
|
+
class MenuItemPool extends GObject.Object {
|
|
1489
|
+
static $gtype: GObject.GType<MenuItemPool>;
|
|
1490
|
+
|
|
1491
|
+
// Constructors of Garcon.MenuItemPool
|
|
1492
|
+
|
|
1493
|
+
constructor(properties?: Partial<MenuItemPool.ConstructorProps>, ...args: any[]);
|
|
1494
|
+
|
|
1495
|
+
_init(...args: any[]): void;
|
|
1496
|
+
|
|
1497
|
+
static ['new'](): MenuItemPool;
|
|
1498
|
+
|
|
1499
|
+
// Own methods of Garcon.MenuItemPool
|
|
1500
|
+
|
|
1501
|
+
apply_exclude_rule(node: GLib.Node): void;
|
|
1502
|
+
clear(): void;
|
|
1503
|
+
foreach(func: GLib.HFunc): void;
|
|
1504
|
+
get_empty(): boolean;
|
|
1505
|
+
insert(item: MenuItem): void;
|
|
1506
|
+
lookup(desktop_id: string): MenuItem;
|
|
1507
|
+
lookup_file(file: Gio.File): MenuItem;
|
|
1508
|
+
}
|
|
1509
|
+
|
|
1510
|
+
module MenuMerger {
|
|
1511
|
+
// Constructor properties interface
|
|
1512
|
+
|
|
1513
|
+
interface ConstructorProps extends GObject.Object.ConstructorProps, MenuTreeProvider.ConstructorProps {
|
|
1514
|
+
tree_provider: MenuTreeProvider;
|
|
1515
|
+
treeProvider: MenuTreeProvider;
|
|
1516
|
+
}
|
|
1517
|
+
}
|
|
1518
|
+
|
|
1519
|
+
class MenuMerger extends GObject.Object implements MenuTreeProvider {
|
|
1520
|
+
static $gtype: GObject.GType<MenuMerger>;
|
|
1521
|
+
|
|
1522
|
+
// Own properties of Garcon.MenuMerger
|
|
1523
|
+
|
|
1524
|
+
get tree_provider(): MenuTreeProvider;
|
|
1525
|
+
get treeProvider(): MenuTreeProvider;
|
|
1526
|
+
|
|
1527
|
+
// Constructors of Garcon.MenuMerger
|
|
1528
|
+
|
|
1529
|
+
constructor(properties?: Partial<MenuMerger.ConstructorProps>, ...args: any[]);
|
|
1530
|
+
|
|
1531
|
+
_init(...args: any[]): void;
|
|
1532
|
+
|
|
1533
|
+
static ['new'](provider: MenuTreeProvider): MenuMerger;
|
|
1534
|
+
|
|
1535
|
+
// Own methods of Garcon.MenuMerger
|
|
1536
|
+
|
|
1537
|
+
run(merge_files: string[], merge_dirs: string[], cancellable?: Gio.Cancellable | null): boolean;
|
|
1538
|
+
|
|
1539
|
+
// Inherited methods
|
|
1540
|
+
get_file(): Gio.File;
|
|
1541
|
+
vfunc_get_file(): Gio.File;
|
|
1542
|
+
/**
|
|
1543
|
+
* Creates a binding between `source_property` on `source` and `target_property`
|
|
1544
|
+
* on `target`.
|
|
1545
|
+
*
|
|
1546
|
+
* Whenever the `source_property` is changed the `target_property` is
|
|
1547
|
+
* updated using the same value. For instance:
|
|
1548
|
+
*
|
|
1549
|
+
*
|
|
1550
|
+
* ```c
|
|
1551
|
+
* g_object_bind_property (action, "active", widget, "sensitive", 0);
|
|
1552
|
+
* ```
|
|
1553
|
+
*
|
|
1554
|
+
*
|
|
1555
|
+
* Will result in the "sensitive" property of the widget #GObject instance to be
|
|
1556
|
+
* updated with the same value of the "active" property of the action #GObject
|
|
1557
|
+
* instance.
|
|
1558
|
+
*
|
|
1559
|
+
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
|
|
1560
|
+
* if `target_property` on `target` changes then the `source_property` on `source`
|
|
1561
|
+
* will be updated as well.
|
|
1562
|
+
*
|
|
1563
|
+
* The binding will automatically be removed when either the `source` or the
|
|
1564
|
+
* `target` instances are finalized. To remove the binding without affecting the
|
|
1565
|
+
* `source` and the `target` you can just call g_object_unref() on the returned
|
|
1566
|
+
* #GBinding instance.
|
|
1567
|
+
*
|
|
1568
|
+
* Removing the binding by calling g_object_unref() on it must only be done if
|
|
1569
|
+
* the binding, `source` and `target` are only used from a single thread and it
|
|
1570
|
+
* is clear that both `source` and `target` outlive the binding. Especially it
|
|
1571
|
+
* is not safe to rely on this if the binding, `source` or `target` can be
|
|
1572
|
+
* finalized from different threads. Keep another reference to the binding and
|
|
1573
|
+
* use g_binding_unbind() instead to be on the safe side.
|
|
1574
|
+
*
|
|
1575
|
+
* A #GObject can have multiple bindings.
|
|
1576
|
+
* @param source_property the property on @source to bind
|
|
1577
|
+
* @param target the target #GObject
|
|
1578
|
+
* @param target_property the property on @target to bind
|
|
1579
|
+
* @param flags flags to pass to #GBinding
|
|
1580
|
+
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
|
|
1581
|
+
*/
|
|
1582
|
+
bind_property(
|
|
1583
|
+
source_property: string,
|
|
1584
|
+
target: GObject.Object,
|
|
1585
|
+
target_property: string,
|
|
1586
|
+
flags: GObject.BindingFlags,
|
|
1587
|
+
): GObject.Binding;
|
|
1588
|
+
/**
|
|
1589
|
+
* Complete version of g_object_bind_property().
|
|
1590
|
+
*
|
|
1591
|
+
* Creates a binding between `source_property` on `source` and `target_property`
|
|
1592
|
+
* on `target,` allowing you to set the transformation functions to be used by
|
|
1593
|
+
* the binding.
|
|
1594
|
+
*
|
|
1595
|
+
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
|
|
1596
|
+
* if `target_property` on `target` changes then the `source_property` on `source`
|
|
1597
|
+
* will be updated as well. The `transform_from` function is only used in case
|
|
1598
|
+
* of bidirectional bindings, otherwise it will be ignored
|
|
1599
|
+
*
|
|
1600
|
+
* The binding will automatically be removed when either the `source` or the
|
|
1601
|
+
* `target` instances are finalized. This will release the reference that is
|
|
1602
|
+
* being held on the #GBinding instance; if you want to hold on to the
|
|
1603
|
+
* #GBinding instance, you will need to hold a reference to it.
|
|
1604
|
+
*
|
|
1605
|
+
* To remove the binding, call g_binding_unbind().
|
|
1606
|
+
*
|
|
1607
|
+
* A #GObject can have multiple bindings.
|
|
1608
|
+
*
|
|
1609
|
+
* The same `user_data` parameter will be used for both `transform_to`
|
|
1610
|
+
* and `transform_from` transformation functions; the `notify` function will
|
|
1611
|
+
* be called once, when the binding is removed. If you need different data
|
|
1612
|
+
* for each transformation function, please use
|
|
1613
|
+
* g_object_bind_property_with_closures() instead.
|
|
1614
|
+
* @param source_property the property on @source to bind
|
|
1615
|
+
* @param target the target #GObject
|
|
1616
|
+
* @param target_property the property on @target to bind
|
|
1617
|
+
* @param flags flags to pass to #GBinding
|
|
1618
|
+
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
|
|
1619
|
+
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
|
|
1620
|
+
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
|
|
1621
|
+
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
|
|
1622
|
+
*/
|
|
1623
|
+
bind_property_full(
|
|
1624
|
+
source_property: string,
|
|
1625
|
+
target: GObject.Object,
|
|
1626
|
+
target_property: string,
|
|
1627
|
+
flags: GObject.BindingFlags,
|
|
1628
|
+
transform_to?: GObject.BindingTransformFunc | null,
|
|
1629
|
+
transform_from?: GObject.BindingTransformFunc | null,
|
|
1630
|
+
notify?: GLib.DestroyNotify | null,
|
|
1631
|
+
): GObject.Binding;
|
|
1632
|
+
// Conflicted with GObject.Object.bind_property_full
|
|
1633
|
+
bind_property_full(...args: never[]): any;
|
|
1634
|
+
/**
|
|
1635
|
+
* This function is intended for #GObject implementations to re-enforce
|
|
1636
|
+
* a [floating][floating-ref] object reference. Doing this is seldom
|
|
1637
|
+
* required: all #GInitiallyUnowneds are created with a floating reference
|
|
1638
|
+
* which usually just needs to be sunken by calling g_object_ref_sink().
|
|
1639
|
+
*/
|
|
1640
|
+
force_floating(): void;
|
|
1641
|
+
/**
|
|
1642
|
+
* Increases the freeze count on `object`. If the freeze count is
|
|
1643
|
+
* non-zero, the emission of "notify" signals on `object` is
|
|
1644
|
+
* stopped. The signals are queued until the freeze count is decreased
|
|
1645
|
+
* to zero. Duplicate notifications are squashed so that at most one
|
|
1646
|
+
* #GObject::notify signal is emitted for each property modified while the
|
|
1647
|
+
* object is frozen.
|
|
1648
|
+
*
|
|
1649
|
+
* This is necessary for accessors that modify multiple properties to prevent
|
|
1650
|
+
* premature notification while the object is still being modified.
|
|
1651
|
+
*/
|
|
1652
|
+
freeze_notify(): void;
|
|
1653
|
+
/**
|
|
1654
|
+
* Gets a named field from the objects table of associations (see g_object_set_data()).
|
|
1655
|
+
* @param key name of the key for that association
|
|
1656
|
+
* @returns the data if found, or %NULL if no such data exists.
|
|
1657
|
+
*/
|
|
1658
|
+
get_data(key: string): any | null;
|
|
1659
|
+
get_property(property_name: string): any;
|
|
1660
|
+
/**
|
|
1661
|
+
* This function gets back user data pointers stored via
|
|
1662
|
+
* g_object_set_qdata().
|
|
1663
|
+
* @param quark A #GQuark, naming the user data pointer
|
|
1664
|
+
* @returns The user data pointer set, or %NULL
|
|
1665
|
+
*/
|
|
1666
|
+
get_qdata(quark: GLib.Quark): any | null;
|
|
1667
|
+
/**
|
|
1668
|
+
* Gets `n_properties` properties for an `object`.
|
|
1669
|
+
* Obtained properties will be set to `values`. All properties must be valid.
|
|
1670
|
+
* Warnings will be emitted and undefined behaviour may result if invalid
|
|
1671
|
+
* properties are passed in.
|
|
1672
|
+
* @param names the names of each property to get
|
|
1673
|
+
* @param values the values of each property to get
|
|
1674
|
+
*/
|
|
1675
|
+
getv(names: string[], values: (GObject.Value | any)[]): void;
|
|
1676
|
+
/**
|
|
1677
|
+
* Checks whether `object` has a [floating][floating-ref] reference.
|
|
1678
|
+
* @returns %TRUE if @object has a floating reference
|
|
1679
|
+
*/
|
|
1680
|
+
is_floating(): boolean;
|
|
1681
|
+
/**
|
|
1682
|
+
* Emits a "notify" signal for the property `property_name` on `object`.
|
|
1683
|
+
*
|
|
1684
|
+
* When possible, eg. when signaling a property change from within the class
|
|
1685
|
+
* that registered the property, you should use g_object_notify_by_pspec()
|
|
1686
|
+
* instead.
|
|
1687
|
+
*
|
|
1688
|
+
* Note that emission of the notify signal may be blocked with
|
|
1689
|
+
* g_object_freeze_notify(). In this case, the signal emissions are queued
|
|
1690
|
+
* and will be emitted (in reverse order) when g_object_thaw_notify() is
|
|
1691
|
+
* called.
|
|
1692
|
+
* @param property_name the name of a property installed on the class of @object.
|
|
1693
|
+
*/
|
|
1694
|
+
notify(property_name: string): void;
|
|
1695
|
+
/**
|
|
1696
|
+
* Emits a "notify" signal for the property specified by `pspec` on `object`.
|
|
1697
|
+
*
|
|
1698
|
+
* This function omits the property name lookup, hence it is faster than
|
|
1699
|
+
* g_object_notify().
|
|
1700
|
+
*
|
|
1701
|
+
* One way to avoid using g_object_notify() from within the
|
|
1702
|
+
* class that registered the properties, and using g_object_notify_by_pspec()
|
|
1703
|
+
* instead, is to store the GParamSpec used with
|
|
1704
|
+
* g_object_class_install_property() inside a static array, e.g.:
|
|
1705
|
+
*
|
|
1706
|
+
*
|
|
1707
|
+
* ```c
|
|
1708
|
+
* typedef enum
|
|
1709
|
+
* {
|
|
1710
|
+
* PROP_FOO = 1,
|
|
1711
|
+
* PROP_LAST
|
|
1712
|
+
* } MyObjectProperty;
|
|
1713
|
+
*
|
|
1714
|
+
* static GParamSpec *properties[PROP_LAST];
|
|
1715
|
+
*
|
|
1716
|
+
* static void
|
|
1717
|
+
* my_object_class_init (MyObjectClass *klass)
|
|
1718
|
+
* {
|
|
1719
|
+
* properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
|
|
1720
|
+
* 0, 100,
|
|
1721
|
+
* 50,
|
|
1722
|
+
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
|
1723
|
+
* g_object_class_install_property (gobject_class,
|
|
1724
|
+
* PROP_FOO,
|
|
1725
|
+
* properties[PROP_FOO]);
|
|
1726
|
+
* }
|
|
1727
|
+
* ```
|
|
1728
|
+
*
|
|
1729
|
+
*
|
|
1730
|
+
* and then notify a change on the "foo" property with:
|
|
1731
|
+
*
|
|
1732
|
+
*
|
|
1733
|
+
* ```c
|
|
1734
|
+
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
|
|
1735
|
+
* ```
|
|
1736
|
+
*
|
|
1737
|
+
* @param pspec the #GParamSpec of a property installed on the class of @object.
|
|
1738
|
+
*/
|
|
1739
|
+
notify_by_pspec(pspec: GObject.ParamSpec): void;
|
|
1740
|
+
/**
|
|
1741
|
+
* Increases the reference count of `object`.
|
|
1742
|
+
*
|
|
1743
|
+
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
|
|
1744
|
+
* of `object` will be propagated to the return type (using the GCC typeof()
|
|
1745
|
+
* extension), so any casting the caller needs to do on the return type must be
|
|
1746
|
+
* explicit.
|
|
1747
|
+
* @returns the same @object
|
|
1748
|
+
*/
|
|
1749
|
+
ref(): GObject.Object;
|
|
1750
|
+
/**
|
|
1751
|
+
* Increase the reference count of `object,` and possibly remove the
|
|
1752
|
+
* [floating][floating-ref] reference, if `object` has a floating reference.
|
|
1753
|
+
*
|
|
1754
|
+
* In other words, if the object is floating, then this call "assumes
|
|
1755
|
+
* ownership" of the floating reference, converting it to a normal
|
|
1756
|
+
* reference by clearing the floating flag while leaving the reference
|
|
1757
|
+
* count unchanged. If the object is not floating, then this call
|
|
1758
|
+
* adds a new normal reference increasing the reference count by one.
|
|
1759
|
+
*
|
|
1760
|
+
* Since GLib 2.56, the type of `object` will be propagated to the return type
|
|
1761
|
+
* under the same conditions as for g_object_ref().
|
|
1762
|
+
* @returns @object
|
|
1763
|
+
*/
|
|
1764
|
+
ref_sink(): GObject.Object;
|
|
1765
|
+
/**
|
|
1766
|
+
* Releases all references to other objects. This can be used to break
|
|
1767
|
+
* reference cycles.
|
|
1768
|
+
*
|
|
1769
|
+
* This function should only be called from object system implementations.
|
|
1770
|
+
*/
|
|
1771
|
+
run_dispose(): void;
|
|
1772
|
+
/**
|
|
1773
|
+
* Each object carries around a table of associations from
|
|
1774
|
+
* strings to pointers. This function lets you set an association.
|
|
1775
|
+
*
|
|
1776
|
+
* If the object already had an association with that name,
|
|
1777
|
+
* the old association will be destroyed.
|
|
1778
|
+
*
|
|
1779
|
+
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
|
|
1780
|
+
* This means a copy of `key` is kept permanently (even after `object` has been
|
|
1781
|
+
* finalized) — so it is recommended to only use a small, bounded set of values
|
|
1782
|
+
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
|
|
1783
|
+
* @param key name of the key
|
|
1784
|
+
* @param data data to associate with that key
|
|
1785
|
+
*/
|
|
1786
|
+
set_data(key: string, data?: any | null): void;
|
|
1787
|
+
set_property(property_name: string, value: any): void;
|
|
1788
|
+
/**
|
|
1789
|
+
* Remove a specified datum from the object's data associations,
|
|
1790
|
+
* without invoking the association's destroy handler.
|
|
1791
|
+
* @param key name of the key
|
|
1792
|
+
* @returns the data if found, or %NULL if no such data exists.
|
|
1793
|
+
*/
|
|
1794
|
+
steal_data(key: string): any | null;
|
|
1795
|
+
/**
|
|
1796
|
+
* This function gets back user data pointers stored via
|
|
1797
|
+
* g_object_set_qdata() and removes the `data` from object
|
|
1798
|
+
* without invoking its destroy() function (if any was
|
|
1799
|
+
* set).
|
|
1800
|
+
* Usually, calling this function is only required to update
|
|
1801
|
+
* user data pointers with a destroy notifier, for example:
|
|
1802
|
+
*
|
|
1803
|
+
* ```c
|
|
1804
|
+
* void
|
|
1805
|
+
* object_add_to_user_list (GObject *object,
|
|
1806
|
+
* const gchar *new_string)
|
|
1807
|
+
* {
|
|
1808
|
+
* // the quark, naming the object data
|
|
1809
|
+
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
|
|
1810
|
+
* // retrieve the old string list
|
|
1811
|
+
* GList *list = g_object_steal_qdata (object, quark_string_list);
|
|
1812
|
+
*
|
|
1813
|
+
* // prepend new string
|
|
1814
|
+
* list = g_list_prepend (list, g_strdup (new_string));
|
|
1815
|
+
* // this changed 'list', so we need to set it again
|
|
1816
|
+
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
|
|
1817
|
+
* }
|
|
1818
|
+
* static void
|
|
1819
|
+
* free_string_list (gpointer data)
|
|
1820
|
+
* {
|
|
1821
|
+
* GList *node, *list = data;
|
|
1822
|
+
*
|
|
1823
|
+
* for (node = list; node; node = node->next)
|
|
1824
|
+
* g_free (node->data);
|
|
1825
|
+
* g_list_free (list);
|
|
1826
|
+
* }
|
|
1827
|
+
* ```
|
|
1828
|
+
*
|
|
1829
|
+
* Using g_object_get_qdata() in the above example, instead of
|
|
1830
|
+
* g_object_steal_qdata() would have left the destroy function set,
|
|
1831
|
+
* and thus the partial string list would have been freed upon
|
|
1832
|
+
* g_object_set_qdata_full().
|
|
1833
|
+
* @param quark A #GQuark, naming the user data pointer
|
|
1834
|
+
* @returns The user data pointer set, or %NULL
|
|
1835
|
+
*/
|
|
1836
|
+
steal_qdata(quark: GLib.Quark): any | null;
|
|
1837
|
+
/**
|
|
1838
|
+
* Reverts the effect of a previous call to
|
|
1839
|
+
* g_object_freeze_notify(). The freeze count is decreased on `object`
|
|
1840
|
+
* and when it reaches zero, queued "notify" signals are emitted.
|
|
1841
|
+
*
|
|
1842
|
+
* Duplicate notifications for each property are squashed so that at most one
|
|
1843
|
+
* #GObject::notify signal is emitted for each property, in the reverse order
|
|
1844
|
+
* in which they have been queued.
|
|
1845
|
+
*
|
|
1846
|
+
* It is an error to call this function when the freeze count is zero.
|
|
1847
|
+
*/
|
|
1848
|
+
thaw_notify(): void;
|
|
1849
|
+
/**
|
|
1850
|
+
* Decreases the reference count of `object`. When its reference count
|
|
1851
|
+
* drops to 0, the object is finalized (i.e. its memory is freed).
|
|
1852
|
+
*
|
|
1853
|
+
* If the pointer to the #GObject may be reused in future (for example, if it is
|
|
1854
|
+
* an instance variable of another object), it is recommended to clear the
|
|
1855
|
+
* pointer to %NULL rather than retain a dangling pointer to a potentially
|
|
1856
|
+
* invalid #GObject instance. Use g_clear_object() for this.
|
|
1857
|
+
*/
|
|
1858
|
+
unref(): void;
|
|
1859
|
+
/**
|
|
1860
|
+
* This function essentially limits the life time of the `closure` to
|
|
1861
|
+
* the life time of the object. That is, when the object is finalized,
|
|
1862
|
+
* the `closure` is invalidated by calling g_closure_invalidate() on
|
|
1863
|
+
* it, in order to prevent invocations of the closure with a finalized
|
|
1864
|
+
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
|
|
1865
|
+
* added as marshal guards to the `closure,` to ensure that an extra
|
|
1866
|
+
* reference count is held on `object` during invocation of the
|
|
1867
|
+
* `closure`. Usually, this function will be called on closures that
|
|
1868
|
+
* use this `object` as closure data.
|
|
1869
|
+
* @param closure #GClosure to watch
|
|
1870
|
+
*/
|
|
1871
|
+
watch_closure(closure: GObject.Closure): void;
|
|
1872
|
+
vfunc_constructed(): void;
|
|
1873
|
+
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
|
|
1874
|
+
vfunc_dispose(): void;
|
|
1875
|
+
vfunc_finalize(): void;
|
|
1876
|
+
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
|
|
1877
|
+
/**
|
|
1878
|
+
* Emits a "notify" signal for the property `property_name` on `object`.
|
|
1879
|
+
*
|
|
1880
|
+
* When possible, eg. when signaling a property change from within the class
|
|
1881
|
+
* that registered the property, you should use g_object_notify_by_pspec()
|
|
1882
|
+
* instead.
|
|
1883
|
+
*
|
|
1884
|
+
* Note that emission of the notify signal may be blocked with
|
|
1885
|
+
* g_object_freeze_notify(). In this case, the signal emissions are queued
|
|
1886
|
+
* and will be emitted (in reverse order) when g_object_thaw_notify() is
|
|
1887
|
+
* called.
|
|
1888
|
+
* @param pspec
|
|
1889
|
+
*/
|
|
1890
|
+
vfunc_notify(pspec: GObject.ParamSpec): void;
|
|
1891
|
+
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
|
|
1892
|
+
disconnect(id: number): void;
|
|
1893
|
+
set(properties: { [key: string]: any }): void;
|
|
1894
|
+
block_signal_handler(id: number): any;
|
|
1895
|
+
unblock_signal_handler(id: number): any;
|
|
1896
|
+
stop_emission_by_name(detailedName: string): any;
|
|
1897
|
+
}
|
|
1898
|
+
|
|
1899
|
+
module MenuNode {
|
|
1900
|
+
// Constructor properties interface
|
|
1901
|
+
|
|
1902
|
+
interface ConstructorProps extends GObject.Object.ConstructorProps {
|
|
1903
|
+
node_type: MenuNodeType;
|
|
1904
|
+
nodeType: MenuNodeType;
|
|
1905
|
+
}
|
|
1906
|
+
}
|
|
1907
|
+
|
|
1908
|
+
class MenuNode extends GObject.Object {
|
|
1909
|
+
static $gtype: GObject.GType<MenuNode>;
|
|
1910
|
+
|
|
1911
|
+
// Own properties of Garcon.MenuNode
|
|
1912
|
+
|
|
1913
|
+
get node_type(): MenuNodeType;
|
|
1914
|
+
set node_type(val: MenuNodeType);
|
|
1915
|
+
get nodeType(): MenuNodeType;
|
|
1916
|
+
set nodeType(val: MenuNodeType);
|
|
1917
|
+
|
|
1918
|
+
// Constructors of Garcon.MenuNode
|
|
1919
|
+
|
|
1920
|
+
constructor(properties?: Partial<MenuNode.ConstructorProps>, ...args: any[]);
|
|
1921
|
+
|
|
1922
|
+
_init(...args: any[]): void;
|
|
1923
|
+
|
|
1924
|
+
static ['new'](node_type: MenuNodeType): MenuNode;
|
|
1925
|
+
|
|
1926
|
+
// Own static methods of Garcon.MenuNode
|
|
1927
|
+
|
|
1928
|
+
static tree_compare(tree: GLib.Node, other_tree: GLib.Node): number;
|
|
1929
|
+
static tree_free(tree: GLib.Node): void;
|
|
1930
|
+
static tree_free_data(tree: GLib.Node): void;
|
|
1931
|
+
static tree_get_boolean_child(tree: GLib.Node, type: MenuNodeType): boolean;
|
|
1932
|
+
static tree_get_child_nodes(tree: GLib.Node, type: MenuNodeType, reverse: boolean): GLib.Node[];
|
|
1933
|
+
static tree_get_layout_merge_type(tree: GLib.Node): MenuLayoutMergeType;
|
|
1934
|
+
static tree_get_merge_file_filename(tree: GLib.Node): string;
|
|
1935
|
+
static tree_get_merge_file_type(tree: GLib.Node): MenuMergeFileType;
|
|
1936
|
+
static tree_get_node_type(tree: GLib.Node): MenuNodeType;
|
|
1937
|
+
static tree_get_string(tree: GLib.Node): string;
|
|
1938
|
+
static tree_get_string_child(tree: GLib.Node, type: MenuNodeType): string;
|
|
1939
|
+
static tree_get_string_children(tree: GLib.Node, type: MenuNodeType, reverse: boolean): GLib.Node[];
|
|
1940
|
+
static tree_rule_matches(tree: GLib.Node, item: MenuItem): boolean;
|
|
1941
|
+
static tree_set_merge_file_filename(tree: GLib.Node, filename: string): void;
|
|
1942
|
+
static tree_set_string(tree: GLib.Node, value: string): void;
|
|
1943
|
+
|
|
1944
|
+
// Own methods of Garcon.MenuNode
|
|
1945
|
+
|
|
1946
|
+
copy(data?: any | null): MenuNode;
|
|
1947
|
+
get_merge_file_filename(): string;
|
|
1948
|
+
get_merge_file_type(): MenuMergeFileType;
|
|
1949
|
+
get_node_type(): MenuNodeType;
|
|
1950
|
+
get_string(): string;
|
|
1951
|
+
set_merge_file_filename(filename: string): void;
|
|
1952
|
+
set_merge_file_type(type: MenuMergeFileType): void;
|
|
1953
|
+
set_string(value: string): void;
|
|
1954
|
+
}
|
|
1955
|
+
|
|
1956
|
+
module MenuParser {
|
|
1957
|
+
// Constructor properties interface
|
|
1958
|
+
|
|
1959
|
+
interface ConstructorProps extends GObject.Object.ConstructorProps, MenuTreeProvider.ConstructorProps {
|
|
1960
|
+
file: Gio.File;
|
|
1961
|
+
}
|
|
1962
|
+
}
|
|
1963
|
+
|
|
1964
|
+
class MenuParser extends GObject.Object implements MenuTreeProvider {
|
|
1965
|
+
static $gtype: GObject.GType<MenuParser>;
|
|
1966
|
+
|
|
1967
|
+
// Own properties of Garcon.MenuParser
|
|
1968
|
+
|
|
1969
|
+
get file(): Gio.File;
|
|
1970
|
+
|
|
1971
|
+
// Constructors of Garcon.MenuParser
|
|
1972
|
+
|
|
1973
|
+
constructor(properties?: Partial<MenuParser.ConstructorProps>, ...args: any[]);
|
|
1974
|
+
|
|
1975
|
+
_init(...args: any[]): void;
|
|
1976
|
+
|
|
1977
|
+
static ['new'](file: Gio.File): MenuParser;
|
|
1978
|
+
|
|
1979
|
+
// Own methods of Garcon.MenuParser
|
|
1980
|
+
|
|
1981
|
+
run(cancellable?: Gio.Cancellable | null): boolean;
|
|
1982
|
+
|
|
1983
|
+
// Inherited methods
|
|
1984
|
+
get_file(): Gio.File;
|
|
1985
|
+
vfunc_get_file(): Gio.File;
|
|
1986
|
+
/**
|
|
1987
|
+
* Creates a binding between `source_property` on `source` and `target_property`
|
|
1988
|
+
* on `target`.
|
|
1989
|
+
*
|
|
1990
|
+
* Whenever the `source_property` is changed the `target_property` is
|
|
1991
|
+
* updated using the same value. For instance:
|
|
1992
|
+
*
|
|
1993
|
+
*
|
|
1994
|
+
* ```c
|
|
1995
|
+
* g_object_bind_property (action, "active", widget, "sensitive", 0);
|
|
1996
|
+
* ```
|
|
1997
|
+
*
|
|
1998
|
+
*
|
|
1999
|
+
* Will result in the "sensitive" property of the widget #GObject instance to be
|
|
2000
|
+
* updated with the same value of the "active" property of the action #GObject
|
|
2001
|
+
* instance.
|
|
2002
|
+
*
|
|
2003
|
+
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
|
|
2004
|
+
* if `target_property` on `target` changes then the `source_property` on `source`
|
|
2005
|
+
* will be updated as well.
|
|
2006
|
+
*
|
|
2007
|
+
* The binding will automatically be removed when either the `source` or the
|
|
2008
|
+
* `target` instances are finalized. To remove the binding without affecting the
|
|
2009
|
+
* `source` and the `target` you can just call g_object_unref() on the returned
|
|
2010
|
+
* #GBinding instance.
|
|
2011
|
+
*
|
|
2012
|
+
* Removing the binding by calling g_object_unref() on it must only be done if
|
|
2013
|
+
* the binding, `source` and `target` are only used from a single thread and it
|
|
2014
|
+
* is clear that both `source` and `target` outlive the binding. Especially it
|
|
2015
|
+
* is not safe to rely on this if the binding, `source` or `target` can be
|
|
2016
|
+
* finalized from different threads. Keep another reference to the binding and
|
|
2017
|
+
* use g_binding_unbind() instead to be on the safe side.
|
|
2018
|
+
*
|
|
2019
|
+
* A #GObject can have multiple bindings.
|
|
2020
|
+
* @param source_property the property on @source to bind
|
|
2021
|
+
* @param target the target #GObject
|
|
2022
|
+
* @param target_property the property on @target to bind
|
|
2023
|
+
* @param flags flags to pass to #GBinding
|
|
2024
|
+
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
|
|
2025
|
+
*/
|
|
2026
|
+
bind_property(
|
|
2027
|
+
source_property: string,
|
|
2028
|
+
target: GObject.Object,
|
|
2029
|
+
target_property: string,
|
|
2030
|
+
flags: GObject.BindingFlags,
|
|
2031
|
+
): GObject.Binding;
|
|
2032
|
+
/**
|
|
2033
|
+
* Complete version of g_object_bind_property().
|
|
2034
|
+
*
|
|
2035
|
+
* Creates a binding between `source_property` on `source` and `target_property`
|
|
2036
|
+
* on `target,` allowing you to set the transformation functions to be used by
|
|
2037
|
+
* the binding.
|
|
2038
|
+
*
|
|
2039
|
+
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
|
|
2040
|
+
* if `target_property` on `target` changes then the `source_property` on `source`
|
|
2041
|
+
* will be updated as well. The `transform_from` function is only used in case
|
|
2042
|
+
* of bidirectional bindings, otherwise it will be ignored
|
|
2043
|
+
*
|
|
2044
|
+
* The binding will automatically be removed when either the `source` or the
|
|
2045
|
+
* `target` instances are finalized. This will release the reference that is
|
|
2046
|
+
* being held on the #GBinding instance; if you want to hold on to the
|
|
2047
|
+
* #GBinding instance, you will need to hold a reference to it.
|
|
2048
|
+
*
|
|
2049
|
+
* To remove the binding, call g_binding_unbind().
|
|
2050
|
+
*
|
|
2051
|
+
* A #GObject can have multiple bindings.
|
|
2052
|
+
*
|
|
2053
|
+
* The same `user_data` parameter will be used for both `transform_to`
|
|
2054
|
+
* and `transform_from` transformation functions; the `notify` function will
|
|
2055
|
+
* be called once, when the binding is removed. If you need different data
|
|
2056
|
+
* for each transformation function, please use
|
|
2057
|
+
* g_object_bind_property_with_closures() instead.
|
|
2058
|
+
* @param source_property the property on @source to bind
|
|
2059
|
+
* @param target the target #GObject
|
|
2060
|
+
* @param target_property the property on @target to bind
|
|
2061
|
+
* @param flags flags to pass to #GBinding
|
|
2062
|
+
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
|
|
2063
|
+
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
|
|
2064
|
+
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
|
|
2065
|
+
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
|
|
2066
|
+
*/
|
|
2067
|
+
bind_property_full(
|
|
2068
|
+
source_property: string,
|
|
2069
|
+
target: GObject.Object,
|
|
2070
|
+
target_property: string,
|
|
2071
|
+
flags: GObject.BindingFlags,
|
|
2072
|
+
transform_to?: GObject.BindingTransformFunc | null,
|
|
2073
|
+
transform_from?: GObject.BindingTransformFunc | null,
|
|
2074
|
+
notify?: GLib.DestroyNotify | null,
|
|
2075
|
+
): GObject.Binding;
|
|
2076
|
+
// Conflicted with GObject.Object.bind_property_full
|
|
2077
|
+
bind_property_full(...args: never[]): any;
|
|
2078
|
+
/**
|
|
2079
|
+
* This function is intended for #GObject implementations to re-enforce
|
|
2080
|
+
* a [floating][floating-ref] object reference. Doing this is seldom
|
|
2081
|
+
* required: all #GInitiallyUnowneds are created with a floating reference
|
|
2082
|
+
* which usually just needs to be sunken by calling g_object_ref_sink().
|
|
2083
|
+
*/
|
|
2084
|
+
force_floating(): void;
|
|
2085
|
+
/**
|
|
2086
|
+
* Increases the freeze count on `object`. If the freeze count is
|
|
2087
|
+
* non-zero, the emission of "notify" signals on `object` is
|
|
2088
|
+
* stopped. The signals are queued until the freeze count is decreased
|
|
2089
|
+
* to zero. Duplicate notifications are squashed so that at most one
|
|
2090
|
+
* #GObject::notify signal is emitted for each property modified while the
|
|
2091
|
+
* object is frozen.
|
|
2092
|
+
*
|
|
2093
|
+
* This is necessary for accessors that modify multiple properties to prevent
|
|
2094
|
+
* premature notification while the object is still being modified.
|
|
2095
|
+
*/
|
|
2096
|
+
freeze_notify(): void;
|
|
2097
|
+
/**
|
|
2098
|
+
* Gets a named field from the objects table of associations (see g_object_set_data()).
|
|
2099
|
+
* @param key name of the key for that association
|
|
2100
|
+
* @returns the data if found, or %NULL if no such data exists.
|
|
2101
|
+
*/
|
|
2102
|
+
get_data(key: string): any | null;
|
|
2103
|
+
get_property(property_name: string): any;
|
|
2104
|
+
/**
|
|
2105
|
+
* This function gets back user data pointers stored via
|
|
2106
|
+
* g_object_set_qdata().
|
|
2107
|
+
* @param quark A #GQuark, naming the user data pointer
|
|
2108
|
+
* @returns The user data pointer set, or %NULL
|
|
2109
|
+
*/
|
|
2110
|
+
get_qdata(quark: GLib.Quark): any | null;
|
|
2111
|
+
/**
|
|
2112
|
+
* Gets `n_properties` properties for an `object`.
|
|
2113
|
+
* Obtained properties will be set to `values`. All properties must be valid.
|
|
2114
|
+
* Warnings will be emitted and undefined behaviour may result if invalid
|
|
2115
|
+
* properties are passed in.
|
|
2116
|
+
* @param names the names of each property to get
|
|
2117
|
+
* @param values the values of each property to get
|
|
2118
|
+
*/
|
|
2119
|
+
getv(names: string[], values: (GObject.Value | any)[]): void;
|
|
2120
|
+
/**
|
|
2121
|
+
* Checks whether `object` has a [floating][floating-ref] reference.
|
|
2122
|
+
* @returns %TRUE if @object has a floating reference
|
|
2123
|
+
*/
|
|
2124
|
+
is_floating(): boolean;
|
|
2125
|
+
/**
|
|
2126
|
+
* Emits a "notify" signal for the property `property_name` on `object`.
|
|
2127
|
+
*
|
|
2128
|
+
* When possible, eg. when signaling a property change from within the class
|
|
2129
|
+
* that registered the property, you should use g_object_notify_by_pspec()
|
|
2130
|
+
* instead.
|
|
2131
|
+
*
|
|
2132
|
+
* Note that emission of the notify signal may be blocked with
|
|
2133
|
+
* g_object_freeze_notify(). In this case, the signal emissions are queued
|
|
2134
|
+
* and will be emitted (in reverse order) when g_object_thaw_notify() is
|
|
2135
|
+
* called.
|
|
2136
|
+
* @param property_name the name of a property installed on the class of @object.
|
|
2137
|
+
*/
|
|
2138
|
+
notify(property_name: string): void;
|
|
2139
|
+
/**
|
|
2140
|
+
* Emits a "notify" signal for the property specified by `pspec` on `object`.
|
|
2141
|
+
*
|
|
2142
|
+
* This function omits the property name lookup, hence it is faster than
|
|
2143
|
+
* g_object_notify().
|
|
2144
|
+
*
|
|
2145
|
+
* One way to avoid using g_object_notify() from within the
|
|
2146
|
+
* class that registered the properties, and using g_object_notify_by_pspec()
|
|
2147
|
+
* instead, is to store the GParamSpec used with
|
|
2148
|
+
* g_object_class_install_property() inside a static array, e.g.:
|
|
2149
|
+
*
|
|
2150
|
+
*
|
|
2151
|
+
* ```c
|
|
2152
|
+
* typedef enum
|
|
2153
|
+
* {
|
|
2154
|
+
* PROP_FOO = 1,
|
|
2155
|
+
* PROP_LAST
|
|
2156
|
+
* } MyObjectProperty;
|
|
2157
|
+
*
|
|
2158
|
+
* static GParamSpec *properties[PROP_LAST];
|
|
2159
|
+
*
|
|
2160
|
+
* static void
|
|
2161
|
+
* my_object_class_init (MyObjectClass *klass)
|
|
2162
|
+
* {
|
|
2163
|
+
* properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
|
|
2164
|
+
* 0, 100,
|
|
2165
|
+
* 50,
|
|
2166
|
+
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
|
2167
|
+
* g_object_class_install_property (gobject_class,
|
|
2168
|
+
* PROP_FOO,
|
|
2169
|
+
* properties[PROP_FOO]);
|
|
2170
|
+
* }
|
|
2171
|
+
* ```
|
|
2172
|
+
*
|
|
2173
|
+
*
|
|
2174
|
+
* and then notify a change on the "foo" property with:
|
|
2175
|
+
*
|
|
2176
|
+
*
|
|
2177
|
+
* ```c
|
|
2178
|
+
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
|
|
2179
|
+
* ```
|
|
2180
|
+
*
|
|
2181
|
+
* @param pspec the #GParamSpec of a property installed on the class of @object.
|
|
2182
|
+
*/
|
|
2183
|
+
notify_by_pspec(pspec: GObject.ParamSpec): void;
|
|
2184
|
+
/**
|
|
2185
|
+
* Increases the reference count of `object`.
|
|
2186
|
+
*
|
|
2187
|
+
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
|
|
2188
|
+
* of `object` will be propagated to the return type (using the GCC typeof()
|
|
2189
|
+
* extension), so any casting the caller needs to do on the return type must be
|
|
2190
|
+
* explicit.
|
|
2191
|
+
* @returns the same @object
|
|
2192
|
+
*/
|
|
2193
|
+
ref(): GObject.Object;
|
|
2194
|
+
/**
|
|
2195
|
+
* Increase the reference count of `object,` and possibly remove the
|
|
2196
|
+
* [floating][floating-ref] reference, if `object` has a floating reference.
|
|
2197
|
+
*
|
|
2198
|
+
* In other words, if the object is floating, then this call "assumes
|
|
2199
|
+
* ownership" of the floating reference, converting it to a normal
|
|
2200
|
+
* reference by clearing the floating flag while leaving the reference
|
|
2201
|
+
* count unchanged. If the object is not floating, then this call
|
|
2202
|
+
* adds a new normal reference increasing the reference count by one.
|
|
2203
|
+
*
|
|
2204
|
+
* Since GLib 2.56, the type of `object` will be propagated to the return type
|
|
2205
|
+
* under the same conditions as for g_object_ref().
|
|
2206
|
+
* @returns @object
|
|
2207
|
+
*/
|
|
2208
|
+
ref_sink(): GObject.Object;
|
|
2209
|
+
/**
|
|
2210
|
+
* Releases all references to other objects. This can be used to break
|
|
2211
|
+
* reference cycles.
|
|
2212
|
+
*
|
|
2213
|
+
* This function should only be called from object system implementations.
|
|
2214
|
+
*/
|
|
2215
|
+
run_dispose(): void;
|
|
2216
|
+
/**
|
|
2217
|
+
* Each object carries around a table of associations from
|
|
2218
|
+
* strings to pointers. This function lets you set an association.
|
|
2219
|
+
*
|
|
2220
|
+
* If the object already had an association with that name,
|
|
2221
|
+
* the old association will be destroyed.
|
|
2222
|
+
*
|
|
2223
|
+
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
|
|
2224
|
+
* This means a copy of `key` is kept permanently (even after `object` has been
|
|
2225
|
+
* finalized) — so it is recommended to only use a small, bounded set of values
|
|
2226
|
+
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
|
|
2227
|
+
* @param key name of the key
|
|
2228
|
+
* @param data data to associate with that key
|
|
2229
|
+
*/
|
|
2230
|
+
set_data(key: string, data?: any | null): void;
|
|
2231
|
+
set_property(property_name: string, value: any): void;
|
|
2232
|
+
/**
|
|
2233
|
+
* Remove a specified datum from the object's data associations,
|
|
2234
|
+
* without invoking the association's destroy handler.
|
|
2235
|
+
* @param key name of the key
|
|
2236
|
+
* @returns the data if found, or %NULL if no such data exists.
|
|
2237
|
+
*/
|
|
2238
|
+
steal_data(key: string): any | null;
|
|
2239
|
+
/**
|
|
2240
|
+
* This function gets back user data pointers stored via
|
|
2241
|
+
* g_object_set_qdata() and removes the `data` from object
|
|
2242
|
+
* without invoking its destroy() function (if any was
|
|
2243
|
+
* set).
|
|
2244
|
+
* Usually, calling this function is only required to update
|
|
2245
|
+
* user data pointers with a destroy notifier, for example:
|
|
2246
|
+
*
|
|
2247
|
+
* ```c
|
|
2248
|
+
* void
|
|
2249
|
+
* object_add_to_user_list (GObject *object,
|
|
2250
|
+
* const gchar *new_string)
|
|
2251
|
+
* {
|
|
2252
|
+
* // the quark, naming the object data
|
|
2253
|
+
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
|
|
2254
|
+
* // retrieve the old string list
|
|
2255
|
+
* GList *list = g_object_steal_qdata (object, quark_string_list);
|
|
2256
|
+
*
|
|
2257
|
+
* // prepend new string
|
|
2258
|
+
* list = g_list_prepend (list, g_strdup (new_string));
|
|
2259
|
+
* // this changed 'list', so we need to set it again
|
|
2260
|
+
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
|
|
2261
|
+
* }
|
|
2262
|
+
* static void
|
|
2263
|
+
* free_string_list (gpointer data)
|
|
2264
|
+
* {
|
|
2265
|
+
* GList *node, *list = data;
|
|
2266
|
+
*
|
|
2267
|
+
* for (node = list; node; node = node->next)
|
|
2268
|
+
* g_free (node->data);
|
|
2269
|
+
* g_list_free (list);
|
|
2270
|
+
* }
|
|
2271
|
+
* ```
|
|
2272
|
+
*
|
|
2273
|
+
* Using g_object_get_qdata() in the above example, instead of
|
|
2274
|
+
* g_object_steal_qdata() would have left the destroy function set,
|
|
2275
|
+
* and thus the partial string list would have been freed upon
|
|
2276
|
+
* g_object_set_qdata_full().
|
|
2277
|
+
* @param quark A #GQuark, naming the user data pointer
|
|
2278
|
+
* @returns The user data pointer set, or %NULL
|
|
2279
|
+
*/
|
|
2280
|
+
steal_qdata(quark: GLib.Quark): any | null;
|
|
2281
|
+
/**
|
|
2282
|
+
* Reverts the effect of a previous call to
|
|
2283
|
+
* g_object_freeze_notify(). The freeze count is decreased on `object`
|
|
2284
|
+
* and when it reaches zero, queued "notify" signals are emitted.
|
|
2285
|
+
*
|
|
2286
|
+
* Duplicate notifications for each property are squashed so that at most one
|
|
2287
|
+
* #GObject::notify signal is emitted for each property, in the reverse order
|
|
2288
|
+
* in which they have been queued.
|
|
2289
|
+
*
|
|
2290
|
+
* It is an error to call this function when the freeze count is zero.
|
|
2291
|
+
*/
|
|
2292
|
+
thaw_notify(): void;
|
|
2293
|
+
/**
|
|
2294
|
+
* Decreases the reference count of `object`. When its reference count
|
|
2295
|
+
* drops to 0, the object is finalized (i.e. its memory is freed).
|
|
2296
|
+
*
|
|
2297
|
+
* If the pointer to the #GObject may be reused in future (for example, if it is
|
|
2298
|
+
* an instance variable of another object), it is recommended to clear the
|
|
2299
|
+
* pointer to %NULL rather than retain a dangling pointer to a potentially
|
|
2300
|
+
* invalid #GObject instance. Use g_clear_object() for this.
|
|
2301
|
+
*/
|
|
2302
|
+
unref(): void;
|
|
2303
|
+
/**
|
|
2304
|
+
* This function essentially limits the life time of the `closure` to
|
|
2305
|
+
* the life time of the object. That is, when the object is finalized,
|
|
2306
|
+
* the `closure` is invalidated by calling g_closure_invalidate() on
|
|
2307
|
+
* it, in order to prevent invocations of the closure with a finalized
|
|
2308
|
+
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
|
|
2309
|
+
* added as marshal guards to the `closure,` to ensure that an extra
|
|
2310
|
+
* reference count is held on `object` during invocation of the
|
|
2311
|
+
* `closure`. Usually, this function will be called on closures that
|
|
2312
|
+
* use this `object` as closure data.
|
|
2313
|
+
* @param closure #GClosure to watch
|
|
2314
|
+
*/
|
|
2315
|
+
watch_closure(closure: GObject.Closure): void;
|
|
2316
|
+
vfunc_constructed(): void;
|
|
2317
|
+
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
|
|
2318
|
+
vfunc_dispose(): void;
|
|
2319
|
+
vfunc_finalize(): void;
|
|
2320
|
+
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
|
|
2321
|
+
/**
|
|
2322
|
+
* Emits a "notify" signal for the property `property_name` on `object`.
|
|
2323
|
+
*
|
|
2324
|
+
* When possible, eg. when signaling a property change from within the class
|
|
2325
|
+
* that registered the property, you should use g_object_notify_by_pspec()
|
|
2326
|
+
* instead.
|
|
2327
|
+
*
|
|
2328
|
+
* Note that emission of the notify signal may be blocked with
|
|
2329
|
+
* g_object_freeze_notify(). In this case, the signal emissions are queued
|
|
2330
|
+
* and will be emitted (in reverse order) when g_object_thaw_notify() is
|
|
2331
|
+
* called.
|
|
2332
|
+
* @param pspec
|
|
2333
|
+
*/
|
|
2334
|
+
vfunc_notify(pspec: GObject.ParamSpec): void;
|
|
2335
|
+
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
|
|
2336
|
+
disconnect(id: number): void;
|
|
2337
|
+
set(properties: { [key: string]: any }): void;
|
|
2338
|
+
block_signal_handler(id: number): any;
|
|
2339
|
+
unblock_signal_handler(id: number): any;
|
|
2340
|
+
stop_emission_by_name(detailedName: string): any;
|
|
2341
|
+
}
|
|
2342
|
+
|
|
2343
|
+
module MenuSeparator {
|
|
2344
|
+
// Constructor properties interface
|
|
2345
|
+
|
|
2346
|
+
interface ConstructorProps extends GObject.Object.ConstructorProps, MenuElement.ConstructorProps {}
|
|
2347
|
+
}
|
|
2348
|
+
|
|
2349
|
+
class MenuSeparator extends GObject.Object implements MenuElement {
|
|
2350
|
+
static $gtype: GObject.GType<MenuSeparator>;
|
|
2351
|
+
|
|
2352
|
+
// Constructors of Garcon.MenuSeparator
|
|
2353
|
+
|
|
2354
|
+
constructor(properties?: Partial<MenuSeparator.ConstructorProps>, ...args: any[]);
|
|
2355
|
+
|
|
2356
|
+
_init(...args: any[]): void;
|
|
2357
|
+
|
|
2358
|
+
static get_default(): MenuSeparator;
|
|
2359
|
+
|
|
2360
|
+
// Inherited methods
|
|
2361
|
+
equal(b: MenuElement): boolean;
|
|
2362
|
+
get_comment(): string;
|
|
2363
|
+
get_icon_name(): string;
|
|
2364
|
+
get_name(): string;
|
|
2365
|
+
get_no_display(): boolean;
|
|
2366
|
+
get_show_in_environment(): boolean;
|
|
2367
|
+
get_visible(): boolean;
|
|
2368
|
+
vfunc_equal(other: MenuElement): boolean;
|
|
2369
|
+
vfunc_get_comment(): string;
|
|
2370
|
+
vfunc_get_icon_name(): string;
|
|
2371
|
+
vfunc_get_name(): string;
|
|
2372
|
+
vfunc_get_no_display(): boolean;
|
|
2373
|
+
vfunc_get_show_in_environment(): boolean;
|
|
2374
|
+
vfunc_get_visible(): boolean;
|
|
2375
|
+
/**
|
|
2376
|
+
* Creates a binding between `source_property` on `source` and `target_property`
|
|
2377
|
+
* on `target`.
|
|
2378
|
+
*
|
|
2379
|
+
* Whenever the `source_property` is changed the `target_property` is
|
|
2380
|
+
* updated using the same value. For instance:
|
|
2381
|
+
*
|
|
2382
|
+
*
|
|
2383
|
+
* ```c
|
|
2384
|
+
* g_object_bind_property (action, "active", widget, "sensitive", 0);
|
|
2385
|
+
* ```
|
|
2386
|
+
*
|
|
2387
|
+
*
|
|
2388
|
+
* Will result in the "sensitive" property of the widget #GObject instance to be
|
|
2389
|
+
* updated with the same value of the "active" property of the action #GObject
|
|
2390
|
+
* instance.
|
|
2391
|
+
*
|
|
2392
|
+
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
|
|
2393
|
+
* if `target_property` on `target` changes then the `source_property` on `source`
|
|
2394
|
+
* will be updated as well.
|
|
2395
|
+
*
|
|
2396
|
+
* The binding will automatically be removed when either the `source` or the
|
|
2397
|
+
* `target` instances are finalized. To remove the binding without affecting the
|
|
2398
|
+
* `source` and the `target` you can just call g_object_unref() on the returned
|
|
2399
|
+
* #GBinding instance.
|
|
2400
|
+
*
|
|
2401
|
+
* Removing the binding by calling g_object_unref() on it must only be done if
|
|
2402
|
+
* the binding, `source` and `target` are only used from a single thread and it
|
|
2403
|
+
* is clear that both `source` and `target` outlive the binding. Especially it
|
|
2404
|
+
* is not safe to rely on this if the binding, `source` or `target` can be
|
|
2405
|
+
* finalized from different threads. Keep another reference to the binding and
|
|
2406
|
+
* use g_binding_unbind() instead to be on the safe side.
|
|
2407
|
+
*
|
|
2408
|
+
* A #GObject can have multiple bindings.
|
|
2409
|
+
* @param source_property the property on @source to bind
|
|
2410
|
+
* @param target the target #GObject
|
|
2411
|
+
* @param target_property the property on @target to bind
|
|
2412
|
+
* @param flags flags to pass to #GBinding
|
|
2413
|
+
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
|
|
2414
|
+
*/
|
|
2415
|
+
bind_property(
|
|
2416
|
+
source_property: string,
|
|
2417
|
+
target: GObject.Object,
|
|
2418
|
+
target_property: string,
|
|
2419
|
+
flags: GObject.BindingFlags,
|
|
2420
|
+
): GObject.Binding;
|
|
2421
|
+
/**
|
|
2422
|
+
* Complete version of g_object_bind_property().
|
|
2423
|
+
*
|
|
2424
|
+
* Creates a binding between `source_property` on `source` and `target_property`
|
|
2425
|
+
* on `target,` allowing you to set the transformation functions to be used by
|
|
2426
|
+
* the binding.
|
|
2427
|
+
*
|
|
2428
|
+
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
|
|
2429
|
+
* if `target_property` on `target` changes then the `source_property` on `source`
|
|
2430
|
+
* will be updated as well. The `transform_from` function is only used in case
|
|
2431
|
+
* of bidirectional bindings, otherwise it will be ignored
|
|
2432
|
+
*
|
|
2433
|
+
* The binding will automatically be removed when either the `source` or the
|
|
2434
|
+
* `target` instances are finalized. This will release the reference that is
|
|
2435
|
+
* being held on the #GBinding instance; if you want to hold on to the
|
|
2436
|
+
* #GBinding instance, you will need to hold a reference to it.
|
|
2437
|
+
*
|
|
2438
|
+
* To remove the binding, call g_binding_unbind().
|
|
2439
|
+
*
|
|
2440
|
+
* A #GObject can have multiple bindings.
|
|
2441
|
+
*
|
|
2442
|
+
* The same `user_data` parameter will be used for both `transform_to`
|
|
2443
|
+
* and `transform_from` transformation functions; the `notify` function will
|
|
2444
|
+
* be called once, when the binding is removed. If you need different data
|
|
2445
|
+
* for each transformation function, please use
|
|
2446
|
+
* g_object_bind_property_with_closures() instead.
|
|
2447
|
+
* @param source_property the property on @source to bind
|
|
2448
|
+
* @param target the target #GObject
|
|
2449
|
+
* @param target_property the property on @target to bind
|
|
2450
|
+
* @param flags flags to pass to #GBinding
|
|
2451
|
+
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
|
|
2452
|
+
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
|
|
2453
|
+
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
|
|
2454
|
+
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
|
|
2455
|
+
*/
|
|
2456
|
+
bind_property_full(
|
|
2457
|
+
source_property: string,
|
|
2458
|
+
target: GObject.Object,
|
|
2459
|
+
target_property: string,
|
|
2460
|
+
flags: GObject.BindingFlags,
|
|
2461
|
+
transform_to?: GObject.BindingTransformFunc | null,
|
|
2462
|
+
transform_from?: GObject.BindingTransformFunc | null,
|
|
2463
|
+
notify?: GLib.DestroyNotify | null,
|
|
2464
|
+
): GObject.Binding;
|
|
2465
|
+
// Conflicted with GObject.Object.bind_property_full
|
|
2466
|
+
bind_property_full(...args: never[]): any;
|
|
2467
|
+
/**
|
|
2468
|
+
* This function is intended for #GObject implementations to re-enforce
|
|
2469
|
+
* a [floating][floating-ref] object reference. Doing this is seldom
|
|
2470
|
+
* required: all #GInitiallyUnowneds are created with a floating reference
|
|
2471
|
+
* which usually just needs to be sunken by calling g_object_ref_sink().
|
|
2472
|
+
*/
|
|
2473
|
+
force_floating(): void;
|
|
2474
|
+
/**
|
|
2475
|
+
* Increases the freeze count on `object`. If the freeze count is
|
|
2476
|
+
* non-zero, the emission of "notify" signals on `object` is
|
|
2477
|
+
* stopped. The signals are queued until the freeze count is decreased
|
|
2478
|
+
* to zero. Duplicate notifications are squashed so that at most one
|
|
2479
|
+
* #GObject::notify signal is emitted for each property modified while the
|
|
2480
|
+
* object is frozen.
|
|
2481
|
+
*
|
|
2482
|
+
* This is necessary for accessors that modify multiple properties to prevent
|
|
2483
|
+
* premature notification while the object is still being modified.
|
|
2484
|
+
*/
|
|
2485
|
+
freeze_notify(): void;
|
|
2486
|
+
/**
|
|
2487
|
+
* Gets a named field from the objects table of associations (see g_object_set_data()).
|
|
2488
|
+
* @param key name of the key for that association
|
|
2489
|
+
* @returns the data if found, or %NULL if no such data exists.
|
|
2490
|
+
*/
|
|
2491
|
+
get_data(key: string): any | null;
|
|
2492
|
+
get_property(property_name: string): any;
|
|
2493
|
+
/**
|
|
2494
|
+
* This function gets back user data pointers stored via
|
|
2495
|
+
* g_object_set_qdata().
|
|
2496
|
+
* @param quark A #GQuark, naming the user data pointer
|
|
2497
|
+
* @returns The user data pointer set, or %NULL
|
|
2498
|
+
*/
|
|
2499
|
+
get_qdata(quark: GLib.Quark): any | null;
|
|
2500
|
+
/**
|
|
2501
|
+
* Gets `n_properties` properties for an `object`.
|
|
2502
|
+
* Obtained properties will be set to `values`. All properties must be valid.
|
|
2503
|
+
* Warnings will be emitted and undefined behaviour may result if invalid
|
|
2504
|
+
* properties are passed in.
|
|
2505
|
+
* @param names the names of each property to get
|
|
2506
|
+
* @param values the values of each property to get
|
|
2507
|
+
*/
|
|
2508
|
+
getv(names: string[], values: (GObject.Value | any)[]): void;
|
|
2509
|
+
/**
|
|
2510
|
+
* Checks whether `object` has a [floating][floating-ref] reference.
|
|
2511
|
+
* @returns %TRUE if @object has a floating reference
|
|
2512
|
+
*/
|
|
2513
|
+
is_floating(): boolean;
|
|
2514
|
+
/**
|
|
2515
|
+
* Emits a "notify" signal for the property `property_name` on `object`.
|
|
2516
|
+
*
|
|
2517
|
+
* When possible, eg. when signaling a property change from within the class
|
|
2518
|
+
* that registered the property, you should use g_object_notify_by_pspec()
|
|
2519
|
+
* instead.
|
|
2520
|
+
*
|
|
2521
|
+
* Note that emission of the notify signal may be blocked with
|
|
2522
|
+
* g_object_freeze_notify(). In this case, the signal emissions are queued
|
|
2523
|
+
* and will be emitted (in reverse order) when g_object_thaw_notify() is
|
|
2524
|
+
* called.
|
|
2525
|
+
* @param property_name the name of a property installed on the class of @object.
|
|
2526
|
+
*/
|
|
2527
|
+
notify(property_name: string): void;
|
|
2528
|
+
/**
|
|
2529
|
+
* Emits a "notify" signal for the property specified by `pspec` on `object`.
|
|
2530
|
+
*
|
|
2531
|
+
* This function omits the property name lookup, hence it is faster than
|
|
2532
|
+
* g_object_notify().
|
|
2533
|
+
*
|
|
2534
|
+
* One way to avoid using g_object_notify() from within the
|
|
2535
|
+
* class that registered the properties, and using g_object_notify_by_pspec()
|
|
2536
|
+
* instead, is to store the GParamSpec used with
|
|
2537
|
+
* g_object_class_install_property() inside a static array, e.g.:
|
|
2538
|
+
*
|
|
2539
|
+
*
|
|
2540
|
+
* ```c
|
|
2541
|
+
* typedef enum
|
|
2542
|
+
* {
|
|
2543
|
+
* PROP_FOO = 1,
|
|
2544
|
+
* PROP_LAST
|
|
2545
|
+
* } MyObjectProperty;
|
|
2546
|
+
*
|
|
2547
|
+
* static GParamSpec *properties[PROP_LAST];
|
|
2548
|
+
*
|
|
2549
|
+
* static void
|
|
2550
|
+
* my_object_class_init (MyObjectClass *klass)
|
|
2551
|
+
* {
|
|
2552
|
+
* properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
|
|
2553
|
+
* 0, 100,
|
|
2554
|
+
* 50,
|
|
2555
|
+
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
|
2556
|
+
* g_object_class_install_property (gobject_class,
|
|
2557
|
+
* PROP_FOO,
|
|
2558
|
+
* properties[PROP_FOO]);
|
|
2559
|
+
* }
|
|
2560
|
+
* ```
|
|
2561
|
+
*
|
|
2562
|
+
*
|
|
2563
|
+
* and then notify a change on the "foo" property with:
|
|
2564
|
+
*
|
|
2565
|
+
*
|
|
2566
|
+
* ```c
|
|
2567
|
+
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
|
|
2568
|
+
* ```
|
|
2569
|
+
*
|
|
2570
|
+
* @param pspec the #GParamSpec of a property installed on the class of @object.
|
|
2571
|
+
*/
|
|
2572
|
+
notify_by_pspec(pspec: GObject.ParamSpec): void;
|
|
2573
|
+
/**
|
|
2574
|
+
* Increases the reference count of `object`.
|
|
2575
|
+
*
|
|
2576
|
+
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
|
|
2577
|
+
* of `object` will be propagated to the return type (using the GCC typeof()
|
|
2578
|
+
* extension), so any casting the caller needs to do on the return type must be
|
|
2579
|
+
* explicit.
|
|
2580
|
+
* @returns the same @object
|
|
2581
|
+
*/
|
|
2582
|
+
ref(): GObject.Object;
|
|
2583
|
+
/**
|
|
2584
|
+
* Increase the reference count of `object,` and possibly remove the
|
|
2585
|
+
* [floating][floating-ref] reference, if `object` has a floating reference.
|
|
2586
|
+
*
|
|
2587
|
+
* In other words, if the object is floating, then this call "assumes
|
|
2588
|
+
* ownership" of the floating reference, converting it to a normal
|
|
2589
|
+
* reference by clearing the floating flag while leaving the reference
|
|
2590
|
+
* count unchanged. If the object is not floating, then this call
|
|
2591
|
+
* adds a new normal reference increasing the reference count by one.
|
|
2592
|
+
*
|
|
2593
|
+
* Since GLib 2.56, the type of `object` will be propagated to the return type
|
|
2594
|
+
* under the same conditions as for g_object_ref().
|
|
2595
|
+
* @returns @object
|
|
2596
|
+
*/
|
|
2597
|
+
ref_sink(): GObject.Object;
|
|
2598
|
+
/**
|
|
2599
|
+
* Releases all references to other objects. This can be used to break
|
|
2600
|
+
* reference cycles.
|
|
2601
|
+
*
|
|
2602
|
+
* This function should only be called from object system implementations.
|
|
2603
|
+
*/
|
|
2604
|
+
run_dispose(): void;
|
|
2605
|
+
/**
|
|
2606
|
+
* Each object carries around a table of associations from
|
|
2607
|
+
* strings to pointers. This function lets you set an association.
|
|
2608
|
+
*
|
|
2609
|
+
* If the object already had an association with that name,
|
|
2610
|
+
* the old association will be destroyed.
|
|
2611
|
+
*
|
|
2612
|
+
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
|
|
2613
|
+
* This means a copy of `key` is kept permanently (even after `object` has been
|
|
2614
|
+
* finalized) — so it is recommended to only use a small, bounded set of values
|
|
2615
|
+
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
|
|
2616
|
+
* @param key name of the key
|
|
2617
|
+
* @param data data to associate with that key
|
|
2618
|
+
*/
|
|
2619
|
+
set_data(key: string, data?: any | null): void;
|
|
2620
|
+
set_property(property_name: string, value: any): void;
|
|
2621
|
+
/**
|
|
2622
|
+
* Remove a specified datum from the object's data associations,
|
|
2623
|
+
* without invoking the association's destroy handler.
|
|
2624
|
+
* @param key name of the key
|
|
2625
|
+
* @returns the data if found, or %NULL if no such data exists.
|
|
2626
|
+
*/
|
|
2627
|
+
steal_data(key: string): any | null;
|
|
2628
|
+
/**
|
|
2629
|
+
* This function gets back user data pointers stored via
|
|
2630
|
+
* g_object_set_qdata() and removes the `data` from object
|
|
2631
|
+
* without invoking its destroy() function (if any was
|
|
2632
|
+
* set).
|
|
2633
|
+
* Usually, calling this function is only required to update
|
|
2634
|
+
* user data pointers with a destroy notifier, for example:
|
|
2635
|
+
*
|
|
2636
|
+
* ```c
|
|
2637
|
+
* void
|
|
2638
|
+
* object_add_to_user_list (GObject *object,
|
|
2639
|
+
* const gchar *new_string)
|
|
2640
|
+
* {
|
|
2641
|
+
* // the quark, naming the object data
|
|
2642
|
+
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
|
|
2643
|
+
* // retrieve the old string list
|
|
2644
|
+
* GList *list = g_object_steal_qdata (object, quark_string_list);
|
|
2645
|
+
*
|
|
2646
|
+
* // prepend new string
|
|
2647
|
+
* list = g_list_prepend (list, g_strdup (new_string));
|
|
2648
|
+
* // this changed 'list', so we need to set it again
|
|
2649
|
+
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
|
|
2650
|
+
* }
|
|
2651
|
+
* static void
|
|
2652
|
+
* free_string_list (gpointer data)
|
|
2653
|
+
* {
|
|
2654
|
+
* GList *node, *list = data;
|
|
2655
|
+
*
|
|
2656
|
+
* for (node = list; node; node = node->next)
|
|
2657
|
+
* g_free (node->data);
|
|
2658
|
+
* g_list_free (list);
|
|
2659
|
+
* }
|
|
2660
|
+
* ```
|
|
2661
|
+
*
|
|
2662
|
+
* Using g_object_get_qdata() in the above example, instead of
|
|
2663
|
+
* g_object_steal_qdata() would have left the destroy function set,
|
|
2664
|
+
* and thus the partial string list would have been freed upon
|
|
2665
|
+
* g_object_set_qdata_full().
|
|
2666
|
+
* @param quark A #GQuark, naming the user data pointer
|
|
2667
|
+
* @returns The user data pointer set, or %NULL
|
|
2668
|
+
*/
|
|
2669
|
+
steal_qdata(quark: GLib.Quark): any | null;
|
|
2670
|
+
/**
|
|
2671
|
+
* Reverts the effect of a previous call to
|
|
2672
|
+
* g_object_freeze_notify(). The freeze count is decreased on `object`
|
|
2673
|
+
* and when it reaches zero, queued "notify" signals are emitted.
|
|
2674
|
+
*
|
|
2675
|
+
* Duplicate notifications for each property are squashed so that at most one
|
|
2676
|
+
* #GObject::notify signal is emitted for each property, in the reverse order
|
|
2677
|
+
* in which they have been queued.
|
|
2678
|
+
*
|
|
2679
|
+
* It is an error to call this function when the freeze count is zero.
|
|
2680
|
+
*/
|
|
2681
|
+
thaw_notify(): void;
|
|
2682
|
+
/**
|
|
2683
|
+
* Decreases the reference count of `object`. When its reference count
|
|
2684
|
+
* drops to 0, the object is finalized (i.e. its memory is freed).
|
|
2685
|
+
*
|
|
2686
|
+
* If the pointer to the #GObject may be reused in future (for example, if it is
|
|
2687
|
+
* an instance variable of another object), it is recommended to clear the
|
|
2688
|
+
* pointer to %NULL rather than retain a dangling pointer to a potentially
|
|
2689
|
+
* invalid #GObject instance. Use g_clear_object() for this.
|
|
2690
|
+
*/
|
|
2691
|
+
unref(): void;
|
|
2692
|
+
/**
|
|
2693
|
+
* This function essentially limits the life time of the `closure` to
|
|
2694
|
+
* the life time of the object. That is, when the object is finalized,
|
|
2695
|
+
* the `closure` is invalidated by calling g_closure_invalidate() on
|
|
2696
|
+
* it, in order to prevent invocations of the closure with a finalized
|
|
2697
|
+
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
|
|
2698
|
+
* added as marshal guards to the `closure,` to ensure that an extra
|
|
2699
|
+
* reference count is held on `object` during invocation of the
|
|
2700
|
+
* `closure`. Usually, this function will be called on closures that
|
|
2701
|
+
* use this `object` as closure data.
|
|
2702
|
+
* @param closure #GClosure to watch
|
|
2703
|
+
*/
|
|
2704
|
+
watch_closure(closure: GObject.Closure): void;
|
|
2705
|
+
vfunc_constructed(): void;
|
|
2706
|
+
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
|
|
2707
|
+
vfunc_dispose(): void;
|
|
2708
|
+
vfunc_finalize(): void;
|
|
2709
|
+
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
|
|
2710
|
+
/**
|
|
2711
|
+
* Emits a "notify" signal for the property `property_name` on `object`.
|
|
2712
|
+
*
|
|
2713
|
+
* When possible, eg. when signaling a property change from within the class
|
|
2714
|
+
* that registered the property, you should use g_object_notify_by_pspec()
|
|
2715
|
+
* instead.
|
|
2716
|
+
*
|
|
2717
|
+
* Note that emission of the notify signal may be blocked with
|
|
2718
|
+
* g_object_freeze_notify(). In this case, the signal emissions are queued
|
|
2719
|
+
* and will be emitted (in reverse order) when g_object_thaw_notify() is
|
|
2720
|
+
* called.
|
|
2721
|
+
* @param pspec
|
|
2722
|
+
*/
|
|
2723
|
+
vfunc_notify(pspec: GObject.ParamSpec): void;
|
|
2724
|
+
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
|
|
2725
|
+
disconnect(id: number): void;
|
|
2726
|
+
set(properties: { [key: string]: any }): void;
|
|
2727
|
+
block_signal_handler(id: number): any;
|
|
2728
|
+
unblock_signal_handler(id: number): any;
|
|
2729
|
+
stop_emission_by_name(detailedName: string): any;
|
|
2730
|
+
}
|
|
2731
|
+
|
|
2732
|
+
type MenuClass = typeof Menu;
|
|
2733
|
+
type MenuDirectoryClass = typeof MenuDirectory;
|
|
2734
|
+
abstract class MenuDirectoryPrivate {
|
|
2735
|
+
static $gtype: GObject.GType<MenuDirectoryPrivate>;
|
|
2736
|
+
|
|
2737
|
+
// Constructors of Garcon.MenuDirectoryPrivate
|
|
2738
|
+
|
|
2739
|
+
_init(...args: any[]): void;
|
|
2740
|
+
}
|
|
2741
|
+
|
|
2742
|
+
type MenuElementIface = typeof MenuElement;
|
|
2743
|
+
type MenuItemActionClass = typeof MenuItemAction;
|
|
2744
|
+
abstract class MenuItemActionPrivate {
|
|
2745
|
+
static $gtype: GObject.GType<MenuItemActionPrivate>;
|
|
2746
|
+
|
|
2747
|
+
// Constructors of Garcon.MenuItemActionPrivate
|
|
2748
|
+
|
|
2749
|
+
_init(...args: any[]): void;
|
|
2750
|
+
}
|
|
2751
|
+
|
|
2752
|
+
type MenuItemCacheClass = typeof MenuItemCache;
|
|
2753
|
+
abstract class MenuItemCachePrivate {
|
|
2754
|
+
static $gtype: GObject.GType<MenuItemCachePrivate>;
|
|
2755
|
+
|
|
2756
|
+
// Constructors of Garcon.MenuItemCachePrivate
|
|
2757
|
+
|
|
2758
|
+
_init(...args: any[]): void;
|
|
2759
|
+
}
|
|
2760
|
+
|
|
2761
|
+
type MenuItemClass = typeof MenuItem;
|
|
2762
|
+
type MenuItemPoolClass = typeof MenuItemPool;
|
|
2763
|
+
abstract class MenuItemPoolPrivate {
|
|
2764
|
+
static $gtype: GObject.GType<MenuItemPoolPrivate>;
|
|
2765
|
+
|
|
2766
|
+
// Constructors of Garcon.MenuItemPoolPrivate
|
|
2767
|
+
|
|
2768
|
+
_init(...args: any[]): void;
|
|
2769
|
+
}
|
|
2770
|
+
|
|
2771
|
+
abstract class MenuItemPrivate {
|
|
2772
|
+
static $gtype: GObject.GType<MenuItemPrivate>;
|
|
2773
|
+
|
|
2774
|
+
// Constructors of Garcon.MenuItemPrivate
|
|
2775
|
+
|
|
2776
|
+
_init(...args: any[]): void;
|
|
2777
|
+
}
|
|
2778
|
+
|
|
2779
|
+
type MenuMergerClass = typeof MenuMerger;
|
|
2780
|
+
abstract class MenuMergerPrivate {
|
|
2781
|
+
static $gtype: GObject.GType<MenuMergerPrivate>;
|
|
2782
|
+
|
|
2783
|
+
// Constructors of Garcon.MenuMergerPrivate
|
|
2784
|
+
|
|
2785
|
+
_init(...args: any[]): void;
|
|
2786
|
+
}
|
|
2787
|
+
|
|
2788
|
+
type MenuNodeClass = typeof MenuNode;
|
|
2789
|
+
type MenuParserClass = typeof MenuParser;
|
|
2790
|
+
abstract class MenuParserPrivate {
|
|
2791
|
+
static $gtype: GObject.GType<MenuParserPrivate>;
|
|
2792
|
+
|
|
2793
|
+
// Constructors of Garcon.MenuParserPrivate
|
|
2794
|
+
|
|
2795
|
+
_init(...args: any[]): void;
|
|
2796
|
+
}
|
|
2797
|
+
|
|
2798
|
+
abstract class MenuPrivate {
|
|
2799
|
+
static $gtype: GObject.GType<MenuPrivate>;
|
|
2800
|
+
|
|
2801
|
+
// Constructors of Garcon.MenuPrivate
|
|
2802
|
+
|
|
2803
|
+
_init(...args: any[]): void;
|
|
2804
|
+
}
|
|
2805
|
+
|
|
2806
|
+
type MenuSeparatorClass = typeof MenuSeparator;
|
|
2807
|
+
type MenuTreeProviderIface = typeof MenuTreeProvider;
|
|
2808
|
+
class MenuNodeData {
|
|
2809
|
+
static $gtype: GObject.GType<MenuNodeData>;
|
|
2810
|
+
|
|
2811
|
+
// Constructors of Garcon.MenuNodeData
|
|
2812
|
+
|
|
2813
|
+
_init(...args: any[]): void;
|
|
2814
|
+
}
|
|
2815
|
+
|
|
2816
|
+
module MenuElement {
|
|
2817
|
+
// Constructor properties interface
|
|
2818
|
+
|
|
2819
|
+
interface ConstructorProps extends GObject.Object.ConstructorProps {}
|
|
2820
|
+
}
|
|
2821
|
+
|
|
2822
|
+
export interface MenuElementNamespace {
|
|
2823
|
+
$gtype: GObject.GType<MenuElement>;
|
|
2824
|
+
prototype: MenuElement;
|
|
2825
|
+
}
|
|
2826
|
+
interface MenuElement extends GObject.Object {
|
|
2827
|
+
// Own methods of Garcon.MenuElement
|
|
2828
|
+
|
|
2829
|
+
equal(b: MenuElement): boolean;
|
|
2830
|
+
get_comment(): string;
|
|
2831
|
+
get_icon_name(): string;
|
|
2832
|
+
get_name(): string;
|
|
2833
|
+
get_no_display(): boolean;
|
|
2834
|
+
get_show_in_environment(): boolean;
|
|
2835
|
+
get_visible(): boolean;
|
|
2836
|
+
|
|
2837
|
+
// Own virtual methods of Garcon.MenuElement
|
|
2838
|
+
|
|
2839
|
+
vfunc_equal(other: MenuElement): boolean;
|
|
2840
|
+
vfunc_get_comment(): string;
|
|
2841
|
+
vfunc_get_icon_name(): string;
|
|
2842
|
+
vfunc_get_name(): string;
|
|
2843
|
+
vfunc_get_no_display(): boolean;
|
|
2844
|
+
vfunc_get_show_in_environment(): boolean;
|
|
2845
|
+
vfunc_get_visible(): boolean;
|
|
2846
|
+
}
|
|
2847
|
+
|
|
2848
|
+
export const MenuElement: MenuElementNamespace;
|
|
2849
|
+
|
|
2850
|
+
module MenuTreeProvider {
|
|
2851
|
+
// Constructor properties interface
|
|
2852
|
+
|
|
2853
|
+
interface ConstructorProps extends GObject.Object.ConstructorProps {}
|
|
2854
|
+
}
|
|
2855
|
+
|
|
2856
|
+
export interface MenuTreeProviderNamespace {
|
|
2857
|
+
$gtype: GObject.GType<MenuTreeProvider>;
|
|
2858
|
+
prototype: MenuTreeProvider;
|
|
2859
|
+
}
|
|
2860
|
+
interface MenuTreeProvider extends GObject.Object {
|
|
2861
|
+
// Own methods of Garcon.MenuTreeProvider
|
|
2862
|
+
|
|
2863
|
+
get_file(): Gio.File;
|
|
2864
|
+
|
|
2865
|
+
// Own virtual methods of Garcon.MenuTreeProvider
|
|
2866
|
+
|
|
2867
|
+
vfunc_get_file(): Gio.File;
|
|
2868
|
+
}
|
|
2869
|
+
|
|
2870
|
+
export const MenuTreeProvider: MenuTreeProviderNamespace;
|
|
2871
|
+
|
|
2872
|
+
/**
|
|
2873
|
+
* Name of the imported GIR library
|
|
2874
|
+
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
|
|
2875
|
+
*/
|
|
2876
|
+
const __name__: string;
|
|
2877
|
+
/**
|
|
2878
|
+
* Version of the imported GIR library
|
|
2879
|
+
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
|
|
2880
|
+
*/
|
|
2881
|
+
const __version__: string;
|
|
2882
|
+
}
|
|
2883
|
+
|
|
2884
|
+
export default Garcon;
|
|
2885
|
+
// END
|