-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCinnamon-0.1.d.ts
1996 lines (1838 loc) · 83.9 KB
/
Cinnamon-0.1.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.Cinnamon {
/** This construct is only for enabling class multi-inheritance,
* use {@link App} instead.
*/
interface IApp {
/**
* The high-level state of the application, effectively whether it's
* running or not, or transitioning between those states.
*/
readonly state: AppState;
/**
* Like {@link Cinnamon.App.activate_full}, but using the default workspace and
* event timestamp.
*/
activate(): void;
/**
* Perform an appropriate default action for operating on this application,
* dependent on its current state. For example, if the application is not
* currently running, launch it. If it is running, activate the most
* recently used NORMAL window (or if that window has a transient, the most
* recently used transient for that window).
* @param workspace launch on this workspace, or -1 for default. Ignored if
* activating an existing window
* @param timestamp Event timestamp
*/
activate_full(workspace: number, timestamp: number): void;
/**
* Bring all windows for the given app to the foreground,
* but ensure that #window is on top. If #window is %NULL,
* the window with the most recent user time for the app
* will be used.
*
* This function has no effect if #app is not currently running.
* @param window Window to be focused
* @param timestamp Event timestamp
*/
activate_window(window: Meta.Window | null, timestamp: number): void;
/**
* Returns %TRUE if the app supports opening a new window through
* {@link Cinnamon.App.open_new_window} (ie, if calling that function will
* result in actually opening a new window and not something else,
* like presenting the most recently active one)
* @returns
*/
can_open_new_window(): boolean;
/**
* Look up the icon for this application, and create a #ClutterActor
* for it at the given size.
* @param size
* @returns A floating #ClutterActor
*/
create_icon_texture(size: number): Clutter.Actor;
/**
* Look up the icon for this application, and create a #ClutterTexture
* for it at the given size. If for_window is NULL, it bases the icon
* off the most-recently-used window for the app, otherwise it attempts to
* use for_window for determining the icon.
* @param size the size of the icon to create
* @param for_window Optional - the backing MetaWindow to look up for.
* @returns A floating #ClutterActor
*/
create_icon_texture_for_window(size: number, for_window?: Meta.Window | null): Clutter.Actor;
get_app_info(): CMenu.DesktopAppInfo;
get_description(): string;
get_flatpak_app_id(): string;
get_id(): string;
get_is_flatpak(): boolean;
get_keywords(): string;
get_n_windows(): number;
get_name(): string;
get_nodisplay(): boolean;
get_pids(): number[];
get_state(): AppState;
get_tree_entry(): CMenu.TreeEntry;
/**
* Get the toplevel, interesting windows which are associated with this
* application. The returned list will be sorted first by whether
* they're on the active workspace, then by whether they're visible,
* and finally by the time the user last interacted with them.
* @returns List of windows
*/
get_windows(): Meta.Window[];
is_on_workspace(workspace: Meta.Workspace): boolean;
/**
* A window backed application is one which represents just an open
* window, i.e. there's no .desktop file association, so we don't know
* how to launch it again.
* @returns
*/
is_window_backed(): boolean;
launch(timestamp: number, uris: string[], workspace: number): [ boolean, string ];
/**
* Launch an application using the dedicated gpu (if available)
* @param timestamp Event timestamp, or 0 for current event timestamp
* @param uris List of uris to pass to application
* @param workspace Start on this workspace, or -1 for default
* @returns
*
* Returned startup notification ID, or %NULL if none
*/
launch_offloaded(timestamp: number, uris: string[], workspace: number): [ boolean, string ];
/**
* Request that the application create a new window.
* @param workspace open on this workspace, or -1 for default
*/
open_new_window(workspace: number): void;
/**
* Initiate an asynchronous request to quit this application.
* The application may interact with the user, and the user
* might cancel the quit request from the application UI.
*
* This operation may not be supported for all applications.
* @returns %TRUE if a quit request is supported for this application
*/
request_quit(): boolean;
connect(signal: "windows-changed", callback: (owner: this) => void): number;
connect(signal: "notify::state", callback: (owner: this, ...args: any) => void): number;
}
type AppInitOptionsMixin = GObject.ObjectInitOptions
export interface AppInitOptions extends AppInitOptionsMixin {}
/** This construct is only for enabling class multi-inheritance,
* use {@link App} instead.
*/
type AppMixin = IApp & GObject.Object;
interface App extends AppMixin {}
class App {
public constructor(options?: Partial<AppInitOptions>);
}
/** This construct is only for enabling class multi-inheritance,
* use {@link AppSystem} instead.
*/
interface IAppSystem {
get_all(): App[];
/**
* Returns the set of applications which currently have at least one
* open window in the given context.
* @returns Active applications
*/
get_running(): App[];
get_tree(): CMenu.Tree;
/**
* Find a {@link App} corresponding to an id.
* @param id
* @returns The {@link App} for id, or %NULL if none
*/
lookup_app(id: string): App;
/**
* Find a valid application whose .desktop file, without the extension
* and properly canonicalized, matches #wmclass.
* @param wmclass A WM_CLASS value
* @returns A {@link App} for #wmclass
*/
lookup_desktop_wmclass(wmclass?: string | null): App;
/**
* Find a {@link App} corresponding to a flatpak app id.
* @param app_id
* @returns The {@link App} for app_id, or %NULL if none
*/
lookup_flatpak_app_id(app_id: string): App;
/**
* Find a valid application whose .desktop file contains a
* StartupWMClass entry matching #wmclass.
* @param wmclass A WM_CLASS value
* @returns A {@link App} for #wmclass
*/
lookup_startup_wmclass(wmclass?: string | null): App;
connect(signal: "app-state-changed", callback: (owner: this, object: App) => void): number;
connect(signal: "installed-changed", callback: (owner: this) => void): number;
}
type AppSystemInitOptionsMixin = GObject.ObjectInitOptions
export interface AppSystemInitOptions extends AppSystemInitOptionsMixin {}
/** This construct is only for enabling class multi-inheritance,
* use {@link AppSystem} instead.
*/
type AppSystemMixin = IAppSystem & GObject.Object;
interface AppSystem extends AppSystemMixin {}
class AppSystem {
public constructor(options?: Partial<AppSystemInitOptions>);
public static get_default(): AppSystem;
}
/** This construct is only for enabling class multi-inheritance,
* use {@link CalendarServerProxy} instead.
*/
interface ICalendarServerProxy {
}
type CalendarServerProxyInitOptionsMixin = Gio.DBusProxyInitOptions & CalendarServerInitOptions & Gio.AsyncInitableInitOptions & Gio.DBusInterfaceInitOptions & Gio.InitableInitOptions
export interface CalendarServerProxyInitOptions extends CalendarServerProxyInitOptionsMixin {}
/** This construct is only for enabling class multi-inheritance,
* use {@link CalendarServerProxy} instead.
*/
type CalendarServerProxyMixin = ICalendarServerProxy & Gio.DBusProxy & CalendarServer & Gio.AsyncInitable & Gio.DBusInterface & Gio.Initable;
/**
* The {@link CalendarServerProxy} structure contains only private data and should only be accessed using the provided API.
*/
interface CalendarServerProxy extends CalendarServerProxyMixin {}
class CalendarServerProxy {
public constructor(options?: Partial<CalendarServerProxyInitOptions>);
/**
* Finishes an operation started with {@link Cinnamon.CalendarServerProxy.new}.
* @param res The #GAsyncResult obtained from the #GAsyncReadyCallback passed to {@link Cinnamon.CalendarServerProxy.new}.
* @returns The constructed proxy object or %NULL if #error is set.
*/
public static new_finish(res: Gio.AsyncResult): CalendarServerProxy;
/**
* Finishes an operation started with {@link Cinnamon.CalendarServerProxy.new_for_bus}.
* @param res The #GAsyncResult obtained from the #GAsyncReadyCallback passed to {@link Cinnamon.CalendarServerProxy.new_for_bus}.
* @returns The constructed proxy object or %NULL if #error is set.
*/
public static new_for_bus_finish(res: Gio.AsyncResult): CalendarServerProxy;
/**
* Like {@link Cinnamon.CalendarServerProxy.new_sync} but takes a #GBusType instead of a #GDBusConnection.
*
* The calling thread is blocked until a reply is received.
*
* See cinnamon_calendar_server_proxy_new_for_bus() for the asynchronous version of this constructor.
* @param bus_type A #GBusType.
* @param flags Flags from the #GDBusProxyFlags enumeration.
* @param name A bus name (well-known or unique).
* @param object_path An object path.
* @param cancellable A #GCancellable or %NULL.
* @returns The constructed proxy object or %NULL if #error is set.
*/
public static new_for_bus_sync(bus_type: Gio.BusType, flags: Gio.DBusProxyFlags, name: string, object_path: string, cancellable?: Gio.Cancellable | null): CalendarServerProxy;
/**
* Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-cinnamon-CalendarServer.top_of_page">org.cinnamon.CalendarServer</link>. See {@link Glib.dbus_proxy_new_sync} for more details.
*
* The calling thread is blocked until a reply is received.
*
* See cinnamon_calendar_server_proxy_new() for the asynchronous version of this constructor.
* @param connection A #GDBusConnection.
* @param flags Flags from the #GDBusProxyFlags enumeration.
* @param name A bus name (well-known or unique) or %NULL if #connection is not a message bus connection.
* @param object_path An object path.
* @param cancellable A #GCancellable or %NULL.
* @returns The constructed proxy object or %NULL if #error is set.
*/
public static new_sync(connection: Gio.DBusConnection, flags: Gio.DBusProxyFlags, name: string | null, object_path: string, cancellable?: Gio.Cancellable | null): CalendarServerProxy;
/**
* Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-cinnamon-CalendarServer.top_of_page">org.cinnamon.CalendarServer</link>. See {@link Glib.dbus_proxy_new} for more details.
*
* When the operation is finished, #callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
* You can then call cinnamon_calendar_server_proxy_new_finish() to get the result of the operation.
*
* See cinnamon_calendar_server_proxy_new_sync() for the synchronous, blocking version of this constructor.
* @param connection A #GDBusConnection.
* @param flags Flags from the #GDBusProxyFlags enumeration.
* @param name A bus name (well-known or unique) or %NULL if #connection is not a message bus connection.
* @param object_path An object path.
* @param cancellable A #GCancellable or %NULL.
* @param callback A #GAsyncReadyCallback to call when the request is satisfied.
*/
public static new(connection: Gio.DBusConnection, flags: Gio.DBusProxyFlags, name: string | null, object_path: string, cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): void;
/**
* Like {@link Cinnamon.CalendarServerProxy.new} but takes a #GBusType instead of a #GDBusConnection.
*
* When the operation is finished, #callback will be invoked in the thread-default main loop of the thread you are calling this method from (see g_main_context_push_thread_default()).
* You can then call cinnamon_calendar_server_proxy_new_for_bus_finish() to get the result of the operation.
*
* See cinnamon_calendar_server_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
* @param bus_type A #GBusType.
* @param flags Flags from the #GDBusProxyFlags enumeration.
* @param name A bus name (well-known or unique).
* @param object_path An object path.
* @param cancellable A #GCancellable or %NULL.
* @param callback A #GAsyncReadyCallback to call when the request is satisfied.
*/
public static new_for_bus(bus_type: Gio.BusType, flags: Gio.DBusProxyFlags, name: string, object_path: string, cancellable?: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback | null): void;
}
/** This construct is only for enabling class multi-inheritance,
* use {@link CalendarServerSkeleton} instead.
*/
interface ICalendarServerSkeleton {
}
type CalendarServerSkeletonInitOptionsMixin = Gio.DBusInterfaceSkeletonInitOptions & CalendarServerInitOptions & Gio.DBusInterfaceInitOptions
export interface CalendarServerSkeletonInitOptions extends CalendarServerSkeletonInitOptionsMixin {}
/** This construct is only for enabling class multi-inheritance,
* use {@link CalendarServerSkeleton} instead.
*/
type CalendarServerSkeletonMixin = ICalendarServerSkeleton & Gio.DBusInterfaceSkeleton & CalendarServer & Gio.DBusInterface;
/**
* The {@link CalendarServerSkeleton} structure contains only private data and should only be accessed using the provided API.
*/
interface CalendarServerSkeleton extends CalendarServerSkeletonMixin {}
class CalendarServerSkeleton {
public constructor(options?: Partial<CalendarServerSkeletonInitOptions>);
/**
* Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-cinnamon-CalendarServer.top_of_page">org.cinnamon.CalendarServer</link>.
* @returns The skeleton object.
*/
public static new(): CalendarServerSkeleton;
}
/** This construct is only for enabling class multi-inheritance,
* use {@link DocSystem} instead.
*/
interface IDocSystem {
/**
* Returns the currently cached set of recent files. Recent files are read initially
* from the underlying #GtkRecentManager, and updated when it changes.
* This function does not perform I/O.
* @returns Cached recent file infos
*/
get_all(): Gtk.RecentInfo[];
connect(signal: "changed", callback: (owner: this) => void): number;
}
type DocSystemInitOptionsMixin = GObject.ObjectInitOptions
export interface DocSystemInitOptions extends DocSystemInitOptionsMixin {}
/** This construct is only for enabling class multi-inheritance,
* use {@link DocSystem} instead.
*/
type DocSystemMixin = IDocSystem & GObject.Object;
interface DocSystem extends DocSystemMixin {}
class DocSystem {
public constructor(options?: Partial<DocSystemInitOptions>);
public static get_default(): DocSystem;
}
/** This construct is only for enabling class multi-inheritance,
* use {@link EmbeddedWindow} instead.
*/
interface IEmbeddedWindow {
}
type EmbeddedWindowInitOptionsMixin = Gtk.WindowInitOptions & Atk.ImplementorIfaceInitOptions & Gtk.BuildableInitOptions
export interface EmbeddedWindowInitOptions extends EmbeddedWindowInitOptionsMixin {}
/** This construct is only for enabling class multi-inheritance,
* use {@link EmbeddedWindow} instead.
*/
type EmbeddedWindowMixin = IEmbeddedWindow & Gtk.Window & Atk.ImplementorIface & Gtk.Buildable;
interface EmbeddedWindow extends EmbeddedWindowMixin {}
class EmbeddedWindow {
public constructor(options?: Partial<EmbeddedWindowInitOptions>);
public static new(): Gtk.Widget;
}
/** This construct is only for enabling class multi-inheritance,
* use {@link GLSLQuad} instead.
*/
interface IGLSLQuad {
/**
* Adds a GLSL snippet to the pipeline used for drawing the actor texture.
* See #CoglSnippet for details.
*
* This is only valid inside the a call to the {@link Build.pipeline} virtual
* function.
* @param hook where to insert the code
* @param declarations GLSL declarations
* @param code GLSL code
* @param is_replace whether Cogl code should be replaced by the custom shader
*/
add_glsl_snippet(hook: SnippetHook, declarations: string, code: string, is_replace: boolean): void;
get_uniform_location(name: string): number;
set_uniform_float(uniform: number, n_components: number, value: number[]): void;
}
type GLSLQuadInitOptionsMixin = Clutter.ActorInitOptions & Atk.ImplementorIfaceInitOptions & Clutter.AnimatableInitOptions & Clutter.ContainerInitOptions & Clutter.ScriptableInitOptions
export interface GLSLQuadInitOptions extends GLSLQuadInitOptionsMixin {}
/** This construct is only for enabling class multi-inheritance,
* use {@link GLSLQuad} instead.
*/
type GLSLQuadMixin = IGLSLQuad & Clutter.Actor & Atk.ImplementorIface & Clutter.Animatable & Clutter.Container & Clutter.Scriptable;
interface GLSLQuad extends GLSLQuadMixin {}
class GLSLQuad {
public constructor(options?: Partial<GLSLQuadInitOptions>);
}
/** This construct is only for enabling class multi-inheritance,
* use {@link GenericContainer} instead.
*/
interface IGenericContainer {
get_n_skip_paint(): number;
/**
* Gets whether or not #actor is skipped when painting.
* @param child Child #ClutterActor
* @returns %TRUE or %FALSE
*/
get_skip_paint(child: Clutter.Actor): boolean;
/**
* Set whether or not we should skip painting #actor. Workaround for
* lack of gjs ability to override _paint vfunc.
* @param child Child #ClutterActor
* @param skip %TRUE if we should skip painting
*/
set_skip_paint(child: Clutter.Actor, skip: boolean): void;
/**
* Emitted when #self is allocated, after chaining up to the parent
* allocate method.
*
* Note that #box is #self's content box (qv
* {@link St.ThemeNode.get_content_box}), NOT its allocation.
* @param signal
* @param callback Callback function
* - owner: owner of the emitted event
* - box: #self's content box
* - flags: the allocation flags.
*
* @returns Callback ID
*/
connect(signal: "allocate", callback: (owner: this, box: Clutter.ActorBox, flags: Clutter.AllocationFlags) => void): number;
/**
* Emitted when {@link Clutter.Actor.get_preferred_height} is called
* on #self. You should fill in the fields of #alloc with the
* your minimum and natural heights. {@link GenericContainer}
* will deal with taking its borders and padding into account
* for you.
*
* #alloc's fields are initialized to 0, so unless you have a fixed
* height specified (via #ClutterActor:height or CSS), you must
* connect to this signal and fill in the values.
* @param signal
* @param callback Callback function
* - owner: owner of the emitted event
* - for_width: as in {@link Clutter.Actor.get_preferred_height}
* - alloc: a {@link GenericContainerAllocation} to be filled in
*
* @returns Callback ID
*/
connect(signal: "get-preferred-height", callback: (owner: this, for_width: number, alloc: GenericContainerAllocation) => void): number;
/**
* Emitted when {@link Clutter.Actor.get_preferred_width} is called
* on #self. You should fill in the fields of #alloc with the
* your minimum and natural widths. {@link GenericContainer}
* will deal with taking its borders and padding into account
* for you.
*
* #alloc's fields are initialized to 0, so unless you have a fixed
* width specified (via #ClutterActor:width or CSS), you must
* connect to this signal and fill in the values.
* @param signal
* @param callback Callback function
* - owner: owner of the emitted event
* - for_height: as in {@link Clutter.Actor.get_preferred_width}
* - alloc: a {@link GenericContainerAllocation} to be filled in
*
* @returns Callback ID
*/
connect(signal: "get-preferred-width", callback: (owner: this, for_height: number, alloc: GenericContainerAllocation) => void): number;
}
type GenericContainerInitOptionsMixin = St.WidgetInitOptions & Atk.ImplementorIfaceInitOptions & Clutter.AnimatableInitOptions & Clutter.ContainerInitOptions & Clutter.ScriptableInitOptions
export interface GenericContainerInitOptions extends GenericContainerInitOptionsMixin {}
/** This construct is only for enabling class multi-inheritance,
* use {@link GenericContainer} instead.
*/
type GenericContainerMixin = IGenericContainer & St.Widget & Atk.ImplementorIface & Clutter.Animatable & Clutter.Container & Clutter.Scriptable;
interface GenericContainer extends GenericContainerMixin {}
class GenericContainer {
public constructor(options?: Partial<GenericContainerInitOptions>);
}
/** This construct is only for enabling class multi-inheritance,
* use {@link Global} instead.
*/
interface IGlobal {
readonly background_actor: Clutter.Actor;
readonly bottom_window_group: Gtk.WindowGroup;
readonly datadir: string;
readonly desklet_container: Clutter.Actor;
readonly display: Meta.Display;
readonly focus_manager: St.FocusManager;
readonly imagedir: string;
readonly overlay_group: Clutter.Actor;
readonly screen: Screen;
readonly screen_height: number;
readonly screen_width: number;
session_running: boolean;
readonly settings: Gio.Settings;
readonly stage: Clutter.Stage;
stage_input_mode: StageInputMode;
readonly top_window_group: Gtk.WindowGroup;
readonly ui_scale: number;
readonly userdatadir: string;
readonly window_group: Gtk.WindowGroup;
readonly window_manager: WM;
readonly workspace_manager: Meta.WorkspaceManager;
/**
* Request mb megabytes allocated. This is just for debugging.
* @param mb How many mb to leak
*/
alloc_leak(mb: number): void;
/**
* Grabs the keyboard and mouse to the stage window. The stage will
* receive all keyboard and mouse events until {@link Cinnamon.Global.end_modal}
* is called. This is used to implement "modes" for the shell, such as the
* overview mode or the "looking glass" debug overlay, that block
* application and normal key shortcuts.
* @param timestamp
* @param options
* @returns %TRUE if we successfully entered the mode. %FALSE if we couldn't
* enter the mode. Failure may occur because an application has the pointer
* or keyboard grabbed, because Mutter is in a mode itself like moving a
* window or alt-Tab window selection, or because {@link Cinnamon.Global.begin_modal}
* was previously called.
*/
begin_modal(timestamp: number, options: Meta.ModalOptions): boolean;
/**
* Marks that we are currently doing work. This is used to to track
* whether we are busy for the purposes of {@link Cinnamon.Global.run_at_leisure}.
* A count is kept and cinnamon_global_end_work() must be called exactly
* as many times as cinnamon_global_begin_work().
*/
begin_work(): void;
/**
* Create a #GAppLaunchContext set up with the correct timestamp, and
* targeted to activate on the current workspace.
* @returns A new #GAppLaunchContext
*/
create_app_launch_context(): Gio.AppLaunchContext;
create_pointer_barrier(x1: number, y1: number, x2: number, y2: number, directions: number): number;
destroy_pointer_barrier(barrier: number): void;
/**
* Prints out the gjs stack
*/
dump_gjs_stack(): void;
/**
* Undoes the effect of {@link Cinnamon.Global.begin_modal}.
* @param timestamp
*/
end_modal(timestamp: number): void;
/**
* Marks the end of work that we started with {@link Cinnamon.Global.begin_work}.
* If no other work is ongoing and functions have been added with
* cinnamon_global_run_at_leisure(), they will be run at the next
* opportunity.
*/
end_work(): void;
get_current_time(): number;
get_display(): Meta.Display;
get_md5_for_string(string: string): string;
get_pid(): number;
/**
* Gets the pointer coordinates and current modifier key state.
* This is a wrapper around {@link Gdk.Display.get_pointer} that strips
* out any un-declared modifier flags, to make gjs happy; see
* https://bugzilla.gnome.org/show_bug.cgi?id=597292.
* @returns the X coordinate of the pointer, in global coordinates
*
* the Y coordinate of the pointer, in global coordinates
*
* the current set of modifier keys that are pressed down
*/
get_pointer(): [ x: number, y: number, mods: Clutter.ModifierType ];
get_screen(): Screen;
/**
* Get the global GSettings instance.
* @returns The GSettings object
*/
get_settings(): Gio.Settings;
get_stage(): Clutter.Stage;
/**
* Gets the list of #MetaWindowActor for the plugin's screen
* @returns the list of windows
*/
get_window_actors(): GLib.List<Meta.WindowActor>;
/**
* Show a system error notification. Use this function
* when a user-initiated action results in a non-fatal problem
* from causes that may not be under system control. For
* example, an application crash.
* @param msg Error message
* @param details Error details
*/
notify_error(msg: string, details: string): void;
/**
* Restart the current process.
*/
real_restart(): void;
/**
* Initiates the shutdown sequence.
*/
reexec_self(): void;
/**
* Schedules a function to be called the next time Cinnamon is idle.
* Idle means here no animations, no redrawing, and no ongoing background
* work. Since there is currently no way to hook into the Clutter master
* clock and know when is running, the implementation here is somewhat
* approximation. Animations done through Cinnamon's Tweener module will
* be handled properly, but other animations may be detected as terminating
* early if they can be drawn fast enough so that the event loop goes idle
* between frames.
*
* The intent of this function is for performance measurement runs
* where a number of actions should be run serially and each action is
* timed individually. Using this function for other purposes will
* interfere with the ability to use it for performance measurement so
* should be avoided.
* @param func function to call at leisure
*/
run_at_leisure(func: LeisureFunction): void;
/**
* Crashes Cinnamon by causing a segfault
*/
segfault(): void;
/**
* Set the cursor on the stage window.
* @param type the type of the cursor
*/
set_cursor(type: Cursor): void;
/**
* Sets the pointer coordinates.
* @param x the X coordinate of the pointer, in global coordinates
* @param y the Y coordinate of the pointer, in global coordinates
*/
set_pointer(x: number, y: number): void;
/**
* Sets the input mode of the stage; when #mode is
* %CINNAMON_STAGE_INPUT_MODE_NONREACTIVE, then the stage does not absorb
* any clicks, but just passes them through to underlying windows.
* When it is %CINNAMON_STAGE_INPUT_MODE_NORMAL, then the stage accepts
* clicks in the region defined by
* {@link Cinnamon.Global.set_stage_input_region} but passes through clicks
* outside that region. When it is %CINNAMON_STAGE_INPUT_MODE_FULLSCREEN,
* the stage absorbs all input.
*
* When the input mode is %CINNAMON_STAGE_INPUT_MODE_FOCUSED, the pointer
* is handled as with %CINNAMON_STAGE_INPUT_MODE_NORMAL, but additionally
* the stage window has the keyboard focus. If the stage loses the
* focus (eg, because the user clicked into a window) the input mode
* will revert to %CINNAMON_STAGE_INPUT_MODE_NORMAL.
*
* Note that whenever a muffin-internal Gtk widget has a pointer grab,
* Cinnamon behaves as though it was in
* %CINNAMON_STAGE_INPUT_MODE_NONREACTIVE, to ensure that the widget gets
* any clicks it is expecting.
* @param mode the stage input mode
*/
set_stage_input_mode(mode: StageInputMode): void;
/**
* Sets the area of the stage that is responsive to mouse clicks when
* the stage mode is %CINNAMON_STAGE_INPUT_MODE_NORMAL (but does not change the
* current stage mode).
* @param rectangles a list of #MetaRectangle
* describing the input region.
*/
set_stage_input_region(rectangles: Meta.Rectangle[]): void;
/**
* Ensures that clutter is aware of the current pointer position,
* causing enter and leave events to be emitted if the pointer moved
* behind our back (ie, during a pointer grab).
*/
sync_pointer(): void;
/**
* Unset the cursor on the stage window.
*/
unset_cursor(): void;
connect(signal: "notify-error", callback: (owner: this, object: string, p0: string) => void): number;
connect(signal: "scale-changed", callback: (owner: this) => void): number;
connect(signal: "shutdown", callback: (owner: this) => void): number;
connect(signal: "notify::background-actor", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::bottom-window-group", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::datadir", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::desklet-container", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::display", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::focus-manager", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::imagedir", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::overlay-group", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::screen", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::screen-height", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::screen-width", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::session-running", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::settings", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::stage", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::stage-input-mode", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::top-window-group", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::ui-scale", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::userdatadir", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::window-group", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::window-manager", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::workspace-manager", callback: (owner: this, ...args: any) => void): number;
}
type GlobalInitOptionsMixin = GObject.ObjectInitOptions &
Pick<IGlobal,
"session_running" |
"stage_input_mode">;
export interface GlobalInitOptions extends GlobalInitOptionsMixin {}
/** This construct is only for enabling class multi-inheritance,
* use {@link Global} instead.
*/
type GlobalMixin = IGlobal & GObject.Object;
interface Global extends GlobalMixin {}
class Global {
public constructor(options?: Partial<GlobalInitOptions>);
/**
* Gets the singleton global object that represents the desktop.
* @returns the singleton global object
*/
public static get(): Global;
}
/** This construct is only for enabling class multi-inheritance,
* use {@link GtkEmbed} instead.
*/
interface IGtkEmbed {
window: EmbeddedWindow;
connect(signal: "notify::window", callback: (owner: this, ...args: any) => void): number;
}
type GtkEmbedInitOptionsMixin = Clutter.CloneInitOptions & Atk.ImplementorIfaceInitOptions & Clutter.AnimatableInitOptions & Clutter.ContainerInitOptions & Clutter.ScriptableInitOptions &
Pick<IGtkEmbed,
"window">;
export interface GtkEmbedInitOptions extends GtkEmbedInitOptionsMixin {}
/** This construct is only for enabling class multi-inheritance,
* use {@link GtkEmbed} instead.
*/
type GtkEmbedMixin = IGtkEmbed & Clutter.Clone & Atk.ImplementorIface & Clutter.Animatable & Clutter.Container & Clutter.Scriptable;
interface GtkEmbed extends GtkEmbedMixin {}
class GtkEmbed {
public constructor(options?: Partial<GtkEmbedInitOptions>);
public static new(window: EmbeddedWindow): Clutter.Actor;
}
/** This construct is only for enabling class multi-inheritance,
* use {@link PerfLog} instead.
*/
interface IPerfLog {
/**
* Adds a function that will be called before statistics are recorded.
* The function would typically compute one or more statistics values
* and call a function such as {@link Cinnamon.PerfLog.update_statistic_i}
* to update the value that will be recorded.
* @param callback function to call before recording statistics
*/
add_statistics_callback(callback: PerfStatisticsCallback): void;
/**
* Calls all the update functions added with
* {@link Cinnamon.PerfLog.add_statistics_callback} and then records events
* for all statistics, followed by a perf.statisticsCollected event.
*/
collect_statistics(): void;
/**
* Defines a performance event for later recording.
* @param name name of the event. This should of the form
* '<namespace>.<specific event>', for example
* 'clutter.stagePaintDone'.
* @param description human readable description of the event.
* @param signature signature defining the arguments that event takes.
* This is a string of type characters, using the same characters
* as D-Bus or GVariant. Only a very limited number of signatures
* are supported: , '', 's', 'i', and 'x'. This mean respectively:
* no arguments, one string, one 32-bit integer, and one 64-bit
* integer.
*/
define_event(name: string, description: string, signature: string): void;
/**
* Defines a statistic. A statistic is a numeric value that is stored
* by the performance log and recorded periodically or when
* {@link Cinnamon.PerfLog.collect_statistics} is called explicitly.
*
* Code that defines a statistic should update it by calling
* the update function for the particular data type of the statistic,
* such as cinnamon_perf_log_update_statistic_i(). This can be done
* at any time, but would normally done inside a function registered
* with cinnamon_perf_log_add_statistics_callback(). These functions
* are called immediately before statistics are recorded.
* @param name name of the statistic and of the corresponding event.
* This should follow the same guidelines as for {@link Cinnamon.PerfLog.define_event}
* @param description human readable description of the statistic.
* @param signature The type of the data stored for statistic. Must
* currently be 'i' or 'x'.
*/
define_statistic(name: string, description: string, signature: string): void;
/**
* Dump the definition of currently defined events and statistics, formatted
* as JSON, to the specified output stream. The JSON output is an array,
* with each element being a dictionary of the form:
*
* { name: <name of event>,
* description: <description of string>,
* statistic: true } (only for statistics)
* @param out output stream into which to write the event definitions
* @returns %TRUE if the dump succeeded. %FALSE if an IO error occurred
*/
dump_events(out: Gio.OutputStream): boolean;
/**
* Writes the performance event log, formatted as JSON, to the specified
* output stream. For performance reasons, the output stream passed
* in should generally be a buffered (or memory) output stream, since
* it will be written to in small pieces. The JSON output is an array
* with the elements of the array also being arrays, of the form
* '[' <time>, <event name> [, <event_arg>... ] ']'.
* @param out output stream into which to write the event log
* @returns %TRUE if the dump succeeded. %FALSE if an IO error occurred
*/
dump_log(out: Gio.OutputStream): boolean;
/**
* Records a performance event with no arguments.
* @param name name of the event
*/
event(name: string): void;
/**
* Records a performance event with one 32-bit integer argument.
* @param name name of the event
* @param arg the argument
*/
event_i(name: string, arg: number): void;
/**
* Records a performance event with one string argument.
* @param name name of the event
* @param arg the argument
*/
event_s(name: string, arg: string): void;
/**
* Records a performance event with one 64-bit integer argument.
* @param name name of the event
* @param arg the argument
*/
event_x(name: string, arg: number): void;
/**
* Replays the log by calling the given function for each event
* in the log.
* @param replay_function function to call for each event in the log
*/
replay(replay_function: PerfReplayFunction): void;
/**
* Sets whether events are currently being recorded.
* @param enabled whether to record events
*/
set_enabled(enabled: boolean): void;
/**
* Updates the current value of an 32-bit integer statistic.
* @param name name of the statistic
* @param value new value for the statistic
*/
update_statistic_i(name: string, value: number): void;
/**
* Updates the current value of an 64-bit integer statistic.
* @param name name of the statistic
* @param value new value for the statistic
*/
update_statistic_x(name: string, value: number): void;
}
type PerfLogInitOptionsMixin = GObject.ObjectInitOptions
export interface PerfLogInitOptions extends PerfLogInitOptionsMixin {}
/** This construct is only for enabling class multi-inheritance,
* use {@link PerfLog} instead.
*/
type PerfLogMixin = IPerfLog & GObject.Object;
interface PerfLog extends PerfLogMixin {}
class PerfLog {
public constructor(options?: Partial<PerfLogInitOptions>);
/**
* Gets the global singleton performance log. This is initially disabled
* and must be explicitly enabled with {@link Cinnamon.PerfLog.set_enabled}.
* @returns the global singleton performance log
*/
public static get_default(): PerfLog;
}
/** This construct is only for enabling class multi-inheritance,
* use {@link Recorder} instead.
*/
interface IRecorder {
draw_cursor: boolean;
file_template: string;
framerate: number;
pipeline: string;
stage: Clutter.Stage;
/**
* Stops recording. It's possible to call {@link Cinnamon.Recorder.record}
* again to reopen a new recording stream, but unless change the
* recording filename, this may result in the old recording being
* overwritten.
*/
close(): void;
/**
* Determine if recording is currently in progress. (The recorder
* is not paused or closed.)
* @returns %TRUE if the recorder is currently recording.
*/
is_recording(): boolean;
/**
* Starts recording, Starting the recording may fail if the output file
* cannot be opened, or if the output stream cannot be created
* for other reasons. In that case a warning is printed to
* stderr. There is no way currently to get details on how
* recording failed to start.
*
* An extra reference count is added to the recorder if recording
* is successfully started; the recording object will not be freed
* until recording is stopped even if the creator no longer holds
* a reference. Recording is automatically stopped if the stage
* is destroyed.
* @returns %TRUE if recording was successfully started
*
* actual filename used for recording
*/
record(): [ boolean, string | null ];
set_area(x: number, y: number, width: number, height: number): void;
set_draw_cursor(draw_cursor: boolean): void;
/**
* Sets the filename that will be used when creating output
* files. This is only used if the configured pipeline has an
* unconnected source pad (as the default pipeline does). If
* the pipeline is complete, then the filename is unused. The
* provided string is used as a template.It can contain
* the following escapes:
*
* %d: The current date as YYYYYMMDD
* %%: A literal percent
*
* The default value is 'cinnamon-%d%u-%c.ogg'.
* @param file_template the filename template to use for output files,
* or %NULL for the default value.
*/
set_file_template(file_template: string): void;
/**
* Sets the number of frames per second we try to record. Less frames
* will be recorded when the screen doesn't need to be redrawn this
* quickly. (This value will also be set as the framerate for the
* GStreamer pipeline; whether that has an effect on the resulting
* video will depend on the details of the pipeline and the codec. The
* default encoding to webm format doesn't pay attention to the pipeline
* framerate.)
*
* The default value is 30.
* @param framerate Framerate used for resulting video in frames-per-second.
*/
set_framerate(framerate: number): void;
/**
* Sets the GStreamer pipeline used to encode recordings.
* It follows the syntax used for gst-launch. The pipeline
* should have an unconnected sink pad where the recorded
* video is recorded. It will normally have a unconnected
* source pad; output from that pad will be written into the
* output file. (See {@link Cinnamon.Recorder.set_file_template}.) However
* the pipeline can also take care of its own output - this
* might be used to send the output to an icecast server
* via shout2send or similar.
*
* The default value is 'vp8enc min_quantizer=13 max_quantizer=13 cpu-used=5 deadline=1000000 threads=%T ! queue ! webmmux'
* @param pipeline the GStreamer pipeline used to encode recordings
* or %NULL for the default value.
*/
set_pipeline(pipeline?: string | null): void;
connect(signal: "notify::draw-cursor", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::file-template", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::framerate", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::pipeline", callback: (owner: this, ...args: any) => void): number;
connect(signal: "notify::stage", callback: (owner: this, ...args: any) => void): number;
}