@girs/dbusmenu-0.4 0.4.0-3.0.0-beta.12

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.
@@ -0,0 +1,1545 @@
1
+
2
+ /*
3
+ * Type Definitions for Gjs (https://gjs.guide/)
4
+ *
5
+ * These type definitions are automatically generated, do not edit them by hand.
6
+ * If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gjs
7
+ */
8
+ /**
9
+ * Dbusmenu-0.4
10
+ */
11
+
12
+ import type GObject from '@girs/gobject-2.0';
13
+ import type GLib from '@girs/glib-2.0';
14
+
15
+ /**
16
+ * Tracks how the menus should be presented to the user.
17
+ */
18
+ export enum Status {
19
+ /**
20
+ * Everything is normal
21
+ */
22
+ NORMAL,
23
+ /**
24
+ * The menus should be shown at a higher priority
25
+ */
26
+ NOTICE,
27
+ }
28
+ /**
29
+ * The direction of text that the strings that this server
30
+ * will be sending strings as.
31
+ */
32
+ export enum TextDirection {
33
+ /**
34
+ * Unspecified text direction
35
+ */
36
+ NONE,
37
+ /**
38
+ * Left-to-right text direction
39
+ */
40
+ LTR,
41
+ /**
42
+ * Right-to-left text direction
43
+ */
44
+ RTL,
45
+ }
46
+ /**
47
+ * String to access property #DbusmenuClient:dbus-name
48
+ */
49
+ export const CLIENT_PROP_DBUS_NAME: string | null
50
+ /**
51
+ * String to access property #DbusmenuClient:dbus-object
52
+ */
53
+ export const CLIENT_PROP_DBUS_OBJECT: string | null
54
+ /**
55
+ * String to access property #DbusmenuClient:group-events
56
+ */
57
+ export const CLIENT_PROP_GROUP_EVENTS: string | null
58
+ /**
59
+ * String to access property #DbusmenuClient:status
60
+ */
61
+ export const CLIENT_PROP_STATUS: string | null
62
+ /**
63
+ * String to access property #DbusmenuClient:text-direction
64
+ */
65
+ export const CLIENT_PROP_TEXT_DIRECTION: string | null
66
+ /**
67
+ * String to attach to signal #DbusmenuClient::event-result
68
+ */
69
+ export const CLIENT_SIGNAL_EVENT_RESULT: string | null
70
+ /**
71
+ * String to attach to signal #DbusmenuClient::icon-theme-dirs-changed
72
+ */
73
+ export const CLIENT_SIGNAL_ICON_THEME_DIRS_CHANGED: string | null
74
+ /**
75
+ * String to attach to signal #DbusmenuClient::item-activate
76
+ */
77
+ export const CLIENT_SIGNAL_ITEM_ACTIVATE: string | null
78
+ /**
79
+ * String to attach to signal #DbusmenuClient::layout-updated
80
+ */
81
+ export const CLIENT_SIGNAL_LAYOUT_UPDATED: string | null
82
+ /**
83
+ * String to attach to signal #DbusmenuClient::new-menuitem
84
+ */
85
+ export const CLIENT_SIGNAL_NEW_MENUITEM: string | null
86
+ /**
87
+ * String to attach to signal #DbusmenuClient::root-changed
88
+ */
89
+ export const CLIENT_SIGNAL_ROOT_CHANGED: string | null
90
+ /**
91
+ * Used to set the 'type' property on a menu item to create
92
+ * a standard menu item.
93
+ */
94
+ export const CLIENT_TYPES_DEFAULT: string | null
95
+ /**
96
+ * Used to set the 'type' property on a menu item to create
97
+ * an image menu item. Deprecated as standard menu items now
98
+ * support images as well.
99
+ */
100
+ export const CLIENT_TYPES_IMAGE: string | null
101
+ /**
102
+ * Used to set the 'type' property on a menu item to create
103
+ * a separator menu item.
104
+ */
105
+ export const CLIENT_TYPES_SEPARATOR: string | null
106
+ /**
107
+ * Used in #DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY to have the
108
+ * subitems displayed as a submenu.
109
+ */
110
+ export const MENUITEM_CHILD_DISPLAY_SUBMENU: string | null
111
+ /**
112
+ * Used in #DBUSMENU_MENUITEM_PROP_DISPOSITION to have a menu
113
+ * item displayed in a way that conveys it's giving an alert
114
+ * to the user.
115
+ */
116
+ export const MENUITEM_DISPOSITION_ALERT: string | null
117
+ /**
118
+ * Used in #DBUSMENU_MENUITEM_PROP_DISPOSITION to have a menu
119
+ * item displayed in a way that conveys it's giving additional
120
+ * information to the user.
121
+ */
122
+ export const MENUITEM_DISPOSITION_INFORMATIVE: string | null
123
+ /**
124
+ * Used in #DBUSMENU_MENUITEM_PROP_DISPOSITION to have a menu
125
+ * item displayed in the normal manner. Default value.
126
+ */
127
+ export const MENUITEM_DISPOSITION_NORMAL: string | null
128
+ /**
129
+ * Used in #DBUSMENU_MENUITEM_PROP_DISPOSITION to have a menu
130
+ * item displayed in a way that conveys it's giving a warning
131
+ * to the user.
132
+ */
133
+ export const MENUITEM_DISPOSITION_WARNING: string | null
134
+ /**
135
+ * String for the event identifier when a menu item is clicked
136
+ * on by the user.
137
+ */
138
+ export const MENUITEM_EVENT_ACTIVATED: string | null
139
+ /**
140
+ * String for the event identifier when a menu is closed and
141
+ * displayed to the user. Only valid for items that contain
142
+ * submenus.
143
+ */
144
+ export const MENUITEM_EVENT_CLOSED: string | null
145
+ /**
146
+ * String for the event identifier when a menu is opened and
147
+ * displayed to the user. Only valid for items that contain
148
+ * submenus.
149
+ */
150
+ export const MENUITEM_EVENT_OPENED: string | null
151
+ /**
152
+ * Used to set #DBUSMENU_MENUITEM_PROP_TOGGLE_STATE so that the menu's
153
+ * toggle item is undecided.
154
+ */
155
+ export const MENUITEM_ICON_NAME_BLANK: string | null
156
+ /**
157
+ * #DbusmenuMenuitem property used to provide a textual description of any
158
+ * information that the icon may convey. The contents of this property are
159
+ * passed through to assistive technologies such as the Orca screen reader.
160
+ * The contents of this property will not be visible in the menu item. If
161
+ * this property is set, Orca will use this property instead of the label
162
+ * property.
163
+ */
164
+ export const MENUITEM_PROP_ACCESSIBLE_DESC: string | null
165
+ /**
166
+ * #DbusmenuMenuitem property that tells how the children of this menuitem
167
+ * should be displayed. Most likely this will be unset or of the value
168
+ * #DBUSMENU_MENUITEM_CHILD_DISPLAY_SUBMENU. Type: #G_VARIANT_TYPE_STRING
169
+ */
170
+ export const MENUITEM_PROP_CHILD_DISPLAY: string | null
171
+ /**
172
+ * #DbusmenuMenuitem property to tell what type of information that the
173
+ * menu item is displaying to the user. Type: #G_VARIANT_TYPE_STRING
174
+ */
175
+ export const MENUITEM_PROP_DISPOSITION: string | null
176
+ /**
177
+ * #DbusmenuMenuitem property used to represent whether the menuitem
178
+ * is clickable or not. Type: #G_VARIANT_TYPE_BOOLEAN.
179
+ */
180
+ export const MENUITEM_PROP_ENABLED: string | null
181
+ /**
182
+ * #DbusmenuMenuitem property that is the raw data of a custom icon
183
+ * used in the application. Type: #G_VARIANT_TYPE_VARIANT
184
+ *
185
+ * It is recommended that this is not set directly but instead the
186
+ * libdbusmenu-gtk library is used with the function dbusmenu_menuitem_property_set_image()
187
+ */
188
+ export const MENUITEM_PROP_ICON_DATA: string | null
189
+ /**
190
+ * #DbusmenuMenuitem property that is the name of the icon under the
191
+ * Freedesktop.org icon naming spec. Type: #G_VARIANT_TYPE_STRING
192
+ */
193
+ export const MENUITEM_PROP_ICON_NAME: string | null
194
+ /**
195
+ * #DbusmenuMenuitem property used for the text on the menu item.
196
+ */
197
+ export const MENUITEM_PROP_LABEL: string | null
198
+ /**
199
+ * #DbusmenuMenuitem property that is the entries that represent a shortcut
200
+ * to activate the menuitem. It is an array of arrays of strings.
201
+ *
202
+ * It is recommended that this is not set directly but instead the
203
+ * libdbusmenu-gtk library is used with the function dbusmenu_menuitem_property_set_shortcut()
204
+ */
205
+ export const MENUITEM_PROP_SHORTCUT: string | null
206
+ /**
207
+ * #DbusmenuMenuitem property that says what state a toggle entry should
208
+ * be shown as the menu. Should be either #DBUSMENU_MENUITEM_TOGGLE_STATE_UNCHECKED
209
+ * #DBUSMENU_MENUITEM_TOGGLE_STATE_CHECKED or #DBUSMENU_MENUITEM_TOGGLE_STATUE_UNKNOWN.
210
+ */
211
+ export const MENUITEM_PROP_TOGGLE_STATE: string | null
212
+ /**
213
+ * #DbusmenuMenuitem property that says what type of toggle entry should
214
+ * be shown in the menu. Should be either #DBUSMENU_MENUITEM_TOGGLE_CHECK
215
+ * or #DBUSMENU_MENUITEM_TOGGLE_RADIO. Type: #G_VARIANT_TYPE_STRING
216
+ */
217
+ export const MENUITEM_PROP_TOGGLE_TYPE: string | null
218
+ /**
219
+ * #DbusmenuMenuitem property used to represent what type of menuitem
220
+ * this object represents. Type: #G_VARIANT_TYPE_STRING.
221
+ */
222
+ export const MENUITEM_PROP_TYPE: string | null
223
+ /**
224
+ * #DbusmenuMenuitem property used to represent whether the menuitem
225
+ * should be shown or not. Type: #G_VARIANT_TYPE_BOOLEAN.
226
+ */
227
+ export const MENUITEM_PROP_VISIBLE: string | null
228
+ /**
229
+ * Used in #DBUSMENU_MENUITEM_PROP_SHORTCUT to represent the
230
+ * alternate key.
231
+ */
232
+ export const MENUITEM_SHORTCUT_ALT: string | null
233
+ /**
234
+ * Used in #DBUSMENU_MENUITEM_PROP_SHORTCUT to represent the
235
+ * control key.
236
+ */
237
+ export const MENUITEM_SHORTCUT_CONTROL: string | null
238
+ /**
239
+ * Used in #DBUSMENU_MENUITEM_PROP_SHORTCUT to represent the
240
+ * shift key.
241
+ */
242
+ export const MENUITEM_SHORTCUT_SHIFT: string | null
243
+ /**
244
+ * Used in #DBUSMENU_MENUITEM_PROP_SHORTCUT to represent the
245
+ * super key.
246
+ */
247
+ export const MENUITEM_SHORTCUT_SUPER: string | null
248
+ /**
249
+ * String to attach to signal #DbusmenuServer::about-to-show
250
+ */
251
+ export const MENUITEM_SIGNAL_ABOUT_TO_SHOW: string | null
252
+ /**
253
+ * String to attach to signal #DbusmenuServer::child-added
254
+ */
255
+ export const MENUITEM_SIGNAL_CHILD_ADDED: string | null
256
+ /**
257
+ * String to attach to signal #DbusmenuServer::child-moved
258
+ */
259
+ export const MENUITEM_SIGNAL_CHILD_MOVED: string | null
260
+ /**
261
+ * String to attach to signal #DbusmenuServer::child-removed
262
+ */
263
+ export const MENUITEM_SIGNAL_CHILD_REMOVED: string | null
264
+ /**
265
+ * String to attach to signal #DbusmenuServer::event
266
+ */
267
+ export const MENUITEM_SIGNAL_EVENT: string | null
268
+ /**
269
+ * String to attach to signal #DbusmenuServer::item-activated
270
+ */
271
+ export const MENUITEM_SIGNAL_ITEM_ACTIVATED: string | null
272
+ /**
273
+ * String to attach to signal #DbusmenuServer::property-changed
274
+ */
275
+ export const MENUITEM_SIGNAL_PROPERTY_CHANGED: string | null
276
+ /**
277
+ * String to attach to signal #DbusmenuServer::realized
278
+ */
279
+ export const MENUITEM_SIGNAL_REALIZED: string | null
280
+ /**
281
+ * String to attach to signal #DbusmenuServer::show-to-user
282
+ */
283
+ export const MENUITEM_SIGNAL_SHOW_TO_USER: string | null
284
+ /**
285
+ * Used to set #DBUSMENU_MENUITEM_PROP_TOGGLE_TYPE to be a standard
286
+ * check mark item.
287
+ */
288
+ export const MENUITEM_TOGGLE_CHECK: string | null
289
+ /**
290
+ * Used to set #DBUSMENU_MENUITEM_PROP_TOGGLE_TYPE to be a standard
291
+ * radio item.
292
+ */
293
+ export const MENUITEM_TOGGLE_RADIO: string | null
294
+ /**
295
+ * Used to set #DBUSMENU_MENUITEM_PROP_TOGGLE_STATE so that the menu's
296
+ * toggle item is filled.
297
+ */
298
+ export const MENUITEM_TOGGLE_STATE_CHECKED: number
299
+ /**
300
+ * Used to set #DBUSMENU_MENUITEM_PROP_TOGGLE_STATE so that the menu's
301
+ * toggle item is empty.
302
+ */
303
+ export const MENUITEM_TOGGLE_STATE_UNCHECKED: number
304
+ /**
305
+ * Used to set #DBUSMENU_MENUITEM_PROP_TOGGLE_STATE so that the menu's
306
+ * toggle item is undecided.
307
+ */
308
+ export const MENUITEM_TOGGLE_STATE_UNKNOWN: number
309
+ /**
310
+ * String to access property #DbusmenuServer:dbus-object
311
+ */
312
+ export const SERVER_PROP_DBUS_OBJECT: string | null
313
+ /**
314
+ * String to access property #DbusmenuServer:root-node
315
+ */
316
+ export const SERVER_PROP_ROOT_NODE: string | null
317
+ /**
318
+ * String to access property #DbusmenuServer:status
319
+ */
320
+ export const SERVER_PROP_STATUS: string | null
321
+ /**
322
+ * String to access property #DbusmenuServer:text-direction
323
+ */
324
+ export const SERVER_PROP_TEXT_DIRECTION: string | null
325
+ /**
326
+ * String to access property #DbusmenuServer:version
327
+ */
328
+ export const SERVER_PROP_VERSION: string | null
329
+ /**
330
+ * String to attach to signal #DbusmenuServer::item-property-updated
331
+ */
332
+ export const SERVER_SIGNAL_ID_PROP_UPDATE: string | null
333
+ /**
334
+ * String to attach to signal #DbusmenuServer::item-updated
335
+ */
336
+ export const SERVER_SIGNAL_ID_UPDATE: string | null
337
+ /**
338
+ * String to attach to signal #DbusmenuServer::item-activation-requested
339
+ */
340
+ export const SERVER_SIGNAL_ITEM_ACTIVATION: string | null
341
+ /**
342
+ * String to attach to signal #DbusmenuServer::layout-updated
343
+ */
344
+ export const SERVER_SIGNAL_LAYOUT_UPDATED: string | null
345
+ /**
346
+ * The type handler is called when a dbusmenu item is created
347
+ * with a matching type as setup in #dbusmenu_client_add_type_handler
348
+ *
349
+ * Return value: #TRUE if the type has been handled. #FALSE if this
350
+ * function was somehow unable to handle it.
351
+ * @callback
352
+ * @param newitem The #DbusmenuMenuitem that was created
353
+ * @param parent The parent of `newitem` or #NULL if none
354
+ * @param client A pointer to the #DbusmenuClient
355
+ */
356
+ export interface ClientTypeHandler {
357
+ (newitem: Menuitem, parent: Menuitem, client: Client): boolean
358
+ }
359
+ /**
360
+ * Callback prototype for a callback that is called when the
361
+ * menu should be shown.
362
+ * @callback
363
+ * @param mi Menu item that should be shown
364
+ */
365
+ export interface menuitem_about_to_show_cb {
366
+ (mi: Menuitem): void
367
+ }
368
+ /**
369
+ * This is the function that is called to represent this menu item
370
+ * as a variant. Should call its own children.
371
+ * @callback
372
+ * @param mi Menu item that should be built from
373
+ * @param properties A list of properties that should be the only ones in the resulting variant structure
374
+ * @returns A variant representing this item and its children
375
+ */
376
+ export interface menuitem_buildvariant_slot_t {
377
+ (mi: Menuitem, properties: string | null): GLib.Variant
378
+ }
379
+ export module Client {
380
+
381
+ // Signal callback interfaces
382
+
383
+ /**
384
+ * Signal callback interface for `event-result`
385
+ */
386
+ export interface EventResultSignalCallback {
387
+ ($obj: Client, object: GObject.Object, p0: string | null, p1: GLib.Variant, p2: number, p3: any | null): void
388
+ }
389
+
390
+ /**
391
+ * Signal callback interface for `icon-theme-dirs-changed`
392
+ */
393
+ export interface IconThemeDirsChangedSignalCallback {
394
+ ($obj: Client, arg1: any | null): void
395
+ }
396
+
397
+ /**
398
+ * Signal callback interface for `item-activate`
399
+ */
400
+ export interface ItemActivateSignalCallback {
401
+ ($obj: Client, arg1: GObject.Object, arg2: number): void
402
+ }
403
+
404
+ /**
405
+ * Signal callback interface for `layout-updated`
406
+ */
407
+ export interface LayoutUpdatedSignalCallback {
408
+ ($obj: Client): void
409
+ }
410
+
411
+ /**
412
+ * Signal callback interface for `new-menuitem`
413
+ */
414
+ export interface NewMenuitemSignalCallback {
415
+ ($obj: Client, arg1: GObject.Object): void
416
+ }
417
+
418
+ /**
419
+ * Signal callback interface for `root-changed`
420
+ */
421
+ export interface RootChangedSignalCallback {
422
+ ($obj: Client, arg1: GObject.Object): void
423
+ }
424
+
425
+
426
+ // Constructor properties interface
427
+
428
+ export interface ConstructorProperties extends GObject.Object.ConstructorProperties {
429
+
430
+ // Own constructor properties of Dbusmenu-0.4.Dbusmenu.Client
431
+
432
+ dbus_name?: string | null
433
+ dbus_object?: string | null
434
+ group_events?: boolean | null
435
+ }
436
+
437
+ }
438
+
439
+ export interface Client {
440
+
441
+ // Own properties of Dbusmenu-0.4.Dbusmenu.Client
442
+
443
+ readonly dbus_name: string | null
444
+ readonly dbus_object: string | null
445
+ group_events: boolean
446
+
447
+ // Owm methods of Dbusmenu-0.4.Dbusmenu.Client
448
+
449
+ /**
450
+ * This function connects into the type handling of the #DbusmenuClient.
451
+ * Every new menuitem that comes in immediately gets asked for its
452
+ * properties. When we get those properties we check the 'type'
453
+ * property and look to see if it matches a handler that is known
454
+ * by the client. If so, the `newfunc` function is executed on that
455
+ * #DbusmenuMenuitem. If not, then the DbusmenuClient::new-menuitem
456
+ * signal is sent.
457
+ *
458
+ * In the future the known types will be sent to the server so that it
459
+ * can make choices about the menu item types availble.
460
+ * @param type A text string that will be matched with the 'type' property on incoming menu items
461
+ * @param newfunc The function that will be executed with those new items when they come in.
462
+ * @returns If registering the new type was successful.
463
+ */
464
+ add_type_handler(type: string | null, newfunc: ClientTypeHandler): boolean
465
+ /**
466
+ * This function connects into the type handling of the #DbusmenuClient.
467
+ * Every new menuitem that comes in immediately gets asked for its
468
+ * properties. When we get those properties we check the 'type'
469
+ * property and look to see if it matches a handler that is known
470
+ * by the client. If so, the `newfunc` function is executed on that
471
+ * #DbusmenuMenuitem. If not, then the DbusmenuClient::new-menuitem
472
+ * signal is sent.
473
+ *
474
+ * In the future the known types will be sent to the server so that it
475
+ * can make choices about the menu item types availble.
476
+ * @param type A text string that will be matched with the 'type' property on incoming menu items
477
+ * @param newfunc The function that will be executed with those new items when they come in.
478
+ * @returns If registering the new type was successful.
479
+ */
480
+ add_type_handler_full(type: string | null, newfunc: ClientTypeHandler): boolean
481
+ /**
482
+ * Gets the stored and exported icon paths from the client.
483
+ * @returns A NULL-terminated list of icon paths with memory managed by the client. Duplicate if you want to keep them.
484
+ */
485
+ get_icon_paths(): string[]
486
+ /**
487
+ * Grabs the root node for the specified client `client`. This
488
+ * function may block. It will block if there is currently a
489
+ * call to update the layout, it will block on that layout
490
+ * updated and then return the newly updated layout. Chances
491
+ * are that this update is in the queue for the mainloop as
492
+ * it would have been requested some time ago, but in theory
493
+ * it could block longer.
494
+ * @returns A #DbusmenuMenuitem representing the root of menu on the server. If there is no server or there is an error receiving its layout it'll return #NULL.
495
+ */
496
+ get_root(): Menuitem
497
+ /**
498
+ * Gets the recommended current status that the server
499
+ * is exporting for the menus. In situtations where the
500
+ * value is #DBUSMENU_STATUS_NOTICE it is recommended that
501
+ * the client show the menus to the user an a more noticible
502
+ * way.
503
+ *
504
+ * Return value: Status being exported.
505
+ */
506
+ get_status(): Status
507
+ /**
508
+ * Gets the text direction that the server is exporting. If
509
+ * the server is not exporting a direction then the value
510
+ * #DBUSMENU_TEXT_DIRECTION_NONE will be returned.
511
+ *
512
+ * Return value: Text direction being exported.
513
+ */
514
+ get_text_direction(): TextDirection
515
+
516
+ // Own signals of Dbusmenu-0.4.Dbusmenu.Client
517
+
518
+ connect(sigName: "event-result", callback: Client.EventResultSignalCallback): number
519
+ connect_after(sigName: "event-result", callback: Client.EventResultSignalCallback): number
520
+ emit(sigName: "event-result", object: GObject.Object, p0: string | null, p1: GLib.Variant, p2: number, p3: any | null, ...args: any[]): void
521
+ connect(sigName: "icon-theme-dirs-changed", callback: Client.IconThemeDirsChangedSignalCallback): number
522
+ connect_after(sigName: "icon-theme-dirs-changed", callback: Client.IconThemeDirsChangedSignalCallback): number
523
+ emit(sigName: "icon-theme-dirs-changed", arg1: any | null, ...args: any[]): void
524
+ connect(sigName: "item-activate", callback: Client.ItemActivateSignalCallback): number
525
+ connect_after(sigName: "item-activate", callback: Client.ItemActivateSignalCallback): number
526
+ emit(sigName: "item-activate", arg1: GObject.Object, arg2: number, ...args: any[]): void
527
+ connect(sigName: "layout-updated", callback: Client.LayoutUpdatedSignalCallback): number
528
+ connect_after(sigName: "layout-updated", callback: Client.LayoutUpdatedSignalCallback): number
529
+ emit(sigName: "layout-updated", ...args: any[]): void
530
+ connect(sigName: "new-menuitem", callback: Client.NewMenuitemSignalCallback): number
531
+ connect_after(sigName: "new-menuitem", callback: Client.NewMenuitemSignalCallback): number
532
+ emit(sigName: "new-menuitem", arg1: GObject.Object, ...args: any[]): void
533
+ connect(sigName: "root-changed", callback: Client.RootChangedSignalCallback): number
534
+ connect_after(sigName: "root-changed", callback: Client.RootChangedSignalCallback): number
535
+ emit(sigName: "root-changed", arg1: GObject.Object, ...args: any[]): void
536
+
537
+ // Class property signals of Dbusmenu-0.4.Dbusmenu.Client
538
+
539
+ connect(sigName: "notify::dbus-name", callback: (($obj: Client, pspec: GObject.ParamSpec) => void)): number
540
+ connect_after(sigName: "notify::dbus-name", callback: (($obj: Client, pspec: GObject.ParamSpec) => void)): number
541
+ emit(sigName: "notify::dbus-name", ...args: any[]): void
542
+ connect(sigName: "notify::dbus-object", callback: (($obj: Client, pspec: GObject.ParamSpec) => void)): number
543
+ connect_after(sigName: "notify::dbus-object", callback: (($obj: Client, pspec: GObject.ParamSpec) => void)): number
544
+ emit(sigName: "notify::dbus-object", ...args: any[]): void
545
+ connect(sigName: "notify::group-events", callback: (($obj: Client, pspec: GObject.ParamSpec) => void)): number
546
+ connect_after(sigName: "notify::group-events", callback: (($obj: Client, pspec: GObject.ParamSpec) => void)): number
547
+ emit(sigName: "notify::group-events", ...args: any[]): void
548
+ connect(sigName: string, callback: (...args: any[]) => void): number
549
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
550
+ emit(sigName: string, ...args: any[]): void
551
+ disconnect(id: number): void
552
+ }
553
+
554
+ /**
555
+ * The client for a #DbusmenuServer creating a shared
556
+ * object set of #DbusmenuMenuitem objects.
557
+ * @class
558
+ */
559
+ export class Client extends GObject.Object {
560
+
561
+ // Own properties of Dbusmenu-0.4.Dbusmenu.Client
562
+
563
+ static name: string
564
+ static $gtype: GObject.GType<Client>
565
+
566
+ // Constructors of Dbusmenu-0.4.Dbusmenu.Client
567
+
568
+ constructor(config?: Client.ConstructorProperties)
569
+ /**
570
+ * This function creates a new client that connects to a specific
571
+ * server on DBus. That server is at a specific location sharing
572
+ * a known object. The interface is assumed by the code to be
573
+ * the DBus menu interface. The newly created client will start
574
+ * sending out events as it syncs up with the server.
575
+ * @constructor
576
+ * @param name The DBus name for the server to connect to
577
+ * @param object The object on the server to monitor
578
+ * @returns A brand new #DbusmenuClient
579
+ */
580
+ constructor(name: string | null, object: string | null)
581
+ /**
582
+ * This function creates a new client that connects to a specific
583
+ * server on DBus. That server is at a specific location sharing
584
+ * a known object. The interface is assumed by the code to be
585
+ * the DBus menu interface. The newly created client will start
586
+ * sending out events as it syncs up with the server.
587
+ * @constructor
588
+ * @param name The DBus name for the server to connect to
589
+ * @param object The object on the server to monitor
590
+ * @returns A brand new #DbusmenuClient
591
+ */
592
+ static new(name: string | null, object: string | null): Client
593
+ _init(config?: Client.ConstructorProperties): void
594
+ }
595
+
596
+ export module Menuitem {
597
+
598
+ // Signal callback interfaces
599
+
600
+ /**
601
+ * Signal callback interface for `about-to-show`
602
+ */
603
+ export interface AboutToShowSignalCallback {
604
+ ($obj: Menuitem): boolean
605
+ }
606
+
607
+ /**
608
+ * Signal callback interface for `child-added`
609
+ */
610
+ export interface ChildAddedSignalCallback {
611
+ ($obj: Menuitem, arg1: GObject.Object, arg2: number): void
612
+ }
613
+
614
+ /**
615
+ * Signal callback interface for `child-moved`
616
+ */
617
+ export interface ChildMovedSignalCallback {
618
+ ($obj: Menuitem, arg1: GObject.Object, arg2: number, arg3: number): void
619
+ }
620
+
621
+ /**
622
+ * Signal callback interface for `child-removed`
623
+ */
624
+ export interface ChildRemovedSignalCallback {
625
+ ($obj: Menuitem, arg1: GObject.Object): void
626
+ }
627
+
628
+ /**
629
+ * Signal callback interface for `event`
630
+ */
631
+ export interface EventSignalCallback {
632
+ ($obj: Menuitem, arg1: string | null, arg2: GLib.Variant, arg3: number): boolean
633
+ }
634
+
635
+ /**
636
+ * Signal callback interface for `item-activated`
637
+ */
638
+ export interface ItemActivatedSignalCallback {
639
+ ($obj: Menuitem, arg1: number): void
640
+ }
641
+
642
+ /**
643
+ * Signal callback interface for `property-changed`
644
+ */
645
+ export interface PropertyChangedSignalCallback {
646
+ ($obj: Menuitem, arg1: string | null, arg2: GLib.Variant): void
647
+ }
648
+
649
+ /**
650
+ * Signal callback interface for `realized`
651
+ */
652
+ export interface RealizedSignalCallback {
653
+ ($obj: Menuitem): void
654
+ }
655
+
656
+ /**
657
+ * Signal callback interface for `show-to-user`
658
+ */
659
+ export interface ShowToUserSignalCallback {
660
+ ($obj: Menuitem, arg1: number): void
661
+ }
662
+
663
+
664
+ // Constructor properties interface
665
+
666
+ export interface ConstructorProperties extends GObject.Object.ConstructorProperties {
667
+
668
+ // Own constructor properties of Dbusmenu-0.4.Dbusmenu.Menuitem
669
+
670
+ id?: number | null
671
+ }
672
+
673
+ }
674
+
675
+ export interface Menuitem {
676
+
677
+ // Own properties of Dbusmenu-0.4.Dbusmenu.Menuitem
678
+
679
+ readonly id: number
680
+
681
+ // Own fields of Dbusmenu-0.4.Dbusmenu.Menuitem
682
+
683
+ /**
684
+ * Parent object
685
+ * @field
686
+ */
687
+ parent: GObject.Object
688
+ /**
689
+ * Private data
690
+ * @field
691
+ */
692
+ priv: MenuitemPrivate
693
+
694
+ // Owm methods of Dbusmenu-0.4.Dbusmenu.Menuitem
695
+
696
+ /**
697
+ * Puts `child` in the list of children for `mi` at the location
698
+ * specified in `position`. If there is not enough entires available
699
+ * then `child` will be placed at the end of the list.
700
+ * @param child The #DbusmenuMenuitem to make a child of `mi`.
701
+ * @param position Where in `mi` object's list of chidren `child` should be placed.
702
+ * @returns Whether @child was added successfully.
703
+ */
704
+ child_add_position(child: Menuitem, position: number): boolean
705
+ /**
706
+ * This function adds `child` to the list of children on `mi` at
707
+ * the end of that list.
708
+ * @param child The #DbusmenMenuitem that will be a child
709
+ * @returns Whether the child has been added successfully.
710
+ */
711
+ child_append(child: Menuitem): boolean
712
+ /**
713
+ * This function removes `child` from the children list of `mi`. It does
714
+ * not call #g_object_unref on `child`.
715
+ * @param child The child #DbusmenuMenuitem that you want to no longer be a child of `mi`.
716
+ * @returns If we were able to delete @child.
717
+ */
718
+ child_delete(child: Menuitem): boolean
719
+ /**
720
+ * Search the children of `mi` to find one with the ID of `id`.
721
+ * If it doesn't exist then we return #NULL.
722
+ * @param id The ID of the child that we're looking for.
723
+ * @returns The menu item with the ID @id or #NULL if it can't be found.
724
+ */
725
+ child_find(id: number): Menuitem
726
+ /**
727
+ * This function adds `child` to the list of children on `mi` at
728
+ * the beginning of that list.
729
+ * @param child The #DbusmenMenuitem that will be a child
730
+ * @returns Whether the child has been added successfully.
731
+ */
732
+ child_prepend(child: Menuitem): boolean
733
+ /**
734
+ * This function moves a child on the list of children. It is
735
+ * for a child that is already in the list, but simply needs a
736
+ * new location.
737
+ * @param child The #DbusmenuMenuitem that is a child needing to be moved
738
+ * @param position The position in the list to place it in
739
+ * @returns Whether the move was successful.
740
+ */
741
+ child_reorder(child: Menuitem, position: number): boolean
742
+ /**
743
+ * This function searchs the whole tree of children that
744
+ * are attached to `mi`. This could be quite a few nodes, all
745
+ * the way down the tree. It is a depth first search.
746
+ * @param id ID of the #DbusmenuMenuitem to search for
747
+ * @returns The #DbusmenuMenuitem with the ID of @id or #NULL if there isn't such a menu item in the tree represented by @mi.
748
+ */
749
+ find_id(id: number): Menuitem
750
+ /**
751
+ * This calls the function `func` on this menu item and all
752
+ * of the children of this item. And their children. And
753
+ * their children. And... you get the point. It will get
754
+ * called on the whole tree.
755
+ * @param func Function to call on every node in the tree
756
+ * @param data User data to pass to the function
757
+ */
758
+ foreach(func: any | null, data: any | null): void
759
+ /**
760
+ * Returns simply the list of children that this menu item
761
+ * has. The list is valid until another child related function
762
+ * is called, where it might be changed.
763
+ * @returns A #GList of pointers to #DbusmenuMenuitem objects.
764
+ */
765
+ get_children(): Menuitem[]
766
+ /**
767
+ * Gets the unique ID for `mi`.
768
+ * @returns The ID of the @mi.
769
+ */
770
+ get_id(): number
771
+ /**
772
+ * This function looks up the parent of `mi`
773
+ * @returns The parent of this menu item
774
+ */
775
+ get_parent(): Menuitem
776
+ /**
777
+ * This function returns the position of the menu item `mi`
778
+ * in the children of `parent`. It will return zero if the
779
+ * menu item can't be found.
780
+ * @param parent The #DbusmenuMenuitem who's children contain `mi`
781
+ * @returns The position of @mi in the children of @parent.
782
+ */
783
+ get_position(parent: Menuitem): number
784
+ /**
785
+ * This function is very similar to #dbusmenu_menuitem_get_position
786
+ * except that it only counts in the children that have been realized.
787
+ * @param parent The #DbusmenuMenuitem who's children contain `mi`
788
+ * @returns The position of @mi in the realized children of @parent.
789
+ */
790
+ get_position_realized(parent: Menuitem): number
791
+ /**
792
+ * This function returns the internal value of whether this is a
793
+ * root node or not.
794
+ * @returns #TRUE if this is a root node
795
+ */
796
+ get_root(): boolean
797
+ /**
798
+ * This function is called to create an event. It is likely
799
+ * to be overrided by subclasses. The default menu item
800
+ * will respond to the activate signal and do:
801
+ *
802
+ * Emits the #DbusmenuMenuitem::item-activate signal on this
803
+ * menu item. Called by server objects when they get the
804
+ * appropriate DBus signals from the client.
805
+ *
806
+ * If you subclass this function you should really think
807
+ * about calling the parent function unless you have a good
808
+ * reason not to.
809
+ * @param name The name of the signal
810
+ * @param variant A value that could be set for the event
811
+ * @param timestamp The timestamp of when the event happened
812
+ */
813
+ handle_event(name: string | null, variant: GLib.Variant, timestamp: number): void
814
+ /**
815
+ * This function takes the properties of a #DbusmenuMenuitem
816
+ * and puts them into a #GHashTable that is referenced by the
817
+ * key of a string and has the value of a string. The hash
818
+ * table may not have any entries if there aren't any or there
819
+ * is an error in processing. It is the caller's responsibility
820
+ * to destroy the created #GHashTable.
821
+ * @returns A brand new #GHashTable that contains all of theroperties that are on this #DbusmenuMenuitem @mi.
822
+ */
823
+ properties_copy(): GLib.HashTable
824
+ /**
825
+ * This functiong gets a list of the names of all the properties
826
+ * that are set on this menu item. This data on the list is owned
827
+ * by the menuitem but the list is not and should be freed using
828
+ * g_list_free() when the calling function is done with it.
829
+ * @returns A list of strings or NULL if there are none.
830
+ */
831
+ properties_list(): string[]
832
+ /**
833
+ * Checkes to see if a particular property exists on `mi` and
834
+ * returns #TRUE if so.
835
+ * @param property The property to look for.
836
+ * @returns A boolean checking to see if the property is available
837
+ */
838
+ property_exist(property: string | null): boolean
839
+ /**
840
+ * Look up a property on `mi` and return the value of it if
841
+ * it exits. #NULL will be returned if the property doesn't
842
+ * exist.
843
+ * @param property The property to grab.
844
+ * @returns A string with the value of the property that shouldn't be free'd. Or #NULL if the property is not set or is not a string.
845
+ */
846
+ property_get(property: string | null): string | null
847
+ /**
848
+ * Look up a property on `mi` and return the value of it if
849
+ * it exits. Returns #FALSE if the property doesn't exist.
850
+ * @param property The property to grab.
851
+ * @returns The value of the property or #FALSE.
852
+ */
853
+ property_get_bool(property: string | null): boolean
854
+ /**
855
+ * Look up a property on `mi` and return the value of it if
856
+ * it exits. #NULL will be returned if the property doesn't
857
+ * exist.
858
+ * @param property The property to grab.
859
+ * @returns A byte array with the value of the property that shouldn't be free'd. Or #NULL if the property is not set or is not a byte array.
860
+ */
861
+ property_get_byte_array(property: string | null): Uint8Array
862
+ /**
863
+ * Look up a property on `mi` and return the value of it if
864
+ * it exits. Returns zero if the property doesn't exist.
865
+ * @param property The property to grab.
866
+ * @returns The value of the property or zero.
867
+ */
868
+ property_get_int(property: string | null): number
869
+ /**
870
+ * Look up a property on `mi` and return the value of it if
871
+ * it exits. #NULL will be returned if the property doesn't
872
+ * exist.
873
+ * @param property The property to grab.
874
+ * @returns A GVariant for the property.
875
+ */
876
+ property_get_variant(property: string | null): GLib.Variant
877
+ /**
878
+ * Removes a property from the menuitem.
879
+ * @param property The property to look for.
880
+ */
881
+ property_remove(property: string | null): void
882
+ /**
883
+ * Takes the pair of `property` and `value` and places them as a
884
+ * property on `mi`. If a property already exists by that name,
885
+ * then the value is set to the new value. If not, the property
886
+ * is added. If the value is changed or the property was previously
887
+ * unset then the signal #DbusmenuMenuitem::prop-changed will be
888
+ * emitted by this function.
889
+ * @param property Name of the property to set.
890
+ * @param value The value of the property.
891
+ * @returns A boolean representing if the property value was set.
892
+ */
893
+ property_set(property: string | null, value: string | null): boolean
894
+ /**
895
+ * Takes a boolean `value` and sets it on `property` as a
896
+ * property on `mi`. If a property already exists by that name,
897
+ * then the value is set to the new value. If not, the property
898
+ * is added. If the value is changed or the property was previously
899
+ * unset then the signal #DbusmenuMenuitem::prop-changed will be
900
+ * emitted by this function.
901
+ * @param property Name of the property to set.
902
+ * @param value The value of the property.
903
+ * @returns A boolean representing if the property value was set.
904
+ */
905
+ property_set_bool(property: string | null, value: boolean): boolean
906
+ /**
907
+ * Takes a byte array `value` and sets it on `property` as a
908
+ * property on `mi`. If a property already exists by that name,
909
+ * then the value is set to the new value. If not, the property
910
+ * is added. If the value is changed or the property was previously
911
+ * unset then the signal #DbusmenuMenuitem::prop-changed will be
912
+ * emitted by this function.
913
+ * @param property Name of the property to set.
914
+ * @param value The byte array.
915
+ * @param nelements The number of elements in the byte array.
916
+ * @returns A boolean representing if the property value was set.
917
+ */
918
+ property_set_byte_array(property: string | null, value: number, nelements: number): boolean
919
+ /**
920
+ * Takes a boolean `value` and sets it on `property` as a
921
+ * property on `mi`. If a property already exists by that name,
922
+ * then the value is set to the new value. If not, the property
923
+ * is added. If the value is changed or the property was previously
924
+ * unset then the signal #DbusmenuMenuitem::prop-changed will be
925
+ * emitted by this function.
926
+ * @param property Name of the property to set.
927
+ * @param value The value of the property.
928
+ * @returns A boolean representing if the property value was set.
929
+ */
930
+ property_set_int(property: string | null, value: number): boolean
931
+ /**
932
+ * Takes the pair of `property` and `value` and places them as a
933
+ * property on `mi`. If a property already exists by that name,
934
+ * then the value is set to the new value. If not, the property
935
+ * is added. If the value is changed or the property was previously
936
+ * unset then the signal #DbusmenuMenuitem::prop-changed will be
937
+ * emitted by this function.
938
+ * @param property Name of the property to set.
939
+ * @param value The value of the property.
940
+ * @returns A boolean representing if the property value was set.
941
+ */
942
+ property_set_variant(property: string | null, value: GLib.Variant): boolean
943
+ /**
944
+ * This function is used to send the even that the submenu
945
+ * of this item is about to be shown. Callers to this event
946
+ * should delay showing the menu until their callback is
947
+ * called if possible.
948
+ * @param cb Callback to call when the call has returned.
949
+ * @param cb_data Data to pass to the callback.
950
+ */
951
+ send_about_to_show(cb: any | null, cb_data: any | null): void
952
+ /**
953
+ * Sets the parent of `mi` to `parent`. If `mi` already
954
+ * has a parent, then this call will fail. The parent will
955
+ * be set automatically when using the usual methods to add a
956
+ * child menuitem, so this function should not normally be
957
+ * called directly
958
+ * @param parent The new parent #DbusmenuMenuitem
959
+ * @returns Whether the parent was set successfully
960
+ */
961
+ set_parent(parent: Menuitem): boolean
962
+ /**
963
+ * This function sets the internal value of whether this is a
964
+ * root node or not.
965
+ * @param root Whether `mi` is a root node or not
966
+ */
967
+ set_root(root: boolean): void
968
+ /**
969
+ * Signals that this menu item should be shown to the user. If this is
970
+ * server side the server will then take it and send it over the
971
+ * bus.
972
+ * @param timestamp The time that the user requested it to be shown
973
+ */
974
+ show_to_user(timestamp: number): void
975
+ /**
976
+ * While the name sounds devious that's exactly what this function
977
+ * does. It takes the list of children from the `mi` and clears the
978
+ * internal list. The calling function is now in charge of the ref's
979
+ * on the children it has taken. A lot of responsibility involved
980
+ * in taking children.
981
+ * @returns A #GList of pointers to #DbusmenuMenuitem objects.
982
+ */
983
+ take_children(): Menuitem[]
984
+ /**
985
+ * Unparents the menu item `mi`. If `mi` doesn't have a
986
+ * parent, then this call will fail. The menuitem will
987
+ * be unparented automatically when using the usual methods
988
+ * to delete a child menuitem, so this function should not
989
+ * normally be called directly
990
+ * @returns Whether the menu item was unparented successfully
991
+ */
992
+ unparent(): boolean
993
+
994
+ // Own virtual methods of Dbusmenu-0.4.Dbusmenu.Menuitem
995
+
996
+ vfunc_child_added(position: number): void
997
+ vfunc_child_moved(newpos: number, oldpos: number): void
998
+ vfunc_child_removed(): void
999
+ /**
1000
+ * This function is called to create an event. It is likely
1001
+ * to be overrided by subclasses. The default menu item
1002
+ * will respond to the activate signal and do:
1003
+ *
1004
+ * Emits the #DbusmenuMenuitem::item-activate signal on this
1005
+ * menu item. Called by server objects when they get the
1006
+ * appropriate DBus signals from the client.
1007
+ *
1008
+ * If you subclass this function you should really think
1009
+ * about calling the parent function unless you have a good
1010
+ * reason not to.
1011
+ * @virtual
1012
+ * @param name The name of the signal
1013
+ * @param variant A value that could be set for the event
1014
+ * @param timestamp The timestamp of when the event happened
1015
+ */
1016
+ vfunc_handle_event(name: string | null, variant: GLib.Variant, timestamp: number): void
1017
+ vfunc_show_to_user(timestamp: number, cb_data: any | null): void
1018
+
1019
+ // Own signals of Dbusmenu-0.4.Dbusmenu.Menuitem
1020
+
1021
+ connect(sigName: "about-to-show", callback: Menuitem.AboutToShowSignalCallback): number
1022
+ connect_after(sigName: "about-to-show", callback: Menuitem.AboutToShowSignalCallback): number
1023
+ emit(sigName: "about-to-show", ...args: any[]): void
1024
+ connect(sigName: "child-added", callback: Menuitem.ChildAddedSignalCallback): number
1025
+ connect_after(sigName: "child-added", callback: Menuitem.ChildAddedSignalCallback): number
1026
+ emit(sigName: "child-added", arg1: GObject.Object, arg2: number, ...args: any[]): void
1027
+ connect(sigName: "child-moved", callback: Menuitem.ChildMovedSignalCallback): number
1028
+ connect_after(sigName: "child-moved", callback: Menuitem.ChildMovedSignalCallback): number
1029
+ emit(sigName: "child-moved", arg1: GObject.Object, arg2: number, arg3: number, ...args: any[]): void
1030
+ connect(sigName: "child-removed", callback: Menuitem.ChildRemovedSignalCallback): number
1031
+ connect_after(sigName: "child-removed", callback: Menuitem.ChildRemovedSignalCallback): number
1032
+ emit(sigName: "child-removed", arg1: GObject.Object, ...args: any[]): void
1033
+ connect(sigName: "event", callback: Menuitem.EventSignalCallback): number
1034
+ connect_after(sigName: "event", callback: Menuitem.EventSignalCallback): number
1035
+ emit(sigName: "event", arg1: string | null, arg2: GLib.Variant, arg3: number, ...args: any[]): void
1036
+ connect(sigName: "item-activated", callback: Menuitem.ItemActivatedSignalCallback): number
1037
+ connect_after(sigName: "item-activated", callback: Menuitem.ItemActivatedSignalCallback): number
1038
+ emit(sigName: "item-activated", arg1: number, ...args: any[]): void
1039
+ connect(sigName: "property-changed", callback: Menuitem.PropertyChangedSignalCallback): number
1040
+ connect_after(sigName: "property-changed", callback: Menuitem.PropertyChangedSignalCallback): number
1041
+ emit(sigName: "property-changed", arg1: string | null, arg2: GLib.Variant, ...args: any[]): void
1042
+ connect(sigName: "realized", callback: Menuitem.RealizedSignalCallback): number
1043
+ connect_after(sigName: "realized", callback: Menuitem.RealizedSignalCallback): number
1044
+ emit(sigName: "realized", ...args: any[]): void
1045
+ connect(sigName: "show-to-user", callback: Menuitem.ShowToUserSignalCallback): number
1046
+ connect_after(sigName: "show-to-user", callback: Menuitem.ShowToUserSignalCallback): number
1047
+ emit(sigName: "show-to-user", arg1: number, ...args: any[]): void
1048
+
1049
+ // Class property signals of Dbusmenu-0.4.Dbusmenu.Menuitem
1050
+
1051
+ connect(sigName: "notify::id", callback: (($obj: Menuitem, pspec: GObject.ParamSpec) => void)): number
1052
+ connect_after(sigName: "notify::id", callback: (($obj: Menuitem, pspec: GObject.ParamSpec) => void)): number
1053
+ emit(sigName: "notify::id", ...args: any[]): void
1054
+ connect(sigName: string, callback: (...args: any[]) => void): number
1055
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
1056
+ emit(sigName: string, ...args: any[]): void
1057
+ disconnect(id: number): void
1058
+ }
1059
+
1060
+ /**
1061
+ * This is the #GObject based object that represents a menu
1062
+ * item. It gets created the same on both the client and
1063
+ * the server side and libdbusmenu-glib does the work of making
1064
+ * this object model appear on both sides of DBus. Simple
1065
+ * really, though through updates and people coming on and off
1066
+ * the bus it can lead to lots of fun complex scenarios.
1067
+ * @class
1068
+ */
1069
+ export class Menuitem extends GObject.Object {
1070
+
1071
+ // Own properties of Dbusmenu-0.4.Dbusmenu.Menuitem
1072
+
1073
+ static name: string
1074
+ static $gtype: GObject.GType<Menuitem>
1075
+
1076
+ // Constructors of Dbusmenu-0.4.Dbusmenu.Menuitem
1077
+
1078
+ constructor(config?: Menuitem.ConstructorProperties)
1079
+ /**
1080
+ * Create a new #DbusmenuMenuitem with all default values.
1081
+ * @constructor
1082
+ * @returns A newly allocated #DbusmenuMenuitem.
1083
+ */
1084
+ constructor()
1085
+ /**
1086
+ * Create a new #DbusmenuMenuitem with all default values.
1087
+ * @constructor
1088
+ * @returns A newly allocated #DbusmenuMenuitem.
1089
+ */
1090
+ static new(): Menuitem
1091
+ /**
1092
+ * This creates a blank #DbusmenuMenuitem with a specific ID.
1093
+ * @constructor
1094
+ * @param id ID to use for this menuitem
1095
+ * @returns A newly allocated #DbusmenuMenuitem.
1096
+ */
1097
+ static new_with_id(id: number): Menuitem
1098
+ _init(config?: Menuitem.ConstructorProperties): void
1099
+ }
1100
+
1101
+ export module MenuitemProxy {
1102
+
1103
+ // Constructor properties interface
1104
+
1105
+ export interface ConstructorProperties extends Menuitem.ConstructorProperties {
1106
+
1107
+ // Own constructor properties of Dbusmenu-0.4.Dbusmenu.MenuitemProxy
1108
+
1109
+ menu_item?: Menuitem | null
1110
+ }
1111
+
1112
+ }
1113
+
1114
+ export interface MenuitemProxy {
1115
+
1116
+ // Own properties of Dbusmenu-0.4.Dbusmenu.MenuitemProxy
1117
+
1118
+ readonly menu_item: Menuitem
1119
+
1120
+ // Owm methods of Dbusmenu-0.4.Dbusmenu.MenuitemProxy
1121
+
1122
+ /**
1123
+ * Accesses the private variable of which #DbusmenuMenuitem
1124
+ * we are doing the proxying for.
1125
+ * @returns A #DbusmenuMenuitem object or a #NULL if we don't have one or there is an error.
1126
+ */
1127
+ get_wrapped(): Menuitem
1128
+
1129
+ // Class property signals of Dbusmenu-0.4.Dbusmenu.MenuitemProxy
1130
+
1131
+ connect(sigName: "notify::menu-item", callback: (($obj: MenuitemProxy, pspec: GObject.ParamSpec) => void)): number
1132
+ connect_after(sigName: "notify::menu-item", callback: (($obj: MenuitemProxy, pspec: GObject.ParamSpec) => void)): number
1133
+ emit(sigName: "notify::menu-item", ...args: any[]): void
1134
+ connect(sigName: "notify::id", callback: (($obj: MenuitemProxy, pspec: GObject.ParamSpec) => void)): number
1135
+ connect_after(sigName: "notify::id", callback: (($obj: MenuitemProxy, pspec: GObject.ParamSpec) => void)): number
1136
+ emit(sigName: "notify::id", ...args: any[]): void
1137
+ connect(sigName: string, callback: (...args: any[]) => void): number
1138
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
1139
+ emit(sigName: string, ...args: any[]): void
1140
+ disconnect(id: number): void
1141
+ }
1142
+
1143
+ /**
1144
+ * Public instance data for a #DbusmenuMenuitemProxy.
1145
+ * @class
1146
+ */
1147
+ export class MenuitemProxy extends Menuitem {
1148
+
1149
+ // Own properties of Dbusmenu-0.4.Dbusmenu.MenuitemProxy
1150
+
1151
+ static name: string
1152
+ static $gtype: GObject.GType<MenuitemProxy>
1153
+
1154
+ // Constructors of Dbusmenu-0.4.Dbusmenu.MenuitemProxy
1155
+
1156
+ constructor(config?: MenuitemProxy.ConstructorProperties)
1157
+ /**
1158
+ * Builds a new #DbusmenuMenuitemProxy object that proxies
1159
+ * all of the values for `mi`.
1160
+ * @constructor
1161
+ * @param mi The #DbusmenuMenuitem to proxy
1162
+ * @returns A new #DbusmenuMenuitemProxy object.
1163
+ */
1164
+ constructor(mi: Menuitem)
1165
+ /**
1166
+ * Builds a new #DbusmenuMenuitemProxy object that proxies
1167
+ * all of the values for `mi`.
1168
+ * @constructor
1169
+ * @param mi The #DbusmenuMenuitem to proxy
1170
+ * @returns A new #DbusmenuMenuitemProxy object.
1171
+ */
1172
+ static new(mi: Menuitem): MenuitemProxy
1173
+
1174
+ // Overloads of new
1175
+
1176
+ /**
1177
+ * Create a new #DbusmenuMenuitem with all default values.
1178
+ * @constructor
1179
+ * @returns A newly allocated #DbusmenuMenuitem.
1180
+ */
1181
+ static new(): Menuitem
1182
+ _init(config?: MenuitemProxy.ConstructorProperties): void
1183
+ }
1184
+
1185
+ export module Server {
1186
+
1187
+ // Signal callback interfaces
1188
+
1189
+ /**
1190
+ * Signal callback interface for `item-activation-requested`
1191
+ */
1192
+ export interface ItemActivationRequestedSignalCallback {
1193
+ ($obj: Server, arg1: number, arg2: number): void
1194
+ }
1195
+
1196
+ /**
1197
+ * Signal callback interface for `item-property-updated`
1198
+ */
1199
+ export interface ItemPropertyUpdatedSignalCallback {
1200
+ ($obj: Server, object: number, p0: string | null, p1: GLib.Variant): void
1201
+ }
1202
+
1203
+ /**
1204
+ * Signal callback interface for `item-updated`
1205
+ */
1206
+ export interface ItemUpdatedSignalCallback {
1207
+ ($obj: Server, object: number): void
1208
+ }
1209
+
1210
+ /**
1211
+ * Signal callback interface for `layout-updated`
1212
+ */
1213
+ export interface LayoutUpdatedSignalCallback {
1214
+ ($obj: Server, arg1: number, arg2: number): void
1215
+ }
1216
+
1217
+
1218
+ // Constructor properties interface
1219
+
1220
+ export interface ConstructorProperties extends GObject.Object.ConstructorProperties {
1221
+
1222
+ // Own constructor properties of Dbusmenu-0.4.Dbusmenu.Server
1223
+
1224
+ dbus_object?: string | null
1225
+ root_node?: Menuitem | null
1226
+ }
1227
+
1228
+ }
1229
+
1230
+ export interface Server {
1231
+
1232
+ // Own properties of Dbusmenu-0.4.Dbusmenu.Server
1233
+
1234
+ readonly dbus_object: string | null
1235
+ root_node: Menuitem
1236
+ readonly version: number
1237
+
1238
+ // Owm methods of Dbusmenu-0.4.Dbusmenu.Server
1239
+
1240
+ /**
1241
+ * Gets the stored and exported icon paths from the server.
1242
+ * @returns A NULL-terminated list of icon paths with memory managed by the server. Duplicate if you want to keep them.
1243
+ */
1244
+ get_icon_paths(): string[]
1245
+ /**
1246
+ * Gets the current statust hat the server is sending out over
1247
+ * DBus.
1248
+ *
1249
+ * Return value: The current status the server is sending
1250
+ */
1251
+ get_status(): Status
1252
+ /**
1253
+ * Returns the value of the text direction that is being exported
1254
+ * over DBus for this server. It should relate to the direction
1255
+ * of the labels and other text fields that are being exported by
1256
+ * this server.
1257
+ *
1258
+ * Return value: Text direction exported for this server.
1259
+ */
1260
+ get_text_direction(): TextDirection
1261
+ /**
1262
+ * Sets the icon paths for the server. This will replace previously
1263
+ * set icon theme paths.
1264
+ * @param icon_paths
1265
+ */
1266
+ set_icon_paths(icon_paths: string[]): void
1267
+ /**
1268
+ * This function contains all of the #GValue wrapping
1269
+ * required to set the property #DbusmenuServer:root-node
1270
+ * on the server `self`.
1271
+ * @param root The new root #DbusmenuMenuitem tree
1272
+ */
1273
+ set_root(root: Menuitem): void
1274
+ /**
1275
+ * Changes the status of the server.
1276
+ * @param status Status value to set on the server
1277
+ */
1278
+ set_status(status: Status): void
1279
+ /**
1280
+ * Sets the text direction that should be exported over DBus for
1281
+ * this server. If the value is set to #DBUSMENU_TEXT_DIRECTION_NONE
1282
+ * the default detection will be used for setting the value and
1283
+ * exported over DBus.
1284
+ * @param dir Direction of the text
1285
+ */
1286
+ set_text_direction(dir: TextDirection): void
1287
+
1288
+ // Own signals of Dbusmenu-0.4.Dbusmenu.Server
1289
+
1290
+ connect(sigName: "item-activation-requested", callback: Server.ItemActivationRequestedSignalCallback): number
1291
+ connect_after(sigName: "item-activation-requested", callback: Server.ItemActivationRequestedSignalCallback): number
1292
+ emit(sigName: "item-activation-requested", arg1: number, arg2: number, ...args: any[]): void
1293
+ connect(sigName: "item-property-updated", callback: Server.ItemPropertyUpdatedSignalCallback): number
1294
+ connect_after(sigName: "item-property-updated", callback: Server.ItemPropertyUpdatedSignalCallback): number
1295
+ emit(sigName: "item-property-updated", object: number, p0: string | null, p1: GLib.Variant, ...args: any[]): void
1296
+ connect(sigName: "item-updated", callback: Server.ItemUpdatedSignalCallback): number
1297
+ connect_after(sigName: "item-updated", callback: Server.ItemUpdatedSignalCallback): number
1298
+ emit(sigName: "item-updated", object: number, ...args: any[]): void
1299
+ connect(sigName: "layout-updated", callback: Server.LayoutUpdatedSignalCallback): number
1300
+ connect_after(sigName: "layout-updated", callback: Server.LayoutUpdatedSignalCallback): number
1301
+ emit(sigName: "layout-updated", arg1: number, arg2: number, ...args: any[]): void
1302
+
1303
+ // Class property signals of Dbusmenu-0.4.Dbusmenu.Server
1304
+
1305
+ connect(sigName: "notify::dbus-object", callback: (($obj: Server, pspec: GObject.ParamSpec) => void)): number
1306
+ connect_after(sigName: "notify::dbus-object", callback: (($obj: Server, pspec: GObject.ParamSpec) => void)): number
1307
+ emit(sigName: "notify::dbus-object", ...args: any[]): void
1308
+ connect(sigName: "notify::root-node", callback: (($obj: Server, pspec: GObject.ParamSpec) => void)): number
1309
+ connect_after(sigName: "notify::root-node", callback: (($obj: Server, pspec: GObject.ParamSpec) => void)): number
1310
+ emit(sigName: "notify::root-node", ...args: any[]): void
1311
+ connect(sigName: "notify::version", callback: (($obj: Server, pspec: GObject.ParamSpec) => void)): number
1312
+ connect_after(sigName: "notify::version", callback: (($obj: Server, pspec: GObject.ParamSpec) => void)): number
1313
+ emit(sigName: "notify::version", ...args: any[]): void
1314
+ connect(sigName: string, callback: (...args: any[]) => void): number
1315
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
1316
+ emit(sigName: string, ...args: any[]): void
1317
+ disconnect(id: number): void
1318
+ }
1319
+
1320
+ /**
1321
+ * A server which represents a sharing of a set of
1322
+ * #DbusmenuMenuitems across DBus to a #DbusmenuClient.
1323
+ * @class
1324
+ */
1325
+ export class Server extends GObject.Object {
1326
+
1327
+ // Own properties of Dbusmenu-0.4.Dbusmenu.Server
1328
+
1329
+ static name: string
1330
+ static $gtype: GObject.GType<Server>
1331
+
1332
+ // Constructors of Dbusmenu-0.4.Dbusmenu.Server
1333
+
1334
+ constructor(config?: Server.ConstructorProperties)
1335
+ /**
1336
+ * Creates a new #DbusmenuServer object with a specific object
1337
+ * path on DBus. If `object` is set to NULL the default object
1338
+ * name of "/com/canonical/dbusmenu" will be used.
1339
+ *
1340
+ * Return value: A brand new #DbusmenuServer
1341
+ * @constructor
1342
+ * @param object The object name to show for this menu structure on DBus. May be NULL.
1343
+ */
1344
+ constructor(object: string | null)
1345
+ /**
1346
+ * Creates a new #DbusmenuServer object with a specific object
1347
+ * path on DBus. If `object` is set to NULL the default object
1348
+ * name of "/com/canonical/dbusmenu" will be used.
1349
+ *
1350
+ * Return value: A brand new #DbusmenuServer
1351
+ * @constructor
1352
+ * @param object The object name to show for this menu structure on DBus. May be NULL.
1353
+ */
1354
+ static new(object: string | null): Server
1355
+ _init(config?: Server.ConstructorProperties): void
1356
+ }
1357
+
1358
+ export interface ClientClass {
1359
+
1360
+ // Own fields of Dbusmenu-0.4.Dbusmenu.ClientClass
1361
+
1362
+ /**
1363
+ * #GObjectClass
1364
+ * @field
1365
+ */
1366
+ parent_class: GObject.ObjectClass
1367
+ layout_updated: () => void
1368
+ root_changed: (newroot: Menuitem) => void
1369
+ new_menuitem: (newitem: Menuitem) => void
1370
+ item_activate: (item: Menuitem, timestamp: number) => void
1371
+ event_result: (item: Menuitem, event: string | null, data: GLib.Variant, timestamp: number, error: GLib.Error) => void
1372
+ icon_theme_dirs: (item: Menuitem, theme_dirs: any, error: GLib.Error) => void
1373
+ reserved1: () => void
1374
+ reserved2: () => void
1375
+ reserved3: () => void
1376
+ reserved4: () => void
1377
+ reserved5: () => void
1378
+ }
1379
+
1380
+ /**
1381
+ * A simple class that takes all of the information from a
1382
+ * #DbusmenuServer over DBus and makes the same set of
1383
+ * #DbusmenuMenuitem objects appear on the other side.
1384
+ * @record
1385
+ */
1386
+ export abstract class ClientClass {
1387
+
1388
+ // Own properties of Dbusmenu-0.4.Dbusmenu.ClientClass
1389
+
1390
+ static name: string
1391
+ }
1392
+
1393
+ export interface ClientPrivate {
1394
+ }
1395
+
1396
+ export class ClientPrivate {
1397
+
1398
+ // Own properties of Dbusmenu-0.4.Dbusmenu.ClientPrivate
1399
+
1400
+ static name: string
1401
+ }
1402
+
1403
+ export interface MenuitemClass {
1404
+
1405
+ // Own fields of Dbusmenu-0.4.Dbusmenu.MenuitemClass
1406
+
1407
+ /**
1408
+ * Functions and signals from our parent
1409
+ * @field
1410
+ */
1411
+ parent_class: GObject.ObjectClass
1412
+ property_changed: (property: string | null, value: GLib.Variant) => void
1413
+ item_activated: (timestamp: number) => void
1414
+ child_added: (child: Menuitem, position: number) => void
1415
+ child_removed: (child: Menuitem) => void
1416
+ child_moved: (child: Menuitem, newpos: number, oldpos: number) => void
1417
+ realized: () => void
1418
+ handle_event: (mi: Menuitem, name: string | null, variant: GLib.Variant, timestamp: number) => void
1419
+ show_to_user: (mi: Menuitem, timestamp: number, cb_data: any | null) => void
1420
+ about_to_show: () => boolean
1421
+ event: (name: string | null, value: GLib.Variant, timestamp: number) => void
1422
+ reserved1: () => void
1423
+ reserved2: () => void
1424
+ reserved3: () => void
1425
+ reserved4: () => void
1426
+ reserved5: () => void
1427
+ }
1428
+
1429
+ /**
1430
+ * Functions and signals that every menuitem should know something
1431
+ * about.
1432
+ * @record
1433
+ */
1434
+ export abstract class MenuitemClass {
1435
+
1436
+ // Own properties of Dbusmenu-0.4.Dbusmenu.MenuitemClass
1437
+
1438
+ static name: string
1439
+ }
1440
+
1441
+ export interface MenuitemPrivate {
1442
+ }
1443
+
1444
+ /**
1445
+ * These are the little secrets that we don't want getting
1446
+ * out of data that we have. They can still be gotten using
1447
+ * accessor functions, but are protected appropriately.
1448
+ * @record
1449
+ */
1450
+ export class MenuitemPrivate {
1451
+
1452
+ // Own properties of Dbusmenu-0.4.Dbusmenu.MenuitemPrivate
1453
+
1454
+ static name: string
1455
+ }
1456
+
1457
+ export interface MenuitemProxyClass {
1458
+
1459
+ // Own fields of Dbusmenu-0.4.Dbusmenu.MenuitemProxyClass
1460
+
1461
+ /**
1462
+ * The Class of #DbusmeneMenuitem
1463
+ * @field
1464
+ */
1465
+ parent_class: MenuitemClass
1466
+ reserved1: () => void
1467
+ reserved2: () => void
1468
+ reserved3: () => void
1469
+ reserved4: () => void
1470
+ }
1471
+
1472
+ /**
1473
+ * Functions and signal slots for #DbusmenuMenuitemProxy.
1474
+ * @record
1475
+ */
1476
+ export abstract class MenuitemProxyClass {
1477
+
1478
+ // Own properties of Dbusmenu-0.4.Dbusmenu.MenuitemProxyClass
1479
+
1480
+ static name: string
1481
+ }
1482
+
1483
+ export interface MenuitemProxyPrivate {
1484
+ }
1485
+
1486
+ export class MenuitemProxyPrivate {
1487
+
1488
+ // Own properties of Dbusmenu-0.4.Dbusmenu.MenuitemProxyPrivate
1489
+
1490
+ static name: string
1491
+ }
1492
+
1493
+ export interface ServerClass {
1494
+
1495
+ // Own fields of Dbusmenu-0.4.Dbusmenu.ServerClass
1496
+
1497
+ /**
1498
+ * #GObjectClass
1499
+ * @field
1500
+ */
1501
+ parent_class: GObject.ObjectClass
1502
+ id_prop_update: (id: number, property: string | null, value: string | null) => void
1503
+ id_update: (id: number) => void
1504
+ layout_updated: (revision: number) => void
1505
+ item_activation: (id: number, timestamp: number) => void
1506
+ reserved1: () => void
1507
+ reserved2: () => void
1508
+ reserved3: () => void
1509
+ reserved4: () => void
1510
+ reserved5: () => void
1511
+ reserved6: () => void
1512
+ }
1513
+
1514
+ /**
1515
+ * The class implementing the virtual functions for #DbusmenuServer.
1516
+ * @record
1517
+ */
1518
+ export abstract class ServerClass {
1519
+
1520
+ // Own properties of Dbusmenu-0.4.Dbusmenu.ServerClass
1521
+
1522
+ static name: string
1523
+ }
1524
+
1525
+ export interface ServerPrivate {
1526
+ }
1527
+
1528
+ export class ServerPrivate {
1529
+
1530
+ // Own properties of Dbusmenu-0.4.Dbusmenu.ServerPrivate
1531
+
1532
+ static name: string
1533
+ }
1534
+
1535
+ /**
1536
+ * Name of the imported GIR library
1537
+ * @see https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
1538
+ */
1539
+ export const __name__: string
1540
+ /**
1541
+ * Version of the imported GIR library
1542
+ * @see https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
1543
+ */
1544
+ export const __version__: string
1545
+ // END