@girs/unique-3.0 3.0.0-3.2.9 → 3.0.0-4.0.0-beta.1

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/unique-3.0.d.ts CHANGED
@@ -1,4 +1,3 @@
1
-
2
1
  /*
3
2
  * Type Definitions for Gjs (https://gjs.guide/)
4
3
  *
@@ -7,7 +6,7 @@
7
6
  */
8
7
 
9
8
  import './unique-3.0-ambient.d.ts';
10
- import './unique-3.0-import.d.ts';
9
+
11
10
  /**
12
11
  * Unique-3.0
13
12
  */
@@ -27,541 +26,390 @@ import type GModule from '@girs/gmodule-2.0';
27
26
  import type Atk from '@girs/atk-1.0';
28
27
 
29
28
  export namespace Unique {
30
-
31
- /**
32
- * Command to send to a currently active instance. User defined commands
33
- * should be positive integers, and should be added using the
34
- * unique_app_add_command() function after creating a #UniqueApp instance
35
- */
36
- enum Command {
37
- INVALID,
38
- ACTIVATE,
39
- NEW,
40
- OPEN,
41
- CLOSE,
42
- }
43
- /**
44
- * Response that a currently active instance of the application should
45
- * return to the caller which sent a command.
46
- */
47
- enum Response {
48
- INVALID,
49
- OK,
50
- CANCEL,
51
- FAIL,
52
- PASSTHROUGH,
53
- }
54
- module App {
55
-
56
- // Signal callback interfaces
57
-
58
29
  /**
59
- * Signal callback interface for `message-received`
30
+ * Command to send to a currently active instance. User defined commands
31
+ * should be positive integers, and should be added using the
32
+ * unique_app_add_command() function after creating a #UniqueApp instance
60
33
  */
61
- interface MessageReceivedSignalCallback {
62
- ($obj: App, command: number, message_data: MessageData, time_: number): Response
34
+ enum Command {
35
+ INVALID,
36
+ ACTIVATE,
37
+ NEW,
38
+ OPEN,
39
+ CLOSE,
40
+ }
41
+ /**
42
+ * Response that a currently active instance of the application should
43
+ * return to the caller which sent a command.
44
+ */
45
+ enum Response {
46
+ INVALID,
47
+ OK,
48
+ CANCEL,
49
+ FAIL,
50
+ PASSTHROUGH,
51
+ }
52
+ module App {
53
+ // Signal callback interfaces
54
+
55
+ interface MessageReceived {
56
+ (command: number, message_data: MessageData, time_: number): Response;
57
+ }
58
+
59
+ // Constructor properties interface
60
+
61
+ interface ConstructorProps extends GObject.Object.ConstructorProps {
62
+ is_running: boolean;
63
+ isRunning: boolean;
64
+ name: string;
65
+ screen: Gdk.Screen;
66
+ startup_id: string;
67
+ startupId: string;
68
+ }
63
69
  }
64
70
 
71
+ /**
72
+ * The base class for every single instance application. The #UniqueApp
73
+ * structure contains only private data and should be manipulated only
74
+ * with the provided functions.
75
+ */
76
+ class App extends GObject.Object {
77
+ static $gtype: GObject.GType<App>;
65
78
 
66
- // Constructor properties interface
67
-
68
- interface ConstructorProperties extends GObject.Object.ConstructorProperties {
69
-
70
- // Own constructor properties of Unique-3.0.Unique.App
79
+ // Own properties of Unique.App
71
80
 
81
+ /**
82
+ * Whether another instance of the application is running.
83
+ */
84
+ get is_running(): boolean;
85
+ /**
86
+ * Whether another instance of the application is running.
87
+ */
88
+ get isRunning(): boolean;
72
89
  /**
73
90
  * The unique name of the application. It must be in form of
74
91
  * a domain-like string, like <literal>org.gnome.MyApplication</literal>.
75
92
  */
76
- name?: string | null
93
+ get name(): string;
77
94
  /**
78
95
  * The #GdkScreen of the application.
79
96
  */
80
- screen?: Gdk.Screen | null
97
+ get screen(): Gdk.Screen;
98
+ set screen(val: Gdk.Screen);
81
99
  /**
82
100
  * The startup notification id, needed to complete the startup
83
101
  * notification sequence. If not set, a default id will be
84
102
  * automatically given.
85
103
  */
86
- startupId?: string | null
87
- }
88
-
89
- }
90
-
91
- interface App {
92
-
93
- // Own properties of Unique-3.0.Unique.App
94
-
95
- /**
96
- * Whether another instance of the application is running.
97
- */
98
- readonly isRunning: boolean
99
- /**
100
- * The unique name of the application. It must be in form of
101
- * a domain-like string, like <literal>org.gnome.MyApplication</literal>.
102
- */
103
- readonly name: string
104
- /**
105
- * The #GdkScreen of the application.
106
- */
107
- screen: Gdk.Screen
108
- /**
109
- * The startup notification id, needed to complete the startup
110
- * notification sequence. If not set, a default id will be
111
- * automatically given.
112
- */
113
- readonly startupId: string
104
+ get startup_id(): string;
105
+ /**
106
+ * The startup notification id, needed to complete the startup
107
+ * notification sequence. If not set, a default id will be
108
+ * automatically given.
109
+ */
110
+ get startupId(): string;
114
111
 
115
- // Owm methods of Unique-3.0.Unique.App
112
+ // Constructors of Unique.App
116
113
 
117
- /**
118
- * Adds `command_name` as a custom command that can be used by `app`. You
119
- * must call unique_app_add_command() before unique_app_send_message() in
120
- * order to use the newly added command.
121
- *
122
- * The command name is used internally: you need to use the command's logical
123
- * id in unique_app_send_message() and inside the UniqueApp::message-received
124
- * signal.
125
- * @param command_name command name
126
- * @param command_id command logical id
127
- */
128
- add_command(command_name: string | null, command_id: number): void
129
- /**
130
- * Checks whether another instance of `app` is running.
131
- * @returns %TRUE if there already is an instance running
132
- */
133
- is_running(): boolean
134
- /**
135
- * Sends `command` to a running instance of `app`. If you need to pass data
136
- * to the instance, you should create a #UniqueMessageData object using
137
- * unique_message_data_new() and then fill it with the data you intend to
138
- * pass.
139
- *
140
- * The running application will receive a UniqueApp::message-received signal
141
- * and will call the various signal handlers attach to it. If any handler
142
- * returns a #UniqueResponse different than %UNIQUE_RESPONSE_OK, the emission
143
- * will stop.
144
- * @param command_id command to send
145
- * @param message_data #UniqueMessageData, or %NULL
146
- * @returns The #UniqueResponse returned by the running instance
147
- */
148
- send_message(command_id: number, message_data?: MessageData | null): Response
149
- /**
150
- * Makes `app` "watch" a window. Every watched window will receive
151
- * startup notification changes automatically.
152
- * @param window the #GtkWindow to watch
153
- */
154
- watch_window(window: Gtk.Window): void
155
-
156
- // Own virtual methods of Unique-3.0.Unique.App
157
-
158
- vfunc_message_received(command: number, message_data: MessageData, time_: number): Response
159
-
160
- // Own signals of Unique-3.0.Unique.App
161
-
162
- connect(sigName: "message-received", callback: App.MessageReceivedSignalCallback): number
163
- connect_after(sigName: "message-received", callback: App.MessageReceivedSignalCallback): number
164
- emit(sigName: "message-received", command: number, message_data: MessageData, time_: number, ...args: any[]): void
165
-
166
- // Class property signals of Unique-3.0.Unique.App
167
-
168
- connect(sigName: "notify::is-running", callback: (($obj: App, pspec: GObject.ParamSpec) => void)): number
169
- connect_after(sigName: "notify::is-running", callback: (($obj: App, pspec: GObject.ParamSpec) => void)): number
170
- emit(sigName: "notify::is-running", ...args: any[]): void
171
- connect(sigName: "notify::name", callback: (($obj: App, pspec: GObject.ParamSpec) => void)): number
172
- connect_after(sigName: "notify::name", callback: (($obj: App, pspec: GObject.ParamSpec) => void)): number
173
- emit(sigName: "notify::name", ...args: any[]): void
174
- connect(sigName: "notify::screen", callback: (($obj: App, pspec: GObject.ParamSpec) => void)): number
175
- connect_after(sigName: "notify::screen", callback: (($obj: App, pspec: GObject.ParamSpec) => void)): number
176
- emit(sigName: "notify::screen", ...args: any[]): void
177
- connect(sigName: "notify::startup-id", callback: (($obj: App, pspec: GObject.ParamSpec) => void)): number
178
- connect_after(sigName: "notify::startup-id", callback: (($obj: App, pspec: GObject.ParamSpec) => void)): number
179
- emit(sigName: "notify::startup-id", ...args: any[]): void
180
- connect(sigName: string, callback: (...args: any[]) => void): number
181
- connect_after(sigName: string, callback: (...args: any[]) => void): number
182
- emit(sigName: string, ...args: any[]): void
183
- disconnect(id: number): void
184
- }
114
+ constructor(properties?: Partial<App.ConstructorProps>, ...args: any[]);
185
115
 
186
- /**
187
- * The base class for every single instance application. The #UniqueApp
188
- * structure contains only private data and should be manipulated only
189
- * with the provided functions.
190
- * @class
191
- */
192
- class App extends GObject.Object {
116
+ _init(...args: any[]): void;
193
117
 
194
- // Own properties of Unique-3.0.Unique.App
118
+ static ['new'](name: string, startup_id: string): App;
195
119
 
196
- static name: string
197
- static $gtype: GObject.GType<App>
120
+ // Own signals of Unique.App
198
121
 
199
- // Constructors of Unique-3.0.Unique.App
122
+ connect(id: string, callback: (...args: any[]) => any): number;
123
+ connect_after(id: string, callback: (...args: any[]) => any): number;
124
+ emit(id: string, ...args: any[]): void;
125
+ connect(
126
+ signal: 'message-received',
127
+ callback: (_source: this, command: number, message_data: MessageData, time_: number) => Response,
128
+ ): number;
129
+ connect_after(
130
+ signal: 'message-received',
131
+ callback: (_source: this, command: number, message_data: MessageData, time_: number) => Response,
132
+ ): number;
133
+ emit(signal: 'message-received', command: number, message_data: MessageData, time_: number): void;
200
134
 
201
- constructor(config?: App.ConstructorProperties)
202
- /**
203
- * Creates a new #UniqueApp instance for `name` passing a start-up notification
204
- * id `startup_id`. The name must be a unique identifier for the application,
205
- * and it must be in form of a domain name, like
206
- * <literal>org.gnome.YourApplication</literal>.
207
- *
208
- * If `startup_id` is %NULL the <literal>DESKTOP_STARTUP_ID</literal>
209
- * environment variable will be check, and if that fails a "fake" startup
210
- * notification id will be created.
211
- *
212
- * Once you have created a #UniqueApp instance, you should check if
213
- * any other instance is running, using unique_app_is_running().
214
- * If another instance is running you can send a command to it, using
215
- * the unique_app_send_message() function; after that, the second instance
216
- * should quit. If no other instance is running, the usual logic for
217
- * creating the application can follow.
218
- * @constructor
219
- * @param name the name of the application's instance
220
- * @param startup_id the startup notification id, or %NULL
221
- * @returns the newly created #UniqueApp instance.
222
- */
223
- constructor(name: string | null, startup_id?: string | null)
224
- /**
225
- * Creates a new #UniqueApp instance for `name` passing a start-up notification
226
- * id `startup_id`. The name must be a unique identifier for the application,
227
- * and it must be in form of a domain name, like
228
- * <literal>org.gnome.YourApplication</literal>.
229
- *
230
- * If `startup_id` is %NULL the <literal>DESKTOP_STARTUP_ID</literal>
231
- * environment variable will be check, and if that fails a "fake" startup
232
- * notification id will be created.
233
- *
234
- * Once you have created a #UniqueApp instance, you should check if
235
- * any other instance is running, using unique_app_is_running().
236
- * If another instance is running you can send a command to it, using
237
- * the unique_app_send_message() function; after that, the second instance
238
- * should quit. If no other instance is running, the usual logic for
239
- * creating the application can follow.
240
- * @constructor
241
- * @param name the name of the application's instance
242
- * @param startup_id the startup notification id, or %NULL
243
- * @returns the newly created #UniqueApp instance.
244
- */
245
- static new(name: string | null, startup_id?: string | null): App
246
- _init(config?: App.ConstructorProperties): void
247
- }
135
+ // Own virtual methods of Unique.App
248
136
 
249
- module Backend {
137
+ vfunc_message_received(command: number, message_data: MessageData, time_: number): Response;
250
138
 
251
- // Constructor properties interface
139
+ // Own methods of Unique.App
252
140
 
253
- interface ConstructorProperties extends GObject.Object.ConstructorProperties {
141
+ /**
142
+ * Adds `command_name` as a custom command that can be used by `app`. You
143
+ * must call unique_app_add_command() before unique_app_send_message() in
144
+ * order to use the newly added command.
145
+ *
146
+ * The command name is used internally: you need to use the command's logical
147
+ * id in unique_app_send_message() and inside the UniqueApp::message-received
148
+ * signal.
149
+ * @param command_name command name
150
+ * @param command_id command logical id
151
+ */
152
+ add_command(command_name: string, command_id: number): void;
153
+ /**
154
+ * Sends `command` to a running instance of `app`. If you need to pass data
155
+ * to the instance, you should create a #UniqueMessageData object using
156
+ * unique_message_data_new() and then fill it with the data you intend to
157
+ * pass.
158
+ *
159
+ * The running application will receive a UniqueApp::message-received signal
160
+ * and will call the various signal handlers attach to it. If any handler
161
+ * returns a #UniqueResponse different than %UNIQUE_RESPONSE_OK, the emission
162
+ * will stop.
163
+ * @param command_id command to send
164
+ * @param message_data #UniqueMessageData, or %NULL
165
+ * @returns The #UniqueResponse returned by the running instance
166
+ */
167
+ send_message(command_id: number, message_data: MessageData): Response;
168
+ /**
169
+ * Makes `app` "watch" a window. Every watched window will receive
170
+ * startup notification changes automatically.
171
+ * @param window the #GtkWindow to watch
172
+ */
173
+ watch_window(window: Gtk.Window): void;
254
174
  }
255
175
 
256
- }
257
-
258
- interface Backend {
259
-
260
- // Own fields of Unique-3.0.Unique.Backend
261
-
262
- parent_instance: GObject.Object
263
-
264
- // Owm methods of Unique-3.0.Unique.Backend
265
-
266
- /**
267
- * FIXME
268
- * @returns FIXME
269
- */
270
- get_name(): string | null
271
- /**
272
- * FIXME
273
- * @returns FIXME
274
- */
275
- get_screen(): Gdk.Screen
276
- /**
277
- * FIXME
278
- * @returns FIXME
279
- */
280
- get_startup_id(): string | null
281
- /**
282
- * Retrieves the current workspace.
283
- * @returns a workspace number
284
- */
285
- get_workspace(): number
286
- /**
287
- * Requests the name set using unique_backend_set_name() using `backend`.
288
- *
289
- * already is a registered name
290
- * @returns %TRUE if the name was assigned to us, %FALSE if there
291
- */
292
- request_name(): boolean
293
- /**
294
- * Sends `command_id,` and optionally `message_data,` to a running instance
295
- * using `backend`.
296
- * @param command_id command to send
297
- * @param message_data message to send, or %NULL
298
- * @param time_ time of the command emission, or 0 for the current time
299
- * @returns a #UniqueResponse value sent by the running instance
300
- */
301
- send_message(command_id: number, message_data: MessageData, time_: number): Response
302
- /**
303
- * FIXME
304
- * @param name FIXME
305
- */
306
- set_name(name: string | null): void
307
- /**
308
- * FIXME
309
- * @param screen FIXME
310
- */
311
- set_screen(screen: Gdk.Screen): void
312
- /**
313
- * FIXME
314
- * @param startup_id FIXME
315
- */
316
- set_startup_id(startup_id: string | null): void
176
+ module Backend {
177
+ // Constructor properties interface
317
178
 
318
- // Own virtual methods of Unique-3.0.Unique.Backend
179
+ interface ConstructorProps extends GObject.Object.ConstructorProps {}
180
+ }
319
181
 
320
182
  /**
321
- * Requests the name set using unique_backend_set_name() using `backend`.
322
- *
323
- * already is a registered name
324
- * @virtual
325
- * @returns %TRUE if the name was assigned to us, %FALSE if there
326
- */
327
- vfunc_request_name(): boolean
328
- /**
329
- * Sends `command_id,` and optionally `message_data,` to a running instance
330
- * using `backend`.
331
- * @virtual
332
- * @param command_id command to send
333
- * @param message_data message to send, or %NULL
334
- * @param time_ time of the command emission, or 0 for the current time
335
- * @returns a #UniqueResponse value sent by the running instance
183
+ * The #UniqueBackend structure contains only private data and should only
184
+ * be accessed using the provided functions.
336
185
  */
337
- vfunc_send_message(command_id: number, message_data: MessageData, time_: number): Response
186
+ abstract class Backend extends GObject.Object {
187
+ static $gtype: GObject.GType<Backend>;
338
188
 
339
- // Class property signals of Unique-3.0.Unique.Backend
189
+ // Constructors of Unique.Backend
340
190
 
341
- connect(sigName: string, callback: (...args: any[]) => void): number
342
- connect_after(sigName: string, callback: (...args: any[]) => void): number
343
- emit(sigName: string, ...args: any[]): void
344
- disconnect(id: number): void
345
- }
346
-
347
- /**
348
- * The #UniqueBackend structure contains only private data and should only
349
- * be accessed using the provided functions.
350
- * @class
351
- */
352
- class Backend extends GObject.Object {
191
+ constructor(properties?: Partial<Backend.ConstructorProps>, ...args: any[]);
353
192
 
354
- // Own properties of Unique-3.0.Unique.Backend
193
+ _init(...args: any[]): void;
355
194
 
356
- static name: string
357
- static $gtype: GObject.GType<Backend>
358
-
359
- // Constructors of Unique-3.0.Unique.Backend
360
-
361
- constructor(config?: Backend.ConstructorProperties)
362
- _init(config?: Backend.ConstructorProperties): void
363
- /**
364
- * Creates a #UniqueBackend using the default backend defined at
365
- * compile time. You can override the default backend by setting the
366
- * <literal>UNIQUE_BACKEND</literal> environment variable with the
367
- * name of the desired backend.
368
- * @returns the newly created #UniqueBackend instance
369
- */
370
- static create(): Backend
371
- }
372
-
373
- interface AppClass {
374
-
375
- // Own fields of Unique-3.0.Unique.AppClass
376
-
377
- message_received: (app: App, command: number, message_data: MessageData, time_: number) => Response
378
- }
195
+ // Own static methods of Unique.Backend
379
196
 
380
- /**
381
- * Base class for every single instance application.
382
- * @record
383
- */
384
- abstract class AppClass {
385
-
386
- // Own properties of Unique-3.0.Unique.AppClass
387
-
388
- static name: string
389
- }
390
-
391
- interface AppPrivate {
392
- }
393
-
394
- class AppPrivate {
395
-
396
- // Own properties of Unique-3.0.Unique.AppPrivate
397
-
398
- static name: string
399
- }
400
-
401
- interface BackendClass {
197
+ /**
198
+ * Creates a #UniqueBackend using the default backend defined at
199
+ * compile time. You can override the default backend by setting the
200
+ * <literal>UNIQUE_BACKEND</literal> environment variable with the
201
+ * name of the desired backend.
202
+ */
203
+ static create(): Backend;
402
204
 
403
- // Own fields of Unique-3.0.Unique.BackendClass
205
+ // Own virtual methods of Unique.Backend
404
206
 
405
- request_name: (backend: Backend) => boolean
406
- send_message: (backend: Backend, command_id: number, message_data: MessageData, time_: number) => Response
407
- }
207
+ /**
208
+ * Requests the name set using unique_backend_set_name() using `backend`.
209
+ *
210
+ * already is a registered name
211
+ */
212
+ vfunc_request_name(): boolean;
213
+ /**
214
+ * Sends `command_id,` and optionally `message_data,` to a running instance
215
+ * using `backend`.
216
+ * @param command_id command to send
217
+ * @param message_data message to send, or %NULL
218
+ * @param time_ time of the command emission, or 0 for the current time
219
+ */
220
+ vfunc_send_message(command_id: number, message_data: MessageData, time_: number): Response;
408
221
 
409
- /**
410
- * The class that should be implemented by every backend for #UniqueApp.
411
- * @record
412
- */
413
- abstract class BackendClass {
222
+ // Own methods of Unique.Backend
414
223
 
415
- // Own properties of Unique-3.0.Unique.BackendClass
224
+ /**
225
+ * FIXME
226
+ * @returns FIXME
227
+ */
228
+ get_name(): string;
229
+ /**
230
+ * FIXME
231
+ * @returns FIXME
232
+ */
233
+ get_screen(): Gdk.Screen;
234
+ /**
235
+ * FIXME
236
+ * @returns FIXME
237
+ */
238
+ get_startup_id(): string;
239
+ /**
240
+ * Retrieves the current workspace.
241
+ * @returns a workspace number
242
+ */
243
+ get_workspace(): number;
244
+ /**
245
+ * Requests the name set using unique_backend_set_name() using `backend`.
246
+ *
247
+ * already is a registered name
248
+ * @returns %TRUE if the name was assigned to us, %FALSE if there
249
+ */
250
+ request_name(): boolean;
251
+ /**
252
+ * Sends `command_id,` and optionally `message_data,` to a running instance
253
+ * using `backend`.
254
+ * @param command_id command to send
255
+ * @param message_data message to send, or %NULL
256
+ * @param time_ time of the command emission, or 0 for the current time
257
+ * @returns a #UniqueResponse value sent by the running instance
258
+ */
259
+ send_message(command_id: number, message_data: MessageData, time_: number): Response;
260
+ /**
261
+ * FIXME
262
+ * @param name FIXME
263
+ */
264
+ set_name(name: string): void;
265
+ /**
266
+ * FIXME
267
+ * @param screen FIXME
268
+ */
269
+ set_screen(screen: Gdk.Screen): void;
270
+ /**
271
+ * FIXME
272
+ * @param startup_id FIXME
273
+ */
274
+ set_startup_id(startup_id: string): void;
275
+ }
416
276
 
417
- static name: string
418
- }
277
+ type AppClass = typeof App;
278
+ abstract class AppPrivate {
279
+ static $gtype: GObject.GType<AppPrivate>;
419
280
 
420
- interface MessageData {
281
+ // Constructors of Unique.AppPrivate
421
282
 
422
- // Owm methods of Unique-3.0.Unique.MessageData
283
+ _init(...args: any[]): void;
284
+ }
423
285
 
286
+ type BackendClass = typeof Backend;
424
287
  /**
425
- * Copies `message_data`.
426
- * @returns a copy of the passed #UniqueMessageData
427
- */
428
- copy(): MessageData
429
- /**
430
- * Frees all the resources allocated by `message_data`.
431
- */
432
- free(): void
433
- /**
434
- * Retrieves the raw contents of `message_data` set using
435
- * unique_messaget_data_set().
436
- *
437
- * returned string is owned by the #UniqueMessageData and should
438
- * never be modified or freed
439
- * @returns the contents of the message data or %NULL. The
440
- */
441
- get(): [ /* returnType */ number, /* length */ number ]
442
- /**
443
- * Retrieves the filename set with unique_message_data_set_filename().
444
- *
445
- * filename. Use g_free() to free the resources used by the returned
446
- * value.
447
- * @returns a newly allocated string containing the
448
- */
449
- get_filename(): string | null
450
- /**
451
- * Returns a pointer to the screen from where the message came. You
452
- * can use gtk_window_set_screen() to move windows or dialogs to the
453
- * right screen. This field is always set by the Unique library.
454
- * @returns a #GdkScreen
455
- */
456
- get_screen(): Gdk.Screen
457
- /**
458
- * Retrieves the startup notification id set inside `message_data`. This
459
- * field is always set by the Unique library.
460
- *
461
- * owned by the #UniqueMessageData structure and should not be
462
- * modified or freed
463
- * @returns the startup notification id. The returned string is
288
+ * #UniqueMessageData contains the data passed between instances of
289
+ * a #UniqueApp. The #UniqueMessageData structure received inside
290
+ * the signal handlers for UniqueApp::message-received is guaranteed
291
+ * to contain the #GdkScreen, the workspace and the startup notification
292
+ * id of the instance sending the message.
464
293
  */
465
- get_startup_id(): string | null
466
- /**
467
- * Retrieves the text set using unique_message_data_set_text().
468
- * @returns a newly-allocated string.
469
- */
470
- get_text(): string | null
471
- /**
472
- * Retrieves a %NULL-terminated string vector containing the URIs set with
473
- * unique_message_data_set_uris().
474
- *
475
- * %NULL-terminated list of URIs. Use g_strfreev() to free it.
476
- * @returns a newly-allocated,
477
- */
478
- get_uris(): string[]
479
- /**
480
- * Retrieves the workspace number from where the message came. This
481
- * field is always set by the Unique library.
482
- * @returns the workspace number
483
- */
484
- get_workspace(): number
485
- /**
486
- * Sets `data` as the payload of `message_data`. Any other data is removed
487
- * from the message data. If `data` is %NULL, a `length` of -1 will unset
488
- * the payload, while a `length` of 0 will set the payload to an empty
489
- * string.
490
- *
491
- * You can use unique_message_data_get() to retrieve the data.
492
- * @param data binary blob to set, or %NULL
493
- * @param length length of `data`
494
- */
495
- set(data: number | null, length: number): void
496
- /**
497
- * Sets `filename` as the contents of `message_data`.
498
- * @param filename a filename
499
- */
500
- set_filename(filename: string | null): void
501
- /**
502
- * Sets `str` as the plain text payload of `message_data,` converting it
503
- * to UTF-8 if needed. If `length` is -1, the length of the string will
504
- * be used. Use unique_message_data_get_text() to retrieve the text.
505
- * @param str plain text to be set as payload
506
- * @param length length of the text, or -1
507
- * @returns %TRUE if the text was successfully converted to UTF-8
508
- */
509
- set_text(str: string | null, length: number): boolean
510
- /**
511
- * Converts `uris` to a valid URI list and sets it as payload of
512
- * `message_data`. You can use unique_message_data_get_uris() to
513
- * retrieve the list from a #UniqueMessageData.
514
- * @param uris a list of URIs in a %NULL-terminated string vector
515
- * @returns %TRUE if the URIs were successfully converted
516
- */
517
- set_uris(uris: string[]): boolean
518
- }
294
+ class MessageData {
295
+ static $gtype: GObject.GType<MessageData>;
519
296
 
520
- /**
521
- * #UniqueMessageData contains the data passed between instances of
522
- * a #UniqueApp. The #UniqueMessageData structure received inside
523
- * the signal handlers for UniqueApp::message-received is guaranteed
524
- * to contain the #GdkScreen, the workspace and the startup notification
525
- * id of the instance sending the message.
526
- * @record
527
- */
528
- class MessageData {
297
+ // Constructors of Unique.MessageData
529
298
 
530
- // Own properties of Unique-3.0.Unique.MessageData
299
+ constructor(properties?: Partial<{}>);
300
+ _init(...args: any[]): void;
531
301
 
532
- static name: string
302
+ static ['new'](): MessageData;
533
303
 
534
- // Constructors of Unique-3.0.Unique.MessageData
304
+ // Own methods of Unique.MessageData
305
+
306
+ /**
307
+ * Copies `message_data`.
308
+ * @returns a copy of the passed #UniqueMessageData
309
+ */
310
+ copy(): MessageData;
311
+ /**
312
+ * Frees all the resources allocated by `message_data`.
313
+ */
314
+ free(): void;
315
+ /**
316
+ * Retrieves the raw contents of `message_data` set using
317
+ * unique_messaget_data_set().
318
+ *
319
+ * returned string is owned by the #UniqueMessageData and should
320
+ * never be modified or freed
321
+ * @returns the contents of the message data or %NULL. The
322
+ */
323
+ get(): [number, number];
324
+ /**
325
+ * Retrieves the filename set with unique_message_data_set_filename().
326
+ *
327
+ * filename. Use g_free() to free the resources used by the returned
328
+ * value.
329
+ * @returns a newly allocated string containing the
330
+ */
331
+ get_filename(): string;
332
+ /**
333
+ * Returns a pointer to the screen from where the message came. You
334
+ * can use gtk_window_set_screen() to move windows or dialogs to the
335
+ * right screen. This field is always set by the Unique library.
336
+ * @returns a #GdkScreen
337
+ */
338
+ get_screen(): Gdk.Screen;
339
+ /**
340
+ * Retrieves the startup notification id set inside `message_data`. This
341
+ * field is always set by the Unique library.
342
+ *
343
+ * owned by the #UniqueMessageData structure and should not be
344
+ * modified or freed
345
+ * @returns the startup notification id. The returned string is
346
+ */
347
+ get_startup_id(): string;
348
+ /**
349
+ * Retrieves the text set using unique_message_data_set_text().
350
+ * @returns a newly-allocated string.
351
+ */
352
+ get_text(): string;
353
+ /**
354
+ * Retrieves a %NULL-terminated string vector containing the URIs set with
355
+ * unique_message_data_set_uris().
356
+ *
357
+ * %NULL-terminated list of URIs. Use g_strfreev() to free it.
358
+ * @returns a newly-allocated,
359
+ */
360
+ get_uris(): string[];
361
+ /**
362
+ * Retrieves the workspace number from where the message came. This
363
+ * field is always set by the Unique library.
364
+ * @returns the workspace number
365
+ */
366
+ get_workspace(): number;
367
+ /**
368
+ * Sets `data` as the payload of `message_data`. Any other data is removed
369
+ * from the message data. If `data` is %NULL, a `length` of -1 will unset
370
+ * the payload, while a `length` of 0 will set the payload to an empty
371
+ * string.
372
+ *
373
+ * You can use unique_message_data_get() to retrieve the data.
374
+ * @param data binary blob to set, or %NULL
375
+ * @param length length of @data
376
+ */
377
+ set(data: number, length: number): void;
378
+ /**
379
+ * Sets `filename` as the contents of `message_data`.
380
+ * @param filename a filename
381
+ */
382
+ set_filename(filename: string): void;
383
+ /**
384
+ * Sets `str` as the plain text payload of `message_data,` converting it
385
+ * to UTF-8 if needed. If `length` is -1, the length of the string will
386
+ * be used. Use unique_message_data_get_text() to retrieve the text.
387
+ * @param str plain text to be set as payload
388
+ * @param length length of the text, or -1
389
+ * @returns %TRUE if the text was successfully converted to UTF-8
390
+ */
391
+ set_text(str: string, length: number): boolean;
392
+ /**
393
+ * Converts `uris` to a valid URI list and sets it as payload of
394
+ * `message_data`. You can use unique_message_data_get_uris() to
395
+ * retrieve the list from a #UniqueMessageData.
396
+ * @param uris a list of URIs in a %NULL-terminated string vector
397
+ * @returns %TRUE if the URIs were successfully converted
398
+ */
399
+ set_uris(uris: string[]): boolean;
400
+ }
535
401
 
536
402
  /**
537
- * Creates a new #UniqueMessageData structure. This structure holds the
538
- * message data passed between running instances with
539
- * unique_app_send_message().
540
- * @constructor
541
- * @returns the newly created #UniqueMessageData
403
+ * Name of the imported GIR library
404
+ * `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
542
405
  */
543
- constructor()
406
+ const __name__: string;
544
407
  /**
545
- * Creates a new #UniqueMessageData structure. This structure holds the
546
- * message data passed between running instances with
547
- * unique_app_send_message().
548
- * @constructor
549
- * @returns the newly created #UniqueMessageData
408
+ * Version of the imported GIR library
409
+ * `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
550
410
  */
551
- static new(): MessageData
552
- }
553
-
554
- /**
555
- * Name of the imported GIR library
556
- * @see https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
557
- */
558
- const __name__: string
559
- /**
560
- * Version of the imported GIR library
561
- * @see https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
562
- */
563
- const __version__: string
411
+ const __version__: string;
564
412
  }
565
413
 
566
414
  export default Unique;
567
- // END
415
+ // END