@girs/fcitx-1.0 1.0.0-4.0.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +86 -0
- package/fcitx-1.0-ambient.d.ts +12 -0
- package/fcitx-1.0-ambient.js +2 -0
- package/fcitx-1.0-import.d.ts +12 -0
- package/fcitx-1.0-import.js +3 -0
- package/fcitx-1.0.d.ts +1793 -0
- package/fcitx-1.0.js +6 -0
- package/package.json +55 -0
- package/tsconfig.json +23 -0
- package/typedoc.json +7 -0
package/fcitx-1.0.d.ts
ADDED
|
@@ -0,0 +1,1793 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Type Definitions for Gjs (https://gjs.guide/)
|
|
3
|
+
*
|
|
4
|
+
* These type definitions are automatically generated, do not edit them by hand.
|
|
5
|
+
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import './fcitx-1.0-ambient.d.ts';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Fcitx-1.0
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import type Gio from '@girs/gio-2.0';
|
|
15
|
+
import type GObject from '@girs/gobject-2.0';
|
|
16
|
+
import type GLib from '@girs/glib-2.0';
|
|
17
|
+
|
|
18
|
+
export namespace Fcitx {
|
|
19
|
+
module Client {
|
|
20
|
+
// Signal callback interfaces
|
|
21
|
+
|
|
22
|
+
interface CloseIm {
|
|
23
|
+
(): void;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
interface CommitString {
|
|
27
|
+
(string: string): void;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
interface Connected {
|
|
31
|
+
(): void;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
interface DeleteSurroundingText {
|
|
35
|
+
(cursor: number, len: number): void;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
interface Disconnected {
|
|
39
|
+
(): void;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
interface EnableIm {
|
|
43
|
+
(): void;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
interface ForwardKey {
|
|
47
|
+
(keyval: number, state: number, type: number): void;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
interface UpdateClientSideUi {
|
|
51
|
+
(
|
|
52
|
+
auxup: string,
|
|
53
|
+
auxdown: string,
|
|
54
|
+
preedit: string,
|
|
55
|
+
candidateword: string,
|
|
56
|
+
imname: string,
|
|
57
|
+
cursor_pos: number,
|
|
58
|
+
): void;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
interface UpdateFormattedPreedit {
|
|
62
|
+
(preedit: PreeditItem[], cursor: number): void;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Constructor properties interface
|
|
66
|
+
|
|
67
|
+
interface ConstructorProps extends GObject.Object.ConstructorProps {
|
|
68
|
+
connection: Connection;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* A #FcitxClient allow to create a input context via DBus
|
|
74
|
+
*/
|
|
75
|
+
class Client extends GObject.Object {
|
|
76
|
+
static $gtype: GObject.GType<Client>;
|
|
77
|
+
|
|
78
|
+
// Own properties of Fcitx.Client
|
|
79
|
+
|
|
80
|
+
set connection(val: Connection);
|
|
81
|
+
|
|
82
|
+
// Constructors of Fcitx.Client
|
|
83
|
+
|
|
84
|
+
constructor(properties?: Partial<Client.ConstructorProps>, ...args: any[]);
|
|
85
|
+
|
|
86
|
+
_init(...args: any[]): void;
|
|
87
|
+
|
|
88
|
+
static ['new'](): Client;
|
|
89
|
+
|
|
90
|
+
static new_with_connection(connection: Connection): Client;
|
|
91
|
+
|
|
92
|
+
// Own signals of Fcitx.Client
|
|
93
|
+
|
|
94
|
+
connect(id: string, callback: (...args: any[]) => any): number;
|
|
95
|
+
connect_after(id: string, callback: (...args: any[]) => any): number;
|
|
96
|
+
emit(id: string, ...args: any[]): void;
|
|
97
|
+
connect(signal: 'close-im', callback: (_source: this) => void): number;
|
|
98
|
+
connect_after(signal: 'close-im', callback: (_source: this) => void): number;
|
|
99
|
+
emit(signal: 'close-im'): void;
|
|
100
|
+
connect(signal: 'commit-string', callback: (_source: this, string: string) => void): number;
|
|
101
|
+
connect_after(signal: 'commit-string', callback: (_source: this, string: string) => void): number;
|
|
102
|
+
emit(signal: 'commit-string', string: string): void;
|
|
103
|
+
connect(signal: 'connected', callback: (_source: this) => void): number;
|
|
104
|
+
connect_after(signal: 'connected', callback: (_source: this) => void): number;
|
|
105
|
+
emit(signal: 'connected'): void;
|
|
106
|
+
connect(
|
|
107
|
+
signal: 'delete-surrounding-text',
|
|
108
|
+
callback: (_source: this, cursor: number, len: number) => void,
|
|
109
|
+
): number;
|
|
110
|
+
connect_after(
|
|
111
|
+
signal: 'delete-surrounding-text',
|
|
112
|
+
callback: (_source: this, cursor: number, len: number) => void,
|
|
113
|
+
): number;
|
|
114
|
+
emit(signal: 'delete-surrounding-text', cursor: number, len: number): void;
|
|
115
|
+
connect(signal: 'disconnected', callback: (_source: this) => void): number;
|
|
116
|
+
connect_after(signal: 'disconnected', callback: (_source: this) => void): number;
|
|
117
|
+
emit(signal: 'disconnected'): void;
|
|
118
|
+
connect(signal: 'enable-im', callback: (_source: this) => void): number;
|
|
119
|
+
connect_after(signal: 'enable-im', callback: (_source: this) => void): number;
|
|
120
|
+
emit(signal: 'enable-im'): void;
|
|
121
|
+
connect(
|
|
122
|
+
signal: 'forward-key',
|
|
123
|
+
callback: (_source: this, keyval: number, state: number, type: number) => void,
|
|
124
|
+
): number;
|
|
125
|
+
connect_after(
|
|
126
|
+
signal: 'forward-key',
|
|
127
|
+
callback: (_source: this, keyval: number, state: number, type: number) => void,
|
|
128
|
+
): number;
|
|
129
|
+
emit(signal: 'forward-key', keyval: number, state: number, type: number): void;
|
|
130
|
+
connect(
|
|
131
|
+
signal: 'update-client-side-ui',
|
|
132
|
+
callback: (
|
|
133
|
+
_source: this,
|
|
134
|
+
auxup: string,
|
|
135
|
+
auxdown: string,
|
|
136
|
+
preedit: string,
|
|
137
|
+
candidateword: string,
|
|
138
|
+
imname: string,
|
|
139
|
+
cursor_pos: number,
|
|
140
|
+
) => void,
|
|
141
|
+
): number;
|
|
142
|
+
connect_after(
|
|
143
|
+
signal: 'update-client-side-ui',
|
|
144
|
+
callback: (
|
|
145
|
+
_source: this,
|
|
146
|
+
auxup: string,
|
|
147
|
+
auxdown: string,
|
|
148
|
+
preedit: string,
|
|
149
|
+
candidateword: string,
|
|
150
|
+
imname: string,
|
|
151
|
+
cursor_pos: number,
|
|
152
|
+
) => void,
|
|
153
|
+
): number;
|
|
154
|
+
emit(
|
|
155
|
+
signal: 'update-client-side-ui',
|
|
156
|
+
auxup: string,
|
|
157
|
+
auxdown: string,
|
|
158
|
+
preedit: string,
|
|
159
|
+
candidateword: string,
|
|
160
|
+
imname: string,
|
|
161
|
+
cursor_pos: number,
|
|
162
|
+
): void;
|
|
163
|
+
connect(
|
|
164
|
+
signal: 'update-formatted-preedit',
|
|
165
|
+
callback: (_source: this, preedit: PreeditItem[], cursor: number) => void,
|
|
166
|
+
): number;
|
|
167
|
+
connect_after(
|
|
168
|
+
signal: 'update-formatted-preedit',
|
|
169
|
+
callback: (_source: this, preedit: PreeditItem[], cursor: number) => void,
|
|
170
|
+
): number;
|
|
171
|
+
emit(signal: 'update-formatted-preedit', preedit: PreeditItem[], cursor: number): void;
|
|
172
|
+
|
|
173
|
+
// Own methods of Fcitx.Client
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* tell fcitx inactivate current ic
|
|
177
|
+
*/
|
|
178
|
+
close_ic(): void;
|
|
179
|
+
/**
|
|
180
|
+
* tell fcitx activate current ic
|
|
181
|
+
*/
|
|
182
|
+
enable_ic(): void;
|
|
183
|
+
/**
|
|
184
|
+
* tell fcitx current client has focus
|
|
185
|
+
*/
|
|
186
|
+
focus_in(): void;
|
|
187
|
+
/**
|
|
188
|
+
* tell fcitx current client has lost focus
|
|
189
|
+
*/
|
|
190
|
+
focus_out(): void;
|
|
191
|
+
/**
|
|
192
|
+
* Check #FcitxClient is valid to communicate with Fcitx
|
|
193
|
+
* @returns #FcitxClient is valid or not
|
|
194
|
+
*/
|
|
195
|
+
is_valid(): boolean;
|
|
196
|
+
/**
|
|
197
|
+
* use this function with #fcitx_client_process_key_finish
|
|
198
|
+
* @param keyval key value
|
|
199
|
+
* @param keycode hardware key code
|
|
200
|
+
* @param state key state
|
|
201
|
+
* @param type event type
|
|
202
|
+
* @param t timestamp
|
|
203
|
+
* @param timeout_msec timeout in millisecond
|
|
204
|
+
* @param cancellable cancellable
|
|
205
|
+
* @param callback callback
|
|
206
|
+
*/
|
|
207
|
+
process_key(
|
|
208
|
+
keyval: number,
|
|
209
|
+
keycode: number,
|
|
210
|
+
state: number,
|
|
211
|
+
type: number,
|
|
212
|
+
t: number,
|
|
213
|
+
timeout_msec: number,
|
|
214
|
+
cancellable?: Gio.Cancellable | null,
|
|
215
|
+
callback?: Gio.AsyncReadyCallback<this> | null,
|
|
216
|
+
): void;
|
|
217
|
+
/**
|
|
218
|
+
* use this function with #fcitx_client_process_key_async
|
|
219
|
+
* @param res result
|
|
220
|
+
* @returns process key result
|
|
221
|
+
*/
|
|
222
|
+
process_key_finish(res: Gio.AsyncResult): number;
|
|
223
|
+
/**
|
|
224
|
+
* send a key event to fcitx synchronizely
|
|
225
|
+
* @param keyval key value
|
|
226
|
+
* @param keycode hardware key code
|
|
227
|
+
* @param state key state
|
|
228
|
+
* @param type event type
|
|
229
|
+
* @param t timestamp
|
|
230
|
+
* @returns the key is processed or not
|
|
231
|
+
*/
|
|
232
|
+
process_key_sync(keyval: number, keycode: number, state: number, type: number, t: number): number;
|
|
233
|
+
/**
|
|
234
|
+
* tell fcitx current client is reset from client side
|
|
235
|
+
*/
|
|
236
|
+
reset(): void;
|
|
237
|
+
/**
|
|
238
|
+
* set client capacity of Fcitx
|
|
239
|
+
* @param flags capacity
|
|
240
|
+
*/
|
|
241
|
+
set_capacity(flags: number): void;
|
|
242
|
+
/**
|
|
243
|
+
* tell fcitx current client's cursor geometry info
|
|
244
|
+
* @param x x of cursor
|
|
245
|
+
* @param y y of cursor
|
|
246
|
+
* @param w width of cursor
|
|
247
|
+
* @param h height of cursor
|
|
248
|
+
*/
|
|
249
|
+
set_cursor_rect(x: number, y: number, w: number, h: number): void;
|
|
250
|
+
set_display(display: string): void;
|
|
251
|
+
set_surrounding_text(text: string | null, cursor: number, anchor: number): void;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
module Connection {
|
|
255
|
+
// Signal callback interfaces
|
|
256
|
+
|
|
257
|
+
interface Connected {
|
|
258
|
+
(): void;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
interface Disconnected {
|
|
262
|
+
(): void;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
// Constructor properties interface
|
|
266
|
+
|
|
267
|
+
interface ConstructorProps extends GObject.Object.ConstructorProps {}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* A FcitxConnection allow to create a input context via DBus
|
|
272
|
+
*/
|
|
273
|
+
class Connection extends GObject.Object {
|
|
274
|
+
static $gtype: GObject.GType<Connection>;
|
|
275
|
+
|
|
276
|
+
// Constructors of Fcitx.Connection
|
|
277
|
+
|
|
278
|
+
constructor(properties?: Partial<Connection.ConstructorProps>, ...args: any[]);
|
|
279
|
+
|
|
280
|
+
_init(...args: any[]): void;
|
|
281
|
+
|
|
282
|
+
static ['new'](): Connection;
|
|
283
|
+
|
|
284
|
+
// Own signals of Fcitx.Connection
|
|
285
|
+
|
|
286
|
+
connect(id: string, callback: (...args: any[]) => any): number;
|
|
287
|
+
connect_after(id: string, callback: (...args: any[]) => any): number;
|
|
288
|
+
emit(id: string, ...args: any[]): void;
|
|
289
|
+
connect(signal: 'connected', callback: (_source: this) => void): number;
|
|
290
|
+
connect_after(signal: 'connected', callback: (_source: this) => void): number;
|
|
291
|
+
emit(signal: 'connected'): void;
|
|
292
|
+
connect(signal: 'disconnected', callback: (_source: this) => void): number;
|
|
293
|
+
connect_after(signal: 'disconnected', callback: (_source: this) => void): number;
|
|
294
|
+
emit(signal: 'disconnected'): void;
|
|
295
|
+
|
|
296
|
+
// Own methods of Fcitx.Connection
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* Return the current #GDBusConnection
|
|
300
|
+
* @returns #GDBusConnection for current connection
|
|
301
|
+
*/
|
|
302
|
+
get_g_dbus_connection(): Gio.DBusConnection;
|
|
303
|
+
/**
|
|
304
|
+
* Check #FcitxConnection is valid to communicate with Fcitx
|
|
305
|
+
* @returns #FcitxConnection is valid or not
|
|
306
|
+
*/
|
|
307
|
+
is_valid(): boolean;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
module InputMethod {
|
|
311
|
+
// Signal callback interfaces
|
|
312
|
+
|
|
313
|
+
interface ImlistChanged {
|
|
314
|
+
(): void;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
// Constructor properties interface
|
|
318
|
+
|
|
319
|
+
interface ConstructorProps
|
|
320
|
+
extends Gio.DBusProxy.ConstructorProps,
|
|
321
|
+
Gio.AsyncInitable.ConstructorProps,
|
|
322
|
+
Gio.DBusInterface.ConstructorProps,
|
|
323
|
+
Gio.Initable.ConstructorProps {
|
|
324
|
+
current_im: string;
|
|
325
|
+
currentIm: string;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* A #FcitxInputMethod allow you to control fcitx via DBus.
|
|
331
|
+
*/
|
|
332
|
+
class InputMethod extends Gio.DBusProxy implements Gio.AsyncInitable<InputMethod>, Gio.DBusInterface, Gio.Initable {
|
|
333
|
+
static $gtype: GObject.GType<InputMethod>;
|
|
334
|
+
|
|
335
|
+
// Own properties of Fcitx.InputMethod
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* The current IM.
|
|
339
|
+
*/
|
|
340
|
+
get current_im(): string;
|
|
341
|
+
set current_im(val: string);
|
|
342
|
+
/**
|
|
343
|
+
* The current IM.
|
|
344
|
+
*/
|
|
345
|
+
get currentIm(): string;
|
|
346
|
+
set currentIm(val: string);
|
|
347
|
+
|
|
348
|
+
// Constructors of Fcitx.InputMethod
|
|
349
|
+
|
|
350
|
+
constructor(properties?: Partial<InputMethod.ConstructorProps>, ...args: any[]);
|
|
351
|
+
|
|
352
|
+
_init(...args: any[]): void;
|
|
353
|
+
|
|
354
|
+
static ['new'](
|
|
355
|
+
bus_type: Gio.BusType,
|
|
356
|
+
flags: Gio.DBusProxyFlags,
|
|
357
|
+
display_number: number,
|
|
358
|
+
cancellable?: Gio.Cancellable | null,
|
|
359
|
+
): InputMethod;
|
|
360
|
+
// Conflicted with Gio.DBusProxy.new
|
|
361
|
+
|
|
362
|
+
static ['new'](...args: never[]): any;
|
|
363
|
+
|
|
364
|
+
// Own signals of Fcitx.InputMethod
|
|
365
|
+
|
|
366
|
+
connect(id: string, callback: (...args: any[]) => any): number;
|
|
367
|
+
connect_after(id: string, callback: (...args: any[]) => any): number;
|
|
368
|
+
emit(id: string, ...args: any[]): void;
|
|
369
|
+
connect(signal: 'imlist-changed', callback: (_source: this) => void): number;
|
|
370
|
+
connect_after(signal: 'imlist-changed', callback: (_source: this) => void): number;
|
|
371
|
+
emit(signal: 'imlist-changed'): void;
|
|
372
|
+
|
|
373
|
+
// Own methods of Fcitx.InputMethod
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* Activate fcitx
|
|
377
|
+
*/
|
|
378
|
+
activate(): void;
|
|
379
|
+
/**
|
|
380
|
+
* Send configure command to fcitx
|
|
381
|
+
*/
|
|
382
|
+
configure(): void;
|
|
383
|
+
/**
|
|
384
|
+
* Send configure addon command to fcitx
|
|
385
|
+
* @param addon addon name
|
|
386
|
+
*/
|
|
387
|
+
configure_addon(addon: string): void;
|
|
388
|
+
/**
|
|
389
|
+
* Send configure im command to fcitx
|
|
390
|
+
* @param imname im name
|
|
391
|
+
*/
|
|
392
|
+
configure_im(imname: string): void;
|
|
393
|
+
/**
|
|
394
|
+
* Send exit command to fcitx
|
|
395
|
+
*/
|
|
396
|
+
exit(): void;
|
|
397
|
+
/**
|
|
398
|
+
* Get im name
|
|
399
|
+
* @returns get im name
|
|
400
|
+
*/
|
|
401
|
+
get_current_im(): string;
|
|
402
|
+
/**
|
|
403
|
+
* Get current state
|
|
404
|
+
* @returns current state, -1 for error
|
|
405
|
+
*/
|
|
406
|
+
get_current_state(): number;
|
|
407
|
+
/**
|
|
408
|
+
* Get im name
|
|
409
|
+
* @returns get ui name
|
|
410
|
+
*/
|
|
411
|
+
get_current_ui(): string;
|
|
412
|
+
/**
|
|
413
|
+
* Get addon name by im
|
|
414
|
+
* @param imname imname
|
|
415
|
+
* @returns get addon name
|
|
416
|
+
*/
|
|
417
|
+
get_im_addon(imname: string): string;
|
|
418
|
+
/**
|
|
419
|
+
* Get Fcitx all im list
|
|
420
|
+
* @returns A #FcitxIMItem List
|
|
421
|
+
*/
|
|
422
|
+
get_imlist(): IMItem[];
|
|
423
|
+
/**
|
|
424
|
+
* Inactivate fcitx
|
|
425
|
+
*/
|
|
426
|
+
inactivate(): void;
|
|
427
|
+
/**
|
|
428
|
+
* Send reload config command to fcitx
|
|
429
|
+
*/
|
|
430
|
+
reload_config(): void;
|
|
431
|
+
/**
|
|
432
|
+
* Send restart command to fcitx
|
|
433
|
+
*/
|
|
434
|
+
restart(): void;
|
|
435
|
+
/**
|
|
436
|
+
* Set im name
|
|
437
|
+
* @param imname set im name
|
|
438
|
+
*/
|
|
439
|
+
set_current_im(imname: string): void;
|
|
440
|
+
/**
|
|
441
|
+
* Set Fcitx all im list
|
|
442
|
+
* @param array A #FcitxIMItem List
|
|
443
|
+
*/
|
|
444
|
+
set_imlist(array: IMItem[]): void;
|
|
445
|
+
/**
|
|
446
|
+
* toggle fcitx state
|
|
447
|
+
*/
|
|
448
|
+
toggle(): void;
|
|
449
|
+
|
|
450
|
+
// Inherited methods
|
|
451
|
+
/**
|
|
452
|
+
* Starts asynchronous initialization of the object implementing the
|
|
453
|
+
* interface. This must be done before any real use of the object after
|
|
454
|
+
* initial construction. If the object also implements #GInitable you can
|
|
455
|
+
* optionally call g_initable_init() instead.
|
|
456
|
+
*
|
|
457
|
+
* This method is intended for language bindings. If writing in C,
|
|
458
|
+
* g_async_initable_new_async() should typically be used instead.
|
|
459
|
+
*
|
|
460
|
+
* When the initialization is finished, `callback` will be called. You can
|
|
461
|
+
* then call g_async_initable_init_finish() to get the result of the
|
|
462
|
+
* initialization.
|
|
463
|
+
*
|
|
464
|
+
* Implementations may also support cancellation. If `cancellable` is not
|
|
465
|
+
* %NULL, then initialization can be cancelled by triggering the cancellable
|
|
466
|
+
* object from another thread. If the operation was cancelled, the error
|
|
467
|
+
* %G_IO_ERROR_CANCELLED will be returned. If `cancellable` is not %NULL, and
|
|
468
|
+
* the object doesn't support cancellable initialization, the error
|
|
469
|
+
* %G_IO_ERROR_NOT_SUPPORTED will be returned.
|
|
470
|
+
*
|
|
471
|
+
* As with #GInitable, if the object is not initialized, or initialization
|
|
472
|
+
* returns with an error, then all operations on the object except
|
|
473
|
+
* g_object_ref() and g_object_unref() are considered to be invalid, and
|
|
474
|
+
* have undefined behaviour. They will often fail with g_critical() or
|
|
475
|
+
* g_warning(), but this must not be relied on.
|
|
476
|
+
*
|
|
477
|
+
* Callers should not assume that a class which implements #GAsyncInitable can
|
|
478
|
+
* be initialized multiple times; for more information, see g_initable_init().
|
|
479
|
+
* If a class explicitly supports being initialized multiple times,
|
|
480
|
+
* implementation requires yielding all subsequent calls to init_async() on the
|
|
481
|
+
* results of the first call.
|
|
482
|
+
*
|
|
483
|
+
* For classes that also support the #GInitable interface, the default
|
|
484
|
+
* implementation of this method will run the g_initable_init() function
|
|
485
|
+
* in a thread, so if you want to support asynchronous initialization via
|
|
486
|
+
* threads, just implement the #GAsyncInitable interface without overriding
|
|
487
|
+
* any interface methods.
|
|
488
|
+
* @param io_priority the [I/O priority][io-priority] of the operation
|
|
489
|
+
* @param cancellable optional #GCancellable object, %NULL to ignore.
|
|
490
|
+
* @param callback a #GAsyncReadyCallback to call when the request is satisfied
|
|
491
|
+
*/
|
|
492
|
+
init_async(
|
|
493
|
+
io_priority: number,
|
|
494
|
+
cancellable?: Gio.Cancellable | null,
|
|
495
|
+
callback?: Gio.AsyncReadyCallback<this> | null,
|
|
496
|
+
): void;
|
|
497
|
+
/**
|
|
498
|
+
* Finishes asynchronous initialization and returns the result.
|
|
499
|
+
* See g_async_initable_init_async().
|
|
500
|
+
* @param res a #GAsyncResult.
|
|
501
|
+
* @returns %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
|
|
502
|
+
*/
|
|
503
|
+
init_finish(res: Gio.AsyncResult): boolean;
|
|
504
|
+
/**
|
|
505
|
+
* Finishes the async construction for the various g_async_initable_new
|
|
506
|
+
* calls, returning the created object or %NULL on error.
|
|
507
|
+
* @param res the #GAsyncResult from the callback
|
|
508
|
+
* @returns a newly created #GObject, or %NULL on error. Free with g_object_unref().
|
|
509
|
+
*/
|
|
510
|
+
new_finish(res: Gio.AsyncResult): InputMethod;
|
|
511
|
+
// Conflicted with Gio.DBusProxy.new_finish
|
|
512
|
+
new_finish(...args: never[]): any;
|
|
513
|
+
/**
|
|
514
|
+
* Starts asynchronous initialization of the object implementing the
|
|
515
|
+
* interface. This must be done before any real use of the object after
|
|
516
|
+
* initial construction. If the object also implements #GInitable you can
|
|
517
|
+
* optionally call g_initable_init() instead.
|
|
518
|
+
*
|
|
519
|
+
* This method is intended for language bindings. If writing in C,
|
|
520
|
+
* g_async_initable_new_async() should typically be used instead.
|
|
521
|
+
*
|
|
522
|
+
* When the initialization is finished, `callback` will be called. You can
|
|
523
|
+
* then call g_async_initable_init_finish() to get the result of the
|
|
524
|
+
* initialization.
|
|
525
|
+
*
|
|
526
|
+
* Implementations may also support cancellation. If `cancellable` is not
|
|
527
|
+
* %NULL, then initialization can be cancelled by triggering the cancellable
|
|
528
|
+
* object from another thread. If the operation was cancelled, the error
|
|
529
|
+
* %G_IO_ERROR_CANCELLED will be returned. If `cancellable` is not %NULL, and
|
|
530
|
+
* the object doesn't support cancellable initialization, the error
|
|
531
|
+
* %G_IO_ERROR_NOT_SUPPORTED will be returned.
|
|
532
|
+
*
|
|
533
|
+
* As with #GInitable, if the object is not initialized, or initialization
|
|
534
|
+
* returns with an error, then all operations on the object except
|
|
535
|
+
* g_object_ref() and g_object_unref() are considered to be invalid, and
|
|
536
|
+
* have undefined behaviour. They will often fail with g_critical() or
|
|
537
|
+
* g_warning(), but this must not be relied on.
|
|
538
|
+
*
|
|
539
|
+
* Callers should not assume that a class which implements #GAsyncInitable can
|
|
540
|
+
* be initialized multiple times; for more information, see g_initable_init().
|
|
541
|
+
* If a class explicitly supports being initialized multiple times,
|
|
542
|
+
* implementation requires yielding all subsequent calls to init_async() on the
|
|
543
|
+
* results of the first call.
|
|
544
|
+
*
|
|
545
|
+
* For classes that also support the #GInitable interface, the default
|
|
546
|
+
* implementation of this method will run the g_initable_init() function
|
|
547
|
+
* in a thread, so if you want to support asynchronous initialization via
|
|
548
|
+
* threads, just implement the #GAsyncInitable interface without overriding
|
|
549
|
+
* any interface methods.
|
|
550
|
+
* @param io_priority the [I/O priority][io-priority] of the operation
|
|
551
|
+
* @param cancellable optional #GCancellable object, %NULL to ignore.
|
|
552
|
+
* @param callback a #GAsyncReadyCallback to call when the request is satisfied
|
|
553
|
+
*/
|
|
554
|
+
vfunc_init_async(
|
|
555
|
+
io_priority: number,
|
|
556
|
+
cancellable?: Gio.Cancellable | null,
|
|
557
|
+
callback?: Gio.AsyncReadyCallback<this> | null,
|
|
558
|
+
): void;
|
|
559
|
+
/**
|
|
560
|
+
* Finishes asynchronous initialization and returns the result.
|
|
561
|
+
* See g_async_initable_init_async().
|
|
562
|
+
* @param res a #GAsyncResult.
|
|
563
|
+
*/
|
|
564
|
+
vfunc_init_finish(res: Gio.AsyncResult): boolean;
|
|
565
|
+
/**
|
|
566
|
+
* Gets the #GDBusObject that `interface_` belongs to, if any.
|
|
567
|
+
* @returns A #GDBusObject or %NULL. The returned reference should be freed with g_object_unref().
|
|
568
|
+
*/
|
|
569
|
+
get_object(): Gio.DBusObject | null;
|
|
570
|
+
/**
|
|
571
|
+
* Gets D-Bus introspection information for the D-Bus interface
|
|
572
|
+
* implemented by `interface_`.
|
|
573
|
+
* @returns A #GDBusInterfaceInfo. Do not free.
|
|
574
|
+
*/
|
|
575
|
+
get_info(): Gio.DBusInterfaceInfo;
|
|
576
|
+
/**
|
|
577
|
+
* Sets the #GDBusObject for `interface_` to `object`.
|
|
578
|
+
*
|
|
579
|
+
* Note that `interface_` will hold a weak reference to `object`.
|
|
580
|
+
* @param object A #GDBusObject or %NULL.
|
|
581
|
+
*/
|
|
582
|
+
set_object(object?: Gio.DBusObject | null): void;
|
|
583
|
+
/**
|
|
584
|
+
* Gets the #GDBusObject that `interface_` belongs to, if any.
|
|
585
|
+
*/
|
|
586
|
+
vfunc_dup_object(): Gio.DBusObject | null;
|
|
587
|
+
/**
|
|
588
|
+
* Gets D-Bus introspection information for the D-Bus interface
|
|
589
|
+
* implemented by `interface_`.
|
|
590
|
+
*/
|
|
591
|
+
vfunc_get_info(): Gio.DBusInterfaceInfo;
|
|
592
|
+
/**
|
|
593
|
+
* Sets the #GDBusObject for `interface_` to `object`.
|
|
594
|
+
*
|
|
595
|
+
* Note that `interface_` will hold a weak reference to `object`.
|
|
596
|
+
* @param object A #GDBusObject or %NULL.
|
|
597
|
+
*/
|
|
598
|
+
vfunc_set_object(object?: Gio.DBusObject | null): void;
|
|
599
|
+
/**
|
|
600
|
+
* Initializes the object implementing the interface.
|
|
601
|
+
*
|
|
602
|
+
* This method is intended for language bindings. If writing in C,
|
|
603
|
+
* g_initable_new() should typically be used instead.
|
|
604
|
+
*
|
|
605
|
+
* The object must be initialized before any real use after initial
|
|
606
|
+
* construction, either with this function or g_async_initable_init_async().
|
|
607
|
+
*
|
|
608
|
+
* Implementations may also support cancellation. If `cancellable` is not %NULL,
|
|
609
|
+
* then initialization can be cancelled by triggering the cancellable object
|
|
610
|
+
* from another thread. If the operation was cancelled, the error
|
|
611
|
+
* %G_IO_ERROR_CANCELLED will be returned. If `cancellable` is not %NULL and
|
|
612
|
+
* the object doesn't support cancellable initialization the error
|
|
613
|
+
* %G_IO_ERROR_NOT_SUPPORTED will be returned.
|
|
614
|
+
*
|
|
615
|
+
* If the object is not initialized, or initialization returns with an
|
|
616
|
+
* error, then all operations on the object except g_object_ref() and
|
|
617
|
+
* g_object_unref() are considered to be invalid, and have undefined
|
|
618
|
+
* behaviour. See the [introduction][ginitable] for more details.
|
|
619
|
+
*
|
|
620
|
+
* Callers should not assume that a class which implements #GInitable can be
|
|
621
|
+
* initialized multiple times, unless the class explicitly documents itself as
|
|
622
|
+
* supporting this. Generally, a class’ implementation of init() can assume
|
|
623
|
+
* (and assert) that it will only be called once. Previously, this documentation
|
|
624
|
+
* recommended all #GInitable implementations should be idempotent; that
|
|
625
|
+
* recommendation was relaxed in GLib 2.54.
|
|
626
|
+
*
|
|
627
|
+
* If a class explicitly supports being initialized multiple times, it is
|
|
628
|
+
* recommended that the method is idempotent: multiple calls with the same
|
|
629
|
+
* arguments should return the same results. Only the first call initializes
|
|
630
|
+
* the object; further calls return the result of the first call.
|
|
631
|
+
*
|
|
632
|
+
* One reason why a class might need to support idempotent initialization is if
|
|
633
|
+
* it is designed to be used via the singleton pattern, with a
|
|
634
|
+
* #GObjectClass.constructor that sometimes returns an existing instance.
|
|
635
|
+
* In this pattern, a caller would expect to be able to call g_initable_init()
|
|
636
|
+
* on the result of g_object_new(), regardless of whether it is in fact a new
|
|
637
|
+
* instance.
|
|
638
|
+
* @param cancellable optional #GCancellable object, %NULL to ignore.
|
|
639
|
+
* @returns %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
|
|
640
|
+
*/
|
|
641
|
+
init(cancellable?: Gio.Cancellable | null): boolean;
|
|
642
|
+
/**
|
|
643
|
+
* Initializes the object implementing the interface.
|
|
644
|
+
*
|
|
645
|
+
* This method is intended for language bindings. If writing in C,
|
|
646
|
+
* g_initable_new() should typically be used instead.
|
|
647
|
+
*
|
|
648
|
+
* The object must be initialized before any real use after initial
|
|
649
|
+
* construction, either with this function or g_async_initable_init_async().
|
|
650
|
+
*
|
|
651
|
+
* Implementations may also support cancellation. If `cancellable` is not %NULL,
|
|
652
|
+
* then initialization can be cancelled by triggering the cancellable object
|
|
653
|
+
* from another thread. If the operation was cancelled, the error
|
|
654
|
+
* %G_IO_ERROR_CANCELLED will be returned. If `cancellable` is not %NULL and
|
|
655
|
+
* the object doesn't support cancellable initialization the error
|
|
656
|
+
* %G_IO_ERROR_NOT_SUPPORTED will be returned.
|
|
657
|
+
*
|
|
658
|
+
* If the object is not initialized, or initialization returns with an
|
|
659
|
+
* error, then all operations on the object except g_object_ref() and
|
|
660
|
+
* g_object_unref() are considered to be invalid, and have undefined
|
|
661
|
+
* behaviour. See the [introduction][ginitable] for more details.
|
|
662
|
+
*
|
|
663
|
+
* Callers should not assume that a class which implements #GInitable can be
|
|
664
|
+
* initialized multiple times, unless the class explicitly documents itself as
|
|
665
|
+
* supporting this. Generally, a class’ implementation of init() can assume
|
|
666
|
+
* (and assert) that it will only be called once. Previously, this documentation
|
|
667
|
+
* recommended all #GInitable implementations should be idempotent; that
|
|
668
|
+
* recommendation was relaxed in GLib 2.54.
|
|
669
|
+
*
|
|
670
|
+
* If a class explicitly supports being initialized multiple times, it is
|
|
671
|
+
* recommended that the method is idempotent: multiple calls with the same
|
|
672
|
+
* arguments should return the same results. Only the first call initializes
|
|
673
|
+
* the object; further calls return the result of the first call.
|
|
674
|
+
*
|
|
675
|
+
* One reason why a class might need to support idempotent initialization is if
|
|
676
|
+
* it is designed to be used via the singleton pattern, with a
|
|
677
|
+
* #GObjectClass.constructor that sometimes returns an existing instance.
|
|
678
|
+
* In this pattern, a caller would expect to be able to call g_initable_init()
|
|
679
|
+
* on the result of g_object_new(), regardless of whether it is in fact a new
|
|
680
|
+
* instance.
|
|
681
|
+
* @param cancellable optional #GCancellable object, %NULL to ignore.
|
|
682
|
+
*/
|
|
683
|
+
vfunc_init(cancellable?: Gio.Cancellable | null): boolean;
|
|
684
|
+
/**
|
|
685
|
+
* Creates a binding between `source_property` on `source` and `target_property`
|
|
686
|
+
* on `target`.
|
|
687
|
+
*
|
|
688
|
+
* Whenever the `source_property` is changed the `target_property` is
|
|
689
|
+
* updated using the same value. For instance:
|
|
690
|
+
*
|
|
691
|
+
*
|
|
692
|
+
* ```c
|
|
693
|
+
* g_object_bind_property (action, "active", widget, "sensitive", 0);
|
|
694
|
+
* ```
|
|
695
|
+
*
|
|
696
|
+
*
|
|
697
|
+
* Will result in the "sensitive" property of the widget #GObject instance to be
|
|
698
|
+
* updated with the same value of the "active" property of the action #GObject
|
|
699
|
+
* instance.
|
|
700
|
+
*
|
|
701
|
+
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
|
|
702
|
+
* if `target_property` on `target` changes then the `source_property` on `source`
|
|
703
|
+
* will be updated as well.
|
|
704
|
+
*
|
|
705
|
+
* The binding will automatically be removed when either the `source` or the
|
|
706
|
+
* `target` instances are finalized. To remove the binding without affecting the
|
|
707
|
+
* `source` and the `target` you can just call g_object_unref() on the returned
|
|
708
|
+
* #GBinding instance.
|
|
709
|
+
*
|
|
710
|
+
* Removing the binding by calling g_object_unref() on it must only be done if
|
|
711
|
+
* the binding, `source` and `target` are only used from a single thread and it
|
|
712
|
+
* is clear that both `source` and `target` outlive the binding. Especially it
|
|
713
|
+
* is not safe to rely on this if the binding, `source` or `target` can be
|
|
714
|
+
* finalized from different threads. Keep another reference to the binding and
|
|
715
|
+
* use g_binding_unbind() instead to be on the safe side.
|
|
716
|
+
*
|
|
717
|
+
* A #GObject can have multiple bindings.
|
|
718
|
+
* @param source_property the property on @source to bind
|
|
719
|
+
* @param target the target #GObject
|
|
720
|
+
* @param target_property the property on @target to bind
|
|
721
|
+
* @param flags flags to pass to #GBinding
|
|
722
|
+
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
|
|
723
|
+
*/
|
|
724
|
+
bind_property(
|
|
725
|
+
source_property: string,
|
|
726
|
+
target: GObject.Object,
|
|
727
|
+
target_property: string,
|
|
728
|
+
flags: GObject.BindingFlags,
|
|
729
|
+
): GObject.Binding;
|
|
730
|
+
/**
|
|
731
|
+
* Complete version of g_object_bind_property().
|
|
732
|
+
*
|
|
733
|
+
* Creates a binding between `source_property` on `source` and `target_property`
|
|
734
|
+
* on `target,` allowing you to set the transformation functions to be used by
|
|
735
|
+
* the binding.
|
|
736
|
+
*
|
|
737
|
+
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
|
|
738
|
+
* if `target_property` on `target` changes then the `source_property` on `source`
|
|
739
|
+
* will be updated as well. The `transform_from` function is only used in case
|
|
740
|
+
* of bidirectional bindings, otherwise it will be ignored
|
|
741
|
+
*
|
|
742
|
+
* The binding will automatically be removed when either the `source` or the
|
|
743
|
+
* `target` instances are finalized. This will release the reference that is
|
|
744
|
+
* being held on the #GBinding instance; if you want to hold on to the
|
|
745
|
+
* #GBinding instance, you will need to hold a reference to it.
|
|
746
|
+
*
|
|
747
|
+
* To remove the binding, call g_binding_unbind().
|
|
748
|
+
*
|
|
749
|
+
* A #GObject can have multiple bindings.
|
|
750
|
+
*
|
|
751
|
+
* The same `user_data` parameter will be used for both `transform_to`
|
|
752
|
+
* and `transform_from` transformation functions; the `notify` function will
|
|
753
|
+
* be called once, when the binding is removed. If you need different data
|
|
754
|
+
* for each transformation function, please use
|
|
755
|
+
* g_object_bind_property_with_closures() instead.
|
|
756
|
+
* @param source_property the property on @source to bind
|
|
757
|
+
* @param target the target #GObject
|
|
758
|
+
* @param target_property the property on @target to bind
|
|
759
|
+
* @param flags flags to pass to #GBinding
|
|
760
|
+
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
|
|
761
|
+
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
|
|
762
|
+
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
|
|
763
|
+
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
|
|
764
|
+
*/
|
|
765
|
+
bind_property_full(
|
|
766
|
+
source_property: string,
|
|
767
|
+
target: GObject.Object,
|
|
768
|
+
target_property: string,
|
|
769
|
+
flags: GObject.BindingFlags,
|
|
770
|
+
transform_to?: GObject.BindingTransformFunc | null,
|
|
771
|
+
transform_from?: GObject.BindingTransformFunc | null,
|
|
772
|
+
notify?: GLib.DestroyNotify | null,
|
|
773
|
+
): GObject.Binding;
|
|
774
|
+
// Conflicted with GObject.Object.bind_property_full
|
|
775
|
+
bind_property_full(...args: never[]): any;
|
|
776
|
+
/**
|
|
777
|
+
* This function is intended for #GObject implementations to re-enforce
|
|
778
|
+
* a [floating][floating-ref] object reference. Doing this is seldom
|
|
779
|
+
* required: all #GInitiallyUnowneds are created with a floating reference
|
|
780
|
+
* which usually just needs to be sunken by calling g_object_ref_sink().
|
|
781
|
+
*/
|
|
782
|
+
force_floating(): void;
|
|
783
|
+
/**
|
|
784
|
+
* Increases the freeze count on `object`. If the freeze count is
|
|
785
|
+
* non-zero, the emission of "notify" signals on `object` is
|
|
786
|
+
* stopped. The signals are queued until the freeze count is decreased
|
|
787
|
+
* to zero. Duplicate notifications are squashed so that at most one
|
|
788
|
+
* #GObject::notify signal is emitted for each property modified while the
|
|
789
|
+
* object is frozen.
|
|
790
|
+
*
|
|
791
|
+
* This is necessary for accessors that modify multiple properties to prevent
|
|
792
|
+
* premature notification while the object is still being modified.
|
|
793
|
+
*/
|
|
794
|
+
freeze_notify(): void;
|
|
795
|
+
/**
|
|
796
|
+
* Gets a named field from the objects table of associations (see g_object_set_data()).
|
|
797
|
+
* @param key name of the key for that association
|
|
798
|
+
* @returns the data if found, or %NULL if no such data exists.
|
|
799
|
+
*/
|
|
800
|
+
get_data(key: string): any | null;
|
|
801
|
+
get_property(property_name: string): any;
|
|
802
|
+
/**
|
|
803
|
+
* This function gets back user data pointers stored via
|
|
804
|
+
* g_object_set_qdata().
|
|
805
|
+
* @param quark A #GQuark, naming the user data pointer
|
|
806
|
+
* @returns The user data pointer set, or %NULL
|
|
807
|
+
*/
|
|
808
|
+
get_qdata(quark: GLib.Quark): any | null;
|
|
809
|
+
/**
|
|
810
|
+
* Gets `n_properties` properties for an `object`.
|
|
811
|
+
* Obtained properties will be set to `values`. All properties must be valid.
|
|
812
|
+
* Warnings will be emitted and undefined behaviour may result if invalid
|
|
813
|
+
* properties are passed in.
|
|
814
|
+
* @param names the names of each property to get
|
|
815
|
+
* @param values the values of each property to get
|
|
816
|
+
*/
|
|
817
|
+
getv(names: string[], values: (GObject.Value | any)[]): void;
|
|
818
|
+
/**
|
|
819
|
+
* Checks whether `object` has a [floating][floating-ref] reference.
|
|
820
|
+
* @returns %TRUE if @object has a floating reference
|
|
821
|
+
*/
|
|
822
|
+
is_floating(): boolean;
|
|
823
|
+
/**
|
|
824
|
+
* Emits a "notify" signal for the property `property_name` on `object`.
|
|
825
|
+
*
|
|
826
|
+
* When possible, eg. when signaling a property change from within the class
|
|
827
|
+
* that registered the property, you should use g_object_notify_by_pspec()
|
|
828
|
+
* instead.
|
|
829
|
+
*
|
|
830
|
+
* Note that emission of the notify signal may be blocked with
|
|
831
|
+
* g_object_freeze_notify(). In this case, the signal emissions are queued
|
|
832
|
+
* and will be emitted (in reverse order) when g_object_thaw_notify() is
|
|
833
|
+
* called.
|
|
834
|
+
* @param property_name the name of a property installed on the class of @object.
|
|
835
|
+
*/
|
|
836
|
+
notify(property_name: string): void;
|
|
837
|
+
/**
|
|
838
|
+
* Emits a "notify" signal for the property specified by `pspec` on `object`.
|
|
839
|
+
*
|
|
840
|
+
* This function omits the property name lookup, hence it is faster than
|
|
841
|
+
* g_object_notify().
|
|
842
|
+
*
|
|
843
|
+
* One way to avoid using g_object_notify() from within the
|
|
844
|
+
* class that registered the properties, and using g_object_notify_by_pspec()
|
|
845
|
+
* instead, is to store the GParamSpec used with
|
|
846
|
+
* g_object_class_install_property() inside a static array, e.g.:
|
|
847
|
+
*
|
|
848
|
+
*
|
|
849
|
+
* ```c
|
|
850
|
+
* typedef enum
|
|
851
|
+
* {
|
|
852
|
+
* PROP_FOO = 1,
|
|
853
|
+
* PROP_LAST
|
|
854
|
+
* } MyObjectProperty;
|
|
855
|
+
*
|
|
856
|
+
* static GParamSpec *properties[PROP_LAST];
|
|
857
|
+
*
|
|
858
|
+
* static void
|
|
859
|
+
* my_object_class_init (MyObjectClass *klass)
|
|
860
|
+
* {
|
|
861
|
+
* properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
|
|
862
|
+
* 0, 100,
|
|
863
|
+
* 50,
|
|
864
|
+
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
|
865
|
+
* g_object_class_install_property (gobject_class,
|
|
866
|
+
* PROP_FOO,
|
|
867
|
+
* properties[PROP_FOO]);
|
|
868
|
+
* }
|
|
869
|
+
* ```
|
|
870
|
+
*
|
|
871
|
+
*
|
|
872
|
+
* and then notify a change on the "foo" property with:
|
|
873
|
+
*
|
|
874
|
+
*
|
|
875
|
+
* ```c
|
|
876
|
+
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
|
|
877
|
+
* ```
|
|
878
|
+
*
|
|
879
|
+
* @param pspec the #GParamSpec of a property installed on the class of @object.
|
|
880
|
+
*/
|
|
881
|
+
notify_by_pspec(pspec: GObject.ParamSpec): void;
|
|
882
|
+
/**
|
|
883
|
+
* Increases the reference count of `object`.
|
|
884
|
+
*
|
|
885
|
+
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
|
|
886
|
+
* of `object` will be propagated to the return type (using the GCC typeof()
|
|
887
|
+
* extension), so any casting the caller needs to do on the return type must be
|
|
888
|
+
* explicit.
|
|
889
|
+
* @returns the same @object
|
|
890
|
+
*/
|
|
891
|
+
ref(): GObject.Object;
|
|
892
|
+
/**
|
|
893
|
+
* Increase the reference count of `object,` and possibly remove the
|
|
894
|
+
* [floating][floating-ref] reference, if `object` has a floating reference.
|
|
895
|
+
*
|
|
896
|
+
* In other words, if the object is floating, then this call "assumes
|
|
897
|
+
* ownership" of the floating reference, converting it to a normal
|
|
898
|
+
* reference by clearing the floating flag while leaving the reference
|
|
899
|
+
* count unchanged. If the object is not floating, then this call
|
|
900
|
+
* adds a new normal reference increasing the reference count by one.
|
|
901
|
+
*
|
|
902
|
+
* Since GLib 2.56, the type of `object` will be propagated to the return type
|
|
903
|
+
* under the same conditions as for g_object_ref().
|
|
904
|
+
* @returns @object
|
|
905
|
+
*/
|
|
906
|
+
ref_sink(): GObject.Object;
|
|
907
|
+
/**
|
|
908
|
+
* Releases all references to other objects. This can be used to break
|
|
909
|
+
* reference cycles.
|
|
910
|
+
*
|
|
911
|
+
* This function should only be called from object system implementations.
|
|
912
|
+
*/
|
|
913
|
+
run_dispose(): void;
|
|
914
|
+
/**
|
|
915
|
+
* Each object carries around a table of associations from
|
|
916
|
+
* strings to pointers. This function lets you set an association.
|
|
917
|
+
*
|
|
918
|
+
* If the object already had an association with that name,
|
|
919
|
+
* the old association will be destroyed.
|
|
920
|
+
*
|
|
921
|
+
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
|
|
922
|
+
* This means a copy of `key` is kept permanently (even after `object` has been
|
|
923
|
+
* finalized) — so it is recommended to only use a small, bounded set of values
|
|
924
|
+
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
|
|
925
|
+
* @param key name of the key
|
|
926
|
+
* @param data data to associate with that key
|
|
927
|
+
*/
|
|
928
|
+
set_data(key: string, data?: any | null): void;
|
|
929
|
+
set_property(property_name: string, value: any): void;
|
|
930
|
+
/**
|
|
931
|
+
* Remove a specified datum from the object's data associations,
|
|
932
|
+
* without invoking the association's destroy handler.
|
|
933
|
+
* @param key name of the key
|
|
934
|
+
* @returns the data if found, or %NULL if no such data exists.
|
|
935
|
+
*/
|
|
936
|
+
steal_data(key: string): any | null;
|
|
937
|
+
/**
|
|
938
|
+
* This function gets back user data pointers stored via
|
|
939
|
+
* g_object_set_qdata() and removes the `data` from object
|
|
940
|
+
* without invoking its destroy() function (if any was
|
|
941
|
+
* set).
|
|
942
|
+
* Usually, calling this function is only required to update
|
|
943
|
+
* user data pointers with a destroy notifier, for example:
|
|
944
|
+
*
|
|
945
|
+
* ```c
|
|
946
|
+
* void
|
|
947
|
+
* object_add_to_user_list (GObject *object,
|
|
948
|
+
* const gchar *new_string)
|
|
949
|
+
* {
|
|
950
|
+
* // the quark, naming the object data
|
|
951
|
+
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
|
|
952
|
+
* // retrieve the old string list
|
|
953
|
+
* GList *list = g_object_steal_qdata (object, quark_string_list);
|
|
954
|
+
*
|
|
955
|
+
* // prepend new string
|
|
956
|
+
* list = g_list_prepend (list, g_strdup (new_string));
|
|
957
|
+
* // this changed 'list', so we need to set it again
|
|
958
|
+
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
|
|
959
|
+
* }
|
|
960
|
+
* static void
|
|
961
|
+
* free_string_list (gpointer data)
|
|
962
|
+
* {
|
|
963
|
+
* GList *node, *list = data;
|
|
964
|
+
*
|
|
965
|
+
* for (node = list; node; node = node->next)
|
|
966
|
+
* g_free (node->data);
|
|
967
|
+
* g_list_free (list);
|
|
968
|
+
* }
|
|
969
|
+
* ```
|
|
970
|
+
*
|
|
971
|
+
* Using g_object_get_qdata() in the above example, instead of
|
|
972
|
+
* g_object_steal_qdata() would have left the destroy function set,
|
|
973
|
+
* and thus the partial string list would have been freed upon
|
|
974
|
+
* g_object_set_qdata_full().
|
|
975
|
+
* @param quark A #GQuark, naming the user data pointer
|
|
976
|
+
* @returns The user data pointer set, or %NULL
|
|
977
|
+
*/
|
|
978
|
+
steal_qdata(quark: GLib.Quark): any | null;
|
|
979
|
+
/**
|
|
980
|
+
* Reverts the effect of a previous call to
|
|
981
|
+
* g_object_freeze_notify(). The freeze count is decreased on `object`
|
|
982
|
+
* and when it reaches zero, queued "notify" signals are emitted.
|
|
983
|
+
*
|
|
984
|
+
* Duplicate notifications for each property are squashed so that at most one
|
|
985
|
+
* #GObject::notify signal is emitted for each property, in the reverse order
|
|
986
|
+
* in which they have been queued.
|
|
987
|
+
*
|
|
988
|
+
* It is an error to call this function when the freeze count is zero.
|
|
989
|
+
*/
|
|
990
|
+
thaw_notify(): void;
|
|
991
|
+
/**
|
|
992
|
+
* Decreases the reference count of `object`. When its reference count
|
|
993
|
+
* drops to 0, the object is finalized (i.e. its memory is freed).
|
|
994
|
+
*
|
|
995
|
+
* If the pointer to the #GObject may be reused in future (for example, if it is
|
|
996
|
+
* an instance variable of another object), it is recommended to clear the
|
|
997
|
+
* pointer to %NULL rather than retain a dangling pointer to a potentially
|
|
998
|
+
* invalid #GObject instance. Use g_clear_object() for this.
|
|
999
|
+
*/
|
|
1000
|
+
unref(): void;
|
|
1001
|
+
/**
|
|
1002
|
+
* This function essentially limits the life time of the `closure` to
|
|
1003
|
+
* the life time of the object. That is, when the object is finalized,
|
|
1004
|
+
* the `closure` is invalidated by calling g_closure_invalidate() on
|
|
1005
|
+
* it, in order to prevent invocations of the closure with a finalized
|
|
1006
|
+
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
|
|
1007
|
+
* added as marshal guards to the `closure,` to ensure that an extra
|
|
1008
|
+
* reference count is held on `object` during invocation of the
|
|
1009
|
+
* `closure`. Usually, this function will be called on closures that
|
|
1010
|
+
* use this `object` as closure data.
|
|
1011
|
+
* @param closure #GClosure to watch
|
|
1012
|
+
*/
|
|
1013
|
+
watch_closure(closure: GObject.Closure): void;
|
|
1014
|
+
vfunc_constructed(): void;
|
|
1015
|
+
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
|
|
1016
|
+
vfunc_dispose(): void;
|
|
1017
|
+
vfunc_finalize(): void;
|
|
1018
|
+
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
|
|
1019
|
+
/**
|
|
1020
|
+
* Emits a "notify" signal for the property `property_name` on `object`.
|
|
1021
|
+
*
|
|
1022
|
+
* When possible, eg. when signaling a property change from within the class
|
|
1023
|
+
* that registered the property, you should use g_object_notify_by_pspec()
|
|
1024
|
+
* instead.
|
|
1025
|
+
*
|
|
1026
|
+
* Note that emission of the notify signal may be blocked with
|
|
1027
|
+
* g_object_freeze_notify(). In this case, the signal emissions are queued
|
|
1028
|
+
* and will be emitted (in reverse order) when g_object_thaw_notify() is
|
|
1029
|
+
* called.
|
|
1030
|
+
* @param pspec
|
|
1031
|
+
*/
|
|
1032
|
+
vfunc_notify(pspec: GObject.ParamSpec): void;
|
|
1033
|
+
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
|
|
1034
|
+
disconnect(id: number): void;
|
|
1035
|
+
set(properties: { [key: string]: any }): void;
|
|
1036
|
+
block_signal_handler(id: number): any;
|
|
1037
|
+
unblock_signal_handler(id: number): any;
|
|
1038
|
+
stop_emission_by_name(detailedName: string): any;
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
module Kbd {
|
|
1042
|
+
// Constructor properties interface
|
|
1043
|
+
|
|
1044
|
+
interface ConstructorProps
|
|
1045
|
+
extends Gio.DBusProxy.ConstructorProps,
|
|
1046
|
+
Gio.AsyncInitable.ConstructorProps,
|
|
1047
|
+
Gio.DBusInterface.ConstructorProps,
|
|
1048
|
+
Gio.Initable.ConstructorProps {}
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
/**
|
|
1052
|
+
* A #FcitxKbd allow you to control fcitx via DBus.
|
|
1053
|
+
*/
|
|
1054
|
+
class Kbd extends Gio.DBusProxy implements Gio.AsyncInitable<Kbd>, Gio.DBusInterface, Gio.Initable {
|
|
1055
|
+
static $gtype: GObject.GType<Kbd>;
|
|
1056
|
+
|
|
1057
|
+
// Constructors of Fcitx.Kbd
|
|
1058
|
+
|
|
1059
|
+
constructor(properties?: Partial<Kbd.ConstructorProps>, ...args: any[]);
|
|
1060
|
+
|
|
1061
|
+
_init(...args: any[]): void;
|
|
1062
|
+
|
|
1063
|
+
static ['new'](
|
|
1064
|
+
bus_type: Gio.BusType,
|
|
1065
|
+
flags: Gio.DBusProxyFlags,
|
|
1066
|
+
display_number: number,
|
|
1067
|
+
cancellable?: Gio.Cancellable | null,
|
|
1068
|
+
): Kbd;
|
|
1069
|
+
// Conflicted with Gio.DBusProxy.new
|
|
1070
|
+
|
|
1071
|
+
static ['new'](...args: never[]): any;
|
|
1072
|
+
|
|
1073
|
+
// Own methods of Fcitx.Kbd
|
|
1074
|
+
|
|
1075
|
+
/**
|
|
1076
|
+
* Get a layout binding with input method
|
|
1077
|
+
* @param imname input method name
|
|
1078
|
+
*/
|
|
1079
|
+
get_layout_for_im(imname: string): [string, string];
|
|
1080
|
+
/**
|
|
1081
|
+
* Get Fcitx all im list
|
|
1082
|
+
* @returns A #FcitxLayoutItem List
|
|
1083
|
+
*/
|
|
1084
|
+
get_layouts(): LayoutItem[];
|
|
1085
|
+
/**
|
|
1086
|
+
* Set a layout binding with the state when there is no input method
|
|
1087
|
+
* @param layout layout
|
|
1088
|
+
* @param variant variant
|
|
1089
|
+
*/
|
|
1090
|
+
set_default_layout(layout: string, variant: string): void;
|
|
1091
|
+
/**
|
|
1092
|
+
* Set a layout binding with input method
|
|
1093
|
+
* @param imname input method name
|
|
1094
|
+
* @param layout layout
|
|
1095
|
+
* @param variant variant
|
|
1096
|
+
*/
|
|
1097
|
+
set_layout_for_im(imname: string, layout: string, variant: string): void;
|
|
1098
|
+
|
|
1099
|
+
// Inherited methods
|
|
1100
|
+
/**
|
|
1101
|
+
* Starts asynchronous initialization of the object implementing the
|
|
1102
|
+
* interface. This must be done before any real use of the object after
|
|
1103
|
+
* initial construction. If the object also implements #GInitable you can
|
|
1104
|
+
* optionally call g_initable_init() instead.
|
|
1105
|
+
*
|
|
1106
|
+
* This method is intended for language bindings. If writing in C,
|
|
1107
|
+
* g_async_initable_new_async() should typically be used instead.
|
|
1108
|
+
*
|
|
1109
|
+
* When the initialization is finished, `callback` will be called. You can
|
|
1110
|
+
* then call g_async_initable_init_finish() to get the result of the
|
|
1111
|
+
* initialization.
|
|
1112
|
+
*
|
|
1113
|
+
* Implementations may also support cancellation. If `cancellable` is not
|
|
1114
|
+
* %NULL, then initialization can be cancelled by triggering the cancellable
|
|
1115
|
+
* object from another thread. If the operation was cancelled, the error
|
|
1116
|
+
* %G_IO_ERROR_CANCELLED will be returned. If `cancellable` is not %NULL, and
|
|
1117
|
+
* the object doesn't support cancellable initialization, the error
|
|
1118
|
+
* %G_IO_ERROR_NOT_SUPPORTED will be returned.
|
|
1119
|
+
*
|
|
1120
|
+
* As with #GInitable, if the object is not initialized, or initialization
|
|
1121
|
+
* returns with an error, then all operations on the object except
|
|
1122
|
+
* g_object_ref() and g_object_unref() are considered to be invalid, and
|
|
1123
|
+
* have undefined behaviour. They will often fail with g_critical() or
|
|
1124
|
+
* g_warning(), but this must not be relied on.
|
|
1125
|
+
*
|
|
1126
|
+
* Callers should not assume that a class which implements #GAsyncInitable can
|
|
1127
|
+
* be initialized multiple times; for more information, see g_initable_init().
|
|
1128
|
+
* If a class explicitly supports being initialized multiple times,
|
|
1129
|
+
* implementation requires yielding all subsequent calls to init_async() on the
|
|
1130
|
+
* results of the first call.
|
|
1131
|
+
*
|
|
1132
|
+
* For classes that also support the #GInitable interface, the default
|
|
1133
|
+
* implementation of this method will run the g_initable_init() function
|
|
1134
|
+
* in a thread, so if you want to support asynchronous initialization via
|
|
1135
|
+
* threads, just implement the #GAsyncInitable interface without overriding
|
|
1136
|
+
* any interface methods.
|
|
1137
|
+
* @param io_priority the [I/O priority][io-priority] of the operation
|
|
1138
|
+
* @param cancellable optional #GCancellable object, %NULL to ignore.
|
|
1139
|
+
* @param callback a #GAsyncReadyCallback to call when the request is satisfied
|
|
1140
|
+
*/
|
|
1141
|
+
init_async(
|
|
1142
|
+
io_priority: number,
|
|
1143
|
+
cancellable?: Gio.Cancellable | null,
|
|
1144
|
+
callback?: Gio.AsyncReadyCallback<this> | null,
|
|
1145
|
+
): void;
|
|
1146
|
+
/**
|
|
1147
|
+
* Finishes asynchronous initialization and returns the result.
|
|
1148
|
+
* See g_async_initable_init_async().
|
|
1149
|
+
* @param res a #GAsyncResult.
|
|
1150
|
+
* @returns %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
|
|
1151
|
+
*/
|
|
1152
|
+
init_finish(res: Gio.AsyncResult): boolean;
|
|
1153
|
+
/**
|
|
1154
|
+
* Finishes the async construction for the various g_async_initable_new
|
|
1155
|
+
* calls, returning the created object or %NULL on error.
|
|
1156
|
+
* @param res the #GAsyncResult from the callback
|
|
1157
|
+
* @returns a newly created #GObject, or %NULL on error. Free with g_object_unref().
|
|
1158
|
+
*/
|
|
1159
|
+
new_finish(res: Gio.AsyncResult): Kbd;
|
|
1160
|
+
// Conflicted with Gio.DBusProxy.new_finish
|
|
1161
|
+
new_finish(...args: never[]): any;
|
|
1162
|
+
/**
|
|
1163
|
+
* Starts asynchronous initialization of the object implementing the
|
|
1164
|
+
* interface. This must be done before any real use of the object after
|
|
1165
|
+
* initial construction. If the object also implements #GInitable you can
|
|
1166
|
+
* optionally call g_initable_init() instead.
|
|
1167
|
+
*
|
|
1168
|
+
* This method is intended for language bindings. If writing in C,
|
|
1169
|
+
* g_async_initable_new_async() should typically be used instead.
|
|
1170
|
+
*
|
|
1171
|
+
* When the initialization is finished, `callback` will be called. You can
|
|
1172
|
+
* then call g_async_initable_init_finish() to get the result of the
|
|
1173
|
+
* initialization.
|
|
1174
|
+
*
|
|
1175
|
+
* Implementations may also support cancellation. If `cancellable` is not
|
|
1176
|
+
* %NULL, then initialization can be cancelled by triggering the cancellable
|
|
1177
|
+
* object from another thread. If the operation was cancelled, the error
|
|
1178
|
+
* %G_IO_ERROR_CANCELLED will be returned. If `cancellable` is not %NULL, and
|
|
1179
|
+
* the object doesn't support cancellable initialization, the error
|
|
1180
|
+
* %G_IO_ERROR_NOT_SUPPORTED will be returned.
|
|
1181
|
+
*
|
|
1182
|
+
* As with #GInitable, if the object is not initialized, or initialization
|
|
1183
|
+
* returns with an error, then all operations on the object except
|
|
1184
|
+
* g_object_ref() and g_object_unref() are considered to be invalid, and
|
|
1185
|
+
* have undefined behaviour. They will often fail with g_critical() or
|
|
1186
|
+
* g_warning(), but this must not be relied on.
|
|
1187
|
+
*
|
|
1188
|
+
* Callers should not assume that a class which implements #GAsyncInitable can
|
|
1189
|
+
* be initialized multiple times; for more information, see g_initable_init().
|
|
1190
|
+
* If a class explicitly supports being initialized multiple times,
|
|
1191
|
+
* implementation requires yielding all subsequent calls to init_async() on the
|
|
1192
|
+
* results of the first call.
|
|
1193
|
+
*
|
|
1194
|
+
* For classes that also support the #GInitable interface, the default
|
|
1195
|
+
* implementation of this method will run the g_initable_init() function
|
|
1196
|
+
* in a thread, so if you want to support asynchronous initialization via
|
|
1197
|
+
* threads, just implement the #GAsyncInitable interface without overriding
|
|
1198
|
+
* any interface methods.
|
|
1199
|
+
* @param io_priority the [I/O priority][io-priority] of the operation
|
|
1200
|
+
* @param cancellable optional #GCancellable object, %NULL to ignore.
|
|
1201
|
+
* @param callback a #GAsyncReadyCallback to call when the request is satisfied
|
|
1202
|
+
*/
|
|
1203
|
+
vfunc_init_async(
|
|
1204
|
+
io_priority: number,
|
|
1205
|
+
cancellable?: Gio.Cancellable | null,
|
|
1206
|
+
callback?: Gio.AsyncReadyCallback<this> | null,
|
|
1207
|
+
): void;
|
|
1208
|
+
/**
|
|
1209
|
+
* Finishes asynchronous initialization and returns the result.
|
|
1210
|
+
* See g_async_initable_init_async().
|
|
1211
|
+
* @param res a #GAsyncResult.
|
|
1212
|
+
*/
|
|
1213
|
+
vfunc_init_finish(res: Gio.AsyncResult): boolean;
|
|
1214
|
+
/**
|
|
1215
|
+
* Gets the #GDBusObject that `interface_` belongs to, if any.
|
|
1216
|
+
* @returns A #GDBusObject or %NULL. The returned reference should be freed with g_object_unref().
|
|
1217
|
+
*/
|
|
1218
|
+
get_object(): Gio.DBusObject | null;
|
|
1219
|
+
/**
|
|
1220
|
+
* Gets D-Bus introspection information for the D-Bus interface
|
|
1221
|
+
* implemented by `interface_`.
|
|
1222
|
+
* @returns A #GDBusInterfaceInfo. Do not free.
|
|
1223
|
+
*/
|
|
1224
|
+
get_info(): Gio.DBusInterfaceInfo;
|
|
1225
|
+
/**
|
|
1226
|
+
* Sets the #GDBusObject for `interface_` to `object`.
|
|
1227
|
+
*
|
|
1228
|
+
* Note that `interface_` will hold a weak reference to `object`.
|
|
1229
|
+
* @param object A #GDBusObject or %NULL.
|
|
1230
|
+
*/
|
|
1231
|
+
set_object(object?: Gio.DBusObject | null): void;
|
|
1232
|
+
/**
|
|
1233
|
+
* Gets the #GDBusObject that `interface_` belongs to, if any.
|
|
1234
|
+
*/
|
|
1235
|
+
vfunc_dup_object(): Gio.DBusObject | null;
|
|
1236
|
+
/**
|
|
1237
|
+
* Gets D-Bus introspection information for the D-Bus interface
|
|
1238
|
+
* implemented by `interface_`.
|
|
1239
|
+
*/
|
|
1240
|
+
vfunc_get_info(): Gio.DBusInterfaceInfo;
|
|
1241
|
+
/**
|
|
1242
|
+
* Sets the #GDBusObject for `interface_` to `object`.
|
|
1243
|
+
*
|
|
1244
|
+
* Note that `interface_` will hold a weak reference to `object`.
|
|
1245
|
+
* @param object A #GDBusObject or %NULL.
|
|
1246
|
+
*/
|
|
1247
|
+
vfunc_set_object(object?: Gio.DBusObject | null): void;
|
|
1248
|
+
/**
|
|
1249
|
+
* Initializes the object implementing the interface.
|
|
1250
|
+
*
|
|
1251
|
+
* This method is intended for language bindings. If writing in C,
|
|
1252
|
+
* g_initable_new() should typically be used instead.
|
|
1253
|
+
*
|
|
1254
|
+
* The object must be initialized before any real use after initial
|
|
1255
|
+
* construction, either with this function or g_async_initable_init_async().
|
|
1256
|
+
*
|
|
1257
|
+
* Implementations may also support cancellation. If `cancellable` is not %NULL,
|
|
1258
|
+
* then initialization can be cancelled by triggering the cancellable object
|
|
1259
|
+
* from another thread. If the operation was cancelled, the error
|
|
1260
|
+
* %G_IO_ERROR_CANCELLED will be returned. If `cancellable` is not %NULL and
|
|
1261
|
+
* the object doesn't support cancellable initialization the error
|
|
1262
|
+
* %G_IO_ERROR_NOT_SUPPORTED will be returned.
|
|
1263
|
+
*
|
|
1264
|
+
* If the object is not initialized, or initialization returns with an
|
|
1265
|
+
* error, then all operations on the object except g_object_ref() and
|
|
1266
|
+
* g_object_unref() are considered to be invalid, and have undefined
|
|
1267
|
+
* behaviour. See the [introduction][ginitable] for more details.
|
|
1268
|
+
*
|
|
1269
|
+
* Callers should not assume that a class which implements #GInitable can be
|
|
1270
|
+
* initialized multiple times, unless the class explicitly documents itself as
|
|
1271
|
+
* supporting this. Generally, a class’ implementation of init() can assume
|
|
1272
|
+
* (and assert) that it will only be called once. Previously, this documentation
|
|
1273
|
+
* recommended all #GInitable implementations should be idempotent; that
|
|
1274
|
+
* recommendation was relaxed in GLib 2.54.
|
|
1275
|
+
*
|
|
1276
|
+
* If a class explicitly supports being initialized multiple times, it is
|
|
1277
|
+
* recommended that the method is idempotent: multiple calls with the same
|
|
1278
|
+
* arguments should return the same results. Only the first call initializes
|
|
1279
|
+
* the object; further calls return the result of the first call.
|
|
1280
|
+
*
|
|
1281
|
+
* One reason why a class might need to support idempotent initialization is if
|
|
1282
|
+
* it is designed to be used via the singleton pattern, with a
|
|
1283
|
+
* #GObjectClass.constructor that sometimes returns an existing instance.
|
|
1284
|
+
* In this pattern, a caller would expect to be able to call g_initable_init()
|
|
1285
|
+
* on the result of g_object_new(), regardless of whether it is in fact a new
|
|
1286
|
+
* instance.
|
|
1287
|
+
* @param cancellable optional #GCancellable object, %NULL to ignore.
|
|
1288
|
+
* @returns %TRUE if successful. If an error has occurred, this function will return %FALSE and set @error appropriately if present.
|
|
1289
|
+
*/
|
|
1290
|
+
init(cancellable?: Gio.Cancellable | null): boolean;
|
|
1291
|
+
/**
|
|
1292
|
+
* Initializes the object implementing the interface.
|
|
1293
|
+
*
|
|
1294
|
+
* This method is intended for language bindings. If writing in C,
|
|
1295
|
+
* g_initable_new() should typically be used instead.
|
|
1296
|
+
*
|
|
1297
|
+
* The object must be initialized before any real use after initial
|
|
1298
|
+
* construction, either with this function or g_async_initable_init_async().
|
|
1299
|
+
*
|
|
1300
|
+
* Implementations may also support cancellation. If `cancellable` is not %NULL,
|
|
1301
|
+
* then initialization can be cancelled by triggering the cancellable object
|
|
1302
|
+
* from another thread. If the operation was cancelled, the error
|
|
1303
|
+
* %G_IO_ERROR_CANCELLED will be returned. If `cancellable` is not %NULL and
|
|
1304
|
+
* the object doesn't support cancellable initialization the error
|
|
1305
|
+
* %G_IO_ERROR_NOT_SUPPORTED will be returned.
|
|
1306
|
+
*
|
|
1307
|
+
* If the object is not initialized, or initialization returns with an
|
|
1308
|
+
* error, then all operations on the object except g_object_ref() and
|
|
1309
|
+
* g_object_unref() are considered to be invalid, and have undefined
|
|
1310
|
+
* behaviour. See the [introduction][ginitable] for more details.
|
|
1311
|
+
*
|
|
1312
|
+
* Callers should not assume that a class which implements #GInitable can be
|
|
1313
|
+
* initialized multiple times, unless the class explicitly documents itself as
|
|
1314
|
+
* supporting this. Generally, a class’ implementation of init() can assume
|
|
1315
|
+
* (and assert) that it will only be called once. Previously, this documentation
|
|
1316
|
+
* recommended all #GInitable implementations should be idempotent; that
|
|
1317
|
+
* recommendation was relaxed in GLib 2.54.
|
|
1318
|
+
*
|
|
1319
|
+
* If a class explicitly supports being initialized multiple times, it is
|
|
1320
|
+
* recommended that the method is idempotent: multiple calls with the same
|
|
1321
|
+
* arguments should return the same results. Only the first call initializes
|
|
1322
|
+
* the object; further calls return the result of the first call.
|
|
1323
|
+
*
|
|
1324
|
+
* One reason why a class might need to support idempotent initialization is if
|
|
1325
|
+
* it is designed to be used via the singleton pattern, with a
|
|
1326
|
+
* #GObjectClass.constructor that sometimes returns an existing instance.
|
|
1327
|
+
* In this pattern, a caller would expect to be able to call g_initable_init()
|
|
1328
|
+
* on the result of g_object_new(), regardless of whether it is in fact a new
|
|
1329
|
+
* instance.
|
|
1330
|
+
* @param cancellable optional #GCancellable object, %NULL to ignore.
|
|
1331
|
+
*/
|
|
1332
|
+
vfunc_init(cancellable?: Gio.Cancellable | null): boolean;
|
|
1333
|
+
/**
|
|
1334
|
+
* Creates a binding between `source_property` on `source` and `target_property`
|
|
1335
|
+
* on `target`.
|
|
1336
|
+
*
|
|
1337
|
+
* Whenever the `source_property` is changed the `target_property` is
|
|
1338
|
+
* updated using the same value. For instance:
|
|
1339
|
+
*
|
|
1340
|
+
*
|
|
1341
|
+
* ```c
|
|
1342
|
+
* g_object_bind_property (action, "active", widget, "sensitive", 0);
|
|
1343
|
+
* ```
|
|
1344
|
+
*
|
|
1345
|
+
*
|
|
1346
|
+
* Will result in the "sensitive" property of the widget #GObject instance to be
|
|
1347
|
+
* updated with the same value of the "active" property of the action #GObject
|
|
1348
|
+
* instance.
|
|
1349
|
+
*
|
|
1350
|
+
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
|
|
1351
|
+
* if `target_property` on `target` changes then the `source_property` on `source`
|
|
1352
|
+
* will be updated as well.
|
|
1353
|
+
*
|
|
1354
|
+
* The binding will automatically be removed when either the `source` or the
|
|
1355
|
+
* `target` instances are finalized. To remove the binding without affecting the
|
|
1356
|
+
* `source` and the `target` you can just call g_object_unref() on the returned
|
|
1357
|
+
* #GBinding instance.
|
|
1358
|
+
*
|
|
1359
|
+
* Removing the binding by calling g_object_unref() on it must only be done if
|
|
1360
|
+
* the binding, `source` and `target` are only used from a single thread and it
|
|
1361
|
+
* is clear that both `source` and `target` outlive the binding. Especially it
|
|
1362
|
+
* is not safe to rely on this if the binding, `source` or `target` can be
|
|
1363
|
+
* finalized from different threads. Keep another reference to the binding and
|
|
1364
|
+
* use g_binding_unbind() instead to be on the safe side.
|
|
1365
|
+
*
|
|
1366
|
+
* A #GObject can have multiple bindings.
|
|
1367
|
+
* @param source_property the property on @source to bind
|
|
1368
|
+
* @param target the target #GObject
|
|
1369
|
+
* @param target_property the property on @target to bind
|
|
1370
|
+
* @param flags flags to pass to #GBinding
|
|
1371
|
+
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
|
|
1372
|
+
*/
|
|
1373
|
+
bind_property(
|
|
1374
|
+
source_property: string,
|
|
1375
|
+
target: GObject.Object,
|
|
1376
|
+
target_property: string,
|
|
1377
|
+
flags: GObject.BindingFlags,
|
|
1378
|
+
): GObject.Binding;
|
|
1379
|
+
/**
|
|
1380
|
+
* Complete version of g_object_bind_property().
|
|
1381
|
+
*
|
|
1382
|
+
* Creates a binding between `source_property` on `source` and `target_property`
|
|
1383
|
+
* on `target,` allowing you to set the transformation functions to be used by
|
|
1384
|
+
* the binding.
|
|
1385
|
+
*
|
|
1386
|
+
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
|
|
1387
|
+
* if `target_property` on `target` changes then the `source_property` on `source`
|
|
1388
|
+
* will be updated as well. The `transform_from` function is only used in case
|
|
1389
|
+
* of bidirectional bindings, otherwise it will be ignored
|
|
1390
|
+
*
|
|
1391
|
+
* The binding will automatically be removed when either the `source` or the
|
|
1392
|
+
* `target` instances are finalized. This will release the reference that is
|
|
1393
|
+
* being held on the #GBinding instance; if you want to hold on to the
|
|
1394
|
+
* #GBinding instance, you will need to hold a reference to it.
|
|
1395
|
+
*
|
|
1396
|
+
* To remove the binding, call g_binding_unbind().
|
|
1397
|
+
*
|
|
1398
|
+
* A #GObject can have multiple bindings.
|
|
1399
|
+
*
|
|
1400
|
+
* The same `user_data` parameter will be used for both `transform_to`
|
|
1401
|
+
* and `transform_from` transformation functions; the `notify` function will
|
|
1402
|
+
* be called once, when the binding is removed. If you need different data
|
|
1403
|
+
* for each transformation function, please use
|
|
1404
|
+
* g_object_bind_property_with_closures() instead.
|
|
1405
|
+
* @param source_property the property on @source to bind
|
|
1406
|
+
* @param target the target #GObject
|
|
1407
|
+
* @param target_property the property on @target to bind
|
|
1408
|
+
* @param flags flags to pass to #GBinding
|
|
1409
|
+
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
|
|
1410
|
+
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
|
|
1411
|
+
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
|
|
1412
|
+
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
|
|
1413
|
+
*/
|
|
1414
|
+
bind_property_full(
|
|
1415
|
+
source_property: string,
|
|
1416
|
+
target: GObject.Object,
|
|
1417
|
+
target_property: string,
|
|
1418
|
+
flags: GObject.BindingFlags,
|
|
1419
|
+
transform_to?: GObject.BindingTransformFunc | null,
|
|
1420
|
+
transform_from?: GObject.BindingTransformFunc | null,
|
|
1421
|
+
notify?: GLib.DestroyNotify | null,
|
|
1422
|
+
): GObject.Binding;
|
|
1423
|
+
// Conflicted with GObject.Object.bind_property_full
|
|
1424
|
+
bind_property_full(...args: never[]): any;
|
|
1425
|
+
/**
|
|
1426
|
+
* This function is intended for #GObject implementations to re-enforce
|
|
1427
|
+
* a [floating][floating-ref] object reference. Doing this is seldom
|
|
1428
|
+
* required: all #GInitiallyUnowneds are created with a floating reference
|
|
1429
|
+
* which usually just needs to be sunken by calling g_object_ref_sink().
|
|
1430
|
+
*/
|
|
1431
|
+
force_floating(): void;
|
|
1432
|
+
/**
|
|
1433
|
+
* Increases the freeze count on `object`. If the freeze count is
|
|
1434
|
+
* non-zero, the emission of "notify" signals on `object` is
|
|
1435
|
+
* stopped. The signals are queued until the freeze count is decreased
|
|
1436
|
+
* to zero. Duplicate notifications are squashed so that at most one
|
|
1437
|
+
* #GObject::notify signal is emitted for each property modified while the
|
|
1438
|
+
* object is frozen.
|
|
1439
|
+
*
|
|
1440
|
+
* This is necessary for accessors that modify multiple properties to prevent
|
|
1441
|
+
* premature notification while the object is still being modified.
|
|
1442
|
+
*/
|
|
1443
|
+
freeze_notify(): void;
|
|
1444
|
+
/**
|
|
1445
|
+
* Gets a named field from the objects table of associations (see g_object_set_data()).
|
|
1446
|
+
* @param key name of the key for that association
|
|
1447
|
+
* @returns the data if found, or %NULL if no such data exists.
|
|
1448
|
+
*/
|
|
1449
|
+
get_data(key: string): any | null;
|
|
1450
|
+
get_property(property_name: string): any;
|
|
1451
|
+
/**
|
|
1452
|
+
* This function gets back user data pointers stored via
|
|
1453
|
+
* g_object_set_qdata().
|
|
1454
|
+
* @param quark A #GQuark, naming the user data pointer
|
|
1455
|
+
* @returns The user data pointer set, or %NULL
|
|
1456
|
+
*/
|
|
1457
|
+
get_qdata(quark: GLib.Quark): any | null;
|
|
1458
|
+
/**
|
|
1459
|
+
* Gets `n_properties` properties for an `object`.
|
|
1460
|
+
* Obtained properties will be set to `values`. All properties must be valid.
|
|
1461
|
+
* Warnings will be emitted and undefined behaviour may result if invalid
|
|
1462
|
+
* properties are passed in.
|
|
1463
|
+
* @param names the names of each property to get
|
|
1464
|
+
* @param values the values of each property to get
|
|
1465
|
+
*/
|
|
1466
|
+
getv(names: string[], values: (GObject.Value | any)[]): void;
|
|
1467
|
+
/**
|
|
1468
|
+
* Checks whether `object` has a [floating][floating-ref] reference.
|
|
1469
|
+
* @returns %TRUE if @object has a floating reference
|
|
1470
|
+
*/
|
|
1471
|
+
is_floating(): boolean;
|
|
1472
|
+
/**
|
|
1473
|
+
* Emits a "notify" signal for the property `property_name` on `object`.
|
|
1474
|
+
*
|
|
1475
|
+
* When possible, eg. when signaling a property change from within the class
|
|
1476
|
+
* that registered the property, you should use g_object_notify_by_pspec()
|
|
1477
|
+
* instead.
|
|
1478
|
+
*
|
|
1479
|
+
* Note that emission of the notify signal may be blocked with
|
|
1480
|
+
* g_object_freeze_notify(). In this case, the signal emissions are queued
|
|
1481
|
+
* and will be emitted (in reverse order) when g_object_thaw_notify() is
|
|
1482
|
+
* called.
|
|
1483
|
+
* @param property_name the name of a property installed on the class of @object.
|
|
1484
|
+
*/
|
|
1485
|
+
notify(property_name: string): void;
|
|
1486
|
+
/**
|
|
1487
|
+
* Emits a "notify" signal for the property specified by `pspec` on `object`.
|
|
1488
|
+
*
|
|
1489
|
+
* This function omits the property name lookup, hence it is faster than
|
|
1490
|
+
* g_object_notify().
|
|
1491
|
+
*
|
|
1492
|
+
* One way to avoid using g_object_notify() from within the
|
|
1493
|
+
* class that registered the properties, and using g_object_notify_by_pspec()
|
|
1494
|
+
* instead, is to store the GParamSpec used with
|
|
1495
|
+
* g_object_class_install_property() inside a static array, e.g.:
|
|
1496
|
+
*
|
|
1497
|
+
*
|
|
1498
|
+
* ```c
|
|
1499
|
+
* typedef enum
|
|
1500
|
+
* {
|
|
1501
|
+
* PROP_FOO = 1,
|
|
1502
|
+
* PROP_LAST
|
|
1503
|
+
* } MyObjectProperty;
|
|
1504
|
+
*
|
|
1505
|
+
* static GParamSpec *properties[PROP_LAST];
|
|
1506
|
+
*
|
|
1507
|
+
* static void
|
|
1508
|
+
* my_object_class_init (MyObjectClass *klass)
|
|
1509
|
+
* {
|
|
1510
|
+
* properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
|
|
1511
|
+
* 0, 100,
|
|
1512
|
+
* 50,
|
|
1513
|
+
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
|
1514
|
+
* g_object_class_install_property (gobject_class,
|
|
1515
|
+
* PROP_FOO,
|
|
1516
|
+
* properties[PROP_FOO]);
|
|
1517
|
+
* }
|
|
1518
|
+
* ```
|
|
1519
|
+
*
|
|
1520
|
+
*
|
|
1521
|
+
* and then notify a change on the "foo" property with:
|
|
1522
|
+
*
|
|
1523
|
+
*
|
|
1524
|
+
* ```c
|
|
1525
|
+
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
|
|
1526
|
+
* ```
|
|
1527
|
+
*
|
|
1528
|
+
* @param pspec the #GParamSpec of a property installed on the class of @object.
|
|
1529
|
+
*/
|
|
1530
|
+
notify_by_pspec(pspec: GObject.ParamSpec): void;
|
|
1531
|
+
/**
|
|
1532
|
+
* Increases the reference count of `object`.
|
|
1533
|
+
*
|
|
1534
|
+
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
|
|
1535
|
+
* of `object` will be propagated to the return type (using the GCC typeof()
|
|
1536
|
+
* extension), so any casting the caller needs to do on the return type must be
|
|
1537
|
+
* explicit.
|
|
1538
|
+
* @returns the same @object
|
|
1539
|
+
*/
|
|
1540
|
+
ref(): GObject.Object;
|
|
1541
|
+
/**
|
|
1542
|
+
* Increase the reference count of `object,` and possibly remove the
|
|
1543
|
+
* [floating][floating-ref] reference, if `object` has a floating reference.
|
|
1544
|
+
*
|
|
1545
|
+
* In other words, if the object is floating, then this call "assumes
|
|
1546
|
+
* ownership" of the floating reference, converting it to a normal
|
|
1547
|
+
* reference by clearing the floating flag while leaving the reference
|
|
1548
|
+
* count unchanged. If the object is not floating, then this call
|
|
1549
|
+
* adds a new normal reference increasing the reference count by one.
|
|
1550
|
+
*
|
|
1551
|
+
* Since GLib 2.56, the type of `object` will be propagated to the return type
|
|
1552
|
+
* under the same conditions as for g_object_ref().
|
|
1553
|
+
* @returns @object
|
|
1554
|
+
*/
|
|
1555
|
+
ref_sink(): GObject.Object;
|
|
1556
|
+
/**
|
|
1557
|
+
* Releases all references to other objects. This can be used to break
|
|
1558
|
+
* reference cycles.
|
|
1559
|
+
*
|
|
1560
|
+
* This function should only be called from object system implementations.
|
|
1561
|
+
*/
|
|
1562
|
+
run_dispose(): void;
|
|
1563
|
+
/**
|
|
1564
|
+
* Each object carries around a table of associations from
|
|
1565
|
+
* strings to pointers. This function lets you set an association.
|
|
1566
|
+
*
|
|
1567
|
+
* If the object already had an association with that name,
|
|
1568
|
+
* the old association will be destroyed.
|
|
1569
|
+
*
|
|
1570
|
+
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
|
|
1571
|
+
* This means a copy of `key` is kept permanently (even after `object` has been
|
|
1572
|
+
* finalized) — so it is recommended to only use a small, bounded set of values
|
|
1573
|
+
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
|
|
1574
|
+
* @param key name of the key
|
|
1575
|
+
* @param data data to associate with that key
|
|
1576
|
+
*/
|
|
1577
|
+
set_data(key: string, data?: any | null): void;
|
|
1578
|
+
set_property(property_name: string, value: any): void;
|
|
1579
|
+
/**
|
|
1580
|
+
* Remove a specified datum from the object's data associations,
|
|
1581
|
+
* without invoking the association's destroy handler.
|
|
1582
|
+
* @param key name of the key
|
|
1583
|
+
* @returns the data if found, or %NULL if no such data exists.
|
|
1584
|
+
*/
|
|
1585
|
+
steal_data(key: string): any | null;
|
|
1586
|
+
/**
|
|
1587
|
+
* This function gets back user data pointers stored via
|
|
1588
|
+
* g_object_set_qdata() and removes the `data` from object
|
|
1589
|
+
* without invoking its destroy() function (if any was
|
|
1590
|
+
* set).
|
|
1591
|
+
* Usually, calling this function is only required to update
|
|
1592
|
+
* user data pointers with a destroy notifier, for example:
|
|
1593
|
+
*
|
|
1594
|
+
* ```c
|
|
1595
|
+
* void
|
|
1596
|
+
* object_add_to_user_list (GObject *object,
|
|
1597
|
+
* const gchar *new_string)
|
|
1598
|
+
* {
|
|
1599
|
+
* // the quark, naming the object data
|
|
1600
|
+
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
|
|
1601
|
+
* // retrieve the old string list
|
|
1602
|
+
* GList *list = g_object_steal_qdata (object, quark_string_list);
|
|
1603
|
+
*
|
|
1604
|
+
* // prepend new string
|
|
1605
|
+
* list = g_list_prepend (list, g_strdup (new_string));
|
|
1606
|
+
* // this changed 'list', so we need to set it again
|
|
1607
|
+
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
|
|
1608
|
+
* }
|
|
1609
|
+
* static void
|
|
1610
|
+
* free_string_list (gpointer data)
|
|
1611
|
+
* {
|
|
1612
|
+
* GList *node, *list = data;
|
|
1613
|
+
*
|
|
1614
|
+
* for (node = list; node; node = node->next)
|
|
1615
|
+
* g_free (node->data);
|
|
1616
|
+
* g_list_free (list);
|
|
1617
|
+
* }
|
|
1618
|
+
* ```
|
|
1619
|
+
*
|
|
1620
|
+
* Using g_object_get_qdata() in the above example, instead of
|
|
1621
|
+
* g_object_steal_qdata() would have left the destroy function set,
|
|
1622
|
+
* and thus the partial string list would have been freed upon
|
|
1623
|
+
* g_object_set_qdata_full().
|
|
1624
|
+
* @param quark A #GQuark, naming the user data pointer
|
|
1625
|
+
* @returns The user data pointer set, or %NULL
|
|
1626
|
+
*/
|
|
1627
|
+
steal_qdata(quark: GLib.Quark): any | null;
|
|
1628
|
+
/**
|
|
1629
|
+
* Reverts the effect of a previous call to
|
|
1630
|
+
* g_object_freeze_notify(). The freeze count is decreased on `object`
|
|
1631
|
+
* and when it reaches zero, queued "notify" signals are emitted.
|
|
1632
|
+
*
|
|
1633
|
+
* Duplicate notifications for each property are squashed so that at most one
|
|
1634
|
+
* #GObject::notify signal is emitted for each property, in the reverse order
|
|
1635
|
+
* in which they have been queued.
|
|
1636
|
+
*
|
|
1637
|
+
* It is an error to call this function when the freeze count is zero.
|
|
1638
|
+
*/
|
|
1639
|
+
thaw_notify(): void;
|
|
1640
|
+
/**
|
|
1641
|
+
* Decreases the reference count of `object`. When its reference count
|
|
1642
|
+
* drops to 0, the object is finalized (i.e. its memory is freed).
|
|
1643
|
+
*
|
|
1644
|
+
* If the pointer to the #GObject may be reused in future (for example, if it is
|
|
1645
|
+
* an instance variable of another object), it is recommended to clear the
|
|
1646
|
+
* pointer to %NULL rather than retain a dangling pointer to a potentially
|
|
1647
|
+
* invalid #GObject instance. Use g_clear_object() for this.
|
|
1648
|
+
*/
|
|
1649
|
+
unref(): void;
|
|
1650
|
+
/**
|
|
1651
|
+
* This function essentially limits the life time of the `closure` to
|
|
1652
|
+
* the life time of the object. That is, when the object is finalized,
|
|
1653
|
+
* the `closure` is invalidated by calling g_closure_invalidate() on
|
|
1654
|
+
* it, in order to prevent invocations of the closure with a finalized
|
|
1655
|
+
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
|
|
1656
|
+
* added as marshal guards to the `closure,` to ensure that an extra
|
|
1657
|
+
* reference count is held on `object` during invocation of the
|
|
1658
|
+
* `closure`. Usually, this function will be called on closures that
|
|
1659
|
+
* use this `object` as closure data.
|
|
1660
|
+
* @param closure #GClosure to watch
|
|
1661
|
+
*/
|
|
1662
|
+
watch_closure(closure: GObject.Closure): void;
|
|
1663
|
+
vfunc_constructed(): void;
|
|
1664
|
+
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
|
|
1665
|
+
vfunc_dispose(): void;
|
|
1666
|
+
vfunc_finalize(): void;
|
|
1667
|
+
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
|
|
1668
|
+
/**
|
|
1669
|
+
* Emits a "notify" signal for the property `property_name` on `object`.
|
|
1670
|
+
*
|
|
1671
|
+
* When possible, eg. when signaling a property change from within the class
|
|
1672
|
+
* that registered the property, you should use g_object_notify_by_pspec()
|
|
1673
|
+
* instead.
|
|
1674
|
+
*
|
|
1675
|
+
* Note that emission of the notify signal may be blocked with
|
|
1676
|
+
* g_object_freeze_notify(). In this case, the signal emissions are queued
|
|
1677
|
+
* and will be emitted (in reverse order) when g_object_thaw_notify() is
|
|
1678
|
+
* called.
|
|
1679
|
+
* @param pspec
|
|
1680
|
+
*/
|
|
1681
|
+
vfunc_notify(pspec: GObject.ParamSpec): void;
|
|
1682
|
+
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
|
|
1683
|
+
disconnect(id: number): void;
|
|
1684
|
+
set(properties: { [key: string]: any }): void;
|
|
1685
|
+
block_signal_handler(id: number): any;
|
|
1686
|
+
unblock_signal_handler(id: number): any;
|
|
1687
|
+
stop_emission_by_name(detailedName: string): any;
|
|
1688
|
+
}
|
|
1689
|
+
|
|
1690
|
+
type ClientClass = typeof Client;
|
|
1691
|
+
abstract class ClientPrivate {
|
|
1692
|
+
static $gtype: GObject.GType<ClientPrivate>;
|
|
1693
|
+
|
|
1694
|
+
// Constructors of Fcitx.ClientPrivate
|
|
1695
|
+
|
|
1696
|
+
_init(...args: any[]): void;
|
|
1697
|
+
}
|
|
1698
|
+
|
|
1699
|
+
type ConnectionClass = typeof Connection;
|
|
1700
|
+
abstract class ConnectionPrivate {
|
|
1701
|
+
static $gtype: GObject.GType<ConnectionPrivate>;
|
|
1702
|
+
|
|
1703
|
+
// Constructors of Fcitx.ConnectionPrivate
|
|
1704
|
+
|
|
1705
|
+
_init(...args: any[]): void;
|
|
1706
|
+
}
|
|
1707
|
+
|
|
1708
|
+
/**
|
|
1709
|
+
* A #FcitxIMItem contains some metadata for an input method in fcitx
|
|
1710
|
+
*/
|
|
1711
|
+
class IMItem {
|
|
1712
|
+
static $gtype: GObject.GType<IMItem>;
|
|
1713
|
+
|
|
1714
|
+
// Own fields of Fcitx.IMItem
|
|
1715
|
+
|
|
1716
|
+
name: string;
|
|
1717
|
+
unique_name: string;
|
|
1718
|
+
langcode: string;
|
|
1719
|
+
enable: boolean;
|
|
1720
|
+
|
|
1721
|
+
// Constructors of Fcitx.IMItem
|
|
1722
|
+
|
|
1723
|
+
constructor(
|
|
1724
|
+
properties?: Partial<{
|
|
1725
|
+
name: string;
|
|
1726
|
+
unique_name: string;
|
|
1727
|
+
langcode: string;
|
|
1728
|
+
enable: boolean;
|
|
1729
|
+
}>,
|
|
1730
|
+
);
|
|
1731
|
+
_init(...args: any[]): void;
|
|
1732
|
+
|
|
1733
|
+
static ['new'](name: string, unique_name: string, langcode: string, enable: boolean): IMItem;
|
|
1734
|
+
}
|
|
1735
|
+
|
|
1736
|
+
type InputMethodClass = typeof InputMethod;
|
|
1737
|
+
type KbdClass = typeof Kbd;
|
|
1738
|
+
class LayoutItem {
|
|
1739
|
+
static $gtype: GObject.GType<LayoutItem>;
|
|
1740
|
+
|
|
1741
|
+
// Own fields of Fcitx.LayoutItem
|
|
1742
|
+
|
|
1743
|
+
layout: string;
|
|
1744
|
+
variant: string;
|
|
1745
|
+
name: string;
|
|
1746
|
+
langcode: string;
|
|
1747
|
+
|
|
1748
|
+
// Constructors of Fcitx.LayoutItem
|
|
1749
|
+
|
|
1750
|
+
constructor(
|
|
1751
|
+
properties?: Partial<{
|
|
1752
|
+
layout: string;
|
|
1753
|
+
variant: string;
|
|
1754
|
+
name: string;
|
|
1755
|
+
langcode: string;
|
|
1756
|
+
}>,
|
|
1757
|
+
);
|
|
1758
|
+
_init(...args: any[]): void;
|
|
1759
|
+
}
|
|
1760
|
+
|
|
1761
|
+
class PreeditItem {
|
|
1762
|
+
static $gtype: GObject.GType<PreeditItem>;
|
|
1763
|
+
|
|
1764
|
+
// Own fields of Fcitx.PreeditItem
|
|
1765
|
+
|
|
1766
|
+
string: string;
|
|
1767
|
+
type: number;
|
|
1768
|
+
|
|
1769
|
+
// Constructors of Fcitx.PreeditItem
|
|
1770
|
+
|
|
1771
|
+
constructor(
|
|
1772
|
+
properties?: Partial<{
|
|
1773
|
+
string: string;
|
|
1774
|
+
type: number;
|
|
1775
|
+
}>,
|
|
1776
|
+
);
|
|
1777
|
+
_init(...args: any[]): void;
|
|
1778
|
+
}
|
|
1779
|
+
|
|
1780
|
+
/**
|
|
1781
|
+
* Name of the imported GIR library
|
|
1782
|
+
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
|
|
1783
|
+
*/
|
|
1784
|
+
const __name__: string;
|
|
1785
|
+
/**
|
|
1786
|
+
* Version of the imported GIR library
|
|
1787
|
+
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
|
|
1788
|
+
*/
|
|
1789
|
+
const __version__: string;
|
|
1790
|
+
}
|
|
1791
|
+
|
|
1792
|
+
export default Fcitx;
|
|
1793
|
+
// END
|