| 1 | /// <reference path="./xlib-2.0.d.ts" /> |
| 2 | /// <reference path="./gdk-4.0.d.ts" /> |
| 3 | /// <reference path="./cairo-1.0.d.ts" /> |
| 4 | /// <reference path="./cairo.d.ts" /> |
| 5 | /// <reference path="./gobject-2.0.d.ts" /> |
| 6 | /// <reference path="./glib-2.0.d.ts" /> |
| 7 | /// <reference path="./pangocairo-1.0.d.ts" /> |
| 8 | /// <reference path="./pango-1.0.d.ts" /> |
| 9 | /// <reference path="./harfbuzz-0.0.d.ts" /> |
| 10 | /// <reference path="./freetype2-2.0.d.ts" /> |
| 11 | /// <reference path="./gio-2.0.d.ts" /> |
| 12 | /// <reference path="./gmodule-2.0.d.ts" /> |
| 13 | /// <reference path="./gdkpixbuf-2.0.d.ts" /> |
| 14 | |
| 15 | /** |
| 16 | * Type Definitions for Gjs (https://gjs.guide/) |
| 17 | * |
| 18 | * These type definitions are automatically generated, do not edit them by hand. |
| 19 | * If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir |
| 20 | * |
| 21 | * The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ... |
| 22 | */ |
| 23 | |
| 24 | declare module 'gi://GdkX11?version=4.0' { |
| 25 | // Module dependencies |
| 26 | import type xlib from 'gi://xlib?version=2.0'; |
| 27 | import type Gdk from 'gi://Gdk?version=4.0'; |
| 28 | import type cairo from 'cairo'; |
| 29 | import type GObject from 'gi://GObject?version=2.0'; |
| 30 | import type GLib from 'gi://GLib?version=2.0'; |
| 31 | import type PangoCairo from 'gi://PangoCairo?version=1.0'; |
| 32 | import type Pango from 'gi://Pango?version=1.0'; |
| 33 | import type HarfBuzz from 'gi://HarfBuzz?version=0.0'; |
| 34 | import type freetype2 from 'gi://freetype2?version=2.0'; |
| 35 | import type Gio from 'gi://Gio?version=2.0'; |
| 36 | import type GModule from 'gi://GModule?version=2.0'; |
| 37 | import type GdkPixbuf from 'gi://GdkPixbuf?version=2.0'; |
| 38 | |
| 39 | export namespace GdkX11 { |
| 40 | /** |
| 41 | * GdkX11-4.0 |
| 42 | */ |
| 43 | |
| 44 | export namespace X11DeviceType { |
| 45 | export const $gtype: GObject.GType<X11DeviceType>; |
| 46 | } |
| 47 | |
| 48 | enum X11DeviceType { |
| 49 | LOGICAL, |
| 50 | PHYSICAL, |
| 51 | FLOATING, |
| 52 | } |
| 53 | /** |
| 54 | * Returns the device ID as seen by XInput2. |
| 55 | * @param device a `GdkDevice` |
| 56 | * @returns the XInput2 device ID |
| 57 | */ |
| 58 | function x11_device_get_id(device: X11DeviceXI2): number; |
| 59 | /** |
| 60 | * Returns the `GdkDevice` that wraps the given device ID. |
| 61 | * @param device_manager a `GdkDeviceManager` |
| 62 | * @param device_id a device ID, as understood by the XInput2 protocol |
| 63 | * @returns The `GdkDevice` wrapping the device ID, or %NULL if the given ID doesn’t currently represent a device. |
| 64 | */ |
| 65 | function x11_device_manager_lookup(device_manager: X11DeviceManagerXI2, device_id: number): X11DeviceXI2 | null; |
| 66 | /** |
| 67 | * Frees the data returned from gdk_x11_display_string_to_compound_text(). |
| 68 | * @param ctext The pointer stored in @ctext from a call to gdk_x11_display_string_to_compound_text(). |
| 69 | */ |
| 70 | function x11_free_compound_text(ctext: number): void; |
| 71 | /** |
| 72 | * Frees the array of strings created by |
| 73 | * gdk_x11_display_text_property_to_text_list(). |
| 74 | * @param list the value stored in the @list parameter by a call to gdk_x11_display_text_property_to_text_list(). |
| 75 | */ |
| 76 | function x11_free_text_list(list: string): void; |
| 77 | /** |
| 78 | * Routine to get the current X server time stamp. |
| 79 | * @param surface a `GdkSurface`, used for communication with the server. The surface must have `GDK_PROPERTY_CHANGE_MASK` in its events mask or a hang will result. |
| 80 | * @returns the time stamp |
| 81 | */ |
| 82 | function x11_get_server_time(surface: X11Surface): number; |
| 83 | /** |
| 84 | * Returns the X atom for a `GdkDisplay` corresponding to `atom_name`. |
| 85 | * This function caches the result, so if called repeatedly it is much |
| 86 | * faster than XInternAtom(), which is a round trip to the server each time. |
| 87 | * @param display a `GdkDisplay` |
| 88 | * @param atom_name a string |
| 89 | * @returns a X atom for a `GdkDisplay` |
| 90 | */ |
| 91 | function x11_get_xatom_by_name_for_display(display: X11Display, atom_name: string): xlib.Atom; |
| 92 | /** |
| 93 | * Returns the name of an X atom for its display. This |
| 94 | * function is meant mainly for debugging, so for convenience, unlike |
| 95 | * XAtomName() and the result doesn’t need to |
| 96 | * be freed. |
| 97 | * @param display the `GdkDisplay` where @xatom is defined |
| 98 | * @param xatom an X atom |
| 99 | * @returns name of the X atom; this string is owned by GDK, so it shouldn’t be modified or freed. |
| 100 | */ |
| 101 | function x11_get_xatom_name_for_display(display: X11Display, xatom: xlib.Atom): string; |
| 102 | /** |
| 103 | * Find the `GdkDisplay` corresponding to `xdisplay,` if any exists. |
| 104 | * @param xdisplay a pointer to an X Display |
| 105 | * @returns the `GdkDisplay`, if found, otherwise %NULL. |
| 106 | */ |
| 107 | function x11_lookup_xdisplay(xdisplay: xlib.Display): X11Display; |
| 108 | /** |
| 109 | * Sets the `SM_CLIENT_ID` property on the application’s leader window so that |
| 110 | * the window manager can save the application’s state using the X11R6 ICCCM |
| 111 | * session management protocol. |
| 112 | * |
| 113 | * See the X Session Management Library documentation for more information on |
| 114 | * session management and the Inter-Client Communication Conventions Manual |
| 115 | * @param sm_client_id the client id assigned by the session manager when the connection was opened, or %NULL to remove the property. |
| 116 | */ |
| 117 | function x11_set_sm_client_id(sm_client_id?: string | null): void; |
| 118 | namespace X11AppLaunchContext { |
| 119 | // Constructor properties interface |
| 120 | |
| 121 | interface ConstructorProps extends Gdk.AppLaunchContext.ConstructorProps {} |
| 122 | } |
| 123 | |
| 124 | class X11AppLaunchContext extends Gdk.AppLaunchContext { |
| 125 | static $gtype: GObject.GType<X11AppLaunchContext>; |
| 126 | |
| 127 | // Constructors |
| 128 | |
| 129 | constructor(properties?: Partial<X11AppLaunchContext.ConstructorProps>, ...args: any[]); |
| 130 | |
| 131 | _init(...args: any[]): void; |
| 132 | } |
| 133 | |
| 134 | namespace X11DeviceManagerXI2 { |
| 135 | // Constructor properties interface |
| 136 | |
| 137 | interface ConstructorProps extends GObject.Object.ConstructorProps { |
| 138 | display: Gdk.Display; |
| 139 | major: number; |
| 140 | minor: number; |
| 141 | opcode: number; |
| 142 | } |
| 143 | } |
| 144 | |
| 145 | class X11DeviceManagerXI2 extends GObject.Object { |
| 146 | static $gtype: GObject.GType<X11DeviceManagerXI2>; |
| 147 | |
| 148 | // Properties |
| 149 | |
| 150 | get display(): Gdk.Display; |
| 151 | get major(): number; |
| 152 | get minor(): number; |
| 153 | get opcode(): number; |
| 154 | |
| 155 | // Constructors |
| 156 | |
| 157 | constructor(properties?: Partial<X11DeviceManagerXI2.ConstructorProps>, ...args: any[]); |
| 158 | |
| 159 | _init(...args: any[]): void; |
| 160 | } |
| 161 | |
| 162 | namespace X11DeviceXI2 { |
| 163 | // Constructor properties interface |
| 164 | |
| 165 | interface ConstructorProps extends Gdk.Device.ConstructorProps { |
| 166 | device_id: number; |
| 167 | deviceId: number; |
| 168 | } |
| 169 | } |
| 170 | |
| 171 | class X11DeviceXI2 extends Gdk.Device { |
| 172 | static $gtype: GObject.GType<X11DeviceXI2>; |
| 173 | |
| 174 | // Properties |
| 175 | |
| 176 | get device_id(): number; |
| 177 | get deviceId(): number; |
| 178 | |
| 179 | // Constructors |
| 180 | |
| 181 | constructor(properties?: Partial<X11DeviceXI2.ConstructorProps>, ...args: any[]); |
| 182 | |
| 183 | _init(...args: any[]): void; |
| 184 | } |
| 185 | |
| 186 | namespace X11Display { |
| 187 | // Signal callback interfaces |
| 188 | |
| 189 | interface Xevent { |
| 190 | (xevent?: any | null): boolean; |
| 191 | } |
| 192 | |
| 193 | // Constructor properties interface |
| 194 | |
| 195 | interface ConstructorProps extends Gdk.Display.ConstructorProps {} |
| 196 | } |
| 197 | |
| 198 | class X11Display extends Gdk.Display { |
| 199 | static $gtype: GObject.GType<X11Display>; |
| 200 | |
| 201 | // Constructors |
| 202 | |
| 203 | constructor(properties?: Partial<X11Display.ConstructorProps>, ...args: any[]); |
| 204 | |
| 205 | _init(...args: any[]): void; |
| 206 | |
| 207 | // Signals |
| 208 | |
| 209 | connect(id: string, callback: (...args: any[]) => any): number; |
| 210 | connect_after(id: string, callback: (...args: any[]) => any): number; |
| 211 | emit(id: string, ...args: any[]): void; |
| 212 | connect(signal: 'xevent', callback: (_source: this, xevent: any | null) => boolean): number; |
| 213 | connect_after(signal: 'xevent', callback: (_source: this, xevent: any | null) => boolean): number; |
| 214 | emit(signal: 'xevent', xevent?: any | null): void; |
| 215 | |
| 216 | // Static methods |
| 217 | |
| 218 | /** |
| 219 | * Tries to open a new display to the X server given by |
| 220 | * `display_name`. If opening the display fails, %NULL is |
| 221 | * returned. |
| 222 | * @param display_name name of the X display. See the XOpenDisplay() for details. |
| 223 | */ |
| 224 | static open(display_name?: string | null): Gdk.Display | null; |
| 225 | /** |
| 226 | * Sets the program class. |
| 227 | * |
| 228 | * The X11 backend uses the program class to set the class name part |
| 229 | * of the `WM_CLASS` property on toplevel windows; see the ICCCM. |
| 230 | * @param display a `GdkDisplay` |
| 231 | * @param program_class a string |
| 232 | */ |
| 233 | static set_program_class(display: Gdk.Display, program_class: string): void; |
| 234 | |
| 235 | // Methods |
| 236 | |
| 237 | /** |
| 238 | * Pops the error trap pushed by gdk_x11_display_error_trap_push(). |
| 239 | * Will XSync() if necessary and will always block until |
| 240 | * the error is known to have occurred or not occurred, |
| 241 | * so the error code can be returned. |
| 242 | * |
| 243 | * If you don’t need to use the return value, |
| 244 | * gdk_x11_display_error_trap_pop_ignored() would be more efficient. |
| 245 | * @returns X error code or 0 on success |
| 246 | */ |
| 247 | error_trap_pop(): number; |
| 248 | /** |
| 249 | * Pops the error trap pushed by gdk_x11_display_error_trap_push(). |
| 250 | * Does not block to see if an error occurred; merely records the |
| 251 | * range of requests to ignore errors for, and ignores those errors |
| 252 | * if they arrive asynchronously. |
| 253 | */ |
| 254 | error_trap_pop_ignored(): void; |
| 255 | /** |
| 256 | * Begins a range of X requests on `display` for which X error events |
| 257 | * will be ignored. Unignored errors (when no trap is pushed) will abort |
| 258 | * the application. Use gdk_x11_display_error_trap_pop() or |
| 259 | * gdk_x11_display_error_trap_pop_ignored()to lift a trap pushed |
| 260 | * with this function. |
| 261 | */ |
| 262 | error_trap_push(): void; |
| 263 | /** |
| 264 | * Returns the default group leader surface for all toplevel surfaces |
| 265 | * on `display`. This surface is implicitly created by GDK. |
| 266 | * See gdk_x11_surface_set_group(). |
| 267 | * @returns The default group leader surface for @display |
| 268 | */ |
| 269 | get_default_group(): Gdk.Surface; |
| 270 | /** |
| 271 | * Retrieves the EGL display connection object for the given GDK display. |
| 272 | * |
| 273 | * This function returns `NULL` if GDK is using GLX. |
| 274 | * @returns the EGL display object |
| 275 | */ |
| 276 | get_egl_display(): any | null; |
| 277 | /** |
| 278 | * Retrieves the version of the EGL implementation. |
| 279 | * @returns %TRUE if EGL is available |
| 280 | */ |
| 281 | get_egl_version(): [boolean, number, number]; |
| 282 | /** |
| 283 | * Retrieves the version of the GLX implementation. |
| 284 | * @returns %TRUE if GLX is available |
| 285 | */ |
| 286 | get_glx_version(): [boolean, number, number]; |
| 287 | /** |
| 288 | * Gets the primary monitor for the display. |
| 289 | * |
| 290 | * The primary monitor is considered the monitor where the “main desktop” |
| 291 | * lives. While normal application surfaces typically allow the window |
| 292 | * manager to place the surfaces, specialized desktop applications |
| 293 | * such as panels should place themselves on the primary monitor. |
| 294 | * |
| 295 | * If no monitor is the designated primary monitor, any monitor |
| 296 | * (usually the first) may be returned. |
| 297 | * @returns the primary monitor, or any monitor if no primary monitor is configured by the user |
| 298 | */ |
| 299 | get_primary_monitor(): Gdk.Monitor; |
| 300 | /** |
| 301 | * Retrieves the `GdkX11Screen` of the `display`. |
| 302 | * @returns the `GdkX11Screen` |
| 303 | */ |
| 304 | get_screen(): X11Screen; |
| 305 | /** |
| 306 | * Gets the startup notification ID for a display. |
| 307 | * @returns the startup notification ID for @display |
| 308 | */ |
| 309 | get_startup_notification_id(): string; |
| 310 | // Conflicted with Gdk.Display.get_startup_notification_id |
| 311 | get_startup_notification_id(...args: never[]): any; |
| 312 | /** |
| 313 | * Returns the timestamp of the last user interaction on |
| 314 | * `display`. The timestamp is taken from events caused |
| 315 | * by user interaction such as key presses or pointer |
| 316 | * movements. See gdk_x11_surface_set_user_time(). |
| 317 | * @returns the timestamp of the last user interaction |
| 318 | */ |
| 319 | get_user_time(): number; |
| 320 | /** |
| 321 | * Returns the X cursor belonging to a `GdkCursor`, potentially |
| 322 | * creating the cursor. |
| 323 | * |
| 324 | * Be aware that the returned cursor may not be unique to `cursor`. |
| 325 | * It may for example be shared with its fallback cursor. On old |
| 326 | * X servers that don't support the XCursor extension, all cursors |
| 327 | * may even fall back to a few default cursors. |
| 328 | * @param cursor a `GdkCursor` |
| 329 | * @returns an Xlib Cursor. |
| 330 | */ |
| 331 | get_xcursor(cursor: Gdk.Cursor): xlib.Cursor; |
| 332 | /** |
| 333 | * Returns the X display of a `GdkDisplay`. |
| 334 | * @returns an X display |
| 335 | */ |
| 336 | get_xdisplay(): xlib.Display; |
| 337 | /** |
| 338 | * Returns the root X window used by `GdkDisplay`. |
| 339 | * @returns an X Window |
| 340 | */ |
| 341 | get_xrootwindow(): xlib.Window; |
| 342 | /** |
| 343 | * Returns the X Screen used by `GdkDisplay`. |
| 344 | * @returns an X Screen |
| 345 | */ |
| 346 | get_xscreen(): xlib.Screen; |
| 347 | /** |
| 348 | * Call XGrabServer() on `display`. |
| 349 | * To ungrab the display again, use gdk_x11_display_ungrab(). |
| 350 | * |
| 351 | * gdk_x11_display_grab()/gdk_x11_display_ungrab() calls can be nested. |
| 352 | */ |
| 353 | grab(): void; |
| 354 | /** |
| 355 | * Sets the cursor theme from which the images for cursor |
| 356 | * should be taken. |
| 357 | * |
| 358 | * If the windowing system supports it, existing cursors created |
| 359 | * with [ctor`Gdk`.Cursor.new_from_name] are updated to reflect the theme |
| 360 | * change. Custom cursors constructed with [ctor`Gdk`.Cursor.new_from_texture] |
| 361 | * will have to be handled by the application (GTK applications can learn |
| 362 | * about cursor theme changes by listening for change notification |
| 363 | * for the corresponding `GtkSetting`). |
| 364 | * @param theme the name of the cursor theme to use, or %NULL to unset a previously set value |
| 365 | * @param size the cursor size to use, or 0 to keep the previous size |
| 366 | */ |
| 367 | set_cursor_theme(theme: string | null, size: number): void; |
| 368 | /** |
| 369 | * Sets the startup notification ID for a display. |
| 370 | * |
| 371 | * This is usually taken from the value of the DESKTOP_STARTUP_ID |
| 372 | * environment variable, but in some cases (such as the application not |
| 373 | * being launched using exec()) it can come from other sources. |
| 374 | * |
| 375 | * If the ID contains the string "_TIME" then the portion following that |
| 376 | * string is taken to be the X11 timestamp of the event that triggered |
| 377 | * the application to be launched and the GDK current event time is set |
| 378 | * accordingly. |
| 379 | * |
| 380 | * The startup ID is also what is used to signal that the startup is |
| 381 | * complete (for example, when opening a window or when calling |
| 382 | * gdk_display_notify_startup_complete()). |
| 383 | * @param startup_id the startup notification ID (must be valid utf8) |
| 384 | */ |
| 385 | set_startup_notification_id(startup_id: string): void; |
| 386 | /** |
| 387 | * Forces a specific window scale for all windows on this display, |
| 388 | * instead of using the default or user configured scale. This |
| 389 | * is can be used to disable scaling support by setting `scale` to |
| 390 | * 1, or to programmatically set the window scale. |
| 391 | * |
| 392 | * Once the scale is set by this call it will not change in response |
| 393 | * to later user configuration changes. |
| 394 | * @param scale The new scale value |
| 395 | */ |
| 396 | set_surface_scale(scale: number): void; |
| 397 | /** |
| 398 | * Convert a string from the encoding of the current |
| 399 | * locale into a form suitable for storing in a window property. |
| 400 | * @param str a nul-terminated string |
| 401 | * @returns 0 upon success, non-zero upon failure |
| 402 | */ |
| 403 | string_to_compound_text(str: string): [number, string, number, Uint8Array]; |
| 404 | /** |
| 405 | * Convert a text string from the encoding as it is stored |
| 406 | * in a property into an array of strings in the encoding of |
| 407 | * the current locale. (The elements of the array represent the |
| 408 | * nul-separated elements of the original text string.) |
| 409 | * @param encoding a string representing the encoding. The most common values for this are "STRING", or "COMPOUND_TEXT". This is value used as the type for the property |
| 410 | * @param format the format of the property |
| 411 | * @param text The text data |
| 412 | * @param length The number of items to transform |
| 413 | * @param list location to store an array of strings in the encoding of the current locale. This array should be freed using gdk_x11_free_text_list(). |
| 414 | * @returns the number of strings stored in list, or 0, if the conversion failed |
| 415 | */ |
| 416 | text_property_to_text_list( |
| 417 | encoding: string, |
| 418 | format: number, |
| 419 | text: number, |
| 420 | length: number, |
| 421 | list: string, |
| 422 | ): number; |
| 423 | /** |
| 424 | * Ungrab `display` after it has been grabbed with |
| 425 | * gdk_x11_display_grab(). |
| 426 | */ |
| 427 | ungrab(): void; |
| 428 | /** |
| 429 | * Converts from UTF-8 to compound text. |
| 430 | * @param str a UTF-8 string |
| 431 | * @returns %TRUE if the conversion succeeded, otherwise %FALSE |
| 432 | */ |
| 433 | utf8_to_compound_text(str: string): [boolean, string, number, Uint8Array]; |
| 434 | } |
| 435 | |
| 436 | namespace X11Drag { |
| 437 | // Constructor properties interface |
| 438 | |
| 439 | interface ConstructorProps extends Gdk.Drag.ConstructorProps {} |
| 440 | } |
| 441 | |
| 442 | class X11Drag extends Gdk.Drag { |
| 443 | static $gtype: GObject.GType<X11Drag>; |
| 444 | |
| 445 | // Constructors |
| 446 | |
| 447 | constructor(properties?: Partial<X11Drag.ConstructorProps>, ...args: any[]); |
| 448 | |
| 449 | _init(...args: any[]): void; |
| 450 | } |
| 451 | |
| 452 | namespace X11GLContext { |
| 453 | // Constructor properties interface |
| 454 | |
| 455 | interface ConstructorProps extends Gdk.GLContext.ConstructorProps {} |
| 456 | } |
| 457 | |
| 458 | abstract class X11GLContext extends Gdk.GLContext { |
| 459 | static $gtype: GObject.GType<X11GLContext>; |
| 460 | |
| 461 | // Constructors |
| 462 | |
| 463 | constructor(properties?: Partial<X11GLContext.ConstructorProps>, ...args: any[]); |
| 464 | |
| 465 | _init(...args: any[]): void; |
| 466 | } |
| 467 | |
| 468 | namespace X11Monitor { |
| 469 | // Constructor properties interface |
| 470 | |
| 471 | interface ConstructorProps extends Gdk.Monitor.ConstructorProps {} |
| 472 | } |
| 473 | |
| 474 | class X11Monitor extends Gdk.Monitor { |
| 475 | static $gtype: GObject.GType<X11Monitor>; |
| 476 | |
| 477 | // Constructors |
| 478 | |
| 479 | constructor(properties?: Partial<X11Monitor.ConstructorProps>, ...args: any[]); |
| 480 | |
| 481 | _init(...args: any[]): void; |
| 482 | |
| 483 | // Methods |
| 484 | |
| 485 | /** |
| 486 | * Returns the XID of the Output corresponding to `monitor`. |
| 487 | * @returns the XID of @monitor |
| 488 | */ |
| 489 | get_output(): xlib.XID; |
| 490 | /** |
| 491 | * Retrieves the size and position of the “work area” on a monitor |
| 492 | * within the display coordinate space. |
| 493 | * |
| 494 | * The returned geometry is in ”application pixels”, not in ”device pixels” |
| 495 | * (see [method`Gdk`.Monitor.get_scale_factor]). |
| 496 | */ |
| 497 | get_workarea(): Gdk.Rectangle; |
| 498 | } |
| 499 | |
| 500 | namespace X11Screen { |
| 501 | // Signal callback interfaces |
| 502 | |
| 503 | interface WindowManagerChanged { |
| 504 | (): void; |
| 505 | } |
| 506 | |
| 507 | // Constructor properties interface |
| 508 | |
| 509 | interface ConstructorProps extends GObject.Object.ConstructorProps {} |
| 510 | } |
| 511 | |
| 512 | class X11Screen extends GObject.Object { |
| 513 | static $gtype: GObject.GType<X11Screen>; |
| 514 | |
| 515 | // Constructors |
| 516 | |
| 517 | constructor(properties?: Partial<X11Screen.ConstructorProps>, ...args: any[]); |
| 518 | |
| 519 | _init(...args: any[]): void; |
| 520 | |
| 521 | // Signals |
| 522 | |
| 523 | connect(id: string, callback: (...args: any[]) => any): number; |
| 524 | connect_after(id: string, callback: (...args: any[]) => any): number; |
| 525 | emit(id: string, ...args: any[]): void; |
| 526 | connect(signal: 'window-manager-changed', callback: (_source: this) => void): number; |
| 527 | connect_after(signal: 'window-manager-changed', callback: (_source: this) => void): number; |
| 528 | emit(signal: 'window-manager-changed'): void; |
| 529 | |
| 530 | // Methods |
| 531 | |
| 532 | /** |
| 533 | * Returns the current workspace for `screen` when running under a |
| 534 | * window manager that supports multiple workspaces, as described |
| 535 | * in the |
| 536 | * [Extended Window Manager Hints](http://www.freedesktop.org/Standards/wm-spec) specification. |
| 537 | * @returns the current workspace, or 0 if workspaces are not supported |
| 538 | */ |
| 539 | get_current_desktop(): number; |
| 540 | /** |
| 541 | * Gets the XID of the specified output/monitor. |
| 542 | * If the X server does not support version 1.2 of the RANDR |
| 543 | * extension, 0 is returned. |
| 544 | * @param monitor_num number of the monitor, between 0 and gdk_screen_get_n_monitors (screen) |
| 545 | * @returns the XID of the monitor |
| 546 | */ |
| 547 | get_monitor_output(monitor_num: number): xlib.XID; |
| 548 | /** |
| 549 | * Returns the number of workspaces for `screen` when running under a |
| 550 | * window manager that supports multiple workspaces, as described |
| 551 | * in the |
| 552 | * [Extended Window Manager Hints](http://www.freedesktop.org/Standards/wm-spec) specification. |
| 553 | * @returns the number of workspaces, or 0 if workspaces are not supported |
| 554 | */ |
| 555 | get_number_of_desktops(): number; |
| 556 | /** |
| 557 | * Returns the index of a `GdkX11Screen`. |
| 558 | * @returns the position of @screen among the screens of its display |
| 559 | */ |
| 560 | get_screen_number(): number; |
| 561 | /** |
| 562 | * Returns the name of the window manager for `screen`. |
| 563 | * @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. |
| 564 | */ |
| 565 | get_window_manager_name(): string; |
| 566 | /** |
| 567 | * Returns the screen of a `GdkX11Screen`. |
| 568 | * @returns an Xlib Screen* |
| 569 | */ |
| 570 | get_xscreen(): xlib.Screen; |
| 571 | /** |
| 572 | * This function is specific to the X11 backend of GDK, and indicates |
| 573 | * whether the window manager supports a certain hint from the |
| 574 | * [Extended Window Manager Hints](http://www.freedesktop.org/Standards/wm-spec) specification. |
| 575 | * |
| 576 | * When using this function, keep in mind that the window manager |
| 577 | * can change over time; so you shouldn’t use this function in |
| 578 | * a way that impacts persistent application state. A common bug |
| 579 | * is that your application can start up before the window manager |
| 580 | * does when the user logs in, and before the window manager starts |
| 581 | * gdk_x11_screen_supports_net_wm_hint() will return %FALSE for every property. |
| 582 | * You can monitor the window_manager_changed signal on `GdkX11Screen` to detect |
| 583 | * a window manager change. |
| 584 | * @param property_name name of the WM property |
| 585 | * @returns %TRUE if the window manager supports @property |
| 586 | */ |
| 587 | supports_net_wm_hint(property_name: string): boolean; |
| 588 | } |
| 589 | |
| 590 | namespace X11Surface { |
| 591 | // Constructor properties interface |
| 592 | |
| 593 | interface ConstructorProps extends Gdk.Surface.ConstructorProps {} |
| 594 | } |
| 595 | |
| 596 | class X11Surface extends Gdk.Surface { |
| 597 | static $gtype: GObject.GType<X11Surface>; |
| 598 | |
| 599 | // Constructors |
| 600 | |
| 601 | constructor(properties?: Partial<X11Surface.ConstructorProps>, ...args: any[]); |
| 602 | |
| 603 | _init(...args: any[]): void; |
| 604 | |
| 605 | // Static methods |
| 606 | |
| 607 | /** |
| 608 | * Looks up the `GdkSurface` that wraps the given native window handle. |
| 609 | * @param display the `GdkDisplay` corresponding to the window handle |
| 610 | * @param window an Xlib Window |
| 611 | */ |
| 612 | static lookup_for_display(display: X11Display, window: xlib.Window): X11Surface; |
| 613 | |
| 614 | // Methods |
| 615 | |
| 616 | /** |
| 617 | * Gets the number of the workspace `surface` is on. |
| 618 | * @returns the current workspace of @surface |
| 619 | */ |
| 620 | get_desktop(): number; |
| 621 | /** |
| 622 | * Returns the group this surface belongs to. |
| 623 | * @returns The group of this surface; |
| 624 | */ |
| 625 | get_group(): Gdk.Surface | null; |
| 626 | /** |
| 627 | * Returns the X resource (surface) belonging to a `GdkSurface`. |
| 628 | * @returns the ID of @drawable’s X resource. |
| 629 | */ |
| 630 | get_xid(): xlib.Window; |
| 631 | /** |
| 632 | * Moves the surface to the correct workspace when running under a |
| 633 | * window manager that supports multiple workspaces, as described |
| 634 | * in the [Extended Window Manager Hints](http://www.freedesktop.org/Standards/wm-spec) specification. |
| 635 | * Will not do anything if the surface is already on all workspaces. |
| 636 | */ |
| 637 | move_to_current_desktop(): void; |
| 638 | /** |
| 639 | * Moves the surface to the given workspace when running unde a |
| 640 | * window manager that supports multiple workspaces, as described |
| 641 | * in the [Extended Window Manager Hints](http://www.freedesktop.org/Standards/wm-spec) specification. |
| 642 | * @param desktop the number of the workspace to move the surface to |
| 643 | */ |
| 644 | move_to_desktop(desktop: number): void; |
| 645 | /** |
| 646 | * This function can be used to disable frame synchronization for a surface. |
| 647 | * Normally frame synchronziation will be enabled or disabled based on whether |
| 648 | * the system has a compositor that supports frame synchronization, but if |
| 649 | * the surface is not directly managed by the window manager, then frame |
| 650 | * synchronziation may need to be disabled. This is the case for a surface |
| 651 | * embedded via the XEMBED protocol. |
| 652 | * @param frame_sync_enabled whether frame-synchronization should be enabled |
| 653 | */ |
| 654 | set_frame_sync_enabled(frame_sync_enabled: boolean): void; |
| 655 | /** |
| 656 | * Sets the group leader of `surface` to be `leader`. |
| 657 | * See the ICCCM for details. |
| 658 | * @param leader a `GdkSurface` |
| 659 | */ |
| 660 | set_group(leader: Gdk.Surface): void; |
| 661 | /** |
| 662 | * Sets a hint on `surface` that pagers should not |
| 663 | * display it. See the EWMH for details. |
| 664 | * @param skips_pager %TRUE to skip pagers |
| 665 | */ |
| 666 | set_skip_pager_hint(skips_pager: boolean): void; |
| 667 | /** |
| 668 | * Sets a hint on `surface` that taskbars should not |
| 669 | * display it. See the EWMH for details. |
| 670 | * @param skips_taskbar %TRUE to skip taskbars |
| 671 | */ |
| 672 | set_skip_taskbar_hint(skips_taskbar: boolean): void; |
| 673 | /** |
| 674 | * GTK applications can request a dark theme variant. In order to |
| 675 | * make other applications - namely window managers using GTK for |
| 676 | * themeing - aware of this choice, GTK uses this function to |
| 677 | * export the requested theme variant as _GTK_THEME_VARIANT property |
| 678 | * on toplevel surfaces. |
| 679 | * |
| 680 | * Note that this property is automatically updated by GTK, so this |
| 681 | * function should only be used by applications which do not use GTK |
| 682 | * to create toplevel surfaces. |
| 683 | * @param variant the theme variant to export |
| 684 | */ |
| 685 | set_theme_variant(variant: string): void; |
| 686 | /** |
| 687 | * Sets a hint on `surface` that it needs user attention. |
| 688 | * See the ICCCM for details. |
| 689 | * @param urgent %TRUE to indicate urgenct attention needed |
| 690 | */ |
| 691 | set_urgency_hint(urgent: boolean): void; |
| 692 | /** |
| 693 | * The application can use this call to update the _NET_WM_USER_TIME |
| 694 | * property on a toplevel surface. This property stores an Xserver |
| 695 | * time which represents the time of the last user input event |
| 696 | * received for this surface. This property may be used by the window |
| 697 | * manager to alter the focus, stacking, and/or placement behavior of |
| 698 | * surfaces when they are mapped depending on whether the new surface |
| 699 | * was created by a user action or is a "pop-up" surface activated by a |
| 700 | * timer or some other event. |
| 701 | * |
| 702 | * Note that this property is automatically updated by GDK, so this |
| 703 | * function should only be used by applications which handle input |
| 704 | * events bypassing GDK. |
| 705 | * @param timestamp An XServer timestamp to which the property should be set |
| 706 | */ |
| 707 | set_user_time(timestamp: number): void; |
| 708 | /** |
| 709 | * This function modifies or removes an arbitrary X11 window |
| 710 | * property of type UTF8_STRING. If the given `surface` is |
| 711 | * not a toplevel surface, it is ignored. |
| 712 | * @param name Property name, will be interned as an X atom |
| 713 | * @param value Property value, or %NULL to delete |
| 714 | */ |
| 715 | set_utf8_property(name: string, value?: string | null): void; |
| 716 | } |
| 717 | |
| 718 | type X11AppLaunchContextClass = typeof X11AppLaunchContext; |
| 719 | type X11DeviceManagerXI2Class = typeof X11DeviceManagerXI2; |
| 720 | type X11DeviceXI2Class = typeof X11DeviceXI2; |
| 721 | type X11DisplayClass = typeof X11Display; |
| 722 | type X11DragClass = typeof X11Drag; |
| 723 | type X11GLContextClass = typeof X11GLContext; |
| 724 | type X11MonitorClass = typeof X11Monitor; |
| 725 | type X11ScreenClass = typeof X11Screen; |
| 726 | type X11SurfaceClass = typeof X11Surface; |
| 727 | /** |
| 728 | * Name of the imported GIR library |
| 729 | * `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188 |
| 730 | */ |
| 731 | const __name__: string; |
| 732 | /** |
| 733 | * Version of the imported GIR library |
| 734 | * `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189 |
| 735 | */ |
| 736 | const __version__: string; |
| 737 | } |
| 738 | |
| 739 | export default GdkX11; |
| 740 | } |
| 741 | |
| 742 | declare module 'gi://GdkX11' { |
| 743 | import GdkX1140 from 'gi://GdkX11?version=4.0'; |
| 744 | export default GdkX1140; |
| 745 | } |
| 746 | // END |