@girs/mks-1 0.1.5-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/mks-1.d.ts ADDED
@@ -0,0 +1,2105 @@
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 './mks-1-ambient.d.ts';
9
+
10
+ /**
11
+ * Mks-1
12
+ */
13
+
14
+ import type Gtk from '@girs/gtk-4.0';
15
+ import type Gsk from '@girs/gsk-4.0';
16
+ import type Graphene from '@girs/graphene-1.0';
17
+ import type GObject from '@girs/gobject-2.0';
18
+ import type GLib from '@girs/glib-2.0';
19
+ import type Gdk from '@girs/gdk-4.0';
20
+ import type cairo from '@girs/cairo-1.0';
21
+ import type PangoCairo from '@girs/pangocairo-1.0';
22
+ import type Pango from '@girs/pango-1.0';
23
+ import type HarfBuzz from '@girs/harfbuzz-0.0';
24
+ import type freetype2 from '@girs/freetype2-2.0';
25
+ import type Gio from '@girs/gio-2.0';
26
+ import type GdkPixbuf from '@girs/gdkpixbuf-2.0';
27
+ import type GModule from '@girs/gmodule-2.0';
28
+
29
+ export namespace Mks {
30
+ /**
31
+ * A mouse button.
32
+ */
33
+ enum MouseButton {
34
+ /**
35
+ * Left button.
36
+ */
37
+ LEFT,
38
+ /**
39
+ * Middle button.
40
+ */
41
+ MIDDLE,
42
+ /**
43
+ * Right button.
44
+ */
45
+ RIGHT,
46
+ /**
47
+ * Wheel-up button.
48
+ */
49
+ WHEEL_UP,
50
+ /**
51
+ * Wheel-down button.
52
+ */
53
+ WHEEL_DOWN,
54
+ /**
55
+ * Side button.
56
+ */
57
+ SIDE,
58
+ /**
59
+ * Extra button.
60
+ */
61
+ EXTRA,
62
+ }
63
+ /**
64
+ * A screen kind.
65
+ */
66
+ enum ScreenKind {
67
+ /**
68
+ * A text only screen.
69
+ */
70
+ TEXT,
71
+ /**
72
+ * A graphical screen.
73
+ */
74
+ GRAPHIC,
75
+ }
76
+ /**
77
+ * The type of a touch event.
78
+ */
79
+ enum TouchEventKind {
80
+ /**
81
+ * The touch event has just started.
82
+ */
83
+ BEGIN,
84
+ /**
85
+ * The touch event has been updated.
86
+ */
87
+ UPDATE,
88
+ /**
89
+ * The touch event has finished.
90
+ */
91
+ END,
92
+ /**
93
+ * The touch event has been canceled.
94
+ */
95
+ CANCEL,
96
+ }
97
+ /**
98
+ * mks major version component (e.g. 1 if %MKS_VERSION is 1.2.3)
99
+ */
100
+ const MAJOR_VERSION: number;
101
+ /**
102
+ * mks micro version component (e.g. 3 if %MKS_VERSION is 1.2.3)
103
+ */
104
+ const MICRO_VERSION: number;
105
+ /**
106
+ * mks minor version component (e.g. 2 if %MKS_VERSION is 1.2.3)
107
+ */
108
+ const MINOR_VERSION: number;
109
+ /**
110
+ * mks version, encoded as a string, useful for printing and
111
+ * concatenation.
112
+ */
113
+ const VERSION_S: string;
114
+ /**
115
+ * The major version the library.
116
+ */
117
+ function get_major_version(): number;
118
+ /**
119
+ * The micro version the library.
120
+ */
121
+ function get_micro_version(): number;
122
+ /**
123
+ * The minor version the library.
124
+ */
125
+ function get_minor_version(): number;
126
+ /**
127
+ * Initializes the library.
128
+ *
129
+ * The function must be called before using any of the library functions.
130
+ */
131
+ function init(): void;
132
+ /**
133
+ * The active keyboard modifiers.
134
+ */
135
+ enum KeyboardModifier {
136
+ /**
137
+ * No modifier.
138
+ */
139
+ NONE,
140
+ /**
141
+ * Scroll lock.
142
+ */
143
+ SCROLL_LOCK,
144
+ /**
145
+ * Numeric lock.
146
+ */
147
+ NUM_LOCK,
148
+ /**
149
+ * Caps lock.
150
+ */
151
+ CAPS_LOCK,
152
+ }
153
+ module Device {
154
+ // Constructor properties interface
155
+
156
+ interface ConstructorProps extends GObject.Object.ConstructorProps {
157
+ name: string;
158
+ }
159
+ }
160
+
161
+ /**
162
+ * An abstraction of a virtualized QEMU device.
163
+ */
164
+ class Device extends GObject.Object {
165
+ static $gtype: GObject.GType<Device>;
166
+
167
+ // Own properties of Mks.Device
168
+
169
+ /**
170
+ * The device name.
171
+ */
172
+ get name(): string;
173
+
174
+ // Constructors of Mks.Device
175
+
176
+ constructor(properties?: Partial<Device.ConstructorProps>, ...args: any[]);
177
+
178
+ _init(...args: any[]): void;
179
+
180
+ // Own methods of Mks.Device
181
+
182
+ /**
183
+ * Gets the device name.
184
+ */
185
+ get_name(): string;
186
+ }
187
+
188
+ module Display {
189
+ // Constructor properties interface
190
+
191
+ interface ConstructorProps
192
+ extends Gtk.Widget.ConstructorProps,
193
+ Gtk.Accessible.ConstructorProps,
194
+ Gtk.Buildable.ConstructorProps,
195
+ Gtk.ConstraintTarget.ConstructorProps {
196
+ auto_resize: boolean;
197
+ autoResize: boolean;
198
+ screen: Screen;
199
+ ungrab_trigger: Gtk.ShortcutTrigger;
200
+ ungrabTrigger: Gtk.ShortcutTrigger;
201
+ }
202
+ }
203
+
204
+ class Display extends Gtk.Widget implements Gtk.Accessible, Gtk.Buildable, Gtk.ConstraintTarget {
205
+ static $gtype: GObject.GType<Display>;
206
+
207
+ // Own properties of Mks.Display
208
+
209
+ get auto_resize(): boolean;
210
+ set auto_resize(val: boolean);
211
+ get autoResize(): boolean;
212
+ set autoResize(val: boolean);
213
+ get screen(): Screen;
214
+ set screen(val: Screen);
215
+ get ungrab_trigger(): Gtk.ShortcutTrigger;
216
+ set ungrab_trigger(val: Gtk.ShortcutTrigger);
217
+ get ungrabTrigger(): Gtk.ShortcutTrigger;
218
+ set ungrabTrigger(val: Gtk.ShortcutTrigger);
219
+
220
+ // Constructors of Mks.Display
221
+
222
+ constructor(properties?: Partial<Display.ConstructorProps>, ...args: any[]);
223
+
224
+ _init(...args: any[]): void;
225
+
226
+ static ['new'](): Display;
227
+
228
+ // Own methods of Mks.Display
229
+
230
+ /**
231
+ * Get whether the widget will reconfigure the VM whenever
232
+ * it gets a new size allocation.
233
+ */
234
+ get_auto_resize(): boolean;
235
+ /**
236
+ * Retrieve the (`guest_x`, `guest_y`) position
237
+ * where the `event` happened.
238
+ *
239
+ * Could be useful for implementing touch support emulation.
240
+ * @param event A #GdkEvent
241
+ * @returns Whether the event has an associated position
242
+ */
243
+ get_event_position_in_guest(event: Gdk.Event): [boolean, number, number];
244
+ /**
245
+ * Gets the screen connected to the display.
246
+ * @returns a #MksScreen
247
+ */
248
+ get_screen(): Screen;
249
+ /**
250
+ * Gets the #GtkShortcutTrigger that will ungrab the display.
251
+ * @returns a #GtkShortcutTrigger
252
+ */
253
+ get_ungrab_trigger(): Gtk.ShortcutTrigger;
254
+ /**
255
+ * Sets whether the widget should reconfigure the VM
256
+ * with the allocated size of the widget.
257
+ * @param auto_resize Whether to auto resize or not
258
+ */
259
+ set_auto_resize(auto_resize: boolean): void;
260
+ set_screen(screen: Screen): void;
261
+ set_ungrab_trigger(trigger: Gtk.ShortcutTrigger): void;
262
+
263
+ // Inherited properties
264
+ /**
265
+ * The accessible role of the given `GtkAccessible` implementation.
266
+ *
267
+ * The accessible role cannot be changed once set.
268
+ */
269
+ get accessible_role(): Gtk.AccessibleRole;
270
+ set accessible_role(val: Gtk.AccessibleRole);
271
+ /**
272
+ * The accessible role of the given `GtkAccessible` implementation.
273
+ *
274
+ * The accessible role cannot be changed once set.
275
+ */
276
+ get accessibleRole(): Gtk.AccessibleRole;
277
+ set accessibleRole(val: Gtk.AccessibleRole);
278
+
279
+ // Inherited methods
280
+ /**
281
+ * Requests the user's screen reader to announce the given message.
282
+ *
283
+ * This kind of notification is useful for messages that
284
+ * either have only a visual representation or that are not
285
+ * exposed visually at all, e.g. a notification about a
286
+ * successful operation.
287
+ *
288
+ * Also, by using this API, you can ensure that the message
289
+ * does not interrupts the user's current screen reader output.
290
+ * @param message the string to announce
291
+ * @param priority the priority of the announcement
292
+ */
293
+ announce(message: string, priority: Gtk.AccessibleAnnouncementPriority): void;
294
+ /**
295
+ * Retrieves the accessible parent for an accessible object.
296
+ *
297
+ * This function returns `NULL` for top level widgets.
298
+ * @returns the accessible parent
299
+ */
300
+ get_accessible_parent(): Gtk.Accessible | null;
301
+ /**
302
+ * Retrieves the accessible role of an accessible object.
303
+ * @returns the accessible role
304
+ */
305
+ get_accessible_role(): Gtk.AccessibleRole;
306
+ /**
307
+ * Retrieves the accessible implementation for the given `GtkAccessible`.
308
+ * @returns the accessible implementation object
309
+ */
310
+ get_at_context(): Gtk.ATContext;
311
+ /**
312
+ * Queries the coordinates and dimensions of this accessible
313
+ *
314
+ * This functionality can be overridden by `GtkAccessible`
315
+ * implementations, e.g. to get the bounds from an ignored
316
+ * child widget.
317
+ * @returns true if the bounds are valid, and false otherwise
318
+ */
319
+ get_bounds(): [boolean, number, number, number, number];
320
+ /**
321
+ * Retrieves the first accessible child of an accessible object.
322
+ * @returns the first accessible child
323
+ */
324
+ get_first_accessible_child(): Gtk.Accessible | null;
325
+ /**
326
+ * Retrieves the next accessible sibling of an accessible object
327
+ * @returns the next accessible sibling
328
+ */
329
+ get_next_accessible_sibling(): Gtk.Accessible | null;
330
+ /**
331
+ * Query a platform state, such as focus.
332
+ *
333
+ * See gtk_accessible_platform_changed().
334
+ *
335
+ * This functionality can be overridden by `GtkAccessible`
336
+ * implementations, e.g. to get platform state from an ignored
337
+ * child widget, as is the case for `GtkText` wrappers.
338
+ * @param state platform state to query
339
+ * @returns the value of @state for the accessible
340
+ */
341
+ get_platform_state(state: Gtk.AccessiblePlatformState): boolean;
342
+ /**
343
+ * Resets the accessible `property` to its default value.
344
+ * @param property a `GtkAccessibleProperty`
345
+ */
346
+ reset_property(property: Gtk.AccessibleProperty): void;
347
+ /**
348
+ * Resets the accessible `relation` to its default value.
349
+ * @param relation a `GtkAccessibleRelation`
350
+ */
351
+ reset_relation(relation: Gtk.AccessibleRelation): void;
352
+ /**
353
+ * Resets the accessible `state` to its default value.
354
+ * @param state a `GtkAccessibleState`
355
+ */
356
+ reset_state(state: Gtk.AccessibleState): void;
357
+ /**
358
+ * Sets the parent and sibling of an accessible object.
359
+ *
360
+ * This function is meant to be used by accessible implementations that are
361
+ * not part of the widget hierarchy, and but act as a logical bridge between
362
+ * widgets. For instance, if a widget creates an object that holds metadata
363
+ * for each child, and you want that object to implement the `GtkAccessible`
364
+ * interface, you will use this function to ensure that the parent of each
365
+ * child widget is the metadata object, and the parent of each metadata
366
+ * object is the container widget.
367
+ * @param parent the parent accessible object
368
+ * @param next_sibling the sibling accessible object
369
+ */
370
+ set_accessible_parent(parent?: Gtk.Accessible | null, next_sibling?: Gtk.Accessible | null): void;
371
+ /**
372
+ * Updates the next accessible sibling of `self`.
373
+ *
374
+ * That might be useful when a new child of a custom `GtkAccessible`
375
+ * is created, and it needs to be linked to a previous child.
376
+ * @param new_sibling the new next accessible sibling to set
377
+ */
378
+ update_next_accessible_sibling(new_sibling?: Gtk.Accessible | null): void;
379
+ /**
380
+ * Updates an array of accessible properties.
381
+ *
382
+ * This function should be called by `GtkWidget` types whenever an accessible
383
+ * property change must be communicated to assistive technologies.
384
+ *
385
+ * This function is meant to be used by language bindings.
386
+ * @param properties an array of `GtkAccessibleProperty`
387
+ * @param values an array of `GValues`, one for each property
388
+ */
389
+ update_property(properties: Gtk.AccessibleProperty[], values: (GObject.Value | any)[]): void;
390
+ /**
391
+ * Updates an array of accessible relations.
392
+ *
393
+ * This function should be called by `GtkWidget` types whenever an accessible
394
+ * relation change must be communicated to assistive technologies.
395
+ *
396
+ * This function is meant to be used by language bindings.
397
+ * @param relations an array of `GtkAccessibleRelation`
398
+ * @param values an array of `GValues`, one for each relation
399
+ */
400
+ update_relation(relations: Gtk.AccessibleRelation[], values: (GObject.Value | any)[]): void;
401
+ /**
402
+ * Updates an array of accessible states.
403
+ *
404
+ * This function should be called by `GtkWidget` types whenever an accessible
405
+ * state change must be communicated to assistive technologies.
406
+ *
407
+ * This function is meant to be used by language bindings.
408
+ * @param states an array of `GtkAccessibleState`
409
+ * @param values an array of `GValues`, one for each state
410
+ */
411
+ update_state(states: Gtk.AccessibleState[], values: (GObject.Value | any)[]): void;
412
+ /**
413
+ * Retrieves the accessible parent for an accessible object.
414
+ *
415
+ * This function returns `NULL` for top level widgets.
416
+ */
417
+ vfunc_get_accessible_parent(): Gtk.Accessible | null;
418
+ /**
419
+ * Retrieves the accessible implementation for the given `GtkAccessible`.
420
+ */
421
+ vfunc_get_at_context(): Gtk.ATContext | null;
422
+ /**
423
+ * Queries the coordinates and dimensions of this accessible
424
+ *
425
+ * This functionality can be overridden by `GtkAccessible`
426
+ * implementations, e.g. to get the bounds from an ignored
427
+ * child widget.
428
+ */
429
+ vfunc_get_bounds(): [boolean, number, number, number, number];
430
+ /**
431
+ * Retrieves the first accessible child of an accessible object.
432
+ */
433
+ vfunc_get_first_accessible_child(): Gtk.Accessible | null;
434
+ /**
435
+ * Retrieves the next accessible sibling of an accessible object
436
+ */
437
+ vfunc_get_next_accessible_sibling(): Gtk.Accessible | null;
438
+ /**
439
+ * Query a platform state, such as focus.
440
+ *
441
+ * See gtk_accessible_platform_changed().
442
+ *
443
+ * This functionality can be overridden by `GtkAccessible`
444
+ * implementations, e.g. to get platform state from an ignored
445
+ * child widget, as is the case for `GtkText` wrappers.
446
+ * @param state platform state to query
447
+ */
448
+ vfunc_get_platform_state(state: Gtk.AccessiblePlatformState): boolean;
449
+ /**
450
+ * Gets the ID of the `buildable` object.
451
+ *
452
+ * `GtkBuilder` sets the name based on the ID attribute
453
+ * of the `<object>` tag used to construct the `buildable`.
454
+ * @returns the ID of the buildable object
455
+ */
456
+ get_buildable_id(): string | null;
457
+ /**
458
+ * Adds a child to `buildable`. `type` is an optional string
459
+ * describing how the child should be added.
460
+ * @param builder a `GtkBuilder`
461
+ * @param child child to add
462
+ * @param type kind of child or %NULL
463
+ */
464
+ vfunc_add_child(builder: Gtk.Builder, child: GObject.Object, type?: string | null): void;
465
+ /**
466
+ * Similar to gtk_buildable_parser_finished() but is
467
+ * called once for each custom tag handled by the `buildable`.
468
+ * @param builder a `GtkBuilder`
469
+ * @param child child object or %NULL for non-child tags
470
+ * @param tagname the name of the tag
471
+ * @param data user data created in custom_tag_start
472
+ */
473
+ vfunc_custom_finished(
474
+ builder: Gtk.Builder,
475
+ child: GObject.Object | null,
476
+ tagname: string,
477
+ data?: any | null,
478
+ ): void;
479
+ /**
480
+ * Called at the end of each custom element handled by
481
+ * the buildable.
482
+ * @param builder `GtkBuilder` used to construct this object
483
+ * @param child child object or %NULL for non-child tags
484
+ * @param tagname name of tag
485
+ * @param data user data that will be passed in to parser functions
486
+ */
487
+ vfunc_custom_tag_end(
488
+ builder: Gtk.Builder,
489
+ child: GObject.Object | null,
490
+ tagname: string,
491
+ data?: any | null,
492
+ ): void;
493
+ /**
494
+ * Called for each unknown element under `<child>`.
495
+ * @param builder a `GtkBuilder` used to construct this object
496
+ * @param child child object or %NULL for non-child tags
497
+ * @param tagname name of tag
498
+ */
499
+ vfunc_custom_tag_start(
500
+ builder: Gtk.Builder,
501
+ child: GObject.Object | null,
502
+ tagname: string,
503
+ ): [boolean, Gtk.BuildableParser, any];
504
+ /**
505
+ * The getter corresponding to `set_id`. Implement this
506
+ * if you implement `set_id`.
507
+ */
508
+ vfunc_get_id(): string;
509
+ /**
510
+ * Retrieves the internal child called `childname` of the `buildable` object.
511
+ * @param builder a `GtkBuilder`
512
+ * @param childname name of child
513
+ */
514
+ vfunc_get_internal_child<T = GObject.Object>(builder: Gtk.Builder, childname: string): T;
515
+ /**
516
+ * Called when a builder finishes the parsing
517
+ * of a UI definition. It is normally not necessary to implement this,
518
+ * unless you need to perform special cleanup actions. `GtkWindow` sets
519
+ * the `GtkWidget:visible` property here.
520
+ * @param builder
521
+ */
522
+ vfunc_parser_finished(builder: Gtk.Builder): void;
523
+ /**
524
+ * Sets a property of a buildable object.
525
+ * It is normally not necessary to implement this, g_object_set_property()
526
+ * is used by default. `GtkWindow` implements this to delay showing itself
527
+ * (i.e. setting the [property`Gtk`.Widget:visible] property) until the whole
528
+ * interface is created.
529
+ * @param builder
530
+ * @param name
531
+ * @param value
532
+ */
533
+ vfunc_set_buildable_property(builder: Gtk.Builder, name: string, value: GObject.Value | any): void;
534
+ /**
535
+ * Stores the id attribute given in the `GtkBuilder` UI definition.
536
+ * `GtkWidget` stores the name as object data. Implement this method if your
537
+ * object has some notion of “ID” and it makes sense to map the XML id
538
+ * attribute to it.
539
+ * @param id
540
+ */
541
+ vfunc_set_id(id: string): void;
542
+ /**
543
+ * Creates a binding between `source_property` on `source` and `target_property`
544
+ * on `target`.
545
+ *
546
+ * Whenever the `source_property` is changed the `target_property` is
547
+ * updated using the same value. For instance:
548
+ *
549
+ *
550
+ * ```c
551
+ * g_object_bind_property (action, "active", widget, "sensitive", 0);
552
+ * ```
553
+ *
554
+ *
555
+ * Will result in the "sensitive" property of the widget #GObject instance to be
556
+ * updated with the same value of the "active" property of the action #GObject
557
+ * instance.
558
+ *
559
+ * If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
560
+ * if `target_property` on `target` changes then the `source_property` on `source`
561
+ * will be updated as well.
562
+ *
563
+ * The binding will automatically be removed when either the `source` or the
564
+ * `target` instances are finalized. To remove the binding without affecting the
565
+ * `source` and the `target` you can just call g_object_unref() on the returned
566
+ * #GBinding instance.
567
+ *
568
+ * Removing the binding by calling g_object_unref() on it must only be done if
569
+ * the binding, `source` and `target` are only used from a single thread and it
570
+ * is clear that both `source` and `target` outlive the binding. Especially it
571
+ * is not safe to rely on this if the binding, `source` or `target` can be
572
+ * finalized from different threads. Keep another reference to the binding and
573
+ * use g_binding_unbind() instead to be on the safe side.
574
+ *
575
+ * A #GObject can have multiple bindings.
576
+ * @param source_property the property on @source to bind
577
+ * @param target the target #GObject
578
+ * @param target_property the property on @target to bind
579
+ * @param flags flags to pass to #GBinding
580
+ * @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
581
+ */
582
+ bind_property(
583
+ source_property: string,
584
+ target: GObject.Object,
585
+ target_property: string,
586
+ flags: GObject.BindingFlags,
587
+ ): GObject.Binding;
588
+ /**
589
+ * Complete version of g_object_bind_property().
590
+ *
591
+ * Creates a binding between `source_property` on `source` and `target_property`
592
+ * on `target,` allowing you to set the transformation functions to be used by
593
+ * the binding.
594
+ *
595
+ * If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
596
+ * if `target_property` on `target` changes then the `source_property` on `source`
597
+ * will be updated as well. The `transform_from` function is only used in case
598
+ * of bidirectional bindings, otherwise it will be ignored
599
+ *
600
+ * The binding will automatically be removed when either the `source` or the
601
+ * `target` instances are finalized. This will release the reference that is
602
+ * being held on the #GBinding instance; if you want to hold on to the
603
+ * #GBinding instance, you will need to hold a reference to it.
604
+ *
605
+ * To remove the binding, call g_binding_unbind().
606
+ *
607
+ * A #GObject can have multiple bindings.
608
+ *
609
+ * The same `user_data` parameter will be used for both `transform_to`
610
+ * and `transform_from` transformation functions; the `notify` function will
611
+ * be called once, when the binding is removed. If you need different data
612
+ * for each transformation function, please use
613
+ * g_object_bind_property_with_closures() instead.
614
+ * @param source_property the property on @source to bind
615
+ * @param target the target #GObject
616
+ * @param target_property the property on @target to bind
617
+ * @param flags flags to pass to #GBinding
618
+ * @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
619
+ * @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
620
+ * @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
621
+ * @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
622
+ */
623
+ bind_property_full(
624
+ source_property: string,
625
+ target: GObject.Object,
626
+ target_property: string,
627
+ flags: GObject.BindingFlags,
628
+ transform_to?: GObject.BindingTransformFunc | null,
629
+ transform_from?: GObject.BindingTransformFunc | null,
630
+ notify?: GLib.DestroyNotify | null,
631
+ ): GObject.Binding;
632
+ // Conflicted with GObject.Object.bind_property_full
633
+ bind_property_full(...args: never[]): any;
634
+ /**
635
+ * This function is intended for #GObject implementations to re-enforce
636
+ * a [floating][floating-ref] object reference. Doing this is seldom
637
+ * required: all #GInitiallyUnowneds are created with a floating reference
638
+ * which usually just needs to be sunken by calling g_object_ref_sink().
639
+ */
640
+ force_floating(): void;
641
+ /**
642
+ * Increases the freeze count on `object`. If the freeze count is
643
+ * non-zero, the emission of "notify" signals on `object` is
644
+ * stopped. The signals are queued until the freeze count is decreased
645
+ * to zero. Duplicate notifications are squashed so that at most one
646
+ * #GObject::notify signal is emitted for each property modified while the
647
+ * object is frozen.
648
+ *
649
+ * This is necessary for accessors that modify multiple properties to prevent
650
+ * premature notification while the object is still being modified.
651
+ */
652
+ freeze_notify(): void;
653
+ /**
654
+ * Gets a named field from the objects table of associations (see g_object_set_data()).
655
+ * @param key name of the key for that association
656
+ * @returns the data if found, or %NULL if no such data exists.
657
+ */
658
+ get_data(key: string): any | null;
659
+ get_property(property_name: string): any;
660
+ /**
661
+ * This function gets back user data pointers stored via
662
+ * g_object_set_qdata().
663
+ * @param quark A #GQuark, naming the user data pointer
664
+ * @returns The user data pointer set, or %NULL
665
+ */
666
+ get_qdata(quark: GLib.Quark): any | null;
667
+ /**
668
+ * Gets `n_properties` properties for an `object`.
669
+ * Obtained properties will be set to `values`. All properties must be valid.
670
+ * Warnings will be emitted and undefined behaviour may result if invalid
671
+ * properties are passed in.
672
+ * @param names the names of each property to get
673
+ * @param values the values of each property to get
674
+ */
675
+ getv(names: string[], values: (GObject.Value | any)[]): void;
676
+ /**
677
+ * Checks whether `object` has a [floating][floating-ref] reference.
678
+ * @returns %TRUE if @object has a floating reference
679
+ */
680
+ is_floating(): boolean;
681
+ /**
682
+ * Emits a "notify" signal for the property `property_name` on `object`.
683
+ *
684
+ * When possible, eg. when signaling a property change from within the class
685
+ * that registered the property, you should use g_object_notify_by_pspec()
686
+ * instead.
687
+ *
688
+ * Note that emission of the notify signal may be blocked with
689
+ * g_object_freeze_notify(). In this case, the signal emissions are queued
690
+ * and will be emitted (in reverse order) when g_object_thaw_notify() is
691
+ * called.
692
+ * @param property_name the name of a property installed on the class of @object.
693
+ */
694
+ notify(property_name: string): void;
695
+ /**
696
+ * Emits a "notify" signal for the property specified by `pspec` on `object`.
697
+ *
698
+ * This function omits the property name lookup, hence it is faster than
699
+ * g_object_notify().
700
+ *
701
+ * One way to avoid using g_object_notify() from within the
702
+ * class that registered the properties, and using g_object_notify_by_pspec()
703
+ * instead, is to store the GParamSpec used with
704
+ * g_object_class_install_property() inside a static array, e.g.:
705
+ *
706
+ *
707
+ * ```c
708
+ * typedef enum
709
+ * {
710
+ * PROP_FOO = 1,
711
+ * PROP_LAST
712
+ * } MyObjectProperty;
713
+ *
714
+ * static GParamSpec *properties[PROP_LAST];
715
+ *
716
+ * static void
717
+ * my_object_class_init (MyObjectClass *klass)
718
+ * {
719
+ * properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
720
+ * 0, 100,
721
+ * 50,
722
+ * G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
723
+ * g_object_class_install_property (gobject_class,
724
+ * PROP_FOO,
725
+ * properties[PROP_FOO]);
726
+ * }
727
+ * ```
728
+ *
729
+ *
730
+ * and then notify a change on the "foo" property with:
731
+ *
732
+ *
733
+ * ```c
734
+ * g_object_notify_by_pspec (self, properties[PROP_FOO]);
735
+ * ```
736
+ *
737
+ * @param pspec the #GParamSpec of a property installed on the class of @object.
738
+ */
739
+ notify_by_pspec(pspec: GObject.ParamSpec): void;
740
+ /**
741
+ * Increases the reference count of `object`.
742
+ *
743
+ * Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
744
+ * of `object` will be propagated to the return type (using the GCC typeof()
745
+ * extension), so any casting the caller needs to do on the return type must be
746
+ * explicit.
747
+ * @returns the same @object
748
+ */
749
+ ref(): GObject.Object;
750
+ /**
751
+ * Increase the reference count of `object,` and possibly remove the
752
+ * [floating][floating-ref] reference, if `object` has a floating reference.
753
+ *
754
+ * In other words, if the object is floating, then this call "assumes
755
+ * ownership" of the floating reference, converting it to a normal
756
+ * reference by clearing the floating flag while leaving the reference
757
+ * count unchanged. If the object is not floating, then this call
758
+ * adds a new normal reference increasing the reference count by one.
759
+ *
760
+ * Since GLib 2.56, the type of `object` will be propagated to the return type
761
+ * under the same conditions as for g_object_ref().
762
+ * @returns @object
763
+ */
764
+ ref_sink(): GObject.Object;
765
+ /**
766
+ * Releases all references to other objects. This can be used to break
767
+ * reference cycles.
768
+ *
769
+ * This function should only be called from object system implementations.
770
+ */
771
+ run_dispose(): void;
772
+ /**
773
+ * Each object carries around a table of associations from
774
+ * strings to pointers. This function lets you set an association.
775
+ *
776
+ * If the object already had an association with that name,
777
+ * the old association will be destroyed.
778
+ *
779
+ * Internally, the `key` is converted to a #GQuark using g_quark_from_string().
780
+ * This means a copy of `key` is kept permanently (even after `object` has been
781
+ * finalized) — so it is recommended to only use a small, bounded set of values
782
+ * for `key` in your program, to avoid the #GQuark storage growing unbounded.
783
+ * @param key name of the key
784
+ * @param data data to associate with that key
785
+ */
786
+ set_data(key: string, data?: any | null): void;
787
+ set_property(property_name: string, value: any): void;
788
+ /**
789
+ * Remove a specified datum from the object's data associations,
790
+ * without invoking the association's destroy handler.
791
+ * @param key name of the key
792
+ * @returns the data if found, or %NULL if no such data exists.
793
+ */
794
+ steal_data(key: string): any | null;
795
+ /**
796
+ * This function gets back user data pointers stored via
797
+ * g_object_set_qdata() and removes the `data` from object
798
+ * without invoking its destroy() function (if any was
799
+ * set).
800
+ * Usually, calling this function is only required to update
801
+ * user data pointers with a destroy notifier, for example:
802
+ *
803
+ * ```c
804
+ * void
805
+ * object_add_to_user_list (GObject *object,
806
+ * const gchar *new_string)
807
+ * {
808
+ * // the quark, naming the object data
809
+ * GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
810
+ * // retrieve the old string list
811
+ * GList *list = g_object_steal_qdata (object, quark_string_list);
812
+ *
813
+ * // prepend new string
814
+ * list = g_list_prepend (list, g_strdup (new_string));
815
+ * // this changed 'list', so we need to set it again
816
+ * g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
817
+ * }
818
+ * static void
819
+ * free_string_list (gpointer data)
820
+ * {
821
+ * GList *node, *list = data;
822
+ *
823
+ * for (node = list; node; node = node->next)
824
+ * g_free (node->data);
825
+ * g_list_free (list);
826
+ * }
827
+ * ```
828
+ *
829
+ * Using g_object_get_qdata() in the above example, instead of
830
+ * g_object_steal_qdata() would have left the destroy function set,
831
+ * and thus the partial string list would have been freed upon
832
+ * g_object_set_qdata_full().
833
+ * @param quark A #GQuark, naming the user data pointer
834
+ * @returns The user data pointer set, or %NULL
835
+ */
836
+ steal_qdata(quark: GLib.Quark): any | null;
837
+ /**
838
+ * Reverts the effect of a previous call to
839
+ * g_object_freeze_notify(). The freeze count is decreased on `object`
840
+ * and when it reaches zero, queued "notify" signals are emitted.
841
+ *
842
+ * Duplicate notifications for each property are squashed so that at most one
843
+ * #GObject::notify signal is emitted for each property, in the reverse order
844
+ * in which they have been queued.
845
+ *
846
+ * It is an error to call this function when the freeze count is zero.
847
+ */
848
+ thaw_notify(): void;
849
+ /**
850
+ * Decreases the reference count of `object`. When its reference count
851
+ * drops to 0, the object is finalized (i.e. its memory is freed).
852
+ *
853
+ * If the pointer to the #GObject may be reused in future (for example, if it is
854
+ * an instance variable of another object), it is recommended to clear the
855
+ * pointer to %NULL rather than retain a dangling pointer to a potentially
856
+ * invalid #GObject instance. Use g_clear_object() for this.
857
+ */
858
+ unref(): void;
859
+ /**
860
+ * This function essentially limits the life time of the `closure` to
861
+ * the life time of the object. That is, when the object is finalized,
862
+ * the `closure` is invalidated by calling g_closure_invalidate() on
863
+ * it, in order to prevent invocations of the closure with a finalized
864
+ * (nonexisting) object. Also, g_object_ref() and g_object_unref() are
865
+ * added as marshal guards to the `closure,` to ensure that an extra
866
+ * reference count is held on `object` during invocation of the
867
+ * `closure`. Usually, this function will be called on closures that
868
+ * use this `object` as closure data.
869
+ * @param closure #GClosure to watch
870
+ */
871
+ watch_closure(closure: GObject.Closure): void;
872
+ vfunc_constructed(): void;
873
+ vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
874
+ vfunc_dispose(): void;
875
+ vfunc_finalize(): void;
876
+ vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
877
+ /**
878
+ * Emits a "notify" signal for the property `property_name` on `object`.
879
+ *
880
+ * When possible, eg. when signaling a property change from within the class
881
+ * that registered the property, you should use g_object_notify_by_pspec()
882
+ * instead.
883
+ *
884
+ * Note that emission of the notify signal may be blocked with
885
+ * g_object_freeze_notify(). In this case, the signal emissions are queued
886
+ * and will be emitted (in reverse order) when g_object_thaw_notify() is
887
+ * called.
888
+ * @param pspec
889
+ */
890
+ vfunc_notify(pspec: GObject.ParamSpec): void;
891
+ vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
892
+ disconnect(id: number): void;
893
+ set(properties: { [key: string]: any }): void;
894
+ block_signal_handler(id: number): any;
895
+ unblock_signal_handler(id: number): any;
896
+ stop_emission_by_name(detailedName: string): any;
897
+ }
898
+
899
+ module Keyboard {
900
+ // Constructor properties interface
901
+
902
+ interface ConstructorProps extends Device.ConstructorProps {
903
+ modifiers: KeyboardModifier;
904
+ }
905
+ }
906
+
907
+ /**
908
+ * A virtualized QEMU keyboard.
909
+ */
910
+ class Keyboard extends Device {
911
+ static $gtype: GObject.GType<Keyboard>;
912
+
913
+ // Own properties of Mks.Keyboard
914
+
915
+ /**
916
+ * Active keyboard modifiers.
917
+ */
918
+ get modifiers(): KeyboardModifier;
919
+
920
+ // Constructors of Mks.Keyboard
921
+
922
+ constructor(properties?: Partial<Keyboard.ConstructorProps>, ...args: any[]);
923
+
924
+ _init(...args: any[]): void;
925
+
926
+ // Own static methods of Mks.Keyboard
927
+
928
+ /**
929
+ * Translate a keycode to a QEMU compatible one.
930
+ * @param keyval the keyval
931
+ * @param keycode the hardware keycode
932
+ */
933
+ static translate(keyval: number, keycode: number): number;
934
+
935
+ // Own methods of Mks.Keyboard
936
+
937
+ /**
938
+ * Get the active keyboard modifiers.
939
+ */
940
+ get_modifiers(): KeyboardModifier;
941
+ /**
942
+ * Presses `keycode`.
943
+ * @param keycode the hardware keycode
944
+ * @param cancellable a #GCancellable
945
+ * @param callback a #GAsyncReadyCallback to execute upon completion
946
+ */
947
+ press(
948
+ keycode: number,
949
+ cancellable?: Gio.Cancellable | null,
950
+ callback?: Gio.AsyncReadyCallback<this> | null,
951
+ ): void;
952
+ /**
953
+ * Completes a call to [method`Mks`.Keyboard.press].
954
+ * @param result a #GAsyncResult provided to callback
955
+ * @returns %TRUE if the operation completed successfully; otherwise %FALSE and @error is set.
956
+ */
957
+ press_finish(result: Gio.AsyncResult): boolean;
958
+ /**
959
+ * Synchronously press the `keycode`.
960
+ * @param keycode the hardware keycode
961
+ * @param cancellable a #GCancellable
962
+ * @returns %TRUE if the operation was acknowledged by the QEMU instance; otherwise %FALSE and @error is set.
963
+ */
964
+ press_sync(keycode: number, cancellable?: Gio.Cancellable | null): boolean;
965
+ /**
966
+ * Releases `keycode`.
967
+ * @param keycode the hardware keycode
968
+ * @param cancellable a #GCancellable
969
+ * @param callback a #GAsyncReadyCallback to execute upon completion
970
+ */
971
+ release(
972
+ keycode: number,
973
+ cancellable?: Gio.Cancellable | null,
974
+ callback?: Gio.AsyncReadyCallback<this> | null,
975
+ ): void;
976
+ /**
977
+ * Completes a call to [method`Mks`.Keyboard.release].
978
+ * @param result a #GAsyncResult provided to callback
979
+ * @returns %TRUE if the operation completed successfully; otherwise %FALSE and @error is set.
980
+ */
981
+ release_finish(result: Gio.AsyncResult): boolean;
982
+ /**
983
+ * Synchronously release the `keycode`.
984
+ * @param keycode the hardware keycode
985
+ * @param cancellable a #GCancellable
986
+ * @returns %TRUE if the operation was acknowledged by the QEMU instance; otherwise %FALSE and @error is set.
987
+ */
988
+ release_sync(keycode: number, cancellable?: Gio.Cancellable | null): boolean;
989
+ }
990
+
991
+ module Mouse {
992
+ // Constructor properties interface
993
+
994
+ interface ConstructorProps extends Device.ConstructorProps {
995
+ is_absolute: boolean;
996
+ isAbsolute: boolean;
997
+ }
998
+ }
999
+
1000
+ /**
1001
+ * A virtualized QEMU mouse.
1002
+ */
1003
+ class Mouse extends Device {
1004
+ static $gtype: GObject.GType<Mouse>;
1005
+
1006
+ // Own properties of Mks.Mouse
1007
+
1008
+ /**
1009
+ * Whether the mouse is using absolute movements.
1010
+ */
1011
+ get is_absolute(): boolean;
1012
+ /**
1013
+ * Whether the mouse is using absolute movements.
1014
+ */
1015
+ get isAbsolute(): boolean;
1016
+
1017
+ // Constructors of Mks.Mouse
1018
+
1019
+ constructor(properties?: Partial<Mouse.ConstructorProps>, ...args: any[]);
1020
+
1021
+ _init(...args: any[]): void;
1022
+
1023
+ // Own methods of Mks.Mouse
1024
+
1025
+ /**
1026
+ * Whether the mouse is using absolute movements.
1027
+ */
1028
+ get_is_absolute(): boolean;
1029
+ /**
1030
+ * Moves the mouse by delta_x and delta_y.
1031
+ * @param delta_x the x coordinate delta
1032
+ * @param delta_y the y coordinate delta
1033
+ * @param cancellable a #GCancellable
1034
+ * @param callback a #GAsyncReadyCallback to execute upon completion
1035
+ */
1036
+ move_by(
1037
+ delta_x: number,
1038
+ delta_y: number,
1039
+ cancellable?: Gio.Cancellable | null,
1040
+ callback?: Gio.AsyncReadyCallback<this> | null,
1041
+ ): void;
1042
+ /**
1043
+ * Completes a call to [method`Mks`.Mouse.move_by].
1044
+ * @param result a #GAsyncResult provided to callback
1045
+ * @returns %TRUE if the operation completed successfully; otherwise %FALSE and @error is set.
1046
+ */
1047
+ move_by_finish(result: Gio.AsyncResult): boolean;
1048
+ /**
1049
+ * Synchronously moves the mouse by delta_x and delta_y.
1050
+ * @param delta_x the x coordinate delta
1051
+ * @param delta_y the y coordinate delta
1052
+ * @param cancellable a #GCancellable
1053
+ * @returns %TRUE if the operation was acknowledged by the QEMU instance; otherwise %FALSE and @error is set.
1054
+ */
1055
+ move_by_sync(delta_x: number, delta_y: number, cancellable?: Gio.Cancellable | null): boolean;
1056
+ /**
1057
+ * Moves to the absolute position at coordinates (x,y).
1058
+ * @param x the x coordinate
1059
+ * @param y the y coordinate
1060
+ * @param cancellable a #GCancellable
1061
+ * @param callback a #GAsyncReadyCallback to execute upon completion
1062
+ */
1063
+ move_to(
1064
+ x: number,
1065
+ y: number,
1066
+ cancellable?: Gio.Cancellable | null,
1067
+ callback?: Gio.AsyncReadyCallback<this> | null,
1068
+ ): void;
1069
+ /**
1070
+ * Completes a call to [method`Mks`.Mouse.move_to].
1071
+ * @param result a #GAsyncResult provided to callback
1072
+ * @returns %TRUE if the operation completed successfully; otherwise %FALSE and @error is set.
1073
+ */
1074
+ move_to_finish(result: Gio.AsyncResult): boolean;
1075
+ /**
1076
+ * Synchronously moves to the absolute position at coordinates (x,y).
1077
+ * @param x the x coordinate
1078
+ * @param y the y coordinate
1079
+ * @param cancellable a #GCancellable
1080
+ * @returns %TRUE if the operation was acknowledged by the QEMU instance; otherwise %FALSE and @error is set.
1081
+ */
1082
+ move_to_sync(x: number, y: number, cancellable?: Gio.Cancellable | null): boolean;
1083
+ /**
1084
+ * Presses a mouse button.
1085
+ * @param button the #MksMouseButton that was pressed
1086
+ * @param cancellable a #GCancellable
1087
+ * @param callback a #GAsyncReadyCallback to execute upon completion
1088
+ */
1089
+ press(
1090
+ button: MouseButton,
1091
+ cancellable?: Gio.Cancellable | null,
1092
+ callback?: Gio.AsyncReadyCallback<this> | null,
1093
+ ): void;
1094
+ /**
1095
+ * Completes a call to [method`Mks`.Mouse.press].
1096
+ * @param result a #GAsyncResult provided to callback
1097
+ * @returns %TRUE if the operation completed successfully; otherwise %FALSE and @error is set.
1098
+ */
1099
+ press_finish(result: Gio.AsyncResult): boolean;
1100
+ /**
1101
+ * Synchronously press a mouse button.
1102
+ * @param button the #MksMouseButton that was released
1103
+ * @param cancellable a #GCancellable
1104
+ * @returns %TRUE if the operation was acknowledged by the QEMU instance; otherwise %FALSE and @error is set.
1105
+ */
1106
+ press_sync(button: MouseButton, cancellable?: Gio.Cancellable | null): boolean;
1107
+ /**
1108
+ * Releases a mouse button.
1109
+ * @param button the #MksMouseButton that was released
1110
+ * @param cancellable a #GCancellable
1111
+ * @param callback a #GAsyncReadyCallback to execute upon completion
1112
+ */
1113
+ release(
1114
+ button: MouseButton,
1115
+ cancellable?: Gio.Cancellable | null,
1116
+ callback?: Gio.AsyncReadyCallback<this> | null,
1117
+ ): void;
1118
+ /**
1119
+ * Completes a call to [method`Mks`.Mouse.release].
1120
+ * @param result a #GAsyncResult provided to callback
1121
+ * @returns %TRUE if the operation completed successfully; otherwise %FALSE and @error is set.
1122
+ */
1123
+ release_finish(result: Gio.AsyncResult): boolean;
1124
+ /**
1125
+ * Synchronously releases a mouse button.
1126
+ * @param button the #MksMouseButton that was released
1127
+ * @param cancellable a #GCancellable
1128
+ * @returns %TRUE if the operation was acknowledged by the QEMU instance; otherwise %FALSE and @error is set.
1129
+ */
1130
+ release_sync(button: MouseButton, cancellable?: Gio.Cancellable | null): boolean;
1131
+ }
1132
+
1133
+ module Screen {
1134
+ // Constructor properties interface
1135
+
1136
+ interface ConstructorProps extends Device.ConstructorProps {
1137
+ device_address: string;
1138
+ deviceAddress: string;
1139
+ height: number;
1140
+ keyboard: Keyboard;
1141
+ kind: ScreenKind;
1142
+ mouse: Mouse;
1143
+ number: number;
1144
+ width: number;
1145
+ }
1146
+ }
1147
+
1148
+ class Screen extends Device {
1149
+ static $gtype: GObject.GType<Screen>;
1150
+
1151
+ // Own properties of Mks.Screen
1152
+
1153
+ get device_address(): string;
1154
+ get deviceAddress(): string;
1155
+ get height(): number;
1156
+ get keyboard(): Keyboard;
1157
+ get kind(): ScreenKind;
1158
+ get mouse(): Mouse;
1159
+ get number(): number;
1160
+ get width(): number;
1161
+
1162
+ // Constructors of Mks.Screen
1163
+
1164
+ constructor(properties?: Partial<Screen.ConstructorProps>, ...args: any[]);
1165
+
1166
+ _init(...args: any[]): void;
1167
+
1168
+ // Own methods of Mks.Screen
1169
+
1170
+ /**
1171
+ * Asynchronously creates a #GdkPaintable that is updated with the
1172
+ * contents of the screen.
1173
+ *
1174
+ * This function registers a new `socketpair()` which is shared with
1175
+ * the QEMU instance to receive rendering updates. Those updates are
1176
+ * propagated to the resulting #GdkPainable which can be retrieved
1177
+ * using mks_screen_attach_finish() from `callback`.
1178
+ * @param cancellable a #GCancellable
1179
+ * @param callback a #GAsyncReadyCallback to execute upon completion
1180
+ */
1181
+ attach(cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback<this> | null): void;
1182
+ /**
1183
+ * Completes an asynchronous request to create a [iface`Gdk`.Paintable] containing
1184
+ * the contents of #MksScreen in the QEMU instance.
1185
+ *
1186
+ * The resulting [iface`Gdk`.Paintable] will be updated as changes are delivered
1187
+ * from QEMU over a private `socketpair()`. In the typical case, those
1188
+ * changes are propagated using a DMA-BUF and damage notifications.
1189
+ * @param result a #GAsyncResult provided to callback
1190
+ * @returns a #GdkPainable if successful; otherwise %NULL and @error is set.
1191
+ */
1192
+ attach_finish(result: Gio.AsyncResult): Gdk.Paintable;
1193
+ /**
1194
+ * Synchronous request to attach to screen, creating a paintable that can
1195
+ * be used to update display as the QEMU instance updates.
1196
+ * @param cancellable a #GCancellable or %NULL
1197
+ * @returns a #GdkPaintable if successful; otherwise %NULL and @error is set.
1198
+ */
1199
+ attach_sync(cancellable?: Gio.Cancellable | null): Gdk.Paintable;
1200
+ configure(
1201
+ attributes: ScreenAttributes,
1202
+ cancellable?: Gio.Cancellable | null,
1203
+ callback?: Gio.AsyncReadyCallback<this> | null,
1204
+ ): void;
1205
+ /**
1206
+ * Completes a call to mks_screen_configure().
1207
+ * @param result a #GAsyncResult provided to callback
1208
+ * @returns %TRUE if the operation completed successfully; otherwise %FALSE and @error is set.
1209
+ */
1210
+ configure_finish(result: Gio.AsyncResult): boolean;
1211
+ /**
1212
+ * Requests the QEMU instance reconfigure the screen using `attributes`.
1213
+ *
1214
+ * This function takes ownership of `attributes`.
1215
+ * @param attributes a #MksScreenAttributes
1216
+ * @param cancellable a #GCancellable
1217
+ * @returns %TRUE if the operation completed successfully; otherwise %FALSE and @error is set.
1218
+ */
1219
+ configure_sync(attributes: ScreenAttributes, cancellable?: Gio.Cancellable | null): boolean;
1220
+ get_device_address(): string;
1221
+ /**
1222
+ * Gets the "height" property.
1223
+ * @returns The height of the screen in pixels.
1224
+ */
1225
+ get_height(): number;
1226
+ /**
1227
+ * Gets the #MksScreen:keyboard property.
1228
+ * @returns a #MksKeyboard
1229
+ */
1230
+ get_keyboard(): Keyboard;
1231
+ /**
1232
+ * Gets the "kind" property.
1233
+ * @returns a #MksScreenKind
1234
+ */
1235
+ get_kind(): ScreenKind;
1236
+ /**
1237
+ * Gets the #MksScreen:mouse property.
1238
+ * @returns a #MksMouse
1239
+ */
1240
+ get_mouse(): Mouse;
1241
+ /**
1242
+ * Gets the "number" property.
1243
+ * @returns the screen number
1244
+ */
1245
+ get_number(): number;
1246
+ /**
1247
+ * Gets the #MksScreen:touchable property.
1248
+ * @returns a #MksTouchable
1249
+ */
1250
+ get_touchable(): Touchable;
1251
+ /**
1252
+ * Gets the "width" property.
1253
+ * @returns The width of the screen in pixels.
1254
+ */
1255
+ get_width(): number;
1256
+ }
1257
+
1258
+ module Session {
1259
+ // Constructor properties interface
1260
+
1261
+ interface ConstructorProps
1262
+ extends GObject.Object.ConstructorProps,
1263
+ Gio.AsyncInitable.ConstructorProps,
1264
+ Gio.Initable.ConstructorProps {
1265
+ connection: Gio.DBusConnection;
1266
+ devices: Gio.ListModel;
1267
+ name: string;
1268
+ uuid: string;
1269
+ }
1270
+ }
1271
+
1272
+ /**
1273
+ * Session connected to a QEMU VM
1274
+ *
1275
+ * The `MksSession` represents a connection to a QEMU VM instance. It contains
1276
+ * devices such as the mouse, keyboard, and screen which can be used with GTK.
1277
+ *
1278
+ * You may monitor [property`Mks`.Session:devices] using [signal`Gio`.ListModel::items-changed] to be
1279
+ * notified of changes to available devices in the session.
1280
+ *
1281
+ * # Connecting To QEMU
1282
+ *
1283
+ * To use `MksSession`, you should create your QEMU instance using `dbus` for
1284
+ * the various devices that support it. You'll need to provide your P2P D-Bus
1285
+ * address when connecting to QEMU.
1286
+ *
1287
+ * Using the same [class`Gio`.DBusConnection], create a `MksSession` with
1288
+ * [func`Mks`.Session.new_for_connection]. The `MksSession` instance will negotiate
1289
+ * with the peer to determine what devices are available and expose them
1290
+ * via the [property`Mks`.Session:devices] [iface`Gio`.ListModel].
1291
+ *
1292
+ * # Creating Widgets
1293
+ *
1294
+ * You can create a new widget to embed in your application by calling
1295
+ * [method`Mks`.Session.ref_screen] and set the screen for the [class`Mks`.Display]
1296
+ * with [method`Mks`.Display.set_screen].
1297
+ */
1298
+ class Session extends GObject.Object implements Gio.AsyncInitable<Session>, Gio.Initable {
1299
+ static $gtype: GObject.GType<Session>;
1300
+
1301
+ // Own properties of Mks.Session
1302
+
1303
+ /**
1304
+ * The [class`Gio`.DBusConnection] that is used to communicate with QEMU.
1305
+ */
1306
+ get connection(): Gio.DBusConnection;
1307
+ /**
1308
+ * A [iface`Gio`.ListModel] of devices that have been
1309
+ * discovered on the [class`Gio`.DBusConnection] to QEMU.
1310
+ */
1311
+ get devices(): Gio.ListModel;
1312
+ /**
1313
+ * The VM name as specified by the QEMU instance.
1314
+ */
1315
+ get name(): string;
1316
+ /**
1317
+ * The VM unique identifier specified by the QEMU instance.
1318
+ */
1319
+ get uuid(): string;
1320
+
1321
+ // Constructors of Mks.Session
1322
+
1323
+ constructor(properties?: Partial<Session.ConstructorProps>, ...args: any[]);
1324
+
1325
+ _init(...args: any[]): void;
1326
+
1327
+ static new_for_connection_finish(result: Gio.AsyncResult): Session;
1328
+
1329
+ static new_for_connection_sync(connection: Gio.DBusConnection, cancellable?: Gio.Cancellable | null): Session;
1330
+
1331
+ // Own static methods of Mks.Session
1332
+
1333
+ /**
1334
+ * Creates a #MksSession which communicates using `connection`.
1335
+ *
1336
+ * The [class`Gio`.DBusConnection] should be a private D-Bus connection to a QEMU
1337
+ * instance which has devices created using the "dbus" backend.
1338
+ *
1339
+ * `callback` will be executed when the session has been created or
1340
+ * failed to create.
1341
+ *
1342
+ * This function will not block the calling thread.
1343
+ *
1344
+ * use [ctor`Mks`.Session.new_for_connection_finish] to get the result of
1345
+ * this operation.
1346
+ * @param connection a #GDBusConnection
1347
+ * @param io_priority priority for IO operations
1348
+ * @param cancellable a #GCancellable or %NULL
1349
+ * @param callback a callback to execute upon completion of the operation
1350
+ */
1351
+ static new_for_connection(
1352
+ connection: Gio.DBusConnection,
1353
+ io_priority: number,
1354
+ cancellable?: Gio.Cancellable | null,
1355
+ callback?: Gio.AsyncReadyCallback<Session> | null,
1356
+ ): void;
1357
+
1358
+ // Own methods of Mks.Session
1359
+
1360
+ /**
1361
+ * Gets the DBus connection used for this session.
1362
+ * @returns a #GDBusConnection or %NULL if the connection has not been set, or was disposed.
1363
+ */
1364
+ get_connection(): Gio.DBusConnection | null;
1365
+ /**
1366
+ * Gets a #GListModel of devices connected to the session.
1367
+ * @returns a #GListModel of #MksDevice
1368
+ */
1369
+ get_devices(): Gio.ListModel;
1370
+ /**
1371
+ * Gets the name of the VM.
1372
+ */
1373
+ get_name(): string;
1374
+ /**
1375
+ * Gets the unique identifier of the VM.
1376
+ */
1377
+ get_uuid(): string;
1378
+ /**
1379
+ * Gets the main screen for the session.
1380
+ * @returns a #MksScreen or %NULL
1381
+ */
1382
+ ref_screen(): Screen | null;
1383
+
1384
+ // Inherited methods
1385
+ /**
1386
+ * Starts asynchronous initialization of the object implementing the
1387
+ * interface. This must be done before any real use of the object after
1388
+ * initial construction. If the object also implements #GInitable you can
1389
+ * optionally call g_initable_init() instead.
1390
+ *
1391
+ * This method is intended for language bindings. If writing in C,
1392
+ * g_async_initable_new_async() should typically be used instead.
1393
+ *
1394
+ * When the initialization is finished, `callback` will be called. You can
1395
+ * then call g_async_initable_init_finish() to get the result of the
1396
+ * initialization.
1397
+ *
1398
+ * Implementations may also support cancellation. If `cancellable` is not
1399
+ * %NULL, then initialization can be cancelled by triggering the cancellable
1400
+ * object from another thread. If the operation was cancelled, the error
1401
+ * %G_IO_ERROR_CANCELLED will be returned. If `cancellable` is not %NULL, and
1402
+ * the object doesn't support cancellable initialization, the error
1403
+ * %G_IO_ERROR_NOT_SUPPORTED will be returned.
1404
+ *
1405
+ * As with #GInitable, if the object is not initialized, or initialization
1406
+ * returns with an error, then all operations on the object except
1407
+ * g_object_ref() and g_object_unref() are considered to be invalid, and
1408
+ * have undefined behaviour. They will often fail with g_critical() or
1409
+ * g_warning(), but this must not be relied on.
1410
+ *
1411
+ * Callers should not assume that a class which implements #GAsyncInitable can
1412
+ * be initialized multiple times; for more information, see g_initable_init().
1413
+ * If a class explicitly supports being initialized multiple times,
1414
+ * implementation requires yielding all subsequent calls to init_async() on the
1415
+ * results of the first call.
1416
+ *
1417
+ * For classes that also support the #GInitable interface, the default
1418
+ * implementation of this method will run the g_initable_init() function
1419
+ * in a thread, so if you want to support asynchronous initialization via
1420
+ * threads, just implement the #GAsyncInitable interface without overriding
1421
+ * any interface methods.
1422
+ * @param io_priority the [I/O priority][io-priority] of the operation
1423
+ * @param cancellable optional #GCancellable object, %NULL to ignore.
1424
+ * @param callback a #GAsyncReadyCallback to call when the request is satisfied
1425
+ */
1426
+ init_async(
1427
+ io_priority: number,
1428
+ cancellable?: Gio.Cancellable | null,
1429
+ callback?: Gio.AsyncReadyCallback<this> | null,
1430
+ ): void;
1431
+ /**
1432
+ * Finishes asynchronous initialization and returns the result.
1433
+ * See g_async_initable_init_async().
1434
+ * @param res a #GAsyncResult.
1435
+ * @returns %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
1436
+ */
1437
+ init_finish(res: Gio.AsyncResult): boolean;
1438
+ /**
1439
+ * Finishes the async construction for the various g_async_initable_new
1440
+ * calls, returning the created object or %NULL on error.
1441
+ * @param res the #GAsyncResult from the callback
1442
+ * @returns a newly created #GObject, or %NULL on error. Free with g_object_unref().
1443
+ */
1444
+ new_finish(res: Gio.AsyncResult): Session;
1445
+ /**
1446
+ * Starts asynchronous initialization of the object implementing the
1447
+ * interface. This must be done before any real use of the object after
1448
+ * initial construction. If the object also implements #GInitable you can
1449
+ * optionally call g_initable_init() instead.
1450
+ *
1451
+ * This method is intended for language bindings. If writing in C,
1452
+ * g_async_initable_new_async() should typically be used instead.
1453
+ *
1454
+ * When the initialization is finished, `callback` will be called. You can
1455
+ * then call g_async_initable_init_finish() to get the result of the
1456
+ * initialization.
1457
+ *
1458
+ * Implementations may also support cancellation. If `cancellable` is not
1459
+ * %NULL, then initialization can be cancelled by triggering the cancellable
1460
+ * object from another thread. If the operation was cancelled, the error
1461
+ * %G_IO_ERROR_CANCELLED will be returned. If `cancellable` is not %NULL, and
1462
+ * the object doesn't support cancellable initialization, the error
1463
+ * %G_IO_ERROR_NOT_SUPPORTED will be returned.
1464
+ *
1465
+ * As with #GInitable, if the object is not initialized, or initialization
1466
+ * returns with an error, then all operations on the object except
1467
+ * g_object_ref() and g_object_unref() are considered to be invalid, and
1468
+ * have undefined behaviour. They will often fail with g_critical() or
1469
+ * g_warning(), but this must not be relied on.
1470
+ *
1471
+ * Callers should not assume that a class which implements #GAsyncInitable can
1472
+ * be initialized multiple times; for more information, see g_initable_init().
1473
+ * If a class explicitly supports being initialized multiple times,
1474
+ * implementation requires yielding all subsequent calls to init_async() on the
1475
+ * results of the first call.
1476
+ *
1477
+ * For classes that also support the #GInitable interface, the default
1478
+ * implementation of this method will run the g_initable_init() function
1479
+ * in a thread, so if you want to support asynchronous initialization via
1480
+ * threads, just implement the #GAsyncInitable interface without overriding
1481
+ * any interface methods.
1482
+ * @param io_priority the [I/O priority][io-priority] of the operation
1483
+ * @param cancellable optional #GCancellable object, %NULL to ignore.
1484
+ * @param callback a #GAsyncReadyCallback to call when the request is satisfied
1485
+ */
1486
+ vfunc_init_async(
1487
+ io_priority: number,
1488
+ cancellable?: Gio.Cancellable | null,
1489
+ callback?: Gio.AsyncReadyCallback<this> | null,
1490
+ ): void;
1491
+ /**
1492
+ * Finishes asynchronous initialization and returns the result.
1493
+ * See g_async_initable_init_async().
1494
+ * @param res a #GAsyncResult.
1495
+ */
1496
+ vfunc_init_finish(res: Gio.AsyncResult): boolean;
1497
+ /**
1498
+ * Initializes the object implementing the interface.
1499
+ *
1500
+ * This method is intended for language bindings. If writing in C,
1501
+ * g_initable_new() should typically be used instead.
1502
+ *
1503
+ * The object must be initialized before any real use after initial
1504
+ * construction, either with this function or g_async_initable_init_async().
1505
+ *
1506
+ * Implementations may also support cancellation. If `cancellable` is not %NULL,
1507
+ * then initialization can be cancelled by triggering the cancellable object
1508
+ * from another thread. If the operation was cancelled, the error
1509
+ * %G_IO_ERROR_CANCELLED will be returned. If `cancellable` is not %NULL and
1510
+ * the object doesn't support cancellable initialization the error
1511
+ * %G_IO_ERROR_NOT_SUPPORTED will be returned.
1512
+ *
1513
+ * If the object is not initialized, or initialization returns with an
1514
+ * error, then all operations on the object except g_object_ref() and
1515
+ * g_object_unref() are considered to be invalid, and have undefined
1516
+ * behaviour. See the [introduction][ginitable] for more details.
1517
+ *
1518
+ * Callers should not assume that a class which implements #GInitable can be
1519
+ * initialized multiple times, unless the class explicitly documents itself as
1520
+ * supporting this. Generally, a class’ implementation of init() can assume
1521
+ * (and assert) that it will only be called once. Previously, this documentation
1522
+ * recommended all #GInitable implementations should be idempotent; that
1523
+ * recommendation was relaxed in GLib 2.54.
1524
+ *
1525
+ * If a class explicitly supports being initialized multiple times, it is
1526
+ * recommended that the method is idempotent: multiple calls with the same
1527
+ * arguments should return the same results. Only the first call initializes
1528
+ * the object; further calls return the result of the first call.
1529
+ *
1530
+ * One reason why a class might need to support idempotent initialization is if
1531
+ * it is designed to be used via the singleton pattern, with a
1532
+ * #GObjectClass.constructor that sometimes returns an existing instance.
1533
+ * In this pattern, a caller would expect to be able to call g_initable_init()
1534
+ * on the result of g_object_new(), regardless of whether it is in fact a new
1535
+ * instance.
1536
+ * @param cancellable optional #GCancellable object, %NULL to ignore.
1537
+ * @returns %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
1538
+ */
1539
+ init(cancellable?: Gio.Cancellable | null): boolean;
1540
+ /**
1541
+ * Initializes the object implementing the interface.
1542
+ *
1543
+ * This method is intended for language bindings. If writing in C,
1544
+ * g_initable_new() should typically be used instead.
1545
+ *
1546
+ * The object must be initialized before any real use after initial
1547
+ * construction, either with this function or g_async_initable_init_async().
1548
+ *
1549
+ * Implementations may also support cancellation. If `cancellable` is not %NULL,
1550
+ * then initialization can be cancelled by triggering the cancellable object
1551
+ * from another thread. If the operation was cancelled, the error
1552
+ * %G_IO_ERROR_CANCELLED will be returned. If `cancellable` is not %NULL and
1553
+ * the object doesn't support cancellable initialization the error
1554
+ * %G_IO_ERROR_NOT_SUPPORTED will be returned.
1555
+ *
1556
+ * If the object is not initialized, or initialization returns with an
1557
+ * error, then all operations on the object except g_object_ref() and
1558
+ * g_object_unref() are considered to be invalid, and have undefined
1559
+ * behaviour. See the [introduction][ginitable] for more details.
1560
+ *
1561
+ * Callers should not assume that a class which implements #GInitable can be
1562
+ * initialized multiple times, unless the class explicitly documents itself as
1563
+ * supporting this. Generally, a class’ implementation of init() can assume
1564
+ * (and assert) that it will only be called once. Previously, this documentation
1565
+ * recommended all #GInitable implementations should be idempotent; that
1566
+ * recommendation was relaxed in GLib 2.54.
1567
+ *
1568
+ * If a class explicitly supports being initialized multiple times, it is
1569
+ * recommended that the method is idempotent: multiple calls with the same
1570
+ * arguments should return the same results. Only the first call initializes
1571
+ * the object; further calls return the result of the first call.
1572
+ *
1573
+ * One reason why a class might need to support idempotent initialization is if
1574
+ * it is designed to be used via the singleton pattern, with a
1575
+ * #GObjectClass.constructor that sometimes returns an existing instance.
1576
+ * In this pattern, a caller would expect to be able to call g_initable_init()
1577
+ * on the result of g_object_new(), regardless of whether it is in fact a new
1578
+ * instance.
1579
+ * @param cancellable optional #GCancellable object, %NULL to ignore.
1580
+ */
1581
+ vfunc_init(cancellable?: Gio.Cancellable | null): boolean;
1582
+ /**
1583
+ * Creates a binding between `source_property` on `source` and `target_property`
1584
+ * on `target`.
1585
+ *
1586
+ * Whenever the `source_property` is changed the `target_property` is
1587
+ * updated using the same value. For instance:
1588
+ *
1589
+ *
1590
+ * ```c
1591
+ * g_object_bind_property (action, "active", widget, "sensitive", 0);
1592
+ * ```
1593
+ *
1594
+ *
1595
+ * Will result in the "sensitive" property of the widget #GObject instance to be
1596
+ * updated with the same value of the "active" property of the action #GObject
1597
+ * instance.
1598
+ *
1599
+ * If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
1600
+ * if `target_property` on `target` changes then the `source_property` on `source`
1601
+ * will be updated as well.
1602
+ *
1603
+ * The binding will automatically be removed when either the `source` or the
1604
+ * `target` instances are finalized. To remove the binding without affecting the
1605
+ * `source` and the `target` you can just call g_object_unref() on the returned
1606
+ * #GBinding instance.
1607
+ *
1608
+ * Removing the binding by calling g_object_unref() on it must only be done if
1609
+ * the binding, `source` and `target` are only used from a single thread and it
1610
+ * is clear that both `source` and `target` outlive the binding. Especially it
1611
+ * is not safe to rely on this if the binding, `source` or `target` can be
1612
+ * finalized from different threads. Keep another reference to the binding and
1613
+ * use g_binding_unbind() instead to be on the safe side.
1614
+ *
1615
+ * A #GObject can have multiple bindings.
1616
+ * @param source_property the property on @source to bind
1617
+ * @param target the target #GObject
1618
+ * @param target_property the property on @target to bind
1619
+ * @param flags flags to pass to #GBinding
1620
+ * @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
1621
+ */
1622
+ bind_property(
1623
+ source_property: string,
1624
+ target: GObject.Object,
1625
+ target_property: string,
1626
+ flags: GObject.BindingFlags,
1627
+ ): GObject.Binding;
1628
+ /**
1629
+ * Complete version of g_object_bind_property().
1630
+ *
1631
+ * Creates a binding between `source_property` on `source` and `target_property`
1632
+ * on `target,` allowing you to set the transformation functions to be used by
1633
+ * the binding.
1634
+ *
1635
+ * If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
1636
+ * if `target_property` on `target` changes then the `source_property` on `source`
1637
+ * will be updated as well. The `transform_from` function is only used in case
1638
+ * of bidirectional bindings, otherwise it will be ignored
1639
+ *
1640
+ * The binding will automatically be removed when either the `source` or the
1641
+ * `target` instances are finalized. This will release the reference that is
1642
+ * being held on the #GBinding instance; if you want to hold on to the
1643
+ * #GBinding instance, you will need to hold a reference to it.
1644
+ *
1645
+ * To remove the binding, call g_binding_unbind().
1646
+ *
1647
+ * A #GObject can have multiple bindings.
1648
+ *
1649
+ * The same `user_data` parameter will be used for both `transform_to`
1650
+ * and `transform_from` transformation functions; the `notify` function will
1651
+ * be called once, when the binding is removed. If you need different data
1652
+ * for each transformation function, please use
1653
+ * g_object_bind_property_with_closures() instead.
1654
+ * @param source_property the property on @source to bind
1655
+ * @param target the target #GObject
1656
+ * @param target_property the property on @target to bind
1657
+ * @param flags flags to pass to #GBinding
1658
+ * @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
1659
+ * @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
1660
+ * @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
1661
+ * @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
1662
+ */
1663
+ bind_property_full(
1664
+ source_property: string,
1665
+ target: GObject.Object,
1666
+ target_property: string,
1667
+ flags: GObject.BindingFlags,
1668
+ transform_to?: GObject.BindingTransformFunc | null,
1669
+ transform_from?: GObject.BindingTransformFunc | null,
1670
+ notify?: GLib.DestroyNotify | null,
1671
+ ): GObject.Binding;
1672
+ // Conflicted with GObject.Object.bind_property_full
1673
+ bind_property_full(...args: never[]): any;
1674
+ /**
1675
+ * This function is intended for #GObject implementations to re-enforce
1676
+ * a [floating][floating-ref] object reference. Doing this is seldom
1677
+ * required: all #GInitiallyUnowneds are created with a floating reference
1678
+ * which usually just needs to be sunken by calling g_object_ref_sink().
1679
+ */
1680
+ force_floating(): void;
1681
+ /**
1682
+ * Increases the freeze count on `object`. If the freeze count is
1683
+ * non-zero, the emission of "notify" signals on `object` is
1684
+ * stopped. The signals are queued until the freeze count is decreased
1685
+ * to zero. Duplicate notifications are squashed so that at most one
1686
+ * #GObject::notify signal is emitted for each property modified while the
1687
+ * object is frozen.
1688
+ *
1689
+ * This is necessary for accessors that modify multiple properties to prevent
1690
+ * premature notification while the object is still being modified.
1691
+ */
1692
+ freeze_notify(): void;
1693
+ /**
1694
+ * Gets a named field from the objects table of associations (see g_object_set_data()).
1695
+ * @param key name of the key for that association
1696
+ * @returns the data if found, or %NULL if no such data exists.
1697
+ */
1698
+ get_data(key: string): any | null;
1699
+ get_property(property_name: string): any;
1700
+ /**
1701
+ * This function gets back user data pointers stored via
1702
+ * g_object_set_qdata().
1703
+ * @param quark A #GQuark, naming the user data pointer
1704
+ * @returns The user data pointer set, or %NULL
1705
+ */
1706
+ get_qdata(quark: GLib.Quark): any | null;
1707
+ /**
1708
+ * Gets `n_properties` properties for an `object`.
1709
+ * Obtained properties will be set to `values`. All properties must be valid.
1710
+ * Warnings will be emitted and undefined behaviour may result if invalid
1711
+ * properties are passed in.
1712
+ * @param names the names of each property to get
1713
+ * @param values the values of each property to get
1714
+ */
1715
+ getv(names: string[], values: (GObject.Value | any)[]): void;
1716
+ /**
1717
+ * Checks whether `object` has a [floating][floating-ref] reference.
1718
+ * @returns %TRUE if @object has a floating reference
1719
+ */
1720
+ is_floating(): boolean;
1721
+ /**
1722
+ * Emits a "notify" signal for the property `property_name` on `object`.
1723
+ *
1724
+ * When possible, eg. when signaling a property change from within the class
1725
+ * that registered the property, you should use g_object_notify_by_pspec()
1726
+ * instead.
1727
+ *
1728
+ * Note that emission of the notify signal may be blocked with
1729
+ * g_object_freeze_notify(). In this case, the signal emissions are queued
1730
+ * and will be emitted (in reverse order) when g_object_thaw_notify() is
1731
+ * called.
1732
+ * @param property_name the name of a property installed on the class of @object.
1733
+ */
1734
+ notify(property_name: string): void;
1735
+ /**
1736
+ * Emits a "notify" signal for the property specified by `pspec` on `object`.
1737
+ *
1738
+ * This function omits the property name lookup, hence it is faster than
1739
+ * g_object_notify().
1740
+ *
1741
+ * One way to avoid using g_object_notify() from within the
1742
+ * class that registered the properties, and using g_object_notify_by_pspec()
1743
+ * instead, is to store the GParamSpec used with
1744
+ * g_object_class_install_property() inside a static array, e.g.:
1745
+ *
1746
+ *
1747
+ * ```c
1748
+ * typedef enum
1749
+ * {
1750
+ * PROP_FOO = 1,
1751
+ * PROP_LAST
1752
+ * } MyObjectProperty;
1753
+ *
1754
+ * static GParamSpec *properties[PROP_LAST];
1755
+ *
1756
+ * static void
1757
+ * my_object_class_init (MyObjectClass *klass)
1758
+ * {
1759
+ * properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
1760
+ * 0, 100,
1761
+ * 50,
1762
+ * G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
1763
+ * g_object_class_install_property (gobject_class,
1764
+ * PROP_FOO,
1765
+ * properties[PROP_FOO]);
1766
+ * }
1767
+ * ```
1768
+ *
1769
+ *
1770
+ * and then notify a change on the "foo" property with:
1771
+ *
1772
+ *
1773
+ * ```c
1774
+ * g_object_notify_by_pspec (self, properties[PROP_FOO]);
1775
+ * ```
1776
+ *
1777
+ * @param pspec the #GParamSpec of a property installed on the class of @object.
1778
+ */
1779
+ notify_by_pspec(pspec: GObject.ParamSpec): void;
1780
+ /**
1781
+ * Increases the reference count of `object`.
1782
+ *
1783
+ * Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
1784
+ * of `object` will be propagated to the return type (using the GCC typeof()
1785
+ * extension), so any casting the caller needs to do on the return type must be
1786
+ * explicit.
1787
+ * @returns the same @object
1788
+ */
1789
+ ref(): GObject.Object;
1790
+ /**
1791
+ * Increase the reference count of `object,` and possibly remove the
1792
+ * [floating][floating-ref] reference, if `object` has a floating reference.
1793
+ *
1794
+ * In other words, if the object is floating, then this call "assumes
1795
+ * ownership" of the floating reference, converting it to a normal
1796
+ * reference by clearing the floating flag while leaving the reference
1797
+ * count unchanged. If the object is not floating, then this call
1798
+ * adds a new normal reference increasing the reference count by one.
1799
+ *
1800
+ * Since GLib 2.56, the type of `object` will be propagated to the return type
1801
+ * under the same conditions as for g_object_ref().
1802
+ * @returns @object
1803
+ */
1804
+ ref_sink(): GObject.Object;
1805
+ /**
1806
+ * Releases all references to other objects. This can be used to break
1807
+ * reference cycles.
1808
+ *
1809
+ * This function should only be called from object system implementations.
1810
+ */
1811
+ run_dispose(): void;
1812
+ /**
1813
+ * Each object carries around a table of associations from
1814
+ * strings to pointers. This function lets you set an association.
1815
+ *
1816
+ * If the object already had an association with that name,
1817
+ * the old association will be destroyed.
1818
+ *
1819
+ * Internally, the `key` is converted to a #GQuark using g_quark_from_string().
1820
+ * This means a copy of `key` is kept permanently (even after `object` has been
1821
+ * finalized) — so it is recommended to only use a small, bounded set of values
1822
+ * for `key` in your program, to avoid the #GQuark storage growing unbounded.
1823
+ * @param key name of the key
1824
+ * @param data data to associate with that key
1825
+ */
1826
+ set_data(key: string, data?: any | null): void;
1827
+ set_property(property_name: string, value: any): void;
1828
+ /**
1829
+ * Remove a specified datum from the object's data associations,
1830
+ * without invoking the association's destroy handler.
1831
+ * @param key name of the key
1832
+ * @returns the data if found, or %NULL if no such data exists.
1833
+ */
1834
+ steal_data(key: string): any | null;
1835
+ /**
1836
+ * This function gets back user data pointers stored via
1837
+ * g_object_set_qdata() and removes the `data` from object
1838
+ * without invoking its destroy() function (if any was
1839
+ * set).
1840
+ * Usually, calling this function is only required to update
1841
+ * user data pointers with a destroy notifier, for example:
1842
+ *
1843
+ * ```c
1844
+ * void
1845
+ * object_add_to_user_list (GObject *object,
1846
+ * const gchar *new_string)
1847
+ * {
1848
+ * // the quark, naming the object data
1849
+ * GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
1850
+ * // retrieve the old string list
1851
+ * GList *list = g_object_steal_qdata (object, quark_string_list);
1852
+ *
1853
+ * // prepend new string
1854
+ * list = g_list_prepend (list, g_strdup (new_string));
1855
+ * // this changed 'list', so we need to set it again
1856
+ * g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
1857
+ * }
1858
+ * static void
1859
+ * free_string_list (gpointer data)
1860
+ * {
1861
+ * GList *node, *list = data;
1862
+ *
1863
+ * for (node = list; node; node = node->next)
1864
+ * g_free (node->data);
1865
+ * g_list_free (list);
1866
+ * }
1867
+ * ```
1868
+ *
1869
+ * Using g_object_get_qdata() in the above example, instead of
1870
+ * g_object_steal_qdata() would have left the destroy function set,
1871
+ * and thus the partial string list would have been freed upon
1872
+ * g_object_set_qdata_full().
1873
+ * @param quark A #GQuark, naming the user data pointer
1874
+ * @returns The user data pointer set, or %NULL
1875
+ */
1876
+ steal_qdata(quark: GLib.Quark): any | null;
1877
+ /**
1878
+ * Reverts the effect of a previous call to
1879
+ * g_object_freeze_notify(). The freeze count is decreased on `object`
1880
+ * and when it reaches zero, queued "notify" signals are emitted.
1881
+ *
1882
+ * Duplicate notifications for each property are squashed so that at most one
1883
+ * #GObject::notify signal is emitted for each property, in the reverse order
1884
+ * in which they have been queued.
1885
+ *
1886
+ * It is an error to call this function when the freeze count is zero.
1887
+ */
1888
+ thaw_notify(): void;
1889
+ /**
1890
+ * Decreases the reference count of `object`. When its reference count
1891
+ * drops to 0, the object is finalized (i.e. its memory is freed).
1892
+ *
1893
+ * If the pointer to the #GObject may be reused in future (for example, if it is
1894
+ * an instance variable of another object), it is recommended to clear the
1895
+ * pointer to %NULL rather than retain a dangling pointer to a potentially
1896
+ * invalid #GObject instance. Use g_clear_object() for this.
1897
+ */
1898
+ unref(): void;
1899
+ /**
1900
+ * This function essentially limits the life time of the `closure` to
1901
+ * the life time of the object. That is, when the object is finalized,
1902
+ * the `closure` is invalidated by calling g_closure_invalidate() on
1903
+ * it, in order to prevent invocations of the closure with a finalized
1904
+ * (nonexisting) object. Also, g_object_ref() and g_object_unref() are
1905
+ * added as marshal guards to the `closure,` to ensure that an extra
1906
+ * reference count is held on `object` during invocation of the
1907
+ * `closure`. Usually, this function will be called on closures that
1908
+ * use this `object` as closure data.
1909
+ * @param closure #GClosure to watch
1910
+ */
1911
+ watch_closure(closure: GObject.Closure): void;
1912
+ vfunc_constructed(): void;
1913
+ vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
1914
+ vfunc_dispose(): void;
1915
+ vfunc_finalize(): void;
1916
+ vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
1917
+ /**
1918
+ * Emits a "notify" signal for the property `property_name` on `object`.
1919
+ *
1920
+ * When possible, eg. when signaling a property change from within the class
1921
+ * that registered the property, you should use g_object_notify_by_pspec()
1922
+ * instead.
1923
+ *
1924
+ * Note that emission of the notify signal may be blocked with
1925
+ * g_object_freeze_notify(). In this case, the signal emissions are queued
1926
+ * and will be emitted (in reverse order) when g_object_thaw_notify() is
1927
+ * called.
1928
+ * @param pspec
1929
+ */
1930
+ vfunc_notify(pspec: GObject.ParamSpec): void;
1931
+ vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
1932
+ disconnect(id: number): void;
1933
+ set(properties: { [key: string]: any }): void;
1934
+ block_signal_handler(id: number): any;
1935
+ unblock_signal_handler(id: number): any;
1936
+ stop_emission_by_name(detailedName: string): any;
1937
+ }
1938
+
1939
+ module Touchable {
1940
+ // Constructor properties interface
1941
+
1942
+ interface ConstructorProps extends Device.ConstructorProps {
1943
+ max_slots: number;
1944
+ maxSlots: number;
1945
+ }
1946
+ }
1947
+
1948
+ /**
1949
+ * A virtualized QEMU touch device.
1950
+ */
1951
+ class Touchable extends Device {
1952
+ static $gtype: GObject.GType<Touchable>;
1953
+
1954
+ // Own properties of Mks.Touchable
1955
+
1956
+ /**
1957
+ * The maximum number of slots.
1958
+ */
1959
+ get max_slots(): number;
1960
+ /**
1961
+ * The maximum number of slots.
1962
+ */
1963
+ get maxSlots(): number;
1964
+
1965
+ // Constructors of Mks.Touchable
1966
+
1967
+ constructor(properties?: Partial<Touchable.ConstructorProps>, ...args: any[]);
1968
+
1969
+ _init(...args: any[]): void;
1970
+
1971
+ // Own methods of Mks.Touchable
1972
+
1973
+ /**
1974
+ * Returns the maximum number of slots.
1975
+ */
1976
+ get_max_slots(): number;
1977
+ /**
1978
+ * Send a touch event.
1979
+ * @param kind
1980
+ * @param num_slot the slot number
1981
+ * @param x the x absolute coordinate
1982
+ * @param y the y absolute coordinate
1983
+ * @param cancellable a #GCancellable
1984
+ * @param callback a #GAsyncReadyCallback to execute upon completion
1985
+ */
1986
+ send_event(
1987
+ kind: TouchEventKind,
1988
+ num_slot: number,
1989
+ x: number,
1990
+ y: number,
1991
+ cancellable?: Gio.Cancellable | null,
1992
+ callback?: Gio.AsyncReadyCallback<this> | null,
1993
+ ): void;
1994
+ /**
1995
+ * Completes a call to [method`Mks`.Touchable.send_event].
1996
+ * @param result a #GAsyncResult provided to callback
1997
+ * @returns %TRUE if the operation completed successfully; otherwise %FALSE and @error is set.
1998
+ */
1999
+ send_event_finish(result: Gio.AsyncResult): boolean;
2000
+ /**
2001
+ * Synchronously send a touch event.
2002
+ * @param kind the event kind
2003
+ * @param num_slot the slot number
2004
+ * @param x the x absolute coordinate
2005
+ * @param y the y absolute coordinate
2006
+ * @param cancellable a #GCancellable
2007
+ * @returns %TRUE if the operation was acknowledged by the QEMU instance; otherwise %FALSE and @error is set.
2008
+ */
2009
+ send_event_sync(
2010
+ kind: TouchEventKind,
2011
+ num_slot: number,
2012
+ x: number,
2013
+ y: number,
2014
+ cancellable?: Gio.Cancellable | null,
2015
+ ): boolean;
2016
+ }
2017
+
2018
+ type DeviceClass = typeof Device;
2019
+ type DisplayClass = typeof Display;
2020
+ type KeyboardClass = typeof Keyboard;
2021
+ type MouseClass = typeof Mouse;
2022
+ /**
2023
+ * Screen attributes.
2024
+ *
2025
+ * The attributes are used to reconfigure the QEMU instance with
2026
+ * [method`Mks`.Screen.configure] or [method`Mks`.Screen.configure_sync].
2027
+ */
2028
+ class ScreenAttributes {
2029
+ static $gtype: GObject.GType<ScreenAttributes>;
2030
+
2031
+ // Constructors of Mks.ScreenAttributes
2032
+
2033
+ constructor(properties?: Partial<{}>);
2034
+ _init(...args: any[]): void;
2035
+
2036
+ static ['new'](): ScreenAttributes;
2037
+
2038
+ // Own methods of Mks.ScreenAttributes
2039
+
2040
+ /**
2041
+ * Makes a deep copy of a #MksScreenAttributes.
2042
+ * @returns A newly created #MksScreenAttributes with the same contents as @self. If @self is %NULL, %NULL is returned.
2043
+ */
2044
+ copy(): ScreenAttributes;
2045
+ /**
2046
+ * Returns `true` if the two attributes are equal, `false` otherwise.
2047
+ * @param other a #MksScreenAttributes
2048
+ */
2049
+ equal(other: ScreenAttributes): boolean;
2050
+ /**
2051
+ * Frees a #MksScreenAttributes.
2052
+ *
2053
+ * Allocated using [ctor`Mks`.ScreenAttributes.new]
2054
+ * or [method`Mks`.ScreenAttributes.copy].
2055
+ */
2056
+ free(): void;
2057
+ /**
2058
+ * Set the screen height in pixels.
2059
+ * @param height The screen height.
2060
+ */
2061
+ set_height(height: number): void;
2062
+ /**
2063
+ * Set the screen height in millimeters.
2064
+ * @param height_mm The screen height.
2065
+ */
2066
+ set_height_mm(height_mm: number): void;
2067
+ /**
2068
+ * Set the screen width in pixels.
2069
+ * @param width The screen width.
2070
+ */
2071
+ set_width(width: number): void;
2072
+ /**
2073
+ * Set the screen width in millimeters.
2074
+ * @param width_mm The screen width.
2075
+ */
2076
+ set_width_mm(width_mm: number): void;
2077
+ /**
2078
+ * Set the screen's horizontal offset in pixels.
2079
+ * @param x_offset The screen's horizontal offset.
2080
+ */
2081
+ set_x_offset(x_offset: number): void;
2082
+ /**
2083
+ * Set the screen's vertical offset in pixels.
2084
+ * @param y_offset The screen's vertical offset.
2085
+ */
2086
+ set_y_offset(y_offset: number): void;
2087
+ }
2088
+
2089
+ type ScreenClass = typeof Screen;
2090
+ type SessionClass = typeof Session;
2091
+ type TouchableClass = typeof Touchable;
2092
+ /**
2093
+ * Name of the imported GIR library
2094
+ * `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
2095
+ */
2096
+ const __name__: string;
2097
+ /**
2098
+ * Version of the imported GIR library
2099
+ * `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
2100
+ */
2101
+ const __version__: string;
2102
+ }
2103
+
2104
+ export default Mks;
2105
+ // END