-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gtef-2.d.ts
3426 lines (3024 loc) · 177 KB
/
Gtef-2.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// @ts-nocheck
/*
* Type Definitions for node-gtk (https://github.com/romgrk/node-gtk)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in ts-for-gir itself or create a bug report on https://github.com/sammydre/ts-for-gjs
*/
/**
* Gtef-2
*/
import type GtkSource from './GtkSource-3.0';
import type Gtk from './Gtk-3.0';
import type xlib from './xlib-2.0';
import type Gdk from './Gdk-3.0';
import type cairo from './cairo-1.0';
import type Pango from './Pango-1.0';
import type HarfBuzz from './HarfBuzz-0.0';
import type GObject from './GObject-2.0';
import type GLib from './GLib-2.0';
import type Gio from './Gio-2.0';
import type GdkPixbuf from './GdkPixbuf-2.0';
import type GModule from './GModule-2.0';
import type Atk from './Atk-1.0';
export namespace Gtef {
enum CompressionType {
/**
* plain text.
*/
NONE,
/**
* gzip compression.
*/
GZIP,
}
/**
* An error code used with the %GTEF_FILE_LOADER_ERROR domain.
*/
enum FileLoaderError {
/**
* The file is too big.
*/
TOO_BIG,
/**
* It is not possible to
* detect the encoding automatically.
*/
ENCODING_AUTO_DETECTION_FAILED,
}
/**
* An error code used with the %GTEF_FILE_SAVER_ERROR domain.
*/
enum FileSaverError {
/**
* The buffer contains invalid
* characters.
*/
INVALID_CHARS,
/**
* The file is externally
* modified.
*/
EXTERNALLY_MODIFIED,
}
enum NewlineType {
/**
* line feed, used on UNIX.
*/
LF,
/**
* carriage return, used on Mac.
*/
CR,
/**
* carriage return followed by a line feed, used
* on Windows.
*/
CR_LF,
}
enum SelectionType {
/**
* No selection.
*/
NO_SELECTION,
/**
* The start and end selection bounds are on
* the same line.
*/
ON_SAME_LINE,
/**
* The selection spans multiple lines.
*/
MULTIPLE_LINES,
}
/**
* Flags to define the behavior of a #GtefFileSaver.
* @bitfield
*/
enum FileSaverFlags {
/**
* No flags.
*/
NONE,
/**
* Ignore invalid characters.
*/
IGNORE_INVALID_CHARS,
/**
* Save file despite external modifications.
*/
IGNORE_MODIFICATION_TIME,
/**
* Create a backup before saving the file.
*/
CREATE_BACKUP,
}
/**
* The folding state at a certain line in the #GtkTextBuffer.
*
* Since #GtefGutterRendererFolds has a flat view of the folding tree, some
* states can be combined; for example, %GTEF_GUTTER_RENDERER_FOLDS_STATE_END
* and %GTEF_GUTTER_RENDERER_FOLDS_STATE_CONTINUE.
* @bitfield
*/
enum GutterRendererFoldsState {
/**
* No code folding here.
*/
NONE,
/**
* Start of currently folded
* fold region.
*/
START_FOLDED,
/**
* Start of currently opened
* fold region.
*/
START_OPENED,
/**
* Fold region continues.
*/
CONTINUE,
/**
* End of fold region.
*/
END,
}
/**
* A wrapper function for g_action_map_add_action_entries() that checks
* duplicates.
*
* This function first checks - for each entry - that the `action_map` doesn't
* already contain a #GAction with the same name. A warning is printed if an old
* action will be dropped. In any case, it then calls
* g_action_map_add_action_entries() with the same arguments as passed to this
* function.
*
* This function also checks if there are duplicates in the `entries` array
* itself.
* @param actionMap a #GActionMap.
* @param entries a pointer to the first item in an array of #GActionEntry structs.
* @param userData the user data for signal connections.
*/
function actionMapAddActionEntriesCheckDups(actionMap: Gio.ActionMap, entries: Gio.ActionEntry[], userData: object | null): void
/**
* Gets a list of all encodings known by #GtefEncoding.
*/
function encodingGetAll(): Encoding[]
/**
* Gets the list of default candidate encodings to try when loading a file. See
* gtk_source_file_loader_set_candidate_encodings().
*
* This function returns a different list depending on the current locale (i.e.
* language, country and default encoding). The UTF-8 encoding and the current
* locale encoding are guaranteed to be present in the returned list.
*/
function encodingGetDefaultCandidates(): Encoding[]
function fileLoaderErrorQuark(): GLib.Quark
function fileSaverErrorQuark(): GLib.Quark
/**
* Gets the indentation, as a string, of the line at `iter`. `iter` can be
* anywhere in the line.
*
* Possible use-case: to implement an action that inserts some text in a
* #GtkTextBuffer. If the text to insert spans multiple lines, it is usually
* desired to keep the same indentation level.
* @param iter a #GtkTextIter.
*/
function iterGetLineIndentation(iter: Gtk.TextIter): string
function menuItemGetLongDescription(menuItem: Gtk.MenuItem): string | null
/**
* Sets an icon to a #GtkMenuItem.
*
* If the child widget of `item` is already a #GtkBox, all #GtkImage widgets
* inside that box are first destroyed. A #GtkImage for `icon_name` is then
* inserted to the box.
*
* If the child widget of `item` is not a #GtkBox (it's usually the
* #GtkAccelLabel), it is replaced by a new #GtkBox and the initial child widget
* is inserted to the #GtkBox, alongside the icon.
*
* As a consequence, if you want to call functions on the #GtkAccelLabel, it's
* easier to do it before calling this function.
* @param item a #GtkMenuItem.
* @param iconName an icon name.
*/
function menuItemSetIconName(item: Gtk.MenuItem, iconName: string): void
/**
* Sets the long description of `menu_item`. A possible use-case is to display it
* in a #GtkStatusbar, or as a tooltip.
* @param menuItem a #GtkMenuItem.
* @param longDescription the long description, or %NULL to unset it.
*/
function menuItemSetLongDescription(menuItem: Gtk.MenuItem, longDescription: string | null): void
/**
* This function initializes the metadata manager.
*
* The `metadata_path` must be different for each process. It is advised for your
* application to rely on #GApplication process uniqueness.
*
* A good place to store the metadata is in a sub-directory of the user data
* directory. See g_get_user_data_dir().
* @param metadataPath the filename where the metadata is stored.
*/
function metadataManagerInit(metadataPath: string): void
/**
* This function saves synchronously metadata if they need to be saved, and
* frees the internal data of the metadata manager.
*/
function metadataManagerShutdown(): void
/**
* Gets the URI of `item`. `item` must be a child of `menu`. `menu` must be a
* #GtkRecentChooserMenu.
*
* This function has been written because the value returned by
* gtk_recent_chooser_get_current_uri() is not updated when #GtkMenuItem's of a
* #GtkRecentChooserMenu are selected/deselected.
* @param menu a #GtkRecentChooserMenu.
* @param item a #GtkMenuItem.
*/
function utilsRecentChooserMenuGetItemUri(menu: Gtk.RecentChooserMenu, item: Gtk.MenuItem): string
interface ActionInfoCentralStore_ConstructProps extends GObject.Object_ConstructProps {
}
interface ActionInfoCentralStore {
// Own fields of Gtef-2.Gtef.ActionInfoCentralStore
parent: GObject.Object
priv: ActionInfoCentralStorePrivate
// Owm methods of Gtef-2.Gtef.ActionInfoCentralStore
lookup(actionName: string): ActionInfo
// Class property signals of Gtef-2.Gtef.ActionInfoCentralStore
connect(sigName: string, callback: (...args: any[]) => void): number
on(sigName: string, callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
once(sigName: string, callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
off(sigName: string, callback: (...args: any[]) => void): NodeJS.EventEmitter
emit(sigName: string, ...args: any[]): void
}
class ActionInfoCentralStore extends GObject.Object {
// Own properties of Gtef-2.Gtef.ActionInfoCentralStore
static name: string
static $gtype: GObject.GType<ActionInfoCentralStore>
// Constructors of Gtef-2.Gtef.ActionInfoCentralStore
constructor(config?: ActionInfoCentralStore_ConstructProps)
_init(config?: ActionInfoCentralStore_ConstructProps): void
static getInstance(): ActionInfoCentralStore
}
interface ActionInfoStore_ConstructProps extends GObject.Object_ConstructProps {
// Own constructor properties of Gtef-2.Gtef.ActionInfoStore
/**
* The associated #GtkApplication. #GtefActionInfoStore has a weak
* reference to the #GtkApplication.
*/
application?: Gtk.Application | null
}
interface ActionInfoStore {
// Own properties of Gtef-2.Gtef.ActionInfoStore
/**
* The associated #GtkApplication. #GtefActionInfoStore has a weak
* reference to the #GtkApplication.
*/
readonly application: Gtk.Application
// Own fields of Gtef-2.Gtef.ActionInfoStore
parent: GObject.Object
priv: ActionInfoStorePrivate
// Owm methods of Gtef-2.Gtef.ActionInfoStore
/**
* Inserts `info` into `store` and into the #GtefActionInfoCentralStore. Both the
* `store` and central store must <emphasis>not</emphasis> already contain a
* #GtefActionInfo with the same action name. The stores take their own
* reference on `info`.
* @param info a #GtefActionInfo.
*/
add(info: ActionInfo): void
/**
* Calls gtef_action_info_store_add() for each entry.
*
* If `translation_domain` is not %NULL, g_dgettext() is used to translate the
* `label` and `tooltip` of each entry before setting them to the #GtefActionInfo.
*
* An API similar to g_action_map_add_action_entries().
* @param entries a pointer to the first item in an array of #GtefActionInfoEntry structs.
* @param translationDomain a gettext domain, or %NULL.
*/
addEntries(entries: ActionInfoEntry[], translationDomain: string | null): void
/**
* Checks that all #GtefActionInfo's of `store` have been used by
* gtef_action_info_store_create_menu_item(). If not, a warning is printed and
* might indicate dead code.
*
* You probably want to call this function on the store returned by
* gtef_application_get_app_action_info_store(). But it can also be useful for a
* store provided by a library, to easily see which actions you don't use.
*/
checkAllUsed(): void
/**
* Creates a new #GtkMenuItem for `action_name`. The `store` must contain a
* #GtefActionInfo for `action_name`.
*
* gtk_actionable_set_action_name() is called on the menu item with
* `action_name`. The label is set with the #GtkMenuItem:use-underline property
* enabled. The first accelerator is set to the #GtkAccelLabel of the menu item.
* The icon is set. And the tooltip is set with
* gtef_menu_item_set_long_description().
*
* If #GtefActionInfoStore:application is non-%NULL, this function also calls
* gtk_application_set_accels_for_action() with the accelerators returned by
* gtef_action_info_get_accels() (this will erase previously set accelerators
* for that action, if any).
* @param actionName an action name.
*/
createMenuItem(actionName: string): Gtk.Widget
getApplication(): Gtk.Application | null
lookup(actionName: string): ActionInfo
// Class property signals of Gtef-2.Gtef.ActionInfoStore
connect(sigName: "notify::application", callback: (...args: any[]) => void): number
on(sigName: "notify::application", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
once(sigName: "notify::application", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
off(sigName: "notify::application", callback: (...args: any[]) => void): NodeJS.EventEmitter
emit(sigName: "notify::application", ...args: any[]): void
connect(sigName: string, callback: (...args: any[]) => void): number
on(sigName: string, callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
once(sigName: string, callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
off(sigName: string, callback: (...args: any[]) => void): NodeJS.EventEmitter
emit(sigName: string, ...args: any[]): void
}
class ActionInfoStore extends GObject.Object {
// Own properties of Gtef-2.Gtef.ActionInfoStore
static name: string
static $gtype: GObject.GType<ActionInfoStore>
// Constructors of Gtef-2.Gtef.ActionInfoStore
constructor(config?: ActionInfoStore_ConstructProps)
/**
* Creates a new #GtefActionInfoStore object. Associating a #GtkApplication is
* optional.
* @constructor
* @param application a #GtkApplication, or %NULL.
*/
constructor(application: Gtk.Application | null)
/**
* Creates a new #GtefActionInfoStore object. Associating a #GtkApplication is
* optional.
* @constructor
* @param application a #GtkApplication, or %NULL.
*/
static new(application: Gtk.Application | null): ActionInfoStore
_init(config?: ActionInfoStore_ConstructProps): void
}
interface Application_ConstructProps extends GObject.Object_ConstructProps {
// Own constructor properties of Gtef-2.Gtef.Application
/**
* The #GtkApplication.
*/
application?: Gtk.Application | null
}
interface Application {
// Own properties of Gtef-2.Gtef.Application
/**
* The #GtkApplication.
*/
readonly application: Gtk.Application
// Own fields of Gtef-2.Gtef.Application
parent: GObject.Object
priv: ApplicationPrivate
// Owm methods of Gtef-2.Gtef.Application
/**
* Returns an initially empty #GtefActionInfoStore reserved for the
* application-specific actions. Libraries should not add #GtefActionInfo's to
* this store. Libraries should provide their own store if they want to share
* #GtefActionInfo's.
*/
getAppActionInfoStore(): ActionInfoStore
getApplication(): Gtk.Application
/**
* Calls g_application_open() with a single file and an empty hint.
* @param file a #GFile.
*/
openSimple(file: Gio.File): void
// Class property signals of Gtef-2.Gtef.Application
connect(sigName: "notify::application", callback: (...args: any[]) => void): number
on(sigName: "notify::application", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
once(sigName: "notify::application", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
off(sigName: "notify::application", callback: (...args: any[]) => void): NodeJS.EventEmitter
emit(sigName: "notify::application", ...args: any[]): void
connect(sigName: string, callback: (...args: any[]) => void): number
on(sigName: string, callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
once(sigName: string, callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
off(sigName: string, callback: (...args: any[]) => void): NodeJS.EventEmitter
emit(sigName: string, ...args: any[]): void
}
class Application extends GObject.Object {
// Own properties of Gtef-2.Gtef.Application
static name: string
static $gtype: GObject.GType<Application>
// Constructors of Gtef-2.Gtef.Application
constructor(config?: Application_ConstructProps)
_init(config?: Application_ConstructProps): void
/**
* Convenience function that calls g_application_get_default() followed by
* gtef_application_get_from_gtk_application(). The object returned by
* g_application_get_default() must be a #GtkApplication.
*/
static getDefault(): Application
/**
* Returns the #GtefApplication of `gtk_app`. The returned object is guaranteed
* to be the same for the lifetime of `gtk_app`.
* @param gtkApp a #GtkApplication.
*/
static getFromGtkApplication(gtkApp: Gtk.Application): Application
}
interface ApplicationWindow_ConstructProps extends GObject.Object_ConstructProps {
// Own constructor properties of Gtef-2.Gtef.ApplicationWindow
/**
* The #GtkApplicationWindow.
*/
applicationWindow?: Gtk.ApplicationWindow | null
/**
* The #GtkStatusbar. %NULL by default.
*/
statusbar?: Gtk.Statusbar | null
}
interface ApplicationWindow {
// Own properties of Gtef-2.Gtef.ApplicationWindow
/**
* The #GtkApplicationWindow.
*/
readonly applicationWindow: Gtk.ApplicationWindow
/**
* The #GtkStatusbar. %NULL by default.
*/
statusbar: Gtk.Statusbar
// Own fields of Gtef-2.Gtef.ApplicationWindow
parent: GObject.Object
priv: ApplicationWindowPrivate
// Owm methods of Gtef-2.Gtef.ApplicationWindow
/**
* Connect to the #GtefMenuShell::menu-item-selected and
* #GtefMenuShell::menu-item-deselected signals of `gtef_menu_shell` to push/pop
* the long description of #GtkMenuItem's to the
* #GtefApplicationWindow:statusbar.
*
* The long description is retrieved with gtef_menu_item_get_long_description().
* So gtef_menu_item_set_long_description() must have been called, which is the
* case if the #GtkMenuItem has been created with the functions available in
* #GtefActionInfoStore.
* @param gtefMenuShell a #GtefMenuShell.
*/
connectMenuToStatusbar(gtefMenuShell: MenuShell): void
/**
* An alternative to gtk_recent_chooser_set_show_tips(). Shows the full path in
* the #GtefApplicationWindow:statusbar when a #GtkMenuItem of `menu` is
* selected.
*
* The full path is retrieved with
* gtef_utils_recent_chooser_menu_get_item_uri().
* @param menu a #GtkRecentChooserMenu.
*/
connectRecentChooserMenuToStatusbar(menu: Gtk.RecentChooserMenu): void
/**
* Creates a #GtkMenuItem with a simple and generic #GtkRecentChooserMenu as
* submenu.
*
* The #GtkRecentChooser is configured to show files only recently used with the
* current application, as returned by g_get_application_name(). If recent files
* are added to the default #GtkRecentManager with
* gtk_recent_manager_add_item(), the files will normally show up in the
* #GtkRecentChooserMenu.
*
* The #GtkRecentChooserMenu is connected to the statusbar with
* gtef_application_window_connect_recent_chooser_menu_to_statusbar().
*
* When the #GtkRecentChooser::item-activated signal is emitted,
* gtef_application_open_simple() is called, so the #GApplication must have the
* %G_APPLICATION_HANDLES_OPEN flag set.
*/
createOpenRecentMenuItem(): Gtk.Widget
getApplicationWindow(): Gtk.ApplicationWindow
getStatusbar(): Gtk.Statusbar | null
/**
* Sets the #GtefApplicationWindow:statusbar property.
* @param statusbar a #GtkStatusbar, or %NULL.
*/
setStatusbar(statusbar: Gtk.Statusbar | null): void
// Class property signals of Gtef-2.Gtef.ApplicationWindow
connect(sigName: "notify::application-window", callback: (...args: any[]) => void): number
on(sigName: "notify::application-window", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
once(sigName: "notify::application-window", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
off(sigName: "notify::application-window", callback: (...args: any[]) => void): NodeJS.EventEmitter
emit(sigName: "notify::application-window", ...args: any[]): void
connect(sigName: "notify::statusbar", callback: (...args: any[]) => void): number
on(sigName: "notify::statusbar", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
once(sigName: "notify::statusbar", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
off(sigName: "notify::statusbar", callback: (...args: any[]) => void): NodeJS.EventEmitter
emit(sigName: "notify::statusbar", ...args: any[]): void
connect(sigName: string, callback: (...args: any[]) => void): number
on(sigName: string, callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
once(sigName: string, callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
off(sigName: string, callback: (...args: any[]) => void): NodeJS.EventEmitter
emit(sigName: string, ...args: any[]): void
}
class ApplicationWindow extends GObject.Object {
// Own properties of Gtef-2.Gtef.ApplicationWindow
static name: string
static $gtype: GObject.GType<ApplicationWindow>
// Constructors of Gtef-2.Gtef.ApplicationWindow
constructor(config?: ApplicationWindow_ConstructProps)
_init(config?: ApplicationWindow_ConstructProps): void
/**
* Returns the #GtefApplicationWindow of `gtk_window`. The returned object is
* guaranteed to be the same for the lifetime of `gtk_window`.
* @param gtkWindow a #GtkApplicationWindow.
*/
static getFromGtkApplicationWindow(gtkWindow: Gtk.ApplicationWindow): ApplicationWindow
}
interface Buffer_ConstructProps extends GtkSource.Buffer_ConstructProps {
// Own constructor properties of Gtef-2.Gtef.Buffer
/**
* The #GtkSourceBuffer:style-scheme ID, as a string. This property is
* useful for binding it to a #GSettings key.
*
* When the #GtkSourceBuffer:style-scheme is %NULL,
* #GtefBuffer:gtef-style-scheme-id contains the empty string.
*/
gtefStyleSchemeId?: string | null
}
/**
* Signal callback interface for `gtef-cursor-moved`
*/
interface Buffer_GtefCursorMovedSignalCallback {
(): void
}
interface Buffer {
// Own properties of Gtef-2.Gtef.Buffer
/**
* The #GtkSourceBuffer:style-scheme ID, as a string. This property is
* useful for binding it to a #GSettings key.
*
* When the #GtkSourceBuffer:style-scheme is %NULL,
* #GtefBuffer:gtef-style-scheme-id contains the empty string.
*/
gtefStyleSchemeId: string
/**
* The buffer title. See gtef_buffer_get_title().
*/
readonly gtefTitle: string
// Conflicting properties
priv: any
// Own fields of Gtef-2.Gtef.Buffer
parentInstance: GtkSource.Buffer
// Owm methods of Gtef-2.Gtef.Buffer
/**
* Returns the #GtefFile of `buffer`. The returned object is guaranteed to be the
* same for the lifetime of `buffer`.
*/
getFile(): File
getSelectionType(): SelectionType
getStyleSchemeId(): string
/**
* Returns a title suitable for a #GtkWindow title. It contains (in that order):
* - '*' if the buffer is modified;
* - the #GtefFile:short-name;
* - the directory path in parenthesis if the #GtefFile:location isn't
* %NULL.
*/
getTitle(): string
/**
* Returns whether `buffer` is untouched.
*
* This function is for example useful to know if we can re-use this buffer to
* load a file, instead of opening a new tab or window.
*
* For this function to return %TRUE, the `buffer` must be empty, non-modified,
* the undo/redo #GtkSourceBuffer history must be empty, and the
* #GtefFile:location must be %NULL.
*/
isUntouched(): boolean
/**
* Sets the #GtefBuffer:gtef-style-scheme-id property.
*
* The #GtkSourceStyleScheme is taken from the default
* #GtkSourceStyleSchemeManager as returned by
* gtk_source_style_scheme_manager_get_default().
* @param styleSchemeId the new value.
*/
setStyleSchemeId(styleSchemeId: string): void
// Own signals of Gtef-2.Gtef.Buffer
connect(sigName: "gtef-cursor-moved", callback: Buffer_GtefCursorMovedSignalCallback): number
on(sigName: "gtef-cursor-moved", callback: Buffer_GtefCursorMovedSignalCallback, after?: boolean): NodeJS.EventEmitter
once(sigName: "gtef-cursor-moved", callback: Buffer_GtefCursorMovedSignalCallback, after?: boolean): NodeJS.EventEmitter
off(sigName: "gtef-cursor-moved", callback: Buffer_GtefCursorMovedSignalCallback): NodeJS.EventEmitter
emit(sigName: "gtef-cursor-moved", ...args: any[]): void
// Class property signals of Gtef-2.Gtef.Buffer
connect(sigName: "notify::gtef-style-scheme-id", callback: (...args: any[]) => void): number
on(sigName: "notify::gtef-style-scheme-id", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
once(sigName: "notify::gtef-style-scheme-id", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
off(sigName: "notify::gtef-style-scheme-id", callback: (...args: any[]) => void): NodeJS.EventEmitter
emit(sigName: "notify::gtef-style-scheme-id", ...args: any[]): void
connect(sigName: "notify::gtef-title", callback: (...args: any[]) => void): number
on(sigName: "notify::gtef-title", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
once(sigName: "notify::gtef-title", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
off(sigName: "notify::gtef-title", callback: (...args: any[]) => void): NodeJS.EventEmitter
emit(sigName: "notify::gtef-title", ...args: any[]): void
connect(sigName: "notify::can-redo", callback: (...args: any[]) => void): number
on(sigName: "notify::can-redo", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
once(sigName: "notify::can-redo", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
off(sigName: "notify::can-redo", callback: (...args: any[]) => void): NodeJS.EventEmitter
emit(sigName: "notify::can-redo", ...args: any[]): void
connect(sigName: "notify::can-undo", callback: (...args: any[]) => void): number
on(sigName: "notify::can-undo", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
once(sigName: "notify::can-undo", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
off(sigName: "notify::can-undo", callback: (...args: any[]) => void): NodeJS.EventEmitter
emit(sigName: "notify::can-undo", ...args: any[]): void
connect(sigName: "notify::highlight-matching-brackets", callback: (...args: any[]) => void): number
on(sigName: "notify::highlight-matching-brackets", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
once(sigName: "notify::highlight-matching-brackets", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
off(sigName: "notify::highlight-matching-brackets", callback: (...args: any[]) => void): NodeJS.EventEmitter
emit(sigName: "notify::highlight-matching-brackets", ...args: any[]): void
connect(sigName: "notify::highlight-syntax", callback: (...args: any[]) => void): number
on(sigName: "notify::highlight-syntax", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
once(sigName: "notify::highlight-syntax", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
off(sigName: "notify::highlight-syntax", callback: (...args: any[]) => void): NodeJS.EventEmitter
emit(sigName: "notify::highlight-syntax", ...args: any[]): void
connect(sigName: "notify::implicit-trailing-newline", callback: (...args: any[]) => void): number
on(sigName: "notify::implicit-trailing-newline", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
once(sigName: "notify::implicit-trailing-newline", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
off(sigName: "notify::implicit-trailing-newline", callback: (...args: any[]) => void): NodeJS.EventEmitter
emit(sigName: "notify::implicit-trailing-newline", ...args: any[]): void
connect(sigName: "notify::language", callback: (...args: any[]) => void): number
on(sigName: "notify::language", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
once(sigName: "notify::language", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
off(sigName: "notify::language", callback: (...args: any[]) => void): NodeJS.EventEmitter
emit(sigName: "notify::language", ...args: any[]): void
connect(sigName: "notify::max-undo-levels", callback: (...args: any[]) => void): number
on(sigName: "notify::max-undo-levels", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
once(sigName: "notify::max-undo-levels", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
off(sigName: "notify::max-undo-levels", callback: (...args: any[]) => void): NodeJS.EventEmitter
emit(sigName: "notify::max-undo-levels", ...args: any[]): void
connect(sigName: "notify::style-scheme", callback: (...args: any[]) => void): number
on(sigName: "notify::style-scheme", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
once(sigName: "notify::style-scheme", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
off(sigName: "notify::style-scheme", callback: (...args: any[]) => void): NodeJS.EventEmitter
emit(sigName: "notify::style-scheme", ...args: any[]): void
connect(sigName: "notify::undo-manager", callback: (...args: any[]) => void): number
on(sigName: "notify::undo-manager", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
once(sigName: "notify::undo-manager", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
off(sigName: "notify::undo-manager", callback: (...args: any[]) => void): NodeJS.EventEmitter
emit(sigName: "notify::undo-manager", ...args: any[]): void
connect(sigName: "notify::copy-target-list", callback: (...args: any[]) => void): number
on(sigName: "notify::copy-target-list", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
once(sigName: "notify::copy-target-list", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
off(sigName: "notify::copy-target-list", callback: (...args: any[]) => void): NodeJS.EventEmitter
emit(sigName: "notify::copy-target-list", ...args: any[]): void
connect(sigName: "notify::cursor-position", callback: (...args: any[]) => void): number
on(sigName: "notify::cursor-position", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
once(sigName: "notify::cursor-position", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
off(sigName: "notify::cursor-position", callback: (...args: any[]) => void): NodeJS.EventEmitter
emit(sigName: "notify::cursor-position", ...args: any[]): void
connect(sigName: "notify::has-selection", callback: (...args: any[]) => void): number
on(sigName: "notify::has-selection", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
once(sigName: "notify::has-selection", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
off(sigName: "notify::has-selection", callback: (...args: any[]) => void): NodeJS.EventEmitter
emit(sigName: "notify::has-selection", ...args: any[]): void
connect(sigName: "notify::paste-target-list", callback: (...args: any[]) => void): number
on(sigName: "notify::paste-target-list", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
once(sigName: "notify::paste-target-list", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
off(sigName: "notify::paste-target-list", callback: (...args: any[]) => void): NodeJS.EventEmitter
emit(sigName: "notify::paste-target-list", ...args: any[]): void
connect(sigName: "notify::tag-table", callback: (...args: any[]) => void): number
on(sigName: "notify::tag-table", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
once(sigName: "notify::tag-table", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
off(sigName: "notify::tag-table", callback: (...args: any[]) => void): NodeJS.EventEmitter
emit(sigName: "notify::tag-table", ...args: any[]): void
connect(sigName: "notify::text", callback: (...args: any[]) => void): number
on(sigName: "notify::text", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
once(sigName: "notify::text", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
off(sigName: "notify::text", callback: (...args: any[]) => void): NodeJS.EventEmitter
emit(sigName: "notify::text", ...args: any[]): void
connect(sigName: string, callback: (...args: any[]) => void): number
on(sigName: string, callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
once(sigName: string, callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
off(sigName: string, callback: (...args: any[]) => void): NodeJS.EventEmitter
emit(sigName: string, ...args: any[]): void
}
class Buffer extends GtkSource.Buffer {
// Own properties of Gtef-2.Gtef.Buffer
static name: string
static $gtype: GObject.GType<Buffer>
// Constructors of Gtef-2.Gtef.Buffer
constructor(config?: Buffer_ConstructProps)
constructor()
static new(): Buffer
// Overloads of new
/**
* Creates a new source buffer.
* @constructor
* @param table a #GtkTextTagTable, or %NULL to create a new one.
*/
static new(table: Gtk.TextTagTable | null): GtkSource.Buffer
/**
* Creates a new text buffer.
* @constructor
* @param table a tag table, or %NULL to create a new one
*/
static new(table: Gtk.TextTagTable | null): Gtk.TextBuffer
_init(config?: Buffer_ConstructProps): void
}
interface File_ConstructProps extends GObject.Object_ConstructProps {
// Own constructor properties of Gtef-2.Gtef.File
/**
* The location.
*/
location?: Gio.File | null
}
interface File {
// Own properties of Gtef-2.Gtef.File
/**
* The compression type.
*/
readonly compressionType: CompressionType
/**
* The character encoding, initially %NULL. After a successful file
* loading or saving operation, the encoding is non-%NULL.
*/
readonly encoding: Encoding
/**
* The location.
*/
location: Gio.File
/**
* The line ending type.
*/
readonly newlineType: NewlineType
/**
* Whether the file is read-only or not. The value of this property is
* not updated automatically (there is no file monitors).
*/
readonly readOnly: boolean
/**
* The file short name. See gtef_file_get_short_name().
*/
readonly shortName: string
// Own fields of Gtef-2.Gtef.File
parentInstance: GObject.Object
// Owm methods of Gtef-2.Gtef.File
/**
* Checks synchronously the file on disk, to know whether the file is externally
* modified, or has been deleted, and whether the file is read-only.
*
* #GtefFile doesn't create a #GFileMonitor to track those properties, so
* this function needs to be called instead. Creating lots of #GFileMonitor's
* would take lots of resources.
*
* Since this function is synchronous, it is advised to call it only on local
* files. See gtef_file_is_local().
*/
checkFileOnDisk(): void
getCompressionType(): CompressionType
/**
* The encoding is initially %NULL. After a successful file loading or saving
* operation, the encoding is non-%NULL.
*/
getEncoding(): Encoding
getFileMetadata(): FileMetadata
getLocation(): Gio.File
getNewlineType(): NewlineType
/**
* Gets the `file` short name. If the #GtefFile:location isn't %NULL,
* returns its display-name (see #G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME).
* Otherwise returns "Untitled File N", with N the Nth untitled file of the
* application, starting at 1. When an untitled file is closed, its number is
* released and can be used by a later untitled file.
*/
getShortName(): string
/**
* Returns whether the file has been deleted. If the
* #GtefFile:location is %NULL, returns %FALSE.
*
* To have an up-to-date value, you must first call
* gtef_file_check_file_on_disk().
*/
isDeleted(): boolean
/**
* Returns whether the file is externally modified. If the
* #GtefFile:location is %NULL, returns %FALSE.
*
* To have an up-to-date value, you must first call
* gtef_file_check_file_on_disk().
*/
isExternallyModified(): boolean
/**
* Returns whether the file is local. If the #GtefFile:location is %NULL,
* returns %FALSE.
*/
isLocal(): boolean
/**
* Returns whether the file is read-only. If the
* #GtefFile:location is %NULL, returns %FALSE.
*
* To have an up-to-date value, you must first call
* gtef_file_check_file_on_disk().
*/
isReadonly(): boolean
/**
* Sets the location.
* @param location the new #GFile, or %NULL.
*/
setLocation(location: Gio.File | null): void
// Class property signals of Gtef-2.Gtef.File
connect(sigName: "notify::compression-type", callback: (...args: any[]) => void): number
on(sigName: "notify::compression-type", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
once(sigName: "notify::compression-type", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
off(sigName: "notify::compression-type", callback: (...args: any[]) => void): NodeJS.EventEmitter
emit(sigName: "notify::compression-type", ...args: any[]): void
connect(sigName: "notify::encoding", callback: (...args: any[]) => void): number
on(sigName: "notify::encoding", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
once(sigName: "notify::encoding", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
off(sigName: "notify::encoding", callback: (...args: any[]) => void): NodeJS.EventEmitter
emit(sigName: "notify::encoding", ...args: any[]): void
connect(sigName: "notify::location", callback: (...args: any[]) => void): number
on(sigName: "notify::location", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
once(sigName: "notify::location", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
off(sigName: "notify::location", callback: (...args: any[]) => void): NodeJS.EventEmitter
emit(sigName: "notify::location", ...args: any[]): void
connect(sigName: "notify::newline-type", callback: (...args: any[]) => void): number
on(sigName: "notify::newline-type", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
once(sigName: "notify::newline-type", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
off(sigName: "notify::newline-type", callback: (...args: any[]) => void): NodeJS.EventEmitter
emit(sigName: "notify::newline-type", ...args: any[]): void
connect(sigName: "notify::read-only", callback: (...args: any[]) => void): number
on(sigName: "notify::read-only", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
once(sigName: "notify::read-only", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
off(sigName: "notify::read-only", callback: (...args: any[]) => void): NodeJS.EventEmitter
emit(sigName: "notify::read-only", ...args: any[]): void
connect(sigName: "notify::short-name", callback: (...args: any[]) => void): number
on(sigName: "notify::short-name", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
once(sigName: "notify::short-name", callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
off(sigName: "notify::short-name", callback: (...args: any[]) => void): NodeJS.EventEmitter
emit(sigName: "notify::short-name", ...args: any[]): void
connect(sigName: string, callback: (...args: any[]) => void): number
on(sigName: string, callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
once(sigName: string, callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
off(sigName: string, callback: (...args: any[]) => void): NodeJS.EventEmitter
emit(sigName: string, ...args: any[]): void
}
class File extends GObject.Object {
// Own properties of Gtef-2.Gtef.File
static name: string
static $gtype: GObject.GType<File>
// Constructors of Gtef-2.Gtef.File
constructor(config?: File_ConstructProps)
constructor()
static new(): File
_init(config?: File_ConstructProps): void
}
interface FileLoader_ConstructProps extends GObject.Object_ConstructProps {
// Own constructor properties of Gtef-2.Gtef.FileLoader
/**
* The #GtefBuffer to load the content into. The #GtefFileLoader object
* has a weak reference to the buffer.
*/
buffer?: Buffer | null
/**
* The chunk size, in bytes. The content is loaded chunk by chunk. It
* permits to avoid allocating a too big contiguous memory area, as well
* as reporting progress information after each chunk read.
*
* A small chunk size is better when loading a remote file with a slow
* connection. For local files, the chunk size can be larger.
*/
chunkSize?: number | null
/**