@girs/peas-2 2.0.0-3.0.0-beta.13
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 +31 -0
- package/package.json +59 -0
- package/peas-2.cjs +9 -0
- package/peas-2.d.cts +1178 -0
- package/peas-2.d.ts +1183 -0
- package/peas-2.js +8 -0
- package/tsconfig.doc.json +19 -0
package/peas-2.d.cts
ADDED
|
@@ -0,0 +1,1178 @@
|
|
|
1
|
+
|
|
2
|
+
/*
|
|
3
|
+
* Type Definitions for Gjs (https://gjs.guide/)
|
|
4
|
+
*
|
|
5
|
+
* These type definitions are automatically generated, do not edit them by hand.
|
|
6
|
+
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gjs
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Peas-2
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import type Gio from '@girs/gio-2.0';
|
|
13
|
+
import type GObject from '@girs/gobject-2.0';
|
|
14
|
+
import type GLib from '@girs/glib-2.0';
|
|
15
|
+
import type GModule from '@girs/gmodule-2.0';
|
|
16
|
+
import type GIRepository from '@girs/girepository-2.0';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* These identify the various errors that can occur while
|
|
20
|
+
* loading a plugin.
|
|
21
|
+
*/
|
|
22
|
+
export enum PluginInfoError {
|
|
23
|
+
/**
|
|
24
|
+
* The plugin failed to load.
|
|
25
|
+
*/
|
|
26
|
+
LOADING_FAILED,
|
|
27
|
+
/**
|
|
28
|
+
* The plugin's loader was not found.
|
|
29
|
+
*/
|
|
30
|
+
LOADER_NOT_FOUND,
|
|
31
|
+
/**
|
|
32
|
+
* A dependency of the plugin was not found.
|
|
33
|
+
*/
|
|
34
|
+
DEP_NOT_FOUND,
|
|
35
|
+
/**
|
|
36
|
+
* A dependency of the plugin failed to load.
|
|
37
|
+
*/
|
|
38
|
+
DEP_LOADING_FAILED,
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* This function is passed to [method`ExtensionSet`.foreach] and
|
|
42
|
+
* will be called for each extension in `set`.
|
|
43
|
+
* @callback
|
|
44
|
+
* @param set A #PeasExtensionSet.
|
|
45
|
+
* @param info A #PeasPluginInfo.
|
|
46
|
+
* @param extension The extension instance.
|
|
47
|
+
* @param data Optional data passed to the function.
|
|
48
|
+
*/
|
|
49
|
+
export interface ExtensionSetForeachFunc {
|
|
50
|
+
(set: ExtensionSet, info: PluginInfo, extension: GObject.Object, data: any | null): void
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* A #PeasFactoryFunc is a factory function which will instanciate a new
|
|
54
|
+
* extension of a given type. [ctor`GObject`.Object.newv] is such a function.
|
|
55
|
+
*
|
|
56
|
+
* It is used with [method`ObjectModule`.register_extension_factory].
|
|
57
|
+
* @callback
|
|
58
|
+
* @param parameters The parameters.
|
|
59
|
+
* @returns The created object.
|
|
60
|
+
*/
|
|
61
|
+
export interface FactoryFunc {
|
|
62
|
+
(parameters: GObject.Parameter[]): GObject.Object
|
|
63
|
+
}
|
|
64
|
+
export module Engine {
|
|
65
|
+
|
|
66
|
+
// Signal callback interfaces
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Signal callback interface for `load-plugin`
|
|
70
|
+
*/
|
|
71
|
+
export interface LoadPluginSignalCallback {
|
|
72
|
+
($obj: Engine, info: PluginInfo): void
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Signal callback interface for `unload-plugin`
|
|
77
|
+
*/
|
|
78
|
+
export interface UnloadPluginSignalCallback {
|
|
79
|
+
($obj: Engine, info: PluginInfo): void
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
// Constructor properties interface
|
|
84
|
+
|
|
85
|
+
export interface ConstructorProperties extends Gio.ListModel.ConstructorProperties, GObject.Object.ConstructorProperties {
|
|
86
|
+
|
|
87
|
+
// Own constructor properties of Peas-2.Peas.Engine
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* The list of loaded plugins.
|
|
91
|
+
*
|
|
92
|
+
* This will be modified when [method`Engine`.load_plugin] or
|
|
93
|
+
* [method`Engine`.unload_plugin] is called.
|
|
94
|
+
*
|
|
95
|
+
* This can be used with [class`Gio`.Settings] to save the loaded plugins by
|
|
96
|
+
* binding to this property after instantiating the engine by doing:
|
|
97
|
+
*
|
|
98
|
+
* ```c
|
|
99
|
+
* g_settings_bind (gsettings_object,
|
|
100
|
+
* LOADED_PLUGINS_KEY,
|
|
101
|
+
* engine,
|
|
102
|
+
* "loaded-plugins",
|
|
103
|
+
* G_SETTINGS_BIND_DEFAULT);
|
|
104
|
+
* ```
|
|
105
|
+
*
|
|
106
|
+
* Note: notify will not be called when the engine is being destroyed.
|
|
107
|
+
*/
|
|
108
|
+
loaded_plugins?: string[] | null
|
|
109
|
+
/**
|
|
110
|
+
* If non-global plugin loaders should be used.
|
|
111
|
+
*
|
|
112
|
+
* See [ctor`Engine`.new_with_nonglobal_loaders] for more information.
|
|
113
|
+
*/
|
|
114
|
+
nonglobal_loaders?: boolean | null
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export interface Engine extends Gio.ListModel {
|
|
120
|
+
|
|
121
|
+
// Own properties of Peas-2.Peas.Engine
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* The list of loaded plugins.
|
|
125
|
+
*
|
|
126
|
+
* This will be modified when [method`Engine`.load_plugin] or
|
|
127
|
+
* [method`Engine`.unload_plugin] is called.
|
|
128
|
+
*
|
|
129
|
+
* This can be used with [class`Gio`.Settings] to save the loaded plugins by
|
|
130
|
+
* binding to this property after instantiating the engine by doing:
|
|
131
|
+
*
|
|
132
|
+
* ```c
|
|
133
|
+
* g_settings_bind (gsettings_object,
|
|
134
|
+
* LOADED_PLUGINS_KEY,
|
|
135
|
+
* engine,
|
|
136
|
+
* "loaded-plugins",
|
|
137
|
+
* G_SETTINGS_BIND_DEFAULT);
|
|
138
|
+
* ```
|
|
139
|
+
*
|
|
140
|
+
* Note: notify will not be called when the engine is being destroyed.
|
|
141
|
+
*/
|
|
142
|
+
loaded_plugins: string[]
|
|
143
|
+
/**
|
|
144
|
+
* If non-global plugin loaders should be used.
|
|
145
|
+
*
|
|
146
|
+
* See [ctor`Engine`.new_with_nonglobal_loaders] for more information.
|
|
147
|
+
*/
|
|
148
|
+
readonly nonglobal_loaders: boolean
|
|
149
|
+
|
|
150
|
+
// Owm methods of Peas-2.Peas.Engine
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Appends a search path to the list of paths where to look for plugins.
|
|
154
|
+
*
|
|
155
|
+
* A so-called "search path" actually consists of both a
|
|
156
|
+
* module directory (where the shared libraries or language modules
|
|
157
|
+
* lie) and a data directory (where the plugin data is).
|
|
158
|
+
*
|
|
159
|
+
* The plugin will be able to use a correct data dir depending on
|
|
160
|
+
* where it is installed, hence allowing to keep the plugin agnostic
|
|
161
|
+
* when it comes to installation location: the same plugin can be
|
|
162
|
+
* installed either in the system path or in the user's home directory,
|
|
163
|
+
* without taking other special care than using
|
|
164
|
+
* [method`PluginInfo`.get_data_dir] when looking for its data files.
|
|
165
|
+
*
|
|
166
|
+
* If `data_dir` is %NULL, then it is set to the same value as
|
|
167
|
+
* `module_dir`.
|
|
168
|
+
* @param module_dir the plugin module directory.
|
|
169
|
+
* @param data_dir the plugin data directory.
|
|
170
|
+
*/
|
|
171
|
+
add_search_path(module_dir: string | null, data_dir: string | null): void
|
|
172
|
+
/**
|
|
173
|
+
* If the plugin identified by `info` implements the `extension_type,`
|
|
174
|
+
* then this function will return a new instance of this implementation.
|
|
175
|
+
*
|
|
176
|
+
* See [method`Engine`.create_extension] for more information.
|
|
177
|
+
* @param info A loaded #PeasPluginInfo.
|
|
178
|
+
* @param extension_type The implemented extension #GType.
|
|
179
|
+
* @param prop_names an array of property names.
|
|
180
|
+
* @param prop_values an array of property values.
|
|
181
|
+
* @returns a new instance of #GObject which meets the prerequisites of @extension_type, or %NULL.
|
|
182
|
+
*/
|
|
183
|
+
create_extension(info: PluginInfo, extension_type: GObject.GType, prop_names: string[], prop_values: any[]): GObject.Object
|
|
184
|
+
/**
|
|
185
|
+
* Returns the list of the names of all the loaded plugins.
|
|
186
|
+
*
|
|
187
|
+
* If there is no plugin currently loaded, it will return an array containing a
|
|
188
|
+
* single %NULL element.
|
|
189
|
+
*
|
|
190
|
+
* Please note that the returned array is a newly allocated one: you will need
|
|
191
|
+
* to free it using [func`GLib`.strfreev].
|
|
192
|
+
* @returns A newly-allocated %NULL-terminated array of strings.
|
|
193
|
+
*/
|
|
194
|
+
dup_loaded_plugins(): string[]
|
|
195
|
+
/**
|
|
196
|
+
* Enable a loader, enables a loader for plugins.
|
|
197
|
+
*
|
|
198
|
+
* The C plugin loader is always enabled. The other plugin
|
|
199
|
+
* loaders are: lua5.1, python and python3.
|
|
200
|
+
*
|
|
201
|
+
* For instance, the following code will enable Python 2 plugins
|
|
202
|
+
* to be loaded:
|
|
203
|
+
*
|
|
204
|
+
* ```c
|
|
205
|
+
* peas_engine_enable_loader (engine, "python");
|
|
206
|
+
* ```
|
|
207
|
+
*
|
|
208
|
+
* Note: plugin loaders used to be shared across `PeasEngine`s so enabling
|
|
209
|
+
* a loader on one #PeasEngine would enable it on all #PeasEngines.
|
|
210
|
+
* This behavior has been kept to avoid breaking applications,
|
|
211
|
+
* however a warning has been added to help applications transition.
|
|
212
|
+
* @param loader_name The name of the loader to enable.
|
|
213
|
+
*/
|
|
214
|
+
enable_loader(loader_name: string | null): void
|
|
215
|
+
/**
|
|
216
|
+
* Triggers garbage collection on all the loaders currently owned by the
|
|
217
|
+
* #PeasEngine.
|
|
218
|
+
*
|
|
219
|
+
* This can be used to force the loaders to destroy
|
|
220
|
+
* managed objects that still hold references to objects that are about to
|
|
221
|
+
* disappear.
|
|
222
|
+
*/
|
|
223
|
+
garbage_collect(): void
|
|
224
|
+
/**
|
|
225
|
+
* Gets the [class`PluginInfo]` corresponding with `plugin_name,`
|
|
226
|
+
* or %NULL if `plugin_name` was not found.
|
|
227
|
+
* @param plugin_name A plugin name.
|
|
228
|
+
* @returns the #PeasPluginInfo corresponding with a given plugin module name.
|
|
229
|
+
*/
|
|
230
|
+
get_plugin_info(plugin_name: string | null): PluginInfo
|
|
231
|
+
/**
|
|
232
|
+
* Loads the plugin corresponding to `info` if it's not currently loaded.
|
|
233
|
+
*
|
|
234
|
+
* Emits the [signal`Engine:`:load-plugin] signal; loading the plugin
|
|
235
|
+
* actually occurs in the default signal handler.
|
|
236
|
+
* @param info A #PeasPluginInfo.
|
|
237
|
+
* @returns whether the plugin has been successfully loaded.
|
|
238
|
+
*/
|
|
239
|
+
load_plugin(info: PluginInfo): boolean
|
|
240
|
+
/**
|
|
241
|
+
* Returns if `info` provides an extension for `extension_type`.
|
|
242
|
+
*
|
|
243
|
+
* If the `info` is not loaded than %FALSE will always be returned.
|
|
244
|
+
* @param info A #PeasPluginInfo.
|
|
245
|
+
* @param extension_type The extension #GType.
|
|
246
|
+
* @returns if @info provides an extension for @extension_type.
|
|
247
|
+
*/
|
|
248
|
+
provides_extension(info: PluginInfo, extension_type: GObject.GType): boolean
|
|
249
|
+
/**
|
|
250
|
+
* Rescan all the registered directories to find new or updated plugins.
|
|
251
|
+
*
|
|
252
|
+
* Calling this function will make the newly installed plugin infos
|
|
253
|
+
* be loaded by the engine, so the new plugins can be used without
|
|
254
|
+
* restarting the application.
|
|
255
|
+
*/
|
|
256
|
+
rescan_plugins(): void
|
|
257
|
+
/**
|
|
258
|
+
* Sets the list of loaded plugins for `engine`.
|
|
259
|
+
*
|
|
260
|
+
* When this function is called, the #PeasEngine will load all the plugins whose
|
|
261
|
+
* names are in `plugin_names,` and ensures all other active plugins are
|
|
262
|
+
* unloaded.
|
|
263
|
+
*
|
|
264
|
+
* If `plugin_names` is %NULL, all plugins will be unloaded.
|
|
265
|
+
* @param plugin_names A %NULL-terminated array of plugin names, or %NULL.
|
|
266
|
+
*/
|
|
267
|
+
set_loaded_plugins(plugin_names: string[] | null): void
|
|
268
|
+
/**
|
|
269
|
+
* Unloads the plugin corresponding to `info`.
|
|
270
|
+
*
|
|
271
|
+
* Emits the [signal`Engine:`:unload-plugin] signal; unloading the plugin
|
|
272
|
+
* actually occurs in the default signal handler.
|
|
273
|
+
* @param info A #PeasPluginInfo.
|
|
274
|
+
* @returns whether the plugin has been successfully unloaded.
|
|
275
|
+
*/
|
|
276
|
+
unload_plugin(info: PluginInfo): boolean
|
|
277
|
+
|
|
278
|
+
// Own signals of Peas-2.Peas.Engine
|
|
279
|
+
|
|
280
|
+
connect(sigName: "load-plugin", callback: Engine.LoadPluginSignalCallback): number
|
|
281
|
+
connect_after(sigName: "load-plugin", callback: Engine.LoadPluginSignalCallback): number
|
|
282
|
+
emit(sigName: "load-plugin", info: PluginInfo, ...args: any[]): void
|
|
283
|
+
connect(sigName: "unload-plugin", callback: Engine.UnloadPluginSignalCallback): number
|
|
284
|
+
connect_after(sigName: "unload-plugin", callback: Engine.UnloadPluginSignalCallback): number
|
|
285
|
+
emit(sigName: "unload-plugin", info: PluginInfo, ...args: any[]): void
|
|
286
|
+
|
|
287
|
+
// Class property signals of Peas-2.Peas.Engine
|
|
288
|
+
|
|
289
|
+
connect(sigName: "notify::loaded-plugins", callback: (($obj: Engine, pspec: GObject.ParamSpec) => void)): number
|
|
290
|
+
connect_after(sigName: "notify::loaded-plugins", callback: (($obj: Engine, pspec: GObject.ParamSpec) => void)): number
|
|
291
|
+
emit(sigName: "notify::loaded-plugins", ...args: any[]): void
|
|
292
|
+
connect(sigName: "notify::nonglobal-loaders", callback: (($obj: Engine, pspec: GObject.ParamSpec) => void)): number
|
|
293
|
+
connect_after(sigName: "notify::nonglobal-loaders", callback: (($obj: Engine, pspec: GObject.ParamSpec) => void)): number
|
|
294
|
+
emit(sigName: "notify::nonglobal-loaders", ...args: any[]): void
|
|
295
|
+
connect(sigName: string, callback: (...args: any[]) => void): number
|
|
296
|
+
connect_after(sigName: string, callback: (...args: any[]) => void): number
|
|
297
|
+
emit(sigName: string, ...args: any[]): void
|
|
298
|
+
disconnect(id: number): void
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* The #PeasEngine is the object which manages the plugins.
|
|
303
|
+
*
|
|
304
|
+
* Its role is twofold:
|
|
305
|
+
*
|
|
306
|
+
* - it will fetch all the information about the available plugins
|
|
307
|
+
* from all the registered plugin directories;
|
|
308
|
+
* - it will provide you an API to load, control and unload your
|
|
309
|
+
* plugins and their extensions from within your application.
|
|
310
|
+
* @class
|
|
311
|
+
*/
|
|
312
|
+
export class Engine extends GObject.Object {
|
|
313
|
+
|
|
314
|
+
// Own properties of Peas-2.Peas.Engine
|
|
315
|
+
|
|
316
|
+
static name: string
|
|
317
|
+
static $gtype: GObject.GType<Engine>
|
|
318
|
+
|
|
319
|
+
// Constructors of Peas-2.Peas.Engine
|
|
320
|
+
|
|
321
|
+
constructor(config?: Engine.ConstructorProperties)
|
|
322
|
+
/**
|
|
323
|
+
* Return a new instance of #PeasEngine.
|
|
324
|
+
*
|
|
325
|
+
* If no default #PeasEngine has been instantiated yet,
|
|
326
|
+
* the first call of this function will set the default
|
|
327
|
+
* engine as the new instance of #PeasEngine.
|
|
328
|
+
* @constructor
|
|
329
|
+
* @returns a new instance of #PeasEngine.
|
|
330
|
+
*/
|
|
331
|
+
constructor()
|
|
332
|
+
/**
|
|
333
|
+
* Return a new instance of #PeasEngine.
|
|
334
|
+
*
|
|
335
|
+
* If no default #PeasEngine has been instantiated yet,
|
|
336
|
+
* the first call of this function will set the default
|
|
337
|
+
* engine as the new instance of #PeasEngine.
|
|
338
|
+
* @constructor
|
|
339
|
+
* @returns a new instance of #PeasEngine.
|
|
340
|
+
*/
|
|
341
|
+
static new(): Engine
|
|
342
|
+
/**
|
|
343
|
+
* Return a new instance of #PeasEngine which will use non-global
|
|
344
|
+
* plugin loaders instead of the default global ones.
|
|
345
|
+
*
|
|
346
|
+
* This allows multiple threads to each have a #PeasEngine and be used without
|
|
347
|
+
* internal locking.
|
|
348
|
+
*
|
|
349
|
+
* Note: due to CPython's GIL the python and python3
|
|
350
|
+
* plugin loaders are always global.
|
|
351
|
+
* @constructor
|
|
352
|
+
* @returns a new instance of #PeasEngine that uses non-global loaders.
|
|
353
|
+
*/
|
|
354
|
+
static new_with_nonglobal_loaders(): Engine
|
|
355
|
+
_init(config?: Engine.ConstructorProperties): void
|
|
356
|
+
/**
|
|
357
|
+
* Return the existing instance of #PeasEngine or a subclass of it.
|
|
358
|
+
*
|
|
359
|
+
* If no #PeasEngine subclass has been instantiated yet, the first call
|
|
360
|
+
* of this function will return a new instance of #PeasEngine.
|
|
361
|
+
*
|
|
362
|
+
* Note: this function should never be used when multiple threads are
|
|
363
|
+
* using libpeas API as it is not thread-safe.
|
|
364
|
+
* @returns the existing instance of #PeasEngine.
|
|
365
|
+
*/
|
|
366
|
+
static get_default(): Engine
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
export module ExtensionBase {
|
|
370
|
+
|
|
371
|
+
// Constructor properties interface
|
|
372
|
+
|
|
373
|
+
export interface ConstructorProperties extends GObject.Object.ConstructorProperties {
|
|
374
|
+
|
|
375
|
+
// Own constructor properties of Peas-2.Peas.ExtensionBase
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* The [class`PluginInfo]` related to the current plugin.
|
|
379
|
+
*/
|
|
380
|
+
plugin_info?: PluginInfo | null
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
export interface ExtensionBase {
|
|
386
|
+
|
|
387
|
+
// Own properties of Peas-2.Peas.ExtensionBase
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* The The full path of the directory where the plugin
|
|
391
|
+
* should look for its data files.
|
|
392
|
+
*
|
|
393
|
+
* Note: This is the same path as that returned by
|
|
394
|
+
* [method`PluginInfo`.get_data_dir].
|
|
395
|
+
*/
|
|
396
|
+
readonly data_dir: string | null
|
|
397
|
+
/**
|
|
398
|
+
* The [class`PluginInfo]` related to the current plugin.
|
|
399
|
+
*/
|
|
400
|
+
readonly plugin_info: PluginInfo
|
|
401
|
+
|
|
402
|
+
// Own fields of Peas-2.Peas.ExtensionBase
|
|
403
|
+
|
|
404
|
+
parent_instance: GObject.Object
|
|
405
|
+
|
|
406
|
+
// Owm methods of Peas-2.Peas.ExtensionBase
|
|
407
|
+
|
|
408
|
+
/**
|
|
409
|
+
* Get the path of the directory where the plugin should look for
|
|
410
|
+
* its data files.
|
|
411
|
+
* @returns A newly allocated string with the path of the directory where the plugin should look for its data files
|
|
412
|
+
*/
|
|
413
|
+
get_data_dir(): string | null
|
|
414
|
+
/**
|
|
415
|
+
* Get information relative to `extbase`.
|
|
416
|
+
* @returns the [class@PluginInfo] relative to the #PeasExtensionBase.
|
|
417
|
+
*/
|
|
418
|
+
get_plugin_info(): PluginInfo
|
|
419
|
+
|
|
420
|
+
// Class property signals of Peas-2.Peas.ExtensionBase
|
|
421
|
+
|
|
422
|
+
connect(sigName: "notify::data-dir", callback: (($obj: ExtensionBase, pspec: GObject.ParamSpec) => void)): number
|
|
423
|
+
connect_after(sigName: "notify::data-dir", callback: (($obj: ExtensionBase, pspec: GObject.ParamSpec) => void)): number
|
|
424
|
+
emit(sigName: "notify::data-dir", ...args: any[]): void
|
|
425
|
+
connect(sigName: "notify::plugin-info", callback: (($obj: ExtensionBase, pspec: GObject.ParamSpec) => void)): number
|
|
426
|
+
connect_after(sigName: "notify::plugin-info", callback: (($obj: ExtensionBase, pspec: GObject.ParamSpec) => void)): number
|
|
427
|
+
emit(sigName: "notify::plugin-info", ...args: any[]): void
|
|
428
|
+
connect(sigName: string, callback: (...args: any[]) => void): number
|
|
429
|
+
connect_after(sigName: string, callback: (...args: any[]) => void): number
|
|
430
|
+
emit(sigName: string, ...args: any[]): void
|
|
431
|
+
disconnect(id: number): void
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
/**
|
|
435
|
+
* Base class for C extensions.
|
|
436
|
+
*
|
|
437
|
+
* #PeasExtensionBase can optionally be used as a base class for the extensions
|
|
438
|
+
* of your plugin. By inheriting from it, you will make your extension able to
|
|
439
|
+
* access the related [class`PluginInfo]`, and especially the location where all
|
|
440
|
+
* the data of your plugin lives.
|
|
441
|
+
*
|
|
442
|
+
* Non-C extensions will usually not inherit from this class: Python
|
|
443
|
+
* plugins automatically get a "plugin_info" attribute that serves
|
|
444
|
+
* the same purpose.
|
|
445
|
+
* @class
|
|
446
|
+
*/
|
|
447
|
+
export class ExtensionBase extends GObject.Object {
|
|
448
|
+
|
|
449
|
+
// Own properties of Peas-2.Peas.ExtensionBase
|
|
450
|
+
|
|
451
|
+
static name: string
|
|
452
|
+
static $gtype: GObject.GType<ExtensionBase>
|
|
453
|
+
|
|
454
|
+
// Constructors of Peas-2.Peas.ExtensionBase
|
|
455
|
+
|
|
456
|
+
constructor(config?: ExtensionBase.ConstructorProperties)
|
|
457
|
+
_init(config?: ExtensionBase.ConstructorProperties): void
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
export module ExtensionSet {
|
|
461
|
+
|
|
462
|
+
// Signal callback interfaces
|
|
463
|
+
|
|
464
|
+
/**
|
|
465
|
+
* Signal callback interface for `extension-added`
|
|
466
|
+
*/
|
|
467
|
+
export interface ExtensionAddedSignalCallback {
|
|
468
|
+
($obj: ExtensionSet, info: PluginInfo, extension: GObject.Object): void
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
/**
|
|
472
|
+
* Signal callback interface for `extension-removed`
|
|
473
|
+
*/
|
|
474
|
+
export interface ExtensionRemovedSignalCallback {
|
|
475
|
+
($obj: ExtensionSet, info: PluginInfo, extension: GObject.Object): void
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
|
|
479
|
+
// Constructor properties interface
|
|
480
|
+
|
|
481
|
+
export interface ConstructorProperties extends Gio.ListModel.ConstructorProperties, GObject.Object.ConstructorProperties {
|
|
482
|
+
|
|
483
|
+
// Own constructor properties of Peas-2.Peas.ExtensionSet
|
|
484
|
+
|
|
485
|
+
construct_properties?: any | null
|
|
486
|
+
engine?: Engine | null
|
|
487
|
+
extension_type?: GObject.GType | null
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
export interface ExtensionSet extends Gio.ListModel {
|
|
493
|
+
|
|
494
|
+
// Own properties of Peas-2.Peas.ExtensionSet
|
|
495
|
+
|
|
496
|
+
readonly construct_properties: any
|
|
497
|
+
readonly engine: Engine
|
|
498
|
+
readonly extension_type: GObject.GType
|
|
499
|
+
|
|
500
|
+
// Owm methods of Peas-2.Peas.ExtensionSet
|
|
501
|
+
|
|
502
|
+
/**
|
|
503
|
+
* Calls `func` for each [class`GObject`.Object].
|
|
504
|
+
* @param func A function call for each extension.
|
|
505
|
+
*/
|
|
506
|
+
foreach(func: ExtensionSetForeachFunc): void
|
|
507
|
+
/**
|
|
508
|
+
* Returns the [class`GObject`.Object] object corresponding to `info`.
|
|
509
|
+
*
|
|
510
|
+
* If the plugin doesn't provide such an extension, it returns %NULL.
|
|
511
|
+
* @param info a #PeasPluginInfo
|
|
512
|
+
* @returns a reference to a #GObject
|
|
513
|
+
*/
|
|
514
|
+
get_extension(info: PluginInfo): GObject.Object | null
|
|
515
|
+
|
|
516
|
+
// Own signals of Peas-2.Peas.ExtensionSet
|
|
517
|
+
|
|
518
|
+
connect(sigName: "extension-added", callback: ExtensionSet.ExtensionAddedSignalCallback): number
|
|
519
|
+
connect_after(sigName: "extension-added", callback: ExtensionSet.ExtensionAddedSignalCallback): number
|
|
520
|
+
emit(sigName: "extension-added", info: PluginInfo, extension: GObject.Object, ...args: any[]): void
|
|
521
|
+
connect(sigName: "extension-removed", callback: ExtensionSet.ExtensionRemovedSignalCallback): number
|
|
522
|
+
connect_after(sigName: "extension-removed", callback: ExtensionSet.ExtensionRemovedSignalCallback): number
|
|
523
|
+
emit(sigName: "extension-removed", info: PluginInfo, extension: GObject.Object, ...args: any[]): void
|
|
524
|
+
|
|
525
|
+
// Class property signals of Peas-2.Peas.ExtensionSet
|
|
526
|
+
|
|
527
|
+
connect(sigName: "notify::construct-properties", callback: (($obj: ExtensionSet, pspec: GObject.ParamSpec) => void)): number
|
|
528
|
+
connect_after(sigName: "notify::construct-properties", callback: (($obj: ExtensionSet, pspec: GObject.ParamSpec) => void)): number
|
|
529
|
+
emit(sigName: "notify::construct-properties", ...args: any[]): void
|
|
530
|
+
connect(sigName: "notify::engine", callback: (($obj: ExtensionSet, pspec: GObject.ParamSpec) => void)): number
|
|
531
|
+
connect_after(sigName: "notify::engine", callback: (($obj: ExtensionSet, pspec: GObject.ParamSpec) => void)): number
|
|
532
|
+
emit(sigName: "notify::engine", ...args: any[]): void
|
|
533
|
+
connect(sigName: "notify::extension-type", callback: (($obj: ExtensionSet, pspec: GObject.ParamSpec) => void)): number
|
|
534
|
+
connect_after(sigName: "notify::extension-type", callback: (($obj: ExtensionSet, pspec: GObject.ParamSpec) => void)): number
|
|
535
|
+
emit(sigName: "notify::extension-type", ...args: any[]): void
|
|
536
|
+
connect(sigName: string, callback: (...args: any[]) => void): number
|
|
537
|
+
connect_after(sigName: string, callback: (...args: any[]) => void): number
|
|
538
|
+
emit(sigName: string, ...args: any[]): void
|
|
539
|
+
disconnect(id: number): void
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
/**
|
|
543
|
+
* Proxy for a set of extensions of the same type.
|
|
544
|
+
*
|
|
545
|
+
* A #PeasExtensionSet is an object which proxies method calls to a set
|
|
546
|
+
* of actual extensions. The application writer will use these objects
|
|
547
|
+
* in order to call methods on several instances of an actual extension
|
|
548
|
+
* exported by all the currently loaded plugins.
|
|
549
|
+
*
|
|
550
|
+
* #PeasExtensionSet will automatically track loading and unloading of
|
|
551
|
+
* the plugins, and signal appearance and disappearance of new
|
|
552
|
+
* extension instances. You should connect to those signals if you
|
|
553
|
+
* wish to call specific methods on loading or unloading time.
|
|
554
|
+
*
|
|
555
|
+
* Here is the code for a typical setup of #PeasExtensionSet with
|
|
556
|
+
* ExampleActivatable as the watched extension point, and GtkWindow
|
|
557
|
+
* instances as the target objects:
|
|
558
|
+
*
|
|
559
|
+
* ```c
|
|
560
|
+
* static void
|
|
561
|
+
* on_extension_added (PeasExtensionSet *set,
|
|
562
|
+
* PeasPluginInfo *info,
|
|
563
|
+
* ExampleActivatable *activatable)
|
|
564
|
+
* {
|
|
565
|
+
* example_activatable_activate (activatable);
|
|
566
|
+
* }
|
|
567
|
+
*
|
|
568
|
+
* static void
|
|
569
|
+
* on_extension_removed (PeasExtensionSet *set,
|
|
570
|
+
* PeasPluginInfo *info,
|
|
571
|
+
* ExampleActivatable *activatable)
|
|
572
|
+
* {
|
|
573
|
+
* example_activatable_deactivate (activatable);
|
|
574
|
+
* }
|
|
575
|
+
*
|
|
576
|
+
* PeasExtensionSet *
|
|
577
|
+
* setup_extension_set (PeasEngine *engine,
|
|
578
|
+
* GtkWindow *window)
|
|
579
|
+
* {
|
|
580
|
+
* PeasExtensionSet *set;
|
|
581
|
+
*
|
|
582
|
+
* set = peas_extension_set_new (engine, EXAMPLE_TYPE_ACTIVATABLE,
|
|
583
|
+
* "object", window, NULL);
|
|
584
|
+
* peas_extension_set_foreach (set,
|
|
585
|
+
* (PeasExtensionSetForeachFunc) on_extension_added,
|
|
586
|
+
* NULL);
|
|
587
|
+
* g_signal_connect (set, "extension-added",
|
|
588
|
+
* G_CALLBACK (on_extension_added), NULL);
|
|
589
|
+
* g_signal_connect (set, "extension-removed",
|
|
590
|
+
* G_CALLBACK (on_extension_removed), NULL);
|
|
591
|
+
* return set;
|
|
592
|
+
* }
|
|
593
|
+
* ```
|
|
594
|
+
* @class
|
|
595
|
+
*/
|
|
596
|
+
export class ExtensionSet extends GObject.Object {
|
|
597
|
+
|
|
598
|
+
// Own properties of Peas-2.Peas.ExtensionSet
|
|
599
|
+
|
|
600
|
+
static name: string
|
|
601
|
+
static $gtype: GObject.GType<ExtensionSet>
|
|
602
|
+
|
|
603
|
+
// Constructors of Peas-2.Peas.ExtensionSet
|
|
604
|
+
|
|
605
|
+
constructor(config?: ExtensionSet.ConstructorProperties)
|
|
606
|
+
/**
|
|
607
|
+
* Create a new #PeasExtensionSet for the `exten_type` extension type.
|
|
608
|
+
*
|
|
609
|
+
* If `engine` is %NULL, then the default engine will be used.
|
|
610
|
+
*
|
|
611
|
+
* See [ctor`ExtensionSet`.new] for more information.
|
|
612
|
+
* @constructor
|
|
613
|
+
* @param engine A #PeasEngine, or %NULL.
|
|
614
|
+
* @param exten_type the extension #GType.
|
|
615
|
+
* @param prop_names an array of property names.
|
|
616
|
+
* @param prop_values an array of property values.
|
|
617
|
+
* @returns a new instance of #PeasExtensionSet.
|
|
618
|
+
*/
|
|
619
|
+
constructor(engine: Engine | null, exten_type: GObject.GType, prop_names: string[], prop_values: any[])
|
|
620
|
+
/**
|
|
621
|
+
* Create a new #PeasExtensionSet for the `exten_type` extension type.
|
|
622
|
+
*
|
|
623
|
+
* If `engine` is %NULL, then the default engine will be used.
|
|
624
|
+
*
|
|
625
|
+
* See [ctor`ExtensionSet`.new] for more information.
|
|
626
|
+
* @constructor
|
|
627
|
+
* @param engine A #PeasEngine, or %NULL.
|
|
628
|
+
* @param exten_type the extension #GType.
|
|
629
|
+
* @param prop_names an array of property names.
|
|
630
|
+
* @param prop_values an array of property values.
|
|
631
|
+
* @returns a new instance of #PeasExtensionSet.
|
|
632
|
+
*/
|
|
633
|
+
static new(engine: Engine | null, exten_type: GObject.GType, prop_names: string[], prop_values: any[]): ExtensionSet
|
|
634
|
+
_init(config?: ExtensionSet.ConstructorProperties): void
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
export module ObjectModule {
|
|
638
|
+
|
|
639
|
+
// Constructor properties interface
|
|
640
|
+
|
|
641
|
+
export interface ConstructorProperties extends GObject.TypePlugin.ConstructorProperties, GObject.TypeModule.ConstructorProperties {
|
|
642
|
+
|
|
643
|
+
// Own constructor properties of Peas-2.Peas.ObjectModule
|
|
644
|
+
|
|
645
|
+
/**
|
|
646
|
+
* Whether the module is loaded with local linkage, i.e. #G_MODULE_BIND_LOCAL.
|
|
647
|
+
*/
|
|
648
|
+
local_linkage?: boolean | null
|
|
649
|
+
module_name?: string | null
|
|
650
|
+
path?: string | null
|
|
651
|
+
resident?: boolean | null
|
|
652
|
+
symbol?: string | null
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
export interface ObjectModule extends GObject.TypePlugin {
|
|
658
|
+
|
|
659
|
+
// Own properties of Peas-2.Peas.ObjectModule
|
|
660
|
+
|
|
661
|
+
/**
|
|
662
|
+
* Whether the module is loaded with local linkage, i.e. #G_MODULE_BIND_LOCAL.
|
|
663
|
+
*/
|
|
664
|
+
readonly local_linkage: boolean
|
|
665
|
+
readonly module_name: string | null
|
|
666
|
+
readonly path: string | null
|
|
667
|
+
readonly resident: boolean
|
|
668
|
+
readonly symbol: string | null
|
|
669
|
+
|
|
670
|
+
// Own fields of Peas-2.Peas.ObjectModule
|
|
671
|
+
|
|
672
|
+
parent_instance: GObject.TypeModule & GObject.Object
|
|
673
|
+
|
|
674
|
+
// Owm methods of Peas-2.Peas.ObjectModule
|
|
675
|
+
|
|
676
|
+
/**
|
|
677
|
+
* Register an implementation for an extension type through a factory
|
|
678
|
+
* function `factory_func` which will instantiate the extension when
|
|
679
|
+
* requested.
|
|
680
|
+
*
|
|
681
|
+
* This method is primarily meant to be used by native bindings (like gtkmm),
|
|
682
|
+
* creating native types which cannot be instantiated correctly using
|
|
683
|
+
* [ctor`GObject`.Object.new]. For other uses, you will usually prefer relying on
|
|
684
|
+
* peas_object_module_register_extension_type().
|
|
685
|
+
* @param exten_type The #GType of the extension you implement.
|
|
686
|
+
* @param factory_func The #PeasFactoryFunc that will create the `exten_type` instance when requested.
|
|
687
|
+
*/
|
|
688
|
+
register_extension_factory(exten_type: GObject.GType, factory_func: FactoryFunc): void
|
|
689
|
+
/**
|
|
690
|
+
* Register `impl_type` as an extension which implements `extension_type`.
|
|
691
|
+
* @param exten_type The #GType of the extension you implement.
|
|
692
|
+
* @param impl_type The #GType of your implementation of `exten_type`.
|
|
693
|
+
*/
|
|
694
|
+
register_extension_type(exten_type: GObject.GType, impl_type: GObject.GType): void
|
|
695
|
+
|
|
696
|
+
// Conflicting methods
|
|
697
|
+
|
|
698
|
+
/**
|
|
699
|
+
* Calls the `use_plugin` function from the #GTypePluginClass of
|
|
700
|
+
* `plugin`. There should be no need to use this function outside of
|
|
701
|
+
* the GObject type system itself.
|
|
702
|
+
*/
|
|
703
|
+
use(): void
|
|
704
|
+
/**
|
|
705
|
+
* Increases the use count of a #GTypeModule by one. If the
|
|
706
|
+
* use count was zero before, the plugin will be loaded.
|
|
707
|
+
* If loading the plugin fails, the use count is reset to
|
|
708
|
+
* its prior value.
|
|
709
|
+
* @returns %FALSE if the plugin needed to be loaded and loading the plugin failed.
|
|
710
|
+
*/
|
|
711
|
+
use(): boolean
|
|
712
|
+
|
|
713
|
+
// Overloads of use
|
|
714
|
+
|
|
715
|
+
/**
|
|
716
|
+
* Calls the `use_plugin` function from the #GTypePluginClass of
|
|
717
|
+
* `plugin`. There should be no need to use this function outside of
|
|
718
|
+
* the GObject type system itself.
|
|
719
|
+
*/
|
|
720
|
+
use(): void
|
|
721
|
+
|
|
722
|
+
// Class property signals of Peas-2.Peas.ObjectModule
|
|
723
|
+
|
|
724
|
+
connect(sigName: "notify::local-linkage", callback: (($obj: ObjectModule, pspec: GObject.ParamSpec) => void)): number
|
|
725
|
+
connect_after(sigName: "notify::local-linkage", callback: (($obj: ObjectModule, pspec: GObject.ParamSpec) => void)): number
|
|
726
|
+
emit(sigName: "notify::local-linkage", ...args: any[]): void
|
|
727
|
+
connect(sigName: "notify::module-name", callback: (($obj: ObjectModule, pspec: GObject.ParamSpec) => void)): number
|
|
728
|
+
connect_after(sigName: "notify::module-name", callback: (($obj: ObjectModule, pspec: GObject.ParamSpec) => void)): number
|
|
729
|
+
emit(sigName: "notify::module-name", ...args: any[]): void
|
|
730
|
+
connect(sigName: "notify::path", callback: (($obj: ObjectModule, pspec: GObject.ParamSpec) => void)): number
|
|
731
|
+
connect_after(sigName: "notify::path", callback: (($obj: ObjectModule, pspec: GObject.ParamSpec) => void)): number
|
|
732
|
+
emit(sigName: "notify::path", ...args: any[]): void
|
|
733
|
+
connect(sigName: "notify::resident", callback: (($obj: ObjectModule, pspec: GObject.ParamSpec) => void)): number
|
|
734
|
+
connect_after(sigName: "notify::resident", callback: (($obj: ObjectModule, pspec: GObject.ParamSpec) => void)): number
|
|
735
|
+
emit(sigName: "notify::resident", ...args: any[]): void
|
|
736
|
+
connect(sigName: "notify::symbol", callback: (($obj: ObjectModule, pspec: GObject.ParamSpec) => void)): number
|
|
737
|
+
connect_after(sigName: "notify::symbol", callback: (($obj: ObjectModule, pspec: GObject.ParamSpec) => void)): number
|
|
738
|
+
emit(sigName: "notify::symbol", ...args: any[]): void
|
|
739
|
+
connect(sigName: string, callback: (...args: any[]) => void): number
|
|
740
|
+
connect_after(sigName: string, callback: (...args: any[]) => void): number
|
|
741
|
+
emit(sigName: string, ...args: any[]): void
|
|
742
|
+
disconnect(id: number): void
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
/**
|
|
746
|
+
* Type module which allows extension registration.
|
|
747
|
+
*
|
|
748
|
+
* #PeasObjectModule is a subclass of [class`GObject`.TypeModule] which allows
|
|
749
|
+
* registration of extensions. It will be used by C extensions implementors to
|
|
750
|
+
* register extension implementations from within the peas_register_types module
|
|
751
|
+
* function.
|
|
752
|
+
* @class
|
|
753
|
+
*/
|
|
754
|
+
export class ObjectModule extends GObject.TypeModule {
|
|
755
|
+
|
|
756
|
+
// Own properties of Peas-2.Peas.ObjectModule
|
|
757
|
+
|
|
758
|
+
static name: string
|
|
759
|
+
static $gtype: GObject.GType<ObjectModule>
|
|
760
|
+
|
|
761
|
+
// Constructors of Peas-2.Peas.ObjectModule
|
|
762
|
+
|
|
763
|
+
constructor(config?: ObjectModule.ConstructorProperties)
|
|
764
|
+
_init(config?: ObjectModule.ConstructorProperties): void
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
export module PluginInfo {
|
|
768
|
+
|
|
769
|
+
// Constructor properties interface
|
|
770
|
+
|
|
771
|
+
export interface ConstructorProperties extends GObject.Object.ConstructorProperties {
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
export interface PluginInfo {
|
|
777
|
+
|
|
778
|
+
// Own properties of Peas-2.Peas.PluginInfo
|
|
779
|
+
|
|
780
|
+
readonly authors: string[]
|
|
781
|
+
readonly builtin: boolean
|
|
782
|
+
readonly copyright: string | null
|
|
783
|
+
readonly dependencies: string[]
|
|
784
|
+
readonly description: string | null
|
|
785
|
+
readonly help_uri: string | null
|
|
786
|
+
readonly hidden: boolean
|
|
787
|
+
readonly icon_name: string | null
|
|
788
|
+
readonly loaded: boolean
|
|
789
|
+
readonly module_dir: string | null
|
|
790
|
+
readonly module_name: string | null
|
|
791
|
+
readonly name: string | null
|
|
792
|
+
readonly version: string | null
|
|
793
|
+
readonly website: string | null
|
|
794
|
+
|
|
795
|
+
// Owm methods of Peas-2.Peas.PluginInfo
|
|
796
|
+
|
|
797
|
+
/**
|
|
798
|
+
* Gets a %NULL-terminated array of strings with the authors of the plugin.
|
|
799
|
+
*
|
|
800
|
+
* The relevant key in the plugin info file is "Authors".
|
|
801
|
+
* @returns the plugin's author list.
|
|
802
|
+
*/
|
|
803
|
+
get_authors(): string[]
|
|
804
|
+
/**
|
|
805
|
+
* Gets the copyright of the plugin.
|
|
806
|
+
*
|
|
807
|
+
* The relevant key in the plugin info file is "Copyright".
|
|
808
|
+
* @returns the plugin's copyright information.
|
|
809
|
+
*/
|
|
810
|
+
get_copyright(): string | null
|
|
811
|
+
/**
|
|
812
|
+
* Gets the data dir of the plugin.
|
|
813
|
+
*
|
|
814
|
+
* The module data directory is the directory where a plugin should find its
|
|
815
|
+
* runtime data. This is not a value read from the [struct`GLib`.KeyFile], but
|
|
816
|
+
* rather a value provided by the [class`Engine]`, depending on where the plugin
|
|
817
|
+
* file was found.
|
|
818
|
+
* @returns the plugin's data dir.
|
|
819
|
+
*/
|
|
820
|
+
get_data_dir(): string | null
|
|
821
|
+
/**
|
|
822
|
+
* Gets the dependencies of the plugin.
|
|
823
|
+
*
|
|
824
|
+
* The [class`Engine]` will always ensure that the dependencies of a plugin are
|
|
825
|
+
* loaded when the said plugin is loaded. It means that dependencies are
|
|
826
|
+
* loaded before the plugin, and unloaded after it. Circular dependencies of
|
|
827
|
+
* plugins lead to undefined loading order.
|
|
828
|
+
*
|
|
829
|
+
* The relevant key in the plugin info file is "Depends".
|
|
830
|
+
* @returns the plugin's dependencies.
|
|
831
|
+
*/
|
|
832
|
+
get_dependencies(): string[]
|
|
833
|
+
/**
|
|
834
|
+
* Gets the description of the plugin.
|
|
835
|
+
*
|
|
836
|
+
* The description of the plugin should be a string presenting the purpose of
|
|
837
|
+
* the plugin. It will typically be presented in a plugin's about box.
|
|
838
|
+
*
|
|
839
|
+
* The relevant key in the plugin info file is "Description".
|
|
840
|
+
* @returns the plugin's description.
|
|
841
|
+
*/
|
|
842
|
+
get_description(): string | null
|
|
843
|
+
/**
|
|
844
|
+
* Gets external data specified for the plugin.
|
|
845
|
+
*
|
|
846
|
+
* External data is specified in the plugin info file prefixed with X-. For
|
|
847
|
+
* example, if a key/value pair `X-Peas=1` is specified in the key file, you
|
|
848
|
+
* can use "Peas" for `key` to retrieve the value "1".
|
|
849
|
+
*
|
|
850
|
+
* Note: that you can omit the X- prefix when retrieving the value,
|
|
851
|
+
* but not when specifying the value in the file.
|
|
852
|
+
* @param key The key to lookup.
|
|
853
|
+
* @returns the external data, or %NULL if the external data could not be found.
|
|
854
|
+
*/
|
|
855
|
+
get_external_data(key: string | null): string | null
|
|
856
|
+
/**
|
|
857
|
+
* Gets the help URI of the plugin.
|
|
858
|
+
*
|
|
859
|
+
* The Help URI of a plugin will typically be presented by the plugin manager
|
|
860
|
+
* as a "Help" button linking to the URI. It can either be a HTTP URL on some
|
|
861
|
+
* website or a ghelp: URI if a Gnome help page is available for the plugin.
|
|
862
|
+
*
|
|
863
|
+
* The relevant key in the plugin info file is "Help". Other platform-specific
|
|
864
|
+
* keys exist for platform-specific help files. Those are "Help-GNOME",
|
|
865
|
+
* "Help-Windows" and "Help-MacOS-X".
|
|
866
|
+
* @returns the plugin's help URI.
|
|
867
|
+
*/
|
|
868
|
+
get_help_uri(): string | null
|
|
869
|
+
/**
|
|
870
|
+
* Gets the icon name of the plugin.
|
|
871
|
+
*
|
|
872
|
+
* The icon of the plugin will be presented in the plugin manager UI. If no
|
|
873
|
+
* icon is specified, the default green puzzle icon will be used.
|
|
874
|
+
*
|
|
875
|
+
* The relevant key in the plugin info file is "Icon".
|
|
876
|
+
* @returns the plugin's icon name.
|
|
877
|
+
*/
|
|
878
|
+
get_icon_name(): string | null
|
|
879
|
+
/**
|
|
880
|
+
* Gets the module directory.
|
|
881
|
+
*
|
|
882
|
+
* The module directory is the directory where the plugin file was found. This
|
|
883
|
+
* is not a value from the [struct`GLib`.KeyFile], but rather a value provided by the
|
|
884
|
+
* [class`Engine]`.
|
|
885
|
+
* @returns the module directory.
|
|
886
|
+
*/
|
|
887
|
+
get_module_dir(): string | null
|
|
888
|
+
/**
|
|
889
|
+
* Gets the module name.
|
|
890
|
+
*
|
|
891
|
+
* The module name will be used to find the actual plugin. The way this value
|
|
892
|
+
* will be used depends on the loader (i.e. on the language) of the plugin.
|
|
893
|
+
* This value is also used to uniquely identify a particular plugin.
|
|
894
|
+
*
|
|
895
|
+
* The relevant key in the plugin info file is "Module".
|
|
896
|
+
* @returns the module name.
|
|
897
|
+
*/
|
|
898
|
+
get_module_name(): string | null
|
|
899
|
+
/**
|
|
900
|
+
* Gets the name of the plugin.
|
|
901
|
+
*
|
|
902
|
+
* The name of a plugin should be a nice short string to be presented in UIs.
|
|
903
|
+
*
|
|
904
|
+
* The relevant key in the plugin info file is "Name".
|
|
905
|
+
* @returns the plugin's name.
|
|
906
|
+
*/
|
|
907
|
+
get_name(): string | null
|
|
908
|
+
/**
|
|
909
|
+
* Creates a new #GResource for the given `filename`
|
|
910
|
+
* located in the module directory. If `filename` is %NULL
|
|
911
|
+
* then "${module_name}.gresource" will be loaded.
|
|
912
|
+
* @param filename The filename of the resource, or %NULL.
|
|
913
|
+
* @returns a new #GResource, or %NULL.
|
|
914
|
+
*/
|
|
915
|
+
get_resource(filename: string | null): Gio.Resource
|
|
916
|
+
/**
|
|
917
|
+
* Creates a new [class`Gio`.Settings] for the given `schema_id` and if
|
|
918
|
+
* gschemas.compiled is not in the module directory an attempt
|
|
919
|
+
* will be made to create it.
|
|
920
|
+
* @param schema_id The schema id.
|
|
921
|
+
* @returns a new #GSettings.
|
|
922
|
+
*/
|
|
923
|
+
get_settings(schema_id: string | null): Gio.Settings | null
|
|
924
|
+
/**
|
|
925
|
+
* Gets the version of the plugin.
|
|
926
|
+
*
|
|
927
|
+
* The relevant key in the plugin info file is "Version".
|
|
928
|
+
* @returns the plugin's version.
|
|
929
|
+
*/
|
|
930
|
+
get_version(): string | null
|
|
931
|
+
/**
|
|
932
|
+
* Gets the website of the plugin.
|
|
933
|
+
*
|
|
934
|
+
* The relevant key in the plugin info file is "Website".
|
|
935
|
+
* @returns the plugin's associated website.
|
|
936
|
+
*/
|
|
937
|
+
get_website(): string | null
|
|
938
|
+
/**
|
|
939
|
+
* Check if the plugin depends on another plugin.
|
|
940
|
+
* @param module_name The name of the plugin to check.
|
|
941
|
+
* @returns whether the plugin depends on the plugin @module_name.
|
|
942
|
+
*/
|
|
943
|
+
has_dependency(module_name: string | null): boolean
|
|
944
|
+
/**
|
|
945
|
+
* Check if the plugin is available.
|
|
946
|
+
*
|
|
947
|
+
* A plugin is marked as not available when there is no loader available to
|
|
948
|
+
* load it, or when there has been an error when trying to load it previously.
|
|
949
|
+
* If not available then `error` will be set.
|
|
950
|
+
* @returns %TRUE if the plugin is available.
|
|
951
|
+
*/
|
|
952
|
+
is_available(): boolean
|
|
953
|
+
/**
|
|
954
|
+
* Check if the plugin is a builtin plugin.
|
|
955
|
+
*
|
|
956
|
+
* A builtin plugin is a plugin which cannot be enabled or disabled by the user
|
|
957
|
+
* through a plugin manager (like
|
|
958
|
+
* [PeasGtkPluginManager](https://gnome.pages.gitlab.gnome.org/libpeas/libpeas-gtk-1.0/class.PluginManager.html)).
|
|
959
|
+
* Loading or unloading such plugins is the responsibility of the application
|
|
960
|
+
* alone. Most applications will usually load those plugins immediately after
|
|
961
|
+
* the initialization of the #PeasEngine.
|
|
962
|
+
*
|
|
963
|
+
* The relevant key in the plugin info file is "Builtin".
|
|
964
|
+
* @returns %TRUE if the plugin is a builtin plugin, %FALSE if not.
|
|
965
|
+
*/
|
|
966
|
+
is_builtin(): boolean
|
|
967
|
+
/**
|
|
968
|
+
* Check if the plugin is a hidden plugin.
|
|
969
|
+
*
|
|
970
|
+
* A hidden plugin is a plugin which cannot be seen by a
|
|
971
|
+
* user through a plugin manager (like
|
|
972
|
+
* [PeasGtkPluginManager](https://gnome.pages.gitlab.gnome.org/libpeas/libpeas-gtk-1.0/class.PluginManager.html)).
|
|
973
|
+
* Loading and
|
|
974
|
+
* unloading such plugins is the responsibility of the application alone or
|
|
975
|
+
* through plugins that depend on them.
|
|
976
|
+
*
|
|
977
|
+
* The relevant key in the plugin info file is "Hidden".
|
|
978
|
+
* @returns %TRUE if the plugin is a hidden plugin, %FALSE if not.
|
|
979
|
+
*/
|
|
980
|
+
is_hidden(): boolean
|
|
981
|
+
/**
|
|
982
|
+
* Check if the plugin is loaded.
|
|
983
|
+
* @returns %TRUE if the plugin is loaded.
|
|
984
|
+
*/
|
|
985
|
+
is_loaded(): boolean
|
|
986
|
+
/**
|
|
987
|
+
* Loads the resource using peas_plugin_info_get_resource() and
|
|
988
|
+
* registers it. The resource's lifetime will be automatically
|
|
989
|
+
* handled by `info`.
|
|
990
|
+
*
|
|
991
|
+
* See peas_plugin_info_get_resource() for more information.
|
|
992
|
+
* @param filename The filename of the resource, or %NULL.
|
|
993
|
+
*/
|
|
994
|
+
load_resource(filename: string | null): void
|
|
995
|
+
|
|
996
|
+
// Class property signals of Peas-2.Peas.PluginInfo
|
|
997
|
+
|
|
998
|
+
connect(sigName: "notify::authors", callback: (($obj: PluginInfo, pspec: GObject.ParamSpec) => void)): number
|
|
999
|
+
connect_after(sigName: "notify::authors", callback: (($obj: PluginInfo, pspec: GObject.ParamSpec) => void)): number
|
|
1000
|
+
emit(sigName: "notify::authors", ...args: any[]): void
|
|
1001
|
+
connect(sigName: "notify::builtin", callback: (($obj: PluginInfo, pspec: GObject.ParamSpec) => void)): number
|
|
1002
|
+
connect_after(sigName: "notify::builtin", callback: (($obj: PluginInfo, pspec: GObject.ParamSpec) => void)): number
|
|
1003
|
+
emit(sigName: "notify::builtin", ...args: any[]): void
|
|
1004
|
+
connect(sigName: "notify::copyright", callback: (($obj: PluginInfo, pspec: GObject.ParamSpec) => void)): number
|
|
1005
|
+
connect_after(sigName: "notify::copyright", callback: (($obj: PluginInfo, pspec: GObject.ParamSpec) => void)): number
|
|
1006
|
+
emit(sigName: "notify::copyright", ...args: any[]): void
|
|
1007
|
+
connect(sigName: "notify::dependencies", callback: (($obj: PluginInfo, pspec: GObject.ParamSpec) => void)): number
|
|
1008
|
+
connect_after(sigName: "notify::dependencies", callback: (($obj: PluginInfo, pspec: GObject.ParamSpec) => void)): number
|
|
1009
|
+
emit(sigName: "notify::dependencies", ...args: any[]): void
|
|
1010
|
+
connect(sigName: "notify::description", callback: (($obj: PluginInfo, pspec: GObject.ParamSpec) => void)): number
|
|
1011
|
+
connect_after(sigName: "notify::description", callback: (($obj: PluginInfo, pspec: GObject.ParamSpec) => void)): number
|
|
1012
|
+
emit(sigName: "notify::description", ...args: any[]): void
|
|
1013
|
+
connect(sigName: "notify::help-uri", callback: (($obj: PluginInfo, pspec: GObject.ParamSpec) => void)): number
|
|
1014
|
+
connect_after(sigName: "notify::help-uri", callback: (($obj: PluginInfo, pspec: GObject.ParamSpec) => void)): number
|
|
1015
|
+
emit(sigName: "notify::help-uri", ...args: any[]): void
|
|
1016
|
+
connect(sigName: "notify::hidden", callback: (($obj: PluginInfo, pspec: GObject.ParamSpec) => void)): number
|
|
1017
|
+
connect_after(sigName: "notify::hidden", callback: (($obj: PluginInfo, pspec: GObject.ParamSpec) => void)): number
|
|
1018
|
+
emit(sigName: "notify::hidden", ...args: any[]): void
|
|
1019
|
+
connect(sigName: "notify::icon-name", callback: (($obj: PluginInfo, pspec: GObject.ParamSpec) => void)): number
|
|
1020
|
+
connect_after(sigName: "notify::icon-name", callback: (($obj: PluginInfo, pspec: GObject.ParamSpec) => void)): number
|
|
1021
|
+
emit(sigName: "notify::icon-name", ...args: any[]): void
|
|
1022
|
+
connect(sigName: "notify::loaded", callback: (($obj: PluginInfo, pspec: GObject.ParamSpec) => void)): number
|
|
1023
|
+
connect_after(sigName: "notify::loaded", callback: (($obj: PluginInfo, pspec: GObject.ParamSpec) => void)): number
|
|
1024
|
+
emit(sigName: "notify::loaded", ...args: any[]): void
|
|
1025
|
+
connect(sigName: "notify::module-dir", callback: (($obj: PluginInfo, pspec: GObject.ParamSpec) => void)): number
|
|
1026
|
+
connect_after(sigName: "notify::module-dir", callback: (($obj: PluginInfo, pspec: GObject.ParamSpec) => void)): number
|
|
1027
|
+
emit(sigName: "notify::module-dir", ...args: any[]): void
|
|
1028
|
+
connect(sigName: "notify::module-name", callback: (($obj: PluginInfo, pspec: GObject.ParamSpec) => void)): number
|
|
1029
|
+
connect_after(sigName: "notify::module-name", callback: (($obj: PluginInfo, pspec: GObject.ParamSpec) => void)): number
|
|
1030
|
+
emit(sigName: "notify::module-name", ...args: any[]): void
|
|
1031
|
+
connect(sigName: "notify::name", callback: (($obj: PluginInfo, pspec: GObject.ParamSpec) => void)): number
|
|
1032
|
+
connect_after(sigName: "notify::name", callback: (($obj: PluginInfo, pspec: GObject.ParamSpec) => void)): number
|
|
1033
|
+
emit(sigName: "notify::name", ...args: any[]): void
|
|
1034
|
+
connect(sigName: "notify::version", callback: (($obj: PluginInfo, pspec: GObject.ParamSpec) => void)): number
|
|
1035
|
+
connect_after(sigName: "notify::version", callback: (($obj: PluginInfo, pspec: GObject.ParamSpec) => void)): number
|
|
1036
|
+
emit(sigName: "notify::version", ...args: any[]): void
|
|
1037
|
+
connect(sigName: "notify::website", callback: (($obj: PluginInfo, pspec: GObject.ParamSpec) => void)): number
|
|
1038
|
+
connect_after(sigName: "notify::website", callback: (($obj: PluginInfo, pspec: GObject.ParamSpec) => void)): number
|
|
1039
|
+
emit(sigName: "notify::website", ...args: any[]): void
|
|
1040
|
+
connect(sigName: string, callback: (...args: any[]) => void): number
|
|
1041
|
+
connect_after(sigName: string, callback: (...args: any[]) => void): number
|
|
1042
|
+
emit(sigName: string, ...args: any[]): void
|
|
1043
|
+
disconnect(id: number): void
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1046
|
+
/**
|
|
1047
|
+
* A #PeasPluginInfo contains all the information available about a plugin.
|
|
1048
|
+
*
|
|
1049
|
+
* All this information comes from the related plugin info file, whose file
|
|
1050
|
+
* extension is ".plugin". Here is an example of such a plugin file, in the
|
|
1051
|
+
* [struct`GLib`.KeyFile] format:
|
|
1052
|
+
*
|
|
1053
|
+
* ```toml
|
|
1054
|
+
* [Plugin]
|
|
1055
|
+
* Module=helloworld
|
|
1056
|
+
* Depends=foo;bar;baz
|
|
1057
|
+
* Loader=python
|
|
1058
|
+
* Name=Hello World
|
|
1059
|
+
* Description=Displays "Hello World"
|
|
1060
|
+
* Authors=Steve Frécinaux <code`istique`.net>
|
|
1061
|
+
* Copyright=Copyright © 2009-10 Steve Frécinaux
|
|
1062
|
+
* Website=https://wiki.gnome.org/Projects/Libpeas
|
|
1063
|
+
* Help=http://library.gnome.org/devel/libpeas/stable/
|
|
1064
|
+
* Hidden=false
|
|
1065
|
+
* ```
|
|
1066
|
+
* @class
|
|
1067
|
+
*/
|
|
1068
|
+
export class PluginInfo extends GObject.Object {
|
|
1069
|
+
|
|
1070
|
+
// Own properties of Peas-2.Peas.PluginInfo
|
|
1071
|
+
|
|
1072
|
+
static name: string
|
|
1073
|
+
static $gtype: GObject.GType<PluginInfo>
|
|
1074
|
+
|
|
1075
|
+
// Constructors of Peas-2.Peas.PluginInfo
|
|
1076
|
+
|
|
1077
|
+
constructor(config?: PluginInfo.ConstructorProperties)
|
|
1078
|
+
_init(config?: PluginInfo.ConstructorProperties): void
|
|
1079
|
+
static error_quark(): GLib.Quark
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
export interface EngineClass {
|
|
1083
|
+
|
|
1084
|
+
// Own fields of Peas-2.Peas.EngineClass
|
|
1085
|
+
|
|
1086
|
+
parent_class: GObject.ObjectClass
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1089
|
+
export abstract class EngineClass {
|
|
1090
|
+
|
|
1091
|
+
// Own properties of Peas-2.Peas.EngineClass
|
|
1092
|
+
|
|
1093
|
+
static name: string
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1096
|
+
export interface ExtensionBaseClass {
|
|
1097
|
+
|
|
1098
|
+
// Own fields of Peas-2.Peas.ExtensionBaseClass
|
|
1099
|
+
|
|
1100
|
+
/**
|
|
1101
|
+
* The parent class.
|
|
1102
|
+
* @field
|
|
1103
|
+
*/
|
|
1104
|
+
parent_class: GObject.ObjectClass
|
|
1105
|
+
}
|
|
1106
|
+
|
|
1107
|
+
/**
|
|
1108
|
+
* The class structure of #PeasExtensionBase.
|
|
1109
|
+
* @record
|
|
1110
|
+
*/
|
|
1111
|
+
export abstract class ExtensionBaseClass {
|
|
1112
|
+
|
|
1113
|
+
// Own properties of Peas-2.Peas.ExtensionBaseClass
|
|
1114
|
+
|
|
1115
|
+
static name: string
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1118
|
+
export interface ExtensionSetClass {
|
|
1119
|
+
|
|
1120
|
+
// Own fields of Peas-2.Peas.ExtensionSetClass
|
|
1121
|
+
|
|
1122
|
+
parent_class: GObject.ObjectClass
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1125
|
+
export abstract class ExtensionSetClass {
|
|
1126
|
+
|
|
1127
|
+
// Own properties of Peas-2.Peas.ExtensionSetClass
|
|
1128
|
+
|
|
1129
|
+
static name: string
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
export interface ObjectModuleClass {
|
|
1133
|
+
|
|
1134
|
+
// Own fields of Peas-2.Peas.ObjectModuleClass
|
|
1135
|
+
|
|
1136
|
+
/**
|
|
1137
|
+
* The parent class.
|
|
1138
|
+
* @field
|
|
1139
|
+
*/
|
|
1140
|
+
parent_class: GObject.TypeModuleClass
|
|
1141
|
+
}
|
|
1142
|
+
|
|
1143
|
+
/**
|
|
1144
|
+
* The class structure for #PeasObjectModule.
|
|
1145
|
+
* @record
|
|
1146
|
+
*/
|
|
1147
|
+
export abstract class ObjectModuleClass {
|
|
1148
|
+
|
|
1149
|
+
// Own properties of Peas-2.Peas.ObjectModuleClass
|
|
1150
|
+
|
|
1151
|
+
static name: string
|
|
1152
|
+
}
|
|
1153
|
+
|
|
1154
|
+
export interface PluginInfoClass {
|
|
1155
|
+
|
|
1156
|
+
// Own fields of Peas-2.Peas.PluginInfoClass
|
|
1157
|
+
|
|
1158
|
+
parent_class: GObject.ObjectClass
|
|
1159
|
+
}
|
|
1160
|
+
|
|
1161
|
+
export abstract class PluginInfoClass {
|
|
1162
|
+
|
|
1163
|
+
// Own properties of Peas-2.Peas.PluginInfoClass
|
|
1164
|
+
|
|
1165
|
+
static name: string
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1168
|
+
/**
|
|
1169
|
+
* Name of the imported GIR library
|
|
1170
|
+
* @see https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
|
|
1171
|
+
*/
|
|
1172
|
+
export const __name__: string
|
|
1173
|
+
/**
|
|
1174
|
+
* Version of the imported GIR library
|
|
1175
|
+
* @see https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
|
|
1176
|
+
*/
|
|
1177
|
+
export const __version__: string
|
|
1178
|
+
// END
|