-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMeta-0.d.ts
4630 lines (4306 loc) · 138 KB
/
Meta-0.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/** Generated with https://github.com/Gr3q/GIR2TS - If possible do not modify. */
declare namespace imports.gi.Meta {
/** This construct is only for enabling class multi-inheritance,
* use {@link Backend} instead.
*/
interface IBackend {
/**
* Gets the global {@link Dnd} that's managed by this backend.
* @returns the {@link Dnd}
*/
get_dnd(): Dnd;
get_remote_access_controller(): RemoteAccessController;
/**
* Gets the global #ClutterStage that's managed by this backend.
* @returns the #ClutterStage
*/
get_stage(): Clutter.Actor;
is_rendering_hardware_accelerated(): boolean;
lock_layout_group(idx: number): void;
set_keymap(layouts: string, variants: string, options: string): void;
set_numlock(numlock_state: boolean): void;
connect(signal: "gpu-added", callback: (owner: this, gpu: any) => void): number;
connect(signal: "keymap-changed", callback: (owner: this) => void): number;
connect(signal: "keymap-layout-group-changed", callback: (owner: this, object: number) => void): number;
connect(signal: "last-device-changed", callback: (owner: this, object: Clutter.InputDevice) => void): number;
connect(signal: "lid-is-closed-changed", callback: (owner: this, object: boolean) => void): number;
}
type BackendInitOptionsMixin = GObject.ObjectInitOptions & Gio.InitableInitOptions
export interface BackendInitOptions extends BackendInitOptionsMixin {}
/** This construct is only for enabling class multi-inheritance,
* use {@link Backend} instead.
*/
type BackendMixin = IBackend & GObject.Object & Gio.Initable;
interface Backend extends BackendMixin {}
class Backend {
public constructor(options?: Partial<BackendInitOptions>);
}
/** This construct is only for enabling class multi-inheritance,
* use {@link Background} instead.
*/
interface IBackground {
meta_display: Display;
set_blend(file1: Gio.File, file2: Gio.File, blend_factor: number, style: CDesktopEnums.BackgroundStyle): void;
set_color(color: Clutter.Color): void;
/**
* Set the background to #file
* @param file a #GFile representing the background file
* @param style the background style to apply
*/
set_file(file: Gio.File | null, style: CDesktopEnums.BackgroundStyle): void;
set_gradient(shading_direction: CDesktopEnums.BackgroundShading, color: Clutter.Color, second_color: Clutter.Color): void;
connect(signal: "changed", callback: (owner: this) => void): number;
connect(signal: "notify::meta-display", callback: (owner: this, ...args: any) => void): number;
}
type BackgroundInitOptionsMixin = GObject.ObjectInitOptions &
Pick<IBackground,
"meta_display">;
export interface BackgroundInitOptions extends BackgroundInitOptionsMixin {}
/** This construct is only for enabling class multi-inheritance,
* use {@link Background} instead.
*/
type BackgroundMixin = IBackground & GObject.Object;
/**
* This class handles tracking and painting the root window background.
* By integrating with {@link WindowGroup} we can avoid painting parts of
* the background that are obscured by other windows.
*/
interface Background extends BackgroundMixin {}
class Background {
public constructor(options?: Partial<BackgroundInitOptions>);
public static new(display: Display): Background;
public static refresh_all(): void;
}
/** This construct is only for enabling class multi-inheritance,
* use {@link BackgroundActor} instead.
*/
interface IBackgroundActor {
background: Background;
brightness: number;
gradient: boolean;
gradient_height: number;
gradient_max_darkness: number;
meta_display: Display;
monitor: number;
vignette: boolean;
vignette_sharpness: number;
set_background(background: Background): void;
set_gradient(enabled: boolean, height: number, tone_start: number): void;
set_monitor(monitor: number): void;
set_vignette(enabled: boolean, brightness: number, sharpness: number): void;
connect(signal: "notify::background", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::brightness", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::gradient", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::gradient-height", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::gradient-max-darkness", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::meta-display", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::monitor", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::vignette", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::vignette-sharpness", callback: (owner: this, ...args: any) => void): number;
}
type BackgroundActorInitOptionsMixin = Clutter.ActorInitOptions & Atk.ImplementorIfaceInitOptions & Clutter.AnimatableInitOptions & Clutter.ContainerInitOptions & Clutter.ScriptableInitOptions &
Pick<IBackgroundActor,
"background" |
"brightness" |
"gradient" |
"gradient_height" |
"gradient_max_darkness" |
"meta_display" |
"monitor" |
"vignette" |
"vignette_sharpness">;
export interface BackgroundActorInitOptions extends BackgroundActorInitOptionsMixin {}
/** This construct is only for enabling class multi-inheritance,
* use {@link BackgroundActor} instead.
*/
type BackgroundActorMixin = IBackgroundActor & Clutter.Actor & Atk.ImplementorIface & Clutter.Animatable & Clutter.Container & Clutter.Scriptable;
/**
* This class handles tracking and painting the root window background.
* By integrating with {@link WindowGroup} we can avoid painting parts of
* the background that are obscured by other windows.
*/
interface BackgroundActor extends BackgroundActorMixin {}
class BackgroundActor {
public constructor(options?: Partial<BackgroundActorInitOptions>);
/**
* Creates a new actor to draw the background for the given monitor.
* @param display
* @param monitor Index of the monitor for which to draw the background
* @returns the newly created background actor
*/
public static new(display: Display, monitor: number): Clutter.Actor;
}
/** This construct is only for enabling class multi-inheritance,
* use {@link BackgroundGroup} instead.
*/
interface IBackgroundGroup {
}
type BackgroundGroupInitOptionsMixin = Clutter.ActorInitOptions & Atk.ImplementorIfaceInitOptions & Clutter.AnimatableInitOptions & Clutter.ContainerInitOptions & Clutter.ScriptableInitOptions
export interface BackgroundGroupInitOptions extends BackgroundGroupInitOptionsMixin {}
/** This construct is only for enabling class multi-inheritance,
* use {@link BackgroundGroup} instead.
*/
type BackgroundGroupMixin = IBackgroundGroup & Clutter.Actor & Atk.ImplementorIface & Clutter.Animatable & Clutter.Container & Clutter.Scriptable;
interface BackgroundGroup extends BackgroundGroupMixin {}
class BackgroundGroup {
public constructor(options?: Partial<BackgroundGroupInitOptions>);
public static new(): Clutter.Actor;
}
/** This construct is only for enabling class multi-inheritance,
* use {@link BackgroundImage} instead.
*/
interface IBackgroundImage {
/**
* This function is a convenience function for checking for success,
* without having to call {@link Meta.BackgroundImage.get_texture} and
* handle the return of a Cogl type.
* @returns %TRUE if loading completed successfully, otherwise %FALSE
*/
get_success(): boolean;
get_texture(): Cogl.Texture;
is_loaded(): boolean;
connect(signal: "loaded", callback: (owner: this) => void): number;
}
type BackgroundImageInitOptionsMixin = GObject.ObjectInitOptions
export interface BackgroundImageInitOptions extends BackgroundImageInitOptionsMixin {}
/** This construct is only for enabling class multi-inheritance,
* use {@link BackgroundImage} instead.
*/
type BackgroundImageMixin = IBackgroundImage & GObject.Object;
/**
* {@link BackgroundImage} is an object that represents a loaded or loading background image.
*/
interface BackgroundImage extends BackgroundImageMixin {}
class BackgroundImage {
public constructor(options?: Partial<BackgroundImageInitOptions>);
}
/** This construct is only for enabling class multi-inheritance,
* use {@link BackgroundImageCache} instead.
*/
interface IBackgroundImageCache {
/**
* Loads an image to use as a background, or returns a reference to an
* image that is already in the process of loading or loaded. In either
* case, what is returned is a {@link BackgroundImage} which can be derefenced
* to get a #CoglTexture. If {@link Meta.BackgroundImage.is_loaded} returns %TRUE,
* the background is loaded, otherwise the MetaBackgroundImage::loaded
* signal will be emitted exactly once. The 'loaded' state means that the
* loading process finished, whether it succeeded or failed.
* @param file #GFile to load
* @returns a {@link BackgroundImage} to dereference to get the loaded texture
*/
load(file: Gio.File): BackgroundImage;
/**
* Remove an entry from the cache; this would be used if monitoring
* showed that the file changed.
* @param file file to remove from the cache
*/
purge(file: Gio.File): void;
}
type BackgroundImageCacheInitOptionsMixin = GObject.ObjectInitOptions
export interface BackgroundImageCacheInitOptions extends BackgroundImageCacheInitOptionsMixin {}
/** This construct is only for enabling class multi-inheritance,
* use {@link BackgroundImageCache} instead.
*/
type BackgroundImageCacheMixin = IBackgroundImageCache & GObject.Object;
/**
* {@link BackgroundImageCache} caches loading of textures for backgrounds; there's actually
* nothing background specific about it, other than it is tuned to work well for
* large images as typically are used for backgrounds.
*/
interface BackgroundImageCache extends BackgroundImageCacheMixin {}
class BackgroundImageCache {
public constructor(options?: Partial<BackgroundImageCacheInitOptions>);
public static get_default(): BackgroundImageCache;
}
/** This construct is only for enabling class multi-inheritance,
* use {@link Barrier} instead.
*/
interface IBarrier {
directions: BarrierDirection;
display: Display;
x1: number;
x2: number;
y1: number;
y2: number;
destroy(): void;
is_active(): boolean;
/**
* In XI2.3, pointer barriers provide a feature where they can
* be temporarily released so that the pointer goes through
* them. Pass a {@link BarrierEvent} to release the barrier for
* this event sequence.
* @param event The event to release the pointer for
*/
release(event: BarrierEvent): void;
/**
* When a pointer barrier is hit, this will trigger. This
* requires an XI2-enabled server.
* @param signal
* @param callback Callback function
* - owner: owner of the emitted event
* - event: A {@link BarrierEvent} that has the details of how
* the barrier was hit.
*
* @returns Callback ID
*/
connect(signal: "hit", callback: (owner: this, event: BarrierEvent) => void): number;
/**
* When a pointer barrier hitbox was left, this will trigger.
* This requires an XI2-enabled server.
* @param signal
* @param callback Callback function
* - owner: owner of the emitted event
* - event: A {@link BarrierEvent} that has the details of how
* the barrier was left.
*
* @returns Callback ID
*/
connect(signal: "left", callback: (owner: this, event: BarrierEvent) => void): number;
connect(signal: "notify::directions", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::display", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::x1", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::x2", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::y1", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::y2", callback: (owner: this, ...args: any) => void): number;
}
type BarrierInitOptionsMixin = GObject.ObjectInitOptions &
Pick<IBarrier,
"directions" |
"display" |
"x1" |
"x2" |
"y1" |
"y2">;
export interface BarrierInitOptions extends BarrierInitOptionsMixin {}
/** This construct is only for enabling class multi-inheritance,
* use {@link Barrier} instead.
*/
type BarrierMixin = IBarrier & GObject.Object;
/**
* The <structname>MetaBarrier</structname> structure contains
* only private data and should be accessed using the provided API
*/
interface Barrier extends BarrierMixin {}
class Barrier {
public constructor(options?: Partial<BarrierInitOptions>);
}
/** This construct is only for enabling class multi-inheritance,
* use {@link Compositor} instead.
*/
interface ICompositor {
display: Display;
add_window(window: Window): void;
destroy(): void;
filter_keybinding(binding: KeyBinding): boolean;
flash_display(display: Display): void;
hide_tile_preview(): void;
hide_window(window: Window, effect: CompEffect): void;
manage(): void;
queue_frame_drawn(window: Window, no_delay_frame: boolean): void;
remove_window(window: Window): void;
show_tile_preview(window: Window, tile_rect: Rectangle, tile_monitor_number: number): void;
show_window(window: Window, effect: CompEffect): void;
show_window_menu(window: Window, menu: WindowMenuType, x: number, y: number): void;
show_window_menu_for_rect(window: Window, menu: WindowMenuType, rect: Rectangle): void;
size_change_window(window: Window, which_change: SizeChange, old_frame_rect: Rectangle, old_buffer_rect: Rectangle): void;
switch_workspace(from: Workspace, to: Workspace, direction: MotionDirection): void;
sync_stack(stack: any[]): void;
sync_updates_frozen(window: Window): void;
sync_window_geometry(window: Window, did_placement: boolean): void;
unmanage(): void;
window_opacity_changed(window: Window): void;
window_shape_changed(window: Window): void;
connect(signal: "notify::display", callback: (owner: this, ...args: any) => void): number;
}
type CompositorInitOptionsMixin = GObject.ObjectInitOptions &
Pick<ICompositor,
"display">;
export interface CompositorInitOptions extends CompositorInitOptionsMixin {}
/** This construct is only for enabling class multi-inheritance,
* use {@link Compositor} instead.
*/
type CompositorMixin = ICompositor & GObject.Object;
interface Compositor extends CompositorMixin {}
class Compositor {
public constructor(options?: Partial<CompositorInitOptions>);
}
/** This construct is only for enabling class multi-inheritance,
* use {@link CursorTracker} instead.
*/
interface ICursorTracker {
get_hot(): [ x: number, y: number ];
get_pointer(x: number, y: number, mods: Clutter.ModifierType): void;
get_pointer_visible(): boolean;
get_sprite(): Cogl.Texture;
set_pointer_visible(visible: boolean): void;
connect(signal: "cursor-changed", callback: (owner: this) => void): number;
/**
* Notifies when the cursor has moved to a new location.
* @param signal
* @param callback Callback function
* - owner: owner of the emitted event
* - x: The new X coordinate of the cursor
* - y: The new Y coordinate of the cursor
*
* @returns Callback ID
*/
connect(signal: "cursor-moved", callback: (owner: this, x: number, y: number) => void): number;
connect(signal: "visibility-changed", callback: (owner: this) => void): number;
}
type CursorTrackerInitOptionsMixin = GObject.ObjectInitOptions
export interface CursorTrackerInitOptions extends CursorTrackerInitOptionsMixin {}
/** This construct is only for enabling class multi-inheritance,
* use {@link CursorTracker} instead.
*/
type CursorTrackerMixin = ICursorTracker & GObject.Object;
interface CursorTracker extends CursorTrackerMixin {}
class CursorTracker {
public constructor(options?: Partial<CursorTrackerInitOptions>);
/**
* Retrieves the cursor tracker object for #display.
* @param display the {@link Display}
* @returns
*/
public static get_for_display(display: Display): CursorTracker;
}
/** This construct is only for enabling class multi-inheritance,
* use {@link Display} instead.
*/
interface IDisplay {
readonly focus_window: Window;
/**
* Use {@link Meta.Display.remove_custom_keybinding} to remove the binding.
* @param name the binding's unique name
* @param bindings array of parseable keystrokes
* @param callback function to run when the keybinding is invoked
* @returns %TRUE if the keybinding was added successfully,
* otherwise %FALSE
*/
add_custom_keybinding(name: string, bindings: string[] | null, callback: KeyHandlerFunc): number;
/**
* Save the specified serial and ignore crossing events with that
* serial for the purpose of focus-follows-mouse. This can be used
* for certain changes to the window hierarchy that we don't want
* to change the focus window, even if they cause the pointer to
* end up in a new window.
* @param serial the serial to ignore
*/
add_ignored_crossing_serial(serial: number): void;
/**
* Add a keybinding at runtime. The key #name in #schema needs to be of
* type %G_VARIANT_TYPE_STRING_ARRAY, with each string describing a
* keybinding in the form of "<Control>a" or "<Shift><Alt>F1". The parser
* is fairly liberal and allows lower or upper case, and also abbreviations
* such as "<Ctl>" and "<Ctrl>". If the key is set to the empty list or a
* list with a single element of either "" or "disabled", the keybinding is
* disabled.
*
* Use {@link Meta.Display.remove_keybinding} to remove the binding.
* @param name the binding's name
* @param settings the #GSettings object where #name is stored
* @param flags flags to specify binding details
* @param handler function to run when the keybinding is invoked
* @returns the corresponding keybinding action if the keybinding was
* added successfully, otherwise %META_KEYBINDING_ACTION_NONE
*/
add_keybinding(name: string, settings: Gio.Settings, flags: KeyBindingFlags, handler: KeyHandlerFunc): number;
begin_grab_op(window: Window, op: GrabOp, pointer_already_grabbed: boolean, frame_action: boolean, button: number, modmask: number, timestamp: number, root_x: number, root_y: number): boolean;
/**
* Sets the mouse-mode flag to %FALSE, which means that motion events are
* no longer ignored in mouse or sloppy focus.
* This is an internal function. It should be used only for reimplementing
* keybindings, and only in a manner compatible with core code.
*/
clear_mouse_mode(): void;
close(timestamp: number): void;
end_grab_op(timestamp: number): void;
focus_default_window(timestamp: number): void;
freeze_keyboard(timestamp: number): void;
/**
* Gets the index of the monitor that currently has the mouse pointer.
* @returns a monitor index
*/
get_current_monitor(): number;
get_current_time(): number;
get_current_time_roundtrip(): number;
get_desklets_above(): boolean;
/**
* Get our best guess as to the "currently" focused window (that is,
* the window that we expect will be focused at the point when the X
* server processes our next request).
* @returns The current focus window
*/
get_focus_window(): Window;
/**
* Gets the current grab operation, if any.
* @returns the current grab operation, or %META_GRAB_OP_NONE if
* Mutter doesn't currently have a grab. %META_GRAB_OP_COMPOSITOR will
* be returned if a compositor-plugin modal operation is in effect
* (See {@link Mutter.begin_modal_for_plugin})
*/
get_grab_op(): GrabOp;
/**
* Get the keybinding action bound to #keycode. Builtin keybindings
* have a fixed associated {@link KeyBindingAction}, for bindings added
* dynamically the function will return the keybinding action
* {@link Meta.Display.add_keybinding} returns on registration.
* @param keycode Raw keycode
* @param mask Event mask
* @returns The action that should be taken for the given key, or
* %META_KEYBINDING_ACTION_NONE.
*/
get_keybinding_action(keycode: number, mask: number): number;
get_last_user_time(): number;
/**
* Stores the location and size of the indicated #monitor in #geometry.
* @param monitor the monitor number
* @returns location to store the monitor geometry
*/
get_monitor_geometry(monitor: number): Rectangle;
/**
* Determines whether there is a fullscreen window obscuring the specified
* monitor. If there is a fullscreen window, the desktop environment will
* typically hide any controls that might obscure the fullscreen window.
*
* You can get notification when this changes by connecting to
* MetaDisplay::in-fullscreen-changed.
* @param monitor the monitor number
* @returns %TRUE if there is a fullscreen window covering the specified monitor.
*/
get_monitor_in_fullscreen(monitor: number): boolean;
get_monitor_index_for_rect(rect: Rectangle): number;
get_monitor_neighbor_index(which_monitor: number, dir: DisplayDirection): number;
/**
* Gets the monitor scaling value for the given #monitor.
* @param monitor the monitor number
* @returns the monitor scaling value
*/
get_monitor_scale(monitor: number): number;
/**
* Gets the number of monitors that are joined together to form #display.
* @returns the number of monitors
*/
get_n_monitors(): number;
get_pad_action_label(pad: Clutter.InputDevice, action_type: PadActionType, action_number: number): string;
/**
* Gets the {@link Window} pointed by the mouse
* @param not_this_one window to be excluded
* @returns the {@link Window} pointed by the mouse
* %NULL when window not found
*/
get_pointer_window(not_this_one?: Window | null): Window;
/**
* Gets the index of the primary monitor on this #display.
* @returns a monitor index
*/
get_primary_monitor(): number;
get_selection(): Selection;
/**
* Retrieve the size of the display.
* @returns The width of the screen
*
* The height of the screen
*/
get_size(): [ width: number, height: number ];
get_sound_player(): SoundPlayer;
/**
* Determine the active window that should be displayed for Alt-TAB.
* @param type type of tab list
* @param workspace origin workspace
* @returns Current window
*/
get_tab_current(type: TabList, workspace: Workspace): Window;
/**
* Determine the list of windows that should be displayed for Alt-TAB
* functionality. The windows are returned in most recently used order.
* If #workspace is not %NULL, the list only conains windows that are on
* #workspace or have the demands-attention hint set; otherwise it contains
* all windows.
* @param type type of tab list
* @param workspace origin workspace
* @returns List of windows
*/
get_tab_list(type: TabList, workspace?: Workspace | null): Window[];
/**
* Determine the next window that should be displayed for Alt-TAB
* functionality.
* @param type type of tab list
* @param workspace origin workspace
* @param window starting window
* @param backward If %TRUE, look for the previous window.
* @returns Next window
*/
get_tab_next(type: TabList, workspace: Workspace, window: Window | null, backward: boolean): Window;
get_workspace_manager(): WorkspaceManager;
grab_accelerator(accelerator: string, flags: KeyBindingFlags): number;
/**
* Tells whether the event sequence is the used for pointer emulation
* and single-touch interaction.
* @param sequence a #ClutterEventSequence
* @returns #TRUE if the sequence emulates pointer behavior
*/
is_pointer_emulating_sequence(sequence?: Clutter.EventSequence | null): boolean;
/**
* Lists windows for the display, the #flags parameter for
* now determines whether override-redirect windows will be
* included.
* @param flags options for listing
* @returns the list of windows.
*/
list_windows(flags: ListWindowsFlags): Window[];
logical_index_to_xinerama_index(log_index: number): number;
/**
* If the window is not yet tiled, tile the window to the portion
* of the monitor indicated by #direction. If already tiled, perform
* navigation around the possible tile positions, or untile the
* window, according to #direction.
*
* For example, if #window is left-tiled, and the #direction is
* #META_MOTION_UP, the window will be upper-left corner tiled. If the
* #direction is #META_MOTION_RIGHT, the window will be untiled.
*
* This logic is identical to the behavior of the tiling keyboard
* shortcuts.
* @param window the {@link Window} to act upon
* @param direction the {@link MotionDirection} to push the window in.
*/
push_tile(window: Window, direction: MotionDirection): void;
/**
* Remove keybinding #name; the function will fail if #name is not a known
* keybinding or has not been added with {@link Meta.Display.add_keybinding}.
* @param name name of the keybinding to remove
* @returns %TRUE if the binding has been removed sucessfully,
* otherwise %FALSE
*/
remove_keybinding(name: string): boolean;
request_pad_osd(pad: Clutter.InputDevice, edition_mode: boolean): void;
set_cursor(cursor: Cursor): void;
/**
* Raises the desklet container to the top of the stage temporatily.
* @param above Whether to set above or not
*/
set_desklets_above(above: boolean): void;
set_input_focus(window: Window, focus_frame: boolean, timestamp: number): void;
/**
* Sorts a set of windows according to their current stacking order. If windows
* from multiple screens are present in the set of input windows, then all the
* windows on screen 0 are sorted below all the windows on screen 1, and so forth.
* Since the stacking order of override-redirect windows isn't controlled by
* Metacity, if override-redirect windows are in the input, the result may not
* correspond to the actual stacking order in the X server.
*
* An example of using this would be to sort the list of transient dialogs for a
* window into their current stacking order.
* @param windows Set of windows
* @returns Input windows sorted by stacking order, from lowest to highest
*/
sort_windows_by_stacking(windows: Window[]): Window[];
supports_extended_barriers(): boolean;
unfreeze_keyboard(timestamp: number): void;
ungrab_accelerator(action_id: number): boolean;
ungrab_keyboard(timestamp: number): void;
unset_input_focus(timestamp: number): void;
xinerama_index_to_logical_index(x_index: number): number;
/**
* Xserver time can wraparound, thus comparing two timestamps needs to take
* this into account. If no wraparound has occurred, this is equivalent to
* time1 < time2
* Otherwise, we need to account for the fact that wraparound can occur
* and the fact that a timestamp of 0 must be special-cased since it
* means "older than anything else".
*
* Note that this is NOT an equivalent for time1 <= time2; if that's what
* you need then you'll need to swap the order of the arguments and negate
* the result.
* @param time1 An event timestamp
* @param time2 An event timestamp
* @returns
*/
xserver_time_is_before(time1: number, time2: number): boolean;
connect(signal: "accelerator-activated", callback: (owner: this, object: number, p0: Clutter.InputDevice, p1: number) => void): number;
connect(signal: "closing", callback: (owner: this) => void): number;
connect(signal: "cursor-updated", callback: (owner: this) => void): number;
connect(signal: "gl-video-memory-purged", callback: (owner: this) => void): number;
connect(signal: "grab-op-begin", callback: (owner: this, object: Display, p0: Window, p1: GrabOp) => void): number;
connect(signal: "grab-op-end", callback: (owner: this, object: Display, p0: Window, p1: GrabOp) => void): number;
connect(signal: "in-fullscreen-changed", callback: (owner: this) => void): number;
connect(signal: "init-xserver", callback: (owner: this, object: Gio.Task) => boolean): number;
/**
* The ::modifiers-accelerator-activated signal will be emitted when
* a special modifiers-only keybinding is activated.
* @param signal
* @param callback Callback function
* - owner: owner of the emitted event
* - returns %TRUE means that the keyboard device should remain
* frozen and %FALSE for the default behavior of unfreezing the
* keyboard.
*
* @returns Callback ID
*/
connect(signal: "modifiers-accelerator-activated", callback: (owner: this) => boolean): number;
connect(signal: "overlay-key", callback: (owner: this) => void): number;
connect(signal: "pad-mode-switch", callback: (owner: this, object: Clutter.InputDevice, p0: number, p1: number) => void): number;
connect(signal: "restacked", callback: (owner: this) => void): number;
/**
* The ::restart signal is emitted to indicate that compositor
* should reexec the process. This is
* emitted when meta_restart() is called, either by Mutter
* internally or by the embedding compositor. See also
* ::show-restart-message.
* @param signal
* @param callback Callback function
* - owner: owner of the emitted event
* - returns %FALSE to indicate that the compositor could not
* be restarted. When the compositor is restarted, the signal
* should not return.
*
* @returns Callback ID
*/
connect(signal: "restart", callback: (owner: this) => boolean): number;
connect(signal: "show-osd", callback: (owner: this, object: number, p0: string, p1: string) => void): number;
/**
* Requests the pad button mapping OSD to be shown.
* @param signal
* @param callback Callback function
* - owner: owner of the emitted event
* - pad: the pad device
* - settings: the pad device settings
* - layout_path: path to the layout image
* - edition_mode: Whether the OSD should be shown in edition mode
* - monitor_idx: Monitor to show the OSD on
* - returns The OSD actor
*
* @returns Callback ID
*/
connect(signal: "show-pad-osd", callback: (owner: this, pad: Clutter.InputDevice, settings: Gio.Settings, layout_path: string, edition_mode: boolean, monitor_idx: number) => Clutter.Actor | null): number;
connect(signal: "show-resize-popup", callback: (owner: this, object: boolean, p0: Rectangle, p1: number, p2: number) => boolean): number;
/**
* The ::show-restart-message signal will be emitted to indicate
* that the compositor should show a message during restart. This is
* emitted when meta_restart() is called, either by Mutter
* internally or by the embedding compositor. The message should be
* immediately added to the Clutter stage in its final form -
* ::restart will be emitted to exit the application and leave the
* stage contents frozen as soon as the the stage is painted again.
*
* On case of failure to restart, this signal will be emitted again
* with %NULL for #message.
* @param signal
* @param callback Callback function
* - owner: owner of the emitted event
* - message: The message to display, or %NULL
* to clear a previous restart message.
* - returns %TRUE means the message was added to the stage; %FALSE
* indicates that the compositor did not show the message.
*
* @returns Callback ID
*/
connect(signal: "show-restart-message", callback: (owner: this, message: string | null) => boolean): number;
connect(signal: "showing-desktop-changed", callback: (owner: this) => void): number;
connect(signal: "window-created", callback: (owner: this, object: Window) => void): number;
connect(signal: "window-demands-attention", callback: (owner: this, object: Window) => void): number;
connect(signal: "window-entered-monitor", callback: (owner: this, object: number, p0: Window) => void): number;
connect(signal: "window-left-monitor", callback: (owner: this, object: number, p0: Window) => void): number;
connect(signal: "window-marked-urgent", callback: (owner: this, object: Window) => void): number;
connect(signal: "window-monitor-changed", callback: (owner: this, object: Window, p0: number) => void): number;
connect(signal: "window-skip-taskbar-changed", callback: (owner: this, object: Window) => void): number;
connect(signal: "window-workspace-changed", callback: (owner: this, object: Window, p0: Workspace) => void): number;
connect(signal: "workareas-changed", callback: (owner: this) => void): number;
connect(signal: "x11-display-closing", callback: (owner: this) => void): number;
connect(signal: "x11-display-opened", callback: (owner: this) => void): number;
connect(signal: "x11-display-setup", callback: (owner: this) => void): number;
connect(signal: "zoom-scroll-in", callback: (owner: this) => void): number;
connect(signal: "zoom-scroll-out", callback: (owner: this) => void): number;
connect(signal: "notify::focus-window", callback: (owner: this, ...args: any) => void): number;
}
type DisplayInitOptionsMixin = GObject.ObjectInitOptions
export interface DisplayInitOptions extends DisplayInitOptionsMixin {}
/** This construct is only for enabling class multi-inheritance,
* use {@link Display} instead.
*/
type DisplayMixin = IDisplay & GObject.Object;
interface Display extends DisplayMixin {}
class Display {
public constructor(options?: Partial<DisplayInitOptions>);
}
/** This construct is only for enabling class multi-inheritance,
* use {@link Dnd} instead.
*/
interface IDnd {
connect(signal: "dnd-enter", callback: (owner: this) => void): number;
connect(signal: "dnd-leave", callback: (owner: this) => void): number;
connect(signal: "dnd-position-change", callback: (owner: this, object: number, p0: number) => void): number;
}
type DndInitOptionsMixin = GObject.ObjectInitOptions
export interface DndInitOptions extends DndInitOptionsMixin {}
/** This construct is only for enabling class multi-inheritance,
* use {@link Dnd} instead.
*/
type DndMixin = IDnd & GObject.Object;
interface Dnd extends DndMixin {}
class Dnd {
public constructor(options?: Partial<DndInitOptions>);
}
/** This construct is only for enabling class multi-inheritance,
* use {@link IdleMonitor} instead.
*/
interface IIdleMonitor {
/**
* The device to listen to idletime on.
*/
device: Clutter.InputDevice;
add_idle_watch(interval_msec: number, callback?: IdleMonitorWatchFunc | null): number;
add_user_active_watch(callback?: IdleMonitorWatchFunc | null): number;
get_idletime(): number;
/**
* Removes an idle time watcher, previously added by
* {@link Meta.IdleMonitor.add_idle_watch} or
* meta_idle_monitor_add_user_active_watch().
* @param id A watch ID
*/
remove_watch(id: number): void;
connect(signal: "notify::device", callback: (owner: this, ...args: any) => void): number;
}
type IdleMonitorInitOptionsMixin = GObject.ObjectInitOptions &
Pick<IIdleMonitor,
"device">;
export interface IdleMonitorInitOptions extends IdleMonitorInitOptionsMixin {}
/** This construct is only for enabling class multi-inheritance,
* use {@link IdleMonitor} instead.
*/
type IdleMonitorMixin = IIdleMonitor & GObject.Object;
interface IdleMonitor extends IdleMonitorMixin {}
class IdleMonitor {
public constructor(options?: Partial<IdleMonitorInitOptions>);
public static get_core(): IdleMonitor;
}
/** This construct is only for enabling class multi-inheritance,
* use {@link LaunchContext} instead.
*/
interface ILaunchContext {
display: Display;
timestamp: number;
workspace: Workspace;
set_timestamp(timestamp: number): void;
set_workspace(workspace: Workspace): void;
connect(signal: "notify::display", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::timestamp", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::workspace", callback: (owner: this, ...args: any) => void): number;
}
type LaunchContextInitOptionsMixin = Gio.AppLaunchContextInitOptions &
Pick<ILaunchContext,
"display" |
"timestamp" |
"workspace">;
export interface LaunchContextInitOptions extends LaunchContextInitOptionsMixin {}
/** This construct is only for enabling class multi-inheritance,
* use {@link LaunchContext} instead.
*/
type LaunchContextMixin = ILaunchContext & Gio.AppLaunchContext;
interface LaunchContext extends LaunchContextMixin {}
class LaunchContext {
public constructor(options?: Partial<LaunchContextInitOptions>);
}
/** This construct is only for enabling class multi-inheritance,
* use {@link MonitorManager} instead.
*/
interface IMonitorManager {
backend: Backend;
apply_temporary_rotation(rotation: XrandrRotation): boolean;
can_apply_rotation(rotation: XrandrRotation): boolean;
can_switch_config(): boolean;
/**
* Returns %TRUE if there is a laptop panel and its current rotation
* can be determined, otherwise %FALSE
* @returns
*
* The current {@link XrandrRotation} applied to the laptop panel.
*/
get_current_rotation(): [ boolean, XrandrRotation ];
/**
* Returns whether the built-in display (i.e. a laptop panel) is turned on.
* @returns
*/
get_is_builtin_display_on(): boolean;
get_monitor_for_connector(connector: string): number;
get_switch_config(): MonitorSwitchConfigType;
switch_config(config_type: MonitorSwitchConfigType): void;
connect(signal: "confirm-display-change", callback: (owner: this) => void): number;
connect(signal: "monitors-changed", callback: (owner: this) => void): number;
connect(signal: "monitors-changed-internal", callback: (owner: this) => void): number;
connect(signal: "power-save-mode-changed", callback: (owner: this) => void): number;
connect(signal: "notify::backend", callback: (owner: this, ...args: any) => void): number;
}
type MonitorManagerInitOptionsMixin = GObject.ObjectInitOptions &
Pick<IMonitorManager,
"backend">;
export interface MonitorManagerInitOptions extends MonitorManagerInitOptionsMixin {}
/** This construct is only for enabling class multi-inheritance,
* use {@link MonitorManager} instead.
*/
type MonitorManagerMixin = IMonitorManager & GObject.Object;
interface MonitorManager extends MonitorManagerMixin {}
class MonitorManager {
public constructor(options?: Partial<MonitorManagerInitOptions>);
/**
* Accessor for the singleton MetaMonitorManager.
* @returns The only {@link MonitorManager} there is.
*/
public static get(): MonitorManager;
public static get_display_configuration_timeout(): number;
}
/** This construct is only for enabling class multi-inheritance,
* use {@link Plugin} instead.
*/
interface IPlugin {
/**
* This function is used to grab the keyboard and mouse for the exclusive
* use of the plugin. Correct operation requires that both the keyboard
* and mouse are grabbed, or thing will break. (In particular, other
* passive X grabs in Meta can trigger but not be handled by the normal
* keybinding handling code.) However, the plugin can establish the keyboard
* and/or mouse grabs ahead of time and pass in the
* %META_MODAL_POINTER_ALREADY_GRABBED and/or %META_MODAL_KEYBOARD_ALREADY_GRABBED
* options. This facility is provided for two reasons: first to allow using
* this function to establish modality after a passive grab, and second to
* allow using obscure features of XGrabPointer() and XGrabKeyboard() without
* having to add them to this API.
* @param options flags that modify the behavior of the modal grab
* @param timestamp the timestamp used for establishing grabs
* @returns whether we successfully grabbed the keyboard and
* mouse and made the plugin modal.
*/
begin_modal(options: ModalOptions, timestamp: number): boolean;
complete_display_change(ok: boolean): void;
destroy_completed(actor: WindowActor): void;
/**
* Ends the modal operation begun with {@link Meta.Plugin.begin_modal}. This
* ungrabs both the mouse and keyboard even when
* %META_MODAL_POINTER_ALREADY_GRABBED or
* %META_MODAL_KEYBOARD_ALREADY_GRABBED were provided as options
* when beginnning the modal operation.
* @param timestamp the time used for releasing grabs
*/
end_modal(timestamp: number): void;
/**
* Gets the {@link Display} corresponding to a plugin.
* @returns the {@link Display} for the plugin
*/
get_display(): Display;
get_info(): PluginInfo;
map_completed(actor: WindowActor): void;
minimize_completed(actor: WindowActor): void;
size_change_completed(actor: WindowActor): void;
switch_workspace_completed(): void;
unminimize_completed(actor: WindowActor): void;
}
type PluginInitOptionsMixin = GObject.ObjectInitOptions
export interface PluginInitOptions extends PluginInitOptionsMixin {}
/** This construct is only for enabling class multi-inheritance,
* use {@link Plugin} instead.
*/
type PluginMixin = IPlugin & GObject.Object;