| 1 | /// <reference path="./xlib-2.0.d.ts" /> |
| 2 | /// <reference path="./cairo-1.0.d.ts" /> |
| 3 | /// <reference path="./cairo.d.ts" /> |
| 4 | /// <reference path="./gobject-2.0.d.ts" /> |
| 5 | /// <reference path="./glib-2.0.d.ts" /> |
| 6 | /// <reference path="./pango-1.0.d.ts" /> |
| 7 | /// <reference path="./harfbuzz-0.0.d.ts" /> |
| 8 | /// <reference path="./freetype2-2.0.d.ts" /> |
| 9 | /// <reference path="./gio-2.0.d.ts" /> |
| 10 | /// <reference path="./gmodule-2.0.d.ts" /> |
| 11 | /// <reference path="./gdkpixbuf-2.0.d.ts" /> |
| 12 | /// <reference path="./gdk-3.0.d.ts" /> |
| 13 | |
| 14 | /** |
| 15 | * Type Definitions for Gjs (https://gjs.guide/) |
| 16 | * |
| 17 | * These type definitions are automatically generated, do not edit them by hand. |
| 18 | * If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir |
| 19 | * |
| 20 | * The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ... |
| 21 | */ |
| 22 | |
| 23 | declare module 'gi://GdkX11?version=3.0' { |
| 24 | // Module dependencies |
| 25 | import type xlib from 'gi://xlib?version=2.0'; |
| 26 | import type cairo from 'cairo'; |
| 27 | import type GObject from 'gi://GObject?version=2.0'; |
| 28 | import type GLib from 'gi://GLib?version=2.0'; |
| 29 | import type Pango from 'gi://Pango?version=1.0'; |
| 30 | import type HarfBuzz from 'gi://HarfBuzz?version=0.0'; |
| 31 | import type freetype2 from 'gi://freetype2?version=2.0'; |
| 32 | import type Gio from 'gi://Gio?version=2.0'; |
| 33 | import type GModule from 'gi://GModule?version=2.0'; |
| 34 | import type GdkPixbuf from 'gi://GdkPixbuf?version=2.0'; |
| 35 | import type Gdk from 'gi://Gdk?version=3.0'; |
| 36 | |
| 37 | export namespace GdkX11 { |
| 38 | /** |
| 39 | * GdkX11-3.0 |
| 40 | */ |
| 41 | |
| 42 | /** |
| 43 | * Converts from a #GdkAtom to the X atom for the default GDK display |
| 44 | * with the same string value. |
| 45 | * @param atom A #GdkAtom |
| 46 | * @returns the X atom corresponding to @atom. |
| 47 | */ |
| 48 | function x11_atom_to_xatom(atom: Gdk.Atom): xlib.Atom; |
| 49 | /** |
| 50 | * Converts from a #GdkAtom to the X atom for a #GdkDisplay |
| 51 | * with the same string value. The special value %GDK_NONE |
| 52 | * is converted to %None. |
| 53 | * @param display A #GdkDisplay |
| 54 | * @param atom A #GdkAtom, or %GDK_NONE |
| 55 | * @returns the X atom corresponding to @atom, or %None |
| 56 | */ |
| 57 | function x11_atom_to_xatom_for_display(display: X11Display, atom: Gdk.Atom): xlib.Atom; |
| 58 | /** |
| 59 | * Returns the device ID as seen by XInput2. |
| 60 | * |
| 61 | * > If gdk_disable_multidevice() has been called, this function |
| 62 | * > will respectively return 2/3 for the core pointer and keyboard, |
| 63 | * > (matching the IDs for the Virtual Core Pointer and Keyboard in |
| 64 | * > XInput 2), but calling this function on any slave devices (i.e. |
| 65 | * > those managed via XInput 1.x), will return 0. |
| 66 | * @param device a #GdkDevice |
| 67 | * @returns the XInput2 device ID. |
| 68 | */ |
| 69 | function x11_device_get_id(device: X11DeviceCore): number; |
| 70 | /** |
| 71 | * Returns the #GdkDevice that wraps the given device ID. |
| 72 | * @param device_manager a #GdkDeviceManager |
| 73 | * @param device_id a device ID, as understood by the XInput2 protocol |
| 74 | * @returns The #GdkDevice wrapping the device ID, or %NULL if the given ID doesn’t currently represent a device. |
| 75 | */ |
| 76 | function x11_device_manager_lookup( |
| 77 | device_manager: X11DeviceManagerCore, |
| 78 | device_id: number, |
| 79 | ): X11DeviceCore | null; |
| 80 | /** |
| 81 | * Frees the data returned from gdk_x11_display_string_to_compound_text(). |
| 82 | * @param ctext The pointer stored in @ctext from a call to gdk_x11_display_string_to_compound_text(). |
| 83 | */ |
| 84 | function x11_free_compound_text(ctext: number): void; |
| 85 | /** |
| 86 | * Frees the array of strings created by |
| 87 | * gdk_x11_display_text_property_to_text_list(). |
| 88 | * @param list the value stored in the @list parameter by a call to gdk_x11_display_text_property_to_text_list(). |
| 89 | */ |
| 90 | function x11_free_text_list(list: string): void; |
| 91 | /** |
| 92 | * Gets the root window of the default screen |
| 93 | * (see gdk_x11_get_default_screen()). |
| 94 | * @returns an Xlib Window. |
| 95 | */ |
| 96 | function x11_get_default_root_xwindow(): xlib.Window; |
| 97 | /** |
| 98 | * Gets the default GTK+ screen number. |
| 99 | * @returns returns the screen number specified by the --display command line option or the DISPLAY environment variable when gdk_init() calls XOpenDisplay(). |
| 100 | */ |
| 101 | function x11_get_default_screen(): number; |
| 102 | /** |
| 103 | * Gets the default GTK+ display. |
| 104 | * @returns the Xlib Display* for the display specified in the `--display` command line option or the `DISPLAY` environment variable. |
| 105 | */ |
| 106 | function x11_get_default_xdisplay(): xlib.Display; |
| 107 | /** |
| 108 | * Used with gdk_window_set_background_pattern() to inherit background from |
| 109 | * parent window. Useful for imitating transparency when compositing is not |
| 110 | * available. Otherwise behaves like a transparent pattern. |
| 111 | */ |
| 112 | function x11_get_parent_relative_pattern(): cairo.Pattern; |
| 113 | /** |
| 114 | * Routine to get the current X server time stamp. |
| 115 | * @param window a #GdkWindow, used for communication with the server. The window must have GDK_PROPERTY_CHANGE_MASK in its events mask or a hang will result. |
| 116 | * @returns the time stamp. |
| 117 | */ |
| 118 | function x11_get_server_time(window: X11Window): number; |
| 119 | /** |
| 120 | * Returns the X atom for GDK’s default display corresponding to `atom_name`. |
| 121 | * This function caches the result, so if called repeatedly it is much |
| 122 | * faster than XInternAtom(), which is a round trip to the server each time. |
| 123 | * @param atom_name a string |
| 124 | * @returns a X atom for GDK’s default display. |
| 125 | */ |
| 126 | function x11_get_xatom_by_name(atom_name: string): xlib.Atom; |
| 127 | /** |
| 128 | * Returns the X atom for a #GdkDisplay corresponding to `atom_name`. |
| 129 | * This function caches the result, so if called repeatedly it is much |
| 130 | * faster than XInternAtom(), which is a round trip to the server each time. |
| 131 | * @param display a #GdkDisplay |
| 132 | * @param atom_name a string |
| 133 | * @returns a X atom for a #GdkDisplay |
| 134 | */ |
| 135 | function x11_get_xatom_by_name_for_display(display: X11Display, atom_name: string): xlib.Atom; |
| 136 | /** |
| 137 | * Returns the name of an X atom for GDK’s default display. This |
| 138 | * function is meant mainly for debugging, so for convenience, unlike |
| 139 | * XAtomName() and gdk_atom_name(), the result |
| 140 | * doesn’t need to be freed. Also, this function will never return %NULL, |
| 141 | * even if `xatom` is invalid. |
| 142 | * @param xatom an X atom for GDK’s default display |
| 143 | * @returns name of the X atom; this string is owned by GTK+, so it shouldn’t be modifed or freed. |
| 144 | */ |
| 145 | function x11_get_xatom_name(xatom: xlib.Atom): string; |
| 146 | /** |
| 147 | * Returns the name of an X atom for its display. This |
| 148 | * function is meant mainly for debugging, so for convenience, unlike |
| 149 | * XAtomName() and gdk_atom_name(), the result doesn’t need to |
| 150 | * be freed. |
| 151 | * @param display the #GdkDisplay where @xatom is defined |
| 152 | * @param xatom an X atom |
| 153 | * @returns name of the X atom; this string is owned by GDK, so it shouldn’t be modifed or freed. |
| 154 | */ |
| 155 | function x11_get_xatom_name_for_display(display: X11Display, xatom: xlib.Atom): string; |
| 156 | /** |
| 157 | * Call gdk_x11_display_grab() on the default display. |
| 158 | * To ungrab the server again, use gdk_x11_ungrab_server(). |
| 159 | * |
| 160 | * gdk_x11_grab_server()/gdk_x11_ungrab_server() calls can be nested. |
| 161 | */ |
| 162 | function x11_grab_server(): void; |
| 163 | /** |
| 164 | * Find the #GdkDisplay corresponding to `xdisplay,` if any exists. |
| 165 | * @param xdisplay a pointer to an X Display |
| 166 | * @returns the #GdkDisplay, if found, otherwise %NULL. |
| 167 | */ |
| 168 | function x11_lookup_xdisplay(xdisplay: xlib.Display): X11Display; |
| 169 | /** |
| 170 | * Registers interest in receiving extension events with type codes |
| 171 | * between `event_base` and `event_base + n_events - 1`. |
| 172 | * The registered events must have the window field in the same place |
| 173 | * as core X events (this is not the case for e.g. XKB extension events). |
| 174 | * |
| 175 | * If an event type is registered, events of this type will go through |
| 176 | * global and window-specific filters (see gdk_window_add_filter()). |
| 177 | * Unregistered events will only go through global filters. |
| 178 | * GDK may register the events of some X extensions on its own. |
| 179 | * |
| 180 | * This function should only be needed in unusual circumstances, e.g. |
| 181 | * when filtering XInput extension events on the root window. |
| 182 | * @param display a #GdkDisplay |
| 183 | * @param event_base first event type code to register |
| 184 | * @param n_events number of event type codes to register |
| 185 | */ |
| 186 | function x11_register_standard_event_type(display: X11Display, event_base: number, n_events: number): void; |
| 187 | /** |
| 188 | * Sets the `SM_CLIENT_ID` property on the application’s leader window so that |
| 189 | * the window manager can save the application’s state using the X11R6 ICCCM |
| 190 | * session management protocol. |
| 191 | * |
| 192 | * See the X Session Management Library documentation for more information on |
| 193 | * session management and the Inter-Client Communication Conventions Manual |
| 194 | * @param sm_client_id the client id assigned by the session manager when the connection was opened, or %NULL to remove the property. |
| 195 | */ |
| 196 | function x11_set_sm_client_id(sm_client_id?: string | null): void; |
| 197 | /** |
| 198 | * Ungrab the default display after it has been grabbed with |
| 199 | * gdk_x11_grab_server(). |
| 200 | */ |
| 201 | function x11_ungrab_server(): void; |
| 202 | /** |
| 203 | * Convert from an X atom for the default display to the corresponding |
| 204 | * #GdkAtom. |
| 205 | * @param xatom an X atom for the default GDK display |
| 206 | * @returns the corresponding G#dkAtom. |
| 207 | */ |
| 208 | function x11_xatom_to_atom(xatom: xlib.Atom): Gdk.Atom; |
| 209 | /** |
| 210 | * Convert from an X atom for a #GdkDisplay to the corresponding |
| 211 | * #GdkAtom. |
| 212 | * @param display A #GdkDisplay |
| 213 | * @param xatom an X atom |
| 214 | * @returns the corresponding #GdkAtom. |
| 215 | */ |
| 216 | function x11_xatom_to_atom_for_display(display: X11Display, xatom: xlib.Atom): Gdk.Atom; |
| 217 | namespace X11AppLaunchContext { |
| 218 | // Constructor properties interface |
| 219 | |
| 220 | interface ConstructorProps extends Gdk.AppLaunchContext.ConstructorProps {} |
| 221 | } |
| 222 | |
| 223 | class X11AppLaunchContext extends Gdk.AppLaunchContext { |
| 224 | static $gtype: GObject.GType<X11AppLaunchContext>; |
| 225 | |
| 226 | // Constructors |
| 227 | |
| 228 | constructor(properties?: Partial<X11AppLaunchContext.ConstructorProps>, ...args: any[]); |
| 229 | |
| 230 | _init(...args: any[]): void; |
| 231 | } |
| 232 | |
| 233 | namespace X11Cursor { |
| 234 | // Constructor properties interface |
| 235 | |
| 236 | interface ConstructorProps extends Gdk.Cursor.ConstructorProps {} |
| 237 | } |
| 238 | |
| 239 | class X11Cursor extends Gdk.Cursor { |
| 240 | static $gtype: GObject.GType<X11Cursor>; |
| 241 | |
| 242 | // Constructors |
| 243 | |
| 244 | constructor(properties?: Partial<X11Cursor.ConstructorProps>, ...args: any[]); |
| 245 | |
| 246 | _init(...args: any[]): void; |
| 247 | |
| 248 | // Methods |
| 249 | |
| 250 | /** |
| 251 | * Returns the X cursor belonging to a #GdkCursor. |
| 252 | * @returns an Xlib Cursor. |
| 253 | */ |
| 254 | get_xcursor(): xlib.Cursor; |
| 255 | /** |
| 256 | * Returns the display of a #GdkCursor. |
| 257 | * @returns an Xlib Display*. |
| 258 | */ |
| 259 | get_xdisplay(): xlib.Display; |
| 260 | } |
| 261 | |
| 262 | namespace X11DeviceCore { |
| 263 | // Constructor properties interface |
| 264 | |
| 265 | interface ConstructorProps extends Gdk.Device.ConstructorProps {} |
| 266 | } |
| 267 | |
| 268 | class X11DeviceCore extends Gdk.Device { |
| 269 | static $gtype: GObject.GType<X11DeviceCore>; |
| 270 | |
| 271 | // Constructors |
| 272 | |
| 273 | constructor(properties?: Partial<X11DeviceCore.ConstructorProps>, ...args: any[]); |
| 274 | |
| 275 | _init(...args: any[]): void; |
| 276 | } |
| 277 | |
| 278 | namespace X11DeviceManagerCore { |
| 279 | // Constructor properties interface |
| 280 | |
| 281 | interface ConstructorProps extends Gdk.DeviceManager.ConstructorProps {} |
| 282 | } |
| 283 | |
| 284 | class X11DeviceManagerCore extends Gdk.DeviceManager { |
| 285 | static $gtype: GObject.GType<X11DeviceManagerCore>; |
| 286 | |
| 287 | // Constructors |
| 288 | |
| 289 | constructor(properties?: Partial<X11DeviceManagerCore.ConstructorProps>, ...args: any[]); |
| 290 | |
| 291 | _init(...args: any[]): void; |
| 292 | } |
| 293 | |
| 294 | namespace X11DeviceManagerXI2 { |
| 295 | // Constructor properties interface |
| 296 | |
| 297 | interface ConstructorProps extends X11DeviceManagerCore.ConstructorProps { |
| 298 | major: number; |
| 299 | minor: number; |
| 300 | opcode: number; |
| 301 | } |
| 302 | } |
| 303 | |
| 304 | class X11DeviceManagerXI2 extends X11DeviceManagerCore { |
| 305 | static $gtype: GObject.GType<X11DeviceManagerXI2>; |
| 306 | |
| 307 | // Properties |
| 308 | |
| 309 | get major(): number; |
| 310 | get minor(): number; |
| 311 | get opcode(): number; |
| 312 | |
| 313 | // Constructors |
| 314 | |
| 315 | constructor(properties?: Partial<X11DeviceManagerXI2.ConstructorProps>, ...args: any[]); |
| 316 | |
| 317 | _init(...args: any[]): void; |
| 318 | } |
| 319 | |
| 320 | namespace X11DeviceXI2 { |
| 321 | // Constructor properties interface |
| 322 | |
| 323 | interface ConstructorProps extends Gdk.Device.ConstructorProps { |
| 324 | device_id: number; |
| 325 | deviceId: number; |
| 326 | } |
| 327 | } |
| 328 | |
| 329 | class X11DeviceXI2 extends Gdk.Device { |
| 330 | static $gtype: GObject.GType<X11DeviceXI2>; |
| 331 | |
| 332 | // Properties |
| 333 | |
| 334 | get device_id(): number; |
| 335 | get deviceId(): number; |
| 336 | |
| 337 | // Constructors |
| 338 | |
| 339 | constructor(properties?: Partial<X11DeviceXI2.ConstructorProps>, ...args: any[]); |
| 340 | |
| 341 | _init(...args: any[]): void; |
| 342 | } |
| 343 | |
| 344 | namespace X11Display { |
| 345 | // Constructor properties interface |
| 346 | |
| 347 | interface ConstructorProps extends Gdk.Display.ConstructorProps {} |
| 348 | } |
| 349 | |
| 350 | class X11Display extends Gdk.Display { |
| 351 | static $gtype: GObject.GType<X11Display>; |
| 352 | |
| 353 | // Constructors |
| 354 | |
| 355 | constructor(properties?: Partial<X11Display.ConstructorProps>, ...args: any[]); |
| 356 | |
| 357 | _init(...args: any[]): void; |
| 358 | |
| 359 | // Static methods |
| 360 | |
| 361 | /** |
| 362 | * Retrieves the version of the GLX implementation. |
| 363 | * @param display a #GdkDisplay |
| 364 | */ |
| 365 | static get_glx_version(display: Gdk.Display): [boolean, number, number]; |
| 366 | |
| 367 | // Methods |
| 368 | |
| 369 | /** |
| 370 | * Pops the error trap pushed by gdk_x11_display_error_trap_push(). |
| 371 | * Will XSync() if necessary and will always block until |
| 372 | * the error is known to have occurred or not occurred, |
| 373 | * so the error code can be returned. |
| 374 | * |
| 375 | * If you don’t need to use the return value, |
| 376 | * gdk_x11_display_error_trap_pop_ignored() would be more efficient. |
| 377 | * |
| 378 | * See gdk_error_trap_pop() for the all-displays-at-once |
| 379 | * equivalent. |
| 380 | * @returns X error code or 0 on success |
| 381 | */ |
| 382 | error_trap_pop(): number; |
| 383 | /** |
| 384 | * Pops the error trap pushed by gdk_x11_display_error_trap_push(). |
| 385 | * Does not block to see if an error occurred; merely records the |
| 386 | * range of requests to ignore errors for, and ignores those errors |
| 387 | * if they arrive asynchronously. |
| 388 | * |
| 389 | * See gdk_error_trap_pop_ignored() for the all-displays-at-once |
| 390 | * equivalent. |
| 391 | */ |
| 392 | error_trap_pop_ignored(): void; |
| 393 | /** |
| 394 | * Begins a range of X requests on `display` for which X error events |
| 395 | * will be ignored. Unignored errors (when no trap is pushed) will abort |
| 396 | * the application. Use gdk_x11_display_error_trap_pop() or |
| 397 | * gdk_x11_display_error_trap_pop_ignored()to lift a trap pushed |
| 398 | * with this function. |
| 399 | * |
| 400 | * See also gdk_error_trap_push() to push a trap on all displays. |
| 401 | */ |
| 402 | error_trap_push(): void; |
| 403 | /** |
| 404 | * Gets the startup notification ID for a display. |
| 405 | * @returns the startup notification ID for @display |
| 406 | */ |
| 407 | get_startup_notification_id(): string; |
| 408 | /** |
| 409 | * Returns the timestamp of the last user interaction on |
| 410 | * `display`. The timestamp is taken from events caused |
| 411 | * by user interaction such as key presses or pointer |
| 412 | * movements. See gdk_x11_window_set_user_time(). |
| 413 | * @returns the timestamp of the last user interaction |
| 414 | */ |
| 415 | get_user_time(): number; |
| 416 | /** |
| 417 | * Returns the X display of a #GdkDisplay. |
| 418 | * @returns an X display |
| 419 | */ |
| 420 | get_xdisplay(): xlib.Display; |
| 421 | /** |
| 422 | * Call XGrabServer() on `display`. |
| 423 | * To ungrab the display again, use gdk_x11_display_ungrab(). |
| 424 | * |
| 425 | * gdk_x11_display_grab()/gdk_x11_display_ungrab() calls can be nested. |
| 426 | */ |
| 427 | grab(): void; |
| 428 | /** |
| 429 | * Sets the cursor theme from which the images for cursor |
| 430 | * should be taken. |
| 431 | * |
| 432 | * If the windowing system supports it, existing cursors created |
| 433 | * with gdk_cursor_new(), gdk_cursor_new_for_display() and |
| 434 | * gdk_cursor_new_from_name() are updated to reflect the theme |
| 435 | * change. Custom cursors constructed with |
| 436 | * gdk_cursor_new_from_pixbuf() will have to be handled |
| 437 | * by the application (GTK+ applications can learn about |
| 438 | * cursor theme changes by listening for change notification |
| 439 | * for the corresponding #GtkSetting). |
| 440 | * @param theme the name of the cursor theme to use, or %NULL to unset a previously set value |
| 441 | * @param size the cursor size to use, or 0 to keep the previous size |
| 442 | */ |
| 443 | set_cursor_theme(theme: string | null, size: number): void; |
| 444 | /** |
| 445 | * Sets the startup notification ID for a display. |
| 446 | * |
| 447 | * This is usually taken from the value of the DESKTOP_STARTUP_ID |
| 448 | * environment variable, but in some cases (such as the application not |
| 449 | * being launched using exec()) it can come from other sources. |
| 450 | * |
| 451 | * If the ID contains the string "_TIME" then the portion following that |
| 452 | * string is taken to be the X11 timestamp of the event that triggered |
| 453 | * the application to be launched and the GDK current event time is set |
| 454 | * accordingly. |
| 455 | * |
| 456 | * The startup ID is also what is used to signal that the startup is |
| 457 | * complete (for example, when opening a window or when calling |
| 458 | * gdk_notify_startup_complete()). |
| 459 | * @param startup_id the startup notification ID (must be valid utf8) |
| 460 | */ |
| 461 | set_startup_notification_id(startup_id: string): void; |
| 462 | /** |
| 463 | * Forces a specific window scale for all windows on this display, |
| 464 | * instead of using the default or user configured scale. This |
| 465 | * is can be used to disable scaling support by setting `scale` to |
| 466 | * 1, or to programmatically set the window scale. |
| 467 | * |
| 468 | * Once the scale is set by this call it will not change in response |
| 469 | * to later user configuration changes. |
| 470 | * @param scale The new scale value |
| 471 | */ |
| 472 | set_window_scale(scale: number): void; |
| 473 | /** |
| 474 | * Convert a string from the encoding of the current |
| 475 | * locale into a form suitable for storing in a window property. |
| 476 | * @param str a nul-terminated string |
| 477 | * @returns 0 upon success, non-zero upon failure |
| 478 | */ |
| 479 | string_to_compound_text(str: string): [number, Gdk.Atom, number, Uint8Array]; |
| 480 | /** |
| 481 | * Convert a text string from the encoding as it is stored |
| 482 | * in a property into an array of strings in the encoding of |
| 483 | * the current locale. (The elements of the array represent the |
| 484 | * nul-separated elements of the original text string.) |
| 485 | * @param encoding an atom representing the encoding. The most common values for this are STRING, or COMPOUND_TEXT. This is value used as the type for the property |
| 486 | * @param format the format of the property |
| 487 | * @param text The text data |
| 488 | * @param length The number of items to transform |
| 489 | * @param list location to store an array of strings in the encoding of the current locale. This array should be freed using gdk_free_text_list(). |
| 490 | * @returns the number of strings stored in list, or 0, if the conversion failed |
| 491 | */ |
| 492 | text_property_to_text_list( |
| 493 | encoding: Gdk.Atom, |
| 494 | format: number, |
| 495 | text: number, |
| 496 | length: number, |
| 497 | list: string, |
| 498 | ): number; |
| 499 | /** |
| 500 | * Ungrab `display` after it has been grabbed with |
| 501 | * gdk_x11_display_grab(). |
| 502 | */ |
| 503 | ungrab(): void; |
| 504 | /** |
| 505 | * Converts from UTF-8 to compound text. |
| 506 | * @param str a UTF-8 string |
| 507 | * @returns %TRUE if the conversion succeeded, otherwise %FALSE |
| 508 | */ |
| 509 | utf8_to_compound_text(str: string): [boolean, Gdk.Atom, number, Uint8Array]; |
| 510 | } |
| 511 | |
| 512 | namespace X11DisplayManager { |
| 513 | // Constructor properties interface |
| 514 | |
| 515 | interface ConstructorProps extends Gdk.DisplayManager.ConstructorProps {} |
| 516 | } |
| 517 | |
| 518 | class X11DisplayManager extends Gdk.DisplayManager { |
| 519 | static $gtype: GObject.GType<X11DisplayManager>; |
| 520 | |
| 521 | // Constructors |
| 522 | |
| 523 | constructor(properties?: Partial<X11DisplayManager.ConstructorProps>, ...args: any[]); |
| 524 | |
| 525 | _init(...args: any[]): void; |
| 526 | } |
| 527 | |
| 528 | namespace X11DragContext { |
| 529 | // Constructor properties interface |
| 530 | |
| 531 | interface ConstructorProps extends Gdk.DragContext.ConstructorProps {} |
| 532 | } |
| 533 | |
| 534 | class X11DragContext extends Gdk.DragContext { |
| 535 | static $gtype: GObject.GType<X11DragContext>; |
| 536 | |
| 537 | // Constructors |
| 538 | |
| 539 | constructor(properties?: Partial<X11DragContext.ConstructorProps>, ...args: any[]); |
| 540 | |
| 541 | _init(...args: any[]): void; |
| 542 | } |
| 543 | |
| 544 | namespace X11GLContext { |
| 545 | // Constructor properties interface |
| 546 | |
| 547 | interface ConstructorProps extends Gdk.GLContext.ConstructorProps {} |
| 548 | } |
| 549 | |
| 550 | class X11GLContext extends Gdk.GLContext { |
| 551 | static $gtype: GObject.GType<X11GLContext>; |
| 552 | |
| 553 | // Constructors |
| 554 | |
| 555 | constructor(properties?: Partial<X11GLContext.ConstructorProps>, ...args: any[]); |
| 556 | |
| 557 | _init(...args: any[]): void; |
| 558 | } |
| 559 | |
| 560 | namespace X11Keymap { |
| 561 | // Constructor properties interface |
| 562 | |
| 563 | interface ConstructorProps extends Gdk.Keymap.ConstructorProps {} |
| 564 | } |
| 565 | |
| 566 | class X11Keymap extends Gdk.Keymap { |
| 567 | static $gtype: GObject.GType<X11Keymap>; |
| 568 | |
| 569 | // Constructors |
| 570 | |
| 571 | constructor(properties?: Partial<X11Keymap.ConstructorProps>, ...args: any[]); |
| 572 | |
| 573 | _init(...args: any[]): void; |
| 574 | |
| 575 | // Methods |
| 576 | |
| 577 | /** |
| 578 | * Extracts the group from the state field sent in an X Key event. |
| 579 | * This is only needed for code processing raw X events, since #GdkEventKey |
| 580 | * directly includes an is_modifier field. |
| 581 | * @param state raw state returned from X |
| 582 | * @returns the index of the active keyboard group for the event |
| 583 | */ |
| 584 | get_group_for_state(state: number): number; |
| 585 | /** |
| 586 | * Determines whether a particular key code represents a key that |
| 587 | * is a modifier. That is, it’s a key that normally just affects |
| 588 | * the keyboard state and the behavior of other keys rather than |
| 589 | * producing a direct effect itself. This is only needed for code |
| 590 | * processing raw X events, since #GdkEventKey directly includes |
| 591 | * an is_modifier field. |
| 592 | * @param keycode the hardware keycode from a key event |
| 593 | * @returns %TRUE if the hardware keycode is a modifier key |
| 594 | */ |
| 595 | key_is_modifier(keycode: number): boolean; |
| 596 | } |
| 597 | |
| 598 | namespace X11Monitor { |
| 599 | // Constructor properties interface |
| 600 | |
| 601 | interface ConstructorProps extends Gdk.Monitor.ConstructorProps {} |
| 602 | } |
| 603 | |
| 604 | class X11Monitor extends Gdk.Monitor { |
| 605 | static $gtype: GObject.GType<X11Monitor>; |
| 606 | |
| 607 | // Constructors |
| 608 | |
| 609 | constructor(properties?: Partial<X11Monitor.ConstructorProps>, ...args: any[]); |
| 610 | |
| 611 | _init(...args: any[]): void; |
| 612 | |
| 613 | // Static methods |
| 614 | |
| 615 | static get_output(monitor: Gdk.Monitor): xlib.XID; |
| 616 | } |
| 617 | |
| 618 | namespace X11Screen { |
| 619 | // Signal callback interfaces |
| 620 | |
| 621 | interface WindowManagerChanged { |
| 622 | (): void; |
| 623 | } |
| 624 | |
| 625 | // Constructor properties interface |
| 626 | |
| 627 | interface ConstructorProps extends Gdk.Screen.ConstructorProps {} |
| 628 | } |
| 629 | |
| 630 | class X11Screen extends Gdk.Screen { |
| 631 | static $gtype: GObject.GType<X11Screen>; |
| 632 | |
| 633 | // Constructors |
| 634 | |
| 635 | constructor(properties?: Partial<X11Screen.ConstructorProps>, ...args: any[]); |
| 636 | |
| 637 | _init(...args: any[]): void; |
| 638 | |
| 639 | // Signals |
| 640 | |
| 641 | connect(id: string, callback: (...args: any[]) => any): number; |
| 642 | connect_after(id: string, callback: (...args: any[]) => any): number; |
| 643 | emit(id: string, ...args: any[]): void; |
| 644 | connect(signal: 'window-manager-changed', callback: (_source: this) => void): number; |
| 645 | connect_after(signal: 'window-manager-changed', callback: (_source: this) => void): number; |
| 646 | emit(signal: 'window-manager-changed'): void; |
| 647 | |
| 648 | // Methods |
| 649 | |
| 650 | /** |
| 651 | * Returns the current workspace for `screen` when running under a |
| 652 | * window manager that supports multiple workspaces, as described |
| 653 | * in the |
| 654 | * [Extended Window Manager Hints](http://www.freedesktop.org/Standards/wm-spec) specification. |
| 655 | * @returns the current workspace, or 0 if workspaces are not supported |
| 656 | */ |
| 657 | get_current_desktop(): number; |
| 658 | /** |
| 659 | * Gets the XID of the specified output/monitor. |
| 660 | * If the X server does not support version 1.2 of the RANDR |
| 661 | * extension, 0 is returned. |
| 662 | * @param monitor_num number of the monitor, between 0 and gdk_screen_get_n_monitors (screen) |
| 663 | * @returns the XID of the monitor |
| 664 | */ |
| 665 | get_monitor_output(monitor_num: number): xlib.XID; |
| 666 | /** |
| 667 | * Returns the number of workspaces for `screen` when running under a |
| 668 | * window manager that supports multiple workspaces, as described |
| 669 | * in the |
| 670 | * [Extended Window Manager Hints](http://www.freedesktop.org/Standards/wm-spec) specification. |
| 671 | * @returns the number of workspaces, or 0 if workspaces are not supported |
| 672 | */ |
| 673 | get_number_of_desktops(): number; |
| 674 | /** |
| 675 | * Returns the index of a #GdkScreen. |
| 676 | * @returns the position of @screen among the screens of its display |
| 677 | */ |
| 678 | get_screen_number(): number; |
| 679 | /** |
| 680 | * Returns the name of the window manager for `screen`. |
| 681 | * @returns the name of the window manager screen @screen, or "unknown" if the window manager is unknown. The string is owned by GDK and should not be freed. |
| 682 | */ |
| 683 | get_window_manager_name(): string; |
| 684 | /** |
| 685 | * Returns the screen of a #GdkScreen. |
| 686 | * @returns an Xlib Screen* |
| 687 | */ |
| 688 | get_xscreen(): xlib.Screen; |
| 689 | /** |
| 690 | * Looks up the #GdkVisual for a particular screen and X Visual ID. |
| 691 | * @param xvisualid an X Visual ID. |
| 692 | * @returns the #GdkVisual (owned by the screen object), or %NULL if the visual ID wasn’t found. |
| 693 | */ |
| 694 | lookup_visual(xvisualid: xlib.VisualID): X11Visual; |
| 695 | /** |
| 696 | * This function is specific to the X11 backend of GDK, and indicates |
| 697 | * whether the window manager supports a certain hint from the |
| 698 | * [Extended Window Manager Hints](http://www.freedesktop.org/Standards/wm-spec) specification. |
| 699 | * |
| 700 | * When using this function, keep in mind that the window manager |
| 701 | * can change over time; so you shouldn’t use this function in |
| 702 | * a way that impacts persistent application state. A common bug |
| 703 | * is that your application can start up before the window manager |
| 704 | * does when the user logs in, and before the window manager starts |
| 705 | * gdk_x11_screen_supports_net_wm_hint() will return %FALSE for every property. |
| 706 | * You can monitor the window_manager_changed signal on #GdkScreen to detect |
| 707 | * a window manager change. |
| 708 | * @param property a property atom. |
| 709 | * @returns %TRUE if the window manager supports @property |
| 710 | */ |
| 711 | supports_net_wm_hint(property: Gdk.Atom): boolean; |
| 712 | } |
| 713 | |
| 714 | namespace X11Visual { |
| 715 | // Constructor properties interface |
| 716 | |
| 717 | interface ConstructorProps extends Gdk.Visual.ConstructorProps {} |
| 718 | } |
| 719 | |
| 720 | class X11Visual extends Gdk.Visual { |
| 721 | static $gtype: GObject.GType<X11Visual>; |
| 722 | |
| 723 | // Constructors |
| 724 | |
| 725 | constructor(properties?: Partial<X11Visual.ConstructorProps>, ...args: any[]); |
| 726 | |
| 727 | _init(...args: any[]): void; |
| 728 | |
| 729 | // Methods |
| 730 | |
| 731 | /** |
| 732 | * Returns the X visual belonging to a #GdkVisual. |
| 733 | * @returns an Xlib Visual*. |
| 734 | */ |
| 735 | get_xvisual(): xlib.Visual; |
| 736 | } |
| 737 | |
| 738 | namespace X11Window { |
| 739 | // Constructor properties interface |
| 740 | |
| 741 | interface ConstructorProps extends Gdk.Window.ConstructorProps {} |
| 742 | } |
| 743 | |
| 744 | class X11Window extends Gdk.Window { |
| 745 | static $gtype: GObject.GType<X11Window>; |
| 746 | |
| 747 | // Constructors |
| 748 | |
| 749 | constructor(properties?: Partial<X11Window.ConstructorProps>, ...args: any[]); |
| 750 | |
| 751 | _init(...args: any[]): void; |
| 752 | |
| 753 | static foreign_new_for_display(display: X11Display, window: xlib.Window): X11Window; |
| 754 | |
| 755 | // Static methods |
| 756 | |
| 757 | /** |
| 758 | * Looks up the #GdkWindow that wraps the given native window handle. |
| 759 | * @param display the #GdkDisplay corresponding to the window handle |
| 760 | * @param window an Xlib Window |
| 761 | */ |
| 762 | static lookup_for_display(display: X11Display, window: xlib.Window): X11Window; |
| 763 | |
| 764 | // Methods |
| 765 | |
| 766 | /** |
| 767 | * Gets the number of the workspace `window` is on. |
| 768 | * @returns the current workspace of @window |
| 769 | */ |
| 770 | get_desktop(): number; |
| 771 | /** |
| 772 | * Returns the X resource (window) belonging to a #GdkWindow. |
| 773 | * @returns the ID of @drawable’s X resource. |
| 774 | */ |
| 775 | get_xid(): xlib.Window; |
| 776 | /** |
| 777 | * Moves the window to the correct workspace when running under a |
| 778 | * window manager that supports multiple workspaces, as described |
| 779 | * in the [Extended Window Manager Hints](http://www.freedesktop.org/Standards/wm-spec) specification. |
| 780 | * Will not do anything if the window is already on all workspaces. |
| 781 | */ |
| 782 | move_to_current_desktop(): void; |
| 783 | /** |
| 784 | * Moves the window to the given workspace when running unde a |
| 785 | * window manager that supports multiple workspaces, as described |
| 786 | * in the [Extended Window Manager Hints](http://www.freedesktop.org/Standards/wm-spec) specification. |
| 787 | * @param desktop the number of the workspace to move the window to |
| 788 | */ |
| 789 | move_to_desktop(desktop: number): void; |
| 790 | /** |
| 791 | * This is the same as gdk_window_set_shadow_width() but it only works |
| 792 | * on GdkX11Window. |
| 793 | * @param left The left extent |
| 794 | * @param right The right extent |
| 795 | * @param top The top extent |
| 796 | * @param bottom The bottom extent |
| 797 | */ |
| 798 | set_frame_extents(left: number, right: number, top: number, bottom: number): void; |
| 799 | /** |
| 800 | * This function can be used to disable frame synchronization for a window. |
| 801 | * Normally frame synchronziation will be enabled or disabled based on whether |
| 802 | * the system has a compositor that supports frame synchronization, but if |
| 803 | * the window is not directly managed by the window manager, then frame |
| 804 | * synchronziation may need to be disabled. This is the case for a window |
| 805 | * embedded via the XEMBED protocol. |
| 806 | * @param frame_sync_enabled whether frame-synchronization should be enabled |
| 807 | */ |
| 808 | set_frame_sync_enabled(frame_sync_enabled: boolean): void; |
| 809 | /** |
| 810 | * Set a hint for the window manager, requesting that the titlebar |
| 811 | * should be hidden when the window is maximized. |
| 812 | * |
| 813 | * Note that this property is automatically updated by GTK+, so this |
| 814 | * function should only be used by applications which do not use GTK+ |
| 815 | * to create toplevel windows. |
| 816 | * @param hide_titlebar_when_maximized whether to hide the titlebar when maximized |
| 817 | */ |
| 818 | set_hide_titlebar_when_maximized(hide_titlebar_when_maximized: boolean): void; |
| 819 | /** |
| 820 | * GTK+ applications can request a dark theme variant. In order to |
| 821 | * make other applications - namely window managers using GTK+ for |
| 822 | * themeing - aware of this choice, GTK+ uses this function to |
| 823 | * export the requested theme variant as _GTK_THEME_VARIANT property |
| 824 | * on toplevel windows. |
| 825 | * |
| 826 | * Note that this property is automatically updated by GTK+, so this |
| 827 | * function should only be used by applications which do not use GTK+ |
| 828 | * to create toplevel windows. |
| 829 | * @param variant the theme variant to export |
| 830 | */ |
| 831 | set_theme_variant(variant: string): void; |
| 832 | /** |
| 833 | * The application can use this call to update the _NET_WM_USER_TIME |
| 834 | * property on a toplevel window. This property stores an Xserver |
| 835 | * time which represents the time of the last user input event |
| 836 | * received for this window. This property may be used by the window |
| 837 | * manager to alter the focus, stacking, and/or placement behavior of |
| 838 | * windows when they are mapped depending on whether the new window |
| 839 | * was created by a user action or is a "pop-up" window activated by a |
| 840 | * timer or some other event. |
| 841 | * |
| 842 | * Note that this property is automatically updated by GDK, so this |
| 843 | * function should only be used by applications which handle input |
| 844 | * events bypassing GDK. |
| 845 | * @param timestamp An XServer timestamp to which the property should be set |
| 846 | */ |
| 847 | set_user_time(timestamp: number): void; |
| 848 | /** |
| 849 | * This function modifies or removes an arbitrary X11 window |
| 850 | * property of type UTF8_STRING. If the given `window` is |
| 851 | * not a toplevel window, it is ignored. |
| 852 | * @param name Property name, will be interned as an X atom |
| 853 | * @param value Property value, or %NULL to delete |
| 854 | */ |
| 855 | set_utf8_property(name: string, value?: string | null): void; |
| 856 | } |
| 857 | |
| 858 | type X11AppLaunchContextClass = typeof X11AppLaunchContext; |
| 859 | type X11CursorClass = typeof X11Cursor; |
| 860 | type X11DeviceCoreClass = typeof X11DeviceCore; |
| 861 | type X11DeviceManagerCoreClass = typeof X11DeviceManagerCore; |
| 862 | type X11DeviceManagerXI2Class = typeof X11DeviceManagerXI2; |
| 863 | type X11DeviceXI2Class = typeof X11DeviceXI2; |
| 864 | type X11DisplayClass = typeof X11Display; |
| 865 | type X11DisplayManagerClass = typeof X11DisplayManager; |
| 866 | type X11DragContextClass = typeof X11DragContext; |
| 867 | type X11GLContextClass = typeof X11GLContext; |
| 868 | type X11KeymapClass = typeof X11Keymap; |
| 869 | type X11MonitorClass = typeof X11Monitor; |
| 870 | type X11ScreenClass = typeof X11Screen; |
| 871 | type X11VisualClass = typeof X11Visual; |
| 872 | type X11WindowClass = typeof X11Window; |
| 873 | /** |
| 874 | * Name of the imported GIR library |
| 875 | * `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188 |
| 876 | */ |
| 877 | const __name__: string; |
| 878 | /** |
| 879 | * Version of the imported GIR library |
| 880 | * `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189 |
| 881 | */ |
| 882 | const __version__: string; |
| 883 | } |
| 884 | |
| 885 | export default GdkX11; |
| 886 | } |
| 887 | |
| 888 | declare module 'gi://GdkX11' { |
| 889 | import GdkX1130 from 'gi://GdkX11?version=3.0'; |
| 890 | export default GdkX1130; |
| 891 | } |
| 892 | // END |