| 1 | /// <reference path="./gtk-3.0.d.ts" /> |
| 2 | /// <reference path="./xlib-2.0.d.ts" /> |
| 3 | /// <reference path="./gdk-3.0.d.ts" /> |
| 4 | /// <reference path="./cairo-1.0.d.ts" /> |
| 5 | /// <reference path="./cairo.d.ts" /> |
| 6 | /// <reference path="./gobject-2.0.d.ts" /> |
| 7 | /// <reference path="./glib-2.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 | /// <reference path="./atk-1.0.d.ts" /> |
| 15 | /// <reference path="./gcr-3.d.ts" /> |
| 16 | /// <reference path="./gck-1.d.ts" /> |
| 17 | |
| 18 | /** |
| 19 | * Type Definitions for Gjs (https://gjs.guide/) |
| 20 | * |
| 21 | * These type definitions are automatically generated, do not edit them by hand. |
| 22 | * If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir |
| 23 | * |
| 24 | * The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ... |
| 25 | */ |
| 26 | |
| 27 | declare module 'gi://GcrUi?version=3' { |
| 28 | // Module dependencies |
| 29 | import type Gtk from 'gi://Gtk?version=3.0'; |
| 30 | import type xlib from 'gi://xlib?version=2.0'; |
| 31 | import type Gdk from 'gi://Gdk?version=3.0'; |
| 32 | import type cairo from 'cairo'; |
| 33 | import type GObject from 'gi://GObject?version=2.0'; |
| 34 | import type GLib from 'gi://GLib?version=2.0'; |
| 35 | import type Pango from 'gi://Pango?version=1.0'; |
| 36 | import type HarfBuzz from 'gi://HarfBuzz?version=0.0'; |
| 37 | import type freetype2 from 'gi://freetype2?version=2.0'; |
| 38 | import type Gio from 'gi://Gio?version=2.0'; |
| 39 | import type GModule from 'gi://GModule?version=2.0'; |
| 40 | import type GdkPixbuf from 'gi://GdkPixbuf?version=2.0'; |
| 41 | import type Atk from 'gi://Atk?version=1.0'; |
| 42 | import type Gcr from 'gi://Gcr?version=3'; |
| 43 | import type Gck from 'gi://Gck?version=1'; |
| 44 | |
| 45 | export namespace GcrUi { |
| 46 | /** |
| 47 | * GcrUi-3 |
| 48 | */ |
| 49 | |
| 50 | /** |
| 51 | * If a [class`CollectionModel]` is created with a mode of |
| 52 | * %GCR_COLLECTION_MODEL_TREE, then any included objects that are themselves a |
| 53 | * [iface`Gcr`.Collection], will have all child |
| 54 | * objects include as child rows in a tree form. |
| 55 | */ |
| 56 | |
| 57 | /** |
| 58 | * If a [class`CollectionModel]` is created with a mode of |
| 59 | * %GCR_COLLECTION_MODEL_TREE, then any included objects that are themselves a |
| 60 | * [iface`Gcr`.Collection], will have all child |
| 61 | * objects include as child rows in a tree form. |
| 62 | */ |
| 63 | export namespace CollectionModelMode { |
| 64 | export const $gtype: GObject.GType<CollectionModelMode>; |
| 65 | } |
| 66 | |
| 67 | enum CollectionModelMode { |
| 68 | /** |
| 69 | * only objects in the top collection, no child objects |
| 70 | */ |
| 71 | LIST, |
| 72 | /** |
| 73 | * show objects in the collection, and child objects in a tree form |
| 74 | */ |
| 75 | TREE, |
| 76 | } |
| 77 | /** |
| 78 | * Create and initialize a renderer for the given attributes and label. These |
| 79 | * renderers should have been preregistered via gcr_renderer_register(). |
| 80 | * @param label The label for the renderer |
| 81 | * @param attrs The attributes to render |
| 82 | * @returns a new renderer, or %NULL if no renderer matched the attributes; the render should be released with g_object_unref() |
| 83 | */ |
| 84 | function renderer_create(label: string | null, attrs: Gck.Attributes): Renderer | null; |
| 85 | /** |
| 86 | * Register a renderer to be created when matching attributes are passed to |
| 87 | * gcr_renderer_create(). |
| 88 | * @param renderer_type The renderer class type |
| 89 | * @param attrs The attributes to match |
| 90 | */ |
| 91 | function renderer_register(renderer_type: GObject.GType, attrs: Gck.Attributes): void; |
| 92 | /** |
| 93 | * Register all the well known renderers for certificates and keys known to the |
| 94 | * Gcr library. |
| 95 | */ |
| 96 | function renderer_register_well_known(): void; |
| 97 | /** |
| 98 | * Get an implementation of #GcrViewer that supports a view |
| 99 | * of multiple renderers. |
| 100 | * @returns a newly allocated #GcrViewer, which should be released with g_object_unref() |
| 101 | */ |
| 102 | function viewer_new(): Viewer; |
| 103 | /** |
| 104 | * Get an implementation of #GcrViewer that supports a scrolled view |
| 105 | * of multiple renderers. |
| 106 | * @returns a #GcrViewer which is also a #GtkWidget |
| 107 | */ |
| 108 | function viewer_new_scrolled(): Viewer; |
| 109 | namespace CertificateRenderer { |
| 110 | // Constructor properties interface |
| 111 | |
| 112 | interface ConstructorProps |
| 113 | extends GObject.Object.ConstructorProps, |
| 114 | Gcr.Certificate.ConstructorProps, |
| 115 | Gcr.Comparable.ConstructorProps, |
| 116 | Renderer.ConstructorProps { |
| 117 | attributes: Gck.Attributes; |
| 118 | certificate: Gcr.Certificate; |
| 119 | label: string; |
| 120 | } |
| 121 | } |
| 122 | |
| 123 | /** |
| 124 | * An implementation of #GcrRenderer which renders certificates. |
| 125 | */ |
| 126 | class CertificateRenderer extends GObject.Object implements Gcr.Certificate, Gcr.Comparable, Renderer { |
| 127 | static $gtype: GObject.GType<CertificateRenderer>; |
| 128 | |
| 129 | // Properties |
| 130 | |
| 131 | /** |
| 132 | * The certificate attributes to display. One of the attributes must be |
| 133 | * a CKA_VALUE type attribute which contains a DER encoded certificate. |
| 134 | */ |
| 135 | get attributes(): Gck.Attributes; |
| 136 | set attributes(val: Gck.Attributes); |
| 137 | /** |
| 138 | * The certificate to display. May be %NULL. |
| 139 | */ |
| 140 | get certificate(): Gcr.Certificate; |
| 141 | set certificate(val: Gcr.Certificate); |
| 142 | /** |
| 143 | * The label to display. |
| 144 | */ |
| 145 | get label(): string; |
| 146 | set label(val: string); |
| 147 | |
| 148 | // Constructors |
| 149 | |
| 150 | constructor(properties?: Partial<CertificateRenderer.ConstructorProps>, ...args: any[]); |
| 151 | |
| 152 | _init(...args: any[]): void; |
| 153 | |
| 154 | static ['new'](certificate: Gcr.Certificate): CertificateRenderer; |
| 155 | |
| 156 | static new_for_attributes(label?: string | null, attrs?: any | null): CertificateRenderer; |
| 157 | |
| 158 | // Methods |
| 159 | |
| 160 | /** |
| 161 | * Get the certificate displayed in the renderer. If no certificate was |
| 162 | * explicitly set, then the renderer will return itself since it acts as |
| 163 | * a valid certificate. |
| 164 | * @returns The certificate, owned by the renderer. |
| 165 | */ |
| 166 | get_certificate(): Gcr.Certificate; |
| 167 | /** |
| 168 | * Set a certificate to display in the renderer. |
| 169 | * @param certificate the certificate to display |
| 170 | */ |
| 171 | set_certificate(certificate?: Gcr.Certificate | null): void; |
| 172 | |
| 173 | // Inherited properties |
| 174 | /** |
| 175 | * A readable description for this certificate |
| 176 | */ |
| 177 | get description(): string; |
| 178 | /** |
| 179 | * The expiry date of the certificate |
| 180 | */ |
| 181 | get expiry(): GLib.Date; |
| 182 | /** |
| 183 | * An icon representing the certificate |
| 184 | */ |
| 185 | get icon(): Gio.Icon; |
| 186 | /** |
| 187 | * Common name part of the certificate issuer |
| 188 | */ |
| 189 | get issuer(): string; |
| 190 | /** |
| 191 | * GLib markup to describe the certificate |
| 192 | */ |
| 193 | get markup(): string; |
| 194 | /** |
| 195 | * Common name part of the certificate subject |
| 196 | */ |
| 197 | get subject(): string; |
| 198 | |
| 199 | // Inherited methods |
| 200 | /** |
| 201 | * Get the basic constraints for the certificate if present. If %FALSE is |
| 202 | * returned then no basic constraints are present and the `is_ca` and |
| 203 | * `path_len` arguments are not changed. |
| 204 | * @returns whether basic constraints are present or not |
| 205 | */ |
| 206 | get_basic_constraints(): [boolean, boolean, number]; |
| 207 | /** |
| 208 | * Gets the raw DER data for an X.509 certificate. |
| 209 | * @returns raw DER data of the X.509 certificate |
| 210 | */ |
| 211 | get_der_data(): Uint8Array; |
| 212 | /** |
| 213 | * Get the expiry date of this certificate. |
| 214 | * |
| 215 | * The #GDate returned should be freed by the caller using |
| 216 | * g_date_free() when no longer required. |
| 217 | * @returns An allocated expiry date of this certificate. |
| 218 | */ |
| 219 | get_expiry_date(): GLib.Date; |
| 220 | /** |
| 221 | * Calculate the fingerprint for this certificate. |
| 222 | * |
| 223 | * The caller should free the returned data using g_free() when |
| 224 | * it is no longer required. |
| 225 | * @param type the type of algorithm for the fingerprint. |
| 226 | * @returns the raw binary fingerprint |
| 227 | */ |
| 228 | get_fingerprint(type: GLib.ChecksumType | null): Uint8Array; |
| 229 | /** |
| 230 | * Calculate the fingerprint for this certificate, and return it |
| 231 | * as a hex string. |
| 232 | * |
| 233 | * The caller should free the returned data using g_free() when |
| 234 | * it is no longer required. |
| 235 | * @param type the type of algorithm for the fingerprint. |
| 236 | * @returns an allocated hex string which contains the fingerprint. |
| 237 | */ |
| 238 | get_fingerprint_hex(type: GLib.ChecksumType | null): string; |
| 239 | /** |
| 240 | * Get the issued date of this certificate. |
| 241 | * |
| 242 | * The #GDate returned should be freed by the caller using |
| 243 | * g_date_free() when no longer required. |
| 244 | * @returns An allocated issued date of this certificate. |
| 245 | */ |
| 246 | get_issued_date(): GLib.Date; |
| 247 | /** |
| 248 | * Get the common name of the issuer of this certificate. |
| 249 | * |
| 250 | * The string returned should be freed by the caller when no longer |
| 251 | * required. |
| 252 | * @returns The allocated issuer CN, or %NULL if no issuer CN present. |
| 253 | */ |
| 254 | get_issuer_cn(): string; |
| 255 | /** |
| 256 | * Get the full issuer DN of the certificate as a (mostly) |
| 257 | * readable string. |
| 258 | * |
| 259 | * The string returned should be freed by the caller when no longer |
| 260 | * required. |
| 261 | * @returns The allocated issuer DN of the certificate. |
| 262 | */ |
| 263 | get_issuer_dn(): string; |
| 264 | /** |
| 265 | * Get a name to represent the issuer of this certificate. |
| 266 | * |
| 267 | * This will try to lookup the common name, orianizational unit, |
| 268 | * organization in that order. |
| 269 | * @returns the allocated issuer name, or %NULL if no issuer name |
| 270 | */ |
| 271 | get_issuer_name(): string; |
| 272 | /** |
| 273 | * Get a part of the DN of the issuer of this certificate. |
| 274 | * |
| 275 | * Examples of a `part` might be the 'OU' (organizational unit) |
| 276 | * or the 'CN' (common name). Only the value of that part |
| 277 | * of the DN is returned. |
| 278 | * |
| 279 | * The string returned should be freed by the caller when no longer |
| 280 | * required. |
| 281 | * @param part a DN type string or OID. |
| 282 | * @returns the allocated part of the issuer DN, or %NULL if no such part is present |
| 283 | */ |
| 284 | get_issuer_part(part: string): string | null; |
| 285 | /** |
| 286 | * Get the raw DER data for the issuer DN of the certificate. |
| 287 | * |
| 288 | * The data should be freed by using g_free() when no longer required. |
| 289 | * @returns allocated memory containing the raw issuer |
| 290 | */ |
| 291 | get_issuer_raw(): Uint8Array; |
| 292 | /** |
| 293 | * Get the key size in bits of the public key represented |
| 294 | * by this certificate. |
| 295 | * @returns The key size of the certificate. |
| 296 | */ |
| 297 | get_key_size(): number; |
| 298 | /** |
| 299 | * Calculate a GMarkup string for displaying this certificate. |
| 300 | * @returns the markup string |
| 301 | */ |
| 302 | get_markup_text(): string; |
| 303 | /** |
| 304 | * Get the raw binary serial number of the certificate. |
| 305 | * |
| 306 | * The caller should free the returned data using g_free() when |
| 307 | * it is no longer required. |
| 308 | * @returns the raw binary serial number. |
| 309 | */ |
| 310 | get_serial_number(): Uint8Array; |
| 311 | /** |
| 312 | * Get the serial number of the certificate as a hex string. |
| 313 | * |
| 314 | * The caller should free the returned data using g_free() when |
| 315 | * it is no longer required. |
| 316 | * @returns an allocated string containing the serial number as hex. |
| 317 | */ |
| 318 | get_serial_number_hex(): string; |
| 319 | /** |
| 320 | * Get the common name of the subject of this certificate. |
| 321 | * |
| 322 | * The string returned should be freed by the caller when no longer |
| 323 | * required. |
| 324 | * @returns The allocated subject CN, or %NULL if no subject CN present. |
| 325 | */ |
| 326 | get_subject_cn(): string; |
| 327 | /** |
| 328 | * Get the full subject DN of the certificate as a (mostly) |
| 329 | * readable string. |
| 330 | * |
| 331 | * The string returned should be freed by the caller when no longer |
| 332 | * required. |
| 333 | * @returns The allocated subject DN of the certificate. |
| 334 | */ |
| 335 | get_subject_dn(): string; |
| 336 | /** |
| 337 | * Get a name to represent the subject of this certificate. |
| 338 | * |
| 339 | * This will try to lookup the common name, orianizational unit, |
| 340 | * organization in that order. |
| 341 | * @returns the allocated subject name, or %NULL if no subject name |
| 342 | */ |
| 343 | get_subject_name(): string; |
| 344 | /** |
| 345 | * Get a part of the DN of the subject of this certificate. |
| 346 | * |
| 347 | * Examples of a `part` might be the 'OU' (organizational unit) |
| 348 | * or the 'CN' (common name). Only the value of that part |
| 349 | * of the DN is returned. |
| 350 | * |
| 351 | * The string returned should be freed by the caller when no longer |
| 352 | * required. |
| 353 | * @param part a DN type string or OID. |
| 354 | * @returns the allocated part of the subject DN, or %NULL if no such part is present. |
| 355 | */ |
| 356 | get_subject_part(part: string): string | null; |
| 357 | /** |
| 358 | * Get the raw DER data for the subject DN of the certificate. |
| 359 | * |
| 360 | * The data should be freed by using g_free() when no longer required. |
| 361 | * @returns allocated memory containing the raw subject |
| 362 | */ |
| 363 | get_subject_raw(): Uint8Array; |
| 364 | /** |
| 365 | * Check if `issuer` could be the issuer of this certificate. This is done by |
| 366 | * comparing the relevant subject and issuer fields. No signature check is |
| 367 | * done. Proper verification of certificates must be done via a crypto |
| 368 | * library. |
| 369 | * @param issuer a possible issuer #GcrCertificate |
| 370 | * @returns whether @issuer could be the issuer of the certificate. |
| 371 | */ |
| 372 | is_issuer(issuer: Gcr.Certificate): boolean; |
| 373 | /** |
| 374 | * Implementers of the #GcrCertificate mixin should call this function to notify |
| 375 | * when the certificate has changed to emit notifications on the various |
| 376 | * properties. |
| 377 | */ |
| 378 | mixin_emit_notify(): void; |
| 379 | /** |
| 380 | * Gets the raw DER data for an X.509 certificate. |
| 381 | */ |
| 382 | vfunc_get_der_data(): Uint8Array; |
| 383 | /** |
| 384 | * Compare whether two objects represent the same thing. The return value can |
| 385 | * also be used to sort the objects. |
| 386 | * @param other Another comparable object |
| 387 | * @returns Zero if the two objects represent the same thing, non-zero if not. |
| 388 | */ |
| 389 | compare(other?: Gcr.Comparable | null): number; |
| 390 | /** |
| 391 | * Compare whether two objects represent the same thing. The return value can |
| 392 | * also be used to sort the objects. |
| 393 | * @param other Another comparable object |
| 394 | */ |
| 395 | vfunc_compare(other?: Gcr.Comparable | null): number; |
| 396 | /** |
| 397 | * Emit the #GcrRenderer::data-changed signal on the renderer. This is used by |
| 398 | * renderer implementations. |
| 399 | */ |
| 400 | emit_data_changed(): void; |
| 401 | /** |
| 402 | * Get the PKCS#11 attributes, if any, set for this renderer to display. |
| 403 | * @returns the attributes, owned by the renderer |
| 404 | */ |
| 405 | get_attributes(): Gck.Attributes | null; |
| 406 | /** |
| 407 | * Called by #GcrViewer when about to display a popup menu for the content |
| 408 | * displayed by the renderer. The renderer can add a menu item if desired. |
| 409 | * @param viewer The viewer that is displaying a popup |
| 410 | * @param menu The popup menu being displayed |
| 411 | */ |
| 412 | popuplate_popup(viewer: Viewer, menu: Gtk.Menu): void; |
| 413 | /** |
| 414 | * Render the contents of the renderer to the given viewer. |
| 415 | * @param viewer The viewer to render to. |
| 416 | */ |
| 417 | render_view(viewer: Viewer): void; |
| 418 | /** |
| 419 | * Set the PKCS#11 attributes for this renderer to display. |
| 420 | * @param attrs attributes to set |
| 421 | */ |
| 422 | set_attributes(attrs?: Gck.Attributes | null): void; |
| 423 | /** |
| 424 | * signal emitted when data being rendered changes |
| 425 | */ |
| 426 | vfunc_data_changed(): void; |
| 427 | /** |
| 428 | * method invoked to populate a popup menu with additional |
| 429 | * renderer options |
| 430 | * @param viewer |
| 431 | * @param menu |
| 432 | */ |
| 433 | vfunc_populate_popup(viewer: Viewer, menu: Gtk.Menu): void; |
| 434 | /** |
| 435 | * Render the contents of the renderer to the given viewer. |
| 436 | * @param viewer The viewer to render to. |
| 437 | */ |
| 438 | vfunc_render_view(viewer: Viewer): void; |
| 439 | /** |
| 440 | * Creates a binding between `source_property` on `source` and `target_property` |
| 441 | * on `target`. |
| 442 | * |
| 443 | * Whenever the `source_property` is changed the `target_property` is |
| 444 | * updated using the same value. For instance: |
| 445 | * |
| 446 | * |
| 447 | * ```c |
| 448 | * g_object_bind_property (action, "active", widget, "sensitive", 0); |
| 449 | * ``` |
| 450 | * |
| 451 | * |
| 452 | * Will result in the "sensitive" property of the widget #GObject instance to be |
| 453 | * updated with the same value of the "active" property of the action #GObject |
| 454 | * instance. |
| 455 | * |
| 456 | * If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual: |
| 457 | * if `target_property` on `target` changes then the `source_property` on `source` |
| 458 | * will be updated as well. |
| 459 | * |
| 460 | * The binding will automatically be removed when either the `source` or the |
| 461 | * `target` instances are finalized. To remove the binding without affecting the |
| 462 | * `source` and the `target` you can just call g_object_unref() on the returned |
| 463 | * #GBinding instance. |
| 464 | * |
| 465 | * Removing the binding by calling g_object_unref() on it must only be done if |
| 466 | * the binding, `source` and `target` are only used from a single thread and it |
| 467 | * is clear that both `source` and `target` outlive the binding. Especially it |
| 468 | * is not safe to rely on this if the binding, `source` or `target` can be |
| 469 | * finalized from different threads. Keep another reference to the binding and |
| 470 | * use g_binding_unbind() instead to be on the safe side. |
| 471 | * |
| 472 | * A #GObject can have multiple bindings. |
| 473 | * @param source_property the property on @source to bind |
| 474 | * @param target the target #GObject |
| 475 | * @param target_property the property on @target to bind |
| 476 | * @param flags flags to pass to #GBinding |
| 477 | * @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero. |
| 478 | */ |
| 479 | bind_property( |
| 480 | source_property: string, |
| 481 | target: GObject.Object, |
| 482 | target_property: string, |
| 483 | flags: GObject.BindingFlags | null, |
| 484 | ): GObject.Binding; |
| 485 | /** |
| 486 | * Complete version of g_object_bind_property(). |
| 487 | * |
| 488 | * Creates a binding between `source_property` on `source` and `target_property` |
| 489 | * on `target,` allowing you to set the transformation functions to be used by |
| 490 | * the binding. |
| 491 | * |
| 492 | * If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual: |
| 493 | * if `target_property` on `target` changes then the `source_property` on `source` |
| 494 | * will be updated as well. The `transform_from` function is only used in case |
| 495 | * of bidirectional bindings, otherwise it will be ignored |
| 496 | * |
| 497 | * The binding will automatically be removed when either the `source` or the |
| 498 | * `target` instances are finalized. This will release the reference that is |
| 499 | * being held on the #GBinding instance; if you want to hold on to the |
| 500 | * #GBinding instance, you will need to hold a reference to it. |
| 501 | * |
| 502 | * To remove the binding, call g_binding_unbind(). |
| 503 | * |
| 504 | * A #GObject can have multiple bindings. |
| 505 | * |
| 506 | * The same `user_data` parameter will be used for both `transform_to` |
| 507 | * and `transform_from` transformation functions; the `notify` function will |
| 508 | * be called once, when the binding is removed. If you need different data |
| 509 | * for each transformation function, please use |
| 510 | * g_object_bind_property_with_closures() instead. |
| 511 | * @param source_property the property on @source to bind |
| 512 | * @param target the target #GObject |
| 513 | * @param target_property the property on @target to bind |
| 514 | * @param flags flags to pass to #GBinding |
| 515 | * @param transform_to the transformation function from the @source to the @target, or %NULL to use the default |
| 516 | * @param transform_from the transformation function from the @target to the @source, or %NULL to use the default |
| 517 | * @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required |
| 518 | * @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero. |
| 519 | */ |
| 520 | bind_property_full( |
| 521 | source_property: string, |
| 522 | target: GObject.Object, |
| 523 | target_property: string, |
| 524 | flags: GObject.BindingFlags | null, |
| 525 | transform_to?: GObject.BindingTransformFunc | null, |
| 526 | transform_from?: GObject.BindingTransformFunc | null, |
| 527 | notify?: GLib.DestroyNotify | null, |
| 528 | ): GObject.Binding; |
| 529 | // Conflicted with GObject.Object.bind_property_full |
| 530 | bind_property_full(...args: never[]): any; |
| 531 | /** |
| 532 | * This function is intended for #GObject implementations to re-enforce |
| 533 | * a [floating][floating-ref] object reference. Doing this is seldom |
| 534 | * required: all #GInitiallyUnowneds are created with a floating reference |
| 535 | * which usually just needs to be sunken by calling g_object_ref_sink(). |
| 536 | */ |
| 537 | force_floating(): void; |
| 538 | /** |
| 539 | * Increases the freeze count on `object`. If the freeze count is |
| 540 | * non-zero, the emission of "notify" signals on `object` is |
| 541 | * stopped. The signals are queued until the freeze count is decreased |
| 542 | * to zero. Duplicate notifications are squashed so that at most one |
| 543 | * #GObject::notify signal is emitted for each property modified while the |
| 544 | * object is frozen. |
| 545 | * |
| 546 | * This is necessary for accessors that modify multiple properties to prevent |
| 547 | * premature notification while the object is still being modified. |
| 548 | */ |
| 549 | freeze_notify(): void; |
| 550 | /** |
| 551 | * Gets a named field from the objects table of associations (see g_object_set_data()). |
| 552 | * @param key name of the key for that association |
| 553 | * @returns the data if found, or %NULL if no such data exists. |
| 554 | */ |
| 555 | get_data(key: string): any | null; |
| 556 | /** |
| 557 | * Gets a property of an object. |
| 558 | * |
| 559 | * The value can be: |
| 560 | * - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60) |
| 561 | * - a GObject.Value initialized with the expected type of the property |
| 562 | * - a GObject.Value initialized with a type to which the expected type of the property can be transformed |
| 563 | * |
| 564 | * In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset. |
| 565 | * |
| 566 | * Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming. |
| 567 | * @param property_name The name of the property to get |
| 568 | * @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type |
| 569 | */ |
| 570 | get_property(property_name: string, value: GObject.Value | any): any; |
| 571 | /** |
| 572 | * This function gets back user data pointers stored via |
| 573 | * g_object_set_qdata(). |
| 574 | * @param quark A #GQuark, naming the user data pointer |
| 575 | * @returns The user data pointer set, or %NULL |
| 576 | */ |
| 577 | get_qdata(quark: GLib.Quark): any | null; |
| 578 | /** |
| 579 | * Gets `n_properties` properties for an `object`. |
| 580 | * Obtained properties will be set to `values`. All properties must be valid. |
| 581 | * Warnings will be emitted and undefined behaviour may result if invalid |
| 582 | * properties are passed in. |
| 583 | * @param names the names of each property to get |
| 584 | * @param values the values of each property to get |
| 585 | */ |
| 586 | getv(names: string[], values: (GObject.Value | any)[]): void; |
| 587 | /** |
| 588 | * Checks whether `object` has a [floating][floating-ref] reference. |
| 589 | * @returns %TRUE if @object has a floating reference |
| 590 | */ |
| 591 | is_floating(): boolean; |
| 592 | /** |
| 593 | * Emits a "notify" signal for the property `property_name` on `object`. |
| 594 | * |
| 595 | * When possible, eg. when signaling a property change from within the class |
| 596 | * that registered the property, you should use g_object_notify_by_pspec() |
| 597 | * instead. |
| 598 | * |
| 599 | * Note that emission of the notify signal may be blocked with |
| 600 | * g_object_freeze_notify(). In this case, the signal emissions are queued |
| 601 | * and will be emitted (in reverse order) when g_object_thaw_notify() is |
| 602 | * called. |
| 603 | * @param property_name the name of a property installed on the class of @object. |
| 604 | */ |
| 605 | notify(property_name: string): void; |
| 606 | /** |
| 607 | * Emits a "notify" signal for the property specified by `pspec` on `object`. |
| 608 | * |
| 609 | * This function omits the property name lookup, hence it is faster than |
| 610 | * g_object_notify(). |
| 611 | * |
| 612 | * One way to avoid using g_object_notify() from within the |
| 613 | * class that registered the properties, and using g_object_notify_by_pspec() |
| 614 | * instead, is to store the GParamSpec used with |
| 615 | * g_object_class_install_property() inside a static array, e.g.: |
| 616 | * |
| 617 | * |
| 618 | * ```c |
| 619 | * typedef enum |
| 620 | * { |
| 621 | * PROP_FOO = 1, |
| 622 | * PROP_LAST |
| 623 | * } MyObjectProperty; |
| 624 | * |
| 625 | * static GParamSpec *properties[PROP_LAST]; |
| 626 | * |
| 627 | * static void |
| 628 | * my_object_class_init (MyObjectClass *klass) |
| 629 | * { |
| 630 | * properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL, |
| 631 | * 0, 100, |
| 632 | * 50, |
| 633 | * G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); |
| 634 | * g_object_class_install_property (gobject_class, |
| 635 | * PROP_FOO, |
| 636 | * properties[PROP_FOO]); |
| 637 | * } |
| 638 | * ``` |
| 639 | * |
| 640 | * |
| 641 | * and then notify a change on the "foo" property with: |
| 642 | * |
| 643 | * |
| 644 | * ```c |
| 645 | * g_object_notify_by_pspec (self, properties[PROP_FOO]); |
| 646 | * ``` |
| 647 | * |
| 648 | * @param pspec the #GParamSpec of a property installed on the class of @object. |
| 649 | */ |
| 650 | notify_by_pspec(pspec: GObject.ParamSpec): void; |
| 651 | /** |
| 652 | * Increases the reference count of `object`. |
| 653 | * |
| 654 | * Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type |
| 655 | * of `object` will be propagated to the return type (using the GCC typeof() |
| 656 | * extension), so any casting the caller needs to do on the return type must be |
| 657 | * explicit. |
| 658 | * @returns the same @object |
| 659 | */ |
| 660 | ref(): GObject.Object; |
| 661 | /** |
| 662 | * Increase the reference count of `object,` and possibly remove the |
| 663 | * [floating][floating-ref] reference, if `object` has a floating reference. |
| 664 | * |
| 665 | * In other words, if the object is floating, then this call "assumes |
| 666 | * ownership" of the floating reference, converting it to a normal |
| 667 | * reference by clearing the floating flag while leaving the reference |
| 668 | * count unchanged. If the object is not floating, then this call |
| 669 | * adds a new normal reference increasing the reference count by one. |
| 670 | * |
| 671 | * Since GLib 2.56, the type of `object` will be propagated to the return type |
| 672 | * under the same conditions as for g_object_ref(). |
| 673 | * @returns @object |
| 674 | */ |
| 675 | ref_sink(): GObject.Object; |
| 676 | /** |
| 677 | * Releases all references to other objects. This can be used to break |
| 678 | * reference cycles. |
| 679 | * |
| 680 | * This function should only be called from object system implementations. |
| 681 | */ |
| 682 | run_dispose(): void; |
| 683 | /** |
| 684 | * Each object carries around a table of associations from |
| 685 | * strings to pointers. This function lets you set an association. |
| 686 | * |
| 687 | * If the object already had an association with that name, |
| 688 | * the old association will be destroyed. |
| 689 | * |
| 690 | * Internally, the `key` is converted to a #GQuark using g_quark_from_string(). |
| 691 | * This means a copy of `key` is kept permanently (even after `object` has been |
| 692 | * finalized) — so it is recommended to only use a small, bounded set of values |
| 693 | * for `key` in your program, to avoid the #GQuark storage growing unbounded. |
| 694 | * @param key name of the key |
| 695 | * @param data data to associate with that key |
| 696 | */ |
| 697 | set_data(key: string, data?: any | null): void; |
| 698 | /** |
| 699 | * Sets a property on an object. |
| 700 | * @param property_name The name of the property to set |
| 701 | * @param value The value to set the property to |
| 702 | */ |
| 703 | set_property(property_name: string, value: GObject.Value | any): void; |
| 704 | /** |
| 705 | * Remove a specified datum from the object's data associations, |
| 706 | * without invoking the association's destroy handler. |
| 707 | * @param key name of the key |
| 708 | * @returns the data if found, or %NULL if no such data exists. |
| 709 | */ |
| 710 | steal_data(key: string): any | null; |
| 711 | /** |
| 712 | * This function gets back user data pointers stored via |
| 713 | * g_object_set_qdata() and removes the `data` from object |
| 714 | * without invoking its destroy() function (if any was |
| 715 | * set). |
| 716 | * Usually, calling this function is only required to update |
| 717 | * user data pointers with a destroy notifier, for example: |
| 718 | * |
| 719 | * ```c |
| 720 | * void |
| 721 | * object_add_to_user_list (GObject *object, |
| 722 | * const gchar *new_string) |
| 723 | * { |
| 724 | * // the quark, naming the object data |
| 725 | * GQuark quark_string_list = g_quark_from_static_string ("my-string-list"); |
| 726 | * // retrieve the old string list |
| 727 | * GList *list = g_object_steal_qdata (object, quark_string_list); |
| 728 | * |
| 729 | * // prepend new string |
| 730 | * list = g_list_prepend (list, g_strdup (new_string)); |
| 731 | * // this changed 'list', so we need to set it again |
| 732 | * g_object_set_qdata_full (object, quark_string_list, list, free_string_list); |
| 733 | * } |
| 734 | * static void |
| 735 | * free_string_list (gpointer data) |
| 736 | * { |
| 737 | * GList *node, *list = data; |
| 738 | * |
| 739 | * for (node = list; node; node = node->next) |
| 740 | * g_free (node->data); |
| 741 | * g_list_free (list); |
| 742 | * } |
| 743 | * ``` |
| 744 | * |
| 745 | * Using g_object_get_qdata() in the above example, instead of |
| 746 | * g_object_steal_qdata() would have left the destroy function set, |
| 747 | * and thus the partial string list would have been freed upon |
| 748 | * g_object_set_qdata_full(). |
| 749 | * @param quark A #GQuark, naming the user data pointer |
| 750 | * @returns The user data pointer set, or %NULL |
| 751 | */ |
| 752 | steal_qdata(quark: GLib.Quark): any | null; |
| 753 | /** |
| 754 | * Reverts the effect of a previous call to |
| 755 | * g_object_freeze_notify(). The freeze count is decreased on `object` |
| 756 | * and when it reaches zero, queued "notify" signals are emitted. |
| 757 | * |
| 758 | * Duplicate notifications for each property are squashed so that at most one |
| 759 | * #GObject::notify signal is emitted for each property, in the reverse order |
| 760 | * in which they have been queued. |
| 761 | * |
| 762 | * It is an error to call this function when the freeze count is zero. |
| 763 | */ |
| 764 | thaw_notify(): void; |
| 765 | /** |
| 766 | * Decreases the reference count of `object`. When its reference count |
| 767 | * drops to 0, the object is finalized (i.e. its memory is freed). |
| 768 | * |
| 769 | * If the pointer to the #GObject may be reused in future (for example, if it is |
| 770 | * an instance variable of another object), it is recommended to clear the |
| 771 | * pointer to %NULL rather than retain a dangling pointer to a potentially |
| 772 | * invalid #GObject instance. Use g_clear_object() for this. |
| 773 | */ |
| 774 | unref(): void; |
| 775 | /** |
| 776 | * This function essentially limits the life time of the `closure` to |
| 777 | * the life time of the object. That is, when the object is finalized, |
| 778 | * the `closure` is invalidated by calling g_closure_invalidate() on |
| 779 | * it, in order to prevent invocations of the closure with a finalized |
| 780 | * (nonexisting) object. Also, g_object_ref() and g_object_unref() are |
| 781 | * added as marshal guards to the `closure,` to ensure that an extra |
| 782 | * reference count is held on `object` during invocation of the |
| 783 | * `closure`. Usually, this function will be called on closures that |
| 784 | * use this `object` as closure data. |
| 785 | * @param closure #GClosure to watch |
| 786 | */ |
| 787 | watch_closure(closure: GObject.Closure): void; |
| 788 | /** |
| 789 | * the `constructed` function is called by g_object_new() as the |
| 790 | * final step of the object creation process. At the point of the call, all |
| 791 | * construction properties have been set on the object. The purpose of this |
| 792 | * call is to allow for object initialisation steps that can only be performed |
| 793 | * after construction properties have been set. `constructed` implementors |
| 794 | * should chain up to the `constructed` call of their parent class to allow it |
| 795 | * to complete its initialisation. |
| 796 | */ |
| 797 | vfunc_constructed(): void; |
| 798 | /** |
| 799 | * emits property change notification for a bunch |
| 800 | * of properties. Overriding `dispatch_properties_changed` should be rarely |
| 801 | * needed. |
| 802 | * @param n_pspecs |
| 803 | * @param pspecs |
| 804 | */ |
| 805 | vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void; |
| 806 | /** |
| 807 | * the `dispose` function is supposed to drop all references to other |
| 808 | * objects, but keep the instance otherwise intact, so that client method |
| 809 | * invocations still work. It may be run multiple times (due to reference |
| 810 | * loops). Before returning, `dispose` should chain up to the `dispose` method |
| 811 | * of the parent class. |
| 812 | */ |
| 813 | vfunc_dispose(): void; |
| 814 | /** |
| 815 | * instance finalization function, should finish the finalization of |
| 816 | * the instance begun in `dispose` and chain up to the `finalize` method of the |
| 817 | * parent class. |
| 818 | */ |
| 819 | vfunc_finalize(): void; |
| 820 | /** |
| 821 | * the generic getter for all properties of this type. Should be |
| 822 | * overridden for every type with properties. |
| 823 | * @param property_id |
| 824 | * @param value |
| 825 | * @param pspec |
| 826 | */ |
| 827 | vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void; |
| 828 | /** |
| 829 | * Emits a "notify" signal for the property `property_name` on `object`. |
| 830 | * |
| 831 | * When possible, eg. when signaling a property change from within the class |
| 832 | * that registered the property, you should use g_object_notify_by_pspec() |
| 833 | * instead. |
| 834 | * |
| 835 | * Note that emission of the notify signal may be blocked with |
| 836 | * g_object_freeze_notify(). In this case, the signal emissions are queued |
| 837 | * and will be emitted (in reverse order) when g_object_thaw_notify() is |
| 838 | * called. |
| 839 | * @param pspec |
| 840 | */ |
| 841 | vfunc_notify(pspec: GObject.ParamSpec): void; |
| 842 | /** |
| 843 | * the generic setter for all properties of this type. Should be |
| 844 | * overridden for every type with properties. If implementations of |
| 845 | * `set_property` don't emit property change notification explicitly, this will |
| 846 | * be done implicitly by the type system. However, if the notify signal is |
| 847 | * emitted explicitly, the type system will not emit it a second time. |
| 848 | * @param property_id |
| 849 | * @param value |
| 850 | * @param pspec |
| 851 | */ |
| 852 | vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void; |
| 853 | /** |
| 854 | * Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to. |
| 855 | * @param id Handler ID of the handler to be disconnected |
| 856 | */ |
| 857 | disconnect(id: number): void; |
| 858 | /** |
| 859 | * Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values. |
| 860 | * @param properties Object containing the properties to set |
| 861 | */ |
| 862 | set(properties: { [key: string]: any }): void; |
| 863 | /** |
| 864 | * Blocks a handler of an instance so it will not be called during any signal emissions |
| 865 | * @param id Handler ID of the handler to be blocked |
| 866 | */ |
| 867 | block_signal_handler(id: number): void; |
| 868 | /** |
| 869 | * Unblocks a handler so it will be called again during any signal emissions |
| 870 | * @param id Handler ID of the handler to be unblocked |
| 871 | */ |
| 872 | unblock_signal_handler(id: number): void; |
| 873 | /** |
| 874 | * Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked. |
| 875 | * @param detailedName Name of the signal to stop emission of |
| 876 | */ |
| 877 | stop_emission_by_name(detailedName: string): void; |
| 878 | } |
| 879 | |
| 880 | namespace CertificateWidget { |
| 881 | // Constructor properties interface |
| 882 | |
| 883 | interface ConstructorProps |
| 884 | extends Gtk.Bin.ConstructorProps, |
| 885 | Atk.ImplementorIface.ConstructorProps, |
| 886 | Gtk.Buildable.ConstructorProps { |
| 887 | attributes: Gck.Attributes; |
| 888 | certificate: Gcr.Certificate; |
| 889 | } |
| 890 | } |
| 891 | |
| 892 | /** |
| 893 | * A widget that can be used to display a certificate. |
| 894 | * |
| 895 | * A certificate widget is normally in a collapsed state showing only |
| 896 | * details, but can be expanded by the user. |
| 897 | * |
| 898 | * Use [ctor`CertificateWidget`.new] to create a new certificate widget. Only |
| 899 | * one certificate can be displayed. It contains a [iface`Viewer]` internally |
| 900 | * and [class`CertificateRenderer]` is used to render the certificate to the |
| 901 | * viewer. |
| 902 | * |
| 903 | * To show more than one certificate in a view, create the viewer and |
| 904 | * add renderers to it. |
| 905 | */ |
| 906 | class CertificateWidget extends Gtk.Bin implements Atk.ImplementorIface, Gtk.Buildable { |
| 907 | static $gtype: GObject.GType<CertificateWidget>; |
| 908 | |
| 909 | // Properties |
| 910 | |
| 911 | get attributes(): Gck.Attributes; |
| 912 | set attributes(val: Gck.Attributes); |
| 913 | get certificate(): Gcr.Certificate; |
| 914 | set certificate(val: Gcr.Certificate); |
| 915 | |
| 916 | // Constructors |
| 917 | |
| 918 | constructor(properties?: Partial<CertificateWidget.ConstructorProps>, ...args: any[]); |
| 919 | |
| 920 | _init(...args: any[]): void; |
| 921 | |
| 922 | static ['new'](certificate?: Gcr.Certificate | null): CertificateWidget; |
| 923 | |
| 924 | // Methods |
| 925 | |
| 926 | /** |
| 927 | * Get the attributes displayed in the widget. The attributes should contain |
| 928 | * a certificate. |
| 929 | * @returns the attributes, owned by the widget |
| 930 | */ |
| 931 | get_attributes(): Gck.Attributes | null; |
| 932 | /** |
| 933 | * Get the certificate displayed in the widget. |
| 934 | * @returns the certificate |
| 935 | */ |
| 936 | get_certificate(): Gcr.Certificate | null; |
| 937 | /** |
| 938 | * Set the attributes displayed in the widget. The attributes should contain |
| 939 | * a certificate. |
| 940 | * @param attrs the attributes to display |
| 941 | */ |
| 942 | set_attributes(attrs?: Gck.Attributes | null): void; |
| 943 | /** |
| 944 | * Set the certificate displayed in the widget |
| 945 | * @param certificate the certificate to display |
| 946 | */ |
| 947 | set_certificate(certificate?: Gcr.Certificate | null): void; |
| 948 | |
| 949 | // Inherited methods |
| 950 | /** |
| 951 | * Creates a binding between `source_property` on `source` and `target_property` |
| 952 | * on `target`. |
| 953 | * |
| 954 | * Whenever the `source_property` is changed the `target_property` is |
| 955 | * updated using the same value. For instance: |
| 956 | * |
| 957 | * |
| 958 | * ```c |
| 959 | * g_object_bind_property (action, "active", widget, "sensitive", 0); |
| 960 | * ``` |
| 961 | * |
| 962 | * |
| 963 | * Will result in the "sensitive" property of the widget #GObject instance to be |
| 964 | * updated with the same value of the "active" property of the action #GObject |
| 965 | * instance. |
| 966 | * |
| 967 | * If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual: |
| 968 | * if `target_property` on `target` changes then the `source_property` on `source` |
| 969 | * will be updated as well. |
| 970 | * |
| 971 | * The binding will automatically be removed when either the `source` or the |
| 972 | * `target` instances are finalized. To remove the binding without affecting the |
| 973 | * `source` and the `target` you can just call g_object_unref() on the returned |
| 974 | * #GBinding instance. |
| 975 | * |
| 976 | * Removing the binding by calling g_object_unref() on it must only be done if |
| 977 | * the binding, `source` and `target` are only used from a single thread and it |
| 978 | * is clear that both `source` and `target` outlive the binding. Especially it |
| 979 | * is not safe to rely on this if the binding, `source` or `target` can be |
| 980 | * finalized from different threads. Keep another reference to the binding and |
| 981 | * use g_binding_unbind() instead to be on the safe side. |
| 982 | * |
| 983 | * A #GObject can have multiple bindings. |
| 984 | * @param source_property the property on @source to bind |
| 985 | * @param target the target #GObject |
| 986 | * @param target_property the property on @target to bind |
| 987 | * @param flags flags to pass to #GBinding |
| 988 | * @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero. |
| 989 | */ |
| 990 | bind_property( |
| 991 | source_property: string, |
| 992 | target: GObject.Object, |
| 993 | target_property: string, |
| 994 | flags: GObject.BindingFlags | null, |
| 995 | ): GObject.Binding; |
| 996 | /** |
| 997 | * Complete version of g_object_bind_property(). |
| 998 | * |
| 999 | * Creates a binding between `source_property` on `source` and `target_property` |
| 1000 | * on `target,` allowing you to set the transformation functions to be used by |
| 1001 | * the binding. |
| 1002 | * |
| 1003 | * If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual: |
| 1004 | * if `target_property` on `target` changes then the `source_property` on `source` |
| 1005 | * will be updated as well. The `transform_from` function is only used in case |
| 1006 | * of bidirectional bindings, otherwise it will be ignored |
| 1007 | * |
| 1008 | * The binding will automatically be removed when either the `source` or the |
| 1009 | * `target` instances are finalized. This will release the reference that is |
| 1010 | * being held on the #GBinding instance; if you want to hold on to the |
| 1011 | * #GBinding instance, you will need to hold a reference to it. |
| 1012 | * |
| 1013 | * To remove the binding, call g_binding_unbind(). |
| 1014 | * |
| 1015 | * A #GObject can have multiple bindings. |
| 1016 | * |
| 1017 | * The same `user_data` parameter will be used for both `transform_to` |
| 1018 | * and `transform_from` transformation functions; the `notify` function will |
| 1019 | * be called once, when the binding is removed. If you need different data |
| 1020 | * for each transformation function, please use |
| 1021 | * g_object_bind_property_with_closures() instead. |
| 1022 | * @param source_property the property on @source to bind |
| 1023 | * @param target the target #GObject |
| 1024 | * @param target_property the property on @target to bind |
| 1025 | * @param flags flags to pass to #GBinding |
| 1026 | * @param transform_to the transformation function from the @source to the @target, or %NULL to use the default |
| 1027 | * @param transform_from the transformation function from the @target to the @source, or %NULL to use the default |
| 1028 | * @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required |
| 1029 | * @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero. |
| 1030 | */ |
| 1031 | bind_property_full( |
| 1032 | source_property: string, |
| 1033 | target: GObject.Object, |
| 1034 | target_property: string, |
| 1035 | flags: GObject.BindingFlags | null, |
| 1036 | transform_to?: GObject.BindingTransformFunc | null, |
| 1037 | transform_from?: GObject.BindingTransformFunc | null, |
| 1038 | notify?: GLib.DestroyNotify | null, |
| 1039 | ): GObject.Binding; |
| 1040 | // Conflicted with GObject.Object.bind_property_full |
| 1041 | bind_property_full(...args: never[]): any; |
| 1042 | /** |
| 1043 | * This function is intended for #GObject implementations to re-enforce |
| 1044 | * a [floating][floating-ref] object reference. Doing this is seldom |
| 1045 | * required: all #GInitiallyUnowneds are created with a floating reference |
| 1046 | * which usually just needs to be sunken by calling g_object_ref_sink(). |
| 1047 | */ |
| 1048 | force_floating(): void; |
| 1049 | /** |
| 1050 | * Increases the freeze count on `object`. If the freeze count is |
| 1051 | * non-zero, the emission of "notify" signals on `object` is |
| 1052 | * stopped. The signals are queued until the freeze count is decreased |
| 1053 | * to zero. Duplicate notifications are squashed so that at most one |
| 1054 | * #GObject::notify signal is emitted for each property modified while the |
| 1055 | * object is frozen. |
| 1056 | * |
| 1057 | * This is necessary for accessors that modify multiple properties to prevent |
| 1058 | * premature notification while the object is still being modified. |
| 1059 | */ |
| 1060 | freeze_notify(): void; |
| 1061 | /** |
| 1062 | * Gets a named field from the objects table of associations (see g_object_set_data()). |
| 1063 | * @param key name of the key for that association |
| 1064 | * @returns the data if found, or %NULL if no such data exists. |
| 1065 | */ |
| 1066 | get_data(key: string): any | null; |
| 1067 | /** |
| 1068 | * Gets a property of an object. |
| 1069 | * |
| 1070 | * The value can be: |
| 1071 | * - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60) |
| 1072 | * - a GObject.Value initialized with the expected type of the property |
| 1073 | * - a GObject.Value initialized with a type to which the expected type of the property can be transformed |
| 1074 | * |
| 1075 | * In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset. |
| 1076 | * |
| 1077 | * Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming. |
| 1078 | * @param property_name The name of the property to get |
| 1079 | * @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type |
| 1080 | */ |
| 1081 | get_property(property_name: string, value: GObject.Value | any): any; |
| 1082 | /** |
| 1083 | * This function gets back user data pointers stored via |
| 1084 | * g_object_set_qdata(). |
| 1085 | * @param quark A #GQuark, naming the user data pointer |
| 1086 | * @returns The user data pointer set, or %NULL |
| 1087 | */ |
| 1088 | get_qdata(quark: GLib.Quark): any | null; |
| 1089 | /** |
| 1090 | * Gets `n_properties` properties for an `object`. |
| 1091 | * Obtained properties will be set to `values`. All properties must be valid. |
| 1092 | * Warnings will be emitted and undefined behaviour may result if invalid |
| 1093 | * properties are passed in. |
| 1094 | * @param names the names of each property to get |
| 1095 | * @param values the values of each property to get |
| 1096 | */ |
| 1097 | getv(names: string[], values: (GObject.Value | any)[]): void; |
| 1098 | /** |
| 1099 | * Checks whether `object` has a [floating][floating-ref] reference. |
| 1100 | * @returns %TRUE if @object has a floating reference |
| 1101 | */ |
| 1102 | is_floating(): boolean; |
| 1103 | /** |
| 1104 | * Emits a "notify" signal for the property `property_name` on `object`. |
| 1105 | * |
| 1106 | * When possible, eg. when signaling a property change from within the class |
| 1107 | * that registered the property, you should use g_object_notify_by_pspec() |
| 1108 | * instead. |
| 1109 | * |
| 1110 | * Note that emission of the notify signal may be blocked with |
| 1111 | * g_object_freeze_notify(). In this case, the signal emissions are queued |
| 1112 | * and will be emitted (in reverse order) when g_object_thaw_notify() is |
| 1113 | * called. |
| 1114 | * @param property_name the name of a property installed on the class of @object. |
| 1115 | */ |
| 1116 | notify(property_name: string): void; |
| 1117 | /** |
| 1118 | * Emits a "notify" signal for the property specified by `pspec` on `object`. |
| 1119 | * |
| 1120 | * This function omits the property name lookup, hence it is faster than |
| 1121 | * g_object_notify(). |
| 1122 | * |
| 1123 | * One way to avoid using g_object_notify() from within the |
| 1124 | * class that registered the properties, and using g_object_notify_by_pspec() |
| 1125 | * instead, is to store the GParamSpec used with |
| 1126 | * g_object_class_install_property() inside a static array, e.g.: |
| 1127 | * |
| 1128 | * |
| 1129 | * ```c |
| 1130 | * typedef enum |
| 1131 | * { |
| 1132 | * PROP_FOO = 1, |
| 1133 | * PROP_LAST |
| 1134 | * } MyObjectProperty; |
| 1135 | * |
| 1136 | * static GParamSpec *properties[PROP_LAST]; |
| 1137 | * |
| 1138 | * static void |
| 1139 | * my_object_class_init (MyObjectClass *klass) |
| 1140 | * { |
| 1141 | * properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL, |
| 1142 | * 0, 100, |
| 1143 | * 50, |
| 1144 | * G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); |
| 1145 | * g_object_class_install_property (gobject_class, |
| 1146 | * PROP_FOO, |
| 1147 | * properties[PROP_FOO]); |
| 1148 | * } |
| 1149 | * ``` |
| 1150 | * |
| 1151 | * |
| 1152 | * and then notify a change on the "foo" property with: |
| 1153 | * |
| 1154 | * |
| 1155 | * ```c |
| 1156 | * g_object_notify_by_pspec (self, properties[PROP_FOO]); |
| 1157 | * ``` |
| 1158 | * |
| 1159 | * @param pspec the #GParamSpec of a property installed on the class of @object. |
| 1160 | */ |
| 1161 | notify_by_pspec(pspec: GObject.ParamSpec): void; |
| 1162 | /** |
| 1163 | * Increases the reference count of `object`. |
| 1164 | * |
| 1165 | * Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type |
| 1166 | * of `object` will be propagated to the return type (using the GCC typeof() |
| 1167 | * extension), so any casting the caller needs to do on the return type must be |
| 1168 | * explicit. |
| 1169 | * @returns the same @object |
| 1170 | */ |
| 1171 | ref(): GObject.Object; |
| 1172 | /** |
| 1173 | * Increase the reference count of `object,` and possibly remove the |
| 1174 | * [floating][floating-ref] reference, if `object` has a floating reference. |
| 1175 | * |
| 1176 | * In other words, if the object is floating, then this call "assumes |
| 1177 | * ownership" of the floating reference, converting it to a normal |
| 1178 | * reference by clearing the floating flag while leaving the reference |
| 1179 | * count unchanged. If the object is not floating, then this call |
| 1180 | * adds a new normal reference increasing the reference count by one. |
| 1181 | * |
| 1182 | * Since GLib 2.56, the type of `object` will be propagated to the return type |
| 1183 | * under the same conditions as for g_object_ref(). |
| 1184 | * @returns @object |
| 1185 | */ |
| 1186 | ref_sink(): GObject.Object; |
| 1187 | /** |
| 1188 | * Releases all references to other objects. This can be used to break |
| 1189 | * reference cycles. |
| 1190 | * |
| 1191 | * This function should only be called from object system implementations. |
| 1192 | */ |
| 1193 | run_dispose(): void; |
| 1194 | /** |
| 1195 | * Each object carries around a table of associations from |
| 1196 | * strings to pointers. This function lets you set an association. |
| 1197 | * |
| 1198 | * If the object already had an association with that name, |
| 1199 | * the old association will be destroyed. |
| 1200 | * |
| 1201 | * Internally, the `key` is converted to a #GQuark using g_quark_from_string(). |
| 1202 | * This means a copy of `key` is kept permanently (even after `object` has been |
| 1203 | * finalized) — so it is recommended to only use a small, bounded set of values |
| 1204 | * for `key` in your program, to avoid the #GQuark storage growing unbounded. |
| 1205 | * @param key name of the key |
| 1206 | * @param data data to associate with that key |
| 1207 | */ |
| 1208 | set_data(key: string, data?: any | null): void; |
| 1209 | /** |
| 1210 | * Sets a property on an object. |
| 1211 | * @param property_name The name of the property to set |
| 1212 | * @param value The value to set the property to |
| 1213 | */ |
| 1214 | set_property(property_name: string, value: GObject.Value | any): void; |
| 1215 | /** |
| 1216 | * Remove a specified datum from the object's data associations, |
| 1217 | * without invoking the association's destroy handler. |
| 1218 | * @param key name of the key |
| 1219 | * @returns the data if found, or %NULL if no such data exists. |
| 1220 | */ |
| 1221 | steal_data(key: string): any | null; |
| 1222 | /** |
| 1223 | * This function gets back user data pointers stored via |
| 1224 | * g_object_set_qdata() and removes the `data` from object |
| 1225 | * without invoking its destroy() function (if any was |
| 1226 | * set). |
| 1227 | * Usually, calling this function is only required to update |
| 1228 | * user data pointers with a destroy notifier, for example: |
| 1229 | * |
| 1230 | * ```c |
| 1231 | * void |
| 1232 | * object_add_to_user_list (GObject *object, |
| 1233 | * const gchar *new_string) |
| 1234 | * { |
| 1235 | * // the quark, naming the object data |
| 1236 | * GQuark quark_string_list = g_quark_from_static_string ("my-string-list"); |
| 1237 | * // retrieve the old string list |
| 1238 | * GList *list = g_object_steal_qdata (object, quark_string_list); |
| 1239 | * |
| 1240 | * // prepend new string |
| 1241 | * list = g_list_prepend (list, g_strdup (new_string)); |
| 1242 | * // this changed 'list', so we need to set it again |
| 1243 | * g_object_set_qdata_full (object, quark_string_list, list, free_string_list); |
| 1244 | * } |
| 1245 | * static void |
| 1246 | * free_string_list (gpointer data) |
| 1247 | * { |
| 1248 | * GList *node, *list = data; |
| 1249 | * |
| 1250 | * for (node = list; node; node = node->next) |
| 1251 | * g_free (node->data); |
| 1252 | * g_list_free (list); |
| 1253 | * } |
| 1254 | * ``` |
| 1255 | * |
| 1256 | * Using g_object_get_qdata() in the above example, instead of |
| 1257 | * g_object_steal_qdata() would have left the destroy function set, |
| 1258 | * and thus the partial string list would have been freed upon |
| 1259 | * g_object_set_qdata_full(). |
| 1260 | * @param quark A #GQuark, naming the user data pointer |
| 1261 | * @returns The user data pointer set, or %NULL |
| 1262 | */ |
| 1263 | steal_qdata(quark: GLib.Quark): any | null; |
| 1264 | /** |
| 1265 | * Reverts the effect of a previous call to |
| 1266 | * g_object_freeze_notify(). The freeze count is decreased on `object` |
| 1267 | * and when it reaches zero, queued "notify" signals are emitted. |
| 1268 | * |
| 1269 | * Duplicate notifications for each property are squashed so that at most one |
| 1270 | * #GObject::notify signal is emitted for each property, in the reverse order |
| 1271 | * in which they have been queued. |
| 1272 | * |
| 1273 | * It is an error to call this function when the freeze count is zero. |
| 1274 | */ |
| 1275 | thaw_notify(): void; |
| 1276 | /** |
| 1277 | * Decreases the reference count of `object`. When its reference count |
| 1278 | * drops to 0, the object is finalized (i.e. its memory is freed). |
| 1279 | * |
| 1280 | * If the pointer to the #GObject may be reused in future (for example, if it is |
| 1281 | * an instance variable of another object), it is recommended to clear the |
| 1282 | * pointer to %NULL rather than retain a dangling pointer to a potentially |
| 1283 | * invalid #GObject instance. Use g_clear_object() for this. |
| 1284 | */ |
| 1285 | unref(): void; |
| 1286 | /** |
| 1287 | * This function essentially limits the life time of the `closure` to |
| 1288 | * the life time of the object. That is, when the object is finalized, |
| 1289 | * the `closure` is invalidated by calling g_closure_invalidate() on |
| 1290 | * it, in order to prevent invocations of the closure with a finalized |
| 1291 | * (nonexisting) object. Also, g_object_ref() and g_object_unref() are |
| 1292 | * added as marshal guards to the `closure,` to ensure that an extra |
| 1293 | * reference count is held on `object` during invocation of the |
| 1294 | * `closure`. Usually, this function will be called on closures that |
| 1295 | * use this `object` as closure data. |
| 1296 | * @param closure #GClosure to watch |
| 1297 | */ |
| 1298 | watch_closure(closure: GObject.Closure): void; |
| 1299 | /** |
| 1300 | * the `constructed` function is called by g_object_new() as the |
| 1301 | * final step of the object creation process. At the point of the call, all |
| 1302 | * construction properties have been set on the object. The purpose of this |
| 1303 | * call is to allow for object initialisation steps that can only be performed |
| 1304 | * after construction properties have been set. `constructed` implementors |
| 1305 | * should chain up to the `constructed` call of their parent class to allow it |
| 1306 | * to complete its initialisation. |
| 1307 | */ |
| 1308 | vfunc_constructed(): void; |
| 1309 | /** |
| 1310 | * emits property change notification for a bunch |
| 1311 | * of properties. Overriding `dispatch_properties_changed` should be rarely |
| 1312 | * needed. |
| 1313 | * @param n_pspecs |
| 1314 | * @param pspecs |
| 1315 | */ |
| 1316 | vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void; |
| 1317 | /** |
| 1318 | * the `dispose` function is supposed to drop all references to other |
| 1319 | * objects, but keep the instance otherwise intact, so that client method |
| 1320 | * invocations still work. It may be run multiple times (due to reference |
| 1321 | * loops). Before returning, `dispose` should chain up to the `dispose` method |
| 1322 | * of the parent class. |
| 1323 | */ |
| 1324 | vfunc_dispose(): void; |
| 1325 | /** |
| 1326 | * instance finalization function, should finish the finalization of |
| 1327 | * the instance begun in `dispose` and chain up to the `finalize` method of the |
| 1328 | * parent class. |
| 1329 | */ |
| 1330 | vfunc_finalize(): void; |
| 1331 | /** |
| 1332 | * the generic getter for all properties of this type. Should be |
| 1333 | * overridden for every type with properties. |
| 1334 | * @param property_id |
| 1335 | * @param value |
| 1336 | * @param pspec |
| 1337 | */ |
| 1338 | vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void; |
| 1339 | /** |
| 1340 | * Emits a "notify" signal for the property `property_name` on `object`. |
| 1341 | * |
| 1342 | * When possible, eg. when signaling a property change from within the class |
| 1343 | * that registered the property, you should use g_object_notify_by_pspec() |
| 1344 | * instead. |
| 1345 | * |
| 1346 | * Note that emission of the notify signal may be blocked with |
| 1347 | * g_object_freeze_notify(). In this case, the signal emissions are queued |
| 1348 | * and will be emitted (in reverse order) when g_object_thaw_notify() is |
| 1349 | * called. |
| 1350 | * @param pspec |
| 1351 | */ |
| 1352 | vfunc_notify(pspec: GObject.ParamSpec): void; |
| 1353 | /** |
| 1354 | * the generic setter for all properties of this type. Should be |
| 1355 | * overridden for every type with properties. If implementations of |
| 1356 | * `set_property` don't emit property change notification explicitly, this will |
| 1357 | * be done implicitly by the type system. However, if the notify signal is |
| 1358 | * emitted explicitly, the type system will not emit it a second time. |
| 1359 | * @param property_id |
| 1360 | * @param value |
| 1361 | * @param pspec |
| 1362 | */ |
| 1363 | vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void; |
| 1364 | /** |
| 1365 | * Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to. |
| 1366 | * @param id Handler ID of the handler to be disconnected |
| 1367 | */ |
| 1368 | disconnect(id: number): void; |
| 1369 | /** |
| 1370 | * Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values. |
| 1371 | * @param properties Object containing the properties to set |
| 1372 | */ |
| 1373 | set(properties: { [key: string]: any }): void; |
| 1374 | /** |
| 1375 | * Blocks a handler of an instance so it will not be called during any signal emissions |
| 1376 | * @param id Handler ID of the handler to be blocked |
| 1377 | */ |
| 1378 | block_signal_handler(id: number): void; |
| 1379 | /** |
| 1380 | * Unblocks a handler so it will be called again during any signal emissions |
| 1381 | * @param id Handler ID of the handler to be unblocked |
| 1382 | */ |
| 1383 | unblock_signal_handler(id: number): void; |
| 1384 | /** |
| 1385 | * Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked. |
| 1386 | * @param detailedName Name of the signal to stop emission of |
| 1387 | */ |
| 1388 | stop_emission_by_name(detailedName: string): void; |
| 1389 | } |
| 1390 | |
| 1391 | namespace CollectionModel { |
| 1392 | // Constructor properties interface |
| 1393 | |
| 1394 | interface ConstructorProps |
| 1395 | extends GObject.Object.ConstructorProps, |
| 1396 | Gtk.TreeModel.ConstructorProps, |
| 1397 | Gtk.TreeSortable.ConstructorProps { |
| 1398 | collection: Gcr.Collection; |
| 1399 | columns: any; |
| 1400 | } |
| 1401 | } |
| 1402 | |
| 1403 | /** |
| 1404 | * Ain implementation of a [iface`Gtk`.TreeModel] which contains a row for each |
| 1405 | * object in a [iface`Gcr`.Collection]. |
| 1406 | * |
| 1407 | * As objects are added or removed from the collection, rows are added and |
| 1408 | * removed from this model. |
| 1409 | * |
| 1410 | * The row values come from the properties of the objects in the collection. Use |
| 1411 | * [ctor`CollectionModel`.new] to create a new collection model. To have more |
| 1412 | * control over the values use a set of [struct`Gcr`.Column] structures to |
| 1413 | * define the columns. This can be done with [ctor`CollectionModel`.new_full] or |
| 1414 | * [method`CollectionModel`.set_columns]. |
| 1415 | * |
| 1416 | * Each row can have a selected state, which is represented by a boolean column. |
| 1417 | * The selected state can be toggled with gcr_collection_model_toggle_selected() |
| 1418 | * or set with gcr_collection_model_set_selected_objects() and retrieved with |
| 1419 | * [method`CollectionModel`.get_selected_objects]. |
| 1420 | * |
| 1421 | * To determine which object a row represents and vice versa, use the |
| 1422 | * [method`CollectionModel`.iter_for_object] or |
| 1423 | * [method`CollectionModel`.object_for_iter] functions. |
| 1424 | */ |
| 1425 | class CollectionModel extends GObject.Object implements Gtk.TreeModel, Gtk.TreeSortable { |
| 1426 | static $gtype: GObject.GType<CollectionModel>; |
| 1427 | |
| 1428 | // Properties |
| 1429 | |
| 1430 | get collection(): Gcr.Collection; |
| 1431 | set collection(val: Gcr.Collection); |
| 1432 | get columns(): any; |
| 1433 | |
| 1434 | // Constructors |
| 1435 | |
| 1436 | constructor(properties?: Partial<CollectionModel.ConstructorProps>, ...args: any[]); |
| 1437 | |
| 1438 | _init(...args: any[]): void; |
| 1439 | |
| 1440 | // Methods |
| 1441 | |
| 1442 | /** |
| 1443 | * Set whether a given row is toggled selected or not. |
| 1444 | * @param iter The row |
| 1445 | * @param selected Whether the row should be selected or not. |
| 1446 | */ |
| 1447 | change_selected(iter: Gtk.TreeIter, selected: boolean): void; |
| 1448 | /** |
| 1449 | * Get the column identifier for the column that contains the values |
| 1450 | * of the selected state. |
| 1451 | * @returns The column identifier. |
| 1452 | */ |
| 1453 | column_for_selected(): number; |
| 1454 | /** |
| 1455 | * Get the collection which this model represents |
| 1456 | * @returns the collection, owned by the model |
| 1457 | */ |
| 1458 | get_collection(): Gcr.Collection; |
| 1459 | /** |
| 1460 | * Get a list of checked/selected objects. |
| 1461 | * @returns a list of selected objects, which should be freed with g_list_free() |
| 1462 | */ |
| 1463 | get_selected_objects(): GObject.Object[]; |
| 1464 | /** |
| 1465 | * Check whether a given row has been toggled as selected. |
| 1466 | * @param iter The row |
| 1467 | * @returns Whether the row has been selected. |
| 1468 | */ |
| 1469 | is_selected(iter: Gtk.TreeIter): boolean; |
| 1470 | /** |
| 1471 | * Set `iter` to the row for the given object. If the object is not in this |
| 1472 | * model, then %FALSE will be returned. |
| 1473 | * @param object The object |
| 1474 | * @param iter The row for the object |
| 1475 | * @returns %TRUE if the object was present. |
| 1476 | */ |
| 1477 | iter_for_object(object: GObject.Object, iter: Gtk.TreeIter): boolean; |
| 1478 | /** |
| 1479 | * Get the object that is represented by the given row in the model. |
| 1480 | * @param iter The row |
| 1481 | * @returns The object, owned by the model. |
| 1482 | */ |
| 1483 | object_for_iter<T = GObject.Object>(iter: Gtk.TreeIter): T; |
| 1484 | /** |
| 1485 | * Set the collection which this model represents |
| 1486 | * @param collection the collection or %NULL |
| 1487 | */ |
| 1488 | set_collection(collection?: Gcr.Collection | null): void; |
| 1489 | /** |
| 1490 | * Set the checked/selected objects. |
| 1491 | * @param selected a list of objects to select |
| 1492 | */ |
| 1493 | set_selected_objects(selected: GObject.Object[]): void; |
| 1494 | /** |
| 1495 | * Toggle the selected state of a given row. |
| 1496 | * @param iter The row |
| 1497 | */ |
| 1498 | toggle_selected(iter: Gtk.TreeIter): void; |
| 1499 | |
| 1500 | // Inherited methods |
| 1501 | /** |
| 1502 | * Creates a new #GtkTreeModel, with `child_model` as the child_model |
| 1503 | * and `root` as the virtual root. |
| 1504 | * @param root A #GtkTreePath or %NULL. |
| 1505 | * @returns A new #GtkTreeModel. |
| 1506 | */ |
| 1507 | filter_new(root?: Gtk.TreePath | null): Gtk.TreeModel; |
| 1508 | /** |
| 1509 | * Calls func on each node in model in a depth-first fashion. |
| 1510 | * |
| 1511 | * If `func` returns %TRUE, then the tree ceases to be walked, |
| 1512 | * and gtk_tree_model_foreach() returns. |
| 1513 | * @param func a function to be called on each row |
| 1514 | */ |
| 1515 | foreach(func: Gtk.TreeModelForeachFunc): void; |
| 1516 | /** |
| 1517 | * Returns the type of the column. |
| 1518 | * @param index_ the column index |
| 1519 | * @returns the type of the column |
| 1520 | */ |
| 1521 | get_column_type(index_: number): GObject.GType; |
| 1522 | /** |
| 1523 | * Returns a set of flags supported by this interface. |
| 1524 | * |
| 1525 | * The flags are a bitwise combination of #GtkTreeModelFlags. |
| 1526 | * The flags supported should not change during the lifetime |
| 1527 | * of the `tree_model`. |
| 1528 | * @returns the flags supported by this interface |
| 1529 | */ |
| 1530 | get_flags(): Gtk.TreeModelFlags; |
| 1531 | /** |
| 1532 | * Sets `iter` to a valid iterator pointing to `path`. If `path` does |
| 1533 | * not exist, `iter` is set to an invalid iterator and %FALSE is returned. |
| 1534 | * @param path the #GtkTreePath-struct |
| 1535 | * @returns %TRUE, if @iter was set |
| 1536 | */ |
| 1537 | get_iter(path: Gtk.TreePath): [boolean, Gtk.TreeIter]; |
| 1538 | /** |
| 1539 | * Initializes `iter` with the first iterator in the tree |
| 1540 | * (the one at the path "0") and returns %TRUE. Returns |
| 1541 | * %FALSE if the tree is empty. |
| 1542 | * @returns %TRUE, if @iter was set |
| 1543 | */ |
| 1544 | get_iter_first(): [boolean, Gtk.TreeIter]; |
| 1545 | /** |
| 1546 | * Sets `iter` to a valid iterator pointing to `path_string,` if it |
| 1547 | * exists. Otherwise, `iter` is left invalid and %FALSE is returned. |
| 1548 | * @param path_string a string representation of a #GtkTreePath-struct |
| 1549 | * @returns %TRUE, if @iter was set |
| 1550 | */ |
| 1551 | get_iter_from_string(path_string: string): [boolean, Gtk.TreeIter]; |
| 1552 | /** |
| 1553 | * Returns the number of columns supported by `tree_model`. |
| 1554 | * @returns the number of columns |
| 1555 | */ |
| 1556 | get_n_columns(): number; |
| 1557 | /** |
| 1558 | * Returns a newly-created #GtkTreePath-struct referenced by `iter`. |
| 1559 | * |
| 1560 | * This path should be freed with gtk_tree_path_free(). |
| 1561 | * @param iter the #GtkTreeIter-struct |
| 1562 | * @returns a newly-created #GtkTreePath-struct |
| 1563 | */ |
| 1564 | get_path(iter: Gtk.TreeIter): Gtk.TreePath; |
| 1565 | /** |
| 1566 | * Generates a string representation of the iter. |
| 1567 | * |
| 1568 | * This string is a “:” separated list of numbers. |
| 1569 | * For example, “4:10:0:3” would be an acceptable |
| 1570 | * return value for this string. |
| 1571 | * @param iter a #GtkTreeIter-struct |
| 1572 | * @returns a newly-allocated string. Must be freed with g_free(). |
| 1573 | */ |
| 1574 | get_string_from_iter(iter: Gtk.TreeIter): string; |
| 1575 | /** |
| 1576 | * Initializes and sets `value` to that at `column`. |
| 1577 | * |
| 1578 | * When done with `value,` g_value_unset() needs to be called |
| 1579 | * to free any allocated memory. |
| 1580 | * @param iter the #GtkTreeIter-struct |
| 1581 | * @param column the column to lookup the value at |
| 1582 | */ |
| 1583 | get_value(iter: Gtk.TreeIter, column: number): unknown; |
| 1584 | /** |
| 1585 | * Sets `iter` to point to the first child of `parent`. |
| 1586 | * |
| 1587 | * If `parent` has no children, %FALSE is returned and `iter` is |
| 1588 | * set to be invalid. `parent` will remain a valid node after this |
| 1589 | * function has been called. |
| 1590 | * |
| 1591 | * If `parent` is %NULL returns the first node, equivalent to |
| 1592 | * `gtk_tree_model_get_iter_first (tree_model, iter);` |
| 1593 | * @param parent the #GtkTreeIter-struct, or %NULL |
| 1594 | * @returns %TRUE, if @iter has been set to the first child |
| 1595 | */ |
| 1596 | iter_children(parent?: Gtk.TreeIter | null): [boolean, Gtk.TreeIter]; |
| 1597 | /** |
| 1598 | * Returns %TRUE if `iter` has children, %FALSE otherwise. |
| 1599 | * @param iter the #GtkTreeIter-struct to test for children |
| 1600 | * @returns %TRUE if @iter has children |
| 1601 | */ |
| 1602 | iter_has_child(iter: Gtk.TreeIter): boolean; |
| 1603 | /** |
| 1604 | * Returns the number of children that `iter` has. |
| 1605 | * |
| 1606 | * As a special case, if `iter` is %NULL, then the number |
| 1607 | * of toplevel nodes is returned. |
| 1608 | * @param iter the #GtkTreeIter-struct, or %NULL |
| 1609 | * @returns the number of children of @iter |
| 1610 | */ |
| 1611 | iter_n_children(iter?: Gtk.TreeIter | null): number; |
| 1612 | /** |
| 1613 | * Sets `iter` to point to the node following it at the current level. |
| 1614 | * |
| 1615 | * If there is no next `iter,` %FALSE is returned and `iter` is set |
| 1616 | * to be invalid. |
| 1617 | * @param iter the #GtkTreeIter-struct |
| 1618 | * @returns %TRUE if @iter has been changed to the next node |
| 1619 | */ |
| 1620 | iter_next(iter: Gtk.TreeIter): boolean; |
| 1621 | /** |
| 1622 | * Sets `iter` to be the child of `parent,` using the given index. |
| 1623 | * |
| 1624 | * The first index is 0. If `n` is too big, or `parent` has no children, |
| 1625 | * `iter` is set to an invalid iterator and %FALSE is returned. `parent` |
| 1626 | * will remain a valid node after this function has been called. As a |
| 1627 | * special case, if `parent` is %NULL, then the `n-th` root node |
| 1628 | * is set. |
| 1629 | * @param parent the #GtkTreeIter-struct to get the child from, or %NULL. |
| 1630 | * @param n the index of the desired child |
| 1631 | * @returns %TRUE, if @parent has an @n-th child |
| 1632 | */ |
| 1633 | iter_nth_child(parent: Gtk.TreeIter | null, n: number): [boolean, Gtk.TreeIter]; |
| 1634 | /** |
| 1635 | * Sets `iter` to be the parent of `child`. |
| 1636 | * |
| 1637 | * If `child` is at the toplevel, and doesn’t have a parent, then |
| 1638 | * `iter` is set to an invalid iterator and %FALSE is returned. |
| 1639 | * `child` will remain a valid node after this function has been |
| 1640 | * called. |
| 1641 | * |
| 1642 | * `iter` will be initialized before the lookup is performed, so `child` |
| 1643 | * and `iter` cannot point to the same memory location. |
| 1644 | * @param child the #GtkTreeIter-struct |
| 1645 | * @returns %TRUE, if @iter is set to the parent of @child |
| 1646 | */ |
| 1647 | iter_parent(child: Gtk.TreeIter): [boolean, Gtk.TreeIter]; |
| 1648 | /** |
| 1649 | * Sets `iter` to point to the previous node at the current level. |
| 1650 | * |
| 1651 | * If there is no previous `iter,` %FALSE is returned and `iter` is |
| 1652 | * set to be invalid. |
| 1653 | * @param iter the #GtkTreeIter-struct |
| 1654 | * @returns %TRUE if @iter has been changed to the previous node |
| 1655 | */ |
| 1656 | iter_previous(iter: Gtk.TreeIter): boolean; |
| 1657 | /** |
| 1658 | * Lets the tree ref the node. |
| 1659 | * |
| 1660 | * This is an optional method for models to implement. |
| 1661 | * To be more specific, models may ignore this call as it exists |
| 1662 | * primarily for performance reasons. |
| 1663 | * |
| 1664 | * This function is primarily meant as a way for views to let |
| 1665 | * caching models know when nodes are being displayed (and hence, |
| 1666 | * whether or not to cache that node). Being displayed means a node |
| 1667 | * is in an expanded branch, regardless of whether the node is currently |
| 1668 | * visible in the viewport. For example, a file-system based model |
| 1669 | * would not want to keep the entire file-hierarchy in memory, |
| 1670 | * just the sections that are currently being displayed by |
| 1671 | * every current view. |
| 1672 | * |
| 1673 | * A model should be expected to be able to get an iter independent |
| 1674 | * of its reffed state. |
| 1675 | * @param iter the #GtkTreeIter-struct |
| 1676 | */ |
| 1677 | ref_node(iter: Gtk.TreeIter): void; |
| 1678 | /** |
| 1679 | * Emits the #GtkTreeModel::row-changed signal on `tree_model`. |
| 1680 | * @param path a #GtkTreePath-struct pointing to the changed row |
| 1681 | * @param iter a valid #GtkTreeIter-struct pointing to the changed row |
| 1682 | */ |
| 1683 | row_changed(path: Gtk.TreePath, iter: Gtk.TreeIter): void; |
| 1684 | /** |
| 1685 | * Emits the #GtkTreeModel::row-deleted signal on `tree_model`. |
| 1686 | * |
| 1687 | * This should be called by models after a row has been removed. |
| 1688 | * The location pointed to by `path` should be the location that |
| 1689 | * the row previously was at. It may not be a valid location anymore. |
| 1690 | * |
| 1691 | * Nodes that are deleted are not unreffed, this means that any |
| 1692 | * outstanding references on the deleted node should not be released. |
| 1693 | * @param path a #GtkTreePath-struct pointing to the previous location of the deleted row |
| 1694 | */ |
| 1695 | row_deleted(path: Gtk.TreePath): void; |
| 1696 | /** |
| 1697 | * Emits the #GtkTreeModel::row-has-child-toggled signal on |
| 1698 | * `tree_model`. This should be called by models after the child |
| 1699 | * state of a node changes. |
| 1700 | * @param path a #GtkTreePath-struct pointing to the changed row |
| 1701 | * @param iter a valid #GtkTreeIter-struct pointing to the changed row |
| 1702 | */ |
| 1703 | row_has_child_toggled(path: Gtk.TreePath, iter: Gtk.TreeIter): void; |
| 1704 | /** |
| 1705 | * Emits the #GtkTreeModel::row-inserted signal on `tree_model`. |
| 1706 | * @param path a #GtkTreePath-struct pointing to the inserted row |
| 1707 | * @param iter a valid #GtkTreeIter-struct pointing to the inserted row |
| 1708 | */ |
| 1709 | row_inserted(path: Gtk.TreePath, iter: Gtk.TreeIter): void; |
| 1710 | /** |
| 1711 | * Emits the #GtkTreeModel::rows-reordered signal on `tree_model`. |
| 1712 | * |
| 1713 | * This should be called by models when their rows have been |
| 1714 | * reordered. |
| 1715 | * @param path a #GtkTreePath-struct pointing to the tree node whose children have been reordered |
| 1716 | * @param iter a valid #GtkTreeIter-struct pointing to the node whose children have been reordered, or %NULL if the depth of @path is 0 |
| 1717 | * @param new_order an array of integers mapping the current position of each child to its old position before the re-ordering, i.e. @new_order`[newpos] = oldpos` |
| 1718 | */ |
| 1719 | rows_reordered(path: Gtk.TreePath, iter: Gtk.TreeIter | null, new_order: number[]): void; |
| 1720 | /** |
| 1721 | * Lets the tree unref the node. |
| 1722 | * |
| 1723 | * This is an optional method for models to implement. |
| 1724 | * To be more specific, models may ignore this call as it exists |
| 1725 | * primarily for performance reasons. For more information on what |
| 1726 | * this means, see gtk_tree_model_ref_node(). |
| 1727 | * |
| 1728 | * Please note that nodes that are deleted are not unreffed. |
| 1729 | * @param iter the #GtkTreeIter-struct |
| 1730 | */ |
| 1731 | unref_node(iter: Gtk.TreeIter): void; |
| 1732 | /** |
| 1733 | * Returns the type of the column. |
| 1734 | * @param index_ the column index |
| 1735 | */ |
| 1736 | vfunc_get_column_type(index_: number): GObject.GType; |
| 1737 | /** |
| 1738 | * Returns a set of flags supported by this interface. |
| 1739 | * |
| 1740 | * The flags are a bitwise combination of #GtkTreeModelFlags. |
| 1741 | * The flags supported should not change during the lifetime |
| 1742 | * of the `tree_model`. |
| 1743 | */ |
| 1744 | vfunc_get_flags(): Gtk.TreeModelFlags; |
| 1745 | /** |
| 1746 | * Sets `iter` to a valid iterator pointing to `path`. If `path` does |
| 1747 | * not exist, `iter` is set to an invalid iterator and %FALSE is returned. |
| 1748 | * @param path the #GtkTreePath-struct |
| 1749 | */ |
| 1750 | vfunc_get_iter(path: Gtk.TreePath): [boolean, Gtk.TreeIter]; |
| 1751 | /** |
| 1752 | * Returns the number of columns supported by `tree_model`. |
| 1753 | */ |
| 1754 | vfunc_get_n_columns(): number; |
| 1755 | /** |
| 1756 | * Returns a newly-created #GtkTreePath-struct referenced by `iter`. |
| 1757 | * |
| 1758 | * This path should be freed with gtk_tree_path_free(). |
| 1759 | * @param iter the #GtkTreeIter-struct |
| 1760 | */ |
| 1761 | vfunc_get_path(iter: Gtk.TreeIter): Gtk.TreePath; |
| 1762 | /** |
| 1763 | * Initializes and sets `value` to that at `column`. |
| 1764 | * |
| 1765 | * When done with `value,` g_value_unset() needs to be called |
| 1766 | * to free any allocated memory. |
| 1767 | * @param iter the #GtkTreeIter-struct |
| 1768 | * @param column the column to lookup the value at |
| 1769 | */ |
| 1770 | vfunc_get_value(iter: Gtk.TreeIter, column: number): unknown; |
| 1771 | /** |
| 1772 | * Sets `iter` to point to the first child of `parent`. |
| 1773 | * |
| 1774 | * If `parent` has no children, %FALSE is returned and `iter` is |
| 1775 | * set to be invalid. `parent` will remain a valid node after this |
| 1776 | * function has been called. |
| 1777 | * |
| 1778 | * If `parent` is %NULL returns the first node, equivalent to |
| 1779 | * `gtk_tree_model_get_iter_first (tree_model, iter);` |
| 1780 | * @param parent the #GtkTreeIter-struct, or %NULL |
| 1781 | */ |
| 1782 | vfunc_iter_children(parent?: Gtk.TreeIter | null): [boolean, Gtk.TreeIter]; |
| 1783 | /** |
| 1784 | * Returns %TRUE if `iter` has children, %FALSE otherwise. |
| 1785 | * @param iter the #GtkTreeIter-struct to test for children |
| 1786 | */ |
| 1787 | vfunc_iter_has_child(iter: Gtk.TreeIter): boolean; |
| 1788 | /** |
| 1789 | * Returns the number of children that `iter` has. |
| 1790 | * |
| 1791 | * As a special case, if `iter` is %NULL, then the number |
| 1792 | * of toplevel nodes is returned. |
| 1793 | * @param iter the #GtkTreeIter-struct, or %NULL |
| 1794 | */ |
| 1795 | vfunc_iter_n_children(iter?: Gtk.TreeIter | null): number; |
| 1796 | /** |
| 1797 | * Sets `iter` to point to the node following it at the current level. |
| 1798 | * |
| 1799 | * If there is no next `iter,` %FALSE is returned and `iter` is set |
| 1800 | * to be invalid. |
| 1801 | * @param iter the #GtkTreeIter-struct |
| 1802 | */ |
| 1803 | vfunc_iter_next(iter: Gtk.TreeIter): boolean; |
| 1804 | /** |
| 1805 | * Sets `iter` to be the child of `parent,` using the given index. |
| 1806 | * |
| 1807 | * The first index is 0. If `n` is too big, or `parent` has no children, |
| 1808 | * `iter` is set to an invalid iterator and %FALSE is returned. `parent` |
| 1809 | * will remain a valid node after this function has been called. As a |
| 1810 | * special case, if `parent` is %NULL, then the `n-th` root node |
| 1811 | * is set. |
| 1812 | * @param parent the #GtkTreeIter-struct to get the child from, or %NULL. |
| 1813 | * @param n the index of the desired child |
| 1814 | */ |
| 1815 | vfunc_iter_nth_child(parent: Gtk.TreeIter | null, n: number): [boolean, Gtk.TreeIter]; |
| 1816 | /** |
| 1817 | * Sets `iter` to be the parent of `child`. |
| 1818 | * |
| 1819 | * If `child` is at the toplevel, and doesn’t have a parent, then |
| 1820 | * `iter` is set to an invalid iterator and %FALSE is returned. |
| 1821 | * `child` will remain a valid node after this function has been |
| 1822 | * called. |
| 1823 | * |
| 1824 | * `iter` will be initialized before the lookup is performed, so `child` |
| 1825 | * and `iter` cannot point to the same memory location. |
| 1826 | * @param child the #GtkTreeIter-struct |
| 1827 | */ |
| 1828 | vfunc_iter_parent(child: Gtk.TreeIter): [boolean, Gtk.TreeIter]; |
| 1829 | /** |
| 1830 | * Sets `iter` to point to the previous node at the current level. |
| 1831 | * |
| 1832 | * If there is no previous `iter,` %FALSE is returned and `iter` is |
| 1833 | * set to be invalid. |
| 1834 | * @param iter the #GtkTreeIter-struct |
| 1835 | */ |
| 1836 | vfunc_iter_previous(iter: Gtk.TreeIter): boolean; |
| 1837 | /** |
| 1838 | * Lets the tree ref the node. |
| 1839 | * |
| 1840 | * This is an optional method for models to implement. |
| 1841 | * To be more specific, models may ignore this call as it exists |
| 1842 | * primarily for performance reasons. |
| 1843 | * |
| 1844 | * This function is primarily meant as a way for views to let |
| 1845 | * caching models know when nodes are being displayed (and hence, |
| 1846 | * whether or not to cache that node). Being displayed means a node |
| 1847 | * is in an expanded branch, regardless of whether the node is currently |
| 1848 | * visible in the viewport. For example, a file-system based model |
| 1849 | * would not want to keep the entire file-hierarchy in memory, |
| 1850 | * just the sections that are currently being displayed by |
| 1851 | * every current view. |
| 1852 | * |
| 1853 | * A model should be expected to be able to get an iter independent |
| 1854 | * of its reffed state. |
| 1855 | * @param iter the #GtkTreeIter-struct |
| 1856 | */ |
| 1857 | vfunc_ref_node(iter: Gtk.TreeIter): void; |
| 1858 | /** |
| 1859 | * Emits the #GtkTreeModel::row-changed signal on `tree_model`. |
| 1860 | * @param path a #GtkTreePath-struct pointing to the changed row |
| 1861 | * @param iter a valid #GtkTreeIter-struct pointing to the changed row |
| 1862 | */ |
| 1863 | vfunc_row_changed(path: Gtk.TreePath, iter: Gtk.TreeIter): void; |
| 1864 | /** |
| 1865 | * Emits the #GtkTreeModel::row-deleted signal on `tree_model`. |
| 1866 | * |
| 1867 | * This should be called by models after a row has been removed. |
| 1868 | * The location pointed to by `path` should be the location that |
| 1869 | * the row previously was at. It may not be a valid location anymore. |
| 1870 | * |
| 1871 | * Nodes that are deleted are not unreffed, this means that any |
| 1872 | * outstanding references on the deleted node should not be released. |
| 1873 | * @param path a #GtkTreePath-struct pointing to the previous location of the deleted row |
| 1874 | */ |
| 1875 | vfunc_row_deleted(path: Gtk.TreePath): void; |
| 1876 | /** |
| 1877 | * Emits the #GtkTreeModel::row-has-child-toggled signal on |
| 1878 | * `tree_model`. This should be called by models after the child |
| 1879 | * state of a node changes. |
| 1880 | * @param path a #GtkTreePath-struct pointing to the changed row |
| 1881 | * @param iter a valid #GtkTreeIter-struct pointing to the changed row |
| 1882 | */ |
| 1883 | vfunc_row_has_child_toggled(path: Gtk.TreePath, iter: Gtk.TreeIter): void; |
| 1884 | /** |
| 1885 | * Emits the #GtkTreeModel::row-inserted signal on `tree_model`. |
| 1886 | * @param path a #GtkTreePath-struct pointing to the inserted row |
| 1887 | * @param iter a valid #GtkTreeIter-struct pointing to the inserted row |
| 1888 | */ |
| 1889 | vfunc_row_inserted(path: Gtk.TreePath, iter: Gtk.TreeIter): void; |
| 1890 | /** |
| 1891 | * Lets the tree unref the node. |
| 1892 | * |
| 1893 | * This is an optional method for models to implement. |
| 1894 | * To be more specific, models may ignore this call as it exists |
| 1895 | * primarily for performance reasons. For more information on what |
| 1896 | * this means, see gtk_tree_model_ref_node(). |
| 1897 | * |
| 1898 | * Please note that nodes that are deleted are not unreffed. |
| 1899 | * @param iter the #GtkTreeIter-struct |
| 1900 | */ |
| 1901 | vfunc_unref_node(iter: Gtk.TreeIter): void; |
| 1902 | /** |
| 1903 | * Fills in `sort_column_id` and `order` with the current sort column and the |
| 1904 | * order. It returns %TRUE unless the `sort_column_id` is |
| 1905 | * %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID or |
| 1906 | * %GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID. |
| 1907 | * @returns %TRUE if the sort column is not one of the special sort column ids. |
| 1908 | */ |
| 1909 | get_sort_column_id(): [boolean, number, Gtk.SortType]; |
| 1910 | /** |
| 1911 | * Returns %TRUE if the model has a default sort function. This is used |
| 1912 | * primarily by GtkTreeViewColumns in order to determine if a model can |
| 1913 | * go back to the default state, or not. |
| 1914 | * @returns %TRUE, if the model has a default sort function |
| 1915 | */ |
| 1916 | has_default_sort_func(): boolean; |
| 1917 | /** |
| 1918 | * Sets the default comparison function used when sorting to be `sort_func`. |
| 1919 | * If the current sort column id of `sortable` is |
| 1920 | * %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, then the model will sort using |
| 1921 | * this function. |
| 1922 | * |
| 1923 | * If `sort_func` is %NULL, then there will be no default comparison function. |
| 1924 | * This means that once the model has been sorted, it can’t go back to the |
| 1925 | * default state. In this case, when the current sort column id of `sortable` |
| 1926 | * is %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, the model will be unsorted. |
| 1927 | * @param sort_func The comparison function |
| 1928 | * @param destroy Destroy notifier of @user_data, or %NULL |
| 1929 | */ |
| 1930 | set_default_sort_func(sort_func: Gtk.TreeIterCompareFunc, destroy?: GLib.DestroyNotify | null): void; |
| 1931 | /** |
| 1932 | * Sets the current sort column to be `sort_column_id`. The `sortable` will |
| 1933 | * resort itself to reflect this change, after emitting a |
| 1934 | * #GtkTreeSortable::sort-column-changed signal. `sort_column_id` may either be |
| 1935 | * a regular column id, or one of the following special values: |
| 1936 | * |
| 1937 | * - %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID: the default sort function |
| 1938 | * will be used, if it is set |
| 1939 | * |
| 1940 | * - %GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID: no sorting will occur |
| 1941 | * @param sort_column_id the sort column id to set |
| 1942 | * @param order The sort order of the column |
| 1943 | */ |
| 1944 | set_sort_column_id(sort_column_id: number, order: Gtk.SortType | null): void; |
| 1945 | /** |
| 1946 | * Sets the comparison function used when sorting to be `sort_func`. If the |
| 1947 | * current sort column id of `sortable` is the same as `sort_column_id,` then |
| 1948 | * the model will sort using this function. |
| 1949 | * @param sort_column_id the sort column id to set the function for |
| 1950 | * @param sort_func The comparison function |
| 1951 | * @param destroy Destroy notifier of @user_data, or %NULL |
| 1952 | */ |
| 1953 | set_sort_func( |
| 1954 | sort_column_id: number, |
| 1955 | sort_func: Gtk.TreeIterCompareFunc, |
| 1956 | destroy?: GLib.DestroyNotify | null, |
| 1957 | ): void; |
| 1958 | /** |
| 1959 | * Emits a #GtkTreeSortable::sort-column-changed signal on `sortable`. |
| 1960 | */ |
| 1961 | sort_column_changed(): void; |
| 1962 | /** |
| 1963 | * Fills in `sort_column_id` and `order` with the current sort column and the |
| 1964 | * order. It returns %TRUE unless the `sort_column_id` is |
| 1965 | * %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID or |
| 1966 | * %GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID. |
| 1967 | */ |
| 1968 | vfunc_get_sort_column_id(): [boolean, number, Gtk.SortType]; |
| 1969 | /** |
| 1970 | * Returns %TRUE if the model has a default sort function. This is used |
| 1971 | * primarily by GtkTreeViewColumns in order to determine if a model can |
| 1972 | * go back to the default state, or not. |
| 1973 | */ |
| 1974 | vfunc_has_default_sort_func(): boolean; |
| 1975 | /** |
| 1976 | * Sets the default comparison function used when sorting to be `sort_func`. |
| 1977 | * If the current sort column id of `sortable` is |
| 1978 | * %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, then the model will sort using |
| 1979 | * this function. |
| 1980 | * |
| 1981 | * If `sort_func` is %NULL, then there will be no default comparison function. |
| 1982 | * This means that once the model has been sorted, it can’t go back to the |
| 1983 | * default state. In this case, when the current sort column id of `sortable` |
| 1984 | * is %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, the model will be unsorted. |
| 1985 | * @param sort_func The comparison function |
| 1986 | * @param destroy Destroy notifier of @user_data, or %NULL |
| 1987 | */ |
| 1988 | vfunc_set_default_sort_func(sort_func: Gtk.TreeIterCompareFunc, destroy?: GLib.DestroyNotify | null): void; |
| 1989 | /** |
| 1990 | * Sets the current sort column to be `sort_column_id`. The `sortable` will |
| 1991 | * resort itself to reflect this change, after emitting a |
| 1992 | * #GtkTreeSortable::sort-column-changed signal. `sort_column_id` may either be |
| 1993 | * a regular column id, or one of the following special values: |
| 1994 | * |
| 1995 | * - %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID: the default sort function |
| 1996 | * will be used, if it is set |
| 1997 | * |
| 1998 | * - %GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID: no sorting will occur |
| 1999 | * @param sort_column_id the sort column id to set |
| 2000 | * @param order The sort order of the column |
| 2001 | */ |
| 2002 | vfunc_set_sort_column_id(sort_column_id: number, order: Gtk.SortType): void; |
| 2003 | /** |
| 2004 | * Sets the comparison function used when sorting to be `sort_func`. If the |
| 2005 | * current sort column id of `sortable` is the same as `sort_column_id,` then |
| 2006 | * the model will sort using this function. |
| 2007 | * @param sort_column_id the sort column id to set the function for |
| 2008 | * @param sort_func The comparison function |
| 2009 | * @param destroy Destroy notifier of @user_data, or %NULL |
| 2010 | */ |
| 2011 | vfunc_set_sort_func( |
| 2012 | sort_column_id: number, |
| 2013 | sort_func: Gtk.TreeIterCompareFunc, |
| 2014 | destroy?: GLib.DestroyNotify | null, |
| 2015 | ): void; |
| 2016 | /** |
| 2017 | * Emits a #GtkTreeSortable::sort-column-changed signal on `sortable`. |
| 2018 | */ |
| 2019 | vfunc_sort_column_changed(): void; |
| 2020 | /** |
| 2021 | * Creates a binding between `source_property` on `source` and `target_property` |
| 2022 | * on `target`. |
| 2023 | * |
| 2024 | * Whenever the `source_property` is changed the `target_property` is |
| 2025 | * updated using the same value. For instance: |
| 2026 | * |
| 2027 | * |
| 2028 | * ```c |
| 2029 | * g_object_bind_property (action, "active", widget, "sensitive", 0); |
| 2030 | * ``` |
| 2031 | * |
| 2032 | * |
| 2033 | * Will result in the "sensitive" property of the widget #GObject instance to be |
| 2034 | * updated with the same value of the "active" property of the action #GObject |
| 2035 | * instance. |
| 2036 | * |
| 2037 | * If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual: |
| 2038 | * if `target_property` on `target` changes then the `source_property` on `source` |
| 2039 | * will be updated as well. |
| 2040 | * |
| 2041 | * The binding will automatically be removed when either the `source` or the |
| 2042 | * `target` instances are finalized. To remove the binding without affecting the |
| 2043 | * `source` and the `target` you can just call g_object_unref() on the returned |
| 2044 | * #GBinding instance. |
| 2045 | * |
| 2046 | * Removing the binding by calling g_object_unref() on it must only be done if |
| 2047 | * the binding, `source` and `target` are only used from a single thread and it |
| 2048 | * is clear that both `source` and `target` outlive the binding. Especially it |
| 2049 | * is not safe to rely on this if the binding, `source` or `target` can be |
| 2050 | * finalized from different threads. Keep another reference to the binding and |
| 2051 | * use g_binding_unbind() instead to be on the safe side. |
| 2052 | * |
| 2053 | * A #GObject can have multiple bindings. |
| 2054 | * @param source_property the property on @source to bind |
| 2055 | * @param target the target #GObject |
| 2056 | * @param target_property the property on @target to bind |
| 2057 | * @param flags flags to pass to #GBinding |
| 2058 | * @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero. |
| 2059 | */ |
| 2060 | bind_property( |
| 2061 | source_property: string, |
| 2062 | target: GObject.Object, |
| 2063 | target_property: string, |
| 2064 | flags: GObject.BindingFlags | null, |
| 2065 | ): GObject.Binding; |
| 2066 | /** |
| 2067 | * Complete version of g_object_bind_property(). |
| 2068 | * |
| 2069 | * Creates a binding between `source_property` on `source` and `target_property` |
| 2070 | * on `target,` allowing you to set the transformation functions to be used by |
| 2071 | * the binding. |
| 2072 | * |
| 2073 | * If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual: |
| 2074 | * if `target_property` on `target` changes then the `source_property` on `source` |
| 2075 | * will be updated as well. The `transform_from` function is only used in case |
| 2076 | * of bidirectional bindings, otherwise it will be ignored |
| 2077 | * |
| 2078 | * The binding will automatically be removed when either the `source` or the |
| 2079 | * `target` instances are finalized. This will release the reference that is |
| 2080 | * being held on the #GBinding instance; if you want to hold on to the |
| 2081 | * #GBinding instance, you will need to hold a reference to it. |
| 2082 | * |
| 2083 | * To remove the binding, call g_binding_unbind(). |
| 2084 | * |
| 2085 | * A #GObject can have multiple bindings. |
| 2086 | * |
| 2087 | * The same `user_data` parameter will be used for both `transform_to` |
| 2088 | * and `transform_from` transformation functions; the `notify` function will |
| 2089 | * be called once, when the binding is removed. If you need different data |
| 2090 | * for each transformation function, please use |
| 2091 | * g_object_bind_property_with_closures() instead. |
| 2092 | * @param source_property the property on @source to bind |
| 2093 | * @param target the target #GObject |
| 2094 | * @param target_property the property on @target to bind |
| 2095 | * @param flags flags to pass to #GBinding |
| 2096 | * @param transform_to the transformation function from the @source to the @target, or %NULL to use the default |
| 2097 | * @param transform_from the transformation function from the @target to the @source, or %NULL to use the default |
| 2098 | * @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required |
| 2099 | * @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero. |
| 2100 | */ |
| 2101 | bind_property_full( |
| 2102 | source_property: string, |
| 2103 | target: GObject.Object, |
| 2104 | target_property: string, |
| 2105 | flags: GObject.BindingFlags | null, |
| 2106 | transform_to?: GObject.BindingTransformFunc | null, |
| 2107 | transform_from?: GObject.BindingTransformFunc | null, |
| 2108 | notify?: GLib.DestroyNotify | null, |
| 2109 | ): GObject.Binding; |
| 2110 | // Conflicted with GObject.Object.bind_property_full |
| 2111 | bind_property_full(...args: never[]): any; |
| 2112 | /** |
| 2113 | * This function is intended for #GObject implementations to re-enforce |
| 2114 | * a [floating][floating-ref] object reference. Doing this is seldom |
| 2115 | * required: all #GInitiallyUnowneds are created with a floating reference |
| 2116 | * which usually just needs to be sunken by calling g_object_ref_sink(). |
| 2117 | */ |
| 2118 | force_floating(): void; |
| 2119 | /** |
| 2120 | * Increases the freeze count on `object`. If the freeze count is |
| 2121 | * non-zero, the emission of "notify" signals on `object` is |
| 2122 | * stopped. The signals are queued until the freeze count is decreased |
| 2123 | * to zero. Duplicate notifications are squashed so that at most one |
| 2124 | * #GObject::notify signal is emitted for each property modified while the |
| 2125 | * object is frozen. |
| 2126 | * |
| 2127 | * This is necessary for accessors that modify multiple properties to prevent |
| 2128 | * premature notification while the object is still being modified. |
| 2129 | */ |
| 2130 | freeze_notify(): void; |
| 2131 | /** |
| 2132 | * Gets a named field from the objects table of associations (see g_object_set_data()). |
| 2133 | * @param key name of the key for that association |
| 2134 | * @returns the data if found, or %NULL if no such data exists. |
| 2135 | */ |
| 2136 | get_data(key: string): any | null; |
| 2137 | /** |
| 2138 | * Gets a property of an object. |
| 2139 | * |
| 2140 | * The value can be: |
| 2141 | * - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60) |
| 2142 | * - a GObject.Value initialized with the expected type of the property |
| 2143 | * - a GObject.Value initialized with a type to which the expected type of the property can be transformed |
| 2144 | * |
| 2145 | * In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset. |
| 2146 | * |
| 2147 | * Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming. |
| 2148 | * @param property_name The name of the property to get |
| 2149 | * @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type |
| 2150 | */ |
| 2151 | get_property(property_name: string, value: GObject.Value | any): any; |
| 2152 | /** |
| 2153 | * This function gets back user data pointers stored via |
| 2154 | * g_object_set_qdata(). |
| 2155 | * @param quark A #GQuark, naming the user data pointer |
| 2156 | * @returns The user data pointer set, or %NULL |
| 2157 | */ |
| 2158 | get_qdata(quark: GLib.Quark): any | null; |
| 2159 | /** |
| 2160 | * Gets `n_properties` properties for an `object`. |
| 2161 | * Obtained properties will be set to `values`. All properties must be valid. |
| 2162 | * Warnings will be emitted and undefined behaviour may result if invalid |
| 2163 | * properties are passed in. |
| 2164 | * @param names the names of each property to get |
| 2165 | * @param values the values of each property to get |
| 2166 | */ |
| 2167 | getv(names: string[], values: (GObject.Value | any)[]): void; |
| 2168 | /** |
| 2169 | * Checks whether `object` has a [floating][floating-ref] reference. |
| 2170 | * @returns %TRUE if @object has a floating reference |
| 2171 | */ |
| 2172 | is_floating(): boolean; |
| 2173 | /** |
| 2174 | * Emits a "notify" signal for the property `property_name` on `object`. |
| 2175 | * |
| 2176 | * When possible, eg. when signaling a property change from within the class |
| 2177 | * that registered the property, you should use g_object_notify_by_pspec() |
| 2178 | * instead. |
| 2179 | * |
| 2180 | * Note that emission of the notify signal may be blocked with |
| 2181 | * g_object_freeze_notify(). In this case, the signal emissions are queued |
| 2182 | * and will be emitted (in reverse order) when g_object_thaw_notify() is |
| 2183 | * called. |
| 2184 | * @param property_name the name of a property installed on the class of @object. |
| 2185 | */ |
| 2186 | notify(property_name: string): void; |
| 2187 | /** |
| 2188 | * Emits a "notify" signal for the property specified by `pspec` on `object`. |
| 2189 | * |
| 2190 | * This function omits the property name lookup, hence it is faster than |
| 2191 | * g_object_notify(). |
| 2192 | * |
| 2193 | * One way to avoid using g_object_notify() from within the |
| 2194 | * class that registered the properties, and using g_object_notify_by_pspec() |
| 2195 | * instead, is to store the GParamSpec used with |
| 2196 | * g_object_class_install_property() inside a static array, e.g.: |
| 2197 | * |
| 2198 | * |
| 2199 | * ```c |
| 2200 | * typedef enum |
| 2201 | * { |
| 2202 | * PROP_FOO = 1, |
| 2203 | * PROP_LAST |
| 2204 | * } MyObjectProperty; |
| 2205 | * |
| 2206 | * static GParamSpec *properties[PROP_LAST]; |
| 2207 | * |
| 2208 | * static void |
| 2209 | * my_object_class_init (MyObjectClass *klass) |
| 2210 | * { |
| 2211 | * properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL, |
| 2212 | * 0, 100, |
| 2213 | * 50, |
| 2214 | * G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); |
| 2215 | * g_object_class_install_property (gobject_class, |
| 2216 | * PROP_FOO, |
| 2217 | * properties[PROP_FOO]); |
| 2218 | * } |
| 2219 | * ``` |
| 2220 | * |
| 2221 | * |
| 2222 | * and then notify a change on the "foo" property with: |
| 2223 | * |
| 2224 | * |
| 2225 | * ```c |
| 2226 | * g_object_notify_by_pspec (self, properties[PROP_FOO]); |
| 2227 | * ``` |
| 2228 | * |
| 2229 | * @param pspec the #GParamSpec of a property installed on the class of @object. |
| 2230 | */ |
| 2231 | notify_by_pspec(pspec: GObject.ParamSpec): void; |
| 2232 | /** |
| 2233 | * Increases the reference count of `object`. |
| 2234 | * |
| 2235 | * Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type |
| 2236 | * of `object` will be propagated to the return type (using the GCC typeof() |
| 2237 | * extension), so any casting the caller needs to do on the return type must be |
| 2238 | * explicit. |
| 2239 | * @returns the same @object |
| 2240 | */ |
| 2241 | ref(): GObject.Object; |
| 2242 | /** |
| 2243 | * Increase the reference count of `object,` and possibly remove the |
| 2244 | * [floating][floating-ref] reference, if `object` has a floating reference. |
| 2245 | * |
| 2246 | * In other words, if the object is floating, then this call "assumes |
| 2247 | * ownership" of the floating reference, converting it to a normal |
| 2248 | * reference by clearing the floating flag while leaving the reference |
| 2249 | * count unchanged. If the object is not floating, then this call |
| 2250 | * adds a new normal reference increasing the reference count by one. |
| 2251 | * |
| 2252 | * Since GLib 2.56, the type of `object` will be propagated to the return type |
| 2253 | * under the same conditions as for g_object_ref(). |
| 2254 | * @returns @object |
| 2255 | */ |
| 2256 | ref_sink(): GObject.Object; |
| 2257 | /** |
| 2258 | * Releases all references to other objects. This can be used to break |
| 2259 | * reference cycles. |
| 2260 | * |
| 2261 | * This function should only be called from object system implementations. |
| 2262 | */ |
| 2263 | run_dispose(): void; |
| 2264 | /** |
| 2265 | * Each object carries around a table of associations from |
| 2266 | * strings to pointers. This function lets you set an association. |
| 2267 | * |
| 2268 | * If the object already had an association with that name, |
| 2269 | * the old association will be destroyed. |
| 2270 | * |
| 2271 | * Internally, the `key` is converted to a #GQuark using g_quark_from_string(). |
| 2272 | * This means a copy of `key` is kept permanently (even after `object` has been |
| 2273 | * finalized) — so it is recommended to only use a small, bounded set of values |
| 2274 | * for `key` in your program, to avoid the #GQuark storage growing unbounded. |
| 2275 | * @param key name of the key |
| 2276 | * @param data data to associate with that key |
| 2277 | */ |
| 2278 | set_data(key: string, data?: any | null): void; |
| 2279 | /** |
| 2280 | * Sets a property on an object. |
| 2281 | * @param property_name The name of the property to set |
| 2282 | * @param value The value to set the property to |
| 2283 | */ |
| 2284 | set_property(property_name: string, value: GObject.Value | any): void; |
| 2285 | /** |
| 2286 | * Remove a specified datum from the object's data associations, |
| 2287 | * without invoking the association's destroy handler. |
| 2288 | * @param key name of the key |
| 2289 | * @returns the data if found, or %NULL if no such data exists. |
| 2290 | */ |
| 2291 | steal_data(key: string): any | null; |
| 2292 | /** |
| 2293 | * This function gets back user data pointers stored via |
| 2294 | * g_object_set_qdata() and removes the `data` from object |
| 2295 | * without invoking its destroy() function (if any was |
| 2296 | * set). |
| 2297 | * Usually, calling this function is only required to update |
| 2298 | * user data pointers with a destroy notifier, for example: |
| 2299 | * |
| 2300 | * ```c |
| 2301 | * void |
| 2302 | * object_add_to_user_list (GObject *object, |
| 2303 | * const gchar *new_string) |
| 2304 | * { |
| 2305 | * // the quark, naming the object data |
| 2306 | * GQuark quark_string_list = g_quark_from_static_string ("my-string-list"); |
| 2307 | * // retrieve the old string list |
| 2308 | * GList *list = g_object_steal_qdata (object, quark_string_list); |
| 2309 | * |
| 2310 | * // prepend new string |
| 2311 | * list = g_list_prepend (list, g_strdup (new_string)); |
| 2312 | * // this changed 'list', so we need to set it again |
| 2313 | * g_object_set_qdata_full (object, quark_string_list, list, free_string_list); |
| 2314 | * } |
| 2315 | * static void |
| 2316 | * free_string_list (gpointer data) |
| 2317 | * { |
| 2318 | * GList *node, *list = data; |
| 2319 | * |
| 2320 | * for (node = list; node; node = node->next) |
| 2321 | * g_free (node->data); |
| 2322 | * g_list_free (list); |
| 2323 | * } |
| 2324 | * ``` |
| 2325 | * |
| 2326 | * Using g_object_get_qdata() in the above example, instead of |
| 2327 | * g_object_steal_qdata() would have left the destroy function set, |
| 2328 | * and thus the partial string list would have been freed upon |
| 2329 | * g_object_set_qdata_full(). |
| 2330 | * @param quark A #GQuark, naming the user data pointer |
| 2331 | * @returns The user data pointer set, or %NULL |
| 2332 | */ |
| 2333 | steal_qdata(quark: GLib.Quark): any | null; |
| 2334 | /** |
| 2335 | * Reverts the effect of a previous call to |
| 2336 | * g_object_freeze_notify(). The freeze count is decreased on `object` |
| 2337 | * and when it reaches zero, queued "notify" signals are emitted. |
| 2338 | * |
| 2339 | * Duplicate notifications for each property are squashed so that at most one |
| 2340 | * #GObject::notify signal is emitted for each property, in the reverse order |
| 2341 | * in which they have been queued. |
| 2342 | * |
| 2343 | * It is an error to call this function when the freeze count is zero. |
| 2344 | */ |
| 2345 | thaw_notify(): void; |
| 2346 | /** |
| 2347 | * Decreases the reference count of `object`. When its reference count |
| 2348 | * drops to 0, the object is finalized (i.e. its memory is freed). |
| 2349 | * |
| 2350 | * If the pointer to the #GObject may be reused in future (for example, if it is |
| 2351 | * an instance variable of another object), it is recommended to clear the |
| 2352 | * pointer to %NULL rather than retain a dangling pointer to a potentially |
| 2353 | * invalid #GObject instance. Use g_clear_object() for this. |
| 2354 | */ |
| 2355 | unref(): void; |
| 2356 | /** |
| 2357 | * This function essentially limits the life time of the `closure` to |
| 2358 | * the life time of the object. That is, when the object is finalized, |
| 2359 | * the `closure` is invalidated by calling g_closure_invalidate() on |
| 2360 | * it, in order to prevent invocations of the closure with a finalized |
| 2361 | * (nonexisting) object. Also, g_object_ref() and g_object_unref() are |
| 2362 | * added as marshal guards to the `closure,` to ensure that an extra |
| 2363 | * reference count is held on `object` during invocation of the |
| 2364 | * `closure`. Usually, this function will be called on closures that |
| 2365 | * use this `object` as closure data. |
| 2366 | * @param closure #GClosure to watch |
| 2367 | */ |
| 2368 | watch_closure(closure: GObject.Closure): void; |
| 2369 | /** |
| 2370 | * the `constructed` function is called by g_object_new() as the |
| 2371 | * final step of the object creation process. At the point of the call, all |
| 2372 | * construction properties have been set on the object. The purpose of this |
| 2373 | * call is to allow for object initialisation steps that can only be performed |
| 2374 | * after construction properties have been set. `constructed` implementors |
| 2375 | * should chain up to the `constructed` call of their parent class to allow it |
| 2376 | * to complete its initialisation. |
| 2377 | */ |
| 2378 | vfunc_constructed(): void; |
| 2379 | /** |
| 2380 | * emits property change notification for a bunch |
| 2381 | * of properties. Overriding `dispatch_properties_changed` should be rarely |
| 2382 | * needed. |
| 2383 | * @param n_pspecs |
| 2384 | * @param pspecs |
| 2385 | */ |
| 2386 | vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void; |
| 2387 | /** |
| 2388 | * the `dispose` function is supposed to drop all references to other |
| 2389 | * objects, but keep the instance otherwise intact, so that client method |
| 2390 | * invocations still work. It may be run multiple times (due to reference |
| 2391 | * loops). Before returning, `dispose` should chain up to the `dispose` method |
| 2392 | * of the parent class. |
| 2393 | */ |
| 2394 | vfunc_dispose(): void; |
| 2395 | /** |
| 2396 | * instance finalization function, should finish the finalization of |
| 2397 | * the instance begun in `dispose` and chain up to the `finalize` method of the |
| 2398 | * parent class. |
| 2399 | */ |
| 2400 | vfunc_finalize(): void; |
| 2401 | /** |
| 2402 | * the generic getter for all properties of this type. Should be |
| 2403 | * overridden for every type with properties. |
| 2404 | * @param property_id |
| 2405 | * @param value |
| 2406 | * @param pspec |
| 2407 | */ |
| 2408 | vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void; |
| 2409 | /** |
| 2410 | * Emits a "notify" signal for the property `property_name` on `object`. |
| 2411 | * |
| 2412 | * When possible, eg. when signaling a property change from within the class |
| 2413 | * that registered the property, you should use g_object_notify_by_pspec() |
| 2414 | * instead. |
| 2415 | * |
| 2416 | * Note that emission of the notify signal may be blocked with |
| 2417 | * g_object_freeze_notify(). In this case, the signal emissions are queued |
| 2418 | * and will be emitted (in reverse order) when g_object_thaw_notify() is |
| 2419 | * called. |
| 2420 | * @param pspec |
| 2421 | */ |
| 2422 | vfunc_notify(pspec: GObject.ParamSpec): void; |
| 2423 | /** |
| 2424 | * the generic setter for all properties of this type. Should be |
| 2425 | * overridden for every type with properties. If implementations of |
| 2426 | * `set_property` don't emit property change notification explicitly, this will |
| 2427 | * be done implicitly by the type system. However, if the notify signal is |
| 2428 | * emitted explicitly, the type system will not emit it a second time. |
| 2429 | * @param property_id |
| 2430 | * @param value |
| 2431 | * @param pspec |
| 2432 | */ |
| 2433 | vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void; |
| 2434 | /** |
| 2435 | * Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to. |
| 2436 | * @param id Handler ID of the handler to be disconnected |
| 2437 | */ |
| 2438 | disconnect(id: number): void; |
| 2439 | /** |
| 2440 | * Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values. |
| 2441 | * @param properties Object containing the properties to set |
| 2442 | */ |
| 2443 | set(properties: { [key: string]: any }): void; |
| 2444 | /** |
| 2445 | * Blocks a handler of an instance so it will not be called during any signal emissions |
| 2446 | * @param id Handler ID of the handler to be blocked |
| 2447 | */ |
| 2448 | block_signal_handler(id: number): void; |
| 2449 | /** |
| 2450 | * Unblocks a handler so it will be called again during any signal emissions |
| 2451 | * @param id Handler ID of the handler to be unblocked |
| 2452 | */ |
| 2453 | unblock_signal_handler(id: number): void; |
| 2454 | /** |
| 2455 | * Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked. |
| 2456 | * @param detailedName Name of the signal to stop emission of |
| 2457 | */ |
| 2458 | stop_emission_by_name(detailedName: string): void; |
| 2459 | } |
| 2460 | |
| 2461 | namespace ComboSelector { |
| 2462 | // Constructor properties interface |
| 2463 | |
| 2464 | interface ConstructorProps |
| 2465 | extends Gtk.ComboBox.ConstructorProps, |
| 2466 | Atk.ImplementorIface.ConstructorProps, |
| 2467 | Gtk.Buildable.ConstructorProps, |
| 2468 | Gtk.CellEditable.ConstructorProps, |
| 2469 | Gtk.CellLayout.ConstructorProps { |
| 2470 | collection: Gcr.Collection; |
| 2471 | } |
| 2472 | } |
| 2473 | |
| 2474 | /** |
| 2475 | * A widget that can be used to select a certificate or key. It allows |
| 2476 | * the user to select one object from the selector at a time. |
| 2477 | */ |
| 2478 | class ComboSelector |
| 2479 | extends Gtk.ComboBox |
| 2480 | implements Atk.ImplementorIface, Gtk.Buildable, Gtk.CellEditable, Gtk.CellLayout |
| 2481 | { |
| 2482 | static $gtype: GObject.GType<ComboSelector>; |
| 2483 | |
| 2484 | // Properties |
| 2485 | |
| 2486 | /** |
| 2487 | * The collection which contains the objects to display in the selector. |
| 2488 | */ |
| 2489 | get collection(): Gcr.Collection; |
| 2490 | |
| 2491 | // Constructors |
| 2492 | |
| 2493 | constructor(properties?: Partial<ComboSelector.ConstructorProps>, ...args: any[]); |
| 2494 | |
| 2495 | _init(...args: any[]): void; |
| 2496 | |
| 2497 | static ['new'](collection: Gcr.Collection): ComboSelector; |
| 2498 | // Conflicted with Gtk.ComboBox.new |
| 2499 | |
| 2500 | static ['new'](...args: never[]): any; |
| 2501 | |
| 2502 | // Methods |
| 2503 | |
| 2504 | /** |
| 2505 | * Get the collection that this selector is displaying objects from. |
| 2506 | * @returns The collection, owned by the selector. |
| 2507 | */ |
| 2508 | get_collection(): Gcr.Collection; |
| 2509 | /** |
| 2510 | * Get the selected object in the selector, or %NULL if nothing selected. |
| 2511 | * @returns the selected object, owned by the selector, or %NULL |
| 2512 | */ |
| 2513 | get_selected<T = GObject.Object>(): T; |
| 2514 | /** |
| 2515 | * Set the currently selected object in the selector, or clear the selection |
| 2516 | * if selected is set to %NULL. |
| 2517 | * @param selected the object to select or %NULL |
| 2518 | */ |
| 2519 | set_selected(selected?: GObject.Object | null): void; |
| 2520 | |
| 2521 | // Inherited properties |
| 2522 | /** |
| 2523 | * Indicates whether editing on the cell has been canceled. |
| 2524 | */ |
| 2525 | get editing_canceled(): boolean; |
| 2526 | set editing_canceled(val: boolean); |
| 2527 | /** |
| 2528 | * Indicates whether editing on the cell has been canceled. |
| 2529 | */ |
| 2530 | get editingCanceled(): boolean; |
| 2531 | set editingCanceled(val: boolean); |
| 2532 | get app_paintable(): boolean; |
| 2533 | set app_paintable(val: boolean); |
| 2534 | get appPaintable(): boolean; |
| 2535 | set appPaintable(val: boolean); |
| 2536 | get can_default(): boolean; |
| 2537 | set can_default(val: boolean); |
| 2538 | get canDefault(): boolean; |
| 2539 | set canDefault(val: boolean); |
| 2540 | get can_focus(): boolean; |
| 2541 | set can_focus(val: boolean); |
| 2542 | get canFocus(): boolean; |
| 2543 | set canFocus(val: boolean); |
| 2544 | get composite_child(): boolean; |
| 2545 | get compositeChild(): boolean; |
| 2546 | /** |
| 2547 | * Whether the widget is double buffered. |
| 2548 | */ |
| 2549 | get double_buffered(): boolean; |
| 2550 | set double_buffered(val: boolean); |
| 2551 | /** |
| 2552 | * Whether the widget is double buffered. |
| 2553 | */ |
| 2554 | get doubleBuffered(): boolean; |
| 2555 | set doubleBuffered(val: boolean); |
| 2556 | get events(): Gdk.EventMask; |
| 2557 | set events(val: Gdk.EventMask); |
| 2558 | /** |
| 2559 | * Whether to expand in both directions. Setting this sets both #GtkWidget:hexpand and #GtkWidget:vexpand |
| 2560 | */ |
| 2561 | get expand(): boolean; |
| 2562 | set expand(val: boolean); |
| 2563 | /** |
| 2564 | * Whether the widget should grab focus when it is clicked with the mouse. |
| 2565 | * |
| 2566 | * This property is only relevant for widgets that can take focus. |
| 2567 | * |
| 2568 | * Before 3.20, several widgets (GtkButton, GtkFileChooserButton, |
| 2569 | * GtkComboBox) implemented this property individually. |
| 2570 | */ |
| 2571 | get focus_on_click(): boolean; |
| 2572 | set focus_on_click(val: boolean); |
| 2573 | /** |
| 2574 | * Whether the widget should grab focus when it is clicked with the mouse. |
| 2575 | * |
| 2576 | * This property is only relevant for widgets that can take focus. |
| 2577 | * |
| 2578 | * Before 3.20, several widgets (GtkButton, GtkFileChooserButton, |
| 2579 | * GtkComboBox) implemented this property individually. |
| 2580 | */ |
| 2581 | get focusOnClick(): boolean; |
| 2582 | set focusOnClick(val: boolean); |
| 2583 | /** |
| 2584 | * How to distribute horizontal space if widget gets extra space, see #GtkAlign |
| 2585 | */ |
| 2586 | get halign(): Gtk.Align; |
| 2587 | set halign(val: Gtk.Align); |
| 2588 | get has_default(): boolean; |
| 2589 | set has_default(val: boolean); |
| 2590 | get hasDefault(): boolean; |
| 2591 | set hasDefault(val: boolean); |
| 2592 | get has_focus(): boolean; |
| 2593 | set has_focus(val: boolean); |
| 2594 | get hasFocus(): boolean; |
| 2595 | set hasFocus(val: boolean); |
| 2596 | /** |
| 2597 | * Enables or disables the emission of #GtkWidget::query-tooltip on `widget`. |
| 2598 | * A value of %TRUE indicates that `widget` can have a tooltip, in this case |
| 2599 | * the widget will be queried using #GtkWidget::query-tooltip to determine |
| 2600 | * whether it will provide a tooltip or not. |
| 2601 | * |
| 2602 | * Note that setting this property to %TRUE for the first time will change |
| 2603 | * the event masks of the GdkWindows of this widget to include leave-notify |
| 2604 | * and motion-notify events. This cannot and will not be undone when the |
| 2605 | * property is set to %FALSE again. |
| 2606 | */ |
| 2607 | get has_tooltip(): boolean; |
| 2608 | set has_tooltip(val: boolean); |
| 2609 | /** |
| 2610 | * Enables or disables the emission of #GtkWidget::query-tooltip on `widget`. |
| 2611 | * A value of %TRUE indicates that `widget` can have a tooltip, in this case |
| 2612 | * the widget will be queried using #GtkWidget::query-tooltip to determine |
| 2613 | * whether it will provide a tooltip or not. |
| 2614 | * |
| 2615 | * Note that setting this property to %TRUE for the first time will change |
| 2616 | * the event masks of the GdkWindows of this widget to include leave-notify |
| 2617 | * and motion-notify events. This cannot and will not be undone when the |
| 2618 | * property is set to %FALSE again. |
| 2619 | */ |
| 2620 | get hasTooltip(): boolean; |
| 2621 | set hasTooltip(val: boolean); |
| 2622 | get height_request(): number; |
| 2623 | set height_request(val: number); |
| 2624 | get heightRequest(): number; |
| 2625 | set heightRequest(val: number); |
| 2626 | /** |
| 2627 | * Whether to expand horizontally. See gtk_widget_set_hexpand(). |
| 2628 | */ |
| 2629 | get hexpand(): boolean; |
| 2630 | set hexpand(val: boolean); |
| 2631 | /** |
| 2632 | * Whether to use the #GtkWidget:hexpand property. See gtk_widget_get_hexpand_set(). |
| 2633 | */ |
| 2634 | get hexpand_set(): boolean; |
| 2635 | set hexpand_set(val: boolean); |
| 2636 | /** |
| 2637 | * Whether to use the #GtkWidget:hexpand property. See gtk_widget_get_hexpand_set(). |
| 2638 | */ |
| 2639 | get hexpandSet(): boolean; |
| 2640 | set hexpandSet(val: boolean); |
| 2641 | get is_focus(): boolean; |
| 2642 | set is_focus(val: boolean); |
| 2643 | get isFocus(): boolean; |
| 2644 | set isFocus(val: boolean); |
| 2645 | /** |
| 2646 | * Sets all four sides' margin at once. If read, returns max |
| 2647 | * margin on any side. |
| 2648 | */ |
| 2649 | get margin(): number; |
| 2650 | set margin(val: number); |
| 2651 | /** |
| 2652 | * Margin on bottom side of widget. |
| 2653 | * |
| 2654 | * This property adds margin outside of the widget's normal size |
| 2655 | * request, the margin will be added in addition to the size from |
| 2656 | * gtk_widget_set_size_request() for example. |
| 2657 | */ |
| 2658 | get margin_bottom(): number; |
| 2659 | set margin_bottom(val: number); |
| 2660 | /** |
| 2661 | * Margin on bottom side of widget. |
| 2662 | * |
| 2663 | * This property adds margin outside of the widget's normal size |
| 2664 | * request, the margin will be added in addition to the size from |
| 2665 | * gtk_widget_set_size_request() for example. |
| 2666 | */ |
| 2667 | get marginBottom(): number; |
| 2668 | set marginBottom(val: number); |
| 2669 | /** |
| 2670 | * Margin on end of widget, horizontally. This property supports |
| 2671 | * left-to-right and right-to-left text directions. |
| 2672 | * |
| 2673 | * This property adds margin outside of the widget's normal size |
| 2674 | * request, the margin will be added in addition to the size from |
| 2675 | * gtk_widget_set_size_request() for example. |
| 2676 | */ |
| 2677 | get margin_end(): number; |
| 2678 | set margin_end(val: number); |
| 2679 | /** |
| 2680 | * Margin on end of widget, horizontally. This property supports |
| 2681 | * left-to-right and right-to-left text directions. |
| 2682 | * |
| 2683 | * This property adds margin outside of the widget's normal size |
| 2684 | * request, the margin will be added in addition to the size from |
| 2685 | * gtk_widget_set_size_request() for example. |
| 2686 | */ |
| 2687 | get marginEnd(): number; |
| 2688 | set marginEnd(val: number); |
| 2689 | /** |
| 2690 | * Margin on left side of widget. |
| 2691 | * |
| 2692 | * This property adds margin outside of the widget's normal size |
| 2693 | * request, the margin will be added in addition to the size from |
| 2694 | * gtk_widget_set_size_request() for example. |
| 2695 | */ |
| 2696 | get margin_left(): number; |
| 2697 | set margin_left(val: number); |
| 2698 | /** |
| 2699 | * Margin on left side of widget. |
| 2700 | * |
| 2701 | * This property adds margin outside of the widget's normal size |
| 2702 | * request, the margin will be added in addition to the size from |
| 2703 | * gtk_widget_set_size_request() for example. |
| 2704 | */ |
| 2705 | get marginLeft(): number; |
| 2706 | set marginLeft(val: number); |
| 2707 | /** |
| 2708 | * Margin on right side of widget. |
| 2709 | * |
| 2710 | * This property adds margin outside of the widget's normal size |
| 2711 | * request, the margin will be added in addition to the size from |
| 2712 | * gtk_widget_set_size_request() for example. |
| 2713 | */ |
| 2714 | get margin_right(): number; |
| 2715 | set margin_right(val: number); |
| 2716 | /** |
| 2717 | * Margin on right side of widget. |
| 2718 | * |
| 2719 | * This property adds margin outside of the widget's normal size |
| 2720 | * request, the margin will be added in addition to the size from |
| 2721 | * gtk_widget_set_size_request() for example. |
| 2722 | */ |
| 2723 | get marginRight(): number; |
| 2724 | set marginRight(val: number); |
| 2725 | /** |
| 2726 | * Margin on start of widget, horizontally. This property supports |
| 2727 | * left-to-right and right-to-left text directions. |
| 2728 | * |
| 2729 | * This property adds margin outside of the widget's normal size |
| 2730 | * request, the margin will be added in addition to the size from |
| 2731 | * gtk_widget_set_size_request() for example. |
| 2732 | */ |
| 2733 | get margin_start(): number; |
| 2734 | set margin_start(val: number); |
| 2735 | /** |
| 2736 | * Margin on start of widget, horizontally. This property supports |
| 2737 | * left-to-right and right-to-left text directions. |
| 2738 | * |
| 2739 | * This property adds margin outside of the widget's normal size |
| 2740 | * request, the margin will be added in addition to the size from |
| 2741 | * gtk_widget_set_size_request() for example. |
| 2742 | */ |
| 2743 | get marginStart(): number; |
| 2744 | set marginStart(val: number); |
| 2745 | /** |
| 2746 | * Margin on top side of widget. |
| 2747 | * |
| 2748 | * This property adds margin outside of the widget's normal size |
| 2749 | * request, the margin will be added in addition to the size from |
| 2750 | * gtk_widget_set_size_request() for example. |
| 2751 | */ |
| 2752 | get margin_top(): number; |
| 2753 | set margin_top(val: number); |
| 2754 | /** |
| 2755 | * Margin on top side of widget. |
| 2756 | * |
| 2757 | * This property adds margin outside of the widget's normal size |
| 2758 | * request, the margin will be added in addition to the size from |
| 2759 | * gtk_widget_set_size_request() for example. |
| 2760 | */ |
| 2761 | get marginTop(): number; |
| 2762 | set marginTop(val: number); |
| 2763 | get name(): string; |
| 2764 | set name(val: string); |
| 2765 | get no_show_all(): boolean; |
| 2766 | set no_show_all(val: boolean); |
| 2767 | get noShowAll(): boolean; |
| 2768 | set noShowAll(val: boolean); |
| 2769 | /** |
| 2770 | * The requested opacity of the widget. See gtk_widget_set_opacity() for |
| 2771 | * more details about window opacity. |
| 2772 | * |
| 2773 | * Before 3.8 this was only available in GtkWindow |
| 2774 | */ |
| 2775 | get opacity(): number; |
| 2776 | set opacity(val: number); |
| 2777 | get parent(): Gtk.Container; |
| 2778 | set parent(val: Gtk.Container); |
| 2779 | get receives_default(): boolean; |
| 2780 | set receives_default(val: boolean); |
| 2781 | get receivesDefault(): boolean; |
| 2782 | set receivesDefault(val: boolean); |
| 2783 | /** |
| 2784 | * The scale factor of the widget. See gtk_widget_get_scale_factor() for |
| 2785 | * more details about widget scaling. |
| 2786 | */ |
| 2787 | get scale_factor(): number; |
| 2788 | /** |
| 2789 | * The scale factor of the widget. See gtk_widget_get_scale_factor() for |
| 2790 | * more details about widget scaling. |
| 2791 | */ |
| 2792 | get scaleFactor(): number; |
| 2793 | get sensitive(): boolean; |
| 2794 | set sensitive(val: boolean); |
| 2795 | /** |
| 2796 | * The style of the widget, which contains information about how it will look (colors, etc). |
| 2797 | */ |
| 2798 | get style(): Gtk.Style; |
| 2799 | set style(val: Gtk.Style); |
| 2800 | /** |
| 2801 | * Sets the text of tooltip to be the given string, which is marked up |
| 2802 | * with the [Pango text markup language][PangoMarkupFormat]. |
| 2803 | * Also see gtk_tooltip_set_markup(). |
| 2804 | * |
| 2805 | * This is a convenience property which will take care of getting the |
| 2806 | * tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip |
| 2807 | * will automatically be set to %TRUE and there will be taken care of |
| 2808 | * #GtkWidget::query-tooltip in the default signal handler. |
| 2809 | * |
| 2810 | * Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup |
| 2811 | * are set, the last one wins. |
| 2812 | */ |
| 2813 | get tooltip_markup(): string; |
| 2814 | set tooltip_markup(val: string); |
| 2815 | /** |
| 2816 | * Sets the text of tooltip to be the given string, which is marked up |
| 2817 | * with the [Pango text markup language][PangoMarkupFormat]. |
| 2818 | * Also see gtk_tooltip_set_markup(). |
| 2819 | * |
| 2820 | * This is a convenience property which will take care of getting the |
| 2821 | * tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip |
| 2822 | * will automatically be set to %TRUE and there will be taken care of |
| 2823 | * #GtkWidget::query-tooltip in the default signal handler. |
| 2824 | * |
| 2825 | * Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup |
| 2826 | * are set, the last one wins. |
| 2827 | */ |
| 2828 | get tooltipMarkup(): string; |
| 2829 | set tooltipMarkup(val: string); |
| 2830 | /** |
| 2831 | * Sets the text of tooltip to be the given string. |
| 2832 | * |
| 2833 | * Also see gtk_tooltip_set_text(). |
| 2834 | * |
| 2835 | * This is a convenience property which will take care of getting the |
| 2836 | * tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip |
| 2837 | * will automatically be set to %TRUE and there will be taken care of |
| 2838 | * #GtkWidget::query-tooltip in the default signal handler. |
| 2839 | * |
| 2840 | * Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup |
| 2841 | * are set, the last one wins. |
| 2842 | */ |
| 2843 | get tooltip_text(): string; |
| 2844 | set tooltip_text(val: string); |
| 2845 | /** |
| 2846 | * Sets the text of tooltip to be the given string. |
| 2847 | * |
| 2848 | * Also see gtk_tooltip_set_text(). |
| 2849 | * |
| 2850 | * This is a convenience property which will take care of getting the |
| 2851 | * tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip |
| 2852 | * will automatically be set to %TRUE and there will be taken care of |
| 2853 | * #GtkWidget::query-tooltip in the default signal handler. |
| 2854 | * |
| 2855 | * Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup |
| 2856 | * are set, the last one wins. |
| 2857 | */ |
| 2858 | get tooltipText(): string; |
| 2859 | set tooltipText(val: string); |
| 2860 | /** |
| 2861 | * How to distribute vertical space if widget gets extra space, see #GtkAlign |
| 2862 | */ |
| 2863 | get valign(): Gtk.Align; |
| 2864 | set valign(val: Gtk.Align); |
| 2865 | /** |
| 2866 | * Whether to expand vertically. See gtk_widget_set_vexpand(). |
| 2867 | */ |
| 2868 | get vexpand(): boolean; |
| 2869 | set vexpand(val: boolean); |
| 2870 | /** |
| 2871 | * Whether to use the #GtkWidget:vexpand property. See gtk_widget_get_vexpand_set(). |
| 2872 | */ |
| 2873 | get vexpand_set(): boolean; |
| 2874 | set vexpand_set(val: boolean); |
| 2875 | /** |
| 2876 | * Whether to use the #GtkWidget:vexpand property. See gtk_widget_get_vexpand_set(). |
| 2877 | */ |
| 2878 | get vexpandSet(): boolean; |
| 2879 | set vexpandSet(val: boolean); |
| 2880 | get visible(): boolean; |
| 2881 | set visible(val: boolean); |
| 2882 | get width_request(): number; |
| 2883 | set width_request(val: number); |
| 2884 | get widthRequest(): number; |
| 2885 | set widthRequest(val: number); |
| 2886 | /** |
| 2887 | * The widget's window if it is realized, %NULL otherwise. |
| 2888 | */ |
| 2889 | get window(): Gdk.Window; |
| 2890 | |
| 2891 | // Inherited methods |
| 2892 | /** |
| 2893 | * Emits the #GtkCellEditable::editing-done signal. |
| 2894 | */ |
| 2895 | editing_done(): void; |
| 2896 | /** |
| 2897 | * Emits the #GtkCellEditable::remove-widget signal. |
| 2898 | */ |
| 2899 | remove_widget(): void; |
| 2900 | /** |
| 2901 | * Begins editing on a `cell_editable`. |
| 2902 | * |
| 2903 | * The #GtkCellRenderer for the cell creates and returns a #GtkCellEditable from |
| 2904 | * gtk_cell_renderer_start_editing(), configured for the #GtkCellRenderer type. |
| 2905 | * |
| 2906 | * gtk_cell_editable_start_editing() can then set up `cell_editable` suitably for |
| 2907 | * editing a cell, e.g. making the Esc key emit #GtkCellEditable::editing-done. |
| 2908 | * |
| 2909 | * Note that the `cell_editable` is created on-demand for the current edit; its |
| 2910 | * lifetime is temporary and does not persist across other edits and/or cells. |
| 2911 | * @param event The #GdkEvent that began the editing process, or %NULL if editing was initiated programmatically |
| 2912 | */ |
| 2913 | start_editing(event?: Gdk.Event | null): void; |
| 2914 | /** |
| 2915 | * Emits the #GtkCellEditable::editing-done signal. |
| 2916 | */ |
| 2917 | vfunc_editing_done(): void; |
| 2918 | /** |
| 2919 | * Emits the #GtkCellEditable::remove-widget signal. |
| 2920 | */ |
| 2921 | vfunc_remove_widget(): void; |
| 2922 | /** |
| 2923 | * Begins editing on a `cell_editable`. |
| 2924 | * |
| 2925 | * The #GtkCellRenderer for the cell creates and returns a #GtkCellEditable from |
| 2926 | * gtk_cell_renderer_start_editing(), configured for the #GtkCellRenderer type. |
| 2927 | * |
| 2928 | * gtk_cell_editable_start_editing() can then set up `cell_editable` suitably for |
| 2929 | * editing a cell, e.g. making the Esc key emit #GtkCellEditable::editing-done. |
| 2930 | * |
| 2931 | * Note that the `cell_editable` is created on-demand for the current edit; its |
| 2932 | * lifetime is temporary and does not persist across other edits and/or cells. |
| 2933 | * @param event The #GdkEvent that began the editing process, or %NULL if editing was initiated programmatically |
| 2934 | */ |
| 2935 | vfunc_start_editing(event?: Gdk.Event | null): void; |
| 2936 | /** |
| 2937 | * Adds an attribute mapping to the list in `cell_layout`. |
| 2938 | * |
| 2939 | * The `column` is the column of the model to get a value from, and the |
| 2940 | * `attribute` is the parameter on `cell` to be set from the value. So for |
| 2941 | * example if column 2 of the model contains strings, you could have the |
| 2942 | * “text” attribute of a #GtkCellRendererText get its values from column 2. |
| 2943 | * @param cell a #GtkCellRenderer |
| 2944 | * @param attribute an attribute on the renderer |
| 2945 | * @param column the column position on the model to get the attribute from |
| 2946 | */ |
| 2947 | add_attribute(cell: Gtk.CellRenderer, attribute: string, column: number): void; |
| 2948 | /** |
| 2949 | * Unsets all the mappings on all renderers on `cell_layout` and |
| 2950 | * removes all renderers from `cell_layout`. |
| 2951 | */ |
| 2952 | clear(): void; |
| 2953 | /** |
| 2954 | * Clears all existing attributes previously set with |
| 2955 | * gtk_cell_layout_set_attributes(). |
| 2956 | * @param cell a #GtkCellRenderer to clear the attribute mapping on |
| 2957 | */ |
| 2958 | clear_attributes(cell: Gtk.CellRenderer): void; |
| 2959 | /** |
| 2960 | * Returns the underlying #GtkCellArea which might be `cell_layout` |
| 2961 | * if called on a #GtkCellArea or might be %NULL if no #GtkCellArea |
| 2962 | * is used by `cell_layout`. |
| 2963 | * @returns the cell area used by @cell_layout, or %NULL in case no cell area is used. |
| 2964 | */ |
| 2965 | get_area(): Gtk.CellArea | null; |
| 2966 | /** |
| 2967 | * Returns the cell renderers which have been added to `cell_layout`. |
| 2968 | * @returns a list of cell renderers. The list, but not the renderers has been newly allocated and should be freed with g_list_free() when no longer needed. |
| 2969 | */ |
| 2970 | get_cells(): Gtk.CellRenderer[]; |
| 2971 | /** |
| 2972 | * Adds the `cell` to the end of `cell_layout`. If `expand` is %FALSE, then the |
| 2973 | * `cell` is allocated no more space than it needs. Any unused space is |
| 2974 | * divided evenly between cells for which `expand` is %TRUE. |
| 2975 | * |
| 2976 | * Note that reusing the same cell renderer is not supported. |
| 2977 | * @param cell a #GtkCellRenderer |
| 2978 | * @param expand %TRUE if @cell is to be given extra space allocated to @cell_layout |
| 2979 | */ |
| 2980 | pack_end(cell: Gtk.CellRenderer, expand: boolean): void; |
| 2981 | /** |
| 2982 | * Packs the `cell` into the beginning of `cell_layout`. If `expand` is %FALSE, |
| 2983 | * then the `cell` is allocated no more space than it needs. Any unused space |
| 2984 | * is divided evenly between cells for which `expand` is %TRUE. |
| 2985 | * |
| 2986 | * Note that reusing the same cell renderer is not supported. |
| 2987 | * @param cell a #GtkCellRenderer |
| 2988 | * @param expand %TRUE if @cell is to be given extra space allocated to @cell_layout |
| 2989 | */ |
| 2990 | pack_start(cell: Gtk.CellRenderer, expand: boolean): void; |
| 2991 | /** |
| 2992 | * Re-inserts `cell` at `position`. |
| 2993 | * |
| 2994 | * Note that `cell` has already to be packed into `cell_layout` |
| 2995 | * for this to function properly. |
| 2996 | * @param cell a #GtkCellRenderer to reorder |
| 2997 | * @param position new position to insert @cell at |
| 2998 | */ |
| 2999 | reorder(cell: Gtk.CellRenderer, position: number): void; |
| 3000 | /** |
| 3001 | * Sets the #GtkCellLayoutDataFunc to use for `cell_layout`. |
| 3002 | * |
| 3003 | * This function is used instead of the standard attributes mapping |
| 3004 | * for setting the column value, and should set the value of `cell_layout’`s |
| 3005 | * cell renderer(s) as appropriate. |
| 3006 | * |
| 3007 | * `func` may be %NULL to remove a previously set function. |
| 3008 | * @param cell a #GtkCellRenderer |
| 3009 | * @param func the #GtkCellLayoutDataFunc to use, or %NULL |
| 3010 | */ |
| 3011 | set_cell_data_func(cell: Gtk.CellRenderer, func?: Gtk.CellLayoutDataFunc | null): void; |
| 3012 | /** |
| 3013 | * Adds an attribute mapping to the list in `cell_layout`. |
| 3014 | * |
| 3015 | * The `column` is the column of the model to get a value from, and the |
| 3016 | * `attribute` is the parameter on `cell` to be set from the value. So for |
| 3017 | * example if column 2 of the model contains strings, you could have the |
| 3018 | * “text” attribute of a #GtkCellRendererText get its values from column 2. |
| 3019 | * @param cell a #GtkCellRenderer |
| 3020 | * @param attribute an attribute on the renderer |
| 3021 | * @param column the column position on the model to get the attribute from |
| 3022 | */ |
| 3023 | vfunc_add_attribute(cell: Gtk.CellRenderer, attribute: string, column: number): void; |
| 3024 | /** |
| 3025 | * Unsets all the mappings on all renderers on `cell_layout` and |
| 3026 | * removes all renderers from `cell_layout`. |
| 3027 | */ |
| 3028 | vfunc_clear(): void; |
| 3029 | /** |
| 3030 | * Clears all existing attributes previously set with |
| 3031 | * gtk_cell_layout_set_attributes(). |
| 3032 | * @param cell a #GtkCellRenderer to clear the attribute mapping on |
| 3033 | */ |
| 3034 | vfunc_clear_attributes(cell: Gtk.CellRenderer): void; |
| 3035 | /** |
| 3036 | * Returns the underlying #GtkCellArea which might be `cell_layout` |
| 3037 | * if called on a #GtkCellArea or might be %NULL if no #GtkCellArea |
| 3038 | * is used by `cell_layout`. |
| 3039 | */ |
| 3040 | vfunc_get_area(): Gtk.CellArea | null; |
| 3041 | /** |
| 3042 | * Returns the cell renderers which have been added to `cell_layout`. |
| 3043 | */ |
| 3044 | vfunc_get_cells(): Gtk.CellRenderer[]; |
| 3045 | /** |
| 3046 | * Adds the `cell` to the end of `cell_layout`. If `expand` is %FALSE, then the |
| 3047 | * `cell` is allocated no more space than it needs. Any unused space is |
| 3048 | * divided evenly between cells for which `expand` is %TRUE. |
| 3049 | * |
| 3050 | * Note that reusing the same cell renderer is not supported. |
| 3051 | * @param cell a #GtkCellRenderer |
| 3052 | * @param expand %TRUE if @cell is to be given extra space allocated to @cell_layout |
| 3053 | */ |
| 3054 | vfunc_pack_end(cell: Gtk.CellRenderer, expand: boolean): void; |
| 3055 | /** |
| 3056 | * Packs the `cell` into the beginning of `cell_layout`. If `expand` is %FALSE, |
| 3057 | * then the `cell` is allocated no more space than it needs. Any unused space |
| 3058 | * is divided evenly between cells for which `expand` is %TRUE. |
| 3059 | * |
| 3060 | * Note that reusing the same cell renderer is not supported. |
| 3061 | * @param cell a #GtkCellRenderer |
| 3062 | * @param expand %TRUE if @cell is to be given extra space allocated to @cell_layout |
| 3063 | */ |
| 3064 | vfunc_pack_start(cell: Gtk.CellRenderer, expand: boolean): void; |
| 3065 | /** |
| 3066 | * Re-inserts `cell` at `position`. |
| 3067 | * |
| 3068 | * Note that `cell` has already to be packed into `cell_layout` |
| 3069 | * for this to function properly. |
| 3070 | * @param cell a #GtkCellRenderer to reorder |
| 3071 | * @param position new position to insert @cell at |
| 3072 | */ |
| 3073 | vfunc_reorder(cell: Gtk.CellRenderer, position: number): void; |
| 3074 | /** |
| 3075 | * Sets the #GtkCellLayoutDataFunc to use for `cell_layout`. |
| 3076 | * |
| 3077 | * This function is used instead of the standard attributes mapping |
| 3078 | * for setting the column value, and should set the value of `cell_layout’`s |
| 3079 | * cell renderer(s) as appropriate. |
| 3080 | * |
| 3081 | * `func` may be %NULL to remove a previously set function. |
| 3082 | * @param cell a #GtkCellRenderer |
| 3083 | * @param func the #GtkCellLayoutDataFunc to use, or %NULL |
| 3084 | */ |
| 3085 | vfunc_set_cell_data_func(cell: Gtk.CellRenderer, func?: Gtk.CellLayoutDataFunc | null): void; |
| 3086 | /** |
| 3087 | * Creates a binding between `source_property` on `source` and `target_property` |
| 3088 | * on `target`. |
| 3089 | * |
| 3090 | * Whenever the `source_property` is changed the `target_property` is |
| 3091 | * updated using the same value. For instance: |
| 3092 | * |
| 3093 | * |
| 3094 | * ```c |
| 3095 | * g_object_bind_property (action, "active", widget, "sensitive", 0); |
| 3096 | * ``` |
| 3097 | * |
| 3098 | * |
| 3099 | * Will result in the "sensitive" property of the widget #GObject instance to be |
| 3100 | * updated with the same value of the "active" property of the action #GObject |
| 3101 | * instance. |
| 3102 | * |
| 3103 | * If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual: |
| 3104 | * if `target_property` on `target` changes then the `source_property` on `source` |
| 3105 | * will be updated as well. |
| 3106 | * |
| 3107 | * The binding will automatically be removed when either the `source` or the |
| 3108 | * `target` instances are finalized. To remove the binding without affecting the |
| 3109 | * `source` and the `target` you can just call g_object_unref() on the returned |
| 3110 | * #GBinding instance. |
| 3111 | * |
| 3112 | * Removing the binding by calling g_object_unref() on it must only be done if |
| 3113 | * the binding, `source` and `target` are only used from a single thread and it |
| 3114 | * is clear that both `source` and `target` outlive the binding. Especially it |
| 3115 | * is not safe to rely on this if the binding, `source` or `target` can be |
| 3116 | * finalized from different threads. Keep another reference to the binding and |
| 3117 | * use g_binding_unbind() instead to be on the safe side. |
| 3118 | * |
| 3119 | * A #GObject can have multiple bindings. |
| 3120 | * @param source_property the property on @source to bind |
| 3121 | * @param target the target #GObject |
| 3122 | * @param target_property the property on @target to bind |
| 3123 | * @param flags flags to pass to #GBinding |
| 3124 | * @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero. |
| 3125 | */ |
| 3126 | bind_property( |
| 3127 | source_property: string, |
| 3128 | target: GObject.Object, |
| 3129 | target_property: string, |
| 3130 | flags: GObject.BindingFlags | null, |
| 3131 | ): GObject.Binding; |
| 3132 | /** |
| 3133 | * Complete version of g_object_bind_property(). |
| 3134 | * |
| 3135 | * Creates a binding between `source_property` on `source` and `target_property` |
| 3136 | * on `target,` allowing you to set the transformation functions to be used by |
| 3137 | * the binding. |
| 3138 | * |
| 3139 | * If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual: |
| 3140 | * if `target_property` on `target` changes then the `source_property` on `source` |
| 3141 | * will be updated as well. The `transform_from` function is only used in case |
| 3142 | * of bidirectional bindings, otherwise it will be ignored |
| 3143 | * |
| 3144 | * The binding will automatically be removed when either the `source` or the |
| 3145 | * `target` instances are finalized. This will release the reference that is |
| 3146 | * being held on the #GBinding instance; if you want to hold on to the |
| 3147 | * #GBinding instance, you will need to hold a reference to it. |
| 3148 | * |
| 3149 | * To remove the binding, call g_binding_unbind(). |
| 3150 | * |
| 3151 | * A #GObject can have multiple bindings. |
| 3152 | * |
| 3153 | * The same `user_data` parameter will be used for both `transform_to` |
| 3154 | * and `transform_from` transformation functions; the `notify` function will |
| 3155 | * be called once, when the binding is removed. If you need different data |
| 3156 | * for each transformation function, please use |
| 3157 | * g_object_bind_property_with_closures() instead. |
| 3158 | * @param source_property the property on @source to bind |
| 3159 | * @param target the target #GObject |
| 3160 | * @param target_property the property on @target to bind |
| 3161 | * @param flags flags to pass to #GBinding |
| 3162 | * @param transform_to the transformation function from the @source to the @target, or %NULL to use the default |
| 3163 | * @param transform_from the transformation function from the @target to the @source, or %NULL to use the default |
| 3164 | * @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required |
| 3165 | * @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero. |
| 3166 | */ |
| 3167 | bind_property_full( |
| 3168 | source_property: string, |
| 3169 | target: GObject.Object, |
| 3170 | target_property: string, |
| 3171 | flags: GObject.BindingFlags | null, |
| 3172 | transform_to?: GObject.BindingTransformFunc | null, |
| 3173 | transform_from?: GObject.BindingTransformFunc | null, |
| 3174 | notify?: GLib.DestroyNotify | null, |
| 3175 | ): GObject.Binding; |
| 3176 | // Conflicted with GObject.Object.bind_property_full |
| 3177 | bind_property_full(...args: never[]): any; |
| 3178 | /** |
| 3179 | * This function is intended for #GObject implementations to re-enforce |
| 3180 | * a [floating][floating-ref] object reference. Doing this is seldom |
| 3181 | * required: all #GInitiallyUnowneds are created with a floating reference |
| 3182 | * which usually just needs to be sunken by calling g_object_ref_sink(). |
| 3183 | */ |
| 3184 | force_floating(): void; |
| 3185 | /** |
| 3186 | * Increases the freeze count on `object`. If the freeze count is |
| 3187 | * non-zero, the emission of "notify" signals on `object` is |
| 3188 | * stopped. The signals are queued until the freeze count is decreased |
| 3189 | * to zero. Duplicate notifications are squashed so that at most one |
| 3190 | * #GObject::notify signal is emitted for each property modified while the |
| 3191 | * object is frozen. |
| 3192 | * |
| 3193 | * This is necessary for accessors that modify multiple properties to prevent |
| 3194 | * premature notification while the object is still being modified. |
| 3195 | */ |
| 3196 | freeze_notify(): void; |
| 3197 | /** |
| 3198 | * Gets a named field from the objects table of associations (see g_object_set_data()). |
| 3199 | * @param key name of the key for that association |
| 3200 | * @returns the data if found, or %NULL if no such data exists. |
| 3201 | */ |
| 3202 | get_data(key: string): any | null; |
| 3203 | /** |
| 3204 | * Gets a property of an object. |
| 3205 | * |
| 3206 | * The value can be: |
| 3207 | * - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60) |
| 3208 | * - a GObject.Value initialized with the expected type of the property |
| 3209 | * - a GObject.Value initialized with a type to which the expected type of the property can be transformed |
| 3210 | * |
| 3211 | * In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset. |
| 3212 | * |
| 3213 | * Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming. |
| 3214 | * @param property_name The name of the property to get |
| 3215 | * @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type |
| 3216 | */ |
| 3217 | get_property(property_name: string, value: GObject.Value | any): any; |
| 3218 | /** |
| 3219 | * This function gets back user data pointers stored via |
| 3220 | * g_object_set_qdata(). |
| 3221 | * @param quark A #GQuark, naming the user data pointer |
| 3222 | * @returns The user data pointer set, or %NULL |
| 3223 | */ |
| 3224 | get_qdata(quark: GLib.Quark): any | null; |
| 3225 | /** |
| 3226 | * Gets `n_properties` properties for an `object`. |
| 3227 | * Obtained properties will be set to `values`. All properties must be valid. |
| 3228 | * Warnings will be emitted and undefined behaviour may result if invalid |
| 3229 | * properties are passed in. |
| 3230 | * @param names the names of each property to get |
| 3231 | * @param values the values of each property to get |
| 3232 | */ |
| 3233 | getv(names: string[], values: (GObject.Value | any)[]): void; |
| 3234 | /** |
| 3235 | * Checks whether `object` has a [floating][floating-ref] reference. |
| 3236 | * @returns %TRUE if @object has a floating reference |
| 3237 | */ |
| 3238 | is_floating(): boolean; |
| 3239 | /** |
| 3240 | * Emits a "notify" signal for the property `property_name` on `object`. |
| 3241 | * |
| 3242 | * When possible, eg. when signaling a property change from within the class |
| 3243 | * that registered the property, you should use g_object_notify_by_pspec() |
| 3244 | * instead. |
| 3245 | * |
| 3246 | * Note that emission of the notify signal may be blocked with |
| 3247 | * g_object_freeze_notify(). In this case, the signal emissions are queued |
| 3248 | * and will be emitted (in reverse order) when g_object_thaw_notify() is |
| 3249 | * called. |
| 3250 | * @param property_name the name of a property installed on the class of @object. |
| 3251 | */ |
| 3252 | notify(property_name: string): void; |
| 3253 | /** |
| 3254 | * Emits a "notify" signal for the property specified by `pspec` on `object`. |
| 3255 | * |
| 3256 | * This function omits the property name lookup, hence it is faster than |
| 3257 | * g_object_notify(). |
| 3258 | * |
| 3259 | * One way to avoid using g_object_notify() from within the |
| 3260 | * class that registered the properties, and using g_object_notify_by_pspec() |
| 3261 | * instead, is to store the GParamSpec used with |
| 3262 | * g_object_class_install_property() inside a static array, e.g.: |
| 3263 | * |
| 3264 | * |
| 3265 | * ```c |
| 3266 | * typedef enum |
| 3267 | * { |
| 3268 | * PROP_FOO = 1, |
| 3269 | * PROP_LAST |
| 3270 | * } MyObjectProperty; |
| 3271 | * |
| 3272 | * static GParamSpec *properties[PROP_LAST]; |
| 3273 | * |
| 3274 | * static void |
| 3275 | * my_object_class_init (MyObjectClass *klass) |
| 3276 | * { |
| 3277 | * properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL, |
| 3278 | * 0, 100, |
| 3279 | * 50, |
| 3280 | * G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); |
| 3281 | * g_object_class_install_property (gobject_class, |
| 3282 | * PROP_FOO, |
| 3283 | * properties[PROP_FOO]); |
| 3284 | * } |
| 3285 | * ``` |
| 3286 | * |
| 3287 | * |
| 3288 | * and then notify a change on the "foo" property with: |
| 3289 | * |
| 3290 | * |
| 3291 | * ```c |
| 3292 | * g_object_notify_by_pspec (self, properties[PROP_FOO]); |
| 3293 | * ``` |
| 3294 | * |
| 3295 | * @param pspec the #GParamSpec of a property installed on the class of @object. |
| 3296 | */ |
| 3297 | notify_by_pspec(pspec: GObject.ParamSpec): void; |
| 3298 | /** |
| 3299 | * Increases the reference count of `object`. |
| 3300 | * |
| 3301 | * Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type |
| 3302 | * of `object` will be propagated to the return type (using the GCC typeof() |
| 3303 | * extension), so any casting the caller needs to do on the return type must be |
| 3304 | * explicit. |
| 3305 | * @returns the same @object |
| 3306 | */ |
| 3307 | ref(): GObject.Object; |
| 3308 | /** |
| 3309 | * Increase the reference count of `object,` and possibly remove the |
| 3310 | * [floating][floating-ref] reference, if `object` has a floating reference. |
| 3311 | * |
| 3312 | * In other words, if the object is floating, then this call "assumes |
| 3313 | * ownership" of the floating reference, converting it to a normal |
| 3314 | * reference by clearing the floating flag while leaving the reference |
| 3315 | * count unchanged. If the object is not floating, then this call |
| 3316 | * adds a new normal reference increasing the reference count by one. |
| 3317 | * |
| 3318 | * Since GLib 2.56, the type of `object` will be propagated to the return type |
| 3319 | * under the same conditions as for g_object_ref(). |
| 3320 | * @returns @object |
| 3321 | */ |
| 3322 | ref_sink(): GObject.Object; |
| 3323 | /** |
| 3324 | * Releases all references to other objects. This can be used to break |
| 3325 | * reference cycles. |
| 3326 | * |
| 3327 | * This function should only be called from object system implementations. |
| 3328 | */ |
| 3329 | run_dispose(): void; |
| 3330 | /** |
| 3331 | * Each object carries around a table of associations from |
| 3332 | * strings to pointers. This function lets you set an association. |
| 3333 | * |
| 3334 | * If the object already had an association with that name, |
| 3335 | * the old association will be destroyed. |
| 3336 | * |
| 3337 | * Internally, the `key` is converted to a #GQuark using g_quark_from_string(). |
| 3338 | * This means a copy of `key` is kept permanently (even after `object` has been |
| 3339 | * finalized) — so it is recommended to only use a small, bounded set of values |
| 3340 | * for `key` in your program, to avoid the #GQuark storage growing unbounded. |
| 3341 | * @param key name of the key |
| 3342 | * @param data data to associate with that key |
| 3343 | */ |
| 3344 | set_data(key: string, data?: any | null): void; |
| 3345 | /** |
| 3346 | * Sets a property on an object. |
| 3347 | * @param property_name The name of the property to set |
| 3348 | * @param value The value to set the property to |
| 3349 | */ |
| 3350 | set_property(property_name: string, value: GObject.Value | any): void; |
| 3351 | /** |
| 3352 | * Remove a specified datum from the object's data associations, |
| 3353 | * without invoking the association's destroy handler. |
| 3354 | * @param key name of the key |
| 3355 | * @returns the data if found, or %NULL if no such data exists. |
| 3356 | */ |
| 3357 | steal_data(key: string): any | null; |
| 3358 | /** |
| 3359 | * This function gets back user data pointers stored via |
| 3360 | * g_object_set_qdata() and removes the `data` from object |
| 3361 | * without invoking its destroy() function (if any was |
| 3362 | * set). |
| 3363 | * Usually, calling this function is only required to update |
| 3364 | * user data pointers with a destroy notifier, for example: |
| 3365 | * |
| 3366 | * ```c |
| 3367 | * void |
| 3368 | * object_add_to_user_list (GObject *object, |
| 3369 | * const gchar *new_string) |
| 3370 | * { |
| 3371 | * // the quark, naming the object data |
| 3372 | * GQuark quark_string_list = g_quark_from_static_string ("my-string-list"); |
| 3373 | * // retrieve the old string list |
| 3374 | * GList *list = g_object_steal_qdata (object, quark_string_list); |
| 3375 | * |
| 3376 | * // prepend new string |
| 3377 | * list = g_list_prepend (list, g_strdup (new_string)); |
| 3378 | * // this changed 'list', so we need to set it again |
| 3379 | * g_object_set_qdata_full (object, quark_string_list, list, free_string_list); |
| 3380 | * } |
| 3381 | * static void |
| 3382 | * free_string_list (gpointer data) |
| 3383 | * { |
| 3384 | * GList *node, *list = data; |
| 3385 | * |
| 3386 | * for (node = list; node; node = node->next) |
| 3387 | * g_free (node->data); |
| 3388 | * g_list_free (list); |
| 3389 | * } |
| 3390 | * ``` |
| 3391 | * |
| 3392 | * Using g_object_get_qdata() in the above example, instead of |
| 3393 | * g_object_steal_qdata() would have left the destroy function set, |
| 3394 | * and thus the partial string list would have been freed upon |
| 3395 | * g_object_set_qdata_full(). |
| 3396 | * @param quark A #GQuark, naming the user data pointer |
| 3397 | * @returns The user data pointer set, or %NULL |
| 3398 | */ |
| 3399 | steal_qdata(quark: GLib.Quark): any | null; |
| 3400 | /** |
| 3401 | * Reverts the effect of a previous call to |
| 3402 | * g_object_freeze_notify(). The freeze count is decreased on `object` |
| 3403 | * and when it reaches zero, queued "notify" signals are emitted. |
| 3404 | * |
| 3405 | * Duplicate notifications for each property are squashed so that at most one |
| 3406 | * #GObject::notify signal is emitted for each property, in the reverse order |
| 3407 | * in which they have been queued. |
| 3408 | * |
| 3409 | * It is an error to call this function when the freeze count is zero. |
| 3410 | */ |
| 3411 | thaw_notify(): void; |
| 3412 | /** |
| 3413 | * Decreases the reference count of `object`. When its reference count |
| 3414 | * drops to 0, the object is finalized (i.e. its memory is freed). |
| 3415 | * |
| 3416 | * If the pointer to the #GObject may be reused in future (for example, if it is |
| 3417 | * an instance variable of another object), it is recommended to clear the |
| 3418 | * pointer to %NULL rather than retain a dangling pointer to a potentially |
| 3419 | * invalid #GObject instance. Use g_clear_object() for this. |
| 3420 | */ |
| 3421 | unref(): void; |
| 3422 | /** |
| 3423 | * This function essentially limits the life time of the `closure` to |
| 3424 | * the life time of the object. That is, when the object is finalized, |
| 3425 | * the `closure` is invalidated by calling g_closure_invalidate() on |
| 3426 | * it, in order to prevent invocations of the closure with a finalized |
| 3427 | * (nonexisting) object. Also, g_object_ref() and g_object_unref() are |
| 3428 | * added as marshal guards to the `closure,` to ensure that an extra |
| 3429 | * reference count is held on `object` during invocation of the |
| 3430 | * `closure`. Usually, this function will be called on closures that |
| 3431 | * use this `object` as closure data. |
| 3432 | * @param closure #GClosure to watch |
| 3433 | */ |
| 3434 | watch_closure(closure: GObject.Closure): void; |
| 3435 | /** |
| 3436 | * the `constructed` function is called by g_object_new() as the |
| 3437 | * final step of the object creation process. At the point of the call, all |
| 3438 | * construction properties have been set on the object. The purpose of this |
| 3439 | * call is to allow for object initialisation steps that can only be performed |
| 3440 | * after construction properties have been set. `constructed` implementors |
| 3441 | * should chain up to the `constructed` call of their parent class to allow it |
| 3442 | * to complete its initialisation. |
| 3443 | */ |
| 3444 | vfunc_constructed(): void; |
| 3445 | /** |
| 3446 | * emits property change notification for a bunch |
| 3447 | * of properties. Overriding `dispatch_properties_changed` should be rarely |
| 3448 | * needed. |
| 3449 | * @param n_pspecs |
| 3450 | * @param pspecs |
| 3451 | */ |
| 3452 | vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void; |
| 3453 | /** |
| 3454 | * the `dispose` function is supposed to drop all references to other |
| 3455 | * objects, but keep the instance otherwise intact, so that client method |
| 3456 | * invocations still work. It may be run multiple times (due to reference |
| 3457 | * loops). Before returning, `dispose` should chain up to the `dispose` method |
| 3458 | * of the parent class. |
| 3459 | */ |
| 3460 | vfunc_dispose(): void; |
| 3461 | /** |
| 3462 | * instance finalization function, should finish the finalization of |
| 3463 | * the instance begun in `dispose` and chain up to the `finalize` method of the |
| 3464 | * parent class. |
| 3465 | */ |
| 3466 | vfunc_finalize(): void; |
| 3467 | /** |
| 3468 | * the generic getter for all properties of this type. Should be |
| 3469 | * overridden for every type with properties. |
| 3470 | * @param property_id |
| 3471 | * @param value |
| 3472 | * @param pspec |
| 3473 | */ |
| 3474 | vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void; |
| 3475 | /** |
| 3476 | * Emits a "notify" signal for the property `property_name` on `object`. |
| 3477 | * |
| 3478 | * When possible, eg. when signaling a property change from within the class |
| 3479 | * that registered the property, you should use g_object_notify_by_pspec() |
| 3480 | * instead. |
| 3481 | * |
| 3482 | * Note that emission of the notify signal may be blocked with |
| 3483 | * g_object_freeze_notify(). In this case, the signal emissions are queued |
| 3484 | * and will be emitted (in reverse order) when g_object_thaw_notify() is |
| 3485 | * called. |
| 3486 | * @param pspec |
| 3487 | */ |
| 3488 | vfunc_notify(pspec: GObject.ParamSpec): void; |
| 3489 | /** |
| 3490 | * the generic setter for all properties of this type. Should be |
| 3491 | * overridden for every type with properties. If implementations of |
| 3492 | * `set_property` don't emit property change notification explicitly, this will |
| 3493 | * be done implicitly by the type system. However, if the notify signal is |
| 3494 | * emitted explicitly, the type system will not emit it a second time. |
| 3495 | * @param property_id |
| 3496 | * @param value |
| 3497 | * @param pspec |
| 3498 | */ |
| 3499 | vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void; |
| 3500 | /** |
| 3501 | * Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to. |
| 3502 | * @param id Handler ID of the handler to be disconnected |
| 3503 | */ |
| 3504 | disconnect(id: number): void; |
| 3505 | /** |
| 3506 | * Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values. |
| 3507 | * @param properties Object containing the properties to set |
| 3508 | */ |
| 3509 | set(properties: { [key: string]: any }): void; |
| 3510 | /** |
| 3511 | * Blocks a handler of an instance so it will not be called during any signal emissions |
| 3512 | * @param id Handler ID of the handler to be blocked |
| 3513 | */ |
| 3514 | block_signal_handler(id: number): void; |
| 3515 | /** |
| 3516 | * Unblocks a handler so it will be called again during any signal emissions |
| 3517 | * @param id Handler ID of the handler to be unblocked |
| 3518 | */ |
| 3519 | unblock_signal_handler(id: number): void; |
| 3520 | /** |
| 3521 | * Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked. |
| 3522 | * @param detailedName Name of the signal to stop emission of |
| 3523 | */ |
| 3524 | stop_emission_by_name(detailedName: string): void; |
| 3525 | /** |
| 3526 | * For widgets that can be “activated” (buttons, menu items, etc.) |
| 3527 | * this function activates them. Activation is what happens when you |
| 3528 | * press Enter on a widget during key navigation. If `widget` isn't |
| 3529 | * activatable, the function returns %FALSE. |
| 3530 | * @returns %TRUE if the widget was activatable |
| 3531 | */ |
| 3532 | activate(): boolean; |
| 3533 | /** |
| 3534 | * Installs an accelerator for this `widget` in `accel_group` that causes |
| 3535 | * `accel_signal` to be emitted if the accelerator is activated. |
| 3536 | * The `accel_group` needs to be added to the widget’s toplevel via |
| 3537 | * gtk_window_add_accel_group(), and the signal must be of type %G_SIGNAL_ACTION. |
| 3538 | * Accelerators added through this function are not user changeable during |
| 3539 | * runtime. If you want to support accelerators that can be changed by the |
| 3540 | * user, use gtk_accel_map_add_entry() and gtk_widget_set_accel_path() or |
| 3541 | * gtk_menu_item_set_accel_path() instead. |
| 3542 | * @param accel_signal widget signal to emit on accelerator activation |
| 3543 | * @param accel_group accel group for this widget, added to its toplevel |
| 3544 | * @param accel_key GDK keyval of the accelerator |
| 3545 | * @param accel_mods modifier key combination of the accelerator |
| 3546 | * @param accel_flags flag accelerators, e.g. %GTK_ACCEL_VISIBLE |
| 3547 | */ |
| 3548 | add_accelerator( |
| 3549 | accel_signal: string, |
| 3550 | accel_group: Gtk.AccelGroup, |
| 3551 | accel_key: number, |
| 3552 | accel_mods: Gdk.ModifierType | null, |
| 3553 | accel_flags: Gtk.AccelFlags | null, |
| 3554 | ): void; |
| 3555 | /** |
| 3556 | * Adds the device events in the bitfield `events` to the event mask for |
| 3557 | * `widget`. See gtk_widget_set_device_events() for details. |
| 3558 | * @param device a #GdkDevice |
| 3559 | * @param events an event mask, see #GdkEventMask |
| 3560 | */ |
| 3561 | add_device_events(device: Gdk.Device, events: Gdk.EventMask | null): void; |
| 3562 | /** |
| 3563 | * Adds the events in the bitfield `events` to the event mask for |
| 3564 | * `widget`. See gtk_widget_set_events() and the |
| 3565 | * [input handling overview][event-masks] for details. |
| 3566 | * @param events an event mask, see #GdkEventMask |
| 3567 | */ |
| 3568 | add_events(events: number): void; |
| 3569 | /** |
| 3570 | * Adds a widget to the list of mnemonic labels for |
| 3571 | * this widget. (See gtk_widget_list_mnemonic_labels()). Note the |
| 3572 | * list of mnemonic labels for the widget is cleared when the |
| 3573 | * widget is destroyed, so the caller must make sure to update |
| 3574 | * its internal state at this point as well, by using a connection |
| 3575 | * to the #GtkWidget::destroy signal or a weak notifier. |
| 3576 | * @param label a #GtkWidget that acts as a mnemonic label for @widget |
| 3577 | */ |
| 3578 | add_mnemonic_label(label: Gtk.Widget): void; |
| 3579 | /** |
| 3580 | * Queues an animation frame update and adds a callback to be called |
| 3581 | * before each frame. Until the tick callback is removed, it will be |
| 3582 | * called frequently (usually at the frame rate of the output device |
| 3583 | * or as quickly as the application can be repainted, whichever is |
| 3584 | * slower). For this reason, is most suitable for handling graphics |
| 3585 | * that change every frame or every few frames. The tick callback does |
| 3586 | * not automatically imply a relayout or repaint. If you want a |
| 3587 | * repaint or relayout, and aren’t changing widget properties that |
| 3588 | * would trigger that (for example, changing the text of a #GtkLabel), |
| 3589 | * then you will have to call gtk_widget_queue_resize() or |
| 3590 | * gtk_widget_queue_draw_area() yourself. |
| 3591 | * |
| 3592 | * gdk_frame_clock_get_frame_time() should generally be used for timing |
| 3593 | * continuous animations and |
| 3594 | * gdk_frame_timings_get_predicted_presentation_time() if you are |
| 3595 | * trying to display isolated frames at particular times. |
| 3596 | * |
| 3597 | * This is a more convenient alternative to connecting directly to the |
| 3598 | * #GdkFrameClock::update signal of #GdkFrameClock, since you don't |
| 3599 | * have to worry about when a #GdkFrameClock is assigned to a widget. |
| 3600 | * @param callback function to call for updating animations |
| 3601 | * @returns an id for the connection of this callback. Remove the callback by passing it to gtk_widget_remove_tick_callback() |
| 3602 | */ |
| 3603 | add_tick_callback(callback: Gtk.TickCallback): number; |
| 3604 | /** |
| 3605 | * Determines whether an accelerator that activates the signal |
| 3606 | * identified by `signal_id` can currently be activated. |
| 3607 | * This is done by emitting the #GtkWidget::can-activate-accel |
| 3608 | * signal on `widget;` if the signal isn’t overridden by a |
| 3609 | * handler or in a derived widget, then the default check is |
| 3610 | * that the widget must be sensitive, and the widget and all |
| 3611 | * its ancestors mapped. |
| 3612 | * @param signal_id the ID of a signal installed on @widget |
| 3613 | * @returns %TRUE if the accelerator can be activated. |
| 3614 | */ |
| 3615 | can_activate_accel(signal_id: number): boolean; |
| 3616 | /** |
| 3617 | * This function is used by custom widget implementations; if you're |
| 3618 | * writing an app, you’d use gtk_widget_grab_focus() to move the focus |
| 3619 | * to a particular widget, and gtk_container_set_focus_chain() to |
| 3620 | * change the focus tab order. So you may want to investigate those |
| 3621 | * functions instead. |
| 3622 | * |
| 3623 | * gtk_widget_child_focus() is called by containers as the user moves |
| 3624 | * around the window using keyboard shortcuts. `direction` indicates |
| 3625 | * what kind of motion is taking place (up, down, left, right, tab |
| 3626 | * forward, tab backward). gtk_widget_child_focus() emits the |
| 3627 | * #GtkWidget::focus signal; widgets override the default handler |
| 3628 | * for this signal in order to implement appropriate focus behavior. |
| 3629 | * |
| 3630 | * The default ::focus handler for a widget should return %TRUE if |
| 3631 | * moving in `direction` left the focus on a focusable location inside |
| 3632 | * that widget, and %FALSE if moving in `direction` moved the focus |
| 3633 | * outside the widget. If returning %TRUE, widgets normally |
| 3634 | * call gtk_widget_grab_focus() to place the focus accordingly; |
| 3635 | * if returning %FALSE, they don’t modify the current focus location. |
| 3636 | * @param direction direction of focus movement |
| 3637 | * @returns %TRUE if focus ended up inside @widget |
| 3638 | */ |
| 3639 | child_focus(direction: Gtk.DirectionType | null): boolean; |
| 3640 | /** |
| 3641 | * Emits a #GtkWidget::child-notify signal for the |
| 3642 | * [child property][child-properties] `child_property` |
| 3643 | * on `widget`. |
| 3644 | * |
| 3645 | * This is the analogue of g_object_notify() for child properties. |
| 3646 | * |
| 3647 | * Also see gtk_container_child_notify(). |
| 3648 | * @param child_property the name of a child property installed on the class of @widget’s parent |
| 3649 | */ |
| 3650 | child_notify(child_property: string): void; |
| 3651 | // Conflicted with Gtk.Container.child_notify |
| 3652 | child_notify(...args: never[]): any; |
| 3653 | /** |
| 3654 | * Same as gtk_widget_path(), but always uses the name of a widget’s type, |
| 3655 | * never uses a custom name set with gtk_widget_set_name(). |
| 3656 | */ |
| 3657 | class_path(): [number, string, string]; |
| 3658 | /** |
| 3659 | * Computes whether a container should give this widget extra space |
| 3660 | * when possible. Containers should check this, rather than |
| 3661 | * looking at gtk_widget_get_hexpand() or gtk_widget_get_vexpand(). |
| 3662 | * |
| 3663 | * This function already checks whether the widget is visible, so |
| 3664 | * visibility does not need to be checked separately. Non-visible |
| 3665 | * widgets are not expanded. |
| 3666 | * |
| 3667 | * The computed expand value uses either the expand setting explicitly |
| 3668 | * set on the widget itself, or, if none has been explicitly set, |
| 3669 | * the widget may expand if some of its children do. |
| 3670 | * @param orientation expand direction |
| 3671 | * @returns whether widget tree rooted here should be expanded |
| 3672 | */ |
| 3673 | compute_expand(orientation: Gtk.Orientation | null): boolean; |
| 3674 | /** |
| 3675 | * Creates a new #PangoContext with the appropriate font map, |
| 3676 | * font options, font description, and base direction for drawing |
| 3677 | * text for this widget. See also gtk_widget_get_pango_context(). |
| 3678 | * @returns the new #PangoContext |
| 3679 | */ |
| 3680 | create_pango_context(): Pango.Context; |
| 3681 | /** |
| 3682 | * Creates a new #PangoLayout with the appropriate font map, |
| 3683 | * font description, and base direction for drawing text for |
| 3684 | * this widget. |
| 3685 | * |
| 3686 | * If you keep a #PangoLayout created in this way around, you need |
| 3687 | * to re-create it when the widget #PangoContext is replaced. |
| 3688 | * This can be tracked by using the #GtkWidget::screen-changed signal |
| 3689 | * on the widget. |
| 3690 | * @param text text to set on the layout (can be %NULL) |
| 3691 | * @returns the new #PangoLayout |
| 3692 | */ |
| 3693 | create_pango_layout(text?: string | null): Pango.Layout; |
| 3694 | /** |
| 3695 | * Destroys a widget. |
| 3696 | * |
| 3697 | * When a widget is destroyed all references it holds on other objects |
| 3698 | * will be released: |
| 3699 | * |
| 3700 | * - if the widget is inside a container, it will be removed from its |
| 3701 | * parent |
| 3702 | * - if the widget is a container, all its children will be destroyed, |
| 3703 | * recursively |
| 3704 | * - if the widget is a top level, it will be removed from the list |
| 3705 | * of top level widgets that GTK+ maintains internally |
| 3706 | * |
| 3707 | * It's expected that all references held on the widget will also |
| 3708 | * be released; you should connect to the #GtkWidget::destroy signal |
| 3709 | * if you hold a reference to `widget` and you wish to remove it when |
| 3710 | * this function is called. It is not necessary to do so if you are |
| 3711 | * implementing a #GtkContainer, as you'll be able to use the |
| 3712 | * #GtkContainerClass.remove() virtual function for that. |
| 3713 | * |
| 3714 | * It's important to notice that gtk_widget_destroy() will only cause |
| 3715 | * the `widget` to be finalized if no additional references, acquired |
| 3716 | * using g_object_ref(), are held on it. In case additional references |
| 3717 | * are in place, the `widget` will be in an "inert" state after calling |
| 3718 | * this function; `widget` will still point to valid memory, allowing you |
| 3719 | * to release the references you hold, but you may not query the widget's |
| 3720 | * own state. |
| 3721 | * |
| 3722 | * You should typically call this function on top level widgets, and |
| 3723 | * rarely on child widgets. |
| 3724 | * |
| 3725 | * See also: gtk_container_remove() |
| 3726 | */ |
| 3727 | destroy(): void; |
| 3728 | /** |
| 3729 | * This function sets *`widget_pointer` to %NULL if `widget_pointer` != |
| 3730 | * %NULL. It’s intended to be used as a callback connected to the |
| 3731 | * “destroy” signal of a widget. You connect gtk_widget_destroyed() |
| 3732 | * as a signal handler, and pass the address of your widget variable |
| 3733 | * as user data. Then when the widget is destroyed, the variable will |
| 3734 | * be set to %NULL. Useful for example to avoid multiple copies |
| 3735 | * of the same dialog. |
| 3736 | * @param widget_pointer address of a variable that contains @widget |
| 3737 | */ |
| 3738 | destroyed(widget_pointer: Gtk.Widget): Gtk.Widget; |
| 3739 | /** |
| 3740 | * Returns %TRUE if `device` has been shadowed by a GTK+ |
| 3741 | * device grab on another widget, so it would stop sending |
| 3742 | * events to `widget`. This may be used in the |
| 3743 | * #GtkWidget::grab-notify signal to check for specific |
| 3744 | * devices. See gtk_device_grab_add(). |
| 3745 | * @param device a #GdkDevice |
| 3746 | * @returns %TRUE if there is an ongoing grab on @device by another #GtkWidget than @widget. |
| 3747 | */ |
| 3748 | device_is_shadowed(device: Gdk.Device): boolean; |
| 3749 | /** |
| 3750 | * This function is equivalent to gtk_drag_begin_with_coordinates(), |
| 3751 | * passing -1, -1 as coordinates. |
| 3752 | * @param targets The targets (data formats) in which the source can provide the data |
| 3753 | * @param actions A bitmask of the allowed drag actions for this drag |
| 3754 | * @param button The button the user clicked to start the drag |
| 3755 | * @param event The event that triggered the start of the drag, or %NULL if none can be obtained. |
| 3756 | * @returns the context for this drag |
| 3757 | */ |
| 3758 | drag_begin( |
| 3759 | targets: Gtk.TargetList, |
| 3760 | actions: Gdk.DragAction | null, |
| 3761 | button: number, |
| 3762 | event?: Gdk.Event | null, |
| 3763 | ): Gdk.DragContext; |
| 3764 | /** |
| 3765 | * Initiates a drag on the source side. The function only needs to be used |
| 3766 | * when the application is starting drags itself, and is not needed when |
| 3767 | * gtk_drag_source_set() is used. |
| 3768 | * |
| 3769 | * The `event` is used to retrieve the timestamp that will be used internally to |
| 3770 | * grab the pointer. If `event` is %NULL, then %GDK_CURRENT_TIME will be used. |
| 3771 | * However, you should try to pass a real event in all cases, since that can be |
| 3772 | * used to get information about the drag. |
| 3773 | * |
| 3774 | * Generally there are three cases when you want to start a drag by hand by |
| 3775 | * calling this function: |
| 3776 | * |
| 3777 | * 1. During a #GtkWidget::button-press-event handler, if you want to start a drag |
| 3778 | * immediately when the user presses the mouse button. Pass the `event` |
| 3779 | * that you have in your #GtkWidget::button-press-event handler. |
| 3780 | * |
| 3781 | * 2. During a #GtkWidget::motion-notify-event handler, if you want to start a drag |
| 3782 | * when the mouse moves past a certain threshold distance after a button-press. |
| 3783 | * Pass the `event` that you have in your #GtkWidget::motion-notify-event handler. |
| 3784 | * |
| 3785 | * 3. During a timeout handler, if you want to start a drag after the mouse |
| 3786 | * button is held down for some time. Try to save the last event that you got |
| 3787 | * from the mouse, using gdk_event_copy(), and pass it to this function |
| 3788 | * (remember to free the event with gdk_event_free() when you are done). |
| 3789 | * If you really cannot pass a real event, pass %NULL instead. |
| 3790 | * @param targets The targets (data formats) in which the source can provide the data |
| 3791 | * @param actions A bitmask of the allowed drag actions for this drag |
| 3792 | * @param button The button the user clicked to start the drag |
| 3793 | * @param event The event that triggered the start of the drag, or %NULL if none can be obtained. |
| 3794 | * @param x The initial x coordinate to start dragging from, in the coordinate space of @widget. If -1 is passed, the coordinates are retrieved from @event or the current pointer position |
| 3795 | * @param y The initial y coordinate to start dragging from, in the coordinate space of @widget. If -1 is passed, the coordinates are retrieved from @event or the current pointer position |
| 3796 | * @returns the context for this drag |
| 3797 | */ |
| 3798 | drag_begin_with_coordinates( |
| 3799 | targets: Gtk.TargetList, |
| 3800 | actions: Gdk.DragAction | null, |
| 3801 | button: number, |
| 3802 | event: Gdk.Event | null, |
| 3803 | x: number, |
| 3804 | y: number, |
| 3805 | ): Gdk.DragContext; |
| 3806 | /** |
| 3807 | * Checks to see if a mouse drag starting at (`start_x,` `start_y)` and ending |
| 3808 | * at (`current_x,` `current_y)` has passed the GTK+ drag threshold, and thus |
| 3809 | * should trigger the beginning of a drag-and-drop operation. |
| 3810 | * @param start_x X coordinate of start of drag |
| 3811 | * @param start_y Y coordinate of start of drag |
| 3812 | * @param current_x current X coordinate |
| 3813 | * @param current_y current Y coordinate |
| 3814 | * @returns %TRUE if the drag threshold has been passed. |
| 3815 | */ |
| 3816 | drag_check_threshold(start_x: number, start_y: number, current_x: number, current_y: number): boolean; |
| 3817 | /** |
| 3818 | * Add the image targets supported by #GtkSelectionData to |
| 3819 | * the target list of the drag destination. The targets |
| 3820 | * are added with `info` = 0. If you need another value, |
| 3821 | * use gtk_target_list_add_image_targets() and |
| 3822 | * gtk_drag_dest_set_target_list(). |
| 3823 | */ |
| 3824 | drag_dest_add_image_targets(): void; |
| 3825 | /** |
| 3826 | * Add the text targets supported by #GtkSelectionData to |
| 3827 | * the target list of the drag destination. The targets |
| 3828 | * are added with `info` = 0. If you need another value, |
| 3829 | * use gtk_target_list_add_text_targets() and |
| 3830 | * gtk_drag_dest_set_target_list(). |
| 3831 | */ |
| 3832 | drag_dest_add_text_targets(): void; |
| 3833 | /** |
| 3834 | * Add the URI targets supported by #GtkSelectionData to |
| 3835 | * the target list of the drag destination. The targets |
| 3836 | * are added with `info` = 0. If you need another value, |
| 3837 | * use gtk_target_list_add_uri_targets() and |
| 3838 | * gtk_drag_dest_set_target_list(). |
| 3839 | */ |
| 3840 | drag_dest_add_uri_targets(): void; |
| 3841 | /** |
| 3842 | * Looks for a match between the supported targets of `context` and the |
| 3843 | * `dest_target_list,` returning the first matching target, otherwise |
| 3844 | * returning %GDK_NONE. `dest_target_list` should usually be the return |
| 3845 | * value from gtk_drag_dest_get_target_list(), but some widgets may |
| 3846 | * have different valid targets for different parts of the widget; in |
| 3847 | * that case, they will have to implement a drag_motion handler that |
| 3848 | * passes the correct target list to this function. |
| 3849 | * @param context drag context |
| 3850 | * @param target_list list of droppable targets, or %NULL to use gtk_drag_dest_get_target_list (@widget). |
| 3851 | * @returns first target that the source offers and the dest can accept, or %GDK_NONE |
| 3852 | */ |
| 3853 | drag_dest_find_target(context: Gdk.DragContext, target_list?: Gtk.TargetList | null): Gdk.Atom; |
| 3854 | /** |
| 3855 | * Returns the list of targets this widget can accept from |
| 3856 | * drag-and-drop. |
| 3857 | * @returns the #GtkTargetList, or %NULL if none |
| 3858 | */ |
| 3859 | drag_dest_get_target_list(): Gtk.TargetList | null; |
| 3860 | /** |
| 3861 | * Returns whether the widget has been configured to always |
| 3862 | * emit #GtkWidget::drag-motion signals. |
| 3863 | * @returns %TRUE if the widget always emits #GtkWidget::drag-motion events |
| 3864 | */ |
| 3865 | drag_dest_get_track_motion(): boolean; |
| 3866 | /** |
| 3867 | * Sets a widget as a potential drop destination, and adds default behaviors. |
| 3868 | * |
| 3869 | * The default behaviors listed in `flags` have an effect similar |
| 3870 | * to installing default handlers for the widget’s drag-and-drop signals |
| 3871 | * (#GtkWidget::drag-motion, #GtkWidget::drag-drop, ...). They all exist |
| 3872 | * for convenience. When passing #GTK_DEST_DEFAULT_ALL for instance it is |
| 3873 | * sufficient to connect to the widget’s #GtkWidget::drag-data-received |
| 3874 | * signal to get primitive, but consistent drag-and-drop support. |
| 3875 | * |
| 3876 | * Things become more complicated when you try to preview the dragged data, |
| 3877 | * as described in the documentation for #GtkWidget::drag-motion. The default |
| 3878 | * behaviors described by `flags` make some assumptions, that can conflict |
| 3879 | * with your own signal handlers. For instance #GTK_DEST_DEFAULT_DROP causes |
| 3880 | * invokations of gdk_drag_status() in the context of #GtkWidget::drag-motion, |
| 3881 | * and invokations of gtk_drag_finish() in #GtkWidget::drag-data-received. |
| 3882 | * Especially the later is dramatic, when your own #GtkWidget::drag-motion |
| 3883 | * handler calls gtk_drag_get_data() to inspect the dragged data. |
| 3884 | * |
| 3885 | * There’s no way to set a default action here, you can use the |
| 3886 | * #GtkWidget::drag-motion callback for that. Here’s an example which selects |
| 3887 | * the action to use depending on whether the control key is pressed or not: |
| 3888 | * |
| 3889 | * ```c |
| 3890 | * static void |
| 3891 | * drag_motion (GtkWidget *widget, |
| 3892 | * GdkDragContext *context, |
| 3893 | * gint x, |
| 3894 | * gint y, |
| 3895 | * guint time) |
| 3896 | * { |
| 3897 | * GdkModifierType mask; |
| 3898 | * |
| 3899 | * gdk_window_get_pointer (gtk_widget_get_window (widget), |
| 3900 | * NULL, NULL, &mask); |
| 3901 | * if (mask & GDK_CONTROL_MASK) |
| 3902 | * gdk_drag_status (context, GDK_ACTION_COPY, time); |
| 3903 | * else |
| 3904 | * gdk_drag_status (context, GDK_ACTION_MOVE, time); |
| 3905 | * } |
| 3906 | * ``` |
| 3907 | * |
| 3908 | * @param flags which types of default drag behavior to use |
| 3909 | * @param targets a pointer to an array of #GtkTargetEntrys indicating the drop types that this @widget will accept, or %NULL. Later you can access the list with gtk_drag_dest_get_target_list() and gtk_drag_dest_find_target(). |
| 3910 | * @param actions a bitmask of possible actions for a drop onto this @widget. |
| 3911 | */ |
| 3912 | drag_dest_set( |
| 3913 | flags: Gtk.DestDefaults | null, |
| 3914 | targets: Gtk.TargetEntry[] | null, |
| 3915 | actions: Gdk.DragAction | null, |
| 3916 | ): void; |
| 3917 | /** |
| 3918 | * Sets this widget as a proxy for drops to another window. |
| 3919 | * @param proxy_window the window to which to forward drag events |
| 3920 | * @param protocol the drag protocol which the @proxy_window accepts (You can use gdk_drag_get_protocol() to determine this) |
| 3921 | * @param use_coordinates If %TRUE, send the same coordinates to the destination, because it is an embedded subwindow. |
| 3922 | */ |
| 3923 | drag_dest_set_proxy( |
| 3924 | proxy_window: Gdk.Window, |
| 3925 | protocol: Gdk.DragProtocol | null, |
| 3926 | use_coordinates: boolean, |
| 3927 | ): void; |
| 3928 | /** |
| 3929 | * Sets the target types that this widget can accept from drag-and-drop. |
| 3930 | * The widget must first be made into a drag destination with |
| 3931 | * gtk_drag_dest_set(). |
| 3932 | * @param target_list list of droppable targets, or %NULL for none |
| 3933 | */ |
| 3934 | drag_dest_set_target_list(target_list?: Gtk.TargetList | null): void; |
| 3935 | /** |
| 3936 | * Tells the widget to emit #GtkWidget::drag-motion and |
| 3937 | * #GtkWidget::drag-leave events regardless of the targets and the |
| 3938 | * %GTK_DEST_DEFAULT_MOTION flag. |
| 3939 | * |
| 3940 | * This may be used when a widget wants to do generic |
| 3941 | * actions regardless of the targets that the source offers. |
| 3942 | * @param track_motion whether to accept all targets |
| 3943 | */ |
| 3944 | drag_dest_set_track_motion(track_motion: boolean): void; |
| 3945 | /** |
| 3946 | * Clears information about a drop destination set with |
| 3947 | * gtk_drag_dest_set(). The widget will no longer receive |
| 3948 | * notification of drags. |
| 3949 | */ |
| 3950 | drag_dest_unset(): void; |
| 3951 | /** |
| 3952 | * Gets the data associated with a drag. When the data |
| 3953 | * is received or the retrieval fails, GTK+ will emit a |
| 3954 | * #GtkWidget::drag-data-received signal. Failure of the retrieval |
| 3955 | * is indicated by the length field of the `selection_data` |
| 3956 | * signal parameter being negative. However, when gtk_drag_get_data() |
| 3957 | * is called implicitely because the %GTK_DEST_DEFAULT_DROP was set, |
| 3958 | * then the widget will not receive notification of failed |
| 3959 | * drops. |
| 3960 | * @param context the drag context |
| 3961 | * @param target the target (form of the data) to retrieve |
| 3962 | * @param time_ a timestamp for retrieving the data. This will generally be the time received in a #GtkWidget::drag-motion or #GtkWidget::drag-drop signal |
| 3963 | */ |
| 3964 | drag_get_data(context: Gdk.DragContext, target: Gdk.Atom, time_: number): void; |
| 3965 | /** |
| 3966 | * Highlights a widget as a currently hovered drop target. |
| 3967 | * To end the highlight, call gtk_drag_unhighlight(). |
| 3968 | * GTK+ calls this automatically if %GTK_DEST_DEFAULT_HIGHLIGHT is set. |
| 3969 | */ |
| 3970 | drag_highlight(): void; |
| 3971 | /** |
| 3972 | * Add the writable image targets supported by #GtkSelectionData to |
| 3973 | * the target list of the drag source. The targets |
| 3974 | * are added with `info` = 0. If you need another value, |
| 3975 | * use gtk_target_list_add_image_targets() and |
| 3976 | * gtk_drag_source_set_target_list(). |
| 3977 | */ |
| 3978 | drag_source_add_image_targets(): void; |
| 3979 | /** |
| 3980 | * Add the text targets supported by #GtkSelectionData to |
| 3981 | * the target list of the drag source. The targets |
| 3982 | * are added with `info` = 0. If you need another value, |
| 3983 | * use gtk_target_list_add_text_targets() and |
| 3984 | * gtk_drag_source_set_target_list(). |
| 3985 | */ |
| 3986 | drag_source_add_text_targets(): void; |
| 3987 | /** |
| 3988 | * Add the URI targets supported by #GtkSelectionData to |
| 3989 | * the target list of the drag source. The targets |
| 3990 | * are added with `info` = 0. If you need another value, |
| 3991 | * use gtk_target_list_add_uri_targets() and |
| 3992 | * gtk_drag_source_set_target_list(). |
| 3993 | */ |
| 3994 | drag_source_add_uri_targets(): void; |
| 3995 | /** |
| 3996 | * Gets the list of targets this widget can provide for |
| 3997 | * drag-and-drop. |
| 3998 | * @returns the #GtkTargetList, or %NULL if none |
| 3999 | */ |
| 4000 | drag_source_get_target_list(): Gtk.TargetList | null; |
| 4001 | /** |
| 4002 | * Sets up a widget so that GTK+ will start a drag operation when the user |
| 4003 | * clicks and drags on the widget. The widget must have a window. |
| 4004 | * @param start_button_mask the bitmask of buttons that can start the drag |
| 4005 | * @param targets the table of targets that the drag will support, may be %NULL |
| 4006 | * @param actions the bitmask of possible actions for a drag from this widget |
| 4007 | */ |
| 4008 | drag_source_set( |
| 4009 | start_button_mask: Gdk.ModifierType | null, |
| 4010 | targets: Gtk.TargetEntry[] | null, |
| 4011 | actions: Gdk.DragAction | null, |
| 4012 | ): void; |
| 4013 | /** |
| 4014 | * Sets the icon that will be used for drags from a particular source |
| 4015 | * to `icon`. See the docs for #GtkIconTheme for more details. |
| 4016 | * @param icon A #GIcon |
| 4017 | */ |
| 4018 | drag_source_set_icon_gicon(icon: Gio.Icon): void; |
| 4019 | /** |
| 4020 | * Sets the icon that will be used for drags from a particular source |
| 4021 | * to a themed icon. See the docs for #GtkIconTheme for more details. |
| 4022 | * @param icon_name name of icon to use |
| 4023 | */ |
| 4024 | drag_source_set_icon_name(icon_name: string): void; |
| 4025 | /** |
| 4026 | * Sets the icon that will be used for drags from a particular widget |
| 4027 | * from a #GdkPixbuf. GTK+ retains a reference for `pixbuf` and will |
| 4028 | * release it when it is no longer needed. |
| 4029 | * @param pixbuf the #GdkPixbuf for the drag icon |
| 4030 | */ |
| 4031 | drag_source_set_icon_pixbuf(pixbuf: GdkPixbuf.Pixbuf): void; |
| 4032 | /** |
| 4033 | * Sets the icon that will be used for drags from a particular source |
| 4034 | * to a stock icon. |
| 4035 | * @param stock_id the ID of the stock icon to use |
| 4036 | */ |
| 4037 | drag_source_set_icon_stock(stock_id: string): void; |
| 4038 | /** |
| 4039 | * Changes the target types that this widget offers for drag-and-drop. |
| 4040 | * The widget must first be made into a drag source with |
| 4041 | * gtk_drag_source_set(). |
| 4042 | * @param target_list list of draggable targets, or %NULL for none |
| 4043 | */ |
| 4044 | drag_source_set_target_list(target_list?: Gtk.TargetList | null): void; |
| 4045 | /** |
| 4046 | * Undoes the effects of gtk_drag_source_set(). |
| 4047 | */ |
| 4048 | drag_source_unset(): void; |
| 4049 | /** |
| 4050 | * Removes a highlight set by gtk_drag_highlight() from |
| 4051 | * a widget. |
| 4052 | */ |
| 4053 | drag_unhighlight(): void; |
| 4054 | /** |
| 4055 | * Draws `widget` to `cr`. The top left corner of the widget will be |
| 4056 | * drawn to the currently set origin point of `cr`. |
| 4057 | * |
| 4058 | * You should pass a cairo context as `cr` argument that is in an |
| 4059 | * original state. Otherwise the resulting drawing is undefined. For |
| 4060 | * example changing the operator using cairo_set_operator() or the |
| 4061 | * line width using cairo_set_line_width() might have unwanted side |
| 4062 | * effects. |
| 4063 | * You may however change the context’s transform matrix - like with |
| 4064 | * cairo_scale(), cairo_translate() or cairo_set_matrix() and clip |
| 4065 | * region with cairo_clip() prior to calling this function. Also, it |
| 4066 | * is fine to modify the context with cairo_save() and |
| 4067 | * cairo_push_group() prior to calling this function. |
| 4068 | * |
| 4069 | * Note that special-purpose widgets may contain special code for |
| 4070 | * rendering to the screen and might appear differently on screen |
| 4071 | * and when rendered using gtk_widget_draw(). |
| 4072 | * @param cr a cairo context to draw to |
| 4073 | */ |
| 4074 | draw(cr: cairo.Context): void; |
| 4075 | /** |
| 4076 | * Ensures that `widget` has a style (`widget->`style). |
| 4077 | * |
| 4078 | * Not a very useful function; most of the time, if you |
| 4079 | * want the style, the widget is realized, and realized |
| 4080 | * widgets are guaranteed to have a style already. |
| 4081 | */ |
| 4082 | ensure_style(): void; |
| 4083 | /** |
| 4084 | * Notifies the user about an input-related error on this widget. |
| 4085 | * If the #GtkSettings:gtk-error-bell setting is %TRUE, it calls |
| 4086 | * gdk_window_beep(), otherwise it does nothing. |
| 4087 | * |
| 4088 | * Note that the effect of gdk_window_beep() can be configured in many |
| 4089 | * ways, depending on the windowing backend and the desktop environment |
| 4090 | * or window manager that is used. |
| 4091 | */ |
| 4092 | error_bell(): void; |
| 4093 | /** |
| 4094 | * Rarely-used function. This function is used to emit |
| 4095 | * the event signals on a widget (those signals should never |
| 4096 | * be emitted without using this function to do so). |
| 4097 | * If you want to synthesize an event though, don’t use this function; |
| 4098 | * instead, use gtk_main_do_event() so the event will behave as if |
| 4099 | * it were in the event queue. Don’t synthesize expose events; instead, |
| 4100 | * use gdk_window_invalidate_rect() to invalidate a region of the |
| 4101 | * window. |
| 4102 | * @param event a #GdkEvent |
| 4103 | * @returns return from the event signal emission (%TRUE if the event was handled) |
| 4104 | */ |
| 4105 | event(event: Gdk.Event): boolean; |
| 4106 | /** |
| 4107 | * Stops emission of #GtkWidget::child-notify signals on `widget`. The |
| 4108 | * signals are queued until gtk_widget_thaw_child_notify() is called |
| 4109 | * on `widget`. |
| 4110 | * |
| 4111 | * This is the analogue of g_object_freeze_notify() for child properties. |
| 4112 | */ |
| 4113 | freeze_child_notify(): void; |
| 4114 | /** |
| 4115 | * Returns the accessible object that describes the widget to an |
| 4116 | * assistive technology. |
| 4117 | * |
| 4118 | * If accessibility support is not available, this #AtkObject |
| 4119 | * instance may be a no-op. Likewise, if no class-specific #AtkObject |
| 4120 | * implementation is available for the widget instance in question, |
| 4121 | * it will inherit an #AtkObject implementation from the first ancestor |
| 4122 | * class for which such an implementation is defined. |
| 4123 | * |
| 4124 | * The documentation of the |
| 4125 | * [ATK](http://developer.gnome.org/atk/stable/) |
| 4126 | * library contains more information about accessible objects and their uses. |
| 4127 | * @returns the #AtkObject associated with @widget |
| 4128 | */ |
| 4129 | get_accessible(): Atk.Object; |
| 4130 | /** |
| 4131 | * Retrieves the #GActionGroup that was registered using `prefix`. The resulting |
| 4132 | * #GActionGroup may have been registered to `widget` or any #GtkWidget in its |
| 4133 | * ancestry. |
| 4134 | * |
| 4135 | * If no action group was found matching `prefix,` then %NULL is returned. |
| 4136 | * @param prefix The “prefix” of the action group. |
| 4137 | * @returns A #GActionGroup or %NULL. |
| 4138 | */ |
| 4139 | get_action_group(prefix: string): Gio.ActionGroup | null; |
| 4140 | /** |
| 4141 | * Returns the baseline that has currently been allocated to `widget`. |
| 4142 | * This function is intended to be used when implementing handlers |
| 4143 | * for the #GtkWidget::draw function, and when allocating child |
| 4144 | * widgets in #GtkWidget::size_allocate. |
| 4145 | * @returns the baseline of the @widget, or -1 if none |
| 4146 | */ |
| 4147 | get_allocated_baseline(): number; |
| 4148 | /** |
| 4149 | * Returns the height that has currently been allocated to `widget`. |
| 4150 | * This function is intended to be used when implementing handlers |
| 4151 | * for the #GtkWidget::draw function. |
| 4152 | * @returns the height of the @widget |
| 4153 | */ |
| 4154 | get_allocated_height(): number; |
| 4155 | /** |
| 4156 | * Retrieves the widget’s allocated size. |
| 4157 | * |
| 4158 | * This function returns the last values passed to |
| 4159 | * gtk_widget_size_allocate_with_baseline(). The value differs from |
| 4160 | * the size returned in gtk_widget_get_allocation() in that functions |
| 4161 | * like gtk_widget_set_halign() can adjust the allocation, but not |
| 4162 | * the value returned by this function. |
| 4163 | * |
| 4164 | * If a widget is not visible, its allocated size is 0. |
| 4165 | */ |
| 4166 | get_allocated_size(): [Gtk.Allocation, number]; |
| 4167 | /** |
| 4168 | * Returns the width that has currently been allocated to `widget`. |
| 4169 | * This function is intended to be used when implementing handlers |
| 4170 | * for the #GtkWidget::draw function. |
| 4171 | * @returns the width of the @widget |
| 4172 | */ |
| 4173 | get_allocated_width(): number; |
| 4174 | /** |
| 4175 | * Retrieves the widget’s allocation. |
| 4176 | * |
| 4177 | * Note, when implementing a #GtkContainer: a widget’s allocation will |
| 4178 | * be its “adjusted” allocation, that is, the widget’s parent |
| 4179 | * container typically calls gtk_widget_size_allocate() with an |
| 4180 | * allocation, and that allocation is then adjusted (to handle margin |
| 4181 | * and alignment for example) before assignment to the widget. |
| 4182 | * gtk_widget_get_allocation() returns the adjusted allocation that |
| 4183 | * was actually assigned to the widget. The adjusted allocation is |
| 4184 | * guaranteed to be completely contained within the |
| 4185 | * gtk_widget_size_allocate() allocation, however. So a #GtkContainer |
| 4186 | * is guaranteed that its children stay inside the assigned bounds, |
| 4187 | * but not that they have exactly the bounds the container assigned. |
| 4188 | * There is no way to get the original allocation assigned by |
| 4189 | * gtk_widget_size_allocate(), since it isn’t stored; if a container |
| 4190 | * implementation needs that information it will have to track it itself. |
| 4191 | */ |
| 4192 | get_allocation(): Gtk.Allocation; |
| 4193 | /** |
| 4194 | * Gets the first ancestor of `widget` with type `widget_type`. For example, |
| 4195 | * `gtk_widget_get_ancestor (widget, GTK_TYPE_BOX)` gets |
| 4196 | * the first #GtkBox that’s an ancestor of `widget`. No reference will be |
| 4197 | * added to the returned widget; it should not be unreferenced. See note |
| 4198 | * about checking for a toplevel #GtkWindow in the docs for |
| 4199 | * gtk_widget_get_toplevel(). |
| 4200 | * |
| 4201 | * Note that unlike gtk_widget_is_ancestor(), gtk_widget_get_ancestor() |
| 4202 | * considers `widget` to be an ancestor of itself. |
| 4203 | * @param widget_type ancestor type |
| 4204 | * @returns the ancestor widget, or %NULL if not found |
| 4205 | */ |
| 4206 | get_ancestor(widget_type: GObject.GType): Gtk.Widget | null; |
| 4207 | /** |
| 4208 | * Determines whether the application intends to draw on the widget in |
| 4209 | * an #GtkWidget::draw handler. |
| 4210 | * |
| 4211 | * See gtk_widget_set_app_paintable() |
| 4212 | * @returns %TRUE if the widget is app paintable |
| 4213 | */ |
| 4214 | get_app_paintable(): boolean; |
| 4215 | /** |
| 4216 | * Determines whether `widget` can be a default widget. See |
| 4217 | * gtk_widget_set_can_default(). |
| 4218 | * @returns %TRUE if @widget can be a default widget, %FALSE otherwise |
| 4219 | */ |
| 4220 | get_can_default(): boolean; |
| 4221 | /** |
| 4222 | * Determines whether `widget` can own the input focus. See |
| 4223 | * gtk_widget_set_can_focus(). |
| 4224 | * @returns %TRUE if @widget can own the input focus, %FALSE otherwise |
| 4225 | */ |
| 4226 | get_can_focus(): boolean; |
| 4227 | /** |
| 4228 | * This function is only for use in widget implementations. Obtains |
| 4229 | * `widget->`requisition, unless someone has forced a particular |
| 4230 | * geometry on the widget (e.g. with gtk_widget_set_size_request()), |
| 4231 | * in which case it returns that geometry instead of the widget's |
| 4232 | * requisition. |
| 4233 | * |
| 4234 | * This function differs from gtk_widget_size_request() in that |
| 4235 | * it retrieves the last size request value from `widget->`requisition, |
| 4236 | * while gtk_widget_size_request() actually calls the "size_request" method |
| 4237 | * on `widget` to compute the size request and fill in `widget->`requisition, |
| 4238 | * and only then returns `widget->`requisition. |
| 4239 | * |
| 4240 | * Because this function does not call the “size_request” method, it |
| 4241 | * can only be used when you know that `widget->`requisition is |
| 4242 | * up-to-date, that is, gtk_widget_size_request() has been called |
| 4243 | * since the last time a resize was queued. In general, only container |
| 4244 | * implementations have this information; applications should use |
| 4245 | * gtk_widget_size_request(). |
| 4246 | */ |
| 4247 | get_child_requisition(): Gtk.Requisition; |
| 4248 | /** |
| 4249 | * Gets the value set with gtk_widget_set_child_visible(). |
| 4250 | * If you feel a need to use this function, your code probably |
| 4251 | * needs reorganization. |
| 4252 | * |
| 4253 | * This function is only useful for container implementations and |
| 4254 | * never should be called by an application. |
| 4255 | * @returns %TRUE if the widget is mapped with the parent. |
| 4256 | */ |
| 4257 | get_child_visible(): boolean; |
| 4258 | /** |
| 4259 | * Retrieves the widget’s clip area. |
| 4260 | * |
| 4261 | * The clip area is the area in which all of `widget'`s drawing will |
| 4262 | * happen. Other toolkits call it the bounding box. |
| 4263 | * |
| 4264 | * Historically, in GTK+ the clip area has been equal to the allocation |
| 4265 | * retrieved via gtk_widget_get_allocation(). |
| 4266 | */ |
| 4267 | get_clip(): Gtk.Allocation; |
| 4268 | /** |
| 4269 | * Returns the clipboard object for the given selection to |
| 4270 | * be used with `widget`. `widget` must have a #GdkDisplay |
| 4271 | * associated with it, so must be attached to a toplevel |
| 4272 | * window. |
| 4273 | * @param selection a #GdkAtom which identifies the clipboard to use. %GDK_SELECTION_CLIPBOARD gives the default clipboard. Another common value is %GDK_SELECTION_PRIMARY, which gives the primary X selection. |
| 4274 | * @returns the appropriate clipboard object. If no clipboard already exists, a new one will be created. Once a clipboard object has been created, it is persistent for all time. |
| 4275 | */ |
| 4276 | get_clipboard(selection: Gdk.Atom): Gtk.Clipboard; |
| 4277 | /** |
| 4278 | * Obtains the composite name of a widget. |
| 4279 | * @returns the composite name of @widget, or %NULL if @widget is not a composite child. The string should be freed when it is no longer needed. |
| 4280 | */ |
| 4281 | get_composite_name(): string; |
| 4282 | /** |
| 4283 | * Returns whether `device` can interact with `widget` and its |
| 4284 | * children. See gtk_widget_set_device_enabled(). |
| 4285 | * @param device a #GdkDevice |
| 4286 | * @returns %TRUE is @device is enabled for @widget |
| 4287 | */ |
| 4288 | get_device_enabled(device: Gdk.Device): boolean; |
| 4289 | /** |
| 4290 | * Returns the events mask for the widget corresponding to an specific device. These |
| 4291 | * are the events that the widget will receive when `device` operates on it. |
| 4292 | * @param device a #GdkDevice |
| 4293 | * @returns device event mask for @widget |
| 4294 | */ |
| 4295 | get_device_events(device: Gdk.Device): Gdk.EventMask; |
| 4296 | /** |
| 4297 | * Gets the reading direction for a particular widget. See |
| 4298 | * gtk_widget_set_direction(). |
| 4299 | * @returns the reading direction for the widget. |
| 4300 | */ |
| 4301 | get_direction(): Gtk.TextDirection; |
| 4302 | /** |
| 4303 | * Get the #GdkDisplay for the toplevel window associated with |
| 4304 | * this widget. This function can only be called after the widget |
| 4305 | * has been added to a widget hierarchy with a #GtkWindow at the top. |
| 4306 | * |
| 4307 | * In general, you should only create display specific |
| 4308 | * resources when a widget has been realized, and you should |
| 4309 | * free those resources when the widget is unrealized. |
| 4310 | * @returns the #GdkDisplay for the toplevel for this widget. |
| 4311 | */ |
| 4312 | get_display(): Gdk.Display; |
| 4313 | /** |
| 4314 | * Determines whether the widget is double buffered. |
| 4315 | * |
| 4316 | * See gtk_widget_set_double_buffered() |
| 4317 | * @returns %TRUE if the widget is double buffered |
| 4318 | */ |
| 4319 | get_double_buffered(): boolean; |
| 4320 | /** |
| 4321 | * Returns the event mask (see #GdkEventMask) for the widget. These are the |
| 4322 | * events that the widget will receive. |
| 4323 | * |
| 4324 | * Note: Internally, the widget event mask will be the logical OR of the event |
| 4325 | * mask set through gtk_widget_set_events() or gtk_widget_add_events(), and the |
| 4326 | * event mask necessary to cater for every #GtkEventController created for the |
| 4327 | * widget. |
| 4328 | * @returns event mask for @widget |
| 4329 | */ |
| 4330 | get_events(): number; |
| 4331 | /** |
| 4332 | * Returns whether the widget should grab focus when it is clicked with the mouse. |
| 4333 | * See gtk_widget_set_focus_on_click(). |
| 4334 | * @returns %TRUE if the widget should grab focus when it is clicked with the mouse. |
| 4335 | */ |
| 4336 | get_focus_on_click(): boolean; |
| 4337 | /** |
| 4338 | * Gets the font map that has been set with gtk_widget_set_font_map(). |
| 4339 | * @returns A #PangoFontMap, or %NULL |
| 4340 | */ |
| 4341 | get_font_map(): Pango.FontMap | null; |
| 4342 | /** |
| 4343 | * Returns the #cairo_font_options_t used for Pango rendering. When not set, |
| 4344 | * the defaults font options for the #GdkScreen will be used. |
| 4345 | * @returns the #cairo_font_options_t or %NULL if not set |
| 4346 | */ |
| 4347 | get_font_options(): cairo.FontOptions | null; |
| 4348 | /** |
| 4349 | * Obtains the frame clock for a widget. The frame clock is a global |
| 4350 | * “ticker” that can be used to drive animations and repaints. The |
| 4351 | * most common reason to get the frame clock is to call |
| 4352 | * gdk_frame_clock_get_frame_time(), in order to get a time to use for |
| 4353 | * animating. For example you might record the start of the animation |
| 4354 | * with an initial value from gdk_frame_clock_get_frame_time(), and |
| 4355 | * then update the animation by calling |
| 4356 | * gdk_frame_clock_get_frame_time() again during each repaint. |
| 4357 | * |
| 4358 | * gdk_frame_clock_request_phase() will result in a new frame on the |
| 4359 | * clock, but won’t necessarily repaint any widgets. To repaint a |
| 4360 | * widget, you have to use gtk_widget_queue_draw() which invalidates |
| 4361 | * the widget (thus scheduling it to receive a draw on the next |
| 4362 | * frame). gtk_widget_queue_draw() will also end up requesting a frame |
| 4363 | * on the appropriate frame clock. |
| 4364 | * |
| 4365 | * A widget’s frame clock will not change while the widget is |
| 4366 | * mapped. Reparenting a widget (which implies a temporary unmap) can |
| 4367 | * change the widget’s frame clock. |
| 4368 | * |
| 4369 | * Unrealized widgets do not have a frame clock. |
| 4370 | * @returns a #GdkFrameClock, or %NULL if widget is unrealized |
| 4371 | */ |
| 4372 | get_frame_clock(): Gdk.FrameClock | null; |
| 4373 | /** |
| 4374 | * Gets the value of the #GtkWidget:halign property. |
| 4375 | * |
| 4376 | * For backwards compatibility reasons this method will never return |
| 4377 | * %GTK_ALIGN_BASELINE, but instead it will convert it to |
| 4378 | * %GTK_ALIGN_FILL. Baselines are not supported for horizontal |
| 4379 | * alignment. |
| 4380 | * @returns the horizontal alignment of @widget |
| 4381 | */ |
| 4382 | get_halign(): Gtk.Align; |
| 4383 | /** |
| 4384 | * Returns the current value of the has-tooltip property. See |
| 4385 | * #GtkWidget:has-tooltip for more information. |
| 4386 | * @returns current value of has-tooltip on @widget. |
| 4387 | */ |
| 4388 | get_has_tooltip(): boolean; |
| 4389 | /** |
| 4390 | * Determines whether `widget` has a #GdkWindow of its own. See |
| 4391 | * gtk_widget_set_has_window(). |
| 4392 | * @returns %TRUE if @widget has a window, %FALSE otherwise |
| 4393 | */ |
| 4394 | get_has_window(): boolean; |
| 4395 | /** |
| 4396 | * Gets whether the widget would like any available extra horizontal |
| 4397 | * space. When a user resizes a #GtkWindow, widgets with expand=TRUE |
| 4398 | * generally receive the extra space. For example, a list or |
| 4399 | * scrollable area or document in your window would often be set to |
| 4400 | * expand. |
| 4401 | * |
| 4402 | * Containers should use gtk_widget_compute_expand() rather than |
| 4403 | * this function, to see whether a widget, or any of its children, |
| 4404 | * has the expand flag set. If any child of a widget wants to |
| 4405 | * expand, the parent may ask to expand also. |
| 4406 | * |
| 4407 | * This function only looks at the widget’s own hexpand flag, rather |
| 4408 | * than computing whether the entire widget tree rooted at this widget |
| 4409 | * wants to expand. |
| 4410 | * @returns whether hexpand flag is set |
| 4411 | */ |
| 4412 | get_hexpand(): boolean; |
| 4413 | /** |
| 4414 | * Gets whether gtk_widget_set_hexpand() has been used to |
| 4415 | * explicitly set the expand flag on this widget. |
| 4416 | * |
| 4417 | * If hexpand is set, then it overrides any computed |
| 4418 | * expand value based on child widgets. If hexpand is not |
| 4419 | * set, then the expand value depends on whether any |
| 4420 | * children of the widget would like to expand. |
| 4421 | * |
| 4422 | * There are few reasons to use this function, but it’s here |
| 4423 | * for completeness and consistency. |
| 4424 | * @returns whether hexpand has been explicitly set |
| 4425 | */ |
| 4426 | get_hexpand_set(): boolean; |
| 4427 | /** |
| 4428 | * Whether the widget is mapped. |
| 4429 | * @returns %TRUE if the widget is mapped, %FALSE otherwise. |
| 4430 | */ |
| 4431 | get_mapped(): boolean; |
| 4432 | /** |
| 4433 | * Gets the value of the #GtkWidget:margin-bottom property. |
| 4434 | * @returns The bottom margin of @widget |
| 4435 | */ |
| 4436 | get_margin_bottom(): number; |
| 4437 | /** |
| 4438 | * Gets the value of the #GtkWidget:margin-end property. |
| 4439 | * @returns The end margin of @widget |
| 4440 | */ |
| 4441 | get_margin_end(): number; |
| 4442 | /** |
| 4443 | * Gets the value of the #GtkWidget:margin-left property. |
| 4444 | * @returns The left margin of @widget |
| 4445 | */ |
| 4446 | get_margin_left(): number; |
| 4447 | /** |
| 4448 | * Gets the value of the #GtkWidget:margin-right property. |
| 4449 | * @returns The right margin of @widget |
| 4450 | */ |
| 4451 | get_margin_right(): number; |
| 4452 | /** |
| 4453 | * Gets the value of the #GtkWidget:margin-start property. |
| 4454 | * @returns The start margin of @widget |
| 4455 | */ |
| 4456 | get_margin_start(): number; |
| 4457 | /** |
| 4458 | * Gets the value of the #GtkWidget:margin-top property. |
| 4459 | * @returns The top margin of @widget |
| 4460 | */ |
| 4461 | get_margin_top(): number; |
| 4462 | /** |
| 4463 | * Returns the modifier mask the `widget’`s windowing system backend |
| 4464 | * uses for a particular purpose. |
| 4465 | * |
| 4466 | * See gdk_keymap_get_modifier_mask(). |
| 4467 | * @param intent the use case for the modifier mask |
| 4468 | * @returns the modifier mask used for @intent. |
| 4469 | */ |
| 4470 | get_modifier_mask(intent: Gdk.ModifierIntent | null): Gdk.ModifierType; |
| 4471 | /** |
| 4472 | * Returns the current modifier style for the widget. (As set by |
| 4473 | * gtk_widget_modify_style().) If no style has previously set, a new |
| 4474 | * #GtkRcStyle will be created with all values unset, and set as the |
| 4475 | * modifier style for the widget. If you make changes to this rc |
| 4476 | * style, you must call gtk_widget_modify_style(), passing in the |
| 4477 | * returned rc style, to make sure that your changes take effect. |
| 4478 | * |
| 4479 | * Caution: passing the style back to gtk_widget_modify_style() will |
| 4480 | * normally end up destroying it, because gtk_widget_modify_style() copies |
| 4481 | * the passed-in style and sets the copy as the new modifier style, |
| 4482 | * thus dropping any reference to the old modifier style. Add a reference |
| 4483 | * to the modifier style if you want to keep it alive. |
| 4484 | * @returns the modifier style for the widget. This rc style is owned by the widget. If you want to keep a pointer to value this around, you must add a refcount using g_object_ref(). |
| 4485 | */ |
| 4486 | get_modifier_style(): Gtk.RcStyle; |
| 4487 | /** |
| 4488 | * Retrieves the name of a widget. See gtk_widget_set_name() for the |
| 4489 | * significance of widget names. |
| 4490 | * @returns name of the widget. This string is owned by GTK+ and should not be modified or freed |
| 4491 | */ |
| 4492 | get_name(): string; |
| 4493 | /** |
| 4494 | * Returns the current value of the #GtkWidget:no-show-all property, |
| 4495 | * which determines whether calls to gtk_widget_show_all() |
| 4496 | * will affect this widget. |
| 4497 | * @returns the current value of the “no-show-all” property. |
| 4498 | */ |
| 4499 | get_no_show_all(): boolean; |
| 4500 | /** |
| 4501 | * Fetches the requested opacity for this widget. |
| 4502 | * See gtk_widget_set_opacity(). |
| 4503 | * @returns the requested opacity for this widget. |
| 4504 | */ |
| 4505 | get_opacity(): number; |
| 4506 | /** |
| 4507 | * Gets a #PangoContext with the appropriate font map, font description, |
| 4508 | * and base direction for this widget. Unlike the context returned |
| 4509 | * by gtk_widget_create_pango_context(), this context is owned by |
| 4510 | * the widget (it can be used until the screen for the widget changes |
| 4511 | * or the widget is removed from its toplevel), and will be updated to |
| 4512 | * match any changes to the widget’s attributes. This can be tracked |
| 4513 | * by using the #GtkWidget::screen-changed signal on the widget. |
| 4514 | * @returns the #PangoContext for the widget. |
| 4515 | */ |
| 4516 | get_pango_context(): Pango.Context; |
| 4517 | /** |
| 4518 | * Returns the parent container of `widget`. |
| 4519 | * @returns the parent container of @widget, or %NULL |
| 4520 | */ |
| 4521 | get_parent(): Gtk.Widget | null; |
| 4522 | /** |
| 4523 | * Gets `widget’`s parent window, or %NULL if it does not have one. |
| 4524 | * @returns the parent window of @widget, or %NULL if it does not have a parent window. |
| 4525 | */ |
| 4526 | get_parent_window(): Gdk.Window | null; |
| 4527 | /** |
| 4528 | * Returns the #GtkWidgetPath representing `widget,` if the widget |
| 4529 | * is not connected to a toplevel widget, a partial path will be |
| 4530 | * created. |
| 4531 | * @returns The #GtkWidgetPath representing @widget |
| 4532 | */ |
| 4533 | get_path(): Gtk.WidgetPath; |
| 4534 | /** |
| 4535 | * Obtains the location of the mouse pointer in widget coordinates. |
| 4536 | * Widget coordinates are a bit odd; for historical reasons, they are |
| 4537 | * defined as `widget->`window coordinates for widgets that return %TRUE for |
| 4538 | * gtk_widget_get_has_window(); and are relative to `widget->`allocation.x, |
| 4539 | * `widget->`allocation.y otherwise. |
| 4540 | */ |
| 4541 | get_pointer(): [number, number]; |
| 4542 | /** |
| 4543 | * Retrieves a widget’s initial minimum and natural height. |
| 4544 | * |
| 4545 | * This call is specific to width-for-height requests. |
| 4546 | * |
| 4547 | * The returned request will be modified by the |
| 4548 | * GtkWidgetClass::adjust_size_request virtual method and by any |
| 4549 | * #GtkSizeGroups that have been applied. That is, the returned request |
| 4550 | * is the one that should be used for layout, not necessarily the one |
| 4551 | * returned by the widget itself. |
| 4552 | */ |
| 4553 | get_preferred_height(): [number, number]; |
| 4554 | /** |
| 4555 | * Retrieves a widget’s minimum and natural height and the corresponding baselines if it would be given |
| 4556 | * the specified `width,` or the default height if `width` is -1. The baselines may be -1 which means |
| 4557 | * that no baseline is requested for this widget. |
| 4558 | * |
| 4559 | * The returned request will be modified by the |
| 4560 | * GtkWidgetClass::adjust_size_request and GtkWidgetClass::adjust_baseline_request virtual methods |
| 4561 | * and by any #GtkSizeGroups that have been applied. That is, the returned request |
| 4562 | * is the one that should be used for layout, not necessarily the one |
| 4563 | * returned by the widget itself. |
| 4564 | * @param width the width which is available for allocation, or -1 if none |
| 4565 | */ |
| 4566 | get_preferred_height_and_baseline_for_width(width: number): [number, number, number, number]; |
| 4567 | /** |
| 4568 | * Retrieves a widget’s minimum and natural height if it would be given |
| 4569 | * the specified `width`. |
| 4570 | * |
| 4571 | * The returned request will be modified by the |
| 4572 | * GtkWidgetClass::adjust_size_request virtual method and by any |
| 4573 | * #GtkSizeGroups that have been applied. That is, the returned request |
| 4574 | * is the one that should be used for layout, not necessarily the one |
| 4575 | * returned by the widget itself. |
| 4576 | * @param width the width which is available for allocation |
| 4577 | */ |
| 4578 | get_preferred_height_for_width(width: number): [number, number]; |
| 4579 | /** |
| 4580 | * Retrieves the minimum and natural size of a widget, taking |
| 4581 | * into account the widget’s preference for height-for-width management. |
| 4582 | * |
| 4583 | * This is used to retrieve a suitable size by container widgets which do |
| 4584 | * not impose any restrictions on the child placement. It can be used |
| 4585 | * to deduce toplevel window and menu sizes as well as child widgets in |
| 4586 | * free-form containers such as GtkLayout. |
| 4587 | * |
| 4588 | * Handle with care. Note that the natural height of a height-for-width |
| 4589 | * widget will generally be a smaller size than the minimum height, since the required |
| 4590 | * height for the natural width is generally smaller than the required height for |
| 4591 | * the minimum width. |
| 4592 | * |
| 4593 | * Use gtk_widget_get_preferred_height_and_baseline_for_width() if you want to support |
| 4594 | * baseline alignment. |
| 4595 | */ |
| 4596 | get_preferred_size(): [Gtk.Requisition | null, Gtk.Requisition | null]; |
| 4597 | /** |
| 4598 | * Retrieves a widget’s initial minimum and natural width. |
| 4599 | * |
| 4600 | * This call is specific to height-for-width requests. |
| 4601 | * |
| 4602 | * The returned request will be modified by the |
| 4603 | * GtkWidgetClass::adjust_size_request virtual method and by any |
| 4604 | * #GtkSizeGroups that have been applied. That is, the returned request |
| 4605 | * is the one that should be used for layout, not necessarily the one |
| 4606 | * returned by the widget itself. |
| 4607 | */ |
| 4608 | get_preferred_width(): [number, number]; |
| 4609 | /** |
| 4610 | * Retrieves a widget’s minimum and natural width if it would be given |
| 4611 | * the specified `height`. |
| 4612 | * |
| 4613 | * The returned request will be modified by the |
| 4614 | * GtkWidgetClass::adjust_size_request virtual method and by any |
| 4615 | * #GtkSizeGroups that have been applied. That is, the returned request |
| 4616 | * is the one that should be used for layout, not necessarily the one |
| 4617 | * returned by the widget itself. |
| 4618 | * @param height the height which is available for allocation |
| 4619 | */ |
| 4620 | get_preferred_width_for_height(height: number): [number, number]; |
| 4621 | /** |
| 4622 | * Determines whether `widget` is realized. |
| 4623 | * @returns %TRUE if @widget is realized, %FALSE otherwise |
| 4624 | */ |
| 4625 | get_realized(): boolean; |
| 4626 | /** |
| 4627 | * Determines whether `widget` is always treated as the default widget |
| 4628 | * within its toplevel when it has the focus, even if another widget |
| 4629 | * is the default. |
| 4630 | * |
| 4631 | * See gtk_widget_set_receives_default(). |
| 4632 | * @returns %TRUE if @widget acts as the default widget when focused, %FALSE otherwise |
| 4633 | */ |
| 4634 | get_receives_default(): boolean; |
| 4635 | /** |
| 4636 | * Gets whether the widget prefers a height-for-width layout |
| 4637 | * or a width-for-height layout. |
| 4638 | * |
| 4639 | * #GtkBin widgets generally propagate the preference of |
| 4640 | * their child, container widgets need to request something either in |
| 4641 | * context of their children or in context of their allocation |
| 4642 | * capabilities. |
| 4643 | * @returns The #GtkSizeRequestMode preferred by @widget. |
| 4644 | */ |
| 4645 | get_request_mode(): Gtk.SizeRequestMode; |
| 4646 | /** |
| 4647 | * Retrieves the widget’s requisition. |
| 4648 | * |
| 4649 | * This function should only be used by widget implementations in |
| 4650 | * order to figure whether the widget’s requisition has actually |
| 4651 | * changed after some internal state change (so that they can call |
| 4652 | * gtk_widget_queue_resize() instead of gtk_widget_queue_draw()). |
| 4653 | * |
| 4654 | * Normally, gtk_widget_size_request() should be used. |
| 4655 | */ |
| 4656 | get_requisition(): Gtk.Requisition; |
| 4657 | /** |
| 4658 | * Get the root window where this widget is located. This function can |
| 4659 | * only be called after the widget has been added to a widget |
| 4660 | * hierarchy with #GtkWindow at the top. |
| 4661 | * |
| 4662 | * The root window is useful for such purposes as creating a popup |
| 4663 | * #GdkWindow associated with the window. In general, you should only |
| 4664 | * create display specific resources when a widget has been realized, |
| 4665 | * and you should free those resources when the widget is unrealized. |
| 4666 | * @returns the #GdkWindow root window for the toplevel for this widget. |
| 4667 | */ |
| 4668 | get_root_window(): Gdk.Window; |
| 4669 | /** |
| 4670 | * Retrieves the internal scale factor that maps from window coordinates |
| 4671 | * to the actual device pixels. On traditional systems this is 1, on |
| 4672 | * high density outputs, it can be a higher value (typically 2). |
| 4673 | * |
| 4674 | * See gdk_window_get_scale_factor(). |
| 4675 | * @returns the scale factor for @widget |
| 4676 | */ |
| 4677 | get_scale_factor(): number; |
| 4678 | /** |
| 4679 | * Get the #GdkScreen from the toplevel window associated with |
| 4680 | * this widget. This function can only be called after the widget |
| 4681 | * has been added to a widget hierarchy with a #GtkWindow |
| 4682 | * at the top. |
| 4683 | * |
| 4684 | * In general, you should only create screen specific |
| 4685 | * resources when a widget has been realized, and you should |
| 4686 | * free those resources when the widget is unrealized. |
| 4687 | * @returns the #GdkScreen for the toplevel for this widget. |
| 4688 | */ |
| 4689 | get_screen(): Gdk.Screen; |
| 4690 | /** |
| 4691 | * Returns the widget’s sensitivity (in the sense of returning |
| 4692 | * the value that has been set using gtk_widget_set_sensitive()). |
| 4693 | * |
| 4694 | * The effective sensitivity of a widget is however determined by both its |
| 4695 | * own and its parent widget’s sensitivity. See gtk_widget_is_sensitive(). |
| 4696 | * @returns %TRUE if the widget is sensitive |
| 4697 | */ |
| 4698 | get_sensitive(): boolean; |
| 4699 | /** |
| 4700 | * Gets the settings object holding the settings used for this widget. |
| 4701 | * |
| 4702 | * Note that this function can only be called when the #GtkWidget |
| 4703 | * is attached to a toplevel, since the settings object is specific |
| 4704 | * to a particular #GdkScreen. |
| 4705 | * @returns the relevant #GtkSettings object |
| 4706 | */ |
| 4707 | get_settings(): Gtk.Settings; |
| 4708 | /** |
| 4709 | * Gets the size request that was explicitly set for the widget using |
| 4710 | * gtk_widget_set_size_request(). A value of -1 stored in `width` or |
| 4711 | * `height` indicates that that dimension has not been set explicitly |
| 4712 | * and the natural requisition of the widget will be used instead. See |
| 4713 | * gtk_widget_set_size_request(). To get the size a widget will |
| 4714 | * actually request, call gtk_widget_get_preferred_size() instead of |
| 4715 | * this function. |
| 4716 | */ |
| 4717 | get_size_request(): [number, number]; |
| 4718 | /** |
| 4719 | * Returns the widget’s state. See gtk_widget_set_state(). |
| 4720 | * @returns the state of @widget. |
| 4721 | */ |
| 4722 | get_state(): Gtk.StateType; |
| 4723 | /** |
| 4724 | * Returns the widget state as a flag set. It is worth mentioning |
| 4725 | * that the effective %GTK_STATE_FLAG_INSENSITIVE state will be |
| 4726 | * returned, that is, also based on parent insensitivity, even if |
| 4727 | * `widget` itself is sensitive. |
| 4728 | * |
| 4729 | * Also note that if you are looking for a way to obtain the |
| 4730 | * #GtkStateFlags to pass to a #GtkStyleContext method, you |
| 4731 | * should look at gtk_style_context_get_state(). |
| 4732 | * @returns The state flags for widget |
| 4733 | */ |
| 4734 | get_state_flags(): Gtk.StateFlags; |
| 4735 | /** |
| 4736 | * Simply an accessor function that returns `widget->`style. |
| 4737 | * @returns the widget’s #GtkStyle |
| 4738 | */ |
| 4739 | get_style(): Gtk.Style; |
| 4740 | /** |
| 4741 | * Returns the style context associated to `widget`. The returned object is |
| 4742 | * guaranteed to be the same for the lifetime of `widget`. |
| 4743 | * @returns a #GtkStyleContext. This memory is owned by @widget and must not be freed. |
| 4744 | */ |
| 4745 | get_style_context(): Gtk.StyleContext; |
| 4746 | /** |
| 4747 | * Returns %TRUE if `widget` is multiple pointer aware. See |
| 4748 | * gtk_widget_set_support_multidevice() for more information. |
| 4749 | * @returns %TRUE if @widget is multidevice aware. |
| 4750 | */ |
| 4751 | get_support_multidevice(): boolean; |
| 4752 | /** |
| 4753 | * Fetch an object build from the template XML for `widget_type` in this `widget` instance. |
| 4754 | * |
| 4755 | * This will only report children which were previously declared with |
| 4756 | * gtk_widget_class_bind_template_child_full() or one of its |
| 4757 | * variants. |
| 4758 | * |
| 4759 | * This function is only meant to be called for code which is private to the `widget_type` which |
| 4760 | * declared the child and is meant for language bindings which cannot easily make use |
| 4761 | * of the GObject structure offsets. |
| 4762 | * @param widget_type The #GType to get a template child for |
| 4763 | * @param name The “id” of the child defined in the template XML |
| 4764 | * @returns The object built in the template XML with the id @name |
| 4765 | */ |
| 4766 | get_template_child<T = GObject.Object>(widget_type: GObject.GType, name: string): T; |
| 4767 | /** |
| 4768 | * Gets the contents of the tooltip for `widget`. |
| 4769 | * @returns the tooltip text, or %NULL. You should free the returned string with g_free() when done. |
| 4770 | */ |
| 4771 | get_tooltip_markup(): string | null; |
| 4772 | /** |
| 4773 | * Gets the contents of the tooltip for `widget`. |
| 4774 | * @returns the tooltip text, or %NULL. You should free the returned string with g_free() when done. |
| 4775 | */ |
| 4776 | get_tooltip_text(): string | null; |
| 4777 | /** |
| 4778 | * Returns the #GtkWindow of the current tooltip. This can be the |
| 4779 | * GtkWindow created by default, or the custom tooltip window set |
| 4780 | * using gtk_widget_set_tooltip_window(). |
| 4781 | * @returns The #GtkWindow of the current tooltip. |
| 4782 | */ |
| 4783 | get_tooltip_window(): Gtk.Window; |
| 4784 | /** |
| 4785 | * This function returns the topmost widget in the container hierarchy |
| 4786 | * `widget` is a part of. If `widget` has no parent widgets, it will be |
| 4787 | * returned as the topmost widget. No reference will be added to the |
| 4788 | * returned widget; it should not be unreferenced. |
| 4789 | * |
| 4790 | * Note the difference in behavior vs. gtk_widget_get_ancestor(); |
| 4791 | * `gtk_widget_get_ancestor (widget, GTK_TYPE_WINDOW)` |
| 4792 | * would return |
| 4793 | * %NULL if `widget` wasn’t inside a toplevel window, and if the |
| 4794 | * window was inside a #GtkWindow-derived widget which was in turn |
| 4795 | * inside the toplevel #GtkWindow. While the second case may |
| 4796 | * seem unlikely, it actually happens when a #GtkPlug is embedded |
| 4797 | * inside a #GtkSocket within the same application. |
| 4798 | * |
| 4799 | * To reliably find the toplevel #GtkWindow, use |
| 4800 | * gtk_widget_get_toplevel() and call GTK_IS_WINDOW() |
| 4801 | * on the result. For instance, to get the title of a widget's toplevel |
| 4802 | * window, one might use: |
| 4803 | * |
| 4804 | * ```c |
| 4805 | * static const char * |
| 4806 | * get_widget_toplevel_title (GtkWidget *widget) |
| 4807 | * { |
| 4808 | * GtkWidget *toplevel = gtk_widget_get_toplevel (widget); |
| 4809 | * if (GTK_IS_WINDOW (toplevel)) |
| 4810 | * { |
| 4811 | * return gtk_window_get_title (GTK_WINDOW (toplevel)); |
| 4812 | * } |
| 4813 | * |
| 4814 | * return NULL; |
| 4815 | * } |
| 4816 | * ``` |
| 4817 | * |
| 4818 | * @returns the topmost ancestor of @widget, or @widget itself if there’s no ancestor. |
| 4819 | */ |
| 4820 | get_toplevel(): Gtk.Widget; |
| 4821 | /** |
| 4822 | * Gets the value of the #GtkWidget:valign property. |
| 4823 | * |
| 4824 | * For backwards compatibility reasons this method will never return |
| 4825 | * %GTK_ALIGN_BASELINE, but instead it will convert it to |
| 4826 | * %GTK_ALIGN_FILL. If your widget want to support baseline aligned |
| 4827 | * children it must use gtk_widget_get_valign_with_baseline(), or |
| 4828 | * `g_object_get (widget, "valign", &value, NULL)`, which will |
| 4829 | * also report the true value. |
| 4830 | * @returns the vertical alignment of @widget, ignoring baseline alignment |
| 4831 | */ |
| 4832 | get_valign(): Gtk.Align; |
| 4833 | /** |
| 4834 | * Gets the value of the #GtkWidget:valign property, including |
| 4835 | * %GTK_ALIGN_BASELINE. |
| 4836 | * @returns the vertical alignment of @widget |
| 4837 | */ |
| 4838 | get_valign_with_baseline(): Gtk.Align; |
| 4839 | /** |
| 4840 | * Gets whether the widget would like any available extra vertical |
| 4841 | * space. |
| 4842 | * |
| 4843 | * See gtk_widget_get_hexpand() for more detail. |
| 4844 | * @returns whether vexpand flag is set |
| 4845 | */ |
| 4846 | get_vexpand(): boolean; |
| 4847 | /** |
| 4848 | * Gets whether gtk_widget_set_vexpand() has been used to |
| 4849 | * explicitly set the expand flag on this widget. |
| 4850 | * |
| 4851 | * See gtk_widget_get_hexpand_set() for more detail. |
| 4852 | * @returns whether vexpand has been explicitly set |
| 4853 | */ |
| 4854 | get_vexpand_set(): boolean; |
| 4855 | /** |
| 4856 | * Determines whether the widget is visible. If you want to |
| 4857 | * take into account whether the widget’s parent is also marked as |
| 4858 | * visible, use gtk_widget_is_visible() instead. |
| 4859 | * |
| 4860 | * This function does not check if the widget is obscured in any way. |
| 4861 | * |
| 4862 | * See gtk_widget_set_visible(). |
| 4863 | * @returns %TRUE if the widget is visible |
| 4864 | */ |
| 4865 | get_visible(): boolean; |
| 4866 | /** |
| 4867 | * Gets the visual that will be used to render `widget`. |
| 4868 | * @returns the visual for @widget |
| 4869 | */ |
| 4870 | get_visual(): Gdk.Visual; |
| 4871 | /** |
| 4872 | * Returns the widget’s window if it is realized, %NULL otherwise |
| 4873 | * @returns @widget’s window. |
| 4874 | */ |
| 4875 | get_window(): Gdk.Window | null; |
| 4876 | /** |
| 4877 | * Makes `widget` the current grabbed widget. |
| 4878 | * |
| 4879 | * This means that interaction with other widgets in the same |
| 4880 | * application is blocked and mouse as well as keyboard events |
| 4881 | * are delivered to this widget. |
| 4882 | * |
| 4883 | * If `widget` is not sensitive, it is not set as the current |
| 4884 | * grabbed widget and this function does nothing. |
| 4885 | */ |
| 4886 | grab_add(): void; |
| 4887 | /** |
| 4888 | * Causes `widget` to become the default widget. `widget` must be able to be |
| 4889 | * a default widget; typically you would ensure this yourself |
| 4890 | * by calling gtk_widget_set_can_default() with a %TRUE value. |
| 4891 | * The default widget is activated when |
| 4892 | * the user presses Enter in a window. Default widgets must be |
| 4893 | * activatable, that is, gtk_widget_activate() should affect them. Note |
| 4894 | * that #GtkEntry widgets require the “activates-default” property |
| 4895 | * set to %TRUE before they activate the default widget when Enter |
| 4896 | * is pressed and the #GtkEntry is focused. |
| 4897 | */ |
| 4898 | grab_default(): void; |
| 4899 | /** |
| 4900 | * Causes `widget` to have the keyboard focus for the #GtkWindow it's |
| 4901 | * inside. `widget` must be a focusable widget, such as a #GtkEntry; |
| 4902 | * something like #GtkFrame won’t work. |
| 4903 | * |
| 4904 | * More precisely, it must have the %GTK_CAN_FOCUS flag set. Use |
| 4905 | * gtk_widget_set_can_focus() to modify that flag. |
| 4906 | * |
| 4907 | * The widget also needs to be realized and mapped. This is indicated by the |
| 4908 | * related signals. Grabbing the focus immediately after creating the widget |
| 4909 | * will likely fail and cause critical warnings. |
| 4910 | */ |
| 4911 | grab_focus(): void; |
| 4912 | /** |
| 4913 | * Removes the grab from the given widget. |
| 4914 | * |
| 4915 | * You have to pair calls to gtk_grab_add() and gtk_grab_remove(). |
| 4916 | * |
| 4917 | * If `widget` does not have the grab, this function does nothing. |
| 4918 | */ |
| 4919 | grab_remove(): void; |
| 4920 | /** |
| 4921 | * Determines whether the widget is currently grabbing events, so it |
| 4922 | * is the only widget receiving input events (keyboard and mouse). |
| 4923 | * |
| 4924 | * See also gtk_grab_add(). |
| 4925 | * @returns %TRUE if the widget is in the grab_widgets stack |
| 4926 | */ |
| 4927 | has_grab(): boolean; |
| 4928 | /** |
| 4929 | * Determines if the widget style has been looked up through the rc mechanism. |
| 4930 | * @returns %TRUE if the widget has been looked up through the rc mechanism, %FALSE otherwise. |
| 4931 | */ |
| 4932 | has_rc_style(): boolean; |
| 4933 | /** |
| 4934 | * Checks whether there is a #GdkScreen is associated with |
| 4935 | * this widget. All toplevel widgets have an associated |
| 4936 | * screen, and all widgets added into a hierarchy with a toplevel |
| 4937 | * window at the top. |
| 4938 | * @returns %TRUE if there is a #GdkScreen associated with the widget. |
| 4939 | */ |
| 4940 | has_screen(): boolean; |
| 4941 | /** |
| 4942 | * Determines if the widget should show a visible indication that |
| 4943 | * it has the global input focus. This is a convenience function for |
| 4944 | * use in ::draw handlers that takes into account whether focus |
| 4945 | * indication should currently be shown in the toplevel window of |
| 4946 | * `widget`. See gtk_window_get_focus_visible() for more information |
| 4947 | * about focus indication. |
| 4948 | * |
| 4949 | * To find out if the widget has the global input focus, use |
| 4950 | * gtk_widget_has_focus(). |
| 4951 | * @returns %TRUE if the widget should display a “focus rectangle” |
| 4952 | */ |
| 4953 | has_visible_focus(): boolean; |
| 4954 | /** |
| 4955 | * Reverses the effects of gtk_widget_show(), causing the widget to be |
| 4956 | * hidden (invisible to the user). |
| 4957 | */ |
| 4958 | hide(): void; |
| 4959 | /** |
| 4960 | * Utility function; intended to be connected to the #GtkWidget::delete-event |
| 4961 | * signal on a #GtkWindow. The function calls gtk_widget_hide() on its |
| 4962 | * argument, then returns %TRUE. If connected to ::delete-event, the |
| 4963 | * result is that clicking the close button for a window (on the |
| 4964 | * window frame, top right corner usually) will hide but not destroy |
| 4965 | * the window. By default, GTK+ destroys windows when ::delete-event |
| 4966 | * is received. |
| 4967 | * @returns %TRUE |
| 4968 | */ |
| 4969 | hide_on_delete(): boolean; |
| 4970 | /** |
| 4971 | * Returns whether the widget is currently being destroyed. |
| 4972 | * This information can sometimes be used to avoid doing |
| 4973 | * unnecessary work. |
| 4974 | * @returns %TRUE if @widget is being destroyed |
| 4975 | */ |
| 4976 | in_destruction(): boolean; |
| 4977 | /** |
| 4978 | * Creates and initializes child widgets defined in templates. This |
| 4979 | * function must be called in the instance initializer for any |
| 4980 | * class which assigned itself a template using gtk_widget_class_set_template() |
| 4981 | * |
| 4982 | * It is important to call this function in the instance initializer |
| 4983 | * of a #GtkWidget subclass and not in #GObject.constructed() or |
| 4984 | * #GObject.constructor() for two reasons. |
| 4985 | * |
| 4986 | * One reason is that generally derived widgets will assume that parent |
| 4987 | * class composite widgets have been created in their instance |
| 4988 | * initializers. |
| 4989 | * |
| 4990 | * Another reason is that when calling g_object_new() on a widget with |
| 4991 | * composite templates, it’s important to build the composite widgets |
| 4992 | * before the construct properties are set. Properties passed to g_object_new() |
| 4993 | * should take precedence over properties set in the private template XML. |
| 4994 | */ |
| 4995 | init_template(): void; |
| 4996 | /** |
| 4997 | * Sets an input shape for this widget’s GDK window. This allows for |
| 4998 | * windows which react to mouse click in a nonrectangular region, see |
| 4999 | * gdk_window_input_shape_combine_region() for more information. |
| 5000 | * @param region shape to be added, or %NULL to remove an existing shape |
| 5001 | */ |
| 5002 | input_shape_combine_region(region?: cairo.Region | null): void; |
| 5003 | /** |
| 5004 | * Inserts `group` into `widget`. Children of `widget` that implement |
| 5005 | * #GtkActionable can then be associated with actions in `group` by |
| 5006 | * setting their “action-name” to |
| 5007 | * `prefix`.`action-name`. |
| 5008 | * |
| 5009 | * If `group` is %NULL, a previously inserted group for `name` is removed |
| 5010 | * from `widget`. |
| 5011 | * @param name the prefix for actions in @group |
| 5012 | * @param group a #GActionGroup, or %NULL |
| 5013 | */ |
| 5014 | insert_action_group(name: string, group?: Gio.ActionGroup | null): void; |
| 5015 | /** |
| 5016 | * Computes the intersection of a `widget’`s area and `area,` storing |
| 5017 | * the intersection in `intersection,` and returns %TRUE if there was |
| 5018 | * an intersection. `intersection` may be %NULL if you’re only |
| 5019 | * interested in whether there was an intersection. |
| 5020 | * @param area a rectangle |
| 5021 | * @returns %TRUE if there was an intersection |
| 5022 | */ |
| 5023 | intersect(area: Gdk.Rectangle): [boolean, Gdk.Rectangle | null]; |
| 5024 | /** |
| 5025 | * Determines whether `widget` is somewhere inside `ancestor,` possibly with |
| 5026 | * intermediate containers. |
| 5027 | * @param ancestor another #GtkWidget |
| 5028 | * @returns %TRUE if @ancestor contains @widget as a child, grandchild, great grandchild, etc. |
| 5029 | */ |
| 5030 | is_ancestor(ancestor: Gtk.Widget): boolean; |
| 5031 | /** |
| 5032 | * Whether `widget` can rely on having its alpha channel |
| 5033 | * drawn correctly. On X11 this function returns whether a |
| 5034 | * compositing manager is running for `widget’`s screen. |
| 5035 | * |
| 5036 | * Please note that the semantics of this call will change |
| 5037 | * in the future if used on a widget that has a composited |
| 5038 | * window in its hierarchy (as set by gdk_window_set_composited()). |
| 5039 | * @returns %TRUE if the widget can rely on its alpha channel being drawn correctly. |
| 5040 | */ |
| 5041 | is_composited(): boolean; |
| 5042 | /** |
| 5043 | * Determines whether `widget` can be drawn to. A widget can be drawn |
| 5044 | * to if it is mapped and visible. |
| 5045 | * @returns %TRUE if @widget is drawable, %FALSE otherwise |
| 5046 | */ |
| 5047 | is_drawable(): boolean; |
| 5048 | /** |
| 5049 | * Returns the widget’s effective sensitivity, which means |
| 5050 | * it is sensitive itself and also its parent widget is sensitive |
| 5051 | * @returns %TRUE if the widget is effectively sensitive |
| 5052 | */ |
| 5053 | is_sensitive(): boolean; |
| 5054 | /** |
| 5055 | * Determines whether `widget` is a toplevel widget. |
| 5056 | * |
| 5057 | * Currently only #GtkWindow and #GtkInvisible (and out-of-process |
| 5058 | * #GtkPlugs) are toplevel widgets. Toplevel widgets have no parent |
| 5059 | * widget. |
| 5060 | * @returns %TRUE if @widget is a toplevel, %FALSE otherwise |
| 5061 | */ |
| 5062 | is_toplevel(): boolean; |
| 5063 | /** |
| 5064 | * Determines whether the widget and all its parents are marked as |
| 5065 | * visible. |
| 5066 | * |
| 5067 | * This function does not check if the widget is obscured in any way. |
| 5068 | * |
| 5069 | * See also gtk_widget_get_visible() and gtk_widget_set_visible() |
| 5070 | * @returns %TRUE if the widget and all its parents are visible |
| 5071 | */ |
| 5072 | is_visible(): boolean; |
| 5073 | /** |
| 5074 | * This function should be called whenever keyboard navigation within |
| 5075 | * a single widget hits a boundary. The function emits the |
| 5076 | * #GtkWidget::keynav-failed signal on the widget and its return |
| 5077 | * value should be interpreted in a way similar to the return value of |
| 5078 | * gtk_widget_child_focus(): |
| 5079 | * |
| 5080 | * When %TRUE is returned, stay in the widget, the failed keyboard |
| 5081 | * navigation is OK and/or there is nowhere we can/should move the |
| 5082 | * focus to. |
| 5083 | * |
| 5084 | * When %FALSE is returned, the caller should continue with keyboard |
| 5085 | * navigation outside the widget, e.g. by calling |
| 5086 | * gtk_widget_child_focus() on the widget’s toplevel. |
| 5087 | * |
| 5088 | * The default ::keynav-failed handler returns %FALSE for |
| 5089 | * %GTK_DIR_TAB_FORWARD and %GTK_DIR_TAB_BACKWARD. For the other |
| 5090 | * values of #GtkDirectionType it returns %TRUE. |
| 5091 | * |
| 5092 | * Whenever the default handler returns %TRUE, it also calls |
| 5093 | * gtk_widget_error_bell() to notify the user of the failed keyboard |
| 5094 | * navigation. |
| 5095 | * |
| 5096 | * A use case for providing an own implementation of ::keynav-failed |
| 5097 | * (either by connecting to it or by overriding it) would be a row of |
| 5098 | * #GtkEntry widgets where the user should be able to navigate the |
| 5099 | * entire row with the cursor keys, as e.g. known from user interfaces |
| 5100 | * that require entering license keys. |
| 5101 | * @param direction direction of focus movement |
| 5102 | * @returns %TRUE if stopping keyboard navigation is fine, %FALSE if the emitting widget should try to handle the keyboard navigation attempt in its parent container(s). |
| 5103 | */ |
| 5104 | keynav_failed(direction: Gtk.DirectionType | null): boolean; |
| 5105 | /** |
| 5106 | * Lists the closures used by `widget` for accelerator group connections |
| 5107 | * with gtk_accel_group_connect_by_path() or gtk_accel_group_connect(). |
| 5108 | * The closures can be used to monitor accelerator changes on `widget,` |
| 5109 | * by connecting to the `GtkAccelGroup:`:accel-changed signal of the |
| 5110 | * #GtkAccelGroup of a closure which can be found out with |
| 5111 | * gtk_accel_group_from_accel_closure(). |
| 5112 | * @returns a newly allocated #GList of closures |
| 5113 | */ |
| 5114 | list_accel_closures(): GObject.Closure[]; |
| 5115 | /** |
| 5116 | * Retrieves a %NULL-terminated array of strings containing the prefixes of |
| 5117 | * #GActionGroup's available to `widget`. |
| 5118 | * @returns a %NULL-terminated array of strings. |
| 5119 | */ |
| 5120 | list_action_prefixes(): string[]; |
| 5121 | /** |
| 5122 | * Returns a newly allocated list of the widgets, normally labels, for |
| 5123 | * which this widget is the target of a mnemonic (see for example, |
| 5124 | * gtk_label_set_mnemonic_widget()). |
| 5125 | * |
| 5126 | * The widgets in the list are not individually referenced. If you |
| 5127 | * want to iterate through the list and perform actions involving |
| 5128 | * callbacks that might destroy the widgets, you |
| 5129 | * must call `g_list_foreach (result, |
| 5130 | * (GFunc)g_object_ref, NULL)` first, and then unref all the |
| 5131 | * widgets afterwards. |
| 5132 | * @returns the list of mnemonic labels; free this list with g_list_free() when you are done with it. |
| 5133 | */ |
| 5134 | list_mnemonic_labels(): Gtk.Widget[]; |
| 5135 | /** |
| 5136 | * This function is only for use in widget implementations. Causes |
| 5137 | * a widget to be mapped if it isn’t already. |
| 5138 | */ |
| 5139 | map(): void; |
| 5140 | /** |
| 5141 | * Emits the #GtkWidget::mnemonic-activate signal. |
| 5142 | * @param group_cycling %TRUE if there are other widgets with the same mnemonic |
| 5143 | * @returns %TRUE if the signal has been handled |
| 5144 | */ |
| 5145 | mnemonic_activate(group_cycling: boolean): boolean; |
| 5146 | /** |
| 5147 | * Sets the base color for a widget in a particular state. |
| 5148 | * All other style values are left untouched. The base color |
| 5149 | * is the background color used along with the text color |
| 5150 | * (see gtk_widget_modify_text()) for widgets such as #GtkEntry |
| 5151 | * and #GtkTextView. See also gtk_widget_modify_style(). |
| 5152 | * |
| 5153 | * > Note that “no window” widgets (which have the %GTK_NO_WINDOW |
| 5154 | * > flag set) draw on their parent container’s window and thus may |
| 5155 | * > not draw any background themselves. This is the case for e.g. |
| 5156 | * > #GtkLabel. |
| 5157 | * > |
| 5158 | * > To modify the background of such widgets, you have to set the |
| 5159 | * > base color on their parent; if you want to set the background |
| 5160 | * > of a rectangular area around a label, try placing the label in |
| 5161 | * > a #GtkEventBox widget and setting the base color on that. |
| 5162 | * @param state the state for which to set the base color |
| 5163 | * @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_base(). |
| 5164 | */ |
| 5165 | modify_base(state: Gtk.StateType | null, color?: Gdk.Color | null): void; |
| 5166 | /** |
| 5167 | * Sets the background color for a widget in a particular state. |
| 5168 | * |
| 5169 | * All other style values are left untouched. |
| 5170 | * See also gtk_widget_modify_style(). |
| 5171 | * |
| 5172 | * > Note that “no window” widgets (which have the %GTK_NO_WINDOW |
| 5173 | * > flag set) draw on their parent container’s window and thus may |
| 5174 | * > not draw any background themselves. This is the case for e.g. |
| 5175 | * > #GtkLabel. |
| 5176 | * > |
| 5177 | * > To modify the background of such widgets, you have to set the |
| 5178 | * > background color on their parent; if you want to set the background |
| 5179 | * > of a rectangular area around a label, try placing the label in |
| 5180 | * > a #GtkEventBox widget and setting the background color on that. |
| 5181 | * @param state the state for which to set the background color |
| 5182 | * @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_bg(). |
| 5183 | */ |
| 5184 | modify_bg(state: Gtk.StateType | null, color?: Gdk.Color | null): void; |
| 5185 | /** |
| 5186 | * Sets the cursor color to use in a widget, overriding the #GtkWidget |
| 5187 | * cursor-color and secondary-cursor-color |
| 5188 | * style properties. |
| 5189 | * |
| 5190 | * All other style values are left untouched. |
| 5191 | * See also gtk_widget_modify_style(). |
| 5192 | * @param primary the color to use for primary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_cursor(). |
| 5193 | * @param secondary the color to use for secondary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_cursor(). |
| 5194 | */ |
| 5195 | modify_cursor(primary?: Gdk.Color | null, secondary?: Gdk.Color | null): void; |
| 5196 | /** |
| 5197 | * Sets the foreground color for a widget in a particular state. |
| 5198 | * |
| 5199 | * All other style values are left untouched. |
| 5200 | * See also gtk_widget_modify_style(). |
| 5201 | * @param state the state for which to set the foreground color |
| 5202 | * @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_fg(). |
| 5203 | */ |
| 5204 | modify_fg(state: Gtk.StateType | null, color?: Gdk.Color | null): void; |
| 5205 | /** |
| 5206 | * Sets the font to use for a widget. |
| 5207 | * |
| 5208 | * All other style values are left untouched. |
| 5209 | * See also gtk_widget_modify_style(). |
| 5210 | * @param font_desc the font description to use, or %NULL to undo the effect of previous calls to gtk_widget_modify_font() |
| 5211 | */ |
| 5212 | modify_font(font_desc?: Pango.FontDescription | null): void; |
| 5213 | /** |
| 5214 | * Modifies style values on the widget. |
| 5215 | * |
| 5216 | * Modifications made using this technique take precedence over |
| 5217 | * style values set via an RC file, however, they will be overridden |
| 5218 | * if a style is explicitly set on the widget using gtk_widget_set_style(). |
| 5219 | * The #GtkRcStyle-struct is designed so each field can either be |
| 5220 | * set or unset, so it is possible, using this function, to modify some |
| 5221 | * style values and leave the others unchanged. |
| 5222 | * |
| 5223 | * Note that modifications made with this function are not cumulative |
| 5224 | * with previous calls to gtk_widget_modify_style() or with such |
| 5225 | * functions as gtk_widget_modify_fg(). If you wish to retain |
| 5226 | * previous values, you must first call gtk_widget_get_modifier_style(), |
| 5227 | * make your modifications to the returned style, then call |
| 5228 | * gtk_widget_modify_style() with that style. On the other hand, |
| 5229 | * if you first call gtk_widget_modify_style(), subsequent calls |
| 5230 | * to such functions gtk_widget_modify_fg() will have a cumulative |
| 5231 | * effect with the initial modifications. |
| 5232 | * @param style the #GtkRcStyle-struct holding the style modifications |
| 5233 | */ |
| 5234 | modify_style(style: Gtk.RcStyle): void; |
| 5235 | /** |
| 5236 | * Sets the text color for a widget in a particular state. |
| 5237 | * |
| 5238 | * All other style values are left untouched. |
| 5239 | * The text color is the foreground color used along with the |
| 5240 | * base color (see gtk_widget_modify_base()) for widgets such |
| 5241 | * as #GtkEntry and #GtkTextView. |
| 5242 | * See also gtk_widget_modify_style(). |
| 5243 | * @param state the state for which to set the text color |
| 5244 | * @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_text(). |
| 5245 | */ |
| 5246 | modify_text(state: Gtk.StateType | null, color?: Gdk.Color | null): void; |
| 5247 | /** |
| 5248 | * Sets the background color to use for a widget. |
| 5249 | * |
| 5250 | * All other style values are left untouched. |
| 5251 | * See gtk_widget_override_color(). |
| 5252 | * @param state the state for which to set the background color |
| 5253 | * @param color the color to assign, or %NULL to undo the effect of previous calls to gtk_widget_override_background_color() |
| 5254 | */ |
| 5255 | override_background_color(state: Gtk.StateFlags | null, color?: Gdk.RGBA | null): void; |
| 5256 | /** |
| 5257 | * Sets the color to use for a widget. |
| 5258 | * |
| 5259 | * All other style values are left untouched. |
| 5260 | * |
| 5261 | * This function does not act recursively. Setting the color of a |
| 5262 | * container does not affect its children. Note that some widgets that |
| 5263 | * you may not think of as containers, for instance #GtkButtons, |
| 5264 | * are actually containers. |
| 5265 | * |
| 5266 | * This API is mostly meant as a quick way for applications to |
| 5267 | * change a widget appearance. If you are developing a widgets |
| 5268 | * library and intend this change to be themeable, it is better |
| 5269 | * done by setting meaningful CSS classes in your |
| 5270 | * widget/container implementation through gtk_style_context_add_class(). |
| 5271 | * |
| 5272 | * This way, your widget library can install a #GtkCssProvider |
| 5273 | * with the %GTK_STYLE_PROVIDER_PRIORITY_FALLBACK priority in order |
| 5274 | * to provide a default styling for those widgets that need so, and |
| 5275 | * this theming may fully overridden by the user’s theme. |
| 5276 | * |
| 5277 | * Note that for complex widgets this may bring in undesired |
| 5278 | * results (such as uniform background color everywhere), in |
| 5279 | * these cases it is better to fully style such widgets through a |
| 5280 | * #GtkCssProvider with the %GTK_STYLE_PROVIDER_PRIORITY_APPLICATION |
| 5281 | * priority. |
| 5282 | * @param state the state for which to set the color |
| 5283 | * @param color the color to assign, or %NULL to undo the effect of previous calls to gtk_widget_override_color() |
| 5284 | */ |
| 5285 | override_color(state: Gtk.StateFlags | null, color?: Gdk.RGBA | null): void; |
| 5286 | /** |
| 5287 | * Sets the cursor color to use in a widget, overriding the |
| 5288 | * cursor-color and secondary-cursor-color |
| 5289 | * style properties. All other style values are left untouched. |
| 5290 | * See also gtk_widget_modify_style(). |
| 5291 | * |
| 5292 | * Note that the underlying properties have the #GdkColor type, |
| 5293 | * so the alpha value in `primary` and `secondary` will be ignored. |
| 5294 | * @param cursor the color to use for primary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_override_cursor(). |
| 5295 | * @param secondary_cursor the color to use for secondary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_override_cursor(). |
| 5296 | */ |
| 5297 | override_cursor(cursor?: Gdk.RGBA | null, secondary_cursor?: Gdk.RGBA | null): void; |
| 5298 | /** |
| 5299 | * Sets the font to use for a widget. All other style values are |
| 5300 | * left untouched. See gtk_widget_override_color(). |
| 5301 | * @param font_desc the font description to use, or %NULL to undo the effect of previous calls to gtk_widget_override_font() |
| 5302 | */ |
| 5303 | override_font(font_desc?: Pango.FontDescription | null): void; |
| 5304 | /** |
| 5305 | * Sets a symbolic color for a widget. |
| 5306 | * |
| 5307 | * All other style values are left untouched. |
| 5308 | * See gtk_widget_override_color() for overriding the foreground |
| 5309 | * or background color. |
| 5310 | * @param name the name of the symbolic color to modify |
| 5311 | * @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to gtk_widget_override_symbolic_color() |
| 5312 | */ |
| 5313 | override_symbolic_color(name: string, color?: Gdk.RGBA | null): void; |
| 5314 | /** |
| 5315 | * Obtains the full path to `widget`. The path is simply the name of a |
| 5316 | * widget and all its parents in the container hierarchy, separated by |
| 5317 | * periods. The name of a widget comes from |
| 5318 | * gtk_widget_get_name(). Paths are used to apply styles to a widget |
| 5319 | * in gtkrc configuration files. Widget names are the type of the |
| 5320 | * widget by default (e.g. “GtkButton”) or can be set to an |
| 5321 | * application-specific value with gtk_widget_set_name(). By setting |
| 5322 | * the name of a widget, you allow users or theme authors to apply |
| 5323 | * styles to that specific widget in their gtkrc |
| 5324 | * file. `path_reversed_p` fills in the path in reverse order, |
| 5325 | * i.e. starting with `widget’`s name instead of starting with the name |
| 5326 | * of `widget’`s outermost ancestor. |
| 5327 | */ |
| 5328 | path(): [number, string, string]; |
| 5329 | /** |
| 5330 | * This function is only for use in widget implementations. |
| 5331 | * |
| 5332 | * Flags the widget for a rerun of the GtkWidgetClass::size_allocate |
| 5333 | * function. Use this function instead of gtk_widget_queue_resize() |
| 5334 | * when the `widget'`s size request didn't change but it wants to |
| 5335 | * reposition its contents. |
| 5336 | * |
| 5337 | * An example user of this function is gtk_widget_set_halign(). |
| 5338 | */ |
| 5339 | queue_allocate(): void; |
| 5340 | /** |
| 5341 | * Mark `widget` as needing to recompute its expand flags. Call |
| 5342 | * this function when setting legacy expand child properties |
| 5343 | * on the child of a container. |
| 5344 | * |
| 5345 | * See gtk_widget_compute_expand(). |
| 5346 | */ |
| 5347 | queue_compute_expand(): void; |
| 5348 | /** |
| 5349 | * Equivalent to calling gtk_widget_queue_draw_area() for the |
| 5350 | * entire area of a widget. |
| 5351 | */ |
| 5352 | queue_draw(): void; |
| 5353 | /** |
| 5354 | * Convenience function that calls gtk_widget_queue_draw_region() on |
| 5355 | * the region created from the given coordinates. |
| 5356 | * |
| 5357 | * The region here is specified in widget coordinates. |
| 5358 | * Widget coordinates are a bit odd; for historical reasons, they are |
| 5359 | * defined as `widget->`window coordinates for widgets that return %TRUE for |
| 5360 | * gtk_widget_get_has_window(), and are relative to `widget->`allocation.x, |
| 5361 | * `widget->`allocation.y otherwise. |
| 5362 | * |
| 5363 | * `width` or `height` may be 0, in this case this function does |
| 5364 | * nothing. Negative values for `width` and `height` are not allowed. |
| 5365 | * @param x x coordinate of upper-left corner of rectangle to redraw |
| 5366 | * @param y y coordinate of upper-left corner of rectangle to redraw |
| 5367 | * @param width width of region to draw |
| 5368 | * @param height height of region to draw |
| 5369 | */ |
| 5370 | queue_draw_area(x: number, y: number, width: number, height: number): void; |
| 5371 | /** |
| 5372 | * Invalidates the area of `widget` defined by `region` by calling |
| 5373 | * gdk_window_invalidate_region() on the widget’s window and all its |
| 5374 | * child windows. Once the main loop becomes idle (after the current |
| 5375 | * batch of events has been processed, roughly), the window will |
| 5376 | * receive expose events for the union of all regions that have been |
| 5377 | * invalidated. |
| 5378 | * |
| 5379 | * Normally you would only use this function in widget |
| 5380 | * implementations. You might also use it to schedule a redraw of a |
| 5381 | * #GtkDrawingArea or some portion thereof. |
| 5382 | * @param region region to draw |
| 5383 | */ |
| 5384 | queue_draw_region(region: cairo.Region): void; |
| 5385 | /** |
| 5386 | * This function is only for use in widget implementations. |
| 5387 | * Flags a widget to have its size renegotiated; should |
| 5388 | * be called when a widget for some reason has a new size request. |
| 5389 | * For example, when you change the text in a #GtkLabel, #GtkLabel |
| 5390 | * queues a resize to ensure there’s enough space for the new text. |
| 5391 | * |
| 5392 | * Note that you cannot call gtk_widget_queue_resize() on a widget |
| 5393 | * from inside its implementation of the GtkWidgetClass::size_allocate |
| 5394 | * virtual method. Calls to gtk_widget_queue_resize() from inside |
| 5395 | * GtkWidgetClass::size_allocate will be silently ignored. |
| 5396 | */ |
| 5397 | queue_resize(): void; |
| 5398 | /** |
| 5399 | * This function works like gtk_widget_queue_resize(), |
| 5400 | * except that the widget is not invalidated. |
| 5401 | */ |
| 5402 | queue_resize_no_redraw(): void; |
| 5403 | /** |
| 5404 | * Creates the GDK (windowing system) resources associated with a |
| 5405 | * widget. For example, `widget->`window will be created when a widget |
| 5406 | * is realized. Normally realization happens implicitly; if you show |
| 5407 | * a widget and all its parent containers, then the widget will be |
| 5408 | * realized and mapped automatically. |
| 5409 | * |
| 5410 | * Realizing a widget requires all |
| 5411 | * the widget’s parent widgets to be realized; calling |
| 5412 | * gtk_widget_realize() realizes the widget’s parents in addition to |
| 5413 | * `widget` itself. If a widget is not yet inside a toplevel window |
| 5414 | * when you realize it, bad things will happen. |
| 5415 | * |
| 5416 | * This function is primarily used in widget implementations, and |
| 5417 | * isn’t very useful otherwise. Many times when you think you might |
| 5418 | * need it, a better approach is to connect to a signal that will be |
| 5419 | * called after the widget is realized automatically, such as |
| 5420 | * #GtkWidget::draw. Or simply g_signal_connect () to the |
| 5421 | * #GtkWidget::realize signal. |
| 5422 | */ |
| 5423 | realize(): void; |
| 5424 | /** |
| 5425 | * Computes the intersection of a `widget’`s area and `region,` returning |
| 5426 | * the intersection. The result may be empty, use cairo_region_is_empty() to |
| 5427 | * check. |
| 5428 | * @param region a #cairo_region_t, in the same coordinate system as @widget->allocation. That is, relative to @widget->window for widgets which return %FALSE from gtk_widget_get_has_window(); relative to the parent window of @widget->window otherwise. |
| 5429 | * @returns A newly allocated region holding the intersection of @widget and @region. |
| 5430 | */ |
| 5431 | region_intersect(region: cairo.Region): cairo.Region; |
| 5432 | /** |
| 5433 | * Registers a #GdkWindow with the widget and sets it up so that |
| 5434 | * the widget receives events for it. Call gtk_widget_unregister_window() |
| 5435 | * when destroying the window. |
| 5436 | * |
| 5437 | * Before 3.8 you needed to call gdk_window_set_user_data() directly to set |
| 5438 | * this up. This is now deprecated and you should use gtk_widget_register_window() |
| 5439 | * instead. Old code will keep working as is, although some new features like |
| 5440 | * transparency might not work perfectly. |
| 5441 | * @param window a #GdkWindow |
| 5442 | */ |
| 5443 | register_window(window: Gdk.Window): void; |
| 5444 | /** |
| 5445 | * Removes an accelerator from `widget,` previously installed with |
| 5446 | * gtk_widget_add_accelerator(). |
| 5447 | * @param accel_group accel group for this widget |
| 5448 | * @param accel_key GDK keyval of the accelerator |
| 5449 | * @param accel_mods modifier key combination of the accelerator |
| 5450 | * @returns whether an accelerator was installed and could be removed |
| 5451 | */ |
| 5452 | remove_accelerator( |
| 5453 | accel_group: Gtk.AccelGroup, |
| 5454 | accel_key: number, |
| 5455 | accel_mods: Gdk.ModifierType | null, |
| 5456 | ): boolean; |
| 5457 | /** |
| 5458 | * Removes a widget from the list of mnemonic labels for |
| 5459 | * this widget. (See gtk_widget_list_mnemonic_labels()). The widget |
| 5460 | * must have previously been added to the list with |
| 5461 | * gtk_widget_add_mnemonic_label(). |
| 5462 | * @param label a #GtkWidget that was previously set as a mnemonic label for @widget with gtk_widget_add_mnemonic_label(). |
| 5463 | */ |
| 5464 | remove_mnemonic_label(label: Gtk.Widget): void; |
| 5465 | /** |
| 5466 | * Removes a tick callback previously registered with |
| 5467 | * gtk_widget_add_tick_callback(). |
| 5468 | * @param id an id returned by gtk_widget_add_tick_callback() |
| 5469 | */ |
| 5470 | remove_tick_callback(id: number): void; |
| 5471 | /** |
| 5472 | * A convenience function that uses the theme settings for `widget` |
| 5473 | * to look up `stock_id` and render it to a pixbuf. `stock_id` should |
| 5474 | * be a stock icon ID such as #GTK_STOCK_OPEN or #GTK_STOCK_OK. `size` |
| 5475 | * should be a size such as #GTK_ICON_SIZE_MENU. `detail` should be a |
| 5476 | * string that identifies the widget or code doing the rendering, so |
| 5477 | * that theme engines can special-case rendering for that widget or |
| 5478 | * code. |
| 5479 | * |
| 5480 | * The pixels in the returned #GdkPixbuf are shared with the rest of |
| 5481 | * the application and should not be modified. The pixbuf should be |
| 5482 | * freed after use with g_object_unref(). |
| 5483 | * @param stock_id a stock ID |
| 5484 | * @param size a stock size (#GtkIconSize). A size of `(GtkIconSize)-1` means render at the size of the source and don’t scale (if there are multiple source sizes, GTK+ picks one of the available sizes). |
| 5485 | * @param detail render detail to pass to theme engine |
| 5486 | * @returns a new pixbuf, or %NULL if the stock ID wasn’t known |
| 5487 | */ |
| 5488 | render_icon(stock_id: string, size: number, detail?: string | null): GdkPixbuf.Pixbuf | null; |
| 5489 | /** |
| 5490 | * A convenience function that uses the theme engine and style |
| 5491 | * settings for `widget` to look up `stock_id` and render it to |
| 5492 | * a pixbuf. `stock_id` should be a stock icon ID such as |
| 5493 | * #GTK_STOCK_OPEN or #GTK_STOCK_OK. `size` should be a size |
| 5494 | * such as #GTK_ICON_SIZE_MENU. |
| 5495 | * |
| 5496 | * The pixels in the returned #GdkPixbuf are shared with the rest of |
| 5497 | * the application and should not be modified. The pixbuf should be freed |
| 5498 | * after use with g_object_unref(). |
| 5499 | * @param stock_id a stock ID |
| 5500 | * @param size a stock size (#GtkIconSize). A size of `(GtkIconSize)-1` means render at the size of the source and don’t scale (if there are multiple source sizes, GTK+ picks one of the available sizes). |
| 5501 | * @returns a new pixbuf, or %NULL if the stock ID wasn’t known |
| 5502 | */ |
| 5503 | render_icon_pixbuf(stock_id: string, size: number): GdkPixbuf.Pixbuf | null; |
| 5504 | /** |
| 5505 | * Moves a widget from one #GtkContainer to another, handling reference |
| 5506 | * count issues to avoid destroying the widget. |
| 5507 | * @param new_parent a #GtkContainer to move the widget into |
| 5508 | */ |
| 5509 | reparent(new_parent: Gtk.Widget): void; |
| 5510 | /** |
| 5511 | * Reset the styles of `widget` and all descendents, so when |
| 5512 | * they are looked up again, they get the correct values |
| 5513 | * for the currently loaded RC file settings. |
| 5514 | * |
| 5515 | * This function is not useful for applications. |
| 5516 | */ |
| 5517 | reset_rc_styles(): void; |
| 5518 | /** |
| 5519 | * Updates the style context of `widget` and all descendants |
| 5520 | * by updating its widget path. #GtkContainers may want |
| 5521 | * to use this on a child when reordering it in a way that a different |
| 5522 | * style might apply to it. See also gtk_container_get_path_for_child(). |
| 5523 | */ |
| 5524 | reset_style(): void; |
| 5525 | /** |
| 5526 | * Very rarely-used function. This function is used to emit |
| 5527 | * an expose event on a widget. This function is not normally used |
| 5528 | * directly. The only time it is used is when propagating an expose |
| 5529 | * event to a windowless child widget (gtk_widget_get_has_window() is %FALSE), |
| 5530 | * and that is normally done using gtk_container_propagate_draw(). |
| 5531 | * |
| 5532 | * If you want to force an area of a window to be redrawn, |
| 5533 | * use gdk_window_invalidate_rect() or gdk_window_invalidate_region(). |
| 5534 | * To cause the redraw to be done immediately, follow that call |
| 5535 | * with a call to gdk_window_process_updates(). |
| 5536 | * @param event a expose #GdkEvent |
| 5537 | * @returns return from the event signal emission (%TRUE if the event was handled) |
| 5538 | */ |
| 5539 | send_expose(event: Gdk.Event): number; |
| 5540 | /** |
| 5541 | * Sends the focus change `event` to `widget` |
| 5542 | * |
| 5543 | * This function is not meant to be used by applications. The only time it |
| 5544 | * should be used is when it is necessary for a #GtkWidget to assign focus |
| 5545 | * to a widget that is semantically owned by the first widget even though |
| 5546 | * it’s not a direct child - for instance, a search entry in a floating |
| 5547 | * window similar to the quick search in #GtkTreeView. |
| 5548 | * |
| 5549 | * An example of its usage is: |
| 5550 | * |
| 5551 | * |
| 5552 | * ```c |
| 5553 | * GdkEvent *fevent = gdk_event_new (GDK_FOCUS_CHANGE); |
| 5554 | * |
| 5555 | * fevent->focus_change.type = GDK_FOCUS_CHANGE; |
| 5556 | * fevent->focus_change.in = TRUE; |
| 5557 | * fevent->focus_change.window = _gtk_widget_get_window (widget); |
| 5558 | * if (fevent->focus_change.window != NULL) |
| 5559 | * g_object_ref (fevent->focus_change.window); |
| 5560 | * |
| 5561 | * gtk_widget_send_focus_change (widget, fevent); |
| 5562 | * |
| 5563 | * gdk_event_free (event); |
| 5564 | * ``` |
| 5565 | * |
| 5566 | * @param event a #GdkEvent of type GDK_FOCUS_CHANGE |
| 5567 | * @returns the return value from the event signal emission: %TRUE if the event was handled, and %FALSE otherwise |
| 5568 | */ |
| 5569 | send_focus_change(event: Gdk.Event): boolean; |
| 5570 | /** |
| 5571 | * Given an accelerator group, `accel_group,` and an accelerator path, |
| 5572 | * `accel_path,` sets up an accelerator in `accel_group` so whenever the |
| 5573 | * key binding that is defined for `accel_path` is pressed, `widget` |
| 5574 | * will be activated. This removes any accelerators (for any |
| 5575 | * accelerator group) installed by previous calls to |
| 5576 | * gtk_widget_set_accel_path(). Associating accelerators with |
| 5577 | * paths allows them to be modified by the user and the modifications |
| 5578 | * to be saved for future use. (See gtk_accel_map_save().) |
| 5579 | * |
| 5580 | * This function is a low level function that would most likely |
| 5581 | * be used by a menu creation system like #GtkUIManager. If you |
| 5582 | * use #GtkUIManager, setting up accelerator paths will be done |
| 5583 | * automatically. |
| 5584 | * |
| 5585 | * Even when you you aren’t using #GtkUIManager, if you only want to |
| 5586 | * set up accelerators on menu items gtk_menu_item_set_accel_path() |
| 5587 | * provides a somewhat more convenient interface. |
| 5588 | * |
| 5589 | * Note that `accel_path` string will be stored in a #GQuark. Therefore, if you |
| 5590 | * pass a static string, you can save some memory by interning it first with |
| 5591 | * g_intern_static_string(). |
| 5592 | * @param accel_path path used to look up the accelerator |
| 5593 | * @param accel_group a #GtkAccelGroup. |
| 5594 | */ |
| 5595 | set_accel_path(accel_path?: string | null, accel_group?: Gtk.AccelGroup | null): void; |
| 5596 | /** |
| 5597 | * Sets the widget’s allocation. This should not be used |
| 5598 | * directly, but from within a widget’s size_allocate method. |
| 5599 | * |
| 5600 | * The allocation set should be the “adjusted” or actual |
| 5601 | * allocation. If you’re implementing a #GtkContainer, you want to use |
| 5602 | * gtk_widget_size_allocate() instead of gtk_widget_set_allocation(). |
| 5603 | * The GtkWidgetClass::adjust_size_allocation virtual method adjusts the |
| 5604 | * allocation inside gtk_widget_size_allocate() to create an adjusted |
| 5605 | * allocation. |
| 5606 | * @param allocation a pointer to a #GtkAllocation to copy from |
| 5607 | */ |
| 5608 | set_allocation(allocation: Gtk.Allocation): void; |
| 5609 | /** |
| 5610 | * Sets whether the application intends to draw on the widget in |
| 5611 | * an #GtkWidget::draw handler. |
| 5612 | * |
| 5613 | * This is a hint to the widget and does not affect the behavior of |
| 5614 | * the GTK+ core; many widgets ignore this flag entirely. For widgets |
| 5615 | * that do pay attention to the flag, such as #GtkEventBox and #GtkWindow, |
| 5616 | * the effect is to suppress default themed drawing of the widget's |
| 5617 | * background. (Children of the widget will still be drawn.) The application |
| 5618 | * is then entirely responsible for drawing the widget background. |
| 5619 | * |
| 5620 | * Note that the background is still drawn when the widget is mapped. |
| 5621 | * @param app_paintable %TRUE if the application will paint on the widget |
| 5622 | */ |
| 5623 | set_app_paintable(app_paintable: boolean): void; |
| 5624 | /** |
| 5625 | * Specifies whether `widget` can be a default widget. See |
| 5626 | * gtk_widget_grab_default() for details about the meaning of |
| 5627 | * “default”. |
| 5628 | * @param can_default whether or not @widget can be a default widget. |
| 5629 | */ |
| 5630 | set_can_default(can_default: boolean): void; |
| 5631 | /** |
| 5632 | * Specifies whether `widget` can own the input focus. See |
| 5633 | * gtk_widget_grab_focus() for actually setting the input focus on a |
| 5634 | * widget. |
| 5635 | * @param can_focus whether or not @widget can own the input focus. |
| 5636 | */ |
| 5637 | set_can_focus(can_focus: boolean): void; |
| 5638 | /** |
| 5639 | * Sets whether `widget` should be mapped along with its when its parent |
| 5640 | * is mapped and `widget` has been shown with gtk_widget_show(). |
| 5641 | * |
| 5642 | * The child visibility can be set for widget before it is added to |
| 5643 | * a container with gtk_widget_set_parent(), to avoid mapping |
| 5644 | * children unnecessary before immediately unmapping them. However |
| 5645 | * it will be reset to its default state of %TRUE when the widget |
| 5646 | * is removed from a container. |
| 5647 | * |
| 5648 | * Note that changing the child visibility of a widget does not |
| 5649 | * queue a resize on the widget. Most of the time, the size of |
| 5650 | * a widget is computed from all visible children, whether or |
| 5651 | * not they are mapped. If this is not the case, the container |
| 5652 | * can queue a resize itself. |
| 5653 | * |
| 5654 | * This function is only useful for container implementations and |
| 5655 | * never should be called by an application. |
| 5656 | * @param is_visible if %TRUE, @widget should be mapped along with its parent. |
| 5657 | */ |
| 5658 | set_child_visible(is_visible: boolean): void; |
| 5659 | /** |
| 5660 | * Sets the widget’s clip. This must not be used directly, |
| 5661 | * but from within a widget’s size_allocate method. |
| 5662 | * It must be called after gtk_widget_set_allocation() (or after chaining up |
| 5663 | * to the parent class), because that function resets the clip. |
| 5664 | * |
| 5665 | * The clip set should be the area that `widget` draws on. If `widget` is a |
| 5666 | * #GtkContainer, the area must contain all children's clips. |
| 5667 | * |
| 5668 | * If this function is not called by `widget` during a ::size-allocate handler, |
| 5669 | * the clip will be set to `widget'`s allocation. |
| 5670 | * @param clip a pointer to a #GtkAllocation to copy from |
| 5671 | */ |
| 5672 | set_clip(clip: Gtk.Allocation): void; |
| 5673 | /** |
| 5674 | * Sets a widgets composite name. The widget must be |
| 5675 | * a composite child of its parent; see gtk_widget_push_composite_child(). |
| 5676 | * @param name the name to set |
| 5677 | */ |
| 5678 | set_composite_name(name: string): void; |
| 5679 | /** |
| 5680 | * Enables or disables a #GdkDevice to interact with `widget` |
| 5681 | * and all its children. |
| 5682 | * |
| 5683 | * It does so by descending through the #GdkWindow hierarchy |
| 5684 | * and enabling the same mask that is has for core events |
| 5685 | * (i.e. the one that gdk_window_get_events() returns). |
| 5686 | * @param device a #GdkDevice |
| 5687 | * @param enabled whether to enable the device |
| 5688 | */ |
| 5689 | set_device_enabled(device: Gdk.Device, enabled: boolean): void; |
| 5690 | /** |
| 5691 | * Sets the device event mask (see #GdkEventMask) for a widget. The event |
| 5692 | * mask determines which events a widget will receive from `device`. Keep |
| 5693 | * in mind that different widgets have different default event masks, and by |
| 5694 | * changing the event mask you may disrupt a widget’s functionality, |
| 5695 | * so be careful. This function must be called while a widget is |
| 5696 | * unrealized. Consider gtk_widget_add_device_events() for widgets that are |
| 5697 | * already realized, or if you want to preserve the existing event |
| 5698 | * mask. This function can’t be used with windowless widgets (which return |
| 5699 | * %FALSE from gtk_widget_get_has_window()); |
| 5700 | * to get events on those widgets, place them inside a #GtkEventBox |
| 5701 | * and receive events on the event box. |
| 5702 | * @param device a #GdkDevice |
| 5703 | * @param events event mask |
| 5704 | */ |
| 5705 | set_device_events(device: Gdk.Device, events: Gdk.EventMask | null): void; |
| 5706 | /** |
| 5707 | * Sets the reading direction on a particular widget. This direction |
| 5708 | * controls the primary direction for widgets containing text, |
| 5709 | * and also the direction in which the children of a container are |
| 5710 | * packed. The ability to set the direction is present in order |
| 5711 | * so that correct localization into languages with right-to-left |
| 5712 | * reading directions can be done. Generally, applications will |
| 5713 | * let the default reading direction present, except for containers |
| 5714 | * where the containers are arranged in an order that is explicitly |
| 5715 | * visual rather than logical (such as buttons for text justification). |
| 5716 | * |
| 5717 | * If the direction is set to %GTK_TEXT_DIR_NONE, then the value |
| 5718 | * set by gtk_widget_set_default_direction() will be used. |
| 5719 | * @param dir the new direction |
| 5720 | */ |
| 5721 | set_direction(dir: Gtk.TextDirection | null): void; |
| 5722 | /** |
| 5723 | * Widgets are double buffered by default; you can use this function |
| 5724 | * to turn off the buffering. “Double buffered” simply means that |
| 5725 | * gdk_window_begin_draw_frame() and gdk_window_end_draw_frame() are called |
| 5726 | * automatically around expose events sent to the |
| 5727 | * widget. gdk_window_begin_draw_frame() diverts all drawing to a widget's |
| 5728 | * window to an offscreen buffer, and gdk_window_end_draw_frame() draws the |
| 5729 | * buffer to the screen. The result is that users see the window |
| 5730 | * update in one smooth step, and don’t see individual graphics |
| 5731 | * primitives being rendered. |
| 5732 | * |
| 5733 | * In very simple terms, double buffered widgets don’t flicker, |
| 5734 | * so you would only use this function to turn off double buffering |
| 5735 | * if you had special needs and really knew what you were doing. |
| 5736 | * |
| 5737 | * Note: if you turn off double-buffering, you have to handle |
| 5738 | * expose events, since even the clearing to the background color or |
| 5739 | * pixmap will not happen automatically (as it is done in |
| 5740 | * gdk_window_begin_draw_frame()). |
| 5741 | * |
| 5742 | * In 3.10 GTK and GDK have been restructured for translucent drawing. Since |
| 5743 | * then expose events for double-buffered widgets are culled into a single |
| 5744 | * event to the toplevel GDK window. If you now unset double buffering, you |
| 5745 | * will cause a separate rendering pass for every widget. This will likely |
| 5746 | * cause rendering problems - in particular related to stacking - and usually |
| 5747 | * increases rendering times significantly. |
| 5748 | * @param double_buffered %TRUE to double-buffer a widget |
| 5749 | */ |
| 5750 | set_double_buffered(double_buffered: boolean): void; |
| 5751 | /** |
| 5752 | * Sets the event mask (see #GdkEventMask) for a widget. The event |
| 5753 | * mask determines which events a widget will receive. Keep in mind |
| 5754 | * that different widgets have different default event masks, and by |
| 5755 | * changing the event mask you may disrupt a widget’s functionality, |
| 5756 | * so be careful. This function must be called while a widget is |
| 5757 | * unrealized. Consider gtk_widget_add_events() for widgets that are |
| 5758 | * already realized, or if you want to preserve the existing event |
| 5759 | * mask. This function can’t be used with widgets that have no window. |
| 5760 | * (See gtk_widget_get_has_window()). To get events on those widgets, |
| 5761 | * place them inside a #GtkEventBox and receive events on the event |
| 5762 | * box. |
| 5763 | * @param events event mask |
| 5764 | */ |
| 5765 | set_events(events: number): void; |
| 5766 | /** |
| 5767 | * Sets whether the widget should grab focus when it is clicked with the mouse. |
| 5768 | * Making mouse clicks not grab focus is useful in places like toolbars where |
| 5769 | * you don’t want the keyboard focus removed from the main area of the |
| 5770 | * application. |
| 5771 | * @param focus_on_click whether the widget should grab focus when clicked with the mouse |
| 5772 | */ |
| 5773 | set_focus_on_click(focus_on_click: boolean): void; |
| 5774 | /** |
| 5775 | * Sets the font map to use for Pango rendering. When not set, the widget |
| 5776 | * will inherit the font map from its parent. |
| 5777 | * @param font_map a #PangoFontMap, or %NULL to unset any previously set font map |
| 5778 | */ |
| 5779 | set_font_map(font_map?: Pango.FontMap | null): void; |
| 5780 | /** |
| 5781 | * Sets the #cairo_font_options_t used for Pango rendering in this widget. |
| 5782 | * When not set, the default font options for the #GdkScreen will be used. |
| 5783 | * @param options a #cairo_font_options_t, or %NULL to unset any previously set default font options. |
| 5784 | */ |
| 5785 | set_font_options(options?: cairo.FontOptions | null): void; |
| 5786 | /** |
| 5787 | * Sets the horizontal alignment of `widget`. |
| 5788 | * See the #GtkWidget:halign property. |
| 5789 | * @param align the horizontal alignment |
| 5790 | */ |
| 5791 | set_halign(align: Gtk.Align | null): void; |
| 5792 | /** |
| 5793 | * Sets the has-tooltip property on `widget` to `has_tooltip`. See |
| 5794 | * #GtkWidget:has-tooltip for more information. |
| 5795 | * @param has_tooltip whether or not @widget has a tooltip. |
| 5796 | */ |
| 5797 | set_has_tooltip(has_tooltip: boolean): void; |
| 5798 | /** |
| 5799 | * Specifies whether `widget` has a #GdkWindow of its own. Note that |
| 5800 | * all realized widgets have a non-%NULL “window” pointer |
| 5801 | * (gtk_widget_get_window() never returns a %NULL window when a widget |
| 5802 | * is realized), but for many of them it’s actually the #GdkWindow of |
| 5803 | * one of its parent widgets. Widgets that do not create a %window for |
| 5804 | * themselves in #GtkWidget::realize must announce this by |
| 5805 | * calling this function with `has_window` = %FALSE. |
| 5806 | * |
| 5807 | * This function should only be called by widget implementations, |
| 5808 | * and they should call it in their init() function. |
| 5809 | * @param has_window whether or not @widget has a window. |
| 5810 | */ |
| 5811 | set_has_window(has_window: boolean): void; |
| 5812 | /** |
| 5813 | * Sets whether the widget would like any available extra horizontal |
| 5814 | * space. When a user resizes a #GtkWindow, widgets with expand=TRUE |
| 5815 | * generally receive the extra space. For example, a list or |
| 5816 | * scrollable area or document in your window would often be set to |
| 5817 | * expand. |
| 5818 | * |
| 5819 | * Call this function to set the expand flag if you would like your |
| 5820 | * widget to become larger horizontally when the window has extra |
| 5821 | * room. |
| 5822 | * |
| 5823 | * By default, widgets automatically expand if any of their children |
| 5824 | * want to expand. (To see if a widget will automatically expand given |
| 5825 | * its current children and state, call gtk_widget_compute_expand(). A |
| 5826 | * container can decide how the expandability of children affects the |
| 5827 | * expansion of the container by overriding the compute_expand virtual |
| 5828 | * method on #GtkWidget.). |
| 5829 | * |
| 5830 | * Setting hexpand explicitly with this function will override the |
| 5831 | * automatic expand behavior. |
| 5832 | * |
| 5833 | * This function forces the widget to expand or not to expand, |
| 5834 | * regardless of children. The override occurs because |
| 5835 | * gtk_widget_set_hexpand() sets the hexpand-set property (see |
| 5836 | * gtk_widget_set_hexpand_set()) which causes the widget’s hexpand |
| 5837 | * value to be used, rather than looking at children and widget state. |
| 5838 | * @param expand whether to expand |
| 5839 | */ |
| 5840 | set_hexpand(expand: boolean): void; |
| 5841 | /** |
| 5842 | * Sets whether the hexpand flag (see gtk_widget_get_hexpand()) will |
| 5843 | * be used. |
| 5844 | * |
| 5845 | * The hexpand-set property will be set automatically when you call |
| 5846 | * gtk_widget_set_hexpand() to set hexpand, so the most likely |
| 5847 | * reason to use this function would be to unset an explicit expand |
| 5848 | * flag. |
| 5849 | * |
| 5850 | * If hexpand is set, then it overrides any computed |
| 5851 | * expand value based on child widgets. If hexpand is not |
| 5852 | * set, then the expand value depends on whether any |
| 5853 | * children of the widget would like to expand. |
| 5854 | * |
| 5855 | * There are few reasons to use this function, but it’s here |
| 5856 | * for completeness and consistency. |
| 5857 | * @param set value for hexpand-set property |
| 5858 | */ |
| 5859 | set_hexpand_set(set: boolean): void; |
| 5860 | /** |
| 5861 | * Marks the widget as being mapped. |
| 5862 | * |
| 5863 | * This function should only ever be called in a derived widget's |
| 5864 | * “map” or “unmap” implementation. |
| 5865 | * @param mapped %TRUE to mark the widget as mapped |
| 5866 | */ |
| 5867 | set_mapped(mapped: boolean): void; |
| 5868 | /** |
| 5869 | * Sets the bottom margin of `widget`. |
| 5870 | * See the #GtkWidget:margin-bottom property. |
| 5871 | * @param margin the bottom margin |
| 5872 | */ |
| 5873 | set_margin_bottom(margin: number): void; |
| 5874 | /** |
| 5875 | * Sets the end margin of `widget`. |
| 5876 | * See the #GtkWidget:margin-end property. |
| 5877 | * @param margin the end margin |
| 5878 | */ |
| 5879 | set_margin_end(margin: number): void; |
| 5880 | /** |
| 5881 | * Sets the left margin of `widget`. |
| 5882 | * See the #GtkWidget:margin-left property. |
| 5883 | * @param margin the left margin |
| 5884 | */ |
| 5885 | set_margin_left(margin: number): void; |
| 5886 | /** |
| 5887 | * Sets the right margin of `widget`. |
| 5888 | * See the #GtkWidget:margin-right property. |
| 5889 | * @param margin the right margin |
| 5890 | */ |
| 5891 | set_margin_right(margin: number): void; |
| 5892 | /** |
| 5893 | * Sets the start margin of `widget`. |
| 5894 | * See the #GtkWidget:margin-start property. |
| 5895 | * @param margin the start margin |
| 5896 | */ |
| 5897 | set_margin_start(margin: number): void; |
| 5898 | /** |
| 5899 | * Sets the top margin of `widget`. |
| 5900 | * See the #GtkWidget:margin-top property. |
| 5901 | * @param margin the top margin |
| 5902 | */ |
| 5903 | set_margin_top(margin: number): void; |
| 5904 | /** |
| 5905 | * Widgets can be named, which allows you to refer to them from a |
| 5906 | * CSS file. You can apply a style to widgets with a particular name |
| 5907 | * in the CSS file. See the documentation for the CSS syntax (on the |
| 5908 | * same page as the docs for #GtkStyleContext). |
| 5909 | * |
| 5910 | * Note that the CSS syntax has certain special characters to delimit |
| 5911 | * and represent elements in a selector (period, #, >, *...), so using |
| 5912 | * these will make your widget impossible to match by name. Any combination |
| 5913 | * of alphanumeric symbols, dashes and underscores will suffice. |
| 5914 | * @param name name for the widget |
| 5915 | */ |
| 5916 | set_name(name: string): void; |
| 5917 | /** |
| 5918 | * Sets the #GtkWidget:no-show-all property, which determines whether |
| 5919 | * calls to gtk_widget_show_all() will affect this widget. |
| 5920 | * |
| 5921 | * This is mostly for use in constructing widget hierarchies with externally |
| 5922 | * controlled visibility, see #GtkUIManager. |
| 5923 | * @param no_show_all the new value for the “no-show-all” property |
| 5924 | */ |
| 5925 | set_no_show_all(no_show_all: boolean): void; |
| 5926 | /** |
| 5927 | * Request the `widget` to be rendered partially transparent, |
| 5928 | * with opacity 0 being fully transparent and 1 fully opaque. (Opacity values |
| 5929 | * are clamped to the [0,1] range.). |
| 5930 | * This works on both toplevel widget, and child widgets, although there |
| 5931 | * are some limitations: |
| 5932 | * |
| 5933 | * For toplevel widgets this depends on the capabilities of the windowing |
| 5934 | * system. On X11 this has any effect only on X screens with a compositing manager |
| 5935 | * running. See gtk_widget_is_composited(). On Windows it should work |
| 5936 | * always, although setting a window’s opacity after the window has been |
| 5937 | * shown causes it to flicker once on Windows. |
| 5938 | * |
| 5939 | * For child widgets it doesn’t work if any affected widget has a native window, or |
| 5940 | * disables double buffering. |
| 5941 | * @param opacity desired opacity, between 0 and 1 |
| 5942 | */ |
| 5943 | set_opacity(opacity: number): void; |
| 5944 | /** |
| 5945 | * This function is useful only when implementing subclasses of |
| 5946 | * #GtkContainer. |
| 5947 | * Sets the container as the parent of `widget,` and takes care of |
| 5948 | * some details such as updating the state and style of the child |
| 5949 | * to reflect its new location. The opposite function is |
| 5950 | * gtk_widget_unparent(). |
| 5951 | * @param parent parent container |
| 5952 | */ |
| 5953 | set_parent(parent: Gtk.Widget): void; |
| 5954 | /** |
| 5955 | * Sets a non default parent window for `widget`. |
| 5956 | * |
| 5957 | * For #GtkWindow classes, setting a `parent_window` effects whether |
| 5958 | * the window is a toplevel window or can be embedded into other |
| 5959 | * widgets. |
| 5960 | * |
| 5961 | * For #GtkWindow classes, this needs to be called before the |
| 5962 | * window is realized. |
| 5963 | * @param parent_window the new parent window. |
| 5964 | */ |
| 5965 | set_parent_window(parent_window: Gdk.Window): void; |
| 5966 | /** |
| 5967 | * Marks the widget as being realized. This function must only be |
| 5968 | * called after all #GdkWindows for the `widget` have been created |
| 5969 | * and registered. |
| 5970 | * |
| 5971 | * This function should only ever be called in a derived widget's |
| 5972 | * “realize” or “unrealize” implementation. |
| 5973 | * @param realized %TRUE to mark the widget as realized |
| 5974 | */ |
| 5975 | set_realized(realized: boolean): void; |
| 5976 | /** |
| 5977 | * Specifies whether `widget` will be treated as the default widget |
| 5978 | * within its toplevel when it has the focus, even if another widget |
| 5979 | * is the default. |
| 5980 | * |
| 5981 | * See gtk_widget_grab_default() for details about the meaning of |
| 5982 | * “default”. |
| 5983 | * @param receives_default whether or not @widget can be a default widget. |
| 5984 | */ |
| 5985 | set_receives_default(receives_default: boolean): void; |
| 5986 | /** |
| 5987 | * Sets whether the entire widget is queued for drawing when its size |
| 5988 | * allocation changes. By default, this setting is %TRUE and |
| 5989 | * the entire widget is redrawn on every size change. If your widget |
| 5990 | * leaves the upper left unchanged when made bigger, turning this |
| 5991 | * setting off will improve performance. |
| 5992 | * |
| 5993 | * Note that for widgets where gtk_widget_get_has_window() is %FALSE |
| 5994 | * setting this flag to %FALSE turns off all allocation on resizing: |
| 5995 | * the widget will not even redraw if its position changes; this is to |
| 5996 | * allow containers that don’t draw anything to avoid excess |
| 5997 | * invalidations. If you set this flag on a widget with no window that |
| 5998 | * does draw on `widget->`window, you are |
| 5999 | * responsible for invalidating both the old and new allocation of the |
| 6000 | * widget when the widget is moved and responsible for invalidating |
| 6001 | * regions newly when the widget increases size. |
| 6002 | * @param redraw_on_allocate if %TRUE, the entire widget will be redrawn when it is allocated to a new size. Otherwise, only the new portion of the widget will be redrawn. |
| 6003 | */ |
| 6004 | set_redraw_on_allocate(redraw_on_allocate: boolean): void; |
| 6005 | /** |
| 6006 | * Sets the sensitivity of a widget. A widget is sensitive if the user |
| 6007 | * can interact with it. Insensitive widgets are “grayed out” and the |
| 6008 | * user can’t interact with them. Insensitive widgets are known as |
| 6009 | * “inactive”, “disabled”, or “ghosted” in some other toolkits. |
| 6010 | * @param sensitive %TRUE to make the widget sensitive |
| 6011 | */ |
| 6012 | set_sensitive(sensitive: boolean): void; |
| 6013 | /** |
| 6014 | * Sets the minimum size of a widget; that is, the widget’s size |
| 6015 | * request will be at least `width` by `height`. You can use this |
| 6016 | * function to force a widget to be larger than it normally would be. |
| 6017 | * |
| 6018 | * In most cases, gtk_window_set_default_size() is a better choice for |
| 6019 | * toplevel windows than this function; setting the default size will |
| 6020 | * still allow users to shrink the window. Setting the size request |
| 6021 | * will force them to leave the window at least as large as the size |
| 6022 | * request. When dealing with window sizes, |
| 6023 | * gtk_window_set_geometry_hints() can be a useful function as well. |
| 6024 | * |
| 6025 | * Note the inherent danger of setting any fixed size - themes, |
| 6026 | * translations into other languages, different fonts, and user action |
| 6027 | * can all change the appropriate size for a given widget. So, it's |
| 6028 | * basically impossible to hardcode a size that will always be |
| 6029 | * correct. |
| 6030 | * |
| 6031 | * The size request of a widget is the smallest size a widget can |
| 6032 | * accept while still functioning well and drawing itself correctly. |
| 6033 | * However in some strange cases a widget may be allocated less than |
| 6034 | * its requested size, and in many cases a widget may be allocated more |
| 6035 | * space than it requested. |
| 6036 | * |
| 6037 | * If the size request in a given direction is -1 (unset), then |
| 6038 | * the “natural” size request of the widget will be used instead. |
| 6039 | * |
| 6040 | * The size request set here does not include any margin from the |
| 6041 | * #GtkWidget properties margin-left, margin-right, margin-top, and |
| 6042 | * margin-bottom, but it does include pretty much all other padding |
| 6043 | * or border properties set by any subclass of #GtkWidget. |
| 6044 | * @param width width @widget should request, or -1 to unset |
| 6045 | * @param height height @widget should request, or -1 to unset |
| 6046 | */ |
| 6047 | set_size_request(width: number, height: number): void; |
| 6048 | /** |
| 6049 | * This function is for use in widget implementations. Sets the state |
| 6050 | * of a widget (insensitive, prelighted, etc.) Usually you should set |
| 6051 | * the state using wrapper functions such as gtk_widget_set_sensitive(). |
| 6052 | * @param state new state for @widget |
| 6053 | */ |
| 6054 | set_state(state: Gtk.StateType | null): void; |
| 6055 | /** |
| 6056 | * This function is for use in widget implementations. Turns on flag |
| 6057 | * values in the current widget state (insensitive, prelighted, etc.). |
| 6058 | * |
| 6059 | * This function accepts the values %GTK_STATE_FLAG_DIR_LTR and |
| 6060 | * %GTK_STATE_FLAG_DIR_RTL but ignores them. If you want to set the widget's |
| 6061 | * direction, use gtk_widget_set_direction(). |
| 6062 | * |
| 6063 | * It is worth mentioning that any other state than %GTK_STATE_FLAG_INSENSITIVE, |
| 6064 | * will be propagated down to all non-internal children if `widget` is a |
| 6065 | * #GtkContainer, while %GTK_STATE_FLAG_INSENSITIVE itself will be propagated |
| 6066 | * down to all #GtkContainer children by different means than turning on the |
| 6067 | * state flag down the hierarchy, both gtk_widget_get_state_flags() and |
| 6068 | * gtk_widget_is_sensitive() will make use of these. |
| 6069 | * @param flags State flags to turn on |
| 6070 | * @param clear Whether to clear state before turning on @flags |
| 6071 | */ |
| 6072 | set_state_flags(flags: Gtk.StateFlags | null, clear: boolean): void; |
| 6073 | /** |
| 6074 | * Used to set the #GtkStyle for a widget (`widget->`style). Since |
| 6075 | * GTK 3, this function does nothing, the passed in style is ignored. |
| 6076 | * @param style a #GtkStyle, or %NULL to remove the effect of a previous call to gtk_widget_set_style() and go back to the default style |
| 6077 | */ |
| 6078 | set_style(style?: Gtk.Style | null): void; |
| 6079 | /** |
| 6080 | * Enables or disables multiple pointer awareness. If this setting is %TRUE, |
| 6081 | * `widget` will start receiving multiple, per device enter/leave events. Note |
| 6082 | * that if custom #GdkWindows are created in #GtkWidget::realize, |
| 6083 | * gdk_window_set_support_multidevice() will have to be called manually on them. |
| 6084 | * @param support_multidevice %TRUE to support input from multiple devices. |
| 6085 | */ |
| 6086 | set_support_multidevice(support_multidevice: boolean): void; |
| 6087 | /** |
| 6088 | * Sets `markup` as the contents of the tooltip, which is marked up with |
| 6089 | * the [Pango text markup language][PangoMarkupFormat]. |
| 6090 | * |
| 6091 | * This function will take care of setting #GtkWidget:has-tooltip to %TRUE |
| 6092 | * and of the default handler for the #GtkWidget::query-tooltip signal. |
| 6093 | * |
| 6094 | * See also the #GtkWidget:tooltip-markup property and |
| 6095 | * gtk_tooltip_set_markup(). |
| 6096 | * @param markup the contents of the tooltip for @widget, or %NULL |
| 6097 | */ |
| 6098 | set_tooltip_markup(markup?: string | null): void; |
| 6099 | /** |
| 6100 | * Sets `text` as the contents of the tooltip. This function will take |
| 6101 | * care of setting #GtkWidget:has-tooltip to %TRUE and of the default |
| 6102 | * handler for the #GtkWidget::query-tooltip signal. |
| 6103 | * |
| 6104 | * See also the #GtkWidget:tooltip-text property and gtk_tooltip_set_text(). |
| 6105 | * @param text the contents of the tooltip for @widget |
| 6106 | */ |
| 6107 | set_tooltip_text(text?: string | null): void; |
| 6108 | /** |
| 6109 | * Replaces the default window used for displaying |
| 6110 | * tooltips with `custom_window`. GTK+ will take care of showing and |
| 6111 | * hiding `custom_window` at the right moment, to behave likewise as |
| 6112 | * the default tooltip window. If `custom_window` is %NULL, the default |
| 6113 | * tooltip window will be used. |
| 6114 | * @param custom_window a #GtkWindow, or %NULL |
| 6115 | */ |
| 6116 | set_tooltip_window(custom_window?: Gtk.Window | null): void; |
| 6117 | /** |
| 6118 | * Sets the vertical alignment of `widget`. |
| 6119 | * See the #GtkWidget:valign property. |
| 6120 | * @param align the vertical alignment |
| 6121 | */ |
| 6122 | set_valign(align: Gtk.Align | null): void; |
| 6123 | /** |
| 6124 | * Sets whether the widget would like any available extra vertical |
| 6125 | * space. |
| 6126 | * |
| 6127 | * See gtk_widget_set_hexpand() for more detail. |
| 6128 | * @param expand whether to expand |
| 6129 | */ |
| 6130 | set_vexpand(expand: boolean): void; |
| 6131 | /** |
| 6132 | * Sets whether the vexpand flag (see gtk_widget_get_vexpand()) will |
| 6133 | * be used. |
| 6134 | * |
| 6135 | * See gtk_widget_set_hexpand_set() for more detail. |
| 6136 | * @param set value for vexpand-set property |
| 6137 | */ |
| 6138 | set_vexpand_set(set: boolean): void; |
| 6139 | /** |
| 6140 | * Sets the visibility state of `widget`. Note that setting this to |
| 6141 | * %TRUE doesn’t mean the widget is actually viewable, see |
| 6142 | * gtk_widget_get_visible(). |
| 6143 | * |
| 6144 | * This function simply calls gtk_widget_show() or gtk_widget_hide() |
| 6145 | * but is nicer to use when the visibility of the widget depends on |
| 6146 | * some condition. |
| 6147 | * @param visible whether the widget should be shown or not |
| 6148 | */ |
| 6149 | set_visible(visible: boolean): void; |
| 6150 | /** |
| 6151 | * Sets the visual that should be used for by widget and its children for |
| 6152 | * creating #GdkWindows. The visual must be on the same #GdkScreen as |
| 6153 | * returned by gtk_widget_get_screen(), so handling the |
| 6154 | * #GtkWidget::screen-changed signal is necessary. |
| 6155 | * |
| 6156 | * Setting a new `visual` will not cause `widget` to recreate its windows, |
| 6157 | * so you should call this function before `widget` is realized. |
| 6158 | * @param visual visual to be used or %NULL to unset a previous one |
| 6159 | */ |
| 6160 | set_visual(visual?: Gdk.Visual | null): void; |
| 6161 | /** |
| 6162 | * Sets a widget’s window. This function should only be used in a |
| 6163 | * widget’s #GtkWidget::realize implementation. The %window passed is |
| 6164 | * usually either new window created with gdk_window_new(), or the |
| 6165 | * window of its parent widget as returned by |
| 6166 | * gtk_widget_get_parent_window(). |
| 6167 | * |
| 6168 | * Widgets must indicate whether they will create their own #GdkWindow |
| 6169 | * by calling gtk_widget_set_has_window(). This is usually done in the |
| 6170 | * widget’s init() function. |
| 6171 | * |
| 6172 | * Note that this function does not add any reference to `window`. |
| 6173 | * @param window a #GdkWindow |
| 6174 | */ |
| 6175 | set_window(window: Gdk.Window): void; |
| 6176 | /** |
| 6177 | * Sets a shape for this widget’s GDK window. This allows for |
| 6178 | * transparent windows etc., see gdk_window_shape_combine_region() |
| 6179 | * for more information. |
| 6180 | * @param region shape to be added, or %NULL to remove an existing shape |
| 6181 | */ |
| 6182 | shape_combine_region(region?: cairo.Region | null): void; |
| 6183 | /** |
| 6184 | * Flags a widget to be displayed. Any widget that isn’t shown will |
| 6185 | * not appear on the screen. If you want to show all the widgets in a |
| 6186 | * container, it’s easier to call gtk_widget_show_all() on the |
| 6187 | * container, instead of individually showing the widgets. |
| 6188 | * |
| 6189 | * Remember that you have to show the containers containing a widget, |
| 6190 | * in addition to the widget itself, before it will appear onscreen. |
| 6191 | * |
| 6192 | * When a toplevel container is shown, it is immediately realized and |
| 6193 | * mapped; other shown widgets are realized and mapped when their |
| 6194 | * toplevel container is realized and mapped. |
| 6195 | */ |
| 6196 | show(): void; |
| 6197 | /** |
| 6198 | * Recursively shows a widget, and any child widgets (if the widget is |
| 6199 | * a container). |
| 6200 | */ |
| 6201 | show_all(): void; |
| 6202 | /** |
| 6203 | * Shows a widget. If the widget is an unmapped toplevel widget |
| 6204 | * (i.e. a #GtkWindow that has not yet been shown), enter the main |
| 6205 | * loop and wait for the window to actually be mapped. Be careful; |
| 6206 | * because the main loop is running, anything can happen during |
| 6207 | * this function. |
| 6208 | */ |
| 6209 | show_now(): void; |
| 6210 | /** |
| 6211 | * This function is only used by #GtkContainer subclasses, to assign a size |
| 6212 | * and position to their child widgets. |
| 6213 | * |
| 6214 | * In this function, the allocation may be adjusted. It will be forced |
| 6215 | * to a 1x1 minimum size, and the adjust_size_allocation virtual |
| 6216 | * method on the child will be used to adjust the allocation. Standard |
| 6217 | * adjustments include removing the widget’s margins, and applying the |
| 6218 | * widget’s #GtkWidget:halign and #GtkWidget:valign properties. |
| 6219 | * |
| 6220 | * For baseline support in containers you need to use gtk_widget_size_allocate_with_baseline() |
| 6221 | * instead. |
| 6222 | * @param allocation position and size to be allocated to @widget |
| 6223 | */ |
| 6224 | size_allocate(allocation: Gtk.Allocation): void; |
| 6225 | /** |
| 6226 | * This function is only used by #GtkContainer subclasses, to assign a size, |
| 6227 | * position and (optionally) baseline to their child widgets. |
| 6228 | * |
| 6229 | * In this function, the allocation and baseline may be adjusted. It |
| 6230 | * will be forced to a 1x1 minimum size, and the |
| 6231 | * adjust_size_allocation virtual and adjust_baseline_allocation |
| 6232 | * methods on the child will be used to adjust the allocation and |
| 6233 | * baseline. Standard adjustments include removing the widget's |
| 6234 | * margins, and applying the widget’s #GtkWidget:halign and |
| 6235 | * #GtkWidget:valign properties. |
| 6236 | * |
| 6237 | * If the child widget does not have a valign of %GTK_ALIGN_BASELINE the |
| 6238 | * baseline argument is ignored and -1 is used instead. |
| 6239 | * @param allocation position and size to be allocated to @widget |
| 6240 | * @param baseline The baseline of the child, or -1 |
| 6241 | */ |
| 6242 | size_allocate_with_baseline(allocation: Gtk.Allocation, baseline: number): void; |
| 6243 | /** |
| 6244 | * This function is typically used when implementing a #GtkContainer |
| 6245 | * subclass. Obtains the preferred size of a widget. The container |
| 6246 | * uses this information to arrange its child widgets and decide what |
| 6247 | * size allocations to give them with gtk_widget_size_allocate(). |
| 6248 | * |
| 6249 | * You can also call this function from an application, with some |
| 6250 | * caveats. Most notably, getting a size request requires the widget |
| 6251 | * to be associated with a screen, because font information may be |
| 6252 | * needed. Multihead-aware applications should keep this in mind. |
| 6253 | * |
| 6254 | * Also remember that the size request is not necessarily the size |
| 6255 | * a widget will actually be allocated. |
| 6256 | */ |
| 6257 | size_request(): Gtk.Requisition; |
| 6258 | /** |
| 6259 | * This function attaches the widget’s #GtkStyle to the widget's |
| 6260 | * #GdkWindow. It is a replacement for |
| 6261 | * |
| 6262 | * |
| 6263 | * ``` |
| 6264 | * widget->style = gtk_style_attach (widget->style, widget->window); |
| 6265 | * ``` |
| 6266 | * |
| 6267 | * |
| 6268 | * and should only ever be called in a derived widget’s “realize” |
| 6269 | * implementation which does not chain up to its parent class' |
| 6270 | * “realize” implementation, because one of the parent classes |
| 6271 | * (finally #GtkWidget) would attach the style itself. |
| 6272 | */ |
| 6273 | style_attach(): void; |
| 6274 | /** |
| 6275 | * Gets the value of a style property of `widget`. |
| 6276 | * @param property_name the name of a style property |
| 6277 | * @param value location to return the property value |
| 6278 | */ |
| 6279 | style_get_property(property_name: string, value: GObject.Value | any): void; |
| 6280 | /** |
| 6281 | * Reverts the effect of a previous call to gtk_widget_freeze_child_notify(). |
| 6282 | * This causes all queued #GtkWidget::child-notify signals on `widget` to be |
| 6283 | * emitted. |
| 6284 | */ |
| 6285 | thaw_child_notify(): void; |
| 6286 | /** |
| 6287 | * Translate coordinates relative to `src_widget’`s allocation to coordinates |
| 6288 | * relative to `dest_widget’`s allocations. In order to perform this |
| 6289 | * operation, both widgets must be realized, and must share a common |
| 6290 | * toplevel. |
| 6291 | * @param dest_widget a #GtkWidget |
| 6292 | * @param src_x X position relative to @src_widget |
| 6293 | * @param src_y Y position relative to @src_widget |
| 6294 | * @returns %FALSE if either widget was not realized, or there was no common ancestor. In this case, nothing is stored in *@dest_x and *@dest_y. Otherwise %TRUE. |
| 6295 | */ |
| 6296 | translate_coordinates(dest_widget: Gtk.Widget, src_x: number, src_y: number): [boolean, number, number]; |
| 6297 | /** |
| 6298 | * Triggers a tooltip query on the display where the toplevel of `widget` |
| 6299 | * is located. See gtk_tooltip_trigger_tooltip_query() for more |
| 6300 | * information. |
| 6301 | */ |
| 6302 | trigger_tooltip_query(): void; |
| 6303 | /** |
| 6304 | * This function is only for use in widget implementations. Causes |
| 6305 | * a widget to be unmapped if it’s currently mapped. |
| 6306 | */ |
| 6307 | unmap(): void; |
| 6308 | /** |
| 6309 | * This function is only for use in widget implementations. |
| 6310 | * Should be called by implementations of the remove method |
| 6311 | * on #GtkContainer, to dissociate a child from the container. |
| 6312 | */ |
| 6313 | unparent(): void; |
| 6314 | /** |
| 6315 | * This function is only useful in widget implementations. |
| 6316 | * Causes a widget to be unrealized (frees all GDK resources |
| 6317 | * associated with the widget, such as `widget->`window). |
| 6318 | */ |
| 6319 | unrealize(): void; |
| 6320 | /** |
| 6321 | * Unregisters a #GdkWindow from the widget that was previously set up with |
| 6322 | * gtk_widget_register_window(). You need to call this when the window is |
| 6323 | * no longer used by the widget, such as when you destroy it. |
| 6324 | * @param window a #GdkWindow |
| 6325 | */ |
| 6326 | unregister_window(window: Gdk.Window): void; |
| 6327 | /** |
| 6328 | * This function is for use in widget implementations. Turns off flag |
| 6329 | * values for the current widget state (insensitive, prelighted, etc.). |
| 6330 | * See gtk_widget_set_state_flags(). |
| 6331 | * @param flags State flags to turn off |
| 6332 | */ |
| 6333 | unset_state_flags(flags: Gtk.StateFlags | null): void; |
| 6334 | vfunc_adjust_baseline_allocation(baseline: number): void; |
| 6335 | vfunc_adjust_baseline_request(minimum_baseline: number, natural_baseline: number): void; |
| 6336 | /** |
| 6337 | * Convert an initial size allocation assigned |
| 6338 | * by a #GtkContainer using gtk_widget_size_allocate(), into an actual |
| 6339 | * size allocation to be used by the widget. adjust_size_allocation |
| 6340 | * adjusts to a child widget’s actual allocation |
| 6341 | * from what a parent container computed for the |
| 6342 | * child. The adjusted allocation must be entirely within the original |
| 6343 | * allocation. In any custom implementation, chain up to the default |
| 6344 | * #GtkWidget implementation of this method, which applies the margin |
| 6345 | * and alignment properties of #GtkWidget. Chain up |
| 6346 | * before performing your own adjustments so your |
| 6347 | * own adjustments remove more allocation after the #GtkWidget base |
| 6348 | * class has already removed margin and alignment. The natural size |
| 6349 | * passed in should be adjusted in the same way as the allocated size, |
| 6350 | * which allows adjustments to perform alignments or other changes |
| 6351 | * based on natural size. |
| 6352 | * @param orientation |
| 6353 | * @param minimum_size |
| 6354 | * @param natural_size |
| 6355 | * @param allocated_pos |
| 6356 | * @param allocated_size |
| 6357 | */ |
| 6358 | vfunc_adjust_size_allocation( |
| 6359 | orientation: Gtk.Orientation, |
| 6360 | minimum_size: number, |
| 6361 | natural_size: number, |
| 6362 | allocated_pos: number, |
| 6363 | allocated_size: number, |
| 6364 | ): void; |
| 6365 | /** |
| 6366 | * Convert an initial size request from a widget's |
| 6367 | * #GtkSizeRequestMode virtual method implementations into a size request to |
| 6368 | * be used by parent containers in laying out the widget. |
| 6369 | * adjust_size_request adjusts from a child widget's |
| 6370 | * original request to what a parent container should |
| 6371 | * use for layout. The `for_size` argument will be -1 if the request should |
| 6372 | * not be for a particular size in the opposing orientation, i.e. if the |
| 6373 | * request is not height-for-width or width-for-height. If `for_size` is |
| 6374 | * greater than -1, it is the proposed allocation in the opposing |
| 6375 | * orientation that we need the request for. Implementations of |
| 6376 | * adjust_size_request should chain up to the default implementation, |
| 6377 | * which applies #GtkWidget’s margin properties and imposes any values |
| 6378 | * from gtk_widget_set_size_request(). Chaining up should be last, |
| 6379 | * after your subclass adjusts the request, so |
| 6380 | * #GtkWidget can apply constraints and add the margin properly. |
| 6381 | * @param orientation |
| 6382 | * @param minimum_size |
| 6383 | * @param natural_size |
| 6384 | */ |
| 6385 | vfunc_adjust_size_request(orientation: Gtk.Orientation, minimum_size: number, natural_size: number): void; |
| 6386 | /** |
| 6387 | * Signal will be emitted when a button |
| 6388 | * (typically from a mouse) is pressed. |
| 6389 | * @param event |
| 6390 | */ |
| 6391 | vfunc_button_press_event(event: Gdk.EventButton): boolean; |
| 6392 | /** |
| 6393 | * Signal will be emitted when a button |
| 6394 | * (typically from a mouse) is released. |
| 6395 | * @param event |
| 6396 | */ |
| 6397 | vfunc_button_release_event(event: Gdk.EventButton): boolean; |
| 6398 | /** |
| 6399 | * Determines whether an accelerator that activates the signal |
| 6400 | * identified by `signal_id` can currently be activated. |
| 6401 | * This is done by emitting the #GtkWidget::can-activate-accel |
| 6402 | * signal on `widget;` if the signal isn’t overridden by a |
| 6403 | * handler or in a derived widget, then the default check is |
| 6404 | * that the widget must be sensitive, and the widget and all |
| 6405 | * its ancestors mapped. |
| 6406 | * @param signal_id the ID of a signal installed on @widget |
| 6407 | */ |
| 6408 | vfunc_can_activate_accel(signal_id: number): boolean; |
| 6409 | /** |
| 6410 | * Emits a #GtkWidget::child-notify signal for the |
| 6411 | * [child property][child-properties] `child_property` |
| 6412 | * on `widget`. |
| 6413 | * |
| 6414 | * This is the analogue of g_object_notify() for child properties. |
| 6415 | * |
| 6416 | * Also see gtk_container_child_notify(). |
| 6417 | * @param child_property the name of a child property installed on the class of @widget’s parent |
| 6418 | */ |
| 6419 | vfunc_child_notify(child_property: GObject.ParamSpec): void; |
| 6420 | /** |
| 6421 | * Signal emitted when the composited status of |
| 6422 | * widgets screen changes. See gdk_screen_is_composited(). |
| 6423 | */ |
| 6424 | vfunc_composited_changed(): void; |
| 6425 | /** |
| 6426 | * Computes whether a container should give this |
| 6427 | * widget extra space when possible. |
| 6428 | * @param hexpand_p |
| 6429 | * @param vexpand_p |
| 6430 | */ |
| 6431 | vfunc_compute_expand(hexpand_p: boolean, vexpand_p: boolean): void; |
| 6432 | /** |
| 6433 | * Signal will be emitted when the size, position or |
| 6434 | * stacking of the widget’s window has changed. |
| 6435 | * @param event |
| 6436 | */ |
| 6437 | vfunc_configure_event(event: Gdk.EventConfigure): boolean; |
| 6438 | /** |
| 6439 | * Signal emitted when a redirected window belonging to |
| 6440 | * widget gets drawn into. |
| 6441 | * @param event |
| 6442 | */ |
| 6443 | vfunc_damage_event(event: Gdk.EventExpose): boolean; |
| 6444 | /** |
| 6445 | * Signal emitted if a user requests that a toplevel |
| 6446 | * window is closed. |
| 6447 | * @param event |
| 6448 | */ |
| 6449 | vfunc_delete_event(event: Gdk.EventAny): boolean; |
| 6450 | /** |
| 6451 | * Destroys a widget. |
| 6452 | * |
| 6453 | * When a widget is destroyed all references it holds on other objects |
| 6454 | * will be released: |
| 6455 | * |
| 6456 | * - if the widget is inside a container, it will be removed from its |
| 6457 | * parent |
| 6458 | * - if the widget is a container, all its children will be destroyed, |
| 6459 | * recursively |
| 6460 | * - if the widget is a top level, it will be removed from the list |
| 6461 | * of top level widgets that GTK+ maintains internally |
| 6462 | * |
| 6463 | * It's expected that all references held on the widget will also |
| 6464 | * be released; you should connect to the #GtkWidget::destroy signal |
| 6465 | * if you hold a reference to `widget` and you wish to remove it when |
| 6466 | * this function is called. It is not necessary to do so if you are |
| 6467 | * implementing a #GtkContainer, as you'll be able to use the |
| 6468 | * #GtkContainerClass.remove() virtual function for that. |
| 6469 | * |
| 6470 | * It's important to notice that gtk_widget_destroy() will only cause |
| 6471 | * the `widget` to be finalized if no additional references, acquired |
| 6472 | * using g_object_ref(), are held on it. In case additional references |
| 6473 | * are in place, the `widget` will be in an "inert" state after calling |
| 6474 | * this function; `widget` will still point to valid memory, allowing you |
| 6475 | * to release the references you hold, but you may not query the widget's |
| 6476 | * own state. |
| 6477 | * |
| 6478 | * You should typically call this function on top level widgets, and |
| 6479 | * rarely on child widgets. |
| 6480 | * |
| 6481 | * See also: gtk_container_remove() |
| 6482 | */ |
| 6483 | vfunc_destroy(): void; |
| 6484 | /** |
| 6485 | * Signal is emitted when a #GdkWindow is destroyed. |
| 6486 | * @param event |
| 6487 | */ |
| 6488 | vfunc_destroy_event(event: Gdk.EventAny): boolean; |
| 6489 | /** |
| 6490 | * Signal emitted when the text direction of a |
| 6491 | * widget changes. |
| 6492 | * @param previous_direction |
| 6493 | */ |
| 6494 | vfunc_direction_changed(previous_direction: Gtk.TextDirection): void; |
| 6495 | /** |
| 6496 | * Seldomly overidden. |
| 6497 | * @param n_pspecs |
| 6498 | * @param pspecs |
| 6499 | */ |
| 6500 | vfunc_dispatch_child_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void; |
| 6501 | /** |
| 6502 | * Signal emitted on the drag source when a drag is |
| 6503 | * started. |
| 6504 | * @param context |
| 6505 | */ |
| 6506 | vfunc_drag_begin(context: Gdk.DragContext): void; |
| 6507 | /** |
| 6508 | * Signal emitted on the drag source when a drag |
| 6509 | * with the action %GDK_ACTION_MOVE is successfully completed. |
| 6510 | * @param context |
| 6511 | */ |
| 6512 | vfunc_drag_data_delete(context: Gdk.DragContext): void; |
| 6513 | /** |
| 6514 | * Signal emitted on the drag source when the drop |
| 6515 | * site requests the data which is dragged. |
| 6516 | * @param context |
| 6517 | * @param selection_data |
| 6518 | * @param info |
| 6519 | * @param time_ |
| 6520 | */ |
| 6521 | vfunc_drag_data_get( |
| 6522 | context: Gdk.DragContext, |
| 6523 | selection_data: Gtk.SelectionData, |
| 6524 | info: number, |
| 6525 | time_: number, |
| 6526 | ): void; |
| 6527 | /** |
| 6528 | * Signal emitted on the drop site when the |
| 6529 | * dragged data has been received. |
| 6530 | * @param context |
| 6531 | * @param x |
| 6532 | * @param y |
| 6533 | * @param selection_data |
| 6534 | * @param info |
| 6535 | * @param time_ |
| 6536 | */ |
| 6537 | vfunc_drag_data_received( |
| 6538 | context: Gdk.DragContext, |
| 6539 | x: number, |
| 6540 | y: number, |
| 6541 | selection_data: Gtk.SelectionData, |
| 6542 | info: number, |
| 6543 | time_: number, |
| 6544 | ): void; |
| 6545 | /** |
| 6546 | * Signal emitted on the drop site when the user drops the |
| 6547 | * data onto the widget. |
| 6548 | * @param context |
| 6549 | * @param x |
| 6550 | * @param y |
| 6551 | * @param time_ |
| 6552 | */ |
| 6553 | vfunc_drag_drop(context: Gdk.DragContext, x: number, y: number, time_: number): boolean; |
| 6554 | /** |
| 6555 | * Signal emitted on the drag source when a drag is |
| 6556 | * finished. |
| 6557 | * @param context |
| 6558 | */ |
| 6559 | vfunc_drag_end(context: Gdk.DragContext): void; |
| 6560 | /** |
| 6561 | * Signal emitted on the drag source when a drag has |
| 6562 | * failed. |
| 6563 | * @param context |
| 6564 | * @param result |
| 6565 | */ |
| 6566 | vfunc_drag_failed(context: Gdk.DragContext, result: Gtk.DragResult): boolean; |
| 6567 | /** |
| 6568 | * Signal emitted on the drop site when the cursor leaves |
| 6569 | * the widget. |
| 6570 | * @param context |
| 6571 | * @param time_ |
| 6572 | */ |
| 6573 | vfunc_drag_leave(context: Gdk.DragContext, time_: number): void; |
| 6574 | /** |
| 6575 | * signal emitted on the drop site when the user moves |
| 6576 | * the cursor over the widget during a drag. |
| 6577 | * @param context |
| 6578 | * @param x |
| 6579 | * @param y |
| 6580 | * @param time_ |
| 6581 | */ |
| 6582 | vfunc_drag_motion(context: Gdk.DragContext, x: number, y: number, time_: number): boolean; |
| 6583 | /** |
| 6584 | * Signal emitted when a widget is supposed to render itself. |
| 6585 | * @param cr |
| 6586 | */ |
| 6587 | vfunc_draw(cr: cairo.Context): boolean; |
| 6588 | /** |
| 6589 | * Signal event will be emitted when the pointer |
| 6590 | * enters the widget’s window. |
| 6591 | * @param event |
| 6592 | */ |
| 6593 | vfunc_enter_notify_event(event: Gdk.EventCrossing): boolean; |
| 6594 | /** |
| 6595 | * Rarely-used function. This function is used to emit |
| 6596 | * the event signals on a widget (those signals should never |
| 6597 | * be emitted without using this function to do so). |
| 6598 | * If you want to synthesize an event though, don’t use this function; |
| 6599 | * instead, use gtk_main_do_event() so the event will behave as if |
| 6600 | * it were in the event queue. Don’t synthesize expose events; instead, |
| 6601 | * use gdk_window_invalidate_rect() to invalidate a region of the |
| 6602 | * window. |
| 6603 | * @param event a #GdkEvent |
| 6604 | */ |
| 6605 | vfunc_event(event: Gdk.Event): boolean; |
| 6606 | vfunc_focus(direction: Gtk.DirectionType): boolean; |
| 6607 | /** |
| 6608 | * Signal emitted when the keyboard focus enters the |
| 6609 | * widget’s window. |
| 6610 | * @param event |
| 6611 | */ |
| 6612 | vfunc_focus_in_event(event: Gdk.EventFocus): boolean; |
| 6613 | /** |
| 6614 | * Signal emitted when the keyboard focus leaves the |
| 6615 | * widget’s window. |
| 6616 | * @param event |
| 6617 | */ |
| 6618 | vfunc_focus_out_event(event: Gdk.EventFocus): boolean; |
| 6619 | /** |
| 6620 | * Returns the accessible object that describes the widget to an |
| 6621 | * assistive technology. |
| 6622 | * |
| 6623 | * If accessibility support is not available, this #AtkObject |
| 6624 | * instance may be a no-op. Likewise, if no class-specific #AtkObject |
| 6625 | * implementation is available for the widget instance in question, |
| 6626 | * it will inherit an #AtkObject implementation from the first ancestor |
| 6627 | * class for which such an implementation is defined. |
| 6628 | * |
| 6629 | * The documentation of the |
| 6630 | * [ATK](http://developer.gnome.org/atk/stable/) |
| 6631 | * library contains more information about accessible objects and their uses. |
| 6632 | */ |
| 6633 | vfunc_get_accessible(): Atk.Object; |
| 6634 | /** |
| 6635 | * Retrieves a widget’s initial minimum and natural height. |
| 6636 | * |
| 6637 | * This call is specific to width-for-height requests. |
| 6638 | * |
| 6639 | * The returned request will be modified by the |
| 6640 | * GtkWidgetClass::adjust_size_request virtual method and by any |
| 6641 | * #GtkSizeGroups that have been applied. That is, the returned request |
| 6642 | * is the one that should be used for layout, not necessarily the one |
| 6643 | * returned by the widget itself. |
| 6644 | */ |
| 6645 | vfunc_get_preferred_height(): [number, number]; |
| 6646 | /** |
| 6647 | * Retrieves a widget’s minimum and natural height and the corresponding baselines if it would be given |
| 6648 | * the specified `width,` or the default height if `width` is -1. The baselines may be -1 which means |
| 6649 | * that no baseline is requested for this widget. |
| 6650 | * |
| 6651 | * The returned request will be modified by the |
| 6652 | * GtkWidgetClass::adjust_size_request and GtkWidgetClass::adjust_baseline_request virtual methods |
| 6653 | * and by any #GtkSizeGroups that have been applied. That is, the returned request |
| 6654 | * is the one that should be used for layout, not necessarily the one |
| 6655 | * returned by the widget itself. |
| 6656 | * @param width the width which is available for allocation, or -1 if none |
| 6657 | */ |
| 6658 | vfunc_get_preferred_height_and_baseline_for_width(width: number): [number, number, number, number]; |
| 6659 | /** |
| 6660 | * Retrieves a widget’s minimum and natural height if it would be given |
| 6661 | * the specified `width`. |
| 6662 | * |
| 6663 | * The returned request will be modified by the |
| 6664 | * GtkWidgetClass::adjust_size_request virtual method and by any |
| 6665 | * #GtkSizeGroups that have been applied. That is, the returned request |
| 6666 | * is the one that should be used for layout, not necessarily the one |
| 6667 | * returned by the widget itself. |
| 6668 | * @param width the width which is available for allocation |
| 6669 | */ |
| 6670 | vfunc_get_preferred_height_for_width(width: number): [number, number]; |
| 6671 | /** |
| 6672 | * Retrieves a widget’s initial minimum and natural width. |
| 6673 | * |
| 6674 | * This call is specific to height-for-width requests. |
| 6675 | * |
| 6676 | * The returned request will be modified by the |
| 6677 | * GtkWidgetClass::adjust_size_request virtual method and by any |
| 6678 | * #GtkSizeGroups that have been applied. That is, the returned request |
| 6679 | * is the one that should be used for layout, not necessarily the one |
| 6680 | * returned by the widget itself. |
| 6681 | */ |
| 6682 | vfunc_get_preferred_width(): [number, number]; |
| 6683 | /** |
| 6684 | * Retrieves a widget’s minimum and natural width if it would be given |
| 6685 | * the specified `height`. |
| 6686 | * |
| 6687 | * The returned request will be modified by the |
| 6688 | * GtkWidgetClass::adjust_size_request virtual method and by any |
| 6689 | * #GtkSizeGroups that have been applied. That is, the returned request |
| 6690 | * is the one that should be used for layout, not necessarily the one |
| 6691 | * returned by the widget itself. |
| 6692 | * @param height the height which is available for allocation |
| 6693 | */ |
| 6694 | vfunc_get_preferred_width_for_height(height: number): [number, number]; |
| 6695 | /** |
| 6696 | * Gets whether the widget prefers a height-for-width layout |
| 6697 | * or a width-for-height layout. |
| 6698 | * |
| 6699 | * #GtkBin widgets generally propagate the preference of |
| 6700 | * their child, container widgets need to request something either in |
| 6701 | * context of their children or in context of their allocation |
| 6702 | * capabilities. |
| 6703 | */ |
| 6704 | vfunc_get_request_mode(): Gtk.SizeRequestMode; |
| 6705 | /** |
| 6706 | * Signal emitted when a pointer or keyboard grab |
| 6707 | * on a window belonging to widget gets broken. |
| 6708 | * @param event |
| 6709 | */ |
| 6710 | vfunc_grab_broken_event(event: Gdk.EventGrabBroken): boolean; |
| 6711 | /** |
| 6712 | * Causes `widget` to have the keyboard focus for the #GtkWindow it's |
| 6713 | * inside. `widget` must be a focusable widget, such as a #GtkEntry; |
| 6714 | * something like #GtkFrame won’t work. |
| 6715 | * |
| 6716 | * More precisely, it must have the %GTK_CAN_FOCUS flag set. Use |
| 6717 | * gtk_widget_set_can_focus() to modify that flag. |
| 6718 | * |
| 6719 | * The widget also needs to be realized and mapped. This is indicated by the |
| 6720 | * related signals. Grabbing the focus immediately after creating the widget |
| 6721 | * will likely fail and cause critical warnings. |
| 6722 | */ |
| 6723 | vfunc_grab_focus(): void; |
| 6724 | /** |
| 6725 | * Signal emitted when a widget becomes shadowed by a |
| 6726 | * GTK+ grab (not a pointer or keyboard grab) on another widget, or |
| 6727 | * when it becomes unshadowed due to a grab being removed. |
| 6728 | * @param was_grabbed |
| 6729 | */ |
| 6730 | vfunc_grab_notify(was_grabbed: boolean): void; |
| 6731 | /** |
| 6732 | * Reverses the effects of gtk_widget_show(), causing the widget to be |
| 6733 | * hidden (invisible to the user). |
| 6734 | */ |
| 6735 | vfunc_hide(): void; |
| 6736 | /** |
| 6737 | * Signal emitted when the anchored state of a |
| 6738 | * widget changes. |
| 6739 | * @param previous_toplevel |
| 6740 | */ |
| 6741 | vfunc_hierarchy_changed(previous_toplevel: Gtk.Widget): void; |
| 6742 | /** |
| 6743 | * Signal emitted when a key is pressed. |
| 6744 | * @param event |
| 6745 | */ |
| 6746 | vfunc_key_press_event(event: Gdk.EventKey): boolean; |
| 6747 | /** |
| 6748 | * Signal is emitted when a key is released. |
| 6749 | * @param event |
| 6750 | */ |
| 6751 | vfunc_key_release_event(event: Gdk.EventKey): boolean; |
| 6752 | /** |
| 6753 | * This function should be called whenever keyboard navigation within |
| 6754 | * a single widget hits a boundary. The function emits the |
| 6755 | * #GtkWidget::keynav-failed signal on the widget and its return |
| 6756 | * value should be interpreted in a way similar to the return value of |
| 6757 | * gtk_widget_child_focus(): |
| 6758 | * |
| 6759 | * When %TRUE is returned, stay in the widget, the failed keyboard |
| 6760 | * navigation is OK and/or there is nowhere we can/should move the |
| 6761 | * focus to. |
| 6762 | * |
| 6763 | * When %FALSE is returned, the caller should continue with keyboard |
| 6764 | * navigation outside the widget, e.g. by calling |
| 6765 | * gtk_widget_child_focus() on the widget’s toplevel. |
| 6766 | * |
| 6767 | * The default ::keynav-failed handler returns %FALSE for |
| 6768 | * %GTK_DIR_TAB_FORWARD and %GTK_DIR_TAB_BACKWARD. For the other |
| 6769 | * values of #GtkDirectionType it returns %TRUE. |
| 6770 | * |
| 6771 | * Whenever the default handler returns %TRUE, it also calls |
| 6772 | * gtk_widget_error_bell() to notify the user of the failed keyboard |
| 6773 | * navigation. |
| 6774 | * |
| 6775 | * A use case for providing an own implementation of ::keynav-failed |
| 6776 | * (either by connecting to it or by overriding it) would be a row of |
| 6777 | * #GtkEntry widgets where the user should be able to navigate the |
| 6778 | * entire row with the cursor keys, as e.g. known from user interfaces |
| 6779 | * that require entering license keys. |
| 6780 | * @param direction direction of focus movement |
| 6781 | */ |
| 6782 | vfunc_keynav_failed(direction: Gtk.DirectionType): boolean; |
| 6783 | /** |
| 6784 | * Will be emitted when the pointer leaves the |
| 6785 | * widget’s window. |
| 6786 | * @param event |
| 6787 | */ |
| 6788 | vfunc_leave_notify_event(event: Gdk.EventCrossing): boolean; |
| 6789 | /** |
| 6790 | * This function is only for use in widget implementations. Causes |
| 6791 | * a widget to be mapped if it isn’t already. |
| 6792 | */ |
| 6793 | vfunc_map(): void; |
| 6794 | /** |
| 6795 | * Signal emitted when the widget’s window is mapped. |
| 6796 | * @param event |
| 6797 | */ |
| 6798 | vfunc_map_event(event: Gdk.EventAny): boolean; |
| 6799 | /** |
| 6800 | * Emits the #GtkWidget::mnemonic-activate signal. |
| 6801 | * @param group_cycling %TRUE if there are other widgets with the same mnemonic |
| 6802 | */ |
| 6803 | vfunc_mnemonic_activate(group_cycling: boolean): boolean; |
| 6804 | /** |
| 6805 | * Signal emitted when the pointer moves over |
| 6806 | * the widget’s #GdkWindow. |
| 6807 | * @param event |
| 6808 | */ |
| 6809 | vfunc_motion_notify_event(event: Gdk.EventMotion): boolean; |
| 6810 | /** |
| 6811 | * Signal emitted when a change of focus is requested |
| 6812 | * @param direction |
| 6813 | */ |
| 6814 | vfunc_move_focus(direction: Gtk.DirectionType): void; |
| 6815 | /** |
| 6816 | * Signal emitted when a new parent has been set on a |
| 6817 | * widget. |
| 6818 | * @param previous_parent |
| 6819 | */ |
| 6820 | vfunc_parent_set(previous_parent: Gtk.Widget): void; |
| 6821 | /** |
| 6822 | * Signal emitted whenever a widget should pop up a |
| 6823 | * context menu. |
| 6824 | */ |
| 6825 | vfunc_popup_menu(): boolean; |
| 6826 | /** |
| 6827 | * Signal will be emitted when a property on |
| 6828 | * the widget’s window has been changed or deleted. |
| 6829 | * @param event |
| 6830 | */ |
| 6831 | vfunc_property_notify_event(event: Gdk.EventProperty): boolean; |
| 6832 | vfunc_proximity_in_event(event: Gdk.EventProximity): boolean; |
| 6833 | vfunc_proximity_out_event(event: Gdk.EventProximity): boolean; |
| 6834 | /** |
| 6835 | * Signal emitted when “has-tooltip” is %TRUE and the |
| 6836 | * hover timeout has expired with the cursor hovering “above” |
| 6837 | * widget; or emitted when widget got focus in keyboard mode. |
| 6838 | * @param x |
| 6839 | * @param y |
| 6840 | * @param keyboard_tooltip |
| 6841 | * @param tooltip |
| 6842 | */ |
| 6843 | vfunc_query_tooltip(x: number, y: number, keyboard_tooltip: boolean, tooltip: Gtk.Tooltip): boolean; |
| 6844 | /** |
| 6845 | * Invalidates the area of `widget` defined by `region` by calling |
| 6846 | * gdk_window_invalidate_region() on the widget’s window and all its |
| 6847 | * child windows. Once the main loop becomes idle (after the current |
| 6848 | * batch of events has been processed, roughly), the window will |
| 6849 | * receive expose events for the union of all regions that have been |
| 6850 | * invalidated. |
| 6851 | * |
| 6852 | * Normally you would only use this function in widget |
| 6853 | * implementations. You might also use it to schedule a redraw of a |
| 6854 | * #GtkDrawingArea or some portion thereof. |
| 6855 | * @param region region to draw |
| 6856 | */ |
| 6857 | vfunc_queue_draw_region(region: cairo.Region): void; |
| 6858 | /** |
| 6859 | * Creates the GDK (windowing system) resources associated with a |
| 6860 | * widget. For example, `widget->`window will be created when a widget |
| 6861 | * is realized. Normally realization happens implicitly; if you show |
| 6862 | * a widget and all its parent containers, then the widget will be |
| 6863 | * realized and mapped automatically. |
| 6864 | * |
| 6865 | * Realizing a widget requires all |
| 6866 | * the widget’s parent widgets to be realized; calling |
| 6867 | * gtk_widget_realize() realizes the widget’s parents in addition to |
| 6868 | * `widget` itself. If a widget is not yet inside a toplevel window |
| 6869 | * when you realize it, bad things will happen. |
| 6870 | * |
| 6871 | * This function is primarily used in widget implementations, and |
| 6872 | * isn’t very useful otherwise. Many times when you think you might |
| 6873 | * need it, a better approach is to connect to a signal that will be |
| 6874 | * called after the widget is realized automatically, such as |
| 6875 | * #GtkWidget::draw. Or simply g_signal_connect () to the |
| 6876 | * #GtkWidget::realize signal. |
| 6877 | */ |
| 6878 | vfunc_realize(): void; |
| 6879 | /** |
| 6880 | * Signal emitted when the screen of a widget has |
| 6881 | * changed. |
| 6882 | * @param previous_screen |
| 6883 | */ |
| 6884 | vfunc_screen_changed(previous_screen: Gdk.Screen): void; |
| 6885 | /** |
| 6886 | * Signal emitted when a button in the 4 to 7 range is |
| 6887 | * pressed. |
| 6888 | * @param event |
| 6889 | */ |
| 6890 | vfunc_scroll_event(event: Gdk.EventScroll): boolean; |
| 6891 | /** |
| 6892 | * Signal will be emitted when the the |
| 6893 | * widget’s window has lost ownership of a selection. |
| 6894 | * @param event |
| 6895 | */ |
| 6896 | vfunc_selection_clear_event(event: Gdk.EventSelection): boolean; |
| 6897 | vfunc_selection_get(selection_data: Gtk.SelectionData, info: number, time_: number): void; |
| 6898 | vfunc_selection_notify_event(event: Gdk.EventSelection): boolean; |
| 6899 | vfunc_selection_received(selection_data: Gtk.SelectionData, time_: number): void; |
| 6900 | /** |
| 6901 | * Signal will be emitted when another |
| 6902 | * client requests ownership of the selection owned by the widget's |
| 6903 | * window. |
| 6904 | * @param event |
| 6905 | */ |
| 6906 | vfunc_selection_request_event(event: Gdk.EventSelection): boolean; |
| 6907 | /** |
| 6908 | * Flags a widget to be displayed. Any widget that isn’t shown will |
| 6909 | * not appear on the screen. If you want to show all the widgets in a |
| 6910 | * container, it’s easier to call gtk_widget_show_all() on the |
| 6911 | * container, instead of individually showing the widgets. |
| 6912 | * |
| 6913 | * Remember that you have to show the containers containing a widget, |
| 6914 | * in addition to the widget itself, before it will appear onscreen. |
| 6915 | * |
| 6916 | * When a toplevel container is shown, it is immediately realized and |
| 6917 | * mapped; other shown widgets are realized and mapped when their |
| 6918 | * toplevel container is realized and mapped. |
| 6919 | */ |
| 6920 | vfunc_show(): void; |
| 6921 | /** |
| 6922 | * Recursively shows a widget, and any child widgets (if the widget is |
| 6923 | * a container). |
| 6924 | */ |
| 6925 | vfunc_show_all(): void; |
| 6926 | vfunc_show_help(help_type: Gtk.WidgetHelpType): boolean; |
| 6927 | /** |
| 6928 | * This function is only used by #GtkContainer subclasses, to assign a size |
| 6929 | * and position to their child widgets. |
| 6930 | * |
| 6931 | * In this function, the allocation may be adjusted. It will be forced |
| 6932 | * to a 1x1 minimum size, and the adjust_size_allocation virtual |
| 6933 | * method on the child will be used to adjust the allocation. Standard |
| 6934 | * adjustments include removing the widget’s margins, and applying the |
| 6935 | * widget’s #GtkWidget:halign and #GtkWidget:valign properties. |
| 6936 | * |
| 6937 | * For baseline support in containers you need to use gtk_widget_size_allocate_with_baseline() |
| 6938 | * instead. |
| 6939 | * @param allocation position and size to be allocated to @widget |
| 6940 | */ |
| 6941 | vfunc_size_allocate(allocation: Gtk.Allocation): void; |
| 6942 | /** |
| 6943 | * Signal emitted when the widget state |
| 6944 | * changes. Deprecated: 3.0 |
| 6945 | * @param previous_state |
| 6946 | */ |
| 6947 | vfunc_state_changed(previous_state: Gtk.StateType): void; |
| 6948 | /** |
| 6949 | * Signal emitted when the widget state changes, |
| 6950 | * see gtk_widget_get_state_flags(). |
| 6951 | * @param previous_state_flags |
| 6952 | */ |
| 6953 | vfunc_state_flags_changed(previous_state_flags: Gtk.StateFlags): void; |
| 6954 | /** |
| 6955 | * Signal emitted when a new style has been set on a |
| 6956 | * widget. Deprecated: 3.0 |
| 6957 | * @param previous_style |
| 6958 | */ |
| 6959 | vfunc_style_set(previous_style: Gtk.Style): void; |
| 6960 | /** |
| 6961 | * Signal emitted when the GtkStyleContext of a widget |
| 6962 | * is changed. |
| 6963 | */ |
| 6964 | vfunc_style_updated(): void; |
| 6965 | /** |
| 6966 | * Signal emitted when a touch event happens |
| 6967 | * @param event |
| 6968 | */ |
| 6969 | vfunc_touch_event(event: Gdk.EventTouch): boolean; |
| 6970 | /** |
| 6971 | * This function is only for use in widget implementations. Causes |
| 6972 | * a widget to be unmapped if it’s currently mapped. |
| 6973 | */ |
| 6974 | vfunc_unmap(): void; |
| 6975 | /** |
| 6976 | * Signal will be emitted when the widget’s window is |
| 6977 | * unmapped. |
| 6978 | * @param event |
| 6979 | */ |
| 6980 | vfunc_unmap_event(event: Gdk.EventAny): boolean; |
| 6981 | /** |
| 6982 | * This function is only useful in widget implementations. |
| 6983 | * Causes a widget to be unrealized (frees all GDK resources |
| 6984 | * associated with the widget, such as `widget->`window). |
| 6985 | */ |
| 6986 | vfunc_unrealize(): void; |
| 6987 | /** |
| 6988 | * Signal emitted when the widget’s window is |
| 6989 | * obscured or unobscured. |
| 6990 | * @param event |
| 6991 | */ |
| 6992 | vfunc_visibility_notify_event(event: Gdk.EventVisibility): boolean; |
| 6993 | /** |
| 6994 | * Signal emitted when the state of the toplevel |
| 6995 | * window associated to the widget changes. |
| 6996 | * @param event |
| 6997 | */ |
| 6998 | vfunc_window_state_event(event: Gdk.EventWindowState): boolean; |
| 6999 | } |
| 7000 | |
| 7001 | namespace FailureRenderer { |
| 7002 | // Constructor properties interface |
| 7003 | |
| 7004 | interface ConstructorProps extends GObject.Object.ConstructorProps, Renderer.ConstructorProps { |
| 7005 | attributes: Gck.Attributes; |
| 7006 | label: string; |
| 7007 | } |
| 7008 | } |
| 7009 | |
| 7010 | /** |
| 7011 | * A renderer that can be used for unsupported data. |
| 7012 | */ |
| 7013 | class FailureRenderer extends GObject.Object implements Renderer { |
| 7014 | static $gtype: GObject.GType<FailureRenderer>; |
| 7015 | |
| 7016 | // Properties |
| 7017 | |
| 7018 | get attributes(): Gck.Attributes; |
| 7019 | set attributes(val: Gck.Attributes); |
| 7020 | get label(): string; |
| 7021 | set label(val: string); |
| 7022 | |
| 7023 | // Constructors |
| 7024 | |
| 7025 | constructor(properties?: Partial<FailureRenderer.ConstructorProps>, ...args: any[]); |
| 7026 | |
| 7027 | _init(...args: any[]): void; |
| 7028 | |
| 7029 | static ['new'](label: string | null, error: GLib.Error): FailureRenderer; |
| 7030 | |
| 7031 | // Static methods |
| 7032 | |
| 7033 | /** |
| 7034 | * Create a new renderer for unsupported data. |
| 7035 | * @param label the label for the failure |
| 7036 | */ |
| 7037 | static new_unsupported(label: string): Renderer; |
| 7038 | |
| 7039 | // Inherited methods |
| 7040 | /** |
| 7041 | * Emit the #GcrRenderer::data-changed signal on the renderer. This is used by |
| 7042 | * renderer implementations. |
| 7043 | */ |
| 7044 | emit_data_changed(): void; |
| 7045 | /** |
| 7046 | * Get the PKCS#11 attributes, if any, set for this renderer to display. |
| 7047 | * @returns the attributes, owned by the renderer |
| 7048 | */ |
| 7049 | get_attributes(): Gck.Attributes | null; |
| 7050 | /** |
| 7051 | * Called by #GcrViewer when about to display a popup menu for the content |
| 7052 | * displayed by the renderer. The renderer can add a menu item if desired. |
| 7053 | * @param viewer The viewer that is displaying a popup |
| 7054 | * @param menu The popup menu being displayed |
| 7055 | */ |
| 7056 | popuplate_popup(viewer: Viewer, menu: Gtk.Menu): void; |
| 7057 | /** |
| 7058 | * Render the contents of the renderer to the given viewer. |
| 7059 | * @param viewer The viewer to render to. |
| 7060 | */ |
| 7061 | render_view(viewer: Viewer): void; |
| 7062 | /** |
| 7063 | * Set the PKCS#11 attributes for this renderer to display. |
| 7064 | * @param attrs attributes to set |
| 7065 | */ |
| 7066 | set_attributes(attrs?: Gck.Attributes | null): void; |
| 7067 | /** |
| 7068 | * signal emitted when data being rendered changes |
| 7069 | */ |
| 7070 | vfunc_data_changed(): void; |
| 7071 | /** |
| 7072 | * method invoked to populate a popup menu with additional |
| 7073 | * renderer options |
| 7074 | * @param viewer |
| 7075 | * @param menu |
| 7076 | */ |
| 7077 | vfunc_populate_popup(viewer: Viewer, menu: Gtk.Menu): void; |
| 7078 | /** |
| 7079 | * Render the contents of the renderer to the given viewer. |
| 7080 | * @param viewer The viewer to render to. |
| 7081 | */ |
| 7082 | vfunc_render_view(viewer: Viewer): void; |
| 7083 | /** |
| 7084 | * Creates a binding between `source_property` on `source` and `target_property` |
| 7085 | * on `target`. |
| 7086 | * |
| 7087 | * Whenever the `source_property` is changed the `target_property` is |
| 7088 | * updated using the same value. For instance: |
| 7089 | * |
| 7090 | * |
| 7091 | * ```c |
| 7092 | * g_object_bind_property (action, "active", widget, "sensitive", 0); |
| 7093 | * ``` |
| 7094 | * |
| 7095 | * |
| 7096 | * Will result in the "sensitive" property of the widget #GObject instance to be |
| 7097 | * updated with the same value of the "active" property of the action #GObject |
| 7098 | * instance. |
| 7099 | * |
| 7100 | * If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual: |
| 7101 | * if `target_property` on `target` changes then the `source_property` on `source` |
| 7102 | * will be updated as well. |
| 7103 | * |
| 7104 | * The binding will automatically be removed when either the `source` or the |
| 7105 | * `target` instances are finalized. To remove the binding without affecting the |
| 7106 | * `source` and the `target` you can just call g_object_unref() on the returned |
| 7107 | * #GBinding instance. |
| 7108 | * |
| 7109 | * Removing the binding by calling g_object_unref() on it must only be done if |
| 7110 | * the binding, `source` and `target` are only used from a single thread and it |
| 7111 | * is clear that both `source` and `target` outlive the binding. Especially it |
| 7112 | * is not safe to rely on this if the binding, `source` or `target` can be |
| 7113 | * finalized from different threads. Keep another reference to the binding and |
| 7114 | * use g_binding_unbind() instead to be on the safe side. |
| 7115 | * |
| 7116 | * A #GObject can have multiple bindings. |
| 7117 | * @param source_property the property on @source to bind |
| 7118 | * @param target the target #GObject |
| 7119 | * @param target_property the property on @target to bind |
| 7120 | * @param flags flags to pass to #GBinding |
| 7121 | * @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero. |
| 7122 | */ |
| 7123 | bind_property( |
| 7124 | source_property: string, |
| 7125 | target: GObject.Object, |
| 7126 | target_property: string, |
| 7127 | flags: GObject.BindingFlags | null, |
| 7128 | ): GObject.Binding; |
| 7129 | /** |
| 7130 | * Complete version of g_object_bind_property(). |
| 7131 | * |
| 7132 | * Creates a binding between `source_property` on `source` and `target_property` |
| 7133 | * on `target,` allowing you to set the transformation functions to be used by |
| 7134 | * the binding. |
| 7135 | * |
| 7136 | * If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual: |
| 7137 | * if `target_property` on `target` changes then the `source_property` on `source` |
| 7138 | * will be updated as well. The `transform_from` function is only used in case |
| 7139 | * of bidirectional bindings, otherwise it will be ignored |
| 7140 | * |
| 7141 | * The binding will automatically be removed when either the `source` or the |
| 7142 | * `target` instances are finalized. This will release the reference that is |
| 7143 | * being held on the #GBinding instance; if you want to hold on to the |
| 7144 | * #GBinding instance, you will need to hold a reference to it. |
| 7145 | * |
| 7146 | * To remove the binding, call g_binding_unbind(). |
| 7147 | * |
| 7148 | * A #GObject can have multiple bindings. |
| 7149 | * |
| 7150 | * The same `user_data` parameter will be used for both `transform_to` |
| 7151 | * and `transform_from` transformation functions; the `notify` function will |
| 7152 | * be called once, when the binding is removed. If you need different data |
| 7153 | * for each transformation function, please use |
| 7154 | * g_object_bind_property_with_closures() instead. |
| 7155 | * @param source_property the property on @source to bind |
| 7156 | * @param target the target #GObject |
| 7157 | * @param target_property the property on @target to bind |
| 7158 | * @param flags flags to pass to #GBinding |
| 7159 | * @param transform_to the transformation function from the @source to the @target, or %NULL to use the default |
| 7160 | * @param transform_from the transformation function from the @target to the @source, or %NULL to use the default |
| 7161 | * @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required |
| 7162 | * @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero. |
| 7163 | */ |
| 7164 | bind_property_full( |
| 7165 | source_property: string, |
| 7166 | target: GObject.Object, |
| 7167 | target_property: string, |
| 7168 | flags: GObject.BindingFlags | null, |
| 7169 | transform_to?: GObject.BindingTransformFunc | null, |
| 7170 | transform_from?: GObject.BindingTransformFunc | null, |
| 7171 | notify?: GLib.DestroyNotify | null, |
| 7172 | ): GObject.Binding; |
| 7173 | // Conflicted with GObject.Object.bind_property_full |
| 7174 | bind_property_full(...args: never[]): any; |
| 7175 | /** |
| 7176 | * This function is intended for #GObject implementations to re-enforce |
| 7177 | * a [floating][floating-ref] object reference. Doing this is seldom |
| 7178 | * required: all #GInitiallyUnowneds are created with a floating reference |
| 7179 | * which usually just needs to be sunken by calling g_object_ref_sink(). |
| 7180 | */ |
| 7181 | force_floating(): void; |
| 7182 | /** |
| 7183 | * Increases the freeze count on `object`. If the freeze count is |
| 7184 | * non-zero, the emission of "notify" signals on `object` is |
| 7185 | * stopped. The signals are queued until the freeze count is decreased |
| 7186 | * to zero. Duplicate notifications are squashed so that at most one |
| 7187 | * #GObject::notify signal is emitted for each property modified while the |
| 7188 | * object is frozen. |
| 7189 | * |
| 7190 | * This is necessary for accessors that modify multiple properties to prevent |
| 7191 | * premature notification while the object is still being modified. |
| 7192 | */ |
| 7193 | freeze_notify(): void; |
| 7194 | /** |
| 7195 | * Gets a named field from the objects table of associations (see g_object_set_data()). |
| 7196 | * @param key name of the key for that association |
| 7197 | * @returns the data if found, or %NULL if no such data exists. |
| 7198 | */ |
| 7199 | get_data(key: string): any | null; |
| 7200 | /** |
| 7201 | * Gets a property of an object. |
| 7202 | * |
| 7203 | * The value can be: |
| 7204 | * - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60) |
| 7205 | * - a GObject.Value initialized with the expected type of the property |
| 7206 | * - a GObject.Value initialized with a type to which the expected type of the property can be transformed |
| 7207 | * |
| 7208 | * In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset. |
| 7209 | * |
| 7210 | * Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming. |
| 7211 | * @param property_name The name of the property to get |
| 7212 | * @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type |
| 7213 | */ |
| 7214 | get_property(property_name: string, value: GObject.Value | any): any; |
| 7215 | /** |
| 7216 | * This function gets back user data pointers stored via |
| 7217 | * g_object_set_qdata(). |
| 7218 | * @param quark A #GQuark, naming the user data pointer |
| 7219 | * @returns The user data pointer set, or %NULL |
| 7220 | */ |
| 7221 | get_qdata(quark: GLib.Quark): any | null; |
| 7222 | /** |
| 7223 | * Gets `n_properties` properties for an `object`. |
| 7224 | * Obtained properties will be set to `values`. All properties must be valid. |
| 7225 | * Warnings will be emitted and undefined behaviour may result if invalid |
| 7226 | * properties are passed in. |
| 7227 | * @param names the names of each property to get |
| 7228 | * @param values the values of each property to get |
| 7229 | */ |
| 7230 | getv(names: string[], values: (GObject.Value | any)[]): void; |
| 7231 | /** |
| 7232 | * Checks whether `object` has a [floating][floating-ref] reference. |
| 7233 | * @returns %TRUE if @object has a floating reference |
| 7234 | */ |
| 7235 | is_floating(): boolean; |
| 7236 | /** |
| 7237 | * Emits a "notify" signal for the property `property_name` on `object`. |
| 7238 | * |
| 7239 | * When possible, eg. when signaling a property change from within the class |
| 7240 | * that registered the property, you should use g_object_notify_by_pspec() |
| 7241 | * instead. |
| 7242 | * |
| 7243 | * Note that emission of the notify signal may be blocked with |
| 7244 | * g_object_freeze_notify(). In this case, the signal emissions are queued |
| 7245 | * and will be emitted (in reverse order) when g_object_thaw_notify() is |
| 7246 | * called. |
| 7247 | * @param property_name the name of a property installed on the class of @object. |
| 7248 | */ |
| 7249 | notify(property_name: string): void; |
| 7250 | /** |
| 7251 | * Emits a "notify" signal for the property specified by `pspec` on `object`. |
| 7252 | * |
| 7253 | * This function omits the property name lookup, hence it is faster than |
| 7254 | * g_object_notify(). |
| 7255 | * |
| 7256 | * One way to avoid using g_object_notify() from within the |
| 7257 | * class that registered the properties, and using g_object_notify_by_pspec() |
| 7258 | * instead, is to store the GParamSpec used with |
| 7259 | * g_object_class_install_property() inside a static array, e.g.: |
| 7260 | * |
| 7261 | * |
| 7262 | * ```c |
| 7263 | * typedef enum |
| 7264 | * { |
| 7265 | * PROP_FOO = 1, |
| 7266 | * PROP_LAST |
| 7267 | * } MyObjectProperty; |
| 7268 | * |
| 7269 | * static GParamSpec *properties[PROP_LAST]; |
| 7270 | * |
| 7271 | * static void |
| 7272 | * my_object_class_init (MyObjectClass *klass) |
| 7273 | * { |
| 7274 | * properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL, |
| 7275 | * 0, 100, |
| 7276 | * 50, |
| 7277 | * G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); |
| 7278 | * g_object_class_install_property (gobject_class, |
| 7279 | * PROP_FOO, |
| 7280 | * properties[PROP_FOO]); |
| 7281 | * } |
| 7282 | * ``` |
| 7283 | * |
| 7284 | * |
| 7285 | * and then notify a change on the "foo" property with: |
| 7286 | * |
| 7287 | * |
| 7288 | * ```c |
| 7289 | * g_object_notify_by_pspec (self, properties[PROP_FOO]); |
| 7290 | * ``` |
| 7291 | * |
| 7292 | * @param pspec the #GParamSpec of a property installed on the class of @object. |
| 7293 | */ |
| 7294 | notify_by_pspec(pspec: GObject.ParamSpec): void; |
| 7295 | /** |
| 7296 | * Increases the reference count of `object`. |
| 7297 | * |
| 7298 | * Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type |
| 7299 | * of `object` will be propagated to the return type (using the GCC typeof() |
| 7300 | * extension), so any casting the caller needs to do on the return type must be |
| 7301 | * explicit. |
| 7302 | * @returns the same @object |
| 7303 | */ |
| 7304 | ref(): GObject.Object; |
| 7305 | /** |
| 7306 | * Increase the reference count of `object,` and possibly remove the |
| 7307 | * [floating][floating-ref] reference, if `object` has a floating reference. |
| 7308 | * |
| 7309 | * In other words, if the object is floating, then this call "assumes |
| 7310 | * ownership" of the floating reference, converting it to a normal |
| 7311 | * reference by clearing the floating flag while leaving the reference |
| 7312 | * count unchanged. If the object is not floating, then this call |
| 7313 | * adds a new normal reference increasing the reference count by one. |
| 7314 | * |
| 7315 | * Since GLib 2.56, the type of `object` will be propagated to the return type |
| 7316 | * under the same conditions as for g_object_ref(). |
| 7317 | * @returns @object |
| 7318 | */ |
| 7319 | ref_sink(): GObject.Object; |
| 7320 | /** |
| 7321 | * Releases all references to other objects. This can be used to break |
| 7322 | * reference cycles. |
| 7323 | * |
| 7324 | * This function should only be called from object system implementations. |
| 7325 | */ |
| 7326 | run_dispose(): void; |
| 7327 | /** |
| 7328 | * Each object carries around a table of associations from |
| 7329 | * strings to pointers. This function lets you set an association. |
| 7330 | * |
| 7331 | * If the object already had an association with that name, |
| 7332 | * the old association will be destroyed. |
| 7333 | * |
| 7334 | * Internally, the `key` is converted to a #GQuark using g_quark_from_string(). |
| 7335 | * This means a copy of `key` is kept permanently (even after `object` has been |
| 7336 | * finalized) — so it is recommended to only use a small, bounded set of values |
| 7337 | * for `key` in your program, to avoid the #GQuark storage growing unbounded. |
| 7338 | * @param key name of the key |
| 7339 | * @param data data to associate with that key |
| 7340 | */ |
| 7341 | set_data(key: string, data?: any | null): void; |
| 7342 | /** |
| 7343 | * Sets a property on an object. |
| 7344 | * @param property_name The name of the property to set |
| 7345 | * @param value The value to set the property to |
| 7346 | */ |
| 7347 | set_property(property_name: string, value: GObject.Value | any): void; |
| 7348 | /** |
| 7349 | * Remove a specified datum from the object's data associations, |
| 7350 | * without invoking the association's destroy handler. |
| 7351 | * @param key name of the key |
| 7352 | * @returns the data if found, or %NULL if no such data exists. |
| 7353 | */ |
| 7354 | steal_data(key: string): any | null; |
| 7355 | /** |
| 7356 | * This function gets back user data pointers stored via |
| 7357 | * g_object_set_qdata() and removes the `data` from object |
| 7358 | * without invoking its destroy() function (if any was |
| 7359 | * set). |
| 7360 | * Usually, calling this function is only required to update |
| 7361 | * user data pointers with a destroy notifier, for example: |
| 7362 | * |
| 7363 | * ```c |
| 7364 | * void |
| 7365 | * object_add_to_user_list (GObject *object, |
| 7366 | * const gchar *new_string) |
| 7367 | * { |
| 7368 | * // the quark, naming the object data |
| 7369 | * GQuark quark_string_list = g_quark_from_static_string ("my-string-list"); |
| 7370 | * // retrieve the old string list |
| 7371 | * GList *list = g_object_steal_qdata (object, quark_string_list); |
| 7372 | * |
| 7373 | * // prepend new string |
| 7374 | * list = g_list_prepend (list, g_strdup (new_string)); |
| 7375 | * // this changed 'list', so we need to set it again |
| 7376 | * g_object_set_qdata_full (object, quark_string_list, list, free_string_list); |
| 7377 | * } |
| 7378 | * static void |
| 7379 | * free_string_list (gpointer data) |
| 7380 | * { |
| 7381 | * GList *node, *list = data; |
| 7382 | * |
| 7383 | * for (node = list; node; node = node->next) |
| 7384 | * g_free (node->data); |
| 7385 | * g_list_free (list); |
| 7386 | * } |
| 7387 | * ``` |
| 7388 | * |
| 7389 | * Using g_object_get_qdata() in the above example, instead of |
| 7390 | * g_object_steal_qdata() would have left the destroy function set, |
| 7391 | * and thus the partial string list would have been freed upon |
| 7392 | * g_object_set_qdata_full(). |
| 7393 | * @param quark A #GQuark, naming the user data pointer |
| 7394 | * @returns The user data pointer set, or %NULL |
| 7395 | */ |
| 7396 | steal_qdata(quark: GLib.Quark): any | null; |
| 7397 | /** |
| 7398 | * Reverts the effect of a previous call to |
| 7399 | * g_object_freeze_notify(). The freeze count is decreased on `object` |
| 7400 | * and when it reaches zero, queued "notify" signals are emitted. |
| 7401 | * |
| 7402 | * Duplicate notifications for each property are squashed so that at most one |
| 7403 | * #GObject::notify signal is emitted for each property, in the reverse order |
| 7404 | * in which they have been queued. |
| 7405 | * |
| 7406 | * It is an error to call this function when the freeze count is zero. |
| 7407 | */ |
| 7408 | thaw_notify(): void; |
| 7409 | /** |
| 7410 | * Decreases the reference count of `object`. When its reference count |
| 7411 | * drops to 0, the object is finalized (i.e. its memory is freed). |
| 7412 | * |
| 7413 | * If the pointer to the #GObject may be reused in future (for example, if it is |
| 7414 | * an instance variable of another object), it is recommended to clear the |
| 7415 | * pointer to %NULL rather than retain a dangling pointer to a potentially |
| 7416 | * invalid #GObject instance. Use g_clear_object() for this. |
| 7417 | */ |
| 7418 | unref(): void; |
| 7419 | /** |
| 7420 | * This function essentially limits the life time of the `closure` to |
| 7421 | * the life time of the object. That is, when the object is finalized, |
| 7422 | * the `closure` is invalidated by calling g_closure_invalidate() on |
| 7423 | * it, in order to prevent invocations of the closure with a finalized |
| 7424 | * (nonexisting) object. Also, g_object_ref() and g_object_unref() are |
| 7425 | * added as marshal guards to the `closure,` to ensure that an extra |
| 7426 | * reference count is held on `object` during invocation of the |
| 7427 | * `closure`. Usually, this function will be called on closures that |
| 7428 | * use this `object` as closure data. |
| 7429 | * @param closure #GClosure to watch |
| 7430 | */ |
| 7431 | watch_closure(closure: GObject.Closure): void; |
| 7432 | /** |
| 7433 | * the `constructed` function is called by g_object_new() as the |
| 7434 | * final step of the object creation process. At the point of the call, all |
| 7435 | * construction properties have been set on the object. The purpose of this |
| 7436 | * call is to allow for object initialisation steps that can only be performed |
| 7437 | * after construction properties have been set. `constructed` implementors |
| 7438 | * should chain up to the `constructed` call of their parent class to allow it |
| 7439 | * to complete its initialisation. |
| 7440 | */ |
| 7441 | vfunc_constructed(): void; |
| 7442 | /** |
| 7443 | * emits property change notification for a bunch |
| 7444 | * of properties. Overriding `dispatch_properties_changed` should be rarely |
| 7445 | * needed. |
| 7446 | * @param n_pspecs |
| 7447 | * @param pspecs |
| 7448 | */ |
| 7449 | vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void; |
| 7450 | /** |
| 7451 | * the `dispose` function is supposed to drop all references to other |
| 7452 | * objects, but keep the instance otherwise intact, so that client method |
| 7453 | * invocations still work. It may be run multiple times (due to reference |
| 7454 | * loops). Before returning, `dispose` should chain up to the `dispose` method |
| 7455 | * of the parent class. |
| 7456 | */ |
| 7457 | vfunc_dispose(): void; |
| 7458 | /** |
| 7459 | * instance finalization function, should finish the finalization of |
| 7460 | * the instance begun in `dispose` and chain up to the `finalize` method of the |
| 7461 | * parent class. |
| 7462 | */ |
| 7463 | vfunc_finalize(): void; |
| 7464 | /** |
| 7465 | * the generic getter for all properties of this type. Should be |
| 7466 | * overridden for every type with properties. |
| 7467 | * @param property_id |
| 7468 | * @param value |
| 7469 | * @param pspec |
| 7470 | */ |
| 7471 | vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void; |
| 7472 | /** |
| 7473 | * Emits a "notify" signal for the property `property_name` on `object`. |
| 7474 | * |
| 7475 | * When possible, eg. when signaling a property change from within the class |
| 7476 | * that registered the property, you should use g_object_notify_by_pspec() |
| 7477 | * instead. |
| 7478 | * |
| 7479 | * Note that emission of the notify signal may be blocked with |
| 7480 | * g_object_freeze_notify(). In this case, the signal emissions are queued |
| 7481 | * and will be emitted (in reverse order) when g_object_thaw_notify() is |
| 7482 | * called. |
| 7483 | * @param pspec |
| 7484 | */ |
| 7485 | vfunc_notify(pspec: GObject.ParamSpec): void; |
| 7486 | /** |
| 7487 | * the generic setter for all properties of this type. Should be |
| 7488 | * overridden for every type with properties. If implementations of |
| 7489 | * `set_property` don't emit property change notification explicitly, this will |
| 7490 | * be done implicitly by the type system. However, if the notify signal is |
| 7491 | * emitted explicitly, the type system will not emit it a second time. |
| 7492 | * @param property_id |
| 7493 | * @param value |
| 7494 | * @param pspec |
| 7495 | */ |
| 7496 | vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void; |
| 7497 | /** |
| 7498 | * Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to. |
| 7499 | * @param id Handler ID of the handler to be disconnected |
| 7500 | */ |
| 7501 | disconnect(id: number): void; |
| 7502 | /** |
| 7503 | * Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values. |
| 7504 | * @param properties Object containing the properties to set |
| 7505 | */ |
| 7506 | set(properties: { [key: string]: any }): void; |
| 7507 | /** |
| 7508 | * Blocks a handler of an instance so it will not be called during any signal emissions |
| 7509 | * @param id Handler ID of the handler to be blocked |
| 7510 | */ |
| 7511 | block_signal_handler(id: number): void; |
| 7512 | /** |
| 7513 | * Unblocks a handler so it will be called again during any signal emissions |
| 7514 | * @param id Handler ID of the handler to be unblocked |
| 7515 | */ |
| 7516 | unblock_signal_handler(id: number): void; |
| 7517 | /** |
| 7518 | * Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked. |
| 7519 | * @param detailedName Name of the signal to stop emission of |
| 7520 | */ |
| 7521 | stop_emission_by_name(detailedName: string): void; |
| 7522 | } |
| 7523 | |
| 7524 | namespace ImportButton { |
| 7525 | // Signal callback interfaces |
| 7526 | |
| 7527 | interface Imported { |
| 7528 | (importer: GObject.Object, error: GLib.Error): void; |
| 7529 | } |
| 7530 | |
| 7531 | interface Importing { |
| 7532 | (importer: GObject.Object): void; |
| 7533 | } |
| 7534 | |
| 7535 | // Constructor properties interface |
| 7536 | |
| 7537 | interface ConstructorProps |
| 7538 | extends Gtk.Button.ConstructorProps, |
| 7539 | Atk.ImplementorIface.ConstructorProps, |
| 7540 | Gtk.Actionable.ConstructorProps, |
| 7541 | Gtk.Activatable.ConstructorProps, |
| 7542 | Gtk.Buildable.ConstructorProps {} |
| 7543 | } |
| 7544 | |
| 7545 | /** |
| 7546 | * A button which imports keys and certificates. |
| 7547 | * |
| 7548 | * The import button shows a spinner when the button is activated. When more |
| 7549 | * than one importer is available, it shows a drop down to select which to |
| 7550 | * import to. |
| 7551 | */ |
| 7552 | class ImportButton |
| 7553 | extends Gtk.Button |
| 7554 | implements Atk.ImplementorIface, Gtk.Actionable, Gtk.Activatable, Gtk.Buildable |
| 7555 | { |
| 7556 | static $gtype: GObject.GType<ImportButton>; |
| 7557 | |
| 7558 | // Constructors |
| 7559 | |
| 7560 | constructor(properties?: Partial<ImportButton.ConstructorProps>, ...args: any[]); |
| 7561 | |
| 7562 | _init(...args: any[]): void; |
| 7563 | |
| 7564 | static ['new'](label?: string | null): ImportButton; |
| 7565 | // Conflicted with Gtk.Button.new |
| 7566 | |
| 7567 | static ['new'](...args: never[]): any; |
| 7568 | |
| 7569 | // Signals |
| 7570 | |
| 7571 | connect(id: string, callback: (...args: any[]) => any): number; |
| 7572 | connect_after(id: string, callback: (...args: any[]) => any): number; |
| 7573 | emit(id: string, ...args: any[]): void; |
| 7574 | connect( |
| 7575 | signal: 'imported', |
| 7576 | callback: (_source: this, importer: GObject.Object, error: GLib.Error) => void, |
| 7577 | ): number; |
| 7578 | connect_after( |
| 7579 | signal: 'imported', |
| 7580 | callback: (_source: this, importer: GObject.Object, error: GLib.Error) => void, |
| 7581 | ): number; |
| 7582 | emit(signal: 'imported', importer: GObject.Object, error: GLib.Error): void; |
| 7583 | connect(signal: 'importing', callback: (_source: this, importer: GObject.Object) => void): number; |
| 7584 | connect_after(signal: 'importing', callback: (_source: this, importer: GObject.Object) => void): number; |
| 7585 | emit(signal: 'importing', importer: GObject.Object): void; |
| 7586 | |
| 7587 | // Virtual methods |
| 7588 | |
| 7589 | /** |
| 7590 | * Emitted when the import completes, or fails. |
| 7591 | * @param importer |
| 7592 | * @param error |
| 7593 | */ |
| 7594 | vfunc_imported(importer: Gcr.Importer, error: GLib.Error): void; |
| 7595 | /** |
| 7596 | * Emitted when the import begins. |
| 7597 | * @param importer |
| 7598 | */ |
| 7599 | vfunc_importing(importer: Gcr.Importer): void; |
| 7600 | |
| 7601 | // Methods |
| 7602 | |
| 7603 | /** |
| 7604 | * Queue an item to import via the button |
| 7605 | * @param parsed a parsed item |
| 7606 | */ |
| 7607 | add_parsed(parsed: Gcr.Parsed): void; |
| 7608 | |
| 7609 | // Inherited properties |
| 7610 | get action_name(): string; |
| 7611 | set action_name(val: string); |
| 7612 | get actionName(): string; |
| 7613 | set actionName(val: string); |
| 7614 | get action_target(): GLib.Variant; |
| 7615 | set action_target(val: GLib.Variant); |
| 7616 | get actionTarget(): GLib.Variant; |
| 7617 | set actionTarget(val: GLib.Variant); |
| 7618 | /** |
| 7619 | * The action that this activatable will activate and receive |
| 7620 | * updates from for various states and possibly appearance. |
| 7621 | * |
| 7622 | * > #GtkActivatable implementors need to handle the this property and |
| 7623 | * > call gtk_activatable_do_set_related_action() when it changes. |
| 7624 | */ |
| 7625 | get related_action(): Gtk.Action; |
| 7626 | set related_action(val: Gtk.Action); |
| 7627 | /** |
| 7628 | * The action that this activatable will activate and receive |
| 7629 | * updates from for various states and possibly appearance. |
| 7630 | * |
| 7631 | * > #GtkActivatable implementors need to handle the this property and |
| 7632 | * > call gtk_activatable_do_set_related_action() when it changes. |
| 7633 | */ |
| 7634 | get relatedAction(): Gtk.Action; |
| 7635 | set relatedAction(val: Gtk.Action); |
| 7636 | /** |
| 7637 | * Whether this activatable should reset its layout |
| 7638 | * and appearance when setting the related action or when |
| 7639 | * the action changes appearance. |
| 7640 | * |
| 7641 | * See the #GtkAction documentation directly to find which properties |
| 7642 | * should be ignored by the #GtkActivatable when this property is %FALSE. |
| 7643 | * |
| 7644 | * > #GtkActivatable implementors need to handle this property |
| 7645 | * > and call gtk_activatable_sync_action_properties() on the activatable |
| 7646 | * > widget when it changes. |
| 7647 | */ |
| 7648 | get use_action_appearance(): boolean; |
| 7649 | set use_action_appearance(val: boolean); |
| 7650 | /** |
| 7651 | * Whether this activatable should reset its layout |
| 7652 | * and appearance when setting the related action or when |
| 7653 | * the action changes appearance. |
| 7654 | * |
| 7655 | * See the #GtkAction documentation directly to find which properties |
| 7656 | * should be ignored by the #GtkActivatable when this property is %FALSE. |
| 7657 | * |
| 7658 | * > #GtkActivatable implementors need to handle this property |
| 7659 | * > and call gtk_activatable_sync_action_properties() on the activatable |
| 7660 | * > widget when it changes. |
| 7661 | */ |
| 7662 | get useActionAppearance(): boolean; |
| 7663 | set useActionAppearance(val: boolean); |
| 7664 | get app_paintable(): boolean; |
| 7665 | set app_paintable(val: boolean); |
| 7666 | get appPaintable(): boolean; |
| 7667 | set appPaintable(val: boolean); |
| 7668 | get can_default(): boolean; |
| 7669 | set can_default(val: boolean); |
| 7670 | get canDefault(): boolean; |
| 7671 | set canDefault(val: boolean); |
| 7672 | get can_focus(): boolean; |
| 7673 | set can_focus(val: boolean); |
| 7674 | get canFocus(): boolean; |
| 7675 | set canFocus(val: boolean); |
| 7676 | get composite_child(): boolean; |
| 7677 | get compositeChild(): boolean; |
| 7678 | /** |
| 7679 | * Whether the widget is double buffered. |
| 7680 | */ |
| 7681 | get double_buffered(): boolean; |
| 7682 | set double_buffered(val: boolean); |
| 7683 | /** |
| 7684 | * Whether the widget is double buffered. |
| 7685 | */ |
| 7686 | get doubleBuffered(): boolean; |
| 7687 | set doubleBuffered(val: boolean); |
| 7688 | get events(): Gdk.EventMask; |
| 7689 | set events(val: Gdk.EventMask); |
| 7690 | /** |
| 7691 | * Whether to expand in both directions. Setting this sets both #GtkWidget:hexpand and #GtkWidget:vexpand |
| 7692 | */ |
| 7693 | get expand(): boolean; |
| 7694 | set expand(val: boolean); |
| 7695 | /** |
| 7696 | * Whether the widget should grab focus when it is clicked with the mouse. |
| 7697 | * |
| 7698 | * This property is only relevant for widgets that can take focus. |
| 7699 | * |
| 7700 | * Before 3.20, several widgets (GtkButton, GtkFileChooserButton, |
| 7701 | * GtkComboBox) implemented this property individually. |
| 7702 | */ |
| 7703 | get focus_on_click(): boolean; |
| 7704 | set focus_on_click(val: boolean); |
| 7705 | /** |
| 7706 | * Whether the widget should grab focus when it is clicked with the mouse. |
| 7707 | * |
| 7708 | * This property is only relevant for widgets that can take focus. |
| 7709 | * |
| 7710 | * Before 3.20, several widgets (GtkButton, GtkFileChooserButton, |
| 7711 | * GtkComboBox) implemented this property individually. |
| 7712 | */ |
| 7713 | get focusOnClick(): boolean; |
| 7714 | set focusOnClick(val: boolean); |
| 7715 | /** |
| 7716 | * How to distribute horizontal space if widget gets extra space, see #GtkAlign |
| 7717 | */ |
| 7718 | get halign(): Gtk.Align; |
| 7719 | set halign(val: Gtk.Align); |
| 7720 | get has_default(): boolean; |
| 7721 | set has_default(val: boolean); |
| 7722 | get hasDefault(): boolean; |
| 7723 | set hasDefault(val: boolean); |
| 7724 | get has_focus(): boolean; |
| 7725 | set has_focus(val: boolean); |
| 7726 | get hasFocus(): boolean; |
| 7727 | set hasFocus(val: boolean); |
| 7728 | /** |
| 7729 | * Enables or disables the emission of #GtkWidget::query-tooltip on `widget`. |
| 7730 | * A value of %TRUE indicates that `widget` can have a tooltip, in this case |
| 7731 | * the widget will be queried using #GtkWidget::query-tooltip to determine |
| 7732 | * whether it will provide a tooltip or not. |
| 7733 | * |
| 7734 | * Note that setting this property to %TRUE for the first time will change |
| 7735 | * the event masks of the GdkWindows of this widget to include leave-notify |
| 7736 | * and motion-notify events. This cannot and will not be undone when the |
| 7737 | * property is set to %FALSE again. |
| 7738 | */ |
| 7739 | get has_tooltip(): boolean; |
| 7740 | set has_tooltip(val: boolean); |
| 7741 | /** |
| 7742 | * Enables or disables the emission of #GtkWidget::query-tooltip on `widget`. |
| 7743 | * A value of %TRUE indicates that `widget` can have a tooltip, in this case |
| 7744 | * the widget will be queried using #GtkWidget::query-tooltip to determine |
| 7745 | * whether it will provide a tooltip or not. |
| 7746 | * |
| 7747 | * Note that setting this property to %TRUE for the first time will change |
| 7748 | * the event masks of the GdkWindows of this widget to include leave-notify |
| 7749 | * and motion-notify events. This cannot and will not be undone when the |
| 7750 | * property is set to %FALSE again. |
| 7751 | */ |
| 7752 | get hasTooltip(): boolean; |
| 7753 | set hasTooltip(val: boolean); |
| 7754 | get height_request(): number; |
| 7755 | set height_request(val: number); |
| 7756 | get heightRequest(): number; |
| 7757 | set heightRequest(val: number); |
| 7758 | /** |
| 7759 | * Whether to expand horizontally. See gtk_widget_set_hexpand(). |
| 7760 | */ |
| 7761 | get hexpand(): boolean; |
| 7762 | set hexpand(val: boolean); |
| 7763 | /** |
| 7764 | * Whether to use the #GtkWidget:hexpand property. See gtk_widget_get_hexpand_set(). |
| 7765 | */ |
| 7766 | get hexpand_set(): boolean; |
| 7767 | set hexpand_set(val: boolean); |
| 7768 | /** |
| 7769 | * Whether to use the #GtkWidget:hexpand property. See gtk_widget_get_hexpand_set(). |
| 7770 | */ |
| 7771 | get hexpandSet(): boolean; |
| 7772 | set hexpandSet(val: boolean); |
| 7773 | get is_focus(): boolean; |
| 7774 | set is_focus(val: boolean); |
| 7775 | get isFocus(): boolean; |
| 7776 | set isFocus(val: boolean); |
| 7777 | /** |
| 7778 | * Sets all four sides' margin at once. If read, returns max |
| 7779 | * margin on any side. |
| 7780 | */ |
| 7781 | get margin(): number; |
| 7782 | set margin(val: number); |
| 7783 | /** |
| 7784 | * Margin on bottom side of widget. |
| 7785 | * |
| 7786 | * This property adds margin outside of the widget's normal size |
| 7787 | * request, the margin will be added in addition to the size from |
| 7788 | * gtk_widget_set_size_request() for example. |
| 7789 | */ |
| 7790 | get margin_bottom(): number; |
| 7791 | set margin_bottom(val: number); |
| 7792 | /** |
| 7793 | * Margin on bottom side of widget. |
| 7794 | * |
| 7795 | * This property adds margin outside of the widget's normal size |
| 7796 | * request, the margin will be added in addition to the size from |
| 7797 | * gtk_widget_set_size_request() for example. |
| 7798 | */ |
| 7799 | get marginBottom(): number; |
| 7800 | set marginBottom(val: number); |
| 7801 | /** |
| 7802 | * Margin on end of widget, horizontally. This property supports |
| 7803 | * left-to-right and right-to-left text directions. |
| 7804 | * |
| 7805 | * This property adds margin outside of the widget's normal size |
| 7806 | * request, the margin will be added in addition to the size from |
| 7807 | * gtk_widget_set_size_request() for example. |
| 7808 | */ |
| 7809 | get margin_end(): number; |
| 7810 | set margin_end(val: number); |
| 7811 | /** |
| 7812 | * Margin on end of widget, horizontally. This property supports |
| 7813 | * left-to-right and right-to-left text directions. |
| 7814 | * |
| 7815 | * This property adds margin outside of the widget's normal size |
| 7816 | * request, the margin will be added in addition to the size from |
| 7817 | * gtk_widget_set_size_request() for example. |
| 7818 | */ |
| 7819 | get marginEnd(): number; |
| 7820 | set marginEnd(val: number); |
| 7821 | /** |
| 7822 | * Margin on left side of widget. |
| 7823 | * |
| 7824 | * This property adds margin outside of the widget's normal size |
| 7825 | * request, the margin will be added in addition to the size from |
| 7826 | * gtk_widget_set_size_request() for example. |
| 7827 | */ |
| 7828 | get margin_left(): number; |
| 7829 | set margin_left(val: number); |
| 7830 | /** |
| 7831 | * Margin on left side of widget. |
| 7832 | * |
| 7833 | * This property adds margin outside of the widget's normal size |
| 7834 | * request, the margin will be added in addition to the size from |
| 7835 | * gtk_widget_set_size_request() for example. |
| 7836 | */ |
| 7837 | get marginLeft(): number; |
| 7838 | set marginLeft(val: number); |
| 7839 | /** |
| 7840 | * Margin on right side of widget. |
| 7841 | * |
| 7842 | * This property adds margin outside of the widget's normal size |
| 7843 | * request, the margin will be added in addition to the size from |
| 7844 | * gtk_widget_set_size_request() for example. |
| 7845 | */ |
| 7846 | get margin_right(): number; |
| 7847 | set margin_right(val: number); |
| 7848 | /** |
| 7849 | * Margin on right side of widget. |
| 7850 | * |
| 7851 | * This property adds margin outside of the widget's normal size |
| 7852 | * request, the margin will be added in addition to the size from |
| 7853 | * gtk_widget_set_size_request() for example. |
| 7854 | */ |
| 7855 | get marginRight(): number; |
| 7856 | set marginRight(val: number); |
| 7857 | /** |
| 7858 | * Margin on start of widget, horizontally. This property supports |
| 7859 | * left-to-right and right-to-left text directions. |
| 7860 | * |
| 7861 | * This property adds margin outside of the widget's normal size |
| 7862 | * request, the margin will be added in addition to the size from |
| 7863 | * gtk_widget_set_size_request() for example. |
| 7864 | */ |
| 7865 | get margin_start(): number; |
| 7866 | set margin_start(val: number); |
| 7867 | /** |
| 7868 | * Margin on start of widget, horizontally. This property supports |
| 7869 | * left-to-right and right-to-left text directions. |
| 7870 | * |
| 7871 | * This property adds margin outside of the widget's normal size |
| 7872 | * request, the margin will be added in addition to the size from |
| 7873 | * gtk_widget_set_size_request() for example. |
| 7874 | */ |
| 7875 | get marginStart(): number; |
| 7876 | set marginStart(val: number); |
| 7877 | /** |
| 7878 | * Margin on top side of widget. |
| 7879 | * |
| 7880 | * This property adds margin outside of the widget's normal size |
| 7881 | * request, the margin will be added in addition to the size from |
| 7882 | * gtk_widget_set_size_request() for example. |
| 7883 | */ |
| 7884 | get margin_top(): number; |
| 7885 | set margin_top(val: number); |
| 7886 | /** |
| 7887 | * Margin on top side of widget. |
| 7888 | * |
| 7889 | * This property adds margin outside of the widget's normal size |
| 7890 | * request, the margin will be added in addition to the size from |
| 7891 | * gtk_widget_set_size_request() for example. |
| 7892 | */ |
| 7893 | get marginTop(): number; |
| 7894 | set marginTop(val: number); |
| 7895 | get name(): string; |
| 7896 | set name(val: string); |
| 7897 | get no_show_all(): boolean; |
| 7898 | set no_show_all(val: boolean); |
| 7899 | get noShowAll(): boolean; |
| 7900 | set noShowAll(val: boolean); |
| 7901 | /** |
| 7902 | * The requested opacity of the widget. See gtk_widget_set_opacity() for |
| 7903 | * more details about window opacity. |
| 7904 | * |
| 7905 | * Before 3.8 this was only available in GtkWindow |
| 7906 | */ |
| 7907 | get opacity(): number; |
| 7908 | set opacity(val: number); |
| 7909 | get parent(): Gtk.Container; |
| 7910 | set parent(val: Gtk.Container); |
| 7911 | get receives_default(): boolean; |
| 7912 | set receives_default(val: boolean); |
| 7913 | get receivesDefault(): boolean; |
| 7914 | set receivesDefault(val: boolean); |
| 7915 | /** |
| 7916 | * The scale factor of the widget. See gtk_widget_get_scale_factor() for |
| 7917 | * more details about widget scaling. |
| 7918 | */ |
| 7919 | get scale_factor(): number; |
| 7920 | /** |
| 7921 | * The scale factor of the widget. See gtk_widget_get_scale_factor() for |
| 7922 | * more details about widget scaling. |
| 7923 | */ |
| 7924 | get scaleFactor(): number; |
| 7925 | get sensitive(): boolean; |
| 7926 | set sensitive(val: boolean); |
| 7927 | /** |
| 7928 | * The style of the widget, which contains information about how it will look (colors, etc). |
| 7929 | */ |
| 7930 | get style(): Gtk.Style; |
| 7931 | set style(val: Gtk.Style); |
| 7932 | /** |
| 7933 | * Sets the text of tooltip to be the given string, which is marked up |
| 7934 | * with the [Pango text markup language][PangoMarkupFormat]. |
| 7935 | * Also see gtk_tooltip_set_markup(). |
| 7936 | * |
| 7937 | * This is a convenience property which will take care of getting the |
| 7938 | * tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip |
| 7939 | * will automatically be set to %TRUE and there will be taken care of |
| 7940 | * #GtkWidget::query-tooltip in the default signal handler. |
| 7941 | * |
| 7942 | * Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup |
| 7943 | * are set, the last one wins. |
| 7944 | */ |
| 7945 | get tooltip_markup(): string; |
| 7946 | set tooltip_markup(val: string); |
| 7947 | /** |
| 7948 | * Sets the text of tooltip to be the given string, which is marked up |
| 7949 | * with the [Pango text markup language][PangoMarkupFormat]. |
| 7950 | * Also see gtk_tooltip_set_markup(). |
| 7951 | * |
| 7952 | * This is a convenience property which will take care of getting the |
| 7953 | * tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip |
| 7954 | * will automatically be set to %TRUE and there will be taken care of |
| 7955 | * #GtkWidget::query-tooltip in the default signal handler. |
| 7956 | * |
| 7957 | * Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup |
| 7958 | * are set, the last one wins. |
| 7959 | */ |
| 7960 | get tooltipMarkup(): string; |
| 7961 | set tooltipMarkup(val: string); |
| 7962 | /** |
| 7963 | * Sets the text of tooltip to be the given string. |
| 7964 | * |
| 7965 | * Also see gtk_tooltip_set_text(). |
| 7966 | * |
| 7967 | * This is a convenience property which will take care of getting the |
| 7968 | * tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip |
| 7969 | * will automatically be set to %TRUE and there will be taken care of |
| 7970 | * #GtkWidget::query-tooltip in the default signal handler. |
| 7971 | * |
| 7972 | * Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup |
| 7973 | * are set, the last one wins. |
| 7974 | */ |
| 7975 | get tooltip_text(): string; |
| 7976 | set tooltip_text(val: string); |
| 7977 | /** |
| 7978 | * Sets the text of tooltip to be the given string. |
| 7979 | * |
| 7980 | * Also see gtk_tooltip_set_text(). |
| 7981 | * |
| 7982 | * This is a convenience property which will take care of getting the |
| 7983 | * tooltip shown if the given string is not %NULL: #GtkWidget:has-tooltip |
| 7984 | * will automatically be set to %TRUE and there will be taken care of |
| 7985 | * #GtkWidget::query-tooltip in the default signal handler. |
| 7986 | * |
| 7987 | * Note that if both #GtkWidget:tooltip-text and #GtkWidget:tooltip-markup |
| 7988 | * are set, the last one wins. |
| 7989 | */ |
| 7990 | get tooltipText(): string; |
| 7991 | set tooltipText(val: string); |
| 7992 | /** |
| 7993 | * How to distribute vertical space if widget gets extra space, see #GtkAlign |
| 7994 | */ |
| 7995 | get valign(): Gtk.Align; |
| 7996 | set valign(val: Gtk.Align); |
| 7997 | /** |
| 7998 | * Whether to expand vertically. See gtk_widget_set_vexpand(). |
| 7999 | */ |
| 8000 | get vexpand(): boolean; |
| 8001 | set vexpand(val: boolean); |
| 8002 | /** |
| 8003 | * Whether to use the #GtkWidget:vexpand property. See gtk_widget_get_vexpand_set(). |
| 8004 | */ |
| 8005 | get vexpand_set(): boolean; |
| 8006 | set vexpand_set(val: boolean); |
| 8007 | /** |
| 8008 | * Whether to use the #GtkWidget:vexpand property. See gtk_widget_get_vexpand_set(). |
| 8009 | */ |
| 8010 | get vexpandSet(): boolean; |
| 8011 | set vexpandSet(val: boolean); |
| 8012 | get visible(): boolean; |
| 8013 | set visible(val: boolean); |
| 8014 | get width_request(): number; |
| 8015 | set width_request(val: number); |
| 8016 | get widthRequest(): number; |
| 8017 | set widthRequest(val: number); |
| 8018 | /** |
| 8019 | * The widget's window if it is realized, %NULL otherwise. |
| 8020 | */ |
| 8021 | get window(): Gdk.Window; |
| 8022 | |
| 8023 | // Inherited methods |
| 8024 | /** |
| 8025 | * Gets the action name for `actionable`. |
| 8026 | * |
| 8027 | * See gtk_actionable_set_action_name() for more information. |
| 8028 | * @returns the action name, or %NULL if none is set |
| 8029 | */ |
| 8030 | get_action_name(): string | null; |
| 8031 | /** |
| 8032 | * Gets the current target value of `actionable`. |
| 8033 | * |
| 8034 | * See gtk_actionable_set_action_target_value() for more information. |
| 8035 | * @returns the current target value |
| 8036 | */ |
| 8037 | get_action_target_value(): GLib.Variant; |
| 8038 | /** |
| 8039 | * Specifies the name of the action with which this widget should be |
| 8040 | * associated. If `action_name` is %NULL then the widget will be |
| 8041 | * unassociated from any previous action. |
| 8042 | * |
| 8043 | * Usually this function is used when the widget is located (or will be |
| 8044 | * located) within the hierarchy of a #GtkApplicationWindow. |
| 8045 | * |
| 8046 | * Names are of the form “win.save” or “app.quit” for actions on the |
| 8047 | * containing #GtkApplicationWindow or its associated #GtkApplication, |
| 8048 | * respectively. This is the same form used for actions in the #GMenu |
| 8049 | * associated with the window. |
| 8050 | * @param action_name an action name, or %NULL |
| 8051 | */ |
| 8052 | set_action_name(action_name?: string | null): void; |
| 8053 | /** |
| 8054 | * Sets the target value of an actionable widget. |
| 8055 | * |
| 8056 | * If `target_value` is %NULL then the target value is unset. |
| 8057 | * |
| 8058 | * The target value has two purposes. First, it is used as the |
| 8059 | * parameter to activation of the action associated with the |
| 8060 | * #GtkActionable widget. Second, it is used to determine if the widget |
| 8061 | * should be rendered as “active” — the widget is active if the state |
| 8062 | * is equal to the given target. |
| 8063 | * |
| 8064 | * Consider the example of associating a set of buttons with a #GAction |
| 8065 | * with string state in a typical “radio button” situation. Each button |
| 8066 | * will be associated with the same action, but with a different target |
| 8067 | * value for that action. Clicking on a particular button will activate |
| 8068 | * the action with the target of that button, which will typically cause |
| 8069 | * the action’s state to change to that value. Since the action’s state |
| 8070 | * is now equal to the target value of the button, the button will now |
| 8071 | * be rendered as active (and the other buttons, with different targets, |
| 8072 | * rendered inactive). |
| 8073 | * @param target_value a #GVariant to set as the target value, or %NULL |
| 8074 | */ |
| 8075 | set_action_target_value(target_value?: GLib.Variant | null): void; |
| 8076 | /** |
| 8077 | * Sets the action-name and associated string target value of an |
| 8078 | * actionable widget. |
| 8079 | * |
| 8080 | * `detailed_action_name` is a string in the format accepted by |
| 8081 | * g_action_parse_detailed_name(). |
| 8082 | * |
| 8083 | * (Note that prior to version 3.22.25, |
| 8084 | * this function is only usable for actions with a simple "s" target, and |
| 8085 | * `detailed_action_name` must be of the form `"action::target"` where |
| 8086 | * `action` is the action name and `target` is the string to use |
| 8087 | * as the target.) |
| 8088 | * @param detailed_action_name the detailed action name |
| 8089 | */ |
| 8090 | set_detailed_action_name(detailed_action_name: string): void; |
| 8091 | /** |
| 8092 | * Gets the action name for `actionable`. |
| 8093 | * |
| 8094 | * See gtk_actionable_set_action_name() for more information. |
| 8095 | */ |
| 8096 | vfunc_get_action_name(): string | null; |
| 8097 | /** |
| 8098 | * Gets the current target value of `actionable`. |
| 8099 | * |
| 8100 | * See gtk_actionable_set_action_target_value() for more information. |
| 8101 | */ |
| 8102 | vfunc_get_action_target_value(): GLib.Variant; |
| 8103 | /** |
| 8104 | * Specifies the name of the action with which this widget should be |
| 8105 | * associated. If `action_name` is %NULL then the widget will be |
| 8106 | * unassociated from any previous action. |
| 8107 | * |
| 8108 | * Usually this function is used when the widget is located (or will be |
| 8109 | * located) within the hierarchy of a #GtkApplicationWindow. |
| 8110 | * |
| 8111 | * Names are of the form “win.save” or “app.quit” for actions on the |
| 8112 | * containing #GtkApplicationWindow or its associated #GtkApplication, |
| 8113 | * respectively. This is the same form used for actions in the #GMenu |
| 8114 | * associated with the window. |
| 8115 | * @param action_name an action name, or %NULL |
| 8116 | */ |
| 8117 | vfunc_set_action_name(action_name?: string | null): void; |
| 8118 | /** |
| 8119 | * Sets the target value of an actionable widget. |
| 8120 | * |
| 8121 | * If `target_value` is %NULL then the target value is unset. |
| 8122 | * |
| 8123 | * The target value has two purposes. First, it is used as the |
| 8124 | * parameter to activation of the action associated with the |
| 8125 | * #GtkActionable widget. Second, it is used to determine if the widget |
| 8126 | * should be rendered as “active” — the widget is active if the state |
| 8127 | * is equal to the given target. |
| 8128 | * |
| 8129 | * Consider the example of associating a set of buttons with a #GAction |
| 8130 | * with string state in a typical “radio button” situation. Each button |
| 8131 | * will be associated with the same action, but with a different target |
| 8132 | * value for that action. Clicking on a particular button will activate |
| 8133 | * the action with the target of that button, which will typically cause |
| 8134 | * the action’s state to change to that value. Since the action’s state |
| 8135 | * is now equal to the target value of the button, the button will now |
| 8136 | * be rendered as active (and the other buttons, with different targets, |
| 8137 | * rendered inactive). |
| 8138 | * @param target_value a #GVariant to set as the target value, or %NULL |
| 8139 | */ |
| 8140 | vfunc_set_action_target_value(target_value?: GLib.Variant | null): void; |
| 8141 | /** |
| 8142 | * This is a utility function for #GtkActivatable implementors. |
| 8143 | * |
| 8144 | * When implementing #GtkActivatable you must call this when |
| 8145 | * handling changes of the #GtkActivatable:related-action, and |
| 8146 | * you must also use this to break references in #GObject->dispose(). |
| 8147 | * |
| 8148 | * This function adds a reference to the currently set related |
| 8149 | * action for you, it also makes sure the #GtkActivatable->update() |
| 8150 | * method is called when the related #GtkAction properties change |
| 8151 | * and registers to the action’s proxy list. |
| 8152 | * |
| 8153 | * > Be careful to call this before setting the local |
| 8154 | * > copy of the #GtkAction property, since this function uses |
| 8155 | * > gtk_activatable_get_related_action() to retrieve the |
| 8156 | * > previous action. |
| 8157 | * @param action the #GtkAction to set |
| 8158 | */ |
| 8159 | do_set_related_action(action: Gtk.Action): void; |
| 8160 | /** |
| 8161 | * Gets the related #GtkAction for `activatable`. |
| 8162 | * @returns the related #GtkAction if one is set. |
| 8163 | */ |
| 8164 | get_related_action(): Gtk.Action; |
| 8165 | /** |
| 8166 | * Gets whether this activatable should reset its layout |
| 8167 | * and appearance when setting the related action or when |
| 8168 | * the action changes appearance. |
| 8169 | * @returns whether @activatable uses its actions appearance. |
| 8170 | */ |
| 8171 | get_use_action_appearance(): boolean; |
| 8172 | /** |
| 8173 | * Sets the related action on the `activatable` object. |
| 8174 | * |
| 8175 | * > #GtkActivatable implementors need to handle the #GtkActivatable:related-action |
| 8176 | * > property and call gtk_activatable_do_set_related_action() when it changes. |
| 8177 | * @param action the #GtkAction to set |
| 8178 | */ |
| 8179 | set_related_action(action: Gtk.Action): void; |
| 8180 | /** |
| 8181 | * Sets whether this activatable should reset its layout and appearance |
| 8182 | * when setting the related action or when the action changes appearance |
| 8183 | * |
| 8184 | * > #GtkActivatable implementors need to handle the |
| 8185 | * > #GtkActivatable:use-action-appearance property and call |
| 8186 | * > gtk_activatable_sync_action_properties() to update `activatable` |
| 8187 | * > if needed. |
| 8188 | * @param use_appearance whether to use the actions appearance |
| 8189 | */ |
| 8190 | set_use_action_appearance(use_appearance: boolean): void; |
| 8191 | /** |
| 8192 | * This is called to update the activatable completely, this is called |
| 8193 | * internally when the #GtkActivatable:related-action property is set |
| 8194 | * or unset and by the implementing class when |
| 8195 | * #GtkActivatable:use-action-appearance changes. |
| 8196 | * @param action the related #GtkAction or %NULL |
| 8197 | */ |
| 8198 | sync_action_properties(action?: Gtk.Action | null): void; |
| 8199 | /** |
| 8200 | * This is called to update the activatable completely, this is called |
| 8201 | * internally when the #GtkActivatable:related-action property is set |
| 8202 | * or unset and by the implementing class when |
| 8203 | * #GtkActivatable:use-action-appearance changes. |
| 8204 | * @param action the related #GtkAction or %NULL |
| 8205 | */ |
| 8206 | vfunc_sync_action_properties(action?: Gtk.Action | null): void; |
| 8207 | /** |
| 8208 | * Called to update the activatable when its related action’s properties change. |
| 8209 | * You must check the #GtkActivatable:use-action-appearance property only apply action |
| 8210 | * properties that are meant to effect the appearance accordingly. |
| 8211 | * @param action |
| 8212 | * @param property_name |
| 8213 | */ |
| 8214 | vfunc_update(action: Gtk.Action, property_name: string): void; |
| 8215 | /** |
| 8216 | * Creates a binding between `source_property` on `source` and `target_property` |
| 8217 | * on `target`. |
| 8218 | * |
| 8219 | * Whenever the `source_property` is changed the `target_property` is |
| 8220 | * updated using the same value. For instance: |
| 8221 | * |
| 8222 | * |
| 8223 | * ```c |
| 8224 | * g_object_bind_property (action, "active", widget, "sensitive", 0); |
| 8225 | * ``` |
| 8226 | * |
| 8227 | * |
| 8228 | * Will result in the "sensitive" property of the widget #GObject instance to be |
| 8229 | * updated with the same value of the "active" property of the action #GObject |
| 8230 | * instance. |
| 8231 | * |
| 8232 | * If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual: |
| 8233 | * if `target_property` on `target` changes then the `source_property` on `source` |
| 8234 | * will be updated as well. |
| 8235 | * |
| 8236 | * The binding will automatically be removed when either the `source` or the |
| 8237 | * `target` instances are finalized. To remove the binding without affecting the |
| 8238 | * `source` and the `target` you can just call g_object_unref() on the returned |
| 8239 | * #GBinding instance. |
| 8240 | * |
| 8241 | * Removing the binding by calling g_object_unref() on it must only be done if |
| 8242 | * the binding, `source` and `target` are only used from a single thread and it |
| 8243 | * is clear that both `source` and `target` outlive the binding. Especially it |
| 8244 | * is not safe to rely on this if the binding, `source` or `target` can be |
| 8245 | * finalized from different threads. Keep another reference to the binding and |
| 8246 | * use g_binding_unbind() instead to be on the safe side. |
| 8247 | * |
| 8248 | * A #GObject can have multiple bindings. |
| 8249 | * @param source_property the property on @source to bind |
| 8250 | * @param target the target #GObject |
| 8251 | * @param target_property the property on @target to bind |
| 8252 | * @param flags flags to pass to #GBinding |
| 8253 | * @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero. |
| 8254 | */ |
| 8255 | bind_property( |
| 8256 | source_property: string, |
| 8257 | target: GObject.Object, |
| 8258 | target_property: string, |
| 8259 | flags: GObject.BindingFlags | null, |
| 8260 | ): GObject.Binding; |
| 8261 | /** |
| 8262 | * Complete version of g_object_bind_property(). |
| 8263 | * |
| 8264 | * Creates a binding between `source_property` on `source` and `target_property` |
| 8265 | * on `target,` allowing you to set the transformation functions to be used by |
| 8266 | * the binding. |
| 8267 | * |
| 8268 | * If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual: |
| 8269 | * if `target_property` on `target` changes then the `source_property` on `source` |
| 8270 | * will be updated as well. The `transform_from` function is only used in case |
| 8271 | * of bidirectional bindings, otherwise it will be ignored |
| 8272 | * |
| 8273 | * The binding will automatically be removed when either the `source` or the |
| 8274 | * `target` instances are finalized. This will release the reference that is |
| 8275 | * being held on the #GBinding instance; if you want to hold on to the |
| 8276 | * #GBinding instance, you will need to hold a reference to it. |
| 8277 | * |
| 8278 | * To remove the binding, call g_binding_unbind(). |
| 8279 | * |
| 8280 | * A #GObject can have multiple bindings. |
| 8281 | * |
| 8282 | * The same `user_data` parameter will be used for both `transform_to` |
| 8283 | * and `transform_from` transformation functions; the `notify` function will |
| 8284 | * be called once, when the binding is removed. If you need different data |
| 8285 | * for each transformation function, please use |
| 8286 | * g_object_bind_property_with_closures() instead. |
| 8287 | * @param source_property the property on @source to bind |
| 8288 | * @param target the target #GObject |
| 8289 | * @param target_property the property on @target to bind |
| 8290 | * @param flags flags to pass to #GBinding |
| 8291 | * @param transform_to the transformation function from the @source to the @target, or %NULL to use the default |
| 8292 | * @param transform_from the transformation function from the @target to the @source, or %NULL to use the default |
| 8293 | * @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required |
| 8294 | * @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero. |
| 8295 | */ |
| 8296 | bind_property_full( |
| 8297 | source_property: string, |
| 8298 | target: GObject.Object, |
| 8299 | target_property: string, |
| 8300 | flags: GObject.BindingFlags | null, |
| 8301 | transform_to?: GObject.BindingTransformFunc | null, |
| 8302 | transform_from?: GObject.BindingTransformFunc | null, |
| 8303 | notify?: GLib.DestroyNotify | null, |
| 8304 | ): GObject.Binding; |
| 8305 | // Conflicted with GObject.Object.bind_property_full |
| 8306 | bind_property_full(...args: never[]): any; |
| 8307 | /** |
| 8308 | * This function is intended for #GObject implementations to re-enforce |
| 8309 | * a [floating][floating-ref] object reference. Doing this is seldom |
| 8310 | * required: all #GInitiallyUnowneds are created with a floating reference |
| 8311 | * which usually just needs to be sunken by calling g_object_ref_sink(). |
| 8312 | */ |
| 8313 | force_floating(): void; |
| 8314 | /** |
| 8315 | * Increases the freeze count on `object`. If the freeze count is |
| 8316 | * non-zero, the emission of "notify" signals on `object` is |
| 8317 | * stopped. The signals are queued until the freeze count is decreased |
| 8318 | * to zero. Duplicate notifications are squashed so that at most one |
| 8319 | * #GObject::notify signal is emitted for each property modified while the |
| 8320 | * object is frozen. |
| 8321 | * |
| 8322 | * This is necessary for accessors that modify multiple properties to prevent |
| 8323 | * premature notification while the object is still being modified. |
| 8324 | */ |
| 8325 | freeze_notify(): void; |
| 8326 | /** |
| 8327 | * Gets a named field from the objects table of associations (see g_object_set_data()). |
| 8328 | * @param key name of the key for that association |
| 8329 | * @returns the data if found, or %NULL if no such data exists. |
| 8330 | */ |
| 8331 | get_data(key: string): any | null; |
| 8332 | /** |
| 8333 | * Gets a property of an object. |
| 8334 | * |
| 8335 | * The value can be: |
| 8336 | * - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60) |
| 8337 | * - a GObject.Value initialized with the expected type of the property |
| 8338 | * - a GObject.Value initialized with a type to which the expected type of the property can be transformed |
| 8339 | * |
| 8340 | * In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset. |
| 8341 | * |
| 8342 | * Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming. |
| 8343 | * @param property_name The name of the property to get |
| 8344 | * @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type |
| 8345 | */ |
| 8346 | get_property(property_name: string, value: GObject.Value | any): any; |
| 8347 | /** |
| 8348 | * This function gets back user data pointers stored via |
| 8349 | * g_object_set_qdata(). |
| 8350 | * @param quark A #GQuark, naming the user data pointer |
| 8351 | * @returns The user data pointer set, or %NULL |
| 8352 | */ |
| 8353 | get_qdata(quark: GLib.Quark): any | null; |
| 8354 | /** |
| 8355 | * Gets `n_properties` properties for an `object`. |
| 8356 | * Obtained properties will be set to `values`. All properties must be valid. |
| 8357 | * Warnings will be emitted and undefined behaviour may result if invalid |
| 8358 | * properties are passed in. |
| 8359 | * @param names the names of each property to get |
| 8360 | * @param values the values of each property to get |
| 8361 | */ |
| 8362 | getv(names: string[], values: (GObject.Value | any)[]): void; |
| 8363 | /** |
| 8364 | * Checks whether `object` has a [floating][floating-ref] reference. |
| 8365 | * @returns %TRUE if @object has a floating reference |
| 8366 | */ |
| 8367 | is_floating(): boolean; |
| 8368 | /** |
| 8369 | * Emits a "notify" signal for the property `property_name` on `object`. |
| 8370 | * |
| 8371 | * When possible, eg. when signaling a property change from within the class |
| 8372 | * that registered the property, you should use g_object_notify_by_pspec() |
| 8373 | * instead. |
| 8374 | * |
| 8375 | * Note that emission of the notify signal may be blocked with |
| 8376 | * g_object_freeze_notify(). In this case, the signal emissions are queued |
| 8377 | * and will be emitted (in reverse order) when g_object_thaw_notify() is |
| 8378 | * called. |
| 8379 | * @param property_name the name of a property installed on the class of @object. |
| 8380 | */ |
| 8381 | notify(property_name: string): void; |
| 8382 | /** |
| 8383 | * Emits a "notify" signal for the property specified by `pspec` on `object`. |
| 8384 | * |
| 8385 | * This function omits the property name lookup, hence it is faster than |
| 8386 | * g_object_notify(). |
| 8387 | * |
| 8388 | * One way to avoid using g_object_notify() from within the |
| 8389 | * class that registered the properties, and using g_object_notify_by_pspec() |
| 8390 | * instead, is to store the GParamSpec used with |
| 8391 | * g_object_class_install_property() inside a static array, e.g.: |
| 8392 | * |
| 8393 | * |
| 8394 | * ```c |
| 8395 | * typedef enum |
| 8396 | * { |
| 8397 | * PROP_FOO = 1, |
| 8398 | * PROP_LAST |
| 8399 | * } MyObjectProperty; |
| 8400 | * |
| 8401 | * static GParamSpec *properties[PROP_LAST]; |
| 8402 | * |
| 8403 | * static void |
| 8404 | * my_object_class_init (MyObjectClass *klass) |
| 8405 | * { |
| 8406 | * properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL, |
| 8407 | * 0, 100, |
| 8408 | * 50, |
| 8409 | * G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); |
| 8410 | * g_object_class_install_property (gobject_class, |
| 8411 | * PROP_FOO, |
| 8412 | * properties[PROP_FOO]); |
| 8413 | * } |
| 8414 | * ``` |
| 8415 | * |
| 8416 | * |
| 8417 | * and then notify a change on the "foo" property with: |
| 8418 | * |
| 8419 | * |
| 8420 | * ```c |
| 8421 | * g_object_notify_by_pspec (self, properties[PROP_FOO]); |
| 8422 | * ``` |
| 8423 | * |
| 8424 | * @param pspec the #GParamSpec of a property installed on the class of @object. |
| 8425 | */ |
| 8426 | notify_by_pspec(pspec: GObject.ParamSpec): void; |
| 8427 | /** |
| 8428 | * Increases the reference count of `object`. |
| 8429 | * |
| 8430 | * Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type |
| 8431 | * of `object` will be propagated to the return type (using the GCC typeof() |
| 8432 | * extension), so any casting the caller needs to do on the return type must be |
| 8433 | * explicit. |
| 8434 | * @returns the same @object |
| 8435 | */ |
| 8436 | ref(): GObject.Object; |
| 8437 | /** |
| 8438 | * Increase the reference count of `object,` and possibly remove the |
| 8439 | * [floating][floating-ref] reference, if `object` has a floating reference. |
| 8440 | * |
| 8441 | * In other words, if the object is floating, then this call "assumes |
| 8442 | * ownership" of the floating reference, converting it to a normal |
| 8443 | * reference by clearing the floating flag while leaving the reference |
| 8444 | * count unchanged. If the object is not floating, then this call |
| 8445 | * adds a new normal reference increasing the reference count by one. |
| 8446 | * |
| 8447 | * Since GLib 2.56, the type of `object` will be propagated to the return type |
| 8448 | * under the same conditions as for g_object_ref(). |
| 8449 | * @returns @object |
| 8450 | */ |
| 8451 | ref_sink(): GObject.Object; |
| 8452 | /** |
| 8453 | * Releases all references to other objects. This can be used to break |
| 8454 | * reference cycles. |
| 8455 | * |
| 8456 | * This function should only be called from object system implementations. |
| 8457 | */ |
| 8458 | run_dispose(): void; |
| 8459 | /** |
| 8460 | * Each object carries around a table of associations from |
| 8461 | * strings to pointers. This function lets you set an association. |
| 8462 | * |
| 8463 | * If the object already had an association with that name, |
| 8464 | * the old association will be destroyed. |
| 8465 | * |
| 8466 | * Internally, the `key` is converted to a #GQuark using g_quark_from_string(). |
| 8467 | * This means a copy of `key` is kept permanently (even after `object` has been |
| 8468 | * finalized) — so it is recommended to only use a small, bounded set of values |
| 8469 | * for `key` in your program, to avoid the #GQuark storage growing unbounded. |
| 8470 | * @param key name of the key |
| 8471 | * @param data data to associate with that key |
| 8472 | */ |
| 8473 | set_data(key: string, data?: any | null): void; |
| 8474 | /** |
| 8475 | * Sets a property on an object. |
| 8476 | * @param property_name The name of the property to set |
| 8477 | * @param value The value to set the property to |
| 8478 | */ |
| 8479 | set_property(property_name: string, value: GObject.Value | any): void; |
| 8480 | /** |
| 8481 | * Remove a specified datum from the object's data associations, |
| 8482 | * without invoking the association's destroy handler. |
| 8483 | * @param key name of the key |
| 8484 | * @returns the data if found, or %NULL if no such data exists. |
| 8485 | */ |
| 8486 | steal_data(key: string): any | null; |
| 8487 | /** |
| 8488 | * This function gets back user data pointers stored via |
| 8489 | * g_object_set_qdata() and removes the `data` from object |
| 8490 | * without invoking its destroy() function (if any was |
| 8491 | * set). |
| 8492 | * Usually, calling this function is only required to update |
| 8493 | * user data pointers with a destroy notifier, for example: |
| 8494 | * |
| 8495 | * ```c |
| 8496 | * void |
| 8497 | * object_add_to_user_list (GObject *object, |
| 8498 | * const gchar *new_string) |
| 8499 | * { |
| 8500 | * // the quark, naming the object data |
| 8501 | * GQuark quark_string_list = g_quark_from_static_string ("my-string-list"); |
| 8502 | * // retrieve the old string list |
| 8503 | * GList *list = g_object_steal_qdata (object, quark_string_list); |
| 8504 | * |
| 8505 | * // prepend new string |
| 8506 | * list = g_list_prepend (list, g_strdup (new_string)); |
| 8507 | * // this changed 'list', so we need to set it again |
| 8508 | * g_object_set_qdata_full (object, quark_string_list, list, free_string_list); |
| 8509 | * } |
| 8510 | * static void |
| 8511 | * free_string_list (gpointer data) |
| 8512 | * { |
| 8513 | * GList *node, *list = data; |
| 8514 | * |
| 8515 | * for (node = list; node; node = node->next) |
| 8516 | * g_free (node->data); |
| 8517 | * g_list_free (list); |
| 8518 | * } |
| 8519 | * ``` |
| 8520 | * |
| 8521 | * Using g_object_get_qdata() in the above example, instead of |
| 8522 | * g_object_steal_qdata() would have left the destroy function set, |
| 8523 | * and thus the partial string list would have been freed upon |
| 8524 | * g_object_set_qdata_full(). |
| 8525 | * @param quark A #GQuark, naming the user data pointer |
| 8526 | * @returns The user data pointer set, or %NULL |
| 8527 | */ |
| 8528 | steal_qdata(quark: GLib.Quark): any | null; |
| 8529 | /** |
| 8530 | * Reverts the effect of a previous call to |
| 8531 | * g_object_freeze_notify(). The freeze count is decreased on `object` |
| 8532 | * and when it reaches zero, queued "notify" signals are emitted. |
| 8533 | * |
| 8534 | * Duplicate notifications for each property are squashed so that at most one |
| 8535 | * #GObject::notify signal is emitted for each property, in the reverse order |
| 8536 | * in which they have been queued. |
| 8537 | * |
| 8538 | * It is an error to call this function when the freeze count is zero. |
| 8539 | */ |
| 8540 | thaw_notify(): void; |
| 8541 | /** |
| 8542 | * Decreases the reference count of `object`. When its reference count |
| 8543 | * drops to 0, the object is finalized (i.e. its memory is freed). |
| 8544 | * |
| 8545 | * If the pointer to the #GObject may be reused in future (for example, if it is |
| 8546 | * an instance variable of another object), it is recommended to clear the |
| 8547 | * pointer to %NULL rather than retain a dangling pointer to a potentially |
| 8548 | * invalid #GObject instance. Use g_clear_object() for this. |
| 8549 | */ |
| 8550 | unref(): void; |
| 8551 | /** |
| 8552 | * This function essentially limits the life time of the `closure` to |
| 8553 | * the life time of the object. That is, when the object is finalized, |
| 8554 | * the `closure` is invalidated by calling g_closure_invalidate() on |
| 8555 | * it, in order to prevent invocations of the closure with a finalized |
| 8556 | * (nonexisting) object. Also, g_object_ref() and g_object_unref() are |
| 8557 | * added as marshal guards to the `closure,` to ensure that an extra |
| 8558 | * reference count is held on `object` during invocation of the |
| 8559 | * `closure`. Usually, this function will be called on closures that |
| 8560 | * use this `object` as closure data. |
| 8561 | * @param closure #GClosure to watch |
| 8562 | */ |
| 8563 | watch_closure(closure: GObject.Closure): void; |
| 8564 | /** |
| 8565 | * the `constructed` function is called by g_object_new() as the |
| 8566 | * final step of the object creation process. At the point of the call, all |
| 8567 | * construction properties have been set on the object. The purpose of this |
| 8568 | * call is to allow for object initialisation steps that can only be performed |
| 8569 | * after construction properties have been set. `constructed` implementors |
| 8570 | * should chain up to the `constructed` call of their parent class to allow it |
| 8571 | * to complete its initialisation. |
| 8572 | */ |
| 8573 | vfunc_constructed(): void; |
| 8574 | /** |
| 8575 | * emits property change notification for a bunch |
| 8576 | * of properties. Overriding `dispatch_properties_changed` should be rarely |
| 8577 | * needed. |
| 8578 | * @param n_pspecs |
| 8579 | * @param pspecs |
| 8580 | */ |
| 8581 | vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void; |
| 8582 | /** |
| 8583 | * the `dispose` function is supposed to drop all references to other |
| 8584 | * objects, but keep the instance otherwise intact, so that client method |
| 8585 | * invocations still work. It may be run multiple times (due to reference |
| 8586 | * loops). Before returning, `dispose` should chain up to the `dispose` method |
| 8587 | * of the parent class. |
| 8588 | */ |
| 8589 | vfunc_dispose(): void; |
| 8590 | /** |
| 8591 | * instance finalization function, should finish the finalization of |
| 8592 | * the instance begun in `dispose` and chain up to the `finalize` method of the |
| 8593 | * parent class. |
| 8594 | */ |
| 8595 | vfunc_finalize(): void; |
| 8596 | /** |
| 8597 | * the generic getter for all properties of this type. Should be |
| 8598 | * overridden for every type with properties. |
| 8599 | * @param property_id |
| 8600 | * @param value |
| 8601 | * @param pspec |
| 8602 | */ |
| 8603 | vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void; |
| 8604 | /** |
| 8605 | * Emits a "notify" signal for the property `property_name` on `object`. |
| 8606 | * |
| 8607 | * When possible, eg. when signaling a property change from within the class |
| 8608 | * that registered the property, you should use g_object_notify_by_pspec() |
| 8609 | * instead. |
| 8610 | * |
| 8611 | * Note that emission of the notify signal may be blocked with |
| 8612 | * g_object_freeze_notify(). In this case, the signal emissions are queued |
| 8613 | * and will be emitted (in reverse order) when g_object_thaw_notify() is |
| 8614 | * called. |
| 8615 | * @param pspec |
| 8616 | */ |
| 8617 | vfunc_notify(pspec: GObject.ParamSpec): void; |
| 8618 | /** |
| 8619 | * the generic setter for all properties of this type. Should be |
| 8620 | * overridden for every type with properties. If implementations of |
| 8621 | * `set_property` don't emit property change notification explicitly, this will |
| 8622 | * be done implicitly by the type system. However, if the notify signal is |
| 8623 | * emitted explicitly, the type system will not emit it a second time. |
| 8624 | * @param property_id |
| 8625 | * @param value |
| 8626 | * @param pspec |
| 8627 | */ |
| 8628 | vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void; |
| 8629 | /** |
| 8630 | * Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to. |
| 8631 | * @param id Handler ID of the handler to be disconnected |
| 8632 | */ |
| 8633 | disconnect(id: number): void; |
| 8634 | /** |
| 8635 | * Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values. |
| 8636 | * @param properties Object containing the properties to set |
| 8637 | */ |
| 8638 | set(properties: { [key: string]: any }): void; |
| 8639 | /** |
| 8640 | * Blocks a handler of an instance so it will not be called during any signal emissions |
| 8641 | * @param id Handler ID of the handler to be blocked |
| 8642 | */ |
| 8643 | block_signal_handler(id: number): void; |
| 8644 | /** |
| 8645 | * Unblocks a handler so it will be called again during any signal emissions |
| 8646 | * @param id Handler ID of the handler to be unblocked |
| 8647 | */ |
| 8648 | unblock_signal_handler(id: number): void; |
| 8649 | /** |
| 8650 | * Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked. |
| 8651 | * @param detailedName Name of the signal to stop emission of |
| 8652 | */ |
| 8653 | stop_emission_by_name(detailedName: string): void; |
| 8654 | /** |
| 8655 | * For widgets that can be “activated” (buttons, menu items, etc.) |
| 8656 | * this function activates them. Activation is what happens when you |
| 8657 | * press Enter on a widget during key navigation. If `widget` isn't |
| 8658 | * activatable, the function returns %FALSE. |
| 8659 | * @returns %TRUE if the widget was activatable |
| 8660 | */ |
| 8661 | activate(): boolean; |
| 8662 | /** |
| 8663 | * Installs an accelerator for this `widget` in `accel_group` that causes |
| 8664 | * `accel_signal` to be emitted if the accelerator is activated. |
| 8665 | * The `accel_group` needs to be added to the widget’s toplevel via |
| 8666 | * gtk_window_add_accel_group(), and the signal must be of type %G_SIGNAL_ACTION. |
| 8667 | * Accelerators added through this function are not user changeable during |
| 8668 | * runtime. If you want to support accelerators that can be changed by the |
| 8669 | * user, use gtk_accel_map_add_entry() and gtk_widget_set_accel_path() or |
| 8670 | * gtk_menu_item_set_accel_path() instead. |
| 8671 | * @param accel_signal widget signal to emit on accelerator activation |
| 8672 | * @param accel_group accel group for this widget, added to its toplevel |
| 8673 | * @param accel_key GDK keyval of the accelerator |
| 8674 | * @param accel_mods modifier key combination of the accelerator |
| 8675 | * @param accel_flags flag accelerators, e.g. %GTK_ACCEL_VISIBLE |
| 8676 | */ |
| 8677 | add_accelerator( |
| 8678 | accel_signal: string, |
| 8679 | accel_group: Gtk.AccelGroup, |
| 8680 | accel_key: number, |
| 8681 | accel_mods: Gdk.ModifierType | null, |
| 8682 | accel_flags: Gtk.AccelFlags | null, |
| 8683 | ): void; |
| 8684 | /** |
| 8685 | * Adds the device events in the bitfield `events` to the event mask for |
| 8686 | * `widget`. See gtk_widget_set_device_events() for details. |
| 8687 | * @param device a #GdkDevice |
| 8688 | * @param events an event mask, see #GdkEventMask |
| 8689 | */ |
| 8690 | add_device_events(device: Gdk.Device, events: Gdk.EventMask | null): void; |
| 8691 | /** |
| 8692 | * Adds the events in the bitfield `events` to the event mask for |
| 8693 | * `widget`. See gtk_widget_set_events() and the |
| 8694 | * [input handling overview][event-masks] for details. |
| 8695 | * @param events an event mask, see #GdkEventMask |
| 8696 | */ |
| 8697 | add_events(events: number): void; |
| 8698 | /** |
| 8699 | * Adds a widget to the list of mnemonic labels for |
| 8700 | * this widget. (See gtk_widget_list_mnemonic_labels()). Note the |
| 8701 | * list of mnemonic labels for the widget is cleared when the |
| 8702 | * widget is destroyed, so the caller must make sure to update |
| 8703 | * its internal state at this point as well, by using a connection |
| 8704 | * to the #GtkWidget::destroy signal or a weak notifier. |
| 8705 | * @param label a #GtkWidget that acts as a mnemonic label for @widget |
| 8706 | */ |
| 8707 | add_mnemonic_label(label: Gtk.Widget): void; |
| 8708 | /** |
| 8709 | * Queues an animation frame update and adds a callback to be called |
| 8710 | * before each frame. Until the tick callback is removed, it will be |
| 8711 | * called frequently (usually at the frame rate of the output device |
| 8712 | * or as quickly as the application can be repainted, whichever is |
| 8713 | * slower). For this reason, is most suitable for handling graphics |
| 8714 | * that change every frame or every few frames. The tick callback does |
| 8715 | * not automatically imply a relayout or repaint. If you want a |
| 8716 | * repaint or relayout, and aren’t changing widget properties that |
| 8717 | * would trigger that (for example, changing the text of a #GtkLabel), |
| 8718 | * then you will have to call gtk_widget_queue_resize() or |
| 8719 | * gtk_widget_queue_draw_area() yourself. |
| 8720 | * |
| 8721 | * gdk_frame_clock_get_frame_time() should generally be used for timing |
| 8722 | * continuous animations and |
| 8723 | * gdk_frame_timings_get_predicted_presentation_time() if you are |
| 8724 | * trying to display isolated frames at particular times. |
| 8725 | * |
| 8726 | * This is a more convenient alternative to connecting directly to the |
| 8727 | * #GdkFrameClock::update signal of #GdkFrameClock, since you don't |
| 8728 | * have to worry about when a #GdkFrameClock is assigned to a widget. |
| 8729 | * @param callback function to call for updating animations |
| 8730 | * @returns an id for the connection of this callback. Remove the callback by passing it to gtk_widget_remove_tick_callback() |
| 8731 | */ |
| 8732 | add_tick_callback(callback: Gtk.TickCallback): number; |
| 8733 | /** |
| 8734 | * Determines whether an accelerator that activates the signal |
| 8735 | * identified by `signal_id` can currently be activated. |
| 8736 | * This is done by emitting the #GtkWidget::can-activate-accel |
| 8737 | * signal on `widget;` if the signal isn’t overridden by a |
| 8738 | * handler or in a derived widget, then the default check is |
| 8739 | * that the widget must be sensitive, and the widget and all |
| 8740 | * its ancestors mapped. |
| 8741 | * @param signal_id the ID of a signal installed on @widget |
| 8742 | * @returns %TRUE if the accelerator can be activated. |
| 8743 | */ |
| 8744 | can_activate_accel(signal_id: number): boolean; |
| 8745 | /** |
| 8746 | * This function is used by custom widget implementations; if you're |
| 8747 | * writing an app, you’d use gtk_widget_grab_focus() to move the focus |
| 8748 | * to a particular widget, and gtk_container_set_focus_chain() to |
| 8749 | * change the focus tab order. So you may want to investigate those |
| 8750 | * functions instead. |
| 8751 | * |
| 8752 | * gtk_widget_child_focus() is called by containers as the user moves |
| 8753 | * around the window using keyboard shortcuts. `direction` indicates |
| 8754 | * what kind of motion is taking place (up, down, left, right, tab |
| 8755 | * forward, tab backward). gtk_widget_child_focus() emits the |
| 8756 | * #GtkWidget::focus signal; widgets override the default handler |
| 8757 | * for this signal in order to implement appropriate focus behavior. |
| 8758 | * |
| 8759 | * The default ::focus handler for a widget should return %TRUE if |
| 8760 | * moving in `direction` left the focus on a focusable location inside |
| 8761 | * that widget, and %FALSE if moving in `direction` moved the focus |
| 8762 | * outside the widget. If returning %TRUE, widgets normally |
| 8763 | * call gtk_widget_grab_focus() to place the focus accordingly; |
| 8764 | * if returning %FALSE, they don’t modify the current focus location. |
| 8765 | * @param direction direction of focus movement |
| 8766 | * @returns %TRUE if focus ended up inside @widget |
| 8767 | */ |
| 8768 | child_focus(direction: Gtk.DirectionType | null): boolean; |
| 8769 | /** |
| 8770 | * Emits a #GtkWidget::child-notify signal for the |
| 8771 | * [child property][child-properties] `child_property` |
| 8772 | * on `widget`. |
| 8773 | * |
| 8774 | * This is the analogue of g_object_notify() for child properties. |
| 8775 | * |
| 8776 | * Also see gtk_container_child_notify(). |
| 8777 | * @param child_property the name of a child property installed on the class of @widget’s parent |
| 8778 | */ |
| 8779 | child_notify(child_property: string): void; |
| 8780 | // Conflicted with Gtk.Container.child_notify |
| 8781 | child_notify(...args: never[]): any; |
| 8782 | /** |
| 8783 | * Same as gtk_widget_path(), but always uses the name of a widget’s type, |
| 8784 | * never uses a custom name set with gtk_widget_set_name(). |
| 8785 | */ |
| 8786 | class_path(): [number, string, string]; |
| 8787 | /** |
| 8788 | * Computes whether a container should give this widget extra space |
| 8789 | * when possible. Containers should check this, rather than |
| 8790 | * looking at gtk_widget_get_hexpand() or gtk_widget_get_vexpand(). |
| 8791 | * |
| 8792 | * This function already checks whether the widget is visible, so |
| 8793 | * visibility does not need to be checked separately. Non-visible |
| 8794 | * widgets are not expanded. |
| 8795 | * |
| 8796 | * The computed expand value uses either the expand setting explicitly |
| 8797 | * set on the widget itself, or, if none has been explicitly set, |
| 8798 | * the widget may expand if some of its children do. |
| 8799 | * @param orientation expand direction |
| 8800 | * @returns whether widget tree rooted here should be expanded |
| 8801 | */ |
| 8802 | compute_expand(orientation: Gtk.Orientation | null): boolean; |
| 8803 | /** |
| 8804 | * Creates a new #PangoContext with the appropriate font map, |
| 8805 | * font options, font description, and base direction for drawing |
| 8806 | * text for this widget. See also gtk_widget_get_pango_context(). |
| 8807 | * @returns the new #PangoContext |
| 8808 | */ |
| 8809 | create_pango_context(): Pango.Context; |
| 8810 | /** |
| 8811 | * Creates a new #PangoLayout with the appropriate font map, |
| 8812 | * font description, and base direction for drawing text for |
| 8813 | * this widget. |
| 8814 | * |
| 8815 | * If you keep a #PangoLayout created in this way around, you need |
| 8816 | * to re-create it when the widget #PangoContext is replaced. |
| 8817 | * This can be tracked by using the #GtkWidget::screen-changed signal |
| 8818 | * on the widget. |
| 8819 | * @param text text to set on the layout (can be %NULL) |
| 8820 | * @returns the new #PangoLayout |
| 8821 | */ |
| 8822 | create_pango_layout(text?: string | null): Pango.Layout; |
| 8823 | /** |
| 8824 | * Destroys a widget. |
| 8825 | * |
| 8826 | * When a widget is destroyed all references it holds on other objects |
| 8827 | * will be released: |
| 8828 | * |
| 8829 | * - if the widget is inside a container, it will be removed from its |
| 8830 | * parent |
| 8831 | * - if the widget is a container, all its children will be destroyed, |
| 8832 | * recursively |
| 8833 | * - if the widget is a top level, it will be removed from the list |
| 8834 | * of top level widgets that GTK+ maintains internally |
| 8835 | * |
| 8836 | * It's expected that all references held on the widget will also |
| 8837 | * be released; you should connect to the #GtkWidget::destroy signal |
| 8838 | * if you hold a reference to `widget` and you wish to remove it when |
| 8839 | * this function is called. It is not necessary to do so if you are |
| 8840 | * implementing a #GtkContainer, as you'll be able to use the |
| 8841 | * #GtkContainerClass.remove() virtual function for that. |
| 8842 | * |
| 8843 | * It's important to notice that gtk_widget_destroy() will only cause |
| 8844 | * the `widget` to be finalized if no additional references, acquired |
| 8845 | * using g_object_ref(), are held on it. In case additional references |
| 8846 | * are in place, the `widget` will be in an "inert" state after calling |
| 8847 | * this function; `widget` will still point to valid memory, allowing you |
| 8848 | * to release the references you hold, but you may not query the widget's |
| 8849 | * own state. |
| 8850 | * |
| 8851 | * You should typically call this function on top level widgets, and |
| 8852 | * rarely on child widgets. |
| 8853 | * |
| 8854 | * See also: gtk_container_remove() |
| 8855 | */ |
| 8856 | destroy(): void; |
| 8857 | /** |
| 8858 | * This function sets *`widget_pointer` to %NULL if `widget_pointer` != |
| 8859 | * %NULL. It’s intended to be used as a callback connected to the |
| 8860 | * “destroy” signal of a widget. You connect gtk_widget_destroyed() |
| 8861 | * as a signal handler, and pass the address of your widget variable |
| 8862 | * as user data. Then when the widget is destroyed, the variable will |
| 8863 | * be set to %NULL. Useful for example to avoid multiple copies |
| 8864 | * of the same dialog. |
| 8865 | * @param widget_pointer address of a variable that contains @widget |
| 8866 | */ |
| 8867 | destroyed(widget_pointer: Gtk.Widget): Gtk.Widget; |
| 8868 | /** |
| 8869 | * Returns %TRUE if `device` has been shadowed by a GTK+ |
| 8870 | * device grab on another widget, so it would stop sending |
| 8871 | * events to `widget`. This may be used in the |
| 8872 | * #GtkWidget::grab-notify signal to check for specific |
| 8873 | * devices. See gtk_device_grab_add(). |
| 8874 | * @param device a #GdkDevice |
| 8875 | * @returns %TRUE if there is an ongoing grab on @device by another #GtkWidget than @widget. |
| 8876 | */ |
| 8877 | device_is_shadowed(device: Gdk.Device): boolean; |
| 8878 | /** |
| 8879 | * This function is equivalent to gtk_drag_begin_with_coordinates(), |
| 8880 | * passing -1, -1 as coordinates. |
| 8881 | * @param targets The targets (data formats) in which the source can provide the data |
| 8882 | * @param actions A bitmask of the allowed drag actions for this drag |
| 8883 | * @param button The button the user clicked to start the drag |
| 8884 | * @param event The event that triggered the start of the drag, or %NULL if none can be obtained. |
| 8885 | * @returns the context for this drag |
| 8886 | */ |
| 8887 | drag_begin( |
| 8888 | targets: Gtk.TargetList, |
| 8889 | actions: Gdk.DragAction | null, |
| 8890 | button: number, |
| 8891 | event?: Gdk.Event | null, |
| 8892 | ): Gdk.DragContext; |
| 8893 | /** |
| 8894 | * Initiates a drag on the source side. The function only needs to be used |
| 8895 | * when the application is starting drags itself, and is not needed when |
| 8896 | * gtk_drag_source_set() is used. |
| 8897 | * |
| 8898 | * The `event` is used to retrieve the timestamp that will be used internally to |
| 8899 | * grab the pointer. If `event` is %NULL, then %GDK_CURRENT_TIME will be used. |
| 8900 | * However, you should try to pass a real event in all cases, since that can be |
| 8901 | * used to get information about the drag. |
| 8902 | * |
| 8903 | * Generally there are three cases when you want to start a drag by hand by |
| 8904 | * calling this function: |
| 8905 | * |
| 8906 | * 1. During a #GtkWidget::button-press-event handler, if you want to start a drag |
| 8907 | * immediately when the user presses the mouse button. Pass the `event` |
| 8908 | * that you have in your #GtkWidget::button-press-event handler. |
| 8909 | * |
| 8910 | * 2. During a #GtkWidget::motion-notify-event handler, if you want to start a drag |
| 8911 | * when the mouse moves past a certain threshold distance after a button-press. |
| 8912 | * Pass the `event` that you have in your #GtkWidget::motion-notify-event handler. |
| 8913 | * |
| 8914 | * 3. During a timeout handler, if you want to start a drag after the mouse |
| 8915 | * button is held down for some time. Try to save the last event that you got |
| 8916 | * from the mouse, using gdk_event_copy(), and pass it to this function |
| 8917 | * (remember to free the event with gdk_event_free() when you are done). |
| 8918 | * If you really cannot pass a real event, pass %NULL instead. |
| 8919 | * @param targets The targets (data formats) in which the source can provide the data |
| 8920 | * @param actions A bitmask of the allowed drag actions for this drag |
| 8921 | * @param button The button the user clicked to start the drag |
| 8922 | * @param event The event that triggered the start of the drag, or %NULL if none can be obtained. |
| 8923 | * @param x The initial x coordinate to start dragging from, in the coordinate space of @widget. If -1 is passed, the coordinates are retrieved from @event or the current pointer position |
| 8924 | * @param y The initial y coordinate to start dragging from, in the coordinate space of @widget. If -1 is passed, the coordinates are retrieved from @event or the current pointer position |
| 8925 | * @returns the context for this drag |
| 8926 | */ |
| 8927 | drag_begin_with_coordinates( |
| 8928 | targets: Gtk.TargetList, |
| 8929 | actions: Gdk.DragAction | null, |
| 8930 | button: number, |
| 8931 | event: Gdk.Event | null, |
| 8932 | x: number, |
| 8933 | y: number, |
| 8934 | ): Gdk.DragContext; |
| 8935 | /** |
| 8936 | * Checks to see if a mouse drag starting at (`start_x,` `start_y)` and ending |
| 8937 | * at (`current_x,` `current_y)` has passed the GTK+ drag threshold, and thus |
| 8938 | * should trigger the beginning of a drag-and-drop operation. |
| 8939 | * @param start_x X coordinate of start of drag |
| 8940 | * @param start_y Y coordinate of start of drag |
| 8941 | * @param current_x current X coordinate |
| 8942 | * @param current_y current Y coordinate |
| 8943 | * @returns %TRUE if the drag threshold has been passed. |
| 8944 | */ |
| 8945 | drag_check_threshold(start_x: number, start_y: number, current_x: number, current_y: number): boolean; |
| 8946 | /** |
| 8947 | * Add the image targets supported by #GtkSelectionData to |
| 8948 | * the target list of the drag destination. The targets |
| 8949 | * are added with `info` = 0. If you need another value, |
| 8950 | * use gtk_target_list_add_image_targets() and |
| 8951 | * gtk_drag_dest_set_target_list(). |
| 8952 | */ |
| 8953 | drag_dest_add_image_targets(): void; |
| 8954 | /** |
| 8955 | * Add the text targets supported by #GtkSelectionData to |
| 8956 | * the target list of the drag destination. The targets |
| 8957 | * are added with `info` = 0. If you need another value, |
| 8958 | * use gtk_target_list_add_text_targets() and |
| 8959 | * gtk_drag_dest_set_target_list(). |
| 8960 | */ |
| 8961 | drag_dest_add_text_targets(): void; |
| 8962 | /** |
| 8963 | * Add the URI targets supported by #GtkSelectionData to |
| 8964 | * the target list of the drag destination. The targets |
| 8965 | * are added with `info` = 0. If you need another value, |
| 8966 | * use gtk_target_list_add_uri_targets() and |
| 8967 | * gtk_drag_dest_set_target_list(). |
| 8968 | */ |
| 8969 | drag_dest_add_uri_targets(): void; |
| 8970 | /** |
| 8971 | * Looks for a match between the supported targets of `context` and the |
| 8972 | * `dest_target_list,` returning the first matching target, otherwise |
| 8973 | * returning %GDK_NONE. `dest_target_list` should usually be the return |
| 8974 | * value from gtk_drag_dest_get_target_list(), but some widgets may |
| 8975 | * have different valid targets for different parts of the widget; in |
| 8976 | * that case, they will have to implement a drag_motion handler that |
| 8977 | * passes the correct target list to this function. |
| 8978 | * @param context drag context |
| 8979 | * @param target_list list of droppable targets, or %NULL to use gtk_drag_dest_get_target_list (@widget). |
| 8980 | * @returns first target that the source offers and the dest can accept, or %GDK_NONE |
| 8981 | */ |
| 8982 | drag_dest_find_target(context: Gdk.DragContext, target_list?: Gtk.TargetList | null): Gdk.Atom; |
| 8983 | /** |
| 8984 | * Returns the list of targets this widget can accept from |
| 8985 | * drag-and-drop. |
| 8986 | * @returns the #GtkTargetList, or %NULL if none |
| 8987 | */ |
| 8988 | drag_dest_get_target_list(): Gtk.TargetList | null; |
| 8989 | /** |
| 8990 | * Returns whether the widget has been configured to always |
| 8991 | * emit #GtkWidget::drag-motion signals. |
| 8992 | * @returns %TRUE if the widget always emits #GtkWidget::drag-motion events |
| 8993 | */ |
| 8994 | drag_dest_get_track_motion(): boolean; |
| 8995 | /** |
| 8996 | * Sets a widget as a potential drop destination, and adds default behaviors. |
| 8997 | * |
| 8998 | * The default behaviors listed in `flags` have an effect similar |
| 8999 | * to installing default handlers for the widget’s drag-and-drop signals |
| 9000 | * (#GtkWidget::drag-motion, #GtkWidget::drag-drop, ...). They all exist |
| 9001 | * for convenience. When passing #GTK_DEST_DEFAULT_ALL for instance it is |
| 9002 | * sufficient to connect to the widget’s #GtkWidget::drag-data-received |
| 9003 | * signal to get primitive, but consistent drag-and-drop support. |
| 9004 | * |
| 9005 | * Things become more complicated when you try to preview the dragged data, |
| 9006 | * as described in the documentation for #GtkWidget::drag-motion. The default |
| 9007 | * behaviors described by `flags` make some assumptions, that can conflict |
| 9008 | * with your own signal handlers. For instance #GTK_DEST_DEFAULT_DROP causes |
| 9009 | * invokations of gdk_drag_status() in the context of #GtkWidget::drag-motion, |
| 9010 | * and invokations of gtk_drag_finish() in #GtkWidget::drag-data-received. |
| 9011 | * Especially the later is dramatic, when your own #GtkWidget::drag-motion |
| 9012 | * handler calls gtk_drag_get_data() to inspect the dragged data. |
| 9013 | * |
| 9014 | * There’s no way to set a default action here, you can use the |
| 9015 | * #GtkWidget::drag-motion callback for that. Here’s an example which selects |
| 9016 | * the action to use depending on whether the control key is pressed or not: |
| 9017 | * |
| 9018 | * ```c |
| 9019 | * static void |
| 9020 | * drag_motion (GtkWidget *widget, |
| 9021 | * GdkDragContext *context, |
| 9022 | * gint x, |
| 9023 | * gint y, |
| 9024 | * guint time) |
| 9025 | * { |
| 9026 | * GdkModifierType mask; |
| 9027 | * |
| 9028 | * gdk_window_get_pointer (gtk_widget_get_window (widget), |
| 9029 | * NULL, NULL, &mask); |
| 9030 | * if (mask & GDK_CONTROL_MASK) |
| 9031 | * gdk_drag_status (context, GDK_ACTION_COPY, time); |
| 9032 | * else |
| 9033 | * gdk_drag_status (context, GDK_ACTION_MOVE, time); |
| 9034 | * } |
| 9035 | * ``` |
| 9036 | * |
| 9037 | * @param flags which types of default drag behavior to use |
| 9038 | * @param targets a pointer to an array of #GtkTargetEntrys indicating the drop types that this @widget will accept, or %NULL. Later you can access the list with gtk_drag_dest_get_target_list() and gtk_drag_dest_find_target(). |
| 9039 | * @param actions a bitmask of possible actions for a drop onto this @widget. |
| 9040 | */ |
| 9041 | drag_dest_set( |
| 9042 | flags: Gtk.DestDefaults | null, |
| 9043 | targets: Gtk.TargetEntry[] | null, |
| 9044 | actions: Gdk.DragAction | null, |
| 9045 | ): void; |
| 9046 | /** |
| 9047 | * Sets this widget as a proxy for drops to another window. |
| 9048 | * @param proxy_window the window to which to forward drag events |
| 9049 | * @param protocol the drag protocol which the @proxy_window accepts (You can use gdk_drag_get_protocol() to determine this) |
| 9050 | * @param use_coordinates If %TRUE, send the same coordinates to the destination, because it is an embedded subwindow. |
| 9051 | */ |
| 9052 | drag_dest_set_proxy( |
| 9053 | proxy_window: Gdk.Window, |
| 9054 | protocol: Gdk.DragProtocol | null, |
| 9055 | use_coordinates: boolean, |
| 9056 | ): void; |
| 9057 | /** |
| 9058 | * Sets the target types that this widget can accept from drag-and-drop. |
| 9059 | * The widget must first be made into a drag destination with |
| 9060 | * gtk_drag_dest_set(). |
| 9061 | * @param target_list list of droppable targets, or %NULL for none |
| 9062 | */ |
| 9063 | drag_dest_set_target_list(target_list?: Gtk.TargetList | null): void; |
| 9064 | /** |
| 9065 | * Tells the widget to emit #GtkWidget::drag-motion and |
| 9066 | * #GtkWidget::drag-leave events regardless of the targets and the |
| 9067 | * %GTK_DEST_DEFAULT_MOTION flag. |
| 9068 | * |
| 9069 | * This may be used when a widget wants to do generic |
| 9070 | * actions regardless of the targets that the source offers. |
| 9071 | * @param track_motion whether to accept all targets |
| 9072 | */ |
| 9073 | drag_dest_set_track_motion(track_motion: boolean): void; |
| 9074 | /** |
| 9075 | * Clears information about a drop destination set with |
| 9076 | * gtk_drag_dest_set(). The widget will no longer receive |
| 9077 | * notification of drags. |
| 9078 | */ |
| 9079 | drag_dest_unset(): void; |
| 9080 | /** |
| 9081 | * Gets the data associated with a drag. When the data |
| 9082 | * is received or the retrieval fails, GTK+ will emit a |
| 9083 | * #GtkWidget::drag-data-received signal. Failure of the retrieval |
| 9084 | * is indicated by the length field of the `selection_data` |
| 9085 | * signal parameter being negative. However, when gtk_drag_get_data() |
| 9086 | * is called implicitely because the %GTK_DEST_DEFAULT_DROP was set, |
| 9087 | * then the widget will not receive notification of failed |
| 9088 | * drops. |
| 9089 | * @param context the drag context |
| 9090 | * @param target the target (form of the data) to retrieve |
| 9091 | * @param time_ a timestamp for retrieving the data. This will generally be the time received in a #GtkWidget::drag-motion or #GtkWidget::drag-drop signal |
| 9092 | */ |
| 9093 | drag_get_data(context: Gdk.DragContext, target: Gdk.Atom, time_: number): void; |
| 9094 | /** |
| 9095 | * Highlights a widget as a currently hovered drop target. |
| 9096 | * To end the highlight, call gtk_drag_unhighlight(). |
| 9097 | * GTK+ calls this automatically if %GTK_DEST_DEFAULT_HIGHLIGHT is set. |
| 9098 | */ |
| 9099 | drag_highlight(): void; |
| 9100 | /** |
| 9101 | * Add the writable image targets supported by #GtkSelectionData to |
| 9102 | * the target list of the drag source. The targets |
| 9103 | * are added with `info` = 0. If you need another value, |
| 9104 | * use gtk_target_list_add_image_targets() and |
| 9105 | * gtk_drag_source_set_target_list(). |
| 9106 | */ |
| 9107 | drag_source_add_image_targets(): void; |
| 9108 | /** |
| 9109 | * Add the text targets supported by #GtkSelectionData to |
| 9110 | * the target list of the drag source. The targets |
| 9111 | * are added with `info` = 0. If you need another value, |
| 9112 | * use gtk_target_list_add_text_targets() and |
| 9113 | * gtk_drag_source_set_target_list(). |
| 9114 | */ |
| 9115 | drag_source_add_text_targets(): void; |
| 9116 | /** |
| 9117 | * Add the URI targets supported by #GtkSelectionData to |
| 9118 | * the target list of the drag source. The targets |
| 9119 | * are added with `info` = 0. If you need another value, |
| 9120 | * use gtk_target_list_add_uri_targets() and |
| 9121 | * gtk_drag_source_set_target_list(). |
| 9122 | */ |
| 9123 | drag_source_add_uri_targets(): void; |
| 9124 | /** |
| 9125 | * Gets the list of targets this widget can provide for |
| 9126 | * drag-and-drop. |
| 9127 | * @returns the #GtkTargetList, or %NULL if none |
| 9128 | */ |
| 9129 | drag_source_get_target_list(): Gtk.TargetList | null; |
| 9130 | /** |
| 9131 | * Sets up a widget so that GTK+ will start a drag operation when the user |
| 9132 | * clicks and drags on the widget. The widget must have a window. |
| 9133 | * @param start_button_mask the bitmask of buttons that can start the drag |
| 9134 | * @param targets the table of targets that the drag will support, may be %NULL |
| 9135 | * @param actions the bitmask of possible actions for a drag from this widget |
| 9136 | */ |
| 9137 | drag_source_set( |
| 9138 | start_button_mask: Gdk.ModifierType | null, |
| 9139 | targets: Gtk.TargetEntry[] | null, |
| 9140 | actions: Gdk.DragAction | null, |
| 9141 | ): void; |
| 9142 | /** |
| 9143 | * Sets the icon that will be used for drags from a particular source |
| 9144 | * to `icon`. See the docs for #GtkIconTheme for more details. |
| 9145 | * @param icon A #GIcon |
| 9146 | */ |
| 9147 | drag_source_set_icon_gicon(icon: Gio.Icon): void; |
| 9148 | /** |
| 9149 | * Sets the icon that will be used for drags from a particular source |
| 9150 | * to a themed icon. See the docs for #GtkIconTheme for more details. |
| 9151 | * @param icon_name name of icon to use |
| 9152 | */ |
| 9153 | drag_source_set_icon_name(icon_name: string): void; |
| 9154 | /** |
| 9155 | * Sets the icon that will be used for drags from a particular widget |
| 9156 | * from a #GdkPixbuf. GTK+ retains a reference for `pixbuf` and will |
| 9157 | * release it when it is no longer needed. |
| 9158 | * @param pixbuf the #GdkPixbuf for the drag icon |
| 9159 | */ |
| 9160 | drag_source_set_icon_pixbuf(pixbuf: GdkPixbuf.Pixbuf): void; |
| 9161 | /** |
| 9162 | * Sets the icon that will be used for drags from a particular source |
| 9163 | * to a stock icon. |
| 9164 | * @param stock_id the ID of the stock icon to use |
| 9165 | */ |
| 9166 | drag_source_set_icon_stock(stock_id: string): void; |
| 9167 | /** |
| 9168 | * Changes the target types that this widget offers for drag-and-drop. |
| 9169 | * The widget must first be made into a drag source with |
| 9170 | * gtk_drag_source_set(). |
| 9171 | * @param target_list list of draggable targets, or %NULL for none |
| 9172 | */ |
| 9173 | drag_source_set_target_list(target_list?: Gtk.TargetList | null): void; |
| 9174 | /** |
| 9175 | * Undoes the effects of gtk_drag_source_set(). |
| 9176 | */ |
| 9177 | drag_source_unset(): void; |
| 9178 | /** |
| 9179 | * Removes a highlight set by gtk_drag_highlight() from |
| 9180 | * a widget. |
| 9181 | */ |
| 9182 | drag_unhighlight(): void; |
| 9183 | /** |
| 9184 | * Draws `widget` to `cr`. The top left corner of the widget will be |
| 9185 | * drawn to the currently set origin point of `cr`. |
| 9186 | * |
| 9187 | * You should pass a cairo context as `cr` argument that is in an |
| 9188 | * original state. Otherwise the resulting drawing is undefined. For |
| 9189 | * example changing the operator using cairo_set_operator() or the |
| 9190 | * line width using cairo_set_line_width() might have unwanted side |
| 9191 | * effects. |
| 9192 | * You may however change the context’s transform matrix - like with |
| 9193 | * cairo_scale(), cairo_translate() or cairo_set_matrix() and clip |
| 9194 | * region with cairo_clip() prior to calling this function. Also, it |
| 9195 | * is fine to modify the context with cairo_save() and |
| 9196 | * cairo_push_group() prior to calling this function. |
| 9197 | * |
| 9198 | * Note that special-purpose widgets may contain special code for |
| 9199 | * rendering to the screen and might appear differently on screen |
| 9200 | * and when rendered using gtk_widget_draw(). |
| 9201 | * @param cr a cairo context to draw to |
| 9202 | */ |
| 9203 | draw(cr: cairo.Context): void; |
| 9204 | /** |
| 9205 | * Ensures that `widget` has a style (`widget->`style). |
| 9206 | * |
| 9207 | * Not a very useful function; most of the time, if you |
| 9208 | * want the style, the widget is realized, and realized |
| 9209 | * widgets are guaranteed to have a style already. |
| 9210 | */ |
| 9211 | ensure_style(): void; |
| 9212 | /** |
| 9213 | * Notifies the user about an input-related error on this widget. |
| 9214 | * If the #GtkSettings:gtk-error-bell setting is %TRUE, it calls |
| 9215 | * gdk_window_beep(), otherwise it does nothing. |
| 9216 | * |
| 9217 | * Note that the effect of gdk_window_beep() can be configured in many |
| 9218 | * ways, depending on the windowing backend and the desktop environment |
| 9219 | * or window manager that is used. |
| 9220 | */ |
| 9221 | error_bell(): void; |
| 9222 | /** |
| 9223 | * Rarely-used function. This function is used to emit |
| 9224 | * the event signals on a widget (those signals should never |
| 9225 | * be emitted without using this function to do so). |
| 9226 | * If you want to synthesize an event though, don’t use this function; |
| 9227 | * instead, use gtk_main_do_event() so the event will behave as if |
| 9228 | * it were in the event queue. Don’t synthesize expose events; instead, |
| 9229 | * use gdk_window_invalidate_rect() to invalidate a region of the |
| 9230 | * window. |
| 9231 | * @param event a #GdkEvent |
| 9232 | * @returns return from the event signal emission (%TRUE if the event was handled) |
| 9233 | */ |
| 9234 | event(event: Gdk.Event): boolean; |
| 9235 | /** |
| 9236 | * Stops emission of #GtkWidget::child-notify signals on `widget`. The |
| 9237 | * signals are queued until gtk_widget_thaw_child_notify() is called |
| 9238 | * on `widget`. |
| 9239 | * |
| 9240 | * This is the analogue of g_object_freeze_notify() for child properties. |
| 9241 | */ |
| 9242 | freeze_child_notify(): void; |
| 9243 | /** |
| 9244 | * Returns the accessible object that describes the widget to an |
| 9245 | * assistive technology. |
| 9246 | * |
| 9247 | * If accessibility support is not available, this #AtkObject |
| 9248 | * instance may be a no-op. Likewise, if no class-specific #AtkObject |
| 9249 | * implementation is available for the widget instance in question, |
| 9250 | * it will inherit an #AtkObject implementation from the first ancestor |
| 9251 | * class for which such an implementation is defined. |
| 9252 | * |
| 9253 | * The documentation of the |
| 9254 | * [ATK](http://developer.gnome.org/atk/stable/) |
| 9255 | * library contains more information about accessible objects and their uses. |
| 9256 | * @returns the #AtkObject associated with @widget |
| 9257 | */ |
| 9258 | get_accessible(): Atk.Object; |
| 9259 | /** |
| 9260 | * Retrieves the #GActionGroup that was registered using `prefix`. The resulting |
| 9261 | * #GActionGroup may have been registered to `widget` or any #GtkWidget in its |
| 9262 | * ancestry. |
| 9263 | * |
| 9264 | * If no action group was found matching `prefix,` then %NULL is returned. |
| 9265 | * @param prefix The “prefix” of the action group. |
| 9266 | * @returns A #GActionGroup or %NULL. |
| 9267 | */ |
| 9268 | get_action_group(prefix: string): Gio.ActionGroup | null; |
| 9269 | /** |
| 9270 | * Returns the baseline that has currently been allocated to `widget`. |
| 9271 | * This function is intended to be used when implementing handlers |
| 9272 | * for the #GtkWidget::draw function, and when allocating child |
| 9273 | * widgets in #GtkWidget::size_allocate. |
| 9274 | * @returns the baseline of the @widget, or -1 if none |
| 9275 | */ |
| 9276 | get_allocated_baseline(): number; |
| 9277 | /** |
| 9278 | * Returns the height that has currently been allocated to `widget`. |
| 9279 | * This function is intended to be used when implementing handlers |
| 9280 | * for the #GtkWidget::draw function. |
| 9281 | * @returns the height of the @widget |
| 9282 | */ |
| 9283 | get_allocated_height(): number; |
| 9284 | /** |
| 9285 | * Retrieves the widget’s allocated size. |
| 9286 | * |
| 9287 | * This function returns the last values passed to |
| 9288 | * gtk_widget_size_allocate_with_baseline(). The value differs from |
| 9289 | * the size returned in gtk_widget_get_allocation() in that functions |
| 9290 | * like gtk_widget_set_halign() can adjust the allocation, but not |
| 9291 | * the value returned by this function. |
| 9292 | * |
| 9293 | * If a widget is not visible, its allocated size is 0. |
| 9294 | */ |
| 9295 | get_allocated_size(): [Gtk.Allocation, number]; |
| 9296 | /** |
| 9297 | * Returns the width that has currently been allocated to `widget`. |
| 9298 | * This function is intended to be used when implementing handlers |
| 9299 | * for the #GtkWidget::draw function. |
| 9300 | * @returns the width of the @widget |
| 9301 | */ |
| 9302 | get_allocated_width(): number; |
| 9303 | /** |
| 9304 | * Retrieves the widget’s allocation. |
| 9305 | * |
| 9306 | * Note, when implementing a #GtkContainer: a widget’s allocation will |
| 9307 | * be its “adjusted” allocation, that is, the widget’s parent |
| 9308 | * container typically calls gtk_widget_size_allocate() with an |
| 9309 | * allocation, and that allocation is then adjusted (to handle margin |
| 9310 | * and alignment for example) before assignment to the widget. |
| 9311 | * gtk_widget_get_allocation() returns the adjusted allocation that |
| 9312 | * was actually assigned to the widget. The adjusted allocation is |
| 9313 | * guaranteed to be completely contained within the |
| 9314 | * gtk_widget_size_allocate() allocation, however. So a #GtkContainer |
| 9315 | * is guaranteed that its children stay inside the assigned bounds, |
| 9316 | * but not that they have exactly the bounds the container assigned. |
| 9317 | * There is no way to get the original allocation assigned by |
| 9318 | * gtk_widget_size_allocate(), since it isn’t stored; if a container |
| 9319 | * implementation needs that information it will have to track it itself. |
| 9320 | */ |
| 9321 | get_allocation(): Gtk.Allocation; |
| 9322 | /** |
| 9323 | * Gets the first ancestor of `widget` with type `widget_type`. For example, |
| 9324 | * `gtk_widget_get_ancestor (widget, GTK_TYPE_BOX)` gets |
| 9325 | * the first #GtkBox that’s an ancestor of `widget`. No reference will be |
| 9326 | * added to the returned widget; it should not be unreferenced. See note |
| 9327 | * about checking for a toplevel #GtkWindow in the docs for |
| 9328 | * gtk_widget_get_toplevel(). |
| 9329 | * |
| 9330 | * Note that unlike gtk_widget_is_ancestor(), gtk_widget_get_ancestor() |
| 9331 | * considers `widget` to be an ancestor of itself. |
| 9332 | * @param widget_type ancestor type |
| 9333 | * @returns the ancestor widget, or %NULL if not found |
| 9334 | */ |
| 9335 | get_ancestor(widget_type: GObject.GType): Gtk.Widget | null; |
| 9336 | /** |
| 9337 | * Determines whether the application intends to draw on the widget in |
| 9338 | * an #GtkWidget::draw handler. |
| 9339 | * |
| 9340 | * See gtk_widget_set_app_paintable() |
| 9341 | * @returns %TRUE if the widget is app paintable |
| 9342 | */ |
| 9343 | get_app_paintable(): boolean; |
| 9344 | /** |
| 9345 | * Determines whether `widget` can be a default widget. See |
| 9346 | * gtk_widget_set_can_default(). |
| 9347 | * @returns %TRUE if @widget can be a default widget, %FALSE otherwise |
| 9348 | */ |
| 9349 | get_can_default(): boolean; |
| 9350 | /** |
| 9351 | * Determines whether `widget` can own the input focus. See |
| 9352 | * gtk_widget_set_can_focus(). |
| 9353 | * @returns %TRUE if @widget can own the input focus, %FALSE otherwise |
| 9354 | */ |
| 9355 | get_can_focus(): boolean; |
| 9356 | /** |
| 9357 | * This function is only for use in widget implementations. Obtains |
| 9358 | * `widget->`requisition, unless someone has forced a particular |
| 9359 | * geometry on the widget (e.g. with gtk_widget_set_size_request()), |
| 9360 | * in which case it returns that geometry instead of the widget's |
| 9361 | * requisition. |
| 9362 | * |
| 9363 | * This function differs from gtk_widget_size_request() in that |
| 9364 | * it retrieves the last size request value from `widget->`requisition, |
| 9365 | * while gtk_widget_size_request() actually calls the "size_request" method |
| 9366 | * on `widget` to compute the size request and fill in `widget->`requisition, |
| 9367 | * and only then returns `widget->`requisition. |
| 9368 | * |
| 9369 | * Because this function does not call the “size_request” method, it |
| 9370 | * can only be used when you know that `widget->`requisition is |
| 9371 | * up-to-date, that is, gtk_widget_size_request() has been called |
| 9372 | * since the last time a resize was queued. In general, only container |
| 9373 | * implementations have this information; applications should use |
| 9374 | * gtk_widget_size_request(). |
| 9375 | */ |
| 9376 | get_child_requisition(): Gtk.Requisition; |
| 9377 | /** |
| 9378 | * Gets the value set with gtk_widget_set_child_visible(). |
| 9379 | * If you feel a need to use this function, your code probably |
| 9380 | * needs reorganization. |
| 9381 | * |
| 9382 | * This function is only useful for container implementations and |
| 9383 | * never should be called by an application. |
| 9384 | * @returns %TRUE if the widget is mapped with the parent. |
| 9385 | */ |
| 9386 | get_child_visible(): boolean; |
| 9387 | /** |
| 9388 | * Retrieves the widget’s clip area. |
| 9389 | * |
| 9390 | * The clip area is the area in which all of `widget'`s drawing will |
| 9391 | * happen. Other toolkits call it the bounding box. |
| 9392 | * |
| 9393 | * Historically, in GTK+ the clip area has been equal to the allocation |
| 9394 | * retrieved via gtk_widget_get_allocation(). |
| 9395 | */ |
| 9396 | get_clip(): Gtk.Allocation; |
| 9397 | /** |
| 9398 | * Returns the clipboard object for the given selection to |
| 9399 | * be used with `widget`. `widget` must have a #GdkDisplay |
| 9400 | * associated with it, so must be attached to a toplevel |
| 9401 | * window. |
| 9402 | * @param selection a #GdkAtom which identifies the clipboard to use. %GDK_SELECTION_CLIPBOARD gives the default clipboard. Another common value is %GDK_SELECTION_PRIMARY, which gives the primary X selection. |
| 9403 | * @returns the appropriate clipboard object. If no clipboard already exists, a new one will be created. Once a clipboard object has been created, it is persistent for all time. |
| 9404 | */ |
| 9405 | get_clipboard(selection: Gdk.Atom): Gtk.Clipboard; |
| 9406 | /** |
| 9407 | * Obtains the composite name of a widget. |
| 9408 | * @returns the composite name of @widget, or %NULL if @widget is not a composite child. The string should be freed when it is no longer needed. |
| 9409 | */ |
| 9410 | get_composite_name(): string; |
| 9411 | /** |
| 9412 | * Returns whether `device` can interact with `widget` and its |
| 9413 | * children. See gtk_widget_set_device_enabled(). |
| 9414 | * @param device a #GdkDevice |
| 9415 | * @returns %TRUE is @device is enabled for @widget |
| 9416 | */ |
| 9417 | get_device_enabled(device: Gdk.Device): boolean; |
| 9418 | /** |
| 9419 | * Returns the events mask for the widget corresponding to an specific device. These |
| 9420 | * are the events that the widget will receive when `device` operates on it. |
| 9421 | * @param device a #GdkDevice |
| 9422 | * @returns device event mask for @widget |
| 9423 | */ |
| 9424 | get_device_events(device: Gdk.Device): Gdk.EventMask; |
| 9425 | /** |
| 9426 | * Gets the reading direction for a particular widget. See |
| 9427 | * gtk_widget_set_direction(). |
| 9428 | * @returns the reading direction for the widget. |
| 9429 | */ |
| 9430 | get_direction(): Gtk.TextDirection; |
| 9431 | /** |
| 9432 | * Get the #GdkDisplay for the toplevel window associated with |
| 9433 | * this widget. This function can only be called after the widget |
| 9434 | * has been added to a widget hierarchy with a #GtkWindow at the top. |
| 9435 | * |
| 9436 | * In general, you should only create display specific |
| 9437 | * resources when a widget has been realized, and you should |
| 9438 | * free those resources when the widget is unrealized. |
| 9439 | * @returns the #GdkDisplay for the toplevel for this widget. |
| 9440 | */ |
| 9441 | get_display(): Gdk.Display; |
| 9442 | /** |
| 9443 | * Determines whether the widget is double buffered. |
| 9444 | * |
| 9445 | * See gtk_widget_set_double_buffered() |
| 9446 | * @returns %TRUE if the widget is double buffered |
| 9447 | */ |
| 9448 | get_double_buffered(): boolean; |
| 9449 | /** |
| 9450 | * Returns the event mask (see #GdkEventMask) for the widget. These are the |
| 9451 | * events that the widget will receive. |
| 9452 | * |
| 9453 | * Note: Internally, the widget event mask will be the logical OR of the event |
| 9454 | * mask set through gtk_widget_set_events() or gtk_widget_add_events(), and the |
| 9455 | * event mask necessary to cater for every #GtkEventController created for the |
| 9456 | * widget. |
| 9457 | * @returns event mask for @widget |
| 9458 | */ |
| 9459 | get_events(): number; |
| 9460 | /** |
| 9461 | * Returns whether the widget should grab focus when it is clicked with the mouse. |
| 9462 | * See gtk_widget_set_focus_on_click(). |
| 9463 | * @returns %TRUE if the widget should grab focus when it is clicked with the mouse. |
| 9464 | */ |
| 9465 | get_focus_on_click(): boolean; |
| 9466 | /** |
| 9467 | * Gets the font map that has been set with gtk_widget_set_font_map(). |
| 9468 | * @returns A #PangoFontMap, or %NULL |
| 9469 | */ |
| 9470 | get_font_map(): Pango.FontMap | null; |
| 9471 | /** |
| 9472 | * Returns the #cairo_font_options_t used for Pango rendering. When not set, |
| 9473 | * the defaults font options for the #GdkScreen will be used. |
| 9474 | * @returns the #cairo_font_options_t or %NULL if not set |
| 9475 | */ |
| 9476 | get_font_options(): cairo.FontOptions | null; |
| 9477 | /** |
| 9478 | * Obtains the frame clock for a widget. The frame clock is a global |
| 9479 | * “ticker” that can be used to drive animations and repaints. The |
| 9480 | * most common reason to get the frame clock is to call |
| 9481 | * gdk_frame_clock_get_frame_time(), in order to get a time to use for |
| 9482 | * animating. For example you might record the start of the animation |
| 9483 | * with an initial value from gdk_frame_clock_get_frame_time(), and |
| 9484 | * then update the animation by calling |
| 9485 | * gdk_frame_clock_get_frame_time() again during each repaint. |
| 9486 | * |
| 9487 | * gdk_frame_clock_request_phase() will result in a new frame on the |
| 9488 | * clock, but won’t necessarily repaint any widgets. To repaint a |
| 9489 | * widget, you have to use gtk_widget_queue_draw() which invalidates |
| 9490 | * the widget (thus scheduling it to receive a draw on the next |
| 9491 | * frame). gtk_widget_queue_draw() will also end up requesting a frame |
| 9492 | * on the appropriate frame clock. |
| 9493 | * |
| 9494 | * A widget’s frame clock will not change while the widget is |
| 9495 | * mapped. Reparenting a widget (which implies a temporary unmap) can |
| 9496 | * change the widget’s frame clock. |
| 9497 | * |
| 9498 | * Unrealized widgets do not have a frame clock. |
| 9499 | * @returns a #GdkFrameClock, or %NULL if widget is unrealized |
| 9500 | */ |
| 9501 | get_frame_clock(): Gdk.FrameClock | null; |
| 9502 | /** |
| 9503 | * Gets the value of the #GtkWidget:halign property. |
| 9504 | * |
| 9505 | * For backwards compatibility reasons this method will never return |
| 9506 | * %GTK_ALIGN_BASELINE, but instead it will convert it to |
| 9507 | * %GTK_ALIGN_FILL. Baselines are not supported for horizontal |
| 9508 | * alignment. |
| 9509 | * @returns the horizontal alignment of @widget |
| 9510 | */ |
| 9511 | get_halign(): Gtk.Align; |
| 9512 | /** |
| 9513 | * Returns the current value of the has-tooltip property. See |
| 9514 | * #GtkWidget:has-tooltip for more information. |
| 9515 | * @returns current value of has-tooltip on @widget. |
| 9516 | */ |
| 9517 | get_has_tooltip(): boolean; |
| 9518 | /** |
| 9519 | * Determines whether `widget` has a #GdkWindow of its own. See |
| 9520 | * gtk_widget_set_has_window(). |
| 9521 | * @returns %TRUE if @widget has a window, %FALSE otherwise |
| 9522 | */ |
| 9523 | get_has_window(): boolean; |
| 9524 | /** |
| 9525 | * Gets whether the widget would like any available extra horizontal |
| 9526 | * space. When a user resizes a #GtkWindow, widgets with expand=TRUE |
| 9527 | * generally receive the extra space. For example, a list or |
| 9528 | * scrollable area or document in your window would often be set to |
| 9529 | * expand. |
| 9530 | * |
| 9531 | * Containers should use gtk_widget_compute_expand() rather than |
| 9532 | * this function, to see whether a widget, or any of its children, |
| 9533 | * has the expand flag set. If any child of a widget wants to |
| 9534 | * expand, the parent may ask to expand also. |
| 9535 | * |
| 9536 | * This function only looks at the widget’s own hexpand flag, rather |
| 9537 | * than computing whether the entire widget tree rooted at this widget |
| 9538 | * wants to expand. |
| 9539 | * @returns whether hexpand flag is set |
| 9540 | */ |
| 9541 | get_hexpand(): boolean; |
| 9542 | /** |
| 9543 | * Gets whether gtk_widget_set_hexpand() has been used to |
| 9544 | * explicitly set the expand flag on this widget. |
| 9545 | * |
| 9546 | * If hexpand is set, then it overrides any computed |
| 9547 | * expand value based on child widgets. If hexpand is not |
| 9548 | * set, then the expand value depends on whether any |
| 9549 | * children of the widget would like to expand. |
| 9550 | * |
| 9551 | * There are few reasons to use this function, but it’s here |
| 9552 | * for completeness and consistency. |
| 9553 | * @returns whether hexpand has been explicitly set |
| 9554 | */ |
| 9555 | get_hexpand_set(): boolean; |
| 9556 | /** |
| 9557 | * Whether the widget is mapped. |
| 9558 | * @returns %TRUE if the widget is mapped, %FALSE otherwise. |
| 9559 | */ |
| 9560 | get_mapped(): boolean; |
| 9561 | /** |
| 9562 | * Gets the value of the #GtkWidget:margin-bottom property. |
| 9563 | * @returns The bottom margin of @widget |
| 9564 | */ |
| 9565 | get_margin_bottom(): number; |
| 9566 | /** |
| 9567 | * Gets the value of the #GtkWidget:margin-end property. |
| 9568 | * @returns The end margin of @widget |
| 9569 | */ |
| 9570 | get_margin_end(): number; |
| 9571 | /** |
| 9572 | * Gets the value of the #GtkWidget:margin-left property. |
| 9573 | * @returns The left margin of @widget |
| 9574 | */ |
| 9575 | get_margin_left(): number; |
| 9576 | /** |
| 9577 | * Gets the value of the #GtkWidget:margin-right property. |
| 9578 | * @returns The right margin of @widget |
| 9579 | */ |
| 9580 | get_margin_right(): number; |
| 9581 | /** |
| 9582 | * Gets the value of the #GtkWidget:margin-start property. |
| 9583 | * @returns The start margin of @widget |
| 9584 | */ |
| 9585 | get_margin_start(): number; |
| 9586 | /** |
| 9587 | * Gets the value of the #GtkWidget:margin-top property. |
| 9588 | * @returns The top margin of @widget |
| 9589 | */ |
| 9590 | get_margin_top(): number; |
| 9591 | /** |
| 9592 | * Returns the modifier mask the `widget’`s windowing system backend |
| 9593 | * uses for a particular purpose. |
| 9594 | * |
| 9595 | * See gdk_keymap_get_modifier_mask(). |
| 9596 | * @param intent the use case for the modifier mask |
| 9597 | * @returns the modifier mask used for @intent. |
| 9598 | */ |
| 9599 | get_modifier_mask(intent: Gdk.ModifierIntent | null): Gdk.ModifierType; |
| 9600 | /** |
| 9601 | * Returns the current modifier style for the widget. (As set by |
| 9602 | * gtk_widget_modify_style().) If no style has previously set, a new |
| 9603 | * #GtkRcStyle will be created with all values unset, and set as the |
| 9604 | * modifier style for the widget. If you make changes to this rc |
| 9605 | * style, you must call gtk_widget_modify_style(), passing in the |
| 9606 | * returned rc style, to make sure that your changes take effect. |
| 9607 | * |
| 9608 | * Caution: passing the style back to gtk_widget_modify_style() will |
| 9609 | * normally end up destroying it, because gtk_widget_modify_style() copies |
| 9610 | * the passed-in style and sets the copy as the new modifier style, |
| 9611 | * thus dropping any reference to the old modifier style. Add a reference |
| 9612 | * to the modifier style if you want to keep it alive. |
| 9613 | * @returns the modifier style for the widget. This rc style is owned by the widget. If you want to keep a pointer to value this around, you must add a refcount using g_object_ref(). |
| 9614 | */ |
| 9615 | get_modifier_style(): Gtk.RcStyle; |
| 9616 | /** |
| 9617 | * Retrieves the name of a widget. See gtk_widget_set_name() for the |
| 9618 | * significance of widget names. |
| 9619 | * @returns name of the widget. This string is owned by GTK+ and should not be modified or freed |
| 9620 | */ |
| 9621 | get_name(): string; |
| 9622 | /** |
| 9623 | * Returns the current value of the #GtkWidget:no-show-all property, |
| 9624 | * which determines whether calls to gtk_widget_show_all() |
| 9625 | * will affect this widget. |
| 9626 | * @returns the current value of the “no-show-all” property. |
| 9627 | */ |
| 9628 | get_no_show_all(): boolean; |
| 9629 | /** |
| 9630 | * Fetches the requested opacity for this widget. |
| 9631 | * See gtk_widget_set_opacity(). |
| 9632 | * @returns the requested opacity for this widget. |
| 9633 | */ |
| 9634 | get_opacity(): number; |
| 9635 | /** |
| 9636 | * Gets a #PangoContext with the appropriate font map, font description, |
| 9637 | * and base direction for this widget. Unlike the context returned |
| 9638 | * by gtk_widget_create_pango_context(), this context is owned by |
| 9639 | * the widget (it can be used until the screen for the widget changes |
| 9640 | * or the widget is removed from its toplevel), and will be updated to |
| 9641 | * match any changes to the widget’s attributes. This can be tracked |
| 9642 | * by using the #GtkWidget::screen-changed signal on the widget. |
| 9643 | * @returns the #PangoContext for the widget. |
| 9644 | */ |
| 9645 | get_pango_context(): Pango.Context; |
| 9646 | /** |
| 9647 | * Returns the parent container of `widget`. |
| 9648 | * @returns the parent container of @widget, or %NULL |
| 9649 | */ |
| 9650 | get_parent(): Gtk.Widget | null; |
| 9651 | /** |
| 9652 | * Gets `widget’`s parent window, or %NULL if it does not have one. |
| 9653 | * @returns the parent window of @widget, or %NULL if it does not have a parent window. |
| 9654 | */ |
| 9655 | get_parent_window(): Gdk.Window | null; |
| 9656 | /** |
| 9657 | * Returns the #GtkWidgetPath representing `widget,` if the widget |
| 9658 | * is not connected to a toplevel widget, a partial path will be |
| 9659 | * created. |
| 9660 | * @returns The #GtkWidgetPath representing @widget |
| 9661 | */ |
| 9662 | get_path(): Gtk.WidgetPath; |
| 9663 | /** |
| 9664 | * Obtains the location of the mouse pointer in widget coordinates. |
| 9665 | * Widget coordinates are a bit odd; for historical reasons, they are |
| 9666 | * defined as `widget->`window coordinates for widgets that return %TRUE for |
| 9667 | * gtk_widget_get_has_window(); and are relative to `widget->`allocation.x, |
| 9668 | * `widget->`allocation.y otherwise. |
| 9669 | */ |
| 9670 | get_pointer(): [number, number]; |
| 9671 | /** |
| 9672 | * Retrieves a widget’s initial minimum and natural height. |
| 9673 | * |
| 9674 | * This call is specific to width-for-height requests. |
| 9675 | * |
| 9676 | * The returned request will be modified by the |
| 9677 | * GtkWidgetClass::adjust_size_request virtual method and by any |
| 9678 | * #GtkSizeGroups that have been applied. That is, the returned request |
| 9679 | * is the one that should be used for layout, not necessarily the one |
| 9680 | * returned by the widget itself. |
| 9681 | */ |
| 9682 | get_preferred_height(): [number, number]; |
| 9683 | /** |
| 9684 | * Retrieves a widget’s minimum and natural height and the corresponding baselines if it would be given |
| 9685 | * the specified `width,` or the default height if `width` is -1. The baselines may be -1 which means |
| 9686 | * that no baseline is requested for this widget. |
| 9687 | * |
| 9688 | * The returned request will be modified by the |
| 9689 | * GtkWidgetClass::adjust_size_request and GtkWidgetClass::adjust_baseline_request virtual methods |
| 9690 | * and by any #GtkSizeGroups that have been applied. That is, the returned request |
| 9691 | * is the one that should be used for layout, not necessarily the one |
| 9692 | * returned by the widget itself. |
| 9693 | * @param width the width which is available for allocation, or -1 if none |
| 9694 | */ |
| 9695 | get_preferred_height_and_baseline_for_width(width: number): [number, number, number, number]; |
| 9696 | /** |
| 9697 | * Retrieves a widget’s minimum and natural height if it would be given |
| 9698 | * the specified `width`. |
| 9699 | * |
| 9700 | * The returned request will be modified by the |
| 9701 | * GtkWidgetClass::adjust_size_request virtual method and by any |
| 9702 | * #GtkSizeGroups that have been applied. That is, the returned request |
| 9703 | * is the one that should be used for layout, not necessarily the one |
| 9704 | * returned by the widget itself. |
| 9705 | * @param width the width which is available for allocation |
| 9706 | */ |
| 9707 | get_preferred_height_for_width(width: number): [number, number]; |
| 9708 | /** |
| 9709 | * Retrieves the minimum and natural size of a widget, taking |
| 9710 | * into account the widget’s preference for height-for-width management. |
| 9711 | * |
| 9712 | * This is used to retrieve a suitable size by container widgets which do |
| 9713 | * not impose any restrictions on the child placement. It can be used |
| 9714 | * to deduce toplevel window and menu sizes as well as child widgets in |
| 9715 | * free-form containers such as GtkLayout. |
| 9716 | * |
| 9717 | * Handle with care. Note that the natural height of a height-for-width |
| 9718 | * widget will generally be a smaller size than the minimum height, since the required |
| 9719 | * height for the natural width is generally smaller than the required height for |
| 9720 | * the minimum width. |
| 9721 | * |
| 9722 | * Use gtk_widget_get_preferred_height_and_baseline_for_width() if you want to support |
| 9723 | * baseline alignment. |
| 9724 | */ |
| 9725 | get_preferred_size(): [Gtk.Requisition | null, Gtk.Requisition | null]; |
| 9726 | /** |
| 9727 | * Retrieves a widget’s initial minimum and natural width. |
| 9728 | * |
| 9729 | * This call is specific to height-for-width requests. |
| 9730 | * |
| 9731 | * The returned request will be modified by the |
| 9732 | * GtkWidgetClass::adjust_size_request virtual method and by any |
| 9733 | * #GtkSizeGroups that have been applied. That is, the returned request |
| 9734 | * is the one that should be used for layout, not necessarily the one |
| 9735 | * returned by the widget itself. |
| 9736 | */ |
| 9737 | get_preferred_width(): [number, number]; |
| 9738 | /** |
| 9739 | * Retrieves a widget’s minimum and natural width if it would be given |
| 9740 | * the specified `height`. |
| 9741 | * |
| 9742 | * The returned request will be modified by the |
| 9743 | * GtkWidgetClass::adjust_size_request virtual method and by any |
| 9744 | * #GtkSizeGroups that have been applied. That is, the returned request |
| 9745 | * is the one that should be used for layout, not necessarily the one |
| 9746 | * returned by the widget itself. |
| 9747 | * @param height the height which is available for allocation |
| 9748 | */ |
| 9749 | get_preferred_width_for_height(height: number): [number, number]; |
| 9750 | /** |
| 9751 | * Determines whether `widget` is realized. |
| 9752 | * @returns %TRUE if @widget is realized, %FALSE otherwise |
| 9753 | */ |
| 9754 | get_realized(): boolean; |
| 9755 | /** |
| 9756 | * Determines whether `widget` is always treated as the default widget |
| 9757 | * within its toplevel when it has the focus, even if another widget |
| 9758 | * is the default. |
| 9759 | * |
| 9760 | * See gtk_widget_set_receives_default(). |
| 9761 | * @returns %TRUE if @widget acts as the default widget when focused, %FALSE otherwise |
| 9762 | */ |
| 9763 | get_receives_default(): boolean; |
| 9764 | /** |
| 9765 | * Gets whether the widget prefers a height-for-width layout |
| 9766 | * or a width-for-height layout. |
| 9767 | * |
| 9768 | * #GtkBin widgets generally propagate the preference of |
| 9769 | * their child, container widgets need to request something either in |
| 9770 | * context of their children or in context of their allocation |
| 9771 | * capabilities. |
| 9772 | * @returns The #GtkSizeRequestMode preferred by @widget. |
| 9773 | */ |
| 9774 | get_request_mode(): Gtk.SizeRequestMode; |
| 9775 | /** |
| 9776 | * Retrieves the widget’s requisition. |
| 9777 | * |
| 9778 | * This function should only be used by widget implementations in |
| 9779 | * order to figure whether the widget’s requisition has actually |
| 9780 | * changed after some internal state change (so that they can call |
| 9781 | * gtk_widget_queue_resize() instead of gtk_widget_queue_draw()). |
| 9782 | * |
| 9783 | * Normally, gtk_widget_size_request() should be used. |
| 9784 | */ |
| 9785 | get_requisition(): Gtk.Requisition; |
| 9786 | /** |
| 9787 | * Get the root window where this widget is located. This function can |
| 9788 | * only be called after the widget has been added to a widget |
| 9789 | * hierarchy with #GtkWindow at the top. |
| 9790 | * |
| 9791 | * The root window is useful for such purposes as creating a popup |
| 9792 | * #GdkWindow associated with the window. In general, you should only |
| 9793 | * create display specific resources when a widget has been realized, |
| 9794 | * and you should free those resources when the widget is unrealized. |
| 9795 | * @returns the #GdkWindow root window for the toplevel for this widget. |
| 9796 | */ |
| 9797 | get_root_window(): Gdk.Window; |
| 9798 | /** |
| 9799 | * Retrieves the internal scale factor that maps from window coordinates |
| 9800 | * to the actual device pixels. On traditional systems this is 1, on |
| 9801 | * high density outputs, it can be a higher value (typically 2). |
| 9802 | * |
| 9803 | * See gdk_window_get_scale_factor(). |
| 9804 | * @returns the scale factor for @widget |
| 9805 | */ |
| 9806 | get_scale_factor(): number; |
| 9807 | /** |
| 9808 | * Get the #GdkScreen from the toplevel window associated with |
| 9809 | * this widget. This function can only be called after the widget |
| 9810 | * has been added to a widget hierarchy with a #GtkWindow |
| 9811 | * at the top. |
| 9812 | * |
| 9813 | * In general, you should only create screen specific |
| 9814 | * resources when a widget has been realized, and you should |
| 9815 | * free those resources when the widget is unrealized. |
| 9816 | * @returns the #GdkScreen for the toplevel for this widget. |
| 9817 | */ |
| 9818 | get_screen(): Gdk.Screen; |
| 9819 | /** |
| 9820 | * Returns the widget’s sensitivity (in the sense of returning |
| 9821 | * the value that has been set using gtk_widget_set_sensitive()). |
| 9822 | * |
| 9823 | * The effective sensitivity of a widget is however determined by both its |
| 9824 | * own and its parent widget’s sensitivity. See gtk_widget_is_sensitive(). |
| 9825 | * @returns %TRUE if the widget is sensitive |
| 9826 | */ |
| 9827 | get_sensitive(): boolean; |
| 9828 | /** |
| 9829 | * Gets the settings object holding the settings used for this widget. |
| 9830 | * |
| 9831 | * Note that this function can only be called when the #GtkWidget |
| 9832 | * is attached to a toplevel, since the settings object is specific |
| 9833 | * to a particular #GdkScreen. |
| 9834 | * @returns the relevant #GtkSettings object |
| 9835 | */ |
| 9836 | get_settings(): Gtk.Settings; |
| 9837 | /** |
| 9838 | * Gets the size request that was explicitly set for the widget using |
| 9839 | * gtk_widget_set_size_request(). A value of -1 stored in `width` or |
| 9840 | * `height` indicates that that dimension has not been set explicitly |
| 9841 | * and the natural requisition of the widget will be used instead. See |
| 9842 | * gtk_widget_set_size_request(). To get the size a widget will |
| 9843 | * actually request, call gtk_widget_get_preferred_size() instead of |
| 9844 | * this function. |
| 9845 | */ |
| 9846 | get_size_request(): [number, number]; |
| 9847 | /** |
| 9848 | * Returns the widget’s state. See gtk_widget_set_state(). |
| 9849 | * @returns the state of @widget. |
| 9850 | */ |
| 9851 | get_state(): Gtk.StateType; |
| 9852 | /** |
| 9853 | * Returns the widget state as a flag set. It is worth mentioning |
| 9854 | * that the effective %GTK_STATE_FLAG_INSENSITIVE state will be |
| 9855 | * returned, that is, also based on parent insensitivity, even if |
| 9856 | * `widget` itself is sensitive. |
| 9857 | * |
| 9858 | * Also note that if you are looking for a way to obtain the |
| 9859 | * #GtkStateFlags to pass to a #GtkStyleContext method, you |
| 9860 | * should look at gtk_style_context_get_state(). |
| 9861 | * @returns The state flags for widget |
| 9862 | */ |
| 9863 | get_state_flags(): Gtk.StateFlags; |
| 9864 | /** |
| 9865 | * Simply an accessor function that returns `widget->`style. |
| 9866 | * @returns the widget’s #GtkStyle |
| 9867 | */ |
| 9868 | get_style(): Gtk.Style; |
| 9869 | /** |
| 9870 | * Returns the style context associated to `widget`. The returned object is |
| 9871 | * guaranteed to be the same for the lifetime of `widget`. |
| 9872 | * @returns a #GtkStyleContext. This memory is owned by @widget and must not be freed. |
| 9873 | */ |
| 9874 | get_style_context(): Gtk.StyleContext; |
| 9875 | /** |
| 9876 | * Returns %TRUE if `widget` is multiple pointer aware. See |
| 9877 | * gtk_widget_set_support_multidevice() for more information. |
| 9878 | * @returns %TRUE if @widget is multidevice aware. |
| 9879 | */ |
| 9880 | get_support_multidevice(): boolean; |
| 9881 | /** |
| 9882 | * Fetch an object build from the template XML for `widget_type` in this `widget` instance. |
| 9883 | * |
| 9884 | * This will only report children which were previously declared with |
| 9885 | * gtk_widget_class_bind_template_child_full() or one of its |
| 9886 | * variants. |
| 9887 | * |
| 9888 | * This function is only meant to be called for code which is private to the `widget_type` which |
| 9889 | * declared the child and is meant for language bindings which cannot easily make use |
| 9890 | * of the GObject structure offsets. |
| 9891 | * @param widget_type The #GType to get a template child for |
| 9892 | * @param name The “id” of the child defined in the template XML |
| 9893 | * @returns The object built in the template XML with the id @name |
| 9894 | */ |
| 9895 | get_template_child<T = GObject.Object>(widget_type: GObject.GType, name: string): T; |
| 9896 | /** |
| 9897 | * Gets the contents of the tooltip for `widget`. |
| 9898 | * @returns the tooltip text, or %NULL. You should free the returned string with g_free() when done. |
| 9899 | */ |
| 9900 | get_tooltip_markup(): string | null; |
| 9901 | /** |
| 9902 | * Gets the contents of the tooltip for `widget`. |
| 9903 | * @returns the tooltip text, or %NULL. You should free the returned string with g_free() when done. |
| 9904 | */ |
| 9905 | get_tooltip_text(): string | null; |
| 9906 | /** |
| 9907 | * Returns the #GtkWindow of the current tooltip. This can be the |
| 9908 | * GtkWindow created by default, or the custom tooltip window set |
| 9909 | * using gtk_widget_set_tooltip_window(). |
| 9910 | * @returns The #GtkWindow of the current tooltip. |
| 9911 | */ |
| 9912 | get_tooltip_window(): Gtk.Window; |
| 9913 | /** |
| 9914 | * This function returns the topmost widget in the container hierarchy |
| 9915 | * `widget` is a part of. If `widget` has no parent widgets, it will be |
| 9916 | * returned as the topmost widget. No reference will be added to the |
| 9917 | * returned widget; it should not be unreferenced. |
| 9918 | * |
| 9919 | * Note the difference in behavior vs. gtk_widget_get_ancestor(); |
| 9920 | * `gtk_widget_get_ancestor (widget, GTK_TYPE_WINDOW)` |
| 9921 | * would return |
| 9922 | * %NULL if `widget` wasn’t inside a toplevel window, and if the |
| 9923 | * window was inside a #GtkWindow-derived widget which was in turn |
| 9924 | * inside the toplevel #GtkWindow. While the second case may |
| 9925 | * seem unlikely, it actually happens when a #GtkPlug is embedded |
| 9926 | * inside a #GtkSocket within the same application. |
| 9927 | * |
| 9928 | * To reliably find the toplevel #GtkWindow, use |
| 9929 | * gtk_widget_get_toplevel() and call GTK_IS_WINDOW() |
| 9930 | * on the result. For instance, to get the title of a widget's toplevel |
| 9931 | * window, one might use: |
| 9932 | * |
| 9933 | * ```c |
| 9934 | * static const char * |
| 9935 | * get_widget_toplevel_title (GtkWidget *widget) |
| 9936 | * { |
| 9937 | * GtkWidget *toplevel = gtk_widget_get_toplevel (widget); |
| 9938 | * if (GTK_IS_WINDOW (toplevel)) |
| 9939 | * { |
| 9940 | * return gtk_window_get_title (GTK_WINDOW (toplevel)); |
| 9941 | * } |
| 9942 | * |
| 9943 | * return NULL; |
| 9944 | * } |
| 9945 | * ``` |
| 9946 | * |
| 9947 | * @returns the topmost ancestor of @widget, or @widget itself if there’s no ancestor. |
| 9948 | */ |
| 9949 | get_toplevel(): Gtk.Widget; |
| 9950 | /** |
| 9951 | * Gets the value of the #GtkWidget:valign property. |
| 9952 | * |
| 9953 | * For backwards compatibility reasons this method will never return |
| 9954 | * %GTK_ALIGN_BASELINE, but instead it will convert it to |
| 9955 | * %GTK_ALIGN_FILL. If your widget want to support baseline aligned |
| 9956 | * children it must use gtk_widget_get_valign_with_baseline(), or |
| 9957 | * `g_object_get (widget, "valign", &value, NULL)`, which will |
| 9958 | * also report the true value. |
| 9959 | * @returns the vertical alignment of @widget, ignoring baseline alignment |
| 9960 | */ |
| 9961 | get_valign(): Gtk.Align; |
| 9962 | /** |
| 9963 | * Gets the value of the #GtkWidget:valign property, including |
| 9964 | * %GTK_ALIGN_BASELINE. |
| 9965 | * @returns the vertical alignment of @widget |
| 9966 | */ |
| 9967 | get_valign_with_baseline(): Gtk.Align; |
| 9968 | /** |
| 9969 | * Gets whether the widget would like any available extra vertical |
| 9970 | * space. |
| 9971 | * |
| 9972 | * See gtk_widget_get_hexpand() for more detail. |
| 9973 | * @returns whether vexpand flag is set |
| 9974 | */ |
| 9975 | get_vexpand(): boolean; |
| 9976 | /** |
| 9977 | * Gets whether gtk_widget_set_vexpand() has been used to |
| 9978 | * explicitly set the expand flag on this widget. |
| 9979 | * |
| 9980 | * See gtk_widget_get_hexpand_set() for more detail. |
| 9981 | * @returns whether vexpand has been explicitly set |
| 9982 | */ |
| 9983 | get_vexpand_set(): boolean; |
| 9984 | /** |
| 9985 | * Determines whether the widget is visible. If you want to |
| 9986 | * take into account whether the widget’s parent is also marked as |
| 9987 | * visible, use gtk_widget_is_visible() instead. |
| 9988 | * |
| 9989 | * This function does not check if the widget is obscured in any way. |
| 9990 | * |
| 9991 | * See gtk_widget_set_visible(). |
| 9992 | * @returns %TRUE if the widget is visible |
| 9993 | */ |
| 9994 | get_visible(): boolean; |
| 9995 | /** |
| 9996 | * Gets the visual that will be used to render `widget`. |
| 9997 | * @returns the visual for @widget |
| 9998 | */ |
| 9999 | get_visual(): Gdk.Visual; |
| 10000 | /** |
| 10001 | * Returns the widget’s window if it is realized, %NULL otherwise |
| 10002 | * @returns @widget’s window. |
| 10003 | */ |
| 10004 | get_window(): Gdk.Window | null; |
| 10005 | /** |
| 10006 | * Makes `widget` the current grabbed widget. |
| 10007 | * |
| 10008 | * This means that interaction with other widgets in the same |
| 10009 | * application is blocked and mouse as well as keyboard events |
| 10010 | * are delivered to this widget. |
| 10011 | * |
| 10012 | * If `widget` is not sensitive, it is not set as the current |
| 10013 | * grabbed widget and this function does nothing. |
| 10014 | */ |
| 10015 | grab_add(): void; |
| 10016 | /** |
| 10017 | * Causes `widget` to become the default widget. `widget` must be able to be |
| 10018 | * a default widget; typically you would ensure this yourself |
| 10019 | * by calling gtk_widget_set_can_default() with a %TRUE value. |
| 10020 | * The default widget is activated when |
| 10021 | * the user presses Enter in a window. Default widgets must be |
| 10022 | * activatable, that is, gtk_widget_activate() should affect them. Note |
| 10023 | * that #GtkEntry widgets require the “activates-default” property |
| 10024 | * set to %TRUE before they activate the default widget when Enter |
| 10025 | * is pressed and the #GtkEntry is focused. |
| 10026 | */ |
| 10027 | grab_default(): void; |
| 10028 | /** |
| 10029 | * Causes `widget` to have the keyboard focus for the #GtkWindow it's |
| 10030 | * inside. `widget` must be a focusable widget, such as a #GtkEntry; |
| 10031 | * something like #GtkFrame won’t work. |
| 10032 | * |
| 10033 | * More precisely, it must have the %GTK_CAN_FOCUS flag set. Use |
| 10034 | * gtk_widget_set_can_focus() to modify that flag. |
| 10035 | * |
| 10036 | * The widget also needs to be realized and mapped. This is indicated by the |
| 10037 | * related signals. Grabbing the focus immediately after creating the widget |
| 10038 | * will likely fail and cause critical warnings. |
| 10039 | */ |
| 10040 | grab_focus(): void; |
| 10041 | /** |
| 10042 | * Removes the grab from the given widget. |
| 10043 | * |
| 10044 | * You have to pair calls to gtk_grab_add() and gtk_grab_remove(). |
| 10045 | * |
| 10046 | * If `widget` does not have the grab, this function does nothing. |
| 10047 | */ |
| 10048 | grab_remove(): void; |
| 10049 | /** |
| 10050 | * Determines whether the widget is currently grabbing events, so it |
| 10051 | * is the only widget receiving input events (keyboard and mouse). |
| 10052 | * |
| 10053 | * See also gtk_grab_add(). |
| 10054 | * @returns %TRUE if the widget is in the grab_widgets stack |
| 10055 | */ |
| 10056 | has_grab(): boolean; |
| 10057 | /** |
| 10058 | * Determines if the widget style has been looked up through the rc mechanism. |
| 10059 | * @returns %TRUE if the widget has been looked up through the rc mechanism, %FALSE otherwise. |
| 10060 | */ |
| 10061 | has_rc_style(): boolean; |
| 10062 | /** |
| 10063 | * Checks whether there is a #GdkScreen is associated with |
| 10064 | * this widget. All toplevel widgets have an associated |
| 10065 | * screen, and all widgets added into a hierarchy with a toplevel |
| 10066 | * window at the top. |
| 10067 | * @returns %TRUE if there is a #GdkScreen associated with the widget. |
| 10068 | */ |
| 10069 | has_screen(): boolean; |
| 10070 | /** |
| 10071 | * Determines if the widget should show a visible indication that |
| 10072 | * it has the global input focus. This is a convenience function for |
| 10073 | * use in ::draw handlers that takes into account whether focus |
| 10074 | * indication should currently be shown in the toplevel window of |
| 10075 | * `widget`. See gtk_window_get_focus_visible() for more information |
| 10076 | * about focus indication. |
| 10077 | * |
| 10078 | * To find out if the widget has the global input focus, use |
| 10079 | * gtk_widget_has_focus(). |
| 10080 | * @returns %TRUE if the widget should display a “focus rectangle” |
| 10081 | */ |
| 10082 | has_visible_focus(): boolean; |
| 10083 | /** |
| 10084 | * Reverses the effects of gtk_widget_show(), causing the widget to be |
| 10085 | * hidden (invisible to the user). |
| 10086 | */ |
| 10087 | hide(): void; |
| 10088 | /** |
| 10089 | * Utility function; intended to be connected to the #GtkWidget::delete-event |
| 10090 | * signal on a #GtkWindow. The function calls gtk_widget_hide() on its |
| 10091 | * argument, then returns %TRUE. If connected to ::delete-event, the |
| 10092 | * result is that clicking the close button for a window (on the |
| 10093 | * window frame, top right corner usually) will hide but not destroy |
| 10094 | * the window. By default, GTK+ destroys windows when ::delete-event |
| 10095 | * is received. |
| 10096 | * @returns %TRUE |
| 10097 | */ |
| 10098 | hide_on_delete(): boolean; |
| 10099 | /** |
| 10100 | * Returns whether the widget is currently being destroyed. |
| 10101 | * This information can sometimes be used to avoid doing |
| 10102 | * unnecessary work. |
| 10103 | * @returns %TRUE if @widget is being destroyed |
| 10104 | */ |
| 10105 | in_destruction(): boolean; |
| 10106 | /** |
| 10107 | * Creates and initializes child widgets defined in templates. This |
| 10108 | * function must be called in the instance initializer for any |
| 10109 | * class which assigned itself a template using gtk_widget_class_set_template() |
| 10110 | * |
| 10111 | * It is important to call this function in the instance initializer |
| 10112 | * of a #GtkWidget subclass and not in #GObject.constructed() or |
| 10113 | * #GObject.constructor() for two reasons. |
| 10114 | * |
| 10115 | * One reason is that generally derived widgets will assume that parent |
| 10116 | * class composite widgets have been created in their instance |
| 10117 | * initializers. |
| 10118 | * |
| 10119 | * Another reason is that when calling g_object_new() on a widget with |
| 10120 | * composite templates, it’s important to build the composite widgets |
| 10121 | * before the construct properties are set. Properties passed to g_object_new() |
| 10122 | * should take precedence over properties set in the private template XML. |
| 10123 | */ |
| 10124 | init_template(): void; |
| 10125 | /** |
| 10126 | * Sets an input shape for this widget’s GDK window. This allows for |
| 10127 | * windows which react to mouse click in a nonrectangular region, see |
| 10128 | * gdk_window_input_shape_combine_region() for more information. |
| 10129 | * @param region shape to be added, or %NULL to remove an existing shape |
| 10130 | */ |
| 10131 | input_shape_combine_region(region?: cairo.Region | null): void; |
| 10132 | /** |
| 10133 | * Inserts `group` into `widget`. Children of `widget` that implement |
| 10134 | * #GtkActionable can then be associated with actions in `group` by |
| 10135 | * setting their “action-name” to |
| 10136 | * `prefix`.`action-name`. |
| 10137 | * |
| 10138 | * If `group` is %NULL, a previously inserted group for `name` is removed |
| 10139 | * from `widget`. |
| 10140 | * @param name the prefix for actions in @group |
| 10141 | * @param group a #GActionGroup, or %NULL |
| 10142 | */ |
| 10143 | insert_action_group(name: string, group?: Gio.ActionGroup | null): void; |
| 10144 | /** |
| 10145 | * Computes the intersection of a `widget’`s area and `area,` storing |
| 10146 | * the intersection in `intersection,` and returns %TRUE if there was |
| 10147 | * an intersection. `intersection` may be %NULL if you’re only |
| 10148 | * interested in whether there was an intersection. |
| 10149 | * @param area a rectangle |
| 10150 | * @returns %TRUE if there was an intersection |
| 10151 | */ |
| 10152 | intersect(area: Gdk.Rectangle): [boolean, Gdk.Rectangle | null]; |
| 10153 | /** |
| 10154 | * Determines whether `widget` is somewhere inside `ancestor,` possibly with |
| 10155 | * intermediate containers. |
| 10156 | * @param ancestor another #GtkWidget |
| 10157 | * @returns %TRUE if @ancestor contains @widget as a child, grandchild, great grandchild, etc. |
| 10158 | */ |
| 10159 | is_ancestor(ancestor: Gtk.Widget): boolean; |
| 10160 | /** |
| 10161 | * Whether `widget` can rely on having its alpha channel |
| 10162 | * drawn correctly. On X11 this function returns whether a |
| 10163 | * compositing manager is running for `widget’`s screen. |
| 10164 | * |
| 10165 | * Please note that the semantics of this call will change |
| 10166 | * in the future if used on a widget that has a composited |
| 10167 | * window in its hierarchy (as set by gdk_window_set_composited()). |
| 10168 | * @returns %TRUE if the widget can rely on its alpha channel being drawn correctly. |
| 10169 | */ |
| 10170 | is_composited(): boolean; |
| 10171 | /** |
| 10172 | * Determines whether `widget` can be drawn to. A widget can be drawn |
| 10173 | * to if it is mapped and visible. |
| 10174 | * @returns %TRUE if @widget is drawable, %FALSE otherwise |
| 10175 | */ |
| 10176 | is_drawable(): boolean; |
| 10177 | /** |
| 10178 | * Returns the widget’s effective sensitivity, which means |
| 10179 | * it is sensitive itself and also its parent widget is sensitive |
| 10180 | * @returns %TRUE if the widget is effectively sensitive |
| 10181 | */ |
| 10182 | is_sensitive(): boolean; |
| 10183 | /** |
| 10184 | * Determines whether `widget` is a toplevel widget. |
| 10185 | * |
| 10186 | * Currently only #GtkWindow and #GtkInvisible (and out-of-process |
| 10187 | * #GtkPlugs) are toplevel widgets. Toplevel widgets have no parent |
| 10188 | * widget. |
| 10189 | * @returns %TRUE if @widget is a toplevel, %FALSE otherwise |
| 10190 | */ |
| 10191 | is_toplevel(): boolean; |
| 10192 | /** |
| 10193 | * Determines whether the widget and all its parents are marked as |
| 10194 | * visible. |
| 10195 | * |
| 10196 | * This function does not check if the widget is obscured in any way. |
| 10197 | * |
| 10198 | * See also gtk_widget_get_visible() and gtk_widget_set_visible() |
| 10199 | * @returns %TRUE if the widget and all its parents are visible |
| 10200 | */ |
| 10201 | is_visible(): boolean; |
| 10202 | /** |
| 10203 | * This function should be called whenever keyboard navigation within |
| 10204 | * a single widget hits a boundary. The function emits the |
| 10205 | * #GtkWidget::keynav-failed signal on the widget and its return |
| 10206 | * value should be interpreted in a way similar to the return value of |
| 10207 | * gtk_widget_child_focus(): |
| 10208 | * |
| 10209 | * When %TRUE is returned, stay in the widget, the failed keyboard |
| 10210 | * navigation is OK and/or there is nowhere we can/should move the |
| 10211 | * focus to. |
| 10212 | * |
| 10213 | * When %FALSE is returned, the caller should continue with keyboard |
| 10214 | * navigation outside the widget, e.g. by calling |
| 10215 | * gtk_widget_child_focus() on the widget’s toplevel. |
| 10216 | * |
| 10217 | * The default ::keynav-failed handler returns %FALSE for |
| 10218 | * %GTK_DIR_TAB_FORWARD and %GTK_DIR_TAB_BACKWARD. For the other |
| 10219 | * values of #GtkDirectionType it returns %TRUE. |
| 10220 | * |
| 10221 | * Whenever the default handler returns %TRUE, it also calls |
| 10222 | * gtk_widget_error_bell() to notify the user of the failed keyboard |
| 10223 | * navigation. |
| 10224 | * |
| 10225 | * A use case for providing an own implementation of ::keynav-failed |
| 10226 | * (either by connecting to it or by overriding it) would be a row of |
| 10227 | * #GtkEntry widgets where the user should be able to navigate the |
| 10228 | * entire row with the cursor keys, as e.g. known from user interfaces |
| 10229 | * that require entering license keys. |
| 10230 | * @param direction direction of focus movement |
| 10231 | * @returns %TRUE if stopping keyboard navigation is fine, %FALSE if the emitting widget should try to handle the keyboard navigation attempt in its parent container(s). |
| 10232 | */ |
| 10233 | keynav_failed(direction: Gtk.DirectionType | null): boolean; |
| 10234 | /** |
| 10235 | * Lists the closures used by `widget` for accelerator group connections |
| 10236 | * with gtk_accel_group_connect_by_path() or gtk_accel_group_connect(). |
| 10237 | * The closures can be used to monitor accelerator changes on `widget,` |
| 10238 | * by connecting to the `GtkAccelGroup:`:accel-changed signal of the |
| 10239 | * #GtkAccelGroup of a closure which can be found out with |
| 10240 | * gtk_accel_group_from_accel_closure(). |
| 10241 | * @returns a newly allocated #GList of closures |
| 10242 | */ |
| 10243 | list_accel_closures(): GObject.Closure[]; |
| 10244 | /** |
| 10245 | * Retrieves a %NULL-terminated array of strings containing the prefixes of |
| 10246 | * #GActionGroup's available to `widget`. |
| 10247 | * @returns a %NULL-terminated array of strings. |
| 10248 | */ |
| 10249 | list_action_prefixes(): string[]; |
| 10250 | /** |
| 10251 | * Returns a newly allocated list of the widgets, normally labels, for |
| 10252 | * which this widget is the target of a mnemonic (see for example, |
| 10253 | * gtk_label_set_mnemonic_widget()). |
| 10254 | * |
| 10255 | * The widgets in the list are not individually referenced. If you |
| 10256 | * want to iterate through the list and perform actions involving |
| 10257 | * callbacks that might destroy the widgets, you |
| 10258 | * must call `g_list_foreach (result, |
| 10259 | * (GFunc)g_object_ref, NULL)` first, and then unref all the |
| 10260 | * widgets afterwards. |
| 10261 | * @returns the list of mnemonic labels; free this list with g_list_free() when you are done with it. |
| 10262 | */ |
| 10263 | list_mnemonic_labels(): Gtk.Widget[]; |
| 10264 | /** |
| 10265 | * This function is only for use in widget implementations. Causes |
| 10266 | * a widget to be mapped if it isn’t already. |
| 10267 | */ |
| 10268 | map(): void; |
| 10269 | /** |
| 10270 | * Emits the #GtkWidget::mnemonic-activate signal. |
| 10271 | * @param group_cycling %TRUE if there are other widgets with the same mnemonic |
| 10272 | * @returns %TRUE if the signal has been handled |
| 10273 | */ |
| 10274 | mnemonic_activate(group_cycling: boolean): boolean; |
| 10275 | /** |
| 10276 | * Sets the base color for a widget in a particular state. |
| 10277 | * All other style values are left untouched. The base color |
| 10278 | * is the background color used along with the text color |
| 10279 | * (see gtk_widget_modify_text()) for widgets such as #GtkEntry |
| 10280 | * and #GtkTextView. See also gtk_widget_modify_style(). |
| 10281 | * |
| 10282 | * > Note that “no window” widgets (which have the %GTK_NO_WINDOW |
| 10283 | * > flag set) draw on their parent container’s window and thus may |
| 10284 | * > not draw any background themselves. This is the case for e.g. |
| 10285 | * > #GtkLabel. |
| 10286 | * > |
| 10287 | * > To modify the background of such widgets, you have to set the |
| 10288 | * > base color on their parent; if you want to set the background |
| 10289 | * > of a rectangular area around a label, try placing the label in |
| 10290 | * > a #GtkEventBox widget and setting the base color on that. |
| 10291 | * @param state the state for which to set the base color |
| 10292 | * @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_base(). |
| 10293 | */ |
| 10294 | modify_base(state: Gtk.StateType | null, color?: Gdk.Color | null): void; |
| 10295 | /** |
| 10296 | * Sets the background color for a widget in a particular state. |
| 10297 | * |
| 10298 | * All other style values are left untouched. |
| 10299 | * See also gtk_widget_modify_style(). |
| 10300 | * |
| 10301 | * > Note that “no window” widgets (which have the %GTK_NO_WINDOW |
| 10302 | * > flag set) draw on their parent container’s window and thus may |
| 10303 | * > not draw any background themselves. This is the case for e.g. |
| 10304 | * > #GtkLabel. |
| 10305 | * > |
| 10306 | * > To modify the background of such widgets, you have to set the |
| 10307 | * > background color on their parent; if you want to set the background |
| 10308 | * > of a rectangular area around a label, try placing the label in |
| 10309 | * > a #GtkEventBox widget and setting the background color on that. |
| 10310 | * @param state the state for which to set the background color |
| 10311 | * @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_bg(). |
| 10312 | */ |
| 10313 | modify_bg(state: Gtk.StateType | null, color?: Gdk.Color | null): void; |
| 10314 | /** |
| 10315 | * Sets the cursor color to use in a widget, overriding the #GtkWidget |
| 10316 | * cursor-color and secondary-cursor-color |
| 10317 | * style properties. |
| 10318 | * |
| 10319 | * All other style values are left untouched. |
| 10320 | * See also gtk_widget_modify_style(). |
| 10321 | * @param primary the color to use for primary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_cursor(). |
| 10322 | * @param secondary the color to use for secondary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_cursor(). |
| 10323 | */ |
| 10324 | modify_cursor(primary?: Gdk.Color | null, secondary?: Gdk.Color | null): void; |
| 10325 | /** |
| 10326 | * Sets the foreground color for a widget in a particular state. |
| 10327 | * |
| 10328 | * All other style values are left untouched. |
| 10329 | * See also gtk_widget_modify_style(). |
| 10330 | * @param state the state for which to set the foreground color |
| 10331 | * @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_fg(). |
| 10332 | */ |
| 10333 | modify_fg(state: Gtk.StateType | null, color?: Gdk.Color | null): void; |
| 10334 | /** |
| 10335 | * Sets the font to use for a widget. |
| 10336 | * |
| 10337 | * All other style values are left untouched. |
| 10338 | * See also gtk_widget_modify_style(). |
| 10339 | * @param font_desc the font description to use, or %NULL to undo the effect of previous calls to gtk_widget_modify_font() |
| 10340 | */ |
| 10341 | modify_font(font_desc?: Pango.FontDescription | null): void; |
| 10342 | /** |
| 10343 | * Modifies style values on the widget. |
| 10344 | * |
| 10345 | * Modifications made using this technique take precedence over |
| 10346 | * style values set via an RC file, however, they will be overridden |
| 10347 | * if a style is explicitly set on the widget using gtk_widget_set_style(). |
| 10348 | * The #GtkRcStyle-struct is designed so each field can either be |
| 10349 | * set or unset, so it is possible, using this function, to modify some |
| 10350 | * style values and leave the others unchanged. |
| 10351 | * |
| 10352 | * Note that modifications made with this function are not cumulative |
| 10353 | * with previous calls to gtk_widget_modify_style() or with such |
| 10354 | * functions as gtk_widget_modify_fg(). If you wish to retain |
| 10355 | * previous values, you must first call gtk_widget_get_modifier_style(), |
| 10356 | * make your modifications to the returned style, then call |
| 10357 | * gtk_widget_modify_style() with that style. On the other hand, |
| 10358 | * if you first call gtk_widget_modify_style(), subsequent calls |
| 10359 | * to such functions gtk_widget_modify_fg() will have a cumulative |
| 10360 | * effect with the initial modifications. |
| 10361 | * @param style the #GtkRcStyle-struct holding the style modifications |
| 10362 | */ |
| 10363 | modify_style(style: Gtk.RcStyle): void; |
| 10364 | /** |
| 10365 | * Sets the text color for a widget in a particular state. |
| 10366 | * |
| 10367 | * All other style values are left untouched. |
| 10368 | * The text color is the foreground color used along with the |
| 10369 | * base color (see gtk_widget_modify_base()) for widgets such |
| 10370 | * as #GtkEntry and #GtkTextView. |
| 10371 | * See also gtk_widget_modify_style(). |
| 10372 | * @param state the state for which to set the text color |
| 10373 | * @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_modify_text(). |
| 10374 | */ |
| 10375 | modify_text(state: Gtk.StateType | null, color?: Gdk.Color | null): void; |
| 10376 | /** |
| 10377 | * Sets the background color to use for a widget. |
| 10378 | * |
| 10379 | * All other style values are left untouched. |
| 10380 | * See gtk_widget_override_color(). |
| 10381 | * @param state the state for which to set the background color |
| 10382 | * @param color the color to assign, or %NULL to undo the effect of previous calls to gtk_widget_override_background_color() |
| 10383 | */ |
| 10384 | override_background_color(state: Gtk.StateFlags | null, color?: Gdk.RGBA | null): void; |
| 10385 | /** |
| 10386 | * Sets the color to use for a widget. |
| 10387 | * |
| 10388 | * All other style values are left untouched. |
| 10389 | * |
| 10390 | * This function does not act recursively. Setting the color of a |
| 10391 | * container does not affect its children. Note that some widgets that |
| 10392 | * you may not think of as containers, for instance #GtkButtons, |
| 10393 | * are actually containers. |
| 10394 | * |
| 10395 | * This API is mostly meant as a quick way for applications to |
| 10396 | * change a widget appearance. If you are developing a widgets |
| 10397 | * library and intend this change to be themeable, it is better |
| 10398 | * done by setting meaningful CSS classes in your |
| 10399 | * widget/container implementation through gtk_style_context_add_class(). |
| 10400 | * |
| 10401 | * This way, your widget library can install a #GtkCssProvider |
| 10402 | * with the %GTK_STYLE_PROVIDER_PRIORITY_FALLBACK priority in order |
| 10403 | * to provide a default styling for those widgets that need so, and |
| 10404 | * this theming may fully overridden by the user’s theme. |
| 10405 | * |
| 10406 | * Note that for complex widgets this may bring in undesired |
| 10407 | * results (such as uniform background color everywhere), in |
| 10408 | * these cases it is better to fully style such widgets through a |
| 10409 | * #GtkCssProvider with the %GTK_STYLE_PROVIDER_PRIORITY_APPLICATION |
| 10410 | * priority. |
| 10411 | * @param state the state for which to set the color |
| 10412 | * @param color the color to assign, or %NULL to undo the effect of previous calls to gtk_widget_override_color() |
| 10413 | */ |
| 10414 | override_color(state: Gtk.StateFlags | null, color?: Gdk.RGBA | null): void; |
| 10415 | /** |
| 10416 | * Sets the cursor color to use in a widget, overriding the |
| 10417 | * cursor-color and secondary-cursor-color |
| 10418 | * style properties. All other style values are left untouched. |
| 10419 | * See also gtk_widget_modify_style(). |
| 10420 | * |
| 10421 | * Note that the underlying properties have the #GdkColor type, |
| 10422 | * so the alpha value in `primary` and `secondary` will be ignored. |
| 10423 | * @param cursor the color to use for primary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_override_cursor(). |
| 10424 | * @param secondary_cursor the color to use for secondary cursor (does not need to be allocated), or %NULL to undo the effect of previous calls to of gtk_widget_override_cursor(). |
| 10425 | */ |
| 10426 | override_cursor(cursor?: Gdk.RGBA | null, secondary_cursor?: Gdk.RGBA | null): void; |
| 10427 | /** |
| 10428 | * Sets the font to use for a widget. All other style values are |
| 10429 | * left untouched. See gtk_widget_override_color(). |
| 10430 | * @param font_desc the font description to use, or %NULL to undo the effect of previous calls to gtk_widget_override_font() |
| 10431 | */ |
| 10432 | override_font(font_desc?: Pango.FontDescription | null): void; |
| 10433 | /** |
| 10434 | * Sets a symbolic color for a widget. |
| 10435 | * |
| 10436 | * All other style values are left untouched. |
| 10437 | * See gtk_widget_override_color() for overriding the foreground |
| 10438 | * or background color. |
| 10439 | * @param name the name of the symbolic color to modify |
| 10440 | * @param color the color to assign (does not need to be allocated), or %NULL to undo the effect of previous calls to gtk_widget_override_symbolic_color() |
| 10441 | */ |
| 10442 | override_symbolic_color(name: string, color?: Gdk.RGBA | null): void; |
| 10443 | /** |
| 10444 | * Obtains the full path to `widget`. The path is simply the name of a |
| 10445 | * widget and all its parents in the container hierarchy, separated by |
| 10446 | * periods. The name of a widget comes from |
| 10447 | * gtk_widget_get_name(). Paths are used to apply styles to a widget |
| 10448 | * in gtkrc configuration files. Widget names are the type of the |
| 10449 | * widget by default (e.g. “GtkButton”) or can be set to an |
| 10450 | * application-specific value with gtk_widget_set_name(). By setting |
| 10451 | * the name of a widget, you allow users or theme authors to apply |
| 10452 | * styles to that specific widget in their gtkrc |
| 10453 | * file. `path_reversed_p` fills in the path in reverse order, |
| 10454 | * i.e. starting with `widget’`s name instead of starting with the name |
| 10455 | * of `widget’`s outermost ancestor. |
| 10456 | */ |
| 10457 | path(): [number, string, string]; |
| 10458 | /** |
| 10459 | * This function is only for use in widget implementations. |
| 10460 | * |
| 10461 | * Flags the widget for a rerun of the GtkWidgetClass::size_allocate |
| 10462 | * function. Use this function instead of gtk_widget_queue_resize() |
| 10463 | * when the `widget'`s size request didn't change but it wants to |
| 10464 | * reposition its contents. |
| 10465 | * |
| 10466 | * An example user of this function is gtk_widget_set_halign(). |
| 10467 | */ |
| 10468 | queue_allocate(): void; |
| 10469 | /** |
| 10470 | * Mark `widget` as needing to recompute its expand flags. Call |
| 10471 | * this function when setting legacy expand child properties |
| 10472 | * on the child of a container. |
| 10473 | * |
| 10474 | * See gtk_widget_compute_expand(). |
| 10475 | */ |
| 10476 | queue_compute_expand(): void; |
| 10477 | /** |
| 10478 | * Equivalent to calling gtk_widget_queue_draw_area() for the |
| 10479 | * entire area of a widget. |
| 10480 | */ |
| 10481 | queue_draw(): void; |
| 10482 | /** |
| 10483 | * Convenience function that calls gtk_widget_queue_draw_region() on |
| 10484 | * the region created from the given coordinates. |
| 10485 | * |
| 10486 | * The region here is specified in widget coordinates. |
| 10487 | * Widget coordinates are a bit odd; for historical reasons, they are |
| 10488 | * defined as `widget->`window coordinates for widgets that return %TRUE for |
| 10489 | * gtk_widget_get_has_window(), and are relative to `widget->`allocation.x, |
| 10490 | * `widget->`allocation.y otherwise. |
| 10491 | * |
| 10492 | * `width` or `height` may be 0, in this case this function does |
| 10493 | * nothing. Negative values for `width` and `height` are not allowed. |
| 10494 | * @param x x coordinate of upper-left corner of rectangle to redraw |
| 10495 | * @param y y coordinate of upper-left corner of rectangle to redraw |
| 10496 | * @param width width of region to draw |
| 10497 | * @param height height of region to draw |
| 10498 | */ |
| 10499 | queue_draw_area(x: number, y: number, width: number, height: number): void; |
| 10500 | /** |
| 10501 | * Invalidates the area of `widget` defined by `region` by calling |
| 10502 | * gdk_window_invalidate_region() on the widget’s window and all its |
| 10503 | * child windows. Once the main loop becomes idle (after the current |
| 10504 | * batch of events has been processed, roughly), the window will |
| 10505 | * receive expose events for the union of all regions that have been |
| 10506 | * invalidated. |
| 10507 | * |
| 10508 | * Normally you would only use this function in widget |
| 10509 | * implementations. You might also use it to schedule a redraw of a |
| 10510 | * #GtkDrawingArea or some portion thereof. |
| 10511 | * @param region region to draw |
| 10512 | */ |
| 10513 | queue_draw_region(region: cairo.Region): void; |
| 10514 | /** |
| 10515 | * This function is only for use in widget implementations. |
| 10516 | * Flags a widget to have its size renegotiated; should |
| 10517 | * be called when a widget for some reason has a new size request. |
| 10518 | * For example, when you change the text in a #GtkLabel, #GtkLabel |
| 10519 | * queues a resize to ensure there’s enough space for the new text. |
| 10520 | * |
| 10521 | * Note that you cannot call gtk_widget_queue_resize() on a widget |
| 10522 | * from inside its implementation of the GtkWidgetClass::size_allocate |
| 10523 | * virtual method. Calls to gtk_widget_queue_resize() from inside |
| 10524 | * GtkWidgetClass::size_allocate will be silently ignored. |
| 10525 | */ |
| 10526 | queue_resize(): void; |
| 10527 | /** |
| 10528 | * This function works like gtk_widget_queue_resize(), |
| 10529 | * except that the widget is not invalidated. |
| 10530 | */ |
| 10531 | queue_resize_no_redraw(): void; |
| 10532 | /** |
| 10533 | * Creates the GDK (windowing system) resources associated with a |
| 10534 | * widget. For example, `widget->`window will be created when a widget |
| 10535 | * is realized. Normally realization happens implicitly; if you show |
| 10536 | * a widget and all its parent containers, then the widget will be |
| 10537 | * realized and mapped automatically. |
| 10538 | * |
| 10539 | * Realizing a widget requires all |
| 10540 | * the widget’s parent widgets to be realized; calling |
| 10541 | * gtk_widget_realize() realizes the widget’s parents in addition to |
| 10542 | * `widget` itself. If a widget is not yet inside a toplevel window |
| 10543 | * when you realize it, bad things will happen. |
| 10544 | * |
| 10545 | * This function is primarily used in widget implementations, and |
| 10546 | * isn’t very useful otherwise. Many times when you think you might |
| 10547 | * need it, a better approach is to connect to a signal that will be |
| 10548 | * called after the widget is realized automatically, such as |
| 10549 | * #GtkWidget::draw. Or simply g_signal_connect () to the |
| 10550 | * #GtkWidget::realize signal. |
| 10551 | */ |
| 10552 | realize(): void; |
| 10553 | /** |
| 10554 | * Computes the intersection of a `widget’`s area and `region,` returning |
| 10555 | * the intersection. The result may be empty, use cairo_region_is_empty() to |
| 10556 | * check. |
| 10557 | * @param region a #cairo_region_t, in the same coordinate system as @widget->allocation. That is, relative to @widget->window for widgets which return %FALSE from gtk_widget_get_has_window(); relative to the parent window of @widget->window otherwise. |
| 10558 | * @returns A newly allocated region holding the intersection of @widget and @region. |
| 10559 | */ |
| 10560 | region_intersect(region: cairo.Region): cairo.Region; |
| 10561 | /** |
| 10562 | * Registers a #GdkWindow with the widget and sets it up so that |
| 10563 | * the widget receives events for it. Call gtk_widget_unregister_window() |
| 10564 | * when destroying the window. |
| 10565 | * |
| 10566 | * Before 3.8 you needed to call gdk_window_set_user_data() directly to set |
| 10567 | * this up. This is now deprecated and you should use gtk_widget_register_window() |
| 10568 | * instead. Old code will keep working as is, although some new features like |
| 10569 | * transparency might not work perfectly. |
| 10570 | * @param window a #GdkWindow |
| 10571 | */ |
| 10572 | register_window(window: Gdk.Window): void; |
| 10573 | /** |
| 10574 | * Removes an accelerator from `widget,` previously installed with |
| 10575 | * gtk_widget_add_accelerator(). |
| 10576 | * @param accel_group accel group for this widget |
| 10577 | * @param accel_key GDK keyval of the accelerator |
| 10578 | * @param accel_mods modifier key combination of the accelerator |
| 10579 | * @returns whether an accelerator was installed and could be removed |
| 10580 | */ |
| 10581 | remove_accelerator( |
| 10582 | accel_group: Gtk.AccelGroup, |
| 10583 | accel_key: number, |
| 10584 | accel_mods: Gdk.ModifierType | null, |
| 10585 | ): boolean; |
| 10586 | /** |
| 10587 | * Removes a widget from the list of mnemonic labels for |
| 10588 | * this widget. (See gtk_widget_list_mnemonic_labels()). The widget |
| 10589 | * must have previously been added to the list with |
| 10590 | * gtk_widget_add_mnemonic_label(). |
| 10591 | * @param label a #GtkWidget that was previously set as a mnemonic label for @widget with gtk_widget_add_mnemonic_label(). |
| 10592 | */ |
| 10593 | remove_mnemonic_label(label: Gtk.Widget): void; |
| 10594 | /** |
| 10595 | * Removes a tick callback previously registered with |
| 10596 | * gtk_widget_add_tick_callback(). |
| 10597 | * @param id an id returned by gtk_widget_add_tick_callback() |
| 10598 | */ |
| 10599 | remove_tick_callback(id: number): void; |
| 10600 | /** |
| 10601 | * A convenience function that uses the theme settings for `widget` |
| 10602 | * to look up `stock_id` and render it to a pixbuf. `stock_id` should |
| 10603 | * be a stock icon ID such as #GTK_STOCK_OPEN or #GTK_STOCK_OK. `size` |
| 10604 | * should be a size such as #GTK_ICON_SIZE_MENU. `detail` should be a |
| 10605 | * string that identifies the widget or code doing the rendering, so |
| 10606 | * that theme engines can special-case rendering for that widget or |
| 10607 | * code. |
| 10608 | * |
| 10609 | * The pixels in the returned #GdkPixbuf are shared with the rest of |
| 10610 | * the application and should not be modified. The pixbuf should be |
| 10611 | * freed after use with g_object_unref(). |
| 10612 | * @param stock_id a stock ID |
| 10613 | * @param size a stock size (#GtkIconSize). A size of `(GtkIconSize)-1` means render at the size of the source and don’t scale (if there are multiple source sizes, GTK+ picks one of the available sizes). |
| 10614 | * @param detail render detail to pass to theme engine |
| 10615 | * @returns a new pixbuf, or %NULL if the stock ID wasn’t known |
| 10616 | */ |
| 10617 | render_icon(stock_id: string, size: number, detail?: string | null): GdkPixbuf.Pixbuf | null; |
| 10618 | /** |
| 10619 | * A convenience function that uses the theme engine and style |
| 10620 | * settings for `widget` to look up `stock_id` and render it to |
| 10621 | * a pixbuf. `stock_id` should be a stock icon ID such as |
| 10622 | * #GTK_STOCK_OPEN or #GTK_STOCK_OK. `size` should be a size |
| 10623 | * such as #GTK_ICON_SIZE_MENU. |
| 10624 | * |
| 10625 | * The pixels in the returned #GdkPixbuf are shared with the rest of |
| 10626 | * the application and should not be modified. The pixbuf should be freed |
| 10627 | * after use with g_object_unref(). |
| 10628 | * @param stock_id a stock ID |
| 10629 | * @param size a stock size (#GtkIconSize). A size of `(GtkIconSize)-1` means render at the size of the source and don’t scale (if there are multiple source sizes, GTK+ picks one of the available sizes). |
| 10630 | * @returns a new pixbuf, or %NULL if the stock ID wasn’t known |
| 10631 | */ |
| 10632 | render_icon_pixbuf(stock_id: string, size: number): GdkPixbuf.Pixbuf | null; |
| 10633 | /** |
| 10634 | * Moves a widget from one #GtkContainer to another, handling reference |
| 10635 | * count issues to avoid destroying the widget. |
| 10636 | * @param new_parent a #GtkContainer to move the widget into |
| 10637 | */ |
| 10638 | reparent(new_parent: Gtk.Widget): void; |
| 10639 | /** |
| 10640 | * Reset the styles of `widget` and all descendents, so when |
| 10641 | * they are looked up again, they get the correct values |
| 10642 | * for the currently loaded RC file settings. |
| 10643 | * |
| 10644 | * This function is not useful for applications. |
| 10645 | */ |
| 10646 | reset_rc_styles(): void; |
| 10647 | /** |
| 10648 | * Updates the style context of `widget` and all descendants |
| 10649 | * by updating its widget path. #GtkContainers may want |
| 10650 | * to use this on a child when reordering it in a way that a different |
| 10651 | * style might apply to it. See also gtk_container_get_path_for_child(). |
| 10652 | */ |
| 10653 | reset_style(): void; |
| 10654 | /** |
| 10655 | * Very rarely-used function. This function is used to emit |
| 10656 | * an expose event on a widget. This function is not normally used |
| 10657 | * directly. The only time it is used is when propagating an expose |
| 10658 | * event to a windowless child widget (gtk_widget_get_has_window() is %FALSE), |
| 10659 | * and that is normally done using gtk_container_propagate_draw(). |
| 10660 | * |
| 10661 | * If you want to force an area of a window to be redrawn, |
| 10662 | * use gdk_window_invalidate_rect() or gdk_window_invalidate_region(). |
| 10663 | * To cause the redraw to be done immediately, follow that call |
| 10664 | * with a call to gdk_window_process_updates(). |
| 10665 | * @param event a expose #GdkEvent |
| 10666 | * @returns return from the event signal emission (%TRUE if the event was handled) |
| 10667 | */ |
| 10668 | send_expose(event: Gdk.Event): number; |
| 10669 | /** |
| 10670 | * Sends the focus change `event` to `widget` |
| 10671 | * |
| 10672 | * This function is not meant to be used by applications. The only time it |
| 10673 | * should be used is when it is necessary for a #GtkWidget to assign focus |
| 10674 | * to a widget that is semantically owned by the first widget even though |
| 10675 | * it’s not a direct child - for instance, a search entry in a floating |
| 10676 | * window similar to the quick search in #GtkTreeView. |
| 10677 | * |
| 10678 | * An example of its usage is: |
| 10679 | * |
| 10680 | * |
| 10681 | * ```c |
| 10682 | * GdkEvent *fevent = gdk_event_new (GDK_FOCUS_CHANGE); |
| 10683 | * |
| 10684 | * fevent->focus_change.type = GDK_FOCUS_CHANGE; |
| 10685 | * fevent->focus_change.in = TRUE; |
| 10686 | * fevent->focus_change.window = _gtk_widget_get_window (widget); |
| 10687 | * if (fevent->focus_change.window != NULL) |
| 10688 | * g_object_ref (fevent->focus_change.window); |
| 10689 | * |
| 10690 | * gtk_widget_send_focus_change (widget, fevent); |
| 10691 | * |
| 10692 | * gdk_event_free (event); |
| 10693 | * ``` |
| 10694 | * |
| 10695 | * @param event a #GdkEvent of type GDK_FOCUS_CHANGE |
| 10696 | * @returns the return value from the event signal emission: %TRUE if the event was handled, and %FALSE otherwise |
| 10697 | */ |
| 10698 | send_focus_change(event: Gdk.Event): boolean; |
| 10699 | /** |
| 10700 | * Given an accelerator group, `accel_group,` and an accelerator path, |
| 10701 | * `accel_path,` sets up an accelerator in `accel_group` so whenever the |
| 10702 | * key binding that is defined for `accel_path` is pressed, `widget` |
| 10703 | * will be activated. This removes any accelerators (for any |
| 10704 | * accelerator group) installed by previous calls to |
| 10705 | * gtk_widget_set_accel_path(). Associating accelerators with |
| 10706 | * paths allows them to be modified by the user and the modifications |
| 10707 | * to be saved for future use. (See gtk_accel_map_save().) |
| 10708 | * |
| 10709 | * This function is a low level function that would most likely |
| 10710 | * be used by a menu creation system like #GtkUIManager. If you |
| 10711 | * use #GtkUIManager, setting up accelerator paths will be done |
| 10712 | * automatically. |
| 10713 | * |
| 10714 | * Even when you you aren’t using #GtkUIManager, if you only want to |
| 10715 | * set up accelerators on menu items gtk_menu_item_set_accel_path() |
| 10716 | * provides a somewhat more convenient interface. |
| 10717 | * |
| 10718 | * Note that `accel_path` string will be stored in a #GQuark. Therefore, if you |
| 10719 | * pass a static string, you can save some memory by interning it first with |
| 10720 | * g_intern_static_string(). |
| 10721 | * @param accel_path path used to look up the accelerator |
| 10722 | * @param accel_group a #GtkAccelGroup. |
| 10723 | */ |
| 10724 | set_accel_path(accel_path?: string | null, accel_group?: Gtk.AccelGroup | null): void; |
| 10725 | /** |
| 10726 | * Sets the widget’s allocation. This should not be used |
| 10727 | * directly, but from within a widget’s size_allocate method. |
| 10728 | * |
| 10729 | * The allocation set should be the “adjusted” or actual |
| 10730 | * allocation. If you’re implementing a #GtkContainer, you want to use |
| 10731 | * gtk_widget_size_allocate() instead of gtk_widget_set_allocation(). |
| 10732 | * The GtkWidgetClass::adjust_size_allocation virtual method adjusts the |
| 10733 | * allocation inside gtk_widget_size_allocate() to create an adjusted |
| 10734 | * allocation. |
| 10735 | * @param allocation a pointer to a #GtkAllocation to copy from |
| 10736 | */ |
| 10737 | set_allocation(allocation: Gtk.Allocation): void; |
| 10738 | /** |
| 10739 | * Sets whether the application intends to draw on the widget in |
| 10740 | * an #GtkWidget::draw handler. |
| 10741 | * |
| 10742 | * This is a hint to the widget and does not affect the behavior of |
| 10743 | * the GTK+ core; many widgets ignore this flag entirely. For widgets |
| 10744 | * that do pay attention to the flag, such as #GtkEventBox and #GtkWindow, |
| 10745 | * the effect is to suppress default themed drawing of the widget's |
| 10746 | * background. (Children of the widget will still be drawn.) The application |
| 10747 | * is then entirely responsible for drawing the widget background. |
| 10748 | * |
| 10749 | * Note that the background is still drawn when the widget is mapped. |
| 10750 | * @param app_paintable %TRUE if the application will paint on the widget |
| 10751 | */ |
| 10752 | set_app_paintable(app_paintable: boolean): void; |
| 10753 | /** |
| 10754 | * Specifies whether `widget` can be a default widget. See |
| 10755 | * gtk_widget_grab_default() for details about the meaning of |
| 10756 | * “default”. |
| 10757 | * @param can_default whether or not @widget can be a default widget. |
| 10758 | */ |
| 10759 | set_can_default(can_default: boolean): void; |
| 10760 | /** |
| 10761 | * Specifies whether `widget` can own the input focus. See |
| 10762 | * gtk_widget_grab_focus() for actually setting the input focus on a |
| 10763 | * widget. |
| 10764 | * @param can_focus whether or not @widget can own the input focus. |
| 10765 | */ |
| 10766 | set_can_focus(can_focus: boolean): void; |
| 10767 | /** |
| 10768 | * Sets whether `widget` should be mapped along with its when its parent |
| 10769 | * is mapped and `widget` has been shown with gtk_widget_show(). |
| 10770 | * |
| 10771 | * The child visibility can be set for widget before it is added to |
| 10772 | * a container with gtk_widget_set_parent(), to avoid mapping |
| 10773 | * children unnecessary before immediately unmapping them. However |
| 10774 | * it will be reset to its default state of %TRUE when the widget |
| 10775 | * is removed from a container. |
| 10776 | * |
| 10777 | * Note that changing the child visibility of a widget does not |
| 10778 | * queue a resize on the widget. Most of the time, the size of |
| 10779 | * a widget is computed from all visible children, whether or |
| 10780 | * not they are mapped. If this is not the case, the container |
| 10781 | * can queue a resize itself. |
| 10782 | * |
| 10783 | * This function is only useful for container implementations and |
| 10784 | * never should be called by an application. |
| 10785 | * @param is_visible if %TRUE, @widget should be mapped along with its parent. |
| 10786 | */ |
| 10787 | set_child_visible(is_visible: boolean): void; |
| 10788 | /** |
| 10789 | * Sets the widget’s clip. This must not be used directly, |
| 10790 | * but from within a widget’s size_allocate method. |
| 10791 | * It must be called after gtk_widget_set_allocation() (or after chaining up |
| 10792 | * to the parent class), because that function resets the clip. |
| 10793 | * |
| 10794 | * The clip set should be the area that `widget` draws on. If `widget` is a |
| 10795 | * #GtkContainer, the area must contain all children's clips. |
| 10796 | * |
| 10797 | * If this function is not called by `widget` during a ::size-allocate handler, |
| 10798 | * the clip will be set to `widget'`s allocation. |
| 10799 | * @param clip a pointer to a #GtkAllocation to copy from |
| 10800 | */ |
| 10801 | set_clip(clip: Gtk.Allocation): void; |
| 10802 | /** |
| 10803 | * Sets a widgets composite name. The widget must be |
| 10804 | * a composite child of its parent; see gtk_widget_push_composite_child(). |
| 10805 | * @param name the name to set |
| 10806 | */ |
| 10807 | set_composite_name(name: string): void; |
| 10808 | /** |
| 10809 | * Enables or disables a #GdkDevice to interact with `widget` |
| 10810 | * and all its children. |
| 10811 | * |
| 10812 | * It does so by descending through the #GdkWindow hierarchy |
| 10813 | * and enabling the same mask that is has for core events |
| 10814 | * (i.e. the one that gdk_window_get_events() returns). |
| 10815 | * @param device a #GdkDevice |
| 10816 | * @param enabled whether to enable the device |
| 10817 | */ |
| 10818 | set_device_enabled(device: Gdk.Device, enabled: boolean): void; |
| 10819 | /** |
| 10820 | * Sets the device event mask (see #GdkEventMask) for a widget. The event |
| 10821 | * mask determines which events a widget will receive from `device`. Keep |
| 10822 | * in mind that different widgets have different default event masks, and by |
| 10823 | * changing the event mask you may disrupt a widget’s functionality, |
| 10824 | * so be careful. This function must be called while a widget is |
| 10825 | * unrealized. Consider gtk_widget_add_device_events() for widgets that are |
| 10826 | * already realized, or if you want to preserve the existing event |
| 10827 | * mask. This function can’t be used with windowless widgets (which return |
| 10828 | * %FALSE from gtk_widget_get_has_window()); |
| 10829 | * to get events on those widgets, place them inside a #GtkEventBox |
| 10830 | * and receive events on the event box. |
| 10831 | * @param device a #GdkDevice |
| 10832 | * @param events event mask |
| 10833 | */ |
| 10834 | set_device_events(device: Gdk.Device, events: Gdk.EventMask | null): void; |
| 10835 | /** |
| 10836 | * Sets the reading direction on a particular widget. This direction |
| 10837 | * controls the primary direction for widgets containing text, |
| 10838 | * and also the direction in which the children of a container are |
| 10839 | * packed. The ability to set the direction is present in order |
| 10840 | * so that correct localization into languages with right-to-left |
| 10841 | * reading directions can be done. Generally, applications will |
| 10842 | * let the default reading direction present, except for containers |
| 10843 | * where the containers are arranged in an order that is explicitly |
| 10844 | * visual rather than logical (such as buttons for text justification). |
| 10845 | * |
| 10846 | * If the direction is set to %GTK_TEXT_DIR_NONE, then the value |
| 10847 | * set by gtk_widget_set_default_direction() will be used. |
| 10848 | * @param dir the new direction |
| 10849 | */ |
| 10850 | set_direction(dir: Gtk.TextDirection | null): void; |
| 10851 | /** |
| 10852 | * Widgets are double buffered by default; you can use this function |
| 10853 | * to turn off the buffering. “Double buffered” simply means that |
| 10854 | * gdk_window_begin_draw_frame() and gdk_window_end_draw_frame() are called |
| 10855 | * automatically around expose events sent to the |
| 10856 | * widget. gdk_window_begin_draw_frame() diverts all drawing to a widget's |
| 10857 | * window to an offscreen buffer, and gdk_window_end_draw_frame() draws the |
| 10858 | * buffer to the screen. The result is that users see the window |
| 10859 | * update in one smooth step, and don’t see individual graphics |
| 10860 | * primitives being rendered. |
| 10861 | * |
| 10862 | * In very simple terms, double buffered widgets don’t flicker, |
| 10863 | * so you would only use this function to turn off double buffering |
| 10864 | * if you had special needs and really knew what you were doing. |
| 10865 | * |
| 10866 | * Note: if you turn off double-buffering, you have to handle |
| 10867 | * expose events, since even the clearing to the background color or |
| 10868 | * pixmap will not happen automatically (as it is done in |
| 10869 | * gdk_window_begin_draw_frame()). |
| 10870 | * |
| 10871 | * In 3.10 GTK and GDK have been restructured for translucent drawing. Since |
| 10872 | * then expose events for double-buffered widgets are culled into a single |
| 10873 | * event to the toplevel GDK window. If you now unset double buffering, you |
| 10874 | * will cause a separate rendering pass for every widget. This will likely |
| 10875 | * cause rendering problems - in particular related to stacking - and usually |
| 10876 | * increases rendering times significantly. |
| 10877 | * @param double_buffered %TRUE to double-buffer a widget |
| 10878 | */ |
| 10879 | set_double_buffered(double_buffered: boolean): void; |
| 10880 | /** |
| 10881 | * Sets the event mask (see #GdkEventMask) for a widget. The event |
| 10882 | * mask determines which events a widget will receive. Keep in mind |
| 10883 | * that different widgets have different default event masks, and by |
| 10884 | * changing the event mask you may disrupt a widget’s functionality, |
| 10885 | * so be careful. This function must be called while a widget is |
| 10886 | * unrealized. Consider gtk_widget_add_events() for widgets that are |
| 10887 | * already realized, or if you want to preserve the existing event |
| 10888 | * mask. This function can’t be used with widgets that have no window. |
| 10889 | * (See gtk_widget_get_has_window()). To get events on those widgets, |
| 10890 | * place them inside a #GtkEventBox and receive events on the event |
| 10891 | * box. |
| 10892 | * @param events event mask |
| 10893 | */ |
| 10894 | set_events(events: number): void; |
| 10895 | /** |
| 10896 | * Sets whether the widget should grab focus when it is clicked with the mouse. |
| 10897 | * Making mouse clicks not grab focus is useful in places like toolbars where |
| 10898 | * you don’t want the keyboard focus removed from the main area of the |
| 10899 | * application. |
| 10900 | * @param focus_on_click whether the widget should grab focus when clicked with the mouse |
| 10901 | */ |
| 10902 | set_focus_on_click(focus_on_click: boolean): void; |
| 10903 | /** |
| 10904 | * Sets the font map to use for Pango rendering. When not set, the widget |
| 10905 | * will inherit the font map from its parent. |
| 10906 | * @param font_map a #PangoFontMap, or %NULL to unset any previously set font map |
| 10907 | */ |
| 10908 | set_font_map(font_map?: Pango.FontMap | null): void; |
| 10909 | /** |
| 10910 | * Sets the #cairo_font_options_t used for Pango rendering in this widget. |
| 10911 | * When not set, the default font options for the #GdkScreen will be used. |
| 10912 | * @param options a #cairo_font_options_t, or %NULL to unset any previously set default font options. |
| 10913 | */ |
| 10914 | set_font_options(options?: cairo.FontOptions | null): void; |
| 10915 | /** |
| 10916 | * Sets the horizontal alignment of `widget`. |
| 10917 | * See the #GtkWidget:halign property. |
| 10918 | * @param align the horizontal alignment |
| 10919 | */ |
| 10920 | set_halign(align: Gtk.Align | null): void; |
| 10921 | /** |
| 10922 | * Sets the has-tooltip property on `widget` to `has_tooltip`. See |
| 10923 | * #GtkWidget:has-tooltip for more information. |
| 10924 | * @param has_tooltip whether or not @widget has a tooltip. |
| 10925 | */ |
| 10926 | set_has_tooltip(has_tooltip: boolean): void; |
| 10927 | /** |
| 10928 | * Specifies whether `widget` has a #GdkWindow of its own. Note that |
| 10929 | * all realized widgets have a non-%NULL “window” pointer |
| 10930 | * (gtk_widget_get_window() never returns a %NULL window when a widget |
| 10931 | * is realized), but for many of them it’s actually the #GdkWindow of |
| 10932 | * one of its parent widgets. Widgets that do not create a %window for |
| 10933 | * themselves in #GtkWidget::realize must announce this by |
| 10934 | * calling this function with `has_window` = %FALSE. |
| 10935 | * |
| 10936 | * This function should only be called by widget implementations, |
| 10937 | * and they should call it in their init() function. |
| 10938 | * @param has_window whether or not @widget has a window. |
| 10939 | */ |
| 10940 | set_has_window(has_window: boolean): void; |
| 10941 | /** |
| 10942 | * Sets whether the widget would like any available extra horizontal |
| 10943 | * space. When a user resizes a #GtkWindow, widgets with expand=TRUE |
| 10944 | * generally receive the extra space. For example, a list or |
| 10945 | * scrollable area or document in your window would often be set to |
| 10946 | * expand. |
| 10947 | * |
| 10948 | * Call this function to set the expand flag if you would like your |
| 10949 | * widget to become larger horizontally when the window has extra |
| 10950 | * room. |
| 10951 | * |
| 10952 | * By default, widgets automatically expand if any of their children |
| 10953 | * want to expand. (To see if a widget will automatically expand given |
| 10954 | * its current children and state, call gtk_widget_compute_expand(). A |
| 10955 | * container can decide how the expandability of children affects the |
| 10956 | * expansion of the container by overriding the compute_expand virtual |
| 10957 | * method on #GtkWidget.). |
| 10958 | * |
| 10959 | * Setting hexpand explicitly with this function will override the |
| 10960 | * automatic expand behavior. |
| 10961 | * |
| 10962 | * This function forces the widget to expand or not to expand, |
| 10963 | * regardless of children. The override occurs because |
| 10964 | * gtk_widget_set_hexpand() sets the hexpand-set property (see |
| 10965 | * gtk_widget_set_hexpand_set()) which causes the widget’s hexpand |
| 10966 | * value to be used, rather than looking at children and widget state. |
| 10967 | * @param expand whether to expand |
| 10968 | */ |
| 10969 | set_hexpand(expand: boolean): void; |
| 10970 | /** |
| 10971 | * Sets whether the hexpand flag (see gtk_widget_get_hexpand()) will |
| 10972 | * be used. |
| 10973 | * |
| 10974 | * The hexpand-set property will be set automatically when you call |
| 10975 | * gtk_widget_set_hexpand() to set hexpand, so the most likely |
| 10976 | * reason to use this function would be to unset an explicit expand |
| 10977 | * flag. |
| 10978 | * |
| 10979 | * If hexpand is set, then it overrides any computed |
| 10980 | * expand value based on child widgets. If hexpand is not |
| 10981 | * set, then the expand value depends on whether any |
| 10982 | * children of the widget would like to expand. |
| 10983 | * |
| 10984 | * There are few reasons to use this function, but it’s here |
| 10985 | * for completeness and consistency. |
| 10986 | * @param set value for hexpand-set property |
| 10987 | */ |
| 10988 | set_hexpand_set(set: boolean): void; |
| 10989 | /** |
| 10990 | * Marks the widget as being mapped. |
| 10991 | * |
| 10992 | * This function should only ever be called in a derived widget's |
| 10993 | * “map” or “unmap” implementation. |
| 10994 | * @param mapped %TRUE to mark the widget as mapped |
| 10995 | */ |
| 10996 | set_mapped(mapped: boolean): void; |
| 10997 | /** |
| 10998 | * Sets the bottom margin of `widget`. |
| 10999 | * See the #GtkWidget:margin-bottom property. |
| 11000 | * @param margin the bottom margin |
| 11001 | */ |
| 11002 | set_margin_bottom(margin: number): void; |
| 11003 | /** |
| 11004 | * Sets the end margin of `widget`. |
| 11005 | * See the #GtkWidget:margin-end property. |
| 11006 | * @param margin the end margin |
| 11007 | */ |
| 11008 | set_margin_end(margin: number): void; |
| 11009 | /** |
| 11010 | * Sets the left margin of `widget`. |
| 11011 | * See the #GtkWidget:margin-left property. |
| 11012 | * @param margin the left margin |
| 11013 | */ |
| 11014 | set_margin_left(margin: number): void; |
| 11015 | /** |
| 11016 | * Sets the right margin of `widget`. |
| 11017 | * See the #GtkWidget:margin-right property. |
| 11018 | * @param margin the right margin |
| 11019 | */ |
| 11020 | set_margin_right(margin: number): void; |
| 11021 | /** |
| 11022 | * Sets the start margin of `widget`. |
| 11023 | * See the #GtkWidget:margin-start property. |
| 11024 | * @param margin the start margin |
| 11025 | */ |
| 11026 | set_margin_start(margin: number): void; |
| 11027 | /** |
| 11028 | * Sets the top margin of `widget`. |
| 11029 | * See the #GtkWidget:margin-top property. |
| 11030 | * @param margin the top margin |
| 11031 | */ |
| 11032 | set_margin_top(margin: number): void; |
| 11033 | /** |
| 11034 | * Widgets can be named, which allows you to refer to them from a |
| 11035 | * CSS file. You can apply a style to widgets with a particular name |
| 11036 | * in the CSS file. See the documentation for the CSS syntax (on the |
| 11037 | * same page as the docs for #GtkStyleContext). |
| 11038 | * |
| 11039 | * Note that the CSS syntax has certain special characters to delimit |
| 11040 | * and represent elements in a selector (period, #, >, *...), so using |
| 11041 | * these will make your widget impossible to match by name. Any combination |
| 11042 | * of alphanumeric symbols, dashes and underscores will suffice. |
| 11043 | * @param name name for the widget |
| 11044 | */ |
| 11045 | set_name(name: string): void; |
| 11046 | /** |
| 11047 | * Sets the #GtkWidget:no-show-all property, which determines whether |
| 11048 | * calls to gtk_widget_show_all() will affect this widget. |
| 11049 | * |
| 11050 | * This is mostly for use in constructing widget hierarchies with externally |
| 11051 | * controlled visibility, see #GtkUIManager. |
| 11052 | * @param no_show_all the new value for the “no-show-all” property |
| 11053 | */ |
| 11054 | set_no_show_all(no_show_all: boolean): void; |
| 11055 | /** |
| 11056 | * Request the `widget` to be rendered partially transparent, |
| 11057 | * with opacity 0 being fully transparent and 1 fully opaque. (Opacity values |
| 11058 | * are clamped to the [0,1] range.). |
| 11059 | * This works on both toplevel widget, and child widgets, although there |
| 11060 | * are some limitations: |
| 11061 | * |
| 11062 | * For toplevel widgets this depends on the capabilities of the windowing |
| 11063 | * system. On X11 this has any effect only on X screens with a compositing manager |
| 11064 | * running. See gtk_widget_is_composited(). On Windows it should work |
| 11065 | * always, although setting a window’s opacity after the window has been |
| 11066 | * shown causes it to flicker once on Windows. |
| 11067 | * |
| 11068 | * For child widgets it doesn’t work if any affected widget has a native window, or |
| 11069 | * disables double buffering. |
| 11070 | * @param opacity desired opacity, between 0 and 1 |
| 11071 | */ |
| 11072 | set_opacity(opacity: number): void; |
| 11073 | /** |
| 11074 | * This function is useful only when implementing subclasses of |
| 11075 | * #GtkContainer. |
| 11076 | * Sets the container as the parent of `widget,` and takes care of |
| 11077 | * some details such as updating the state and style of the child |
| 11078 | * to reflect its new location. The opposite function is |
| 11079 | * gtk_widget_unparent(). |
| 11080 | * @param parent parent container |
| 11081 | */ |
| 11082 | set_parent(parent: Gtk.Widget): void; |
| 11083 | /** |
| 11084 | * Sets a non default parent window for `widget`. |
| 11085 | * |
| 11086 | * For #GtkWindow classes, setting a `parent_window` effects whether |
| 11087 | * the window is a toplevel window or can be embedded into other |
| 11088 | * widgets. |
| 11089 | * |
| 11090 | * For #GtkWindow classes, this needs to be called before the |
| 11091 | * window is realized. |
| 11092 | * @param parent_window the new parent window. |
| 11093 | */ |
| 11094 | set_parent_window(parent_window: Gdk.Window): void; |
| 11095 | /** |
| 11096 | * Marks the widget as being realized. This function must only be |
| 11097 | * called after all #GdkWindows for the `widget` have been created |
| 11098 | * and registered. |
| 11099 | * |
| 11100 | * This function should only ever be called in a derived widget's |
| 11101 | * “realize” or “unrealize” implementation. |
| 11102 | * @param realized %TRUE to mark the widget as realized |
| 11103 | */ |
| 11104 | set_realized(realized: boolean): void; |
| 11105 | /** |
| 11106 | * Specifies whether `widget` will be treated as the default widget |
| 11107 | * within its toplevel when it has the focus, even if another widget |
| 11108 | * is the default. |
| 11109 | * |
| 11110 | * See gtk_widget_grab_default() for details about the meaning of |
| 11111 | * “default”. |
| 11112 | * @param receives_default whether or not @widget can be a default widget. |
| 11113 | */ |
| 11114 | set_receives_default(receives_default: boolean): void; |
| 11115 | /** |
| 11116 | * Sets whether the entire widget is queued for drawing when its size |
| 11117 | * allocation changes. By default, this setting is %TRUE and |
| 11118 | * the entire widget is redrawn on every size change. If your widget |
| 11119 | * leaves the upper left unchanged when made bigger, turning this |
| 11120 | * setting off will improve performance. |
| 11121 | * |
| 11122 | * Note that for widgets where gtk_widget_get_has_window() is %FALSE |
| 11123 | * setting this flag to %FALSE turns off all allocation on resizing: |
| 11124 | * the widget will not even redraw if its position changes; this is to |
| 11125 | * allow containers that don’t draw anything to avoid excess |
| 11126 | * invalidations. If you set this flag on a widget with no window that |
| 11127 | * does draw on `widget->`window, you are |
| 11128 | * responsible for invalidating both the old and new allocation of the |
| 11129 | * widget when the widget is moved and responsible for invalidating |
| 11130 | * regions newly when the widget increases size. |
| 11131 | * @param redraw_on_allocate if %TRUE, the entire widget will be redrawn when it is allocated to a new size. Otherwise, only the new portion of the widget will be redrawn. |
| 11132 | */ |
| 11133 | set_redraw_on_allocate(redraw_on_allocate: boolean): void; |
| 11134 | /** |
| 11135 | * Sets the sensitivity of a widget. A widget is sensitive if the user |
| 11136 | * can interact with it. Insensitive widgets are “grayed out” and the |
| 11137 | * user can’t interact with them. Insensitive widgets are known as |
| 11138 | * “inactive”, “disabled”, or “ghosted” in some other toolkits. |
| 11139 | * @param sensitive %TRUE to make the widget sensitive |
| 11140 | */ |
| 11141 | set_sensitive(sensitive: boolean): void; |
| 11142 | /** |
| 11143 | * Sets the minimum size of a widget; that is, the widget’s size |
| 11144 | * request will be at least `width` by `height`. You can use this |
| 11145 | * function to force a widget to be larger than it normally would be. |
| 11146 | * |
| 11147 | * In most cases, gtk_window_set_default_size() is a better choice for |
| 11148 | * toplevel windows than this function; setting the default size will |
| 11149 | * still allow users to shrink the window. Setting the size request |
| 11150 | * will force them to leave the window at least as large as the size |
| 11151 | * request. When dealing with window sizes, |
| 11152 | * gtk_window_set_geometry_hints() can be a useful function as well. |
| 11153 | * |
| 11154 | * Note the inherent danger of setting any fixed size - themes, |
| 11155 | * translations into other languages, different fonts, and user action |
| 11156 | * can all change the appropriate size for a given widget. So, it's |
| 11157 | * basically impossible to hardcode a size that will always be |
| 11158 | * correct. |
| 11159 | * |
| 11160 | * The size request of a widget is the smallest size a widget can |
| 11161 | * accept while still functioning well and drawing itself correctly. |
| 11162 | * However in some strange cases a widget may be allocated less than |
| 11163 | * its requested size, and in many cases a widget may be allocated more |
| 11164 | * space than it requested. |
| 11165 | * |
| 11166 | * If the size request in a given direction is -1 (unset), then |
| 11167 | * the “natural” size request of the widget will be used instead. |
| 11168 | * |
| 11169 | * The size request set here does not include any margin from the |
| 11170 | * #GtkWidget properties margin-left, margin-right, margin-top, and |
| 11171 | * margin-bottom, but it does include pretty much all other padding |
| 11172 | * or border properties set by any subclass of #GtkWidget. |
| 11173 | * @param width width @widget should request, or -1 to unset |
| 11174 | * @param height height @widget should request, or -1 to unset |
| 11175 | */ |
| 11176 | set_size_request(width: number, height: number): void; |
| 11177 | /** |
| 11178 | * This function is for use in widget implementations. Sets the state |
| 11179 | * of a widget (insensitive, prelighted, etc.) Usually you should set |
| 11180 | * the state using wrapper functions such as gtk_widget_set_sensitive(). |
| 11181 | * @param state new state for @widget |
| 11182 | */ |
| 11183 | set_state(state: Gtk.StateType | null): void; |
| 11184 | /** |
| 11185 | * This function is for use in widget implementations. Turns on flag |
| 11186 | * values in the current widget state (insensitive, prelighted, etc.). |
| 11187 | * |
| 11188 | * This function accepts the values %GTK_STATE_FLAG_DIR_LTR and |
| 11189 | * %GTK_STATE_FLAG_DIR_RTL but ignores them. If you want to set the widget's |
| 11190 | * direction, use gtk_widget_set_direction(). |
| 11191 | * |
| 11192 | * It is worth mentioning that any other state than %GTK_STATE_FLAG_INSENSITIVE, |
| 11193 | * will be propagated down to all non-internal children if `widget` is a |
| 11194 | * #GtkContainer, while %GTK_STATE_FLAG_INSENSITIVE itself will be propagated |
| 11195 | * down to all #GtkContainer children by different means than turning on the |
| 11196 | * state flag down the hierarchy, both gtk_widget_get_state_flags() and |
| 11197 | * gtk_widget_is_sensitive() will make use of these. |
| 11198 | * @param flags State flags to turn on |
| 11199 | * @param clear Whether to clear state before turning on @flags |
| 11200 | */ |
| 11201 | set_state_flags(flags: Gtk.StateFlags | null, clear: boolean): void; |
| 11202 | /** |
| 11203 | * Used to set the #GtkStyle for a widget (`widget->`style). Since |
| 11204 | * GTK 3, this function does nothing, the passed in style is ignored. |
| 11205 | * @param style a #GtkStyle, or %NULL to remove the effect of a previous call to gtk_widget_set_style() and go back to the default style |
| 11206 | */ |
| 11207 | set_style(style?: Gtk.Style | null): void; |
| 11208 | /** |
| 11209 | * Enables or disables multiple pointer awareness. If this setting is %TRUE, |
| 11210 | * `widget` will start receiving multiple, per device enter/leave events. Note |
| 11211 | * that if custom #GdkWindows are created in #GtkWidget::realize, |
| 11212 | * gdk_window_set_support_multidevice() will have to be called manually on them. |
| 11213 | * @param support_multidevice %TRUE to support input from multiple devices. |
| 11214 | */ |
| 11215 | set_support_multidevice(support_multidevice: boolean): void; |
| 11216 | /** |
| 11217 | * Sets `markup` as the contents of the tooltip, which is marked up with |
| 11218 | * the [Pango text markup language][PangoMarkupFormat]. |
| 11219 | * |
| 11220 | * This function will take care of setting #GtkWidget:has-tooltip to %TRUE |
| 11221 | * and of the default handler for the #GtkWidget::query-tooltip signal. |
| 11222 | * |
| 11223 | * See also the #GtkWidget:tooltip-markup property and |
| 11224 | * gtk_tooltip_set_markup(). |
| 11225 | * @param markup the contents of the tooltip for @widget, or %NULL |
| 11226 | */ |
| 11227 | set_tooltip_markup(markup?: string | null): void; |
| 11228 | /** |
| 11229 | * Sets `text` as the contents of the tooltip. This function will take |
| 11230 | * care of setting #GtkWidget:has-tooltip to %TRUE and of the default |
| 11231 | * handler for the #GtkWidget::query-tooltip signal. |
| 11232 | * |
| 11233 | * See also the #GtkWidget:tooltip-text property and gtk_tooltip_set_text(). |
| 11234 | * @param text the contents of the tooltip for @widget |
| 11235 | */ |
| 11236 | set_tooltip_text(text?: string | null): void; |
| 11237 | /** |
| 11238 | * Replaces the default window used for displaying |
| 11239 | * tooltips with `custom_window`. GTK+ will take care of showing and |
| 11240 | * hiding `custom_window` at the right moment, to behave likewise as |
| 11241 | * the default tooltip window. If `custom_window` is %NULL, the default |
| 11242 | * tooltip window will be used. |
| 11243 | * @param custom_window a #GtkWindow, or %NULL |
| 11244 | */ |
| 11245 | set_tooltip_window(custom_window?: Gtk.Window | null): void; |
| 11246 | /** |
| 11247 | * Sets the vertical alignment of `widget`. |
| 11248 | * See the #GtkWidget:valign property. |
| 11249 | * @param align the vertical alignment |
| 11250 | */ |
| 11251 | set_valign(align: Gtk.Align | null): void; |
| 11252 | /** |
| 11253 | * Sets whether the widget would like any available extra vertical |
| 11254 | * space. |
| 11255 | * |
| 11256 | * See gtk_widget_set_hexpand() for more detail. |
| 11257 | * @param expand whether to expand |
| 11258 | */ |
| 11259 | set_vexpand(expand: boolean): void; |
| 11260 | /** |
| 11261 | * Sets whether the vexpand flag (see gtk_widget_get_vexpand()) will |
| 11262 | * be used. |
| 11263 | * |
| 11264 | * See gtk_widget_set_hexpand_set() for more detail. |
| 11265 | * @param set value for vexpand-set property |
| 11266 | */ |
| 11267 | set_vexpand_set(set: boolean): void; |
| 11268 | /** |
| 11269 | * Sets the visibility state of `widget`. Note that setting this to |
| 11270 | * %TRUE doesn’t mean the widget is actually viewable, see |
| 11271 | * gtk_widget_get_visible(). |
| 11272 | * |
| 11273 | * This function simply calls gtk_widget_show() or gtk_widget_hide() |
| 11274 | * but is nicer to use when the visibility of the widget depends on |
| 11275 | * some condition. |
| 11276 | * @param visible whether the widget should be shown or not |
| 11277 | */ |
| 11278 | set_visible(visible: boolean): void; |
| 11279 | /** |
| 11280 | * Sets the visual that should be used for by widget and its children for |
| 11281 | * creating #GdkWindows. The visual must be on the same #GdkScreen as |
| 11282 | * returned by gtk_widget_get_screen(), so handling the |
| 11283 | * #GtkWidget::screen-changed signal is necessary. |
| 11284 | * |
| 11285 | * Setting a new `visual` will not cause `widget` to recreate its windows, |
| 11286 | * so you should call this function before `widget` is realized. |
| 11287 | * @param visual visual to be used or %NULL to unset a previous one |
| 11288 | */ |
| 11289 | set_visual(visual?: Gdk.Visual | null): void; |
| 11290 | /** |
| 11291 | * Sets a widget’s window. This function should only be used in a |
| 11292 | * widget’s #GtkWidget::realize implementation. The %window passed is |
| 11293 | * usually either new window created with gdk_window_new(), or the |
| 11294 | * window of its parent widget as returned by |
| 11295 | * gtk_widget_get_parent_window(). |
| 11296 | * |
| 11297 | * Widgets must indicate whether they will create their own #GdkWindow |
| 11298 | * by calling gtk_widget_set_has_window(). This is usually done in the |
| 11299 | * widget’s init() function. |
| 11300 | * |
| 11301 | * Note that this function does not add any reference to `window`. |
| 11302 | * @param window a #GdkWindow |
| 11303 | */ |
| 11304 | set_window(window: Gdk.Window): void; |
| 11305 | /** |
| 11306 | * Sets a shape for this widget’s GDK window. This allows for |
| 11307 | * transparent windows etc., see gdk_window_shape_combine_region() |
| 11308 | * for more information. |
| 11309 | * @param region shape to be added, or %NULL to remove an existing shape |
| 11310 | */ |
| 11311 | shape_combine_region(region?: cairo.Region | null): void; |
| 11312 | /** |
| 11313 | * Flags a widget to be displayed. Any widget that isn’t shown will |
| 11314 | * not appear on the screen. If you want to show all the widgets in a |
| 11315 | * container, it’s easier to call gtk_widget_show_all() on the |
| 11316 | * container, instead of individually showing the widgets. |
| 11317 | * |
| 11318 | * Remember that you have to show the containers containing a widget, |
| 11319 | * in addition to the widget itself, before it will appear onscreen. |
| 11320 | * |
| 11321 | * When a toplevel container is shown, it is immediately realized and |
| 11322 | * mapped; other shown widgets are realized and mapped when their |
| 11323 | * toplevel container is realized and mapped. |
| 11324 | */ |
| 11325 | show(): void; |
| 11326 | /** |
| 11327 | * Recursively shows a widget, and any child widgets (if the widget is |
| 11328 | * a container). |
| 11329 | */ |
| 11330 | show_all(): void; |
| 11331 | /** |
| 11332 | * Shows a widget. If the widget is an unmapped toplevel widget |
| 11333 | * (i.e. a #GtkWindow that has not yet been shown), enter the main |
| 11334 | * loop and wait for the window to actually be mapped. Be careful; |
| 11335 | * because the main loop is running, anything can happen during |
| 11336 | * this function. |
| 11337 | */ |
| 11338 | show_now(): void; |
| 11339 | /** |
| 11340 | * This function is only used by #GtkContainer subclasses, to assign a size |
| 11341 | * and position to their child widgets. |
| 11342 | * |
| 11343 | * In this function, the allocation may be adjusted. It will be forced |
| 11344 | * to a 1x1 minimum size, and the adjust_size_allocation virtual |
| 11345 | * method on the child will be used to adjust the allocation. Standard |
| 11346 | * adjustments include removing the widget’s margins, and applying the |
| 11347 | * widget’s #GtkWidget:halign and #GtkWidget:valign properties. |
| 11348 | * |
| 11349 | * For baseline support in containers you need to use gtk_widget_size_allocate_with_baseline() |
| 11350 | * instead. |
| 11351 | * @param allocation position and size to be allocated to @widget |
| 11352 | */ |
| 11353 | size_allocate(allocation: Gtk.Allocation): void; |
| 11354 | /** |
| 11355 | * This function is only used by #GtkContainer subclasses, to assign a size, |
| 11356 | * position and (optionally) baseline to their child widgets. |
| 11357 | * |
| 11358 | * In this function, the allocation and baseline may be adjusted. It |
| 11359 | * will be forced to a 1x1 minimum size, and the |
| 11360 | * adjust_size_allocation virtual and adjust_baseline_allocation |
| 11361 | * methods on the child will be used to adjust the allocation and |
| 11362 | * baseline. Standard adjustments include removing the widget's |
| 11363 | * margins, and applying the widget’s #GtkWidget:halign and |
| 11364 | * #GtkWidget:valign properties. |
| 11365 | * |
| 11366 | * If the child widget does not have a valign of %GTK_ALIGN_BASELINE the |
| 11367 | * baseline argument is ignored and -1 is used instead. |
| 11368 | * @param allocation position and size to be allocated to @widget |
| 11369 | * @param baseline The baseline of the child, or -1 |
| 11370 | */ |
| 11371 | size_allocate_with_baseline(allocation: Gtk.Allocation, baseline: number): void; |
| 11372 | /** |
| 11373 | * This function is typically used when implementing a #GtkContainer |
| 11374 | * subclass. Obtains the preferred size of a widget. The container |
| 11375 | * uses this information to arrange its child widgets and decide what |
| 11376 | * size allocations to give them with gtk_widget_size_allocate(). |
| 11377 | * |
| 11378 | * You can also call this function from an application, with some |
| 11379 | * caveats. Most notably, getting a size request requires the widget |
| 11380 | * to be associated with a screen, because font information may be |
| 11381 | * needed. Multihead-aware applications should keep this in mind. |
| 11382 | * |
| 11383 | * Also remember that the size request is not necessarily the size |
| 11384 | * a widget will actually be allocated. |
| 11385 | */ |
| 11386 | size_request(): Gtk.Requisition; |
| 11387 | /** |
| 11388 | * This function attaches the widget’s #GtkStyle to the widget's |
| 11389 | * #GdkWindow. It is a replacement for |
| 11390 | * |
| 11391 | * |
| 11392 | * ``` |
| 11393 | * widget->style = gtk_style_attach (widget->style, widget->window); |
| 11394 | * ``` |
| 11395 | * |
| 11396 | * |
| 11397 | * and should only ever be called in a derived widget’s “realize” |
| 11398 | * implementation which does not chain up to its parent class' |
| 11399 | * “realize” implementation, because one of the parent classes |
| 11400 | * (finally #GtkWidget) would attach the style itself. |
| 11401 | */ |
| 11402 | style_attach(): void; |
| 11403 | /** |
| 11404 | * Gets the value of a style property of `widget`. |
| 11405 | * @param property_name the name of a style property |
| 11406 | * @param value location to return the property value |
| 11407 | */ |
| 11408 | style_get_property(property_name: string, value: GObject.Value | any): void; |
| 11409 | /** |
| 11410 | * Reverts the effect of a previous call to gtk_widget_freeze_child_notify(). |
| 11411 | * This causes all queued #GtkWidget::child-notify signals on `widget` to be |
| 11412 | * emitted. |
| 11413 | */ |
| 11414 | thaw_child_notify(): void; |
| 11415 | /** |
| 11416 | * Translate coordinates relative to `src_widget’`s allocation to coordinates |
| 11417 | * relative to `dest_widget’`s allocations. In order to perform this |
| 11418 | * operation, both widgets must be realized, and must share a common |
| 11419 | * toplevel. |
| 11420 | * @param dest_widget a #GtkWidget |
| 11421 | * @param src_x X position relative to @src_widget |
| 11422 | * @param src_y Y position relative to @src_widget |
| 11423 | * @returns %FALSE if either widget was not realized, or there was no common ancestor. In this case, nothing is stored in *@dest_x and *@dest_y. Otherwise %TRUE. |
| 11424 | */ |
| 11425 | translate_coordinates(dest_widget: Gtk.Widget, src_x: number, src_y: number): [boolean, number, number]; |
| 11426 | /** |
| 11427 | * Triggers a tooltip query on the display where the toplevel of `widget` |
| 11428 | * is located. See gtk_tooltip_trigger_tooltip_query() for more |
| 11429 | * information. |
| 11430 | */ |
| 11431 | trigger_tooltip_query(): void; |
| 11432 | /** |
| 11433 | * This function is only for use in widget implementations. Causes |
| 11434 | * a widget to be unmapped if it’s currently mapped. |
| 11435 | */ |
| 11436 | unmap(): void; |
| 11437 | /** |
| 11438 | * This function is only for use in widget implementations. |
| 11439 | * Should be called by implementations of the remove method |
| 11440 | * on #GtkContainer, to dissociate a child from the container. |
| 11441 | */ |
| 11442 | unparent(): void; |
| 11443 | /** |
| 11444 | * This function is only useful in widget implementations. |
| 11445 | * Causes a widget to be unrealized (frees all GDK resources |
| 11446 | * associated with the widget, such as `widget->`window). |
| 11447 | */ |
| 11448 | unrealize(): void; |
| 11449 | /** |
| 11450 | * Unregisters a #GdkWindow from the widget that was previously set up with |
| 11451 | * gtk_widget_register_window(). You need to call this when the window is |
| 11452 | * no longer used by the widget, such as when you destroy it. |
| 11453 | * @param window a #GdkWindow |
| 11454 | */ |
| 11455 | unregister_window(window: Gdk.Window): void; |
| 11456 | /** |
| 11457 | * This function is for use in widget implementations. Turns off flag |
| 11458 | * values for the current widget state (insensitive, prelighted, etc.). |
| 11459 | * See gtk_widget_set_state_flags(). |
| 11460 | * @param flags State flags to turn off |
| 11461 | */ |
| 11462 | unset_state_flags(flags: Gtk.StateFlags | null): void; |
| 11463 | vfunc_adjust_baseline_allocation(baseline: number): void; |
| 11464 | vfunc_adjust_baseline_request(minimum_baseline: number, natural_baseline: number): void; |
| 11465 | /** |
| 11466 | * Convert an initial size allocation assigned |
| 11467 | * by a #GtkContainer using gtk_widget_size_allocate(), into an actual |
| 11468 | * size allocation to be used by the widget. adjust_size_allocation |
| 11469 | * adjusts to a child widget’s actual allocation |
| 11470 | * from what a parent container computed for the |
| 11471 | * child. The adjusted allocation must be entirely within the original |
| 11472 | * allocation. In any custom implementation, chain up to the default |
| 11473 | * #GtkWidget implementation of this method, which applies the margin |
| 11474 | * and alignment properties of #GtkWidget. Chain up |
| 11475 | * before performing your own adjustments so your |
| 11476 | * own adjustments remove more allocation after the #GtkWidget base |
| 11477 | * class has already removed margin and alignment. The natural size |
| 11478 | * passed in should be adjusted in the same way as the allocated size, |
| 11479 | * which allows adjustments to perform alignments or other changes |
| 11480 | * based on natural size. |
| 11481 | * @param orientation |
| 11482 | * @param minimum_size |
| 11483 | * @param natural_size |
| 11484 | * @param allocated_pos |
| 11485 | * @param allocated_size |
| 11486 | */ |
| 11487 | vfunc_adjust_size_allocation( |
| 11488 | orientation: Gtk.Orientation, |
| 11489 | minimum_size: number, |
| 11490 | natural_size: number, |
| 11491 | allocated_pos: number, |
| 11492 | allocated_size: number, |
| 11493 | ): void; |
| 11494 | /** |
| 11495 | * Convert an initial size request from a widget's |
| 11496 | * #GtkSizeRequestMode virtual method implementations into a size request to |
| 11497 | * be used by parent containers in laying out the widget. |
| 11498 | * adjust_size_request adjusts from a child widget's |
| 11499 | * original request to what a parent container should |
| 11500 | * use for layout. The `for_size` argument will be -1 if the request should |
| 11501 | * not be for a particular size in the opposing orientation, i.e. if the |
| 11502 | * request is not height-for-width or width-for-height. If `for_size` is |
| 11503 | * greater than -1, it is the proposed allocation in the opposing |
| 11504 | * orientation that we need the request for. Implementations of |
| 11505 | * adjust_size_request should chain up to the default implementation, |
| 11506 | * which applies #GtkWidget’s margin properties and imposes any values |
| 11507 | * from gtk_widget_set_size_request(). Chaining up should be last, |
| 11508 | * after your subclass adjusts the request, so |
| 11509 | * #GtkWidget can apply constraints and add the margin properly. |
| 11510 | * @param orientation |
| 11511 | * @param minimum_size |
| 11512 | * @param natural_size |
| 11513 | */ |
| 11514 | vfunc_adjust_size_request(orientation: Gtk.Orientation, minimum_size: number, natural_size: number): void; |
| 11515 | /** |
| 11516 | * Signal will be emitted when a button |
| 11517 | * (typically from a mouse) is pressed. |
| 11518 | * @param event |
| 11519 | */ |
| 11520 | vfunc_button_press_event(event: Gdk.EventButton): boolean; |
| 11521 | /** |
| 11522 | * Signal will be emitted when a button |
| 11523 | * (typically from a mouse) is released. |
| 11524 | * @param event |
| 11525 | */ |
| 11526 | vfunc_button_release_event(event: Gdk.EventButton): boolean; |
| 11527 | /** |
| 11528 | * Determines whether an accelerator that activates the signal |
| 11529 | * identified by `signal_id` can currently be activated. |
| 11530 | * This is done by emitting the #GtkWidget::can-activate-accel |
| 11531 | * signal on `widget;` if the signal isn’t overridden by a |
| 11532 | * handler or in a derived widget, then the default check is |
| 11533 | * that the widget must be sensitive, and the widget and all |
| 11534 | * its ancestors mapped. |
| 11535 | * @param signal_id the ID of a signal installed on @widget |
| 11536 | */ |
| 11537 | vfunc_can_activate_accel(signal_id: number): boolean; |
| 11538 | /** |
| 11539 | * Emits a #GtkWidget::child-notify signal for the |
| 11540 | * [child property][child-properties] `child_property` |
| 11541 | * on `widget`. |
| 11542 | * |
| 11543 | * This is the analogue of g_object_notify() for child properties. |
| 11544 | * |
| 11545 | * Also see gtk_container_child_notify(). |
| 11546 | * @param child_property the name of a child property installed on the class of @widget’s parent |
| 11547 | */ |
| 11548 | vfunc_child_notify(child_property: GObject.ParamSpec): void; |
| 11549 | /** |
| 11550 | * Signal emitted when the composited status of |
| 11551 | * widgets screen changes. See gdk_screen_is_composited(). |
| 11552 | */ |
| 11553 | vfunc_composited_changed(): void; |
| 11554 | /** |
| 11555 | * Computes whether a container should give this |
| 11556 | * widget extra space when possible. |
| 11557 | * @param hexpand_p |
| 11558 | * @param vexpand_p |
| 11559 | */ |
| 11560 | vfunc_compute_expand(hexpand_p: boolean, vexpand_p: boolean): void; |
| 11561 | /** |
| 11562 | * Signal will be emitted when the size, position or |
| 11563 | * stacking of the widget’s window has changed. |
| 11564 | * @param event |
| 11565 | */ |
| 11566 | vfunc_configure_event(event: Gdk.EventConfigure): boolean; |
| 11567 | /** |
| 11568 | * Signal emitted when a redirected window belonging to |
| 11569 | * widget gets drawn into. |
| 11570 | * @param event |
| 11571 | */ |
| 11572 | vfunc_damage_event(event: Gdk.EventExpose): boolean; |
| 11573 | /** |
| 11574 | * Signal emitted if a user requests that a toplevel |
| 11575 | * window is closed. |
| 11576 | * @param event |
| 11577 | */ |
| 11578 | vfunc_delete_event(event: Gdk.EventAny): boolean; |
| 11579 | /** |
| 11580 | * Destroys a widget. |
| 11581 | * |
| 11582 | * When a widget is destroyed all references it holds on other objects |
| 11583 | * will be released: |
| 11584 | * |
| 11585 | * - if the widget is inside a container, it will be removed from its |
| 11586 | * parent |
| 11587 | * - if the widget is a container, all its children will be destroyed, |
| 11588 | * recursively |
| 11589 | * - if the widget is a top level, it will be removed from the list |
| 11590 | * of top level widgets that GTK+ maintains internally |
| 11591 | * |
| 11592 | * It's expected that all references held on the widget will also |
| 11593 | * be released; you should connect to the #GtkWidget::destroy signal |
| 11594 | * if you hold a reference to `widget` and you wish to remove it when |
| 11595 | * this function is called. It is not necessary to do so if you are |
| 11596 | * implementing a #GtkContainer, as you'll be able to use the |
| 11597 | * #GtkContainerClass.remove() virtual function for that. |
| 11598 | * |
| 11599 | * It's important to notice that gtk_widget_destroy() will only cause |
| 11600 | * the `widget` to be finalized if no additional references, acquired |
| 11601 | * using g_object_ref(), are held on it. In case additional references |
| 11602 | * are in place, the `widget` will be in an "inert" state after calling |
| 11603 | * this function; `widget` will still point to valid memory, allowing you |
| 11604 | * to release the references you hold, but you may not query the widget's |
| 11605 | * own state. |
| 11606 | * |
| 11607 | * You should typically call this function on top level widgets, and |
| 11608 | * rarely on child widgets. |
| 11609 | * |
| 11610 | * See also: gtk_container_remove() |
| 11611 | */ |
| 11612 | vfunc_destroy(): void; |
| 11613 | /** |
| 11614 | * Signal is emitted when a #GdkWindow is destroyed. |
| 11615 | * @param event |
| 11616 | */ |
| 11617 | vfunc_destroy_event(event: Gdk.EventAny): boolean; |
| 11618 | /** |
| 11619 | * Signal emitted when the text direction of a |
| 11620 | * widget changes. |
| 11621 | * @param previous_direction |
| 11622 | */ |
| 11623 | vfunc_direction_changed(previous_direction: Gtk.TextDirection): void; |
| 11624 | /** |
| 11625 | * Seldomly overidden. |
| 11626 | * @param n_pspecs |
| 11627 | * @param pspecs |
| 11628 | */ |
| 11629 | vfunc_dispatch_child_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void; |
| 11630 | /** |
| 11631 | * Signal emitted on the drag source when a drag is |
| 11632 | * started. |
| 11633 | * @param context |
| 11634 | */ |
| 11635 | vfunc_drag_begin(context: Gdk.DragContext): void; |
| 11636 | /** |
| 11637 | * Signal emitted on the drag source when a drag |
| 11638 | * with the action %GDK_ACTION_MOVE is successfully completed. |
| 11639 | * @param context |
| 11640 | */ |
| 11641 | vfunc_drag_data_delete(context: Gdk.DragContext): void; |
| 11642 | /** |
| 11643 | * Signal emitted on the drag source when the drop |
| 11644 | * site requests the data which is dragged. |
| 11645 | * @param context |
| 11646 | * @param selection_data |
| 11647 | * @param info |
| 11648 | * @param time_ |
| 11649 | */ |
| 11650 | vfunc_drag_data_get( |
| 11651 | context: Gdk.DragContext, |
| 11652 | selection_data: Gtk.SelectionData, |
| 11653 | info: number, |
| 11654 | time_: number, |
| 11655 | ): void; |
| 11656 | /** |
| 11657 | * Signal emitted on the drop site when the |
| 11658 | * dragged data has been received. |
| 11659 | * @param context |
| 11660 | * @param x |
| 11661 | * @param y |
| 11662 | * @param selection_data |
| 11663 | * @param info |
| 11664 | * @param time_ |
| 11665 | */ |
| 11666 | vfunc_drag_data_received( |
| 11667 | context: Gdk.DragContext, |
| 11668 | x: number, |
| 11669 | y: number, |
| 11670 | selection_data: Gtk.SelectionData, |
| 11671 | info: number, |
| 11672 | time_: number, |
| 11673 | ): void; |
| 11674 | /** |
| 11675 | * Signal emitted on the drop site when the user drops the |
| 11676 | * data onto the widget. |
| 11677 | * @param context |
| 11678 | * @param x |
| 11679 | * @param y |
| 11680 | * @param time_ |
| 11681 | */ |
| 11682 | vfunc_drag_drop(context: Gdk.DragContext, x: number, y: number, time_: number): boolean; |
| 11683 | /** |
| 11684 | * Signal emitted on the drag source when a drag is |
| 11685 | * finished. |
| 11686 | * @param context |
| 11687 | */ |
| 11688 | vfunc_drag_end(context: Gdk.DragContext): void; |
| 11689 | /** |
| 11690 | * Signal emitted on the drag source when a drag has |
| 11691 | * failed. |
| 11692 | * @param context |
| 11693 | * @param result |
| 11694 | */ |
| 11695 | vfunc_drag_failed(context: Gdk.DragContext, result: Gtk.DragResult): boolean; |
| 11696 | /** |
| 11697 | * Signal emitted on the drop site when the cursor leaves |
| 11698 | * the widget. |
| 11699 | * @param context |
| 11700 | * @param time_ |
| 11701 | */ |
| 11702 | vfunc_drag_leave(context: Gdk.DragContext, time_: number): void; |
| 11703 | /** |
| 11704 | * signal emitted on the drop site when the user moves |
| 11705 | * the cursor over the widget during a drag. |
| 11706 | * @param context |
| 11707 | * @param x |
| 11708 | * @param y |
| 11709 | * @param time_ |
| 11710 | */ |
| 11711 | vfunc_drag_motion(context: Gdk.DragContext, x: number, y: number, time_: number): boolean; |
| 11712 | /** |
| 11713 | * Signal emitted when a widget is supposed to render itself. |
| 11714 | * @param cr |
| 11715 | */ |
| 11716 | vfunc_draw(cr: cairo.Context): boolean; |
| 11717 | /** |
| 11718 | * Signal event will be emitted when the pointer |
| 11719 | * enters the widget’s window. |
| 11720 | * @param event |
| 11721 | */ |
| 11722 | vfunc_enter_notify_event(event: Gdk.EventCrossing): boolean; |
| 11723 | /** |
| 11724 | * Rarely-used function. This function is used to emit |
| 11725 | * the event signals on a widget (those signals should never |
| 11726 | * be emitted without using this function to do so). |
| 11727 | * If you want to synthesize an event though, don’t use this function; |
| 11728 | * instead, use gtk_main_do_event() so the event will behave as if |
| 11729 | * it were in the event queue. Don’t synthesize expose events; instead, |
| 11730 | * use gdk_window_invalidate_rect() to invalidate a region of the |
| 11731 | * window. |
| 11732 | * @param event a #GdkEvent |
| 11733 | */ |
| 11734 | vfunc_event(event: Gdk.Event): boolean; |
| 11735 | vfunc_focus(direction: Gtk.DirectionType): boolean; |
| 11736 | /** |
| 11737 | * Signal emitted when the keyboard focus enters the |
| 11738 | * widget’s window. |
| 11739 | * @param event |
| 11740 | */ |
| 11741 | vfunc_focus_in_event(event: Gdk.EventFocus): boolean; |
| 11742 | /** |
| 11743 | * Signal emitted when the keyboard focus leaves the |
| 11744 | * widget’s window. |
| 11745 | * @param event |
| 11746 | */ |
| 11747 | vfunc_focus_out_event(event: Gdk.EventFocus): boolean; |
| 11748 | /** |
| 11749 | * Returns the accessible object that describes the widget to an |
| 11750 | * assistive technology. |
| 11751 | * |
| 11752 | * If accessibility support is not available, this #AtkObject |
| 11753 | * instance may be a no-op. Likewise, if no class-specific #AtkObject |
| 11754 | * implementation is available for the widget instance in question, |
| 11755 | * it will inherit an #AtkObject implementation from the first ancestor |
| 11756 | * class for which such an implementation is defined. |
| 11757 | * |
| 11758 | * The documentation of the |
| 11759 | * [ATK](http://developer.gnome.org/atk/stable/) |
| 11760 | * library contains more information about accessible objects and their uses. |
| 11761 | */ |
| 11762 | vfunc_get_accessible(): Atk.Object; |
| 11763 | /** |
| 11764 | * Retrieves a widget’s initial minimum and natural height. |
| 11765 | * |
| 11766 | * This call is specific to width-for-height requests. |
| 11767 | * |
| 11768 | * The returned request will be modified by the |
| 11769 | * GtkWidgetClass::adjust_size_request virtual method and by any |
| 11770 | * #GtkSizeGroups that have been applied. That is, the returned request |
| 11771 | * is the one that should be used for layout, not necessarily the one |
| 11772 | * returned by the widget itself. |
| 11773 | */ |
| 11774 | vfunc_get_preferred_height(): [number, number]; |
| 11775 | /** |
| 11776 | * Retrieves a widget’s minimum and natural height and the corresponding baselines if it would be given |
| 11777 | * the specified `width,` or the default height if `width` is -1. The baselines may be -1 which means |
| 11778 | * that no baseline is requested for this widget. |
| 11779 | * |
| 11780 | * The returned request will be modified by the |
| 11781 | * GtkWidgetClass::adjust_size_request and GtkWidgetClass::adjust_baseline_request virtual methods |
| 11782 | * and by any #GtkSizeGroups that have been applied. That is, the returned request |
| 11783 | * is the one that should be used for layout, not necessarily the one |
| 11784 | * returned by the widget itself. |
| 11785 | * @param width the width which is available for allocation, or -1 if none |
| 11786 | */ |
| 11787 | vfunc_get_preferred_height_and_baseline_for_width(width: number): [number, number, number, number]; |
| 11788 | /** |
| 11789 | * Retrieves a widget’s minimum and natural height if it would be given |
| 11790 | * the specified `width`. |
| 11791 | * |
| 11792 | * The returned request will be modified by the |
| 11793 | * GtkWidgetClass::adjust_size_request virtual method and by any |
| 11794 | * #GtkSizeGroups that have been applied. That is, the returned request |
| 11795 | * is the one that should be used for layout, not necessarily the one |
| 11796 | * returned by the widget itself. |
| 11797 | * @param width the width which is available for allocation |
| 11798 | */ |
| 11799 | vfunc_get_preferred_height_for_width(width: number): [number, number]; |
| 11800 | /** |
| 11801 | * Retrieves a widget’s initial minimum and natural width. |
| 11802 | * |
| 11803 | * This call is specific to height-for-width requests. |
| 11804 | * |
| 11805 | * The returned request will be modified by the |
| 11806 | * GtkWidgetClass::adjust_size_request virtual method and by any |
| 11807 | * #GtkSizeGroups that have been applied. That is, the returned request |
| 11808 | * is the one that should be used for layout, not necessarily the one |
| 11809 | * returned by the widget itself. |
| 11810 | */ |
| 11811 | vfunc_get_preferred_width(): [number, number]; |
| 11812 | /** |
| 11813 | * Retrieves a widget’s minimum and natural width if it would be given |
| 11814 | * the specified `height`. |
| 11815 | * |
| 11816 | * The returned request will be modified by the |
| 11817 | * GtkWidgetClass::adjust_size_request virtual method and by any |
| 11818 | * #GtkSizeGroups that have been applied. That is, the returned request |
| 11819 | * is the one that should be used for layout, not necessarily the one |
| 11820 | * returned by the widget itself. |
| 11821 | * @param height the height which is available for allocation |
| 11822 | */ |
| 11823 | vfunc_get_preferred_width_for_height(height: number): [number, number]; |
| 11824 | /** |
| 11825 | * Gets whether the widget prefers a height-for-width layout |
| 11826 | * or a width-for-height layout. |
| 11827 | * |
| 11828 | * #GtkBin widgets generally propagate the preference of |
| 11829 | * their child, container widgets need to request something either in |
| 11830 | * context of their children or in context of their allocation |
| 11831 | * capabilities. |
| 11832 | */ |
| 11833 | vfunc_get_request_mode(): Gtk.SizeRequestMode; |
| 11834 | /** |
| 11835 | * Signal emitted when a pointer or keyboard grab |
| 11836 | * on a window belonging to widget gets broken. |
| 11837 | * @param event |
| 11838 | */ |
| 11839 | vfunc_grab_broken_event(event: Gdk.EventGrabBroken): boolean; |
| 11840 | /** |
| 11841 | * Causes `widget` to have the keyboard focus for the #GtkWindow it's |
| 11842 | * inside. `widget` must be a focusable widget, such as a #GtkEntry; |
| 11843 | * something like #GtkFrame won’t work. |
| 11844 | * |
| 11845 | * More precisely, it must have the %GTK_CAN_FOCUS flag set. Use |
| 11846 | * gtk_widget_set_can_focus() to modify that flag. |
| 11847 | * |
| 11848 | * The widget also needs to be realized and mapped. This is indicated by the |
| 11849 | * related signals. Grabbing the focus immediately after creating the widget |
| 11850 | * will likely fail and cause critical warnings. |
| 11851 | */ |
| 11852 | vfunc_grab_focus(): void; |
| 11853 | /** |
| 11854 | * Signal emitted when a widget becomes shadowed by a |
| 11855 | * GTK+ grab (not a pointer or keyboard grab) on another widget, or |
| 11856 | * when it becomes unshadowed due to a grab being removed. |
| 11857 | * @param was_grabbed |
| 11858 | */ |
| 11859 | vfunc_grab_notify(was_grabbed: boolean): void; |
| 11860 | /** |
| 11861 | * Reverses the effects of gtk_widget_show(), causing the widget to be |
| 11862 | * hidden (invisible to the user). |
| 11863 | */ |
| 11864 | vfunc_hide(): void; |
| 11865 | /** |
| 11866 | * Signal emitted when the anchored state of a |
| 11867 | * widget changes. |
| 11868 | * @param previous_toplevel |
| 11869 | */ |
| 11870 | vfunc_hierarchy_changed(previous_toplevel: Gtk.Widget): void; |
| 11871 | /** |
| 11872 | * Signal emitted when a key is pressed. |
| 11873 | * @param event |
| 11874 | */ |
| 11875 | vfunc_key_press_event(event: Gdk.EventKey): boolean; |
| 11876 | /** |
| 11877 | * Signal is emitted when a key is released. |
| 11878 | * @param event |
| 11879 | */ |
| 11880 | vfunc_key_release_event(event: Gdk.EventKey): boolean; |
| 11881 | /** |
| 11882 | * This function should be called whenever keyboard navigation within |
| 11883 | * a single widget hits a boundary. The function emits the |
| 11884 | * #GtkWidget::keynav-failed signal on the widget and its return |
| 11885 | * value should be interpreted in a way similar to the return value of |
| 11886 | * gtk_widget_child_focus(): |
| 11887 | * |
| 11888 | * When %TRUE is returned, stay in the widget, the failed keyboard |
| 11889 | * navigation is OK and/or there is nowhere we can/should move the |
| 11890 | * focus to. |
| 11891 | * |
| 11892 | * When %FALSE is returned, the caller should continue with keyboard |
| 11893 | * navigation outside the widget, e.g. by calling |
| 11894 | * gtk_widget_child_focus() on the widget’s toplevel. |
| 11895 | * |
| 11896 | * The default ::keynav-failed handler returns %FALSE for |
| 11897 | * %GTK_DIR_TAB_FORWARD and %GTK_DIR_TAB_BACKWARD. For the other |
| 11898 | * values of #GtkDirectionType it returns %TRUE. |
| 11899 | * |
| 11900 | * Whenever the default handler returns %TRUE, it also calls |
| 11901 | * gtk_widget_error_bell() to notify the user of the failed keyboard |
| 11902 | * navigation. |
| 11903 | * |
| 11904 | * A use case for providing an own implementation of ::keynav-failed |
| 11905 | * (either by connecting to it or by overriding it) would be a row of |
| 11906 | * #GtkEntry widgets where the user should be able to navigate the |
| 11907 | * entire row with the cursor keys, as e.g. known from user interfaces |
| 11908 | * that require entering license keys. |
| 11909 | * @param direction direction of focus movement |
| 11910 | */ |
| 11911 | vfunc_keynav_failed(direction: Gtk.DirectionType): boolean; |
| 11912 | /** |
| 11913 | * Will be emitted when the pointer leaves the |
| 11914 | * widget’s window. |
| 11915 | * @param event |
| 11916 | */ |
| 11917 | vfunc_leave_notify_event(event: Gdk.EventCrossing): boolean; |
| 11918 | /** |
| 11919 | * This function is only for use in widget implementations. Causes |
| 11920 | * a widget to be mapped if it isn’t already. |
| 11921 | */ |
| 11922 | vfunc_map(): void; |
| 11923 | /** |
| 11924 | * Signal emitted when the widget’s window is mapped. |
| 11925 | * @param event |
| 11926 | */ |
| 11927 | vfunc_map_event(event: Gdk.EventAny): boolean; |
| 11928 | /** |
| 11929 | * Emits the #GtkWidget::mnemonic-activate signal. |
| 11930 | * @param group_cycling %TRUE if there are other widgets with the same mnemonic |
| 11931 | */ |
| 11932 | vfunc_mnemonic_activate(group_cycling: boolean): boolean; |
| 11933 | /** |
| 11934 | * Signal emitted when the pointer moves over |
| 11935 | * the widget’s #GdkWindow. |
| 11936 | * @param event |
| 11937 | */ |
| 11938 | vfunc_motion_notify_event(event: Gdk.EventMotion): boolean; |
| 11939 | /** |
| 11940 | * Signal emitted when a change of focus is requested |
| 11941 | * @param direction |
| 11942 | */ |
| 11943 | vfunc_move_focus(direction: Gtk.DirectionType): void; |
| 11944 | /** |
| 11945 | * Signal emitted when a new parent has been set on a |
| 11946 | * widget. |
| 11947 | * @param previous_parent |
| 11948 | */ |
| 11949 | vfunc_parent_set(previous_parent: Gtk.Widget): void; |
| 11950 | /** |
| 11951 | * Signal emitted whenever a widget should pop up a |
| 11952 | * context menu. |
| 11953 | */ |
| 11954 | vfunc_popup_menu(): boolean; |
| 11955 | /** |
| 11956 | * Signal will be emitted when a property on |
| 11957 | * the widget’s window has been changed or deleted. |
| 11958 | * @param event |
| 11959 | */ |
| 11960 | vfunc_property_notify_event(event: Gdk.EventProperty): boolean; |
| 11961 | vfunc_proximity_in_event(event: Gdk.EventProximity): boolean; |
| 11962 | vfunc_proximity_out_event(event: Gdk.EventProximity): boolean; |
| 11963 | /** |
| 11964 | * Signal emitted when “has-tooltip” is %TRUE and the |
| 11965 | * hover timeout has expired with the cursor hovering “above” |
| 11966 | * widget; or emitted when widget got focus in keyboard mode. |
| 11967 | * @param x |
| 11968 | * @param y |
| 11969 | * @param keyboard_tooltip |
| 11970 | * @param tooltip |
| 11971 | */ |
| 11972 | vfunc_query_tooltip(x: number, y: number, keyboard_tooltip: boolean, tooltip: Gtk.Tooltip): boolean; |
| 11973 | /** |
| 11974 | * Invalidates the area of `widget` defined by `region` by calling |
| 11975 | * gdk_window_invalidate_region() on the widget’s window and all its |
| 11976 | * child windows. Once the main loop becomes idle (after the current |
| 11977 | * batch of events has been processed, roughly), the window will |
| 11978 | * receive expose events for the union of all regions that have been |
| 11979 | * invalidated. |
| 11980 | * |
| 11981 | * Normally you would only use this function in widget |
| 11982 | * implementations. You might also use it to schedule a redraw of a |
| 11983 | * #GtkDrawingArea or some portion thereof. |
| 11984 | * @param region region to draw |
| 11985 | */ |
| 11986 | vfunc_queue_draw_region(region: cairo.Region): void; |
| 11987 | /** |
| 11988 | * Creates the GDK (windowing system) resources associated with a |
| 11989 | * widget. For example, `widget->`window will be created when a widget |
| 11990 | * is realized. Normally realization happens implicitly; if you show |
| 11991 | * a widget and all its parent containers, then the widget will be |
| 11992 | * realized and mapped automatically. |
| 11993 | * |
| 11994 | * Realizing a widget requires all |
| 11995 | * the widget’s parent widgets to be realized; calling |
| 11996 | * gtk_widget_realize() realizes the widget’s parents in addition to |
| 11997 | * `widget` itself. If a widget is not yet inside a toplevel window |
| 11998 | * when you realize it, bad things will happen. |
| 11999 | * |
| 12000 | * This function is primarily used in widget implementations, and |
| 12001 | * isn’t very useful otherwise. Many times when you think you might |
| 12002 | * need it, a better approach is to connect to a signal that will be |
| 12003 | * called after the widget is realized automatically, such as |
| 12004 | * #GtkWidget::draw. Or simply g_signal_connect () to the |
| 12005 | * #GtkWidget::realize signal. |
| 12006 | */ |
| 12007 | vfunc_realize(): void; |
| 12008 | /** |
| 12009 | * Signal emitted when the screen of a widget has |
| 12010 | * changed. |
| 12011 | * @param previous_screen |
| 12012 | */ |
| 12013 | vfunc_screen_changed(previous_screen: Gdk.Screen): void; |
| 12014 | /** |
| 12015 | * Signal emitted when a button in the 4 to 7 range is |
| 12016 | * pressed. |
| 12017 | * @param event |
| 12018 | */ |
| 12019 | vfunc_scroll_event(event: Gdk.EventScroll): boolean; |
| 12020 | /** |
| 12021 | * Signal will be emitted when the the |
| 12022 | * widget’s window has lost ownership of a selection. |
| 12023 | * @param event |
| 12024 | */ |
| 12025 | vfunc_selection_clear_event(event: Gdk.EventSelection): boolean; |
| 12026 | vfunc_selection_get(selection_data: Gtk.SelectionData, info: number, time_: number): void; |
| 12027 | vfunc_selection_notify_event(event: Gdk.EventSelection): boolean; |
| 12028 | vfunc_selection_received(selection_data: Gtk.SelectionData, time_: number): void; |
| 12029 | /** |
| 12030 | * Signal will be emitted when another |
| 12031 | * client requests ownership of the selection owned by the widget's |
| 12032 | * window. |
| 12033 | * @param event |
| 12034 | */ |
| 12035 | vfunc_selection_request_event(event: Gdk.EventSelection): boolean; |
| 12036 | /** |
| 12037 | * Flags a widget to be displayed. Any widget that isn’t shown will |
| 12038 | * not appear on the screen. If you want to show all the widgets in a |
| 12039 | * container, it’s easier to call gtk_widget_show_all() on the |
| 12040 | * container, instead of individually showing the widgets. |
| 12041 | * |
| 12042 | * Remember that you have to show the containers containing a widget, |
| 12043 | * in addition to the widget itself, before it will appear onscreen. |
| 12044 | * |
| 12045 | * When a toplevel container is shown, it is immediately realized and |
| 12046 | * mapped; other shown widgets are realized and mapped when their |
| 12047 | * toplevel container is realized and mapped. |
| 12048 | */ |
| 12049 | vfunc_show(): void; |
| 12050 | /** |
| 12051 | * Recursively shows a widget, and any child widgets (if the widget is |
| 12052 | * a container). |
| 12053 | */ |
| 12054 | vfunc_show_all(): void; |
| 12055 | vfunc_show_help(help_type: Gtk.WidgetHelpType): boolean; |
| 12056 | /** |
| 12057 | * This function is only used by #GtkContainer subclasses, to assign a size |
| 12058 | * and position to their child widgets. |
| 12059 | * |
| 12060 | * In this function, the allocation may be adjusted. It will be forced |
| 12061 | * to a 1x1 minimum size, and the adjust_size_allocation virtual |
| 12062 | * method on the child will be used to adjust the allocation. Standard |
| 12063 | * adjustments include removing the widget’s margins, and applying the |
| 12064 | * widget’s #GtkWidget:halign and #GtkWidget:valign properties. |
| 12065 | * |
| 12066 | * For baseline support in containers you need to use gtk_widget_size_allocate_with_baseline() |
| 12067 | * instead. |
| 12068 | * @param allocation position and size to be allocated to @widget |
| 12069 | */ |
| 12070 | vfunc_size_allocate(allocation: Gtk.Allocation): void; |
| 12071 | /** |
| 12072 | * Signal emitted when the widget state |
| 12073 | * changes. Deprecated: 3.0 |
| 12074 | * @param previous_state |
| 12075 | */ |
| 12076 | vfunc_state_changed(previous_state: Gtk.StateType): void; |
| 12077 | /** |
| 12078 | * Signal emitted when the widget state changes, |
| 12079 | * see gtk_widget_get_state_flags(). |
| 12080 | * @param previous_state_flags |
| 12081 | */ |
| 12082 | vfunc_state_flags_changed(previous_state_flags: Gtk.StateFlags): void; |
| 12083 | /** |
| 12084 | * Signal emitted when a new style has been set on a |
| 12085 | * widget. Deprecated: 3.0 |
| 12086 | * @param previous_style |
| 12087 | */ |
| 12088 | vfunc_style_set(previous_style: Gtk.Style): void; |
| 12089 | /** |
| 12090 | * Signal emitted when the GtkStyleContext of a widget |
| 12091 | * is changed. |
| 12092 | */ |
| 12093 | vfunc_style_updated(): void; |
| 12094 | /** |
| 12095 | * Signal emitted when a touch event happens |
| 12096 | * @param event |
| 12097 | */ |
| 12098 | vfunc_touch_event(event: Gdk.EventTouch): boolean; |
| 12099 | /** |
| 12100 | * This function is only for use in widget implementations. Causes |
| 12101 | * a widget to be unmapped if it’s currently mapped. |
| 12102 | */ |
| 12103 | vfunc_unmap(): void; |
| 12104 | /** |
| 12105 | * Signal will be emitted when the widget’s window is |
| 12106 | * unmapped. |
| 12107 | * @param event |
| 12108 | */ |
| 12109 | vfunc_unmap_event(event: Gdk.EventAny): boolean; |
| 12110 | /** |
| 12111 | * This function is only useful in widget implementations. |
| 12112 | * Causes a widget to be unrealized (frees all GDK resources |
| 12113 | * associated with the widget, such as `widget->`window). |
| 12114 | */ |
| 12115 | vfunc_unrealize(): void; |
| 12116 | /** |
| 12117 | * Signal emitted when the widget’s window is |
| 12118 | * obscured or unobscured. |
| 12119 | * @param event |
| 12120 | */ |
| 12121 | vfunc_visibility_notify_event(event: Gdk.EventVisibility): boolean; |
| 12122 | /** |
| 12123 | * Signal emitted when the state of the toplevel |
| 12124 | * window associated to the widget changes. |
| 12125 | * @param event |
| 12126 | */ |
| 12127 | vfunc_window_state_event(event: Gdk.EventWindowState): boolean; |
| 12128 | } |
| 12129 | |
| 12130 | namespace KeyRenderer { |
| 12131 | // Constructor properties interface |
| 12132 | |
| 12133 | interface ConstructorProps extends GObject.Object.ConstructorProps, Renderer.ConstructorProps { |
| 12134 | object: Gck.Object; |
| 12135 | } |
| 12136 | } |
| 12137 | |
| 12138 | /** |
| 12139 | * An implementation of #GcrRenderer which renders keys. |
| 12140 | */ |
| 12141 | class KeyRenderer extends GObject.Object implements Renderer { |
| 12142 | static $gtype: GObject.GType<KeyRenderer>; |
| 12143 | |
| 12144 | // Properties |
| 12145 | |
| 12146 | get object(): Gck.Object; |
| 12147 | set object(val: Gck.Object); |
| 12148 | |
| 12149 | // Constructors |
| 12150 | |
| 12151 | constructor(properties?: Partial<KeyRenderer.ConstructorProps>, ...args: any[]); |
| 12152 | |
| 12153 | _init(...args: any[]): void; |
| 12154 | |
| 12155 | static ['new'](label?: string | null, attrs?: Gck.Attributes | null): KeyRenderer; |
| 12156 | |
| 12157 | // Methods |
| 12158 | |
| 12159 | /** |
| 12160 | * Get the attributes displayed in the renderer. |
| 12161 | * @returns the attributes, owned by the renderer |
| 12162 | */ |
| 12163 | get_attributes(): Gck.Attributes | null; |
| 12164 | /** |
| 12165 | * Get the attributes displayed in the renderer. The attributes should represent |
| 12166 | * either an RSA, DSA, or EC key in PKCS#11 style. |
| 12167 | * @param attrs the attributes to display |
| 12168 | */ |
| 12169 | set_attributes(attrs?: Gck.Attributes | null): void; |
| 12170 | |
| 12171 | // Inherited properties |
| 12172 | /** |
| 12173 | * The attributes to display. |
| 12174 | */ |
| 12175 | get attributes(): Gck.Attributes; |
| 12176 | set attributes(val: Gck.Attributes); |
| 12177 | /** |
| 12178 | * The label to display. |
| 12179 | */ |
| 12180 | get label(): string; |
| 12181 | set label(val: string); |
| 12182 | |
| 12183 | // Inherited methods |
| 12184 | /** |
| 12185 | * Emit the #GcrRenderer::data-changed signal on the renderer. This is used by |
| 12186 | * renderer implementations. |
| 12187 | */ |
| 12188 | emit_data_changed(): void; |
| 12189 | /** |
| 12190 | * Called by #GcrViewer when about to display a popup menu for the content |
| 12191 | * displayed by the renderer. The renderer can add a menu item if desired. |
| 12192 | * @param viewer The viewer that is displaying a popup |
| 12193 | * @param menu The popup menu being displayed |
| 12194 | */ |
| 12195 | popuplate_popup(viewer: Viewer, menu: Gtk.Menu): void; |
| 12196 | /** |
| 12197 | * Render the contents of the renderer to the given viewer. |
| 12198 | * @param viewer The viewer to render to. |
| 12199 | */ |
| 12200 | render_view(viewer: Viewer): void; |
| 12201 | /** |
| 12202 | * signal emitted when data being rendered changes |
| 12203 | */ |
| 12204 | vfunc_data_changed(): void; |
| 12205 | /** |
| 12206 | * method invoked to populate a popup menu with additional |
| 12207 | * renderer options |
| 12208 | * @param viewer |
| 12209 | * @param menu |
| 12210 | */ |
| 12211 | vfunc_populate_popup(viewer: Viewer, menu: Gtk.Menu): void; |
| 12212 | /** |
| 12213 | * Render the contents of the renderer to the given viewer. |
| 12214 | * @param viewer The viewer to render to. |
| 12215 | */ |
| 12216 | vfunc_render_view(viewer: Viewer): void; |
| 12217 | /** |
| 12218 | * Creates a binding between `source_property` on `source` and `target_property` |
| 12219 | * on `target`. |
| 12220 | * |
| 12221 | * Whenever the `source_property` is changed the `target_property` is |
| 12222 | * updated using the same value. For instance: |
| 12223 | * |
| 12224 | * |
| 12225 | * ```c |
| 12226 | * g_object_bind_property (action, "active", widget, "sensitive", 0); |
| 12227 | * ``` |
| 12228 | * |
| 12229 | * |
| 12230 | * Will result in the "sensitive" property of the widget #GObject instance to be |
| 12231 | * updated with the same value of the "active" property of the action #GObject |
| 12232 | * instance. |
| 12233 | * |
| 12234 | * If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual: |
| 12235 | * if `target_property` on `target` changes then the `source_property` on `source` |
| 12236 | * will be updated as well. |
| 12237 | * |
| 12238 | * The binding will automatically be removed when either the `source` or the |
| 12239 | * `target` instances are finalized. To remove the binding without affecting the |
| 12240 | * `source` and the `target` you can just call g_object_unref() on the returned |
| 12241 | * #GBinding instance. |
| 12242 | * |
| 12243 | * Removing the binding by calling g_object_unref() on it must only be done if |
| 12244 | * the binding, `source` and `target` are only used from a single thread and it |
| 12245 | * is clear that both `source` and `target` outlive the binding. Especially it |
| 12246 | * is not safe to rely on this if the binding, `source` or `target` can be |
| 12247 | * finalized from different threads. Keep another reference to the binding and |
| 12248 | * use g_binding_unbind() instead to be on the safe side. |
| 12249 | * |
| 12250 | * A #GObject can have multiple bindings. |
| 12251 | * @param source_property the property on @source to bind |
| 12252 | * @param target the target #GObject |
| 12253 | * @param target_property the property on @target to bind |
| 12254 | * @param flags flags to pass to #GBinding |
| 12255 | * @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero. |
| 12256 | */ |
| 12257 | bind_property( |
| 12258 | source_property: string, |
| 12259 | target: GObject.Object, |
| 12260 | target_property: string, |
| 12261 | flags: GObject.BindingFlags | null, |
| 12262 | ): GObject.Binding; |
| 12263 | /** |
| 12264 | * Complete version of g_object_bind_property(). |
| 12265 | * |
| 12266 | * Creates a binding between `source_property` on `source` and `target_property` |
| 12267 | * on `target,` allowing you to set the transformation functions to be used by |
| 12268 | * the binding. |
| 12269 | * |
| 12270 | * If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual: |
| 12271 | * if `target_property` on `target` changes then the `source_property` on `source` |
| 12272 | * will be updated as well. The `transform_from` function is only used in case |
| 12273 | * of bidirectional bindings, otherwise it will be ignored |
| 12274 | * |
| 12275 | * The binding will automatically be removed when either the `source` or the |
| 12276 | * `target` instances are finalized. This will release the reference that is |
| 12277 | * being held on the #GBinding instance; if you want to hold on to the |
| 12278 | * #GBinding instance, you will need to hold a reference to it. |
| 12279 | * |
| 12280 | * To remove the binding, call g_binding_unbind(). |
| 12281 | * |
| 12282 | * A #GObject can have multiple bindings. |
| 12283 | * |
| 12284 | * The same `user_data` parameter will be used for both `transform_to` |
| 12285 | * and `transform_from` transformation functions; the `notify` function will |
| 12286 | * be called once, when the binding is removed. If you need different data |
| 12287 | * for each transformation function, please use |
| 12288 | * g_object_bind_property_with_closures() instead. |
| 12289 | * @param source_property the property on @source to bind |
| 12290 | * @param target the target #GObject |
| 12291 | * @param target_property the property on @target to bind |
| 12292 | * @param flags flags to pass to #GBinding |
| 12293 | * @param transform_to the transformation function from the @source to the @target, or %NULL to use the default |
| 12294 | * @param transform_from the transformation function from the @target to the @source, or %NULL to use the default |
| 12295 | * @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required |
| 12296 | * @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero. |
| 12297 | */ |
| 12298 | bind_property_full( |
| 12299 | source_property: string, |
| 12300 | target: GObject.Object, |
| 12301 | target_property: string, |
| 12302 | flags: GObject.BindingFlags | null, |
| 12303 | transform_to?: GObject.BindingTransformFunc | null, |
| 12304 | transform_from?: GObject.BindingTransformFunc | null, |
| 12305 | notify?: GLib.DestroyNotify | null, |
| 12306 | ): GObject.Binding; |
| 12307 | // Conflicted with GObject.Object.bind_property_full |
| 12308 | bind_property_full(...args: never[]): any; |
| 12309 | /** |
| 12310 | * This function is intended for #GObject implementations to re-enforce |
| 12311 | * a [floating][floating-ref] object reference. Doing this is seldom |
| 12312 | * required: all #GInitiallyUnowneds are created with a floating reference |
| 12313 | * which usually just needs to be sunken by calling g_object_ref_sink(). |
| 12314 | */ |
| 12315 | force_floating(): void; |
| 12316 | /** |
| 12317 | * Increases the freeze count on `object`. If the freeze count is |
| 12318 | * non-zero, the emission of "notify" signals on `object` is |
| 12319 | * stopped. The signals are queued until the freeze count is decreased |
| 12320 | * to zero. Duplicate notifications are squashed so that at most one |
| 12321 | * #GObject::notify signal is emitted for each property modified while the |
| 12322 | * object is frozen. |
| 12323 | * |
| 12324 | * This is necessary for accessors that modify multiple properties to prevent |
| 12325 | * premature notification while the object is still being modified. |
| 12326 | */ |
| 12327 | freeze_notify(): void; |
| 12328 | /** |
| 12329 | * Gets a named field from the objects table of associations (see g_object_set_data()). |
| 12330 | * @param key name of the key for that association |
| 12331 | * @returns the data if found, or %NULL if no such data exists. |
| 12332 | */ |
| 12333 | get_data(key: string): any | null; |
| 12334 | /** |
| 12335 | * Gets a property of an object. |
| 12336 | * |
| 12337 | * The value can be: |
| 12338 | * - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60) |
| 12339 | * - a GObject.Value initialized with the expected type of the property |
| 12340 | * - a GObject.Value initialized with a type to which the expected type of the property can be transformed |
| 12341 | * |
| 12342 | * In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset. |
| 12343 | * |
| 12344 | * Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming. |
| 12345 | * @param property_name The name of the property to get |
| 12346 | * @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type |
| 12347 | */ |
| 12348 | get_property(property_name: string, value: GObject.Value | any): any; |
| 12349 | /** |
| 12350 | * This function gets back user data pointers stored via |
| 12351 | * g_object_set_qdata(). |
| 12352 | * @param quark A #GQuark, naming the user data pointer |
| 12353 | * @returns The user data pointer set, or %NULL |
| 12354 | */ |
| 12355 | get_qdata(quark: GLib.Quark): any | null; |
| 12356 | /** |
| 12357 | * Gets `n_properties` properties for an `object`. |
| 12358 | * Obtained properties will be set to `values`. All properties must be valid. |
| 12359 | * Warnings will be emitted and undefined behaviour may result if invalid |
| 12360 | * properties are passed in. |
| 12361 | * @param names the names of each property to get |
| 12362 | * @param values the values of each property to get |
| 12363 | */ |
| 12364 | getv(names: string[], values: (GObject.Value | any)[]): void; |
| 12365 | /** |
| 12366 | * Checks whether `object` has a [floating][floating-ref] reference. |
| 12367 | * @returns %TRUE if @object has a floating reference |
| 12368 | */ |
| 12369 | is_floating(): boolean; |
| 12370 | /** |
| 12371 | * Emits a "notify" signal for the property `property_name` on `object`. |
| 12372 | * |
| 12373 | * When possible, eg. when signaling a property change from within the class |
| 12374 | * that registered the property, you should use g_object_notify_by_pspec() |
| 12375 | * instead. |
| 12376 | * |
| 12377 | * Note that emission of the notify signal may be blocked with |
| 12378 | * g_object_freeze_notify(). In this case, the signal emissions are queued |
| 12379 | * and will be emitted (in reverse order) when g_object_thaw_notify() is |
| 12380 | * called. |
| 12381 | * @param property_name the name of a property installed on the class of @object. |
| 12382 | */ |
| 12383 | notify(property_name: string): void; |
| 12384 | /** |
| 12385 | * Emits a "notify" signal for the property specified by `pspec` on `object`. |
| 12386 | * |
| 12387 | * This function omits the property name lookup, hence it is faster than |
| 12388 | * g_object_notify(). |
| 12389 | * |
| 12390 | * One way to avoid using g_object_notify() from within the |
| 12391 | * class that registered the properties, and using g_object_notify_by_pspec() |
| 12392 | * instead, is to store the GParamSpec used with |
| 12393 | * g_object_class_install_property() inside a static array, e.g.: |
| 12394 | * |
| 12395 | * |
| 12396 | * ```c |
| 12397 | * typedef enum |
| 12398 | * { |
| 12399 | * PROP_FOO = 1, |
| 12400 | * PROP_LAST |
| 12401 | * } MyObjectProperty; |
| 12402 | * |
| 12403 | * static GParamSpec *properties[PROP_LAST]; |
| 12404 | * |
| 12405 | * static void |
| 12406 | * my_object_class_init (MyObjectClass *klass) |
| 12407 | * { |
| 12408 | * properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL, |
| 12409 | * 0, 100, |
| 12410 | * 50, |
| 12411 | * G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); |
| 12412 | * g_object_class_install_property (gobject_class, |
| 12413 | * PROP_FOO, |
| 12414 | * properties[PROP_FOO]); |
| 12415 | * } |
| 12416 | * ``` |
| 12417 | * |
| 12418 | * |
| 12419 | * and then notify a change on the "foo" property with: |
| 12420 | * |
| 12421 | * |
| 12422 | * ```c |
| 12423 | * g_object_notify_by_pspec (self, properties[PROP_FOO]); |
| 12424 | * ``` |
| 12425 | * |
| 12426 | * @param pspec the #GParamSpec of a property installed on the class of @object. |
| 12427 | */ |
| 12428 | notify_by_pspec(pspec: GObject.ParamSpec): void; |
| 12429 | /** |
| 12430 | * Increases the reference count of `object`. |
| 12431 | * |
| 12432 | * Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type |
| 12433 | * of `object` will be propagated to the return type (using the GCC typeof() |
| 12434 | * extension), so any casting the caller needs to do on the return type must be |
| 12435 | * explicit. |
| 12436 | * @returns the same @object |
| 12437 | */ |
| 12438 | ref(): GObject.Object; |
| 12439 | /** |
| 12440 | * Increase the reference count of `object,` and possibly remove the |
| 12441 | * [floating][floating-ref] reference, if `object` has a floating reference. |
| 12442 | * |
| 12443 | * In other words, if the object is floating, then this call "assumes |
| 12444 | * ownership" of the floating reference, converting it to a normal |
| 12445 | * reference by clearing the floating flag while leaving the reference |
| 12446 | * count unchanged. If the object is not floating, then this call |
| 12447 | * adds a new normal reference increasing the reference count by one. |
| 12448 | * |
| 12449 | * Since GLib 2.56, the type of `object` will be propagated to the return type |
| 12450 | * under the same conditions as for g_object_ref(). |
| 12451 | * @returns @object |
| 12452 | */ |
| 12453 | ref_sink(): GObject.Object; |
| 12454 | /** |
| 12455 | * Releases all references to other objects. This can be used to break |
| 12456 | * reference cycles. |
| 12457 | * |
| 12458 | * This function should only be called from object system implementations. |
| 12459 | */ |
| 12460 | run_dispose(): void; |
| 12461 | /** |
| 12462 | * Each object carries around a table of associations from |
| 12463 | * strings to pointers. This function lets you set an association. |
| 12464 | * |
| 12465 | * If the object already had an association with that name, |
| 12466 | * the old association will be destroyed. |
| 12467 | * |
| 12468 | * Internally, the `key` is converted to a #GQuark using g_quark_from_string(). |
| 12469 | * This means a copy of `key` is kept permanently (even after `object` has been |
| 12470 | * finalized) — so it is recommended to only use a small, bounded set of values |
| 12471 | * for `key` in your program, to avoid the #GQuark storage growing unbounded. |
| 12472 | * @param key name of the key |
| 12473 | * @param data data to associate with that key |
| 12474 | */ |
| 12475 | set_data(key: string, data?: any | null): void; |
| 12476 | /** |
| 12477 | * Sets a property on an object. |
| 12478 | * @param property_name The name of the property to set |
| 12479 | * @param value The value to set the property to |
| 12480 | */ |
| 12481 | set_property(property_name: string, value: GObject.Value | any): void; |
| 12482 | /** |
| 12483 | * Remove a specified datum from the object's data associations, |
| 12484 | * without invoking the association's destroy handler. |
| 12485 | * @param key name of the key |
| 12486 | * @returns the data if found, or %NULL if no such data exists. |
| 12487 | */ |
| 12488 | steal_data(key: string): any | null; |
| 12489 | /** |
| 12490 | * This function gets back user data pointers stored via |
| 12491 | * g_object_set_qdata() and removes the `data` from object |
| 12492 | * without invoking its destroy() function (if any was |
| 12493 | * set). |
| 12494 | * Usually, calling this function is only required to update |
| 12495 | * user data pointers with a destroy notifier, for example: |
| 12496 | * |
| 12497 | * ```c |
| 12498 | * void |
| 12499 | * object_add_to_user_list (GObject *object, |
| 12500 | * const gchar *new_string) |
| 12501 | * { |
| 12502 | * // the quark, naming the object data |
| 12503 | * GQuark quark_string_list = g_quark_from_static_string ("my-string-list"); |
| 12504 | * // retrieve the old string list |
| 12505 | * GList *list = g_object_steal_qdata (object, quark_string_list); |
| 12506 | * |
| 12507 | * // prepend new string |
| 12508 | * list = g_list_prepend (list, g_strdup (new_string)); |
| 12509 | * // this changed 'list', so we need to set it again |
| 12510 | * g_object_set_qdata_full (object, quark_string_list, list, free_string_list); |
| 12511 | * } |
| 12512 | * static void |
| 12513 | * free_string_list (gpointer data) |
| 12514 | * { |
| 12515 | * GList *node, *list = data; |
| 12516 | * |
| 12517 | * for (node = list; node; node = node->next) |
| 12518 | * g_free (node->data); |
| 12519 | * g_list_free (list); |
| 12520 | * } |
| 12521 | * ``` |
| 12522 | * |
| 12523 | * Using g_object_get_qdata() in the above example, instead of |
| 12524 | * g_object_steal_qdata() would have left the destroy function set, |
| 12525 | * and thus the partial string list would have been freed upon |
| 12526 | * g_object_set_qdata_full(). |
| 12527 | * @param quark A #GQuark, naming the user data pointer |
| 12528 | * @returns The user data pointer set, or %NULL |
| 12529 | */ |
| 12530 | steal_qdata(quark: GLib.Quark): any | null; |
| 12531 | /** |
| 12532 | * Reverts the effect of a previous call to |
| 12533 | * g_object_freeze_notify(). The freeze count is decreased on `object` |
| 12534 | * and when it reaches zero, queued "notify" signals are emitted. |
| 12535 | * |
| 12536 | * Duplicate notifications for each property are squashed so that at most one |
| 12537 | * #GObject::notify signal is emitted for each property, in the reverse order |
| 12538 | * in which they have been queued. |
| 12539 | * |
| 12540 | * It is an error to call this function when the freeze count is zero. |
| 12541 | */ |
| 12542 | thaw_notify(): void; |
| 12543 | /** |
| 12544 | * Decreases the reference count of `object`. When its reference count |
| 12545 | * drops to 0, the object is finalized (i.e. its memory is freed). |
| 12546 | * |
| 12547 | * If the pointer to the #GObject may be reused in future (for example, if it is |
| 12548 | * an instance variable of another object), it is recommended to clear the |
| 12549 | * pointer to %NULL rather than retain a dangling pointer to a potentially |
| 12550 | * invalid #GObject instance. Use g_clear_object() for this. |
| 12551 | */ |
| 12552 | unref(): void; |
| 12553 | /** |
| 12554 | * This function essentially limits the life time of the `closure` to |
| 12555 | * the life time of the object. That is, when the object is finalized, |
| 12556 | * the `closure` is invalidated by calling g_closure_invalidate() on |
| 12557 | * it, in order to prevent invocations of the closure with a finalized |
| 12558 | * (nonexisting) object. Also, g_object_ref() and g_object_unref() are |
| 12559 | * added as marshal guards to the `closure,` to ensure that an extra |
| 12560 | * reference count is held on `object` during invocation of the |
| 12561 | * `closure`. Usually, this function will be called on closures that |
| 12562 | * use this `object` as closure data. |
| 12563 | * @param closure #GClosure to watch |
| 12564 | */ |
| 12565 | watch_closure(closure: GObject.Closure): void; |
| 12566 | /** |
| 12567 | * the `constructed` function is called by g_object_new() as the |
| 12568 | * final step of the object creation process. At the point of the call, all |
| 12569 | * construction properties have been set on the object. The purpose of this |
| 12570 | * call is to allow for object initialisation steps that can only be performed |
| 12571 | * after construction properties have been set. `constructed` implementors |
| 12572 | * should chain up to the `constructed` call of their parent class to allow it |
| 12573 | * to complete its initialisation. |
| 12574 | */ |
| 12575 | vfunc_constructed(): void; |
| 12576 | /** |
| 12577 | * emits property change notification for a bunch |
| 12578 | * of properties. Overriding `dispatch_properties_changed` should be rarely |
| 12579 | * needed. |
| 12580 | * @param n_pspecs |
| 12581 | * @param pspecs |
| 12582 | */ |
| 12583 | vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void; |
| 12584 | /** |
| 12585 | * the `dispose` function is supposed to drop all references to other |
| 12586 | * objects, but keep the instance otherwise intact, so that client method |
| 12587 | * invocations still work. It may be run multiple times (due to reference |
| 12588 | * loops). Before returning, `dispose` should chain up to the `dispose` method |
| 12589 | * of the parent class. |
| 12590 | */ |
| 12591 | vfunc_dispose(): void; |
| 12592 | /** |
| 12593 | * instance finalization function, should finish the finalization of |
| 12594 | * the instance begun in `dispose` and chain up to the `finalize` method of the |
| 12595 | * parent class. |
| 12596 | */ |
| 12597 | vfunc_finalize(): void; |
| 12598 | /** |
| 12599 | * the generic getter for all properties of this type. Should be |
| 12600 | * overridden for every type with properties. |
| 12601 | * @param property_id |
| 12602 | * @param value |
| 12603 | * @param pspec |
| 12604 | */ |
| 12605 | vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void; |
| 12606 | /** |
| 12607 | * Emits a "notify" signal for the property `property_name` on `object`. |
| 12608 | * |
| 12609 | * When possible, eg. when signaling a property change from within the class |
| 12610 | * that registered the property, you should use g_object_notify_by_pspec() |
| 12611 | * instead. |
| 12612 | * |
| 12613 | * Note that emission of the notify signal may be blocked with |
| 12614 | * g_object_freeze_notify(). In this case, the signal emissions are queued |
| 12615 | * and will be emitted (in reverse order) when g_object_thaw_notify() is |
| 12616 | * called. |
| 12617 | * @param pspec |
| 12618 | */ |
| 12619 | vfunc_notify(pspec: GObject.ParamSpec): void; |
| 12620 | /** |
| 12621 | * the generic setter for all properties of this type. Should be |
| 12622 | * overridden for every type with properties. If implementations of |
| 12623 | * `set_property` don't emit property change notification explicitly, this will |
| 12624 | * be done implicitly by the type system. However, if the notify signal is |
| 12625 | * emitted explicitly, the type system will not emit it a second time. |
| 12626 | * @param property_id |
| 12627 | * @param value |
| 12628 | * @param pspec |
| 12629 | */ |
| 12630 | vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void; |
| 12631 | /** |
| 12632 | * Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to. |
| 12633 | * @param id Handler ID of the handler to be disconnected |
| 12634 | */ |
| 12635 | disconnect(id: number): void; |
| 12636 | /** |
| 12637 | * Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values. |
| 12638 | * @param properties Object containing the properties to set |
| 12639 | */ |
| 12640 | set(properties: { [key: string]: any }): void; |
| 12641 | /** |
| 12642 | * Blocks a handler of an instance so it will not be called during any signal emissions |
| 12643 | * @param id Handler ID of the handler to be blocked |
| 12644 | */ |
| 12645 | block_signal_handler(id: number): void; |
| 12646 | /** |
| 12647 | * Unblocks a handler so it will be called again during any signal emissions |
| 12648 | * @param id Handler ID of the handler to be unblocked |
| 12649 | */ |
| 12650 | unblock_signal_handler(id: number): void; |
| 12651 | /** |
| 12652 | * Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked. |
| 12653 | * @param detailedName Name of the signal to stop emission of |
| 12654 | */ |
| 12655 | stop_emission_by_name(detailedName: string): void; |
| 12656 | } |
| 12657 | |
| 12658 | namespace KeyWidget { |
| 12659 | // Constructor properties interface |
| 12660 | |
| 12661 | interface ConstructorProps |
| 12662 | extends Gtk.Bin.ConstructorProps, |
| 12663 | Atk.ImplementorIface.ConstructorProps, |
| 12664 | Gtk.Buildable.ConstructorProps { |
| 12665 | attributes: Gck.Attributes; |
| 12666 | } |
| 12667 | } |
| 12668 | |
| 12669 | /** |
| 12670 | * A key widget and renderer |
| 12671 | * |
| 12672 | * A key widget can be used to display a RSA, DSA or EC key. The widget is |
| 12673 | * normally in a collapsed state showing only details, but can be expanded by |
| 12674 | * the user. |
| 12675 | * |
| 12676 | * Use [ctor`KeyWidget`.new] to create a new key widget. Only one key can be |
| 12677 | * displayed. A key widget contains a [iface`Viewer]` internally and |
| 12678 | * [class`KeyRenderer]` is used to render the key to the viewer. To show more |
| 12679 | * than one key in a view, create the viewer and add renderers to it. |
| 12680 | */ |
| 12681 | class KeyWidget extends Gtk.Bin implements Atk.ImplementorIface, Gtk.Buildable { |
| 12682 | static $gtype: GObject.GType<KeyWidget>; |
| 12683 | |
| 12684 | // Properties |
| 12685 | |
| 12686 | get attributes(): Gck.Attributes; |
| 12687 | set attributes(val: Gck.Attributes); |
| 12688 | |
| 12689 | // Constructors |
| 12690 | |
| 12691 | constructor(properties?: Partial<KeyWidget.ConstructorProps>, ...args: any[]); |
| 12692 | |
| 12693 | _init(...args: any[]): void; |
| 12694 | |
| 12695 | static ['new'](attrs?: Gck.Attributes | null): KeyWidget; |
| 12696 | |
| 12697 | // Methods |
| 12698 | |
| 12699 | /** |
| 12700 | * Get the attributes displayed in the widget. |
| 12701 | * @returns The attributes, owned by the widget. |
| 12702 | */ |
| 12703 | get_attributes(): Gck.Attributes | null; |
| 12704 | /** |
| 12705 | * Get the attributes displayed in the widget. The attributes should represent |
| 12706 | * either an RSA, DSA or EC key in PKCS#11 style. |
| 12707 | * @param attrs the attributes to display |
| 12708 | */ |
| 12709 | set_attributes(attrs?: Gck.Attributes | null): void; |
| 12710 | |
| 12711 | // Inherited methods |
| 12712 | /** |
| 12713 | * Creates a binding between `source_property` on `source` and `target_property` |
| 12714 | * on `target`. |
| 12715 | * |
| 12716 | * Whenever the `source_property` is changed the `target_property` is |
| 12717 | * updated using the same value. For instance: |
| 12718 | * |
| 12719 | * |
| 12720 | * ```c |
| 12721 | * g_object_bind_property (action, "active", widget, "sensitive", 0); |
| 12722 | * ``` |
| 12723 | * |
| 12724 | * |
| 12725 | * Will result in the "sensitive" property of the widget #GObject instance to be |
| 12726 | * updated with the same value of the "active" property of the action #GObject |
| 12727 | * instance. |
| 12728 | * |
| 12729 | * If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual: |
| 12730 | * if `target_property` on `target` changes then the `source_property` on `source` |
| 12731 | * will be updated as well. |
| 12732 | * |
| 12733 | * The binding will automatically be removed when either the `source` or the |
| 12734 | * `target` instances are finalized. To remove the binding without affecting the |
| 12735 | * `source` and the `target` you can just call g_object_unref() on the returned |
| 12736 | * #GBinding instance. |
| 12737 | * |
| 12738 | * Removing the binding by calling g_object_unref() on it must only be done if |
| 12739 | * the binding, `source` and `target` are only used from a single thread and it |
| 12740 | * is clear that both `source` and `target` outlive the binding. Especially it |
| 12741 | * is not safe to rely on this if the binding, `source` or `target` can be |
| 12742 | * finalized from different threads. Keep another reference to the binding and |
| 12743 | * use g_binding_unbind() instead to be on the safe side. |
| 12744 | * |
| 12745 | * A #GObject can have multiple bindings. |
| 12746 | * @param source_property the property on @source to bind |
| 12747 | * @param target the target #GObject |
| 12748 | * @param target_property the property on @target to bind |
| 12749 | * @param flags flags to pass to #GBinding |
| 12750 | * @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero. |
| 12751 | */ |
| 12752 | bind_property( |
| 12753 | source_property: string, |
| 12754 | target: GObject.Object, |
| 12755 | target_property: string, |
| 12756 | flags: GObject.BindingFlags | null, |
| 12757 | ): GObject.Binding; |
| 12758 | /** |
| 12759 | * Complete version of g_object_bind_property(). |
| 12760 | * |
| 12761 | * Creates a binding between `source_property` on `source` and `target_property` |
| 12762 | * on `target,` allowing you to set the transformation functions to be used by |
| 12763 | * the binding. |
| 12764 | * |
| 12765 | * If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual: |
| 12766 | * if `target_property` on `target` changes then the `source_property` on `source` |
| 12767 | * will be updated as well. The `transform_from` function is only used in case |
| 12768 | * of bidirectional bindings, otherwise it will be ignored |
| 12769 | * |
| 12770 | * The binding will automatically be removed when either the `source` or the |
| 12771 | * `target` instances are finalized. This will release the reference that is |
| 12772 | * being held on the #GBinding instance; if you want to hold on to the |
| 12773 | * #GBinding instance, you will need to hold a reference to it. |
| 12774 | * |
| 12775 | * To remove the binding, call g_binding_unbind(). |
| 12776 | * |
| 12777 | * A #GObject can have multiple bindings. |
| 12778 | * |
| 12779 | * The same `user_data` parameter will be used for both `transform_to` |
| 12780 | * and `transform_from` transformation functions; the `notify` function will |
| 12781 | * be called once, when the binding is removed. If you need different data |
| 12782 | * for each transformation function, please use |
| 12783 | * g_object_bind_property_with_closures() instead. |
| 12784 | * @param source_property the property on @source to bind |
| 12785 | * @param target the target #GObject |
| 12786 | * @param target_property the property on @target to bind |
| 12787 | * @param flags flags to pass to #GBinding |
| 12788 | * @param transform_to the transformation function from the @source to the @target, or %NULL to use the default |
| 12789 | * @param transform_from the transformation function from the @target to the @source, or %NULL to use the default |
| 12790 | * @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required |
| 12791 | * @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero. |
| 12792 | */ |
| 12793 | bind_property_full( |
| 12794 | source_property: string, |
| 12795 | target: GObject.Object, |
| 12796 | target_property: string, |
| 12797 | flags: GObject.BindingFlags | null, |
| 12798 | transform_to?: GObject.BindingTransformFunc | null, |
| 12799 | transform_from?: GObject.BindingTransformFunc | null, |
| 12800 | notify?: GLib.DestroyNotify | null, |
| 12801 | ): GObject.Binding; |
| 12802 | // Conflicted with GObject.Object.bind_property_full |
| 12803 | bind_property_full(...args: never[]): any; |
| 12804 | /** |
| 12805 | * This function is intended for #GObject implementations to re-enforce |
| 12806 | * a [floating][floating-ref] object reference. Doing this is seldom |
| 12807 | * required: all #GInitiallyUnowneds are created with a floating reference |
| 12808 | * which usually just needs to be sunken by calling g_object_ref_sink(). |
| 12809 | */ |
| 12810 | force_floating(): void; |
| 12811 | /** |
| 12812 | * Increases the freeze count on `object`. If the freeze count is |
| 12813 | * non-zero, the emission of "notify" signals on `object` is |
| 12814 | * stopped. The signals are queued until the freeze count is decreased |
| 12815 | * to zero. Duplicate notifications are squashed so that at most one |
| 12816 | * #GObject::notify signal is emitted for each property modified while the |
| 12817 | * object is frozen. |
| 12818 | * |
| 12819 | * This is necessary for accessors that modify multiple properties to prevent |
| 12820 | * premature notification while the object is still being modified. |
| 12821 | */ |
| 12822 | freeze_notify(): void; |
| 12823 | /** |
| 12824 | * Gets a named field from the objects table of associations (see g_object_set_data()). |
| 12825 | * @param key name of the key for that association |
| 12826 | * @returns the data if found, or %NULL if no such data exists. |
| 12827 | */ |
| 12828 | get_data(key: string): any | null; |
| 12829 | /** |
| 12830 | * Gets a property of an object. |
| 12831 | * |
| 12832 | * The value can be: |
| 12833 | * - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60) |
| 12834 | * - a GObject.Value initialized with the expected type of the property |
| 12835 | * - a GObject.Value initialized with a type to which the expected type of the property can be transformed |
| 12836 | * |
| 12837 | * In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset. |
| 12838 | * |
| 12839 | * Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming. |
| 12840 | * @param property_name The name of the property to get |
| 12841 | * @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type |
| 12842 | */ |
| 12843 | get_property(property_name: string, value: GObject.Value | any): any; |
| 12844 | /** |
| 12845 | * This function gets back user data pointers stored via |
| 12846 | * g_object_set_qdata(). |
| 12847 | * @param quark A #GQuark, naming the user data pointer |
| 12848 | * @returns The user data pointer set, or %NULL |
| 12849 | */ |
| 12850 | get_qdata(quark: GLib.Quark): any | null; |
| 12851 | /** |
| 12852 | * Gets `n_properties` properties for an `object`. |
| 12853 | * Obtained properties will be set to `values`. All properties must be valid. |
| 12854 | * Warnings will be emitted and undefined behaviour may result if invalid |
| 12855 | * properties are passed in. |
| 12856 | * @param names the names of each property to get |
| 12857 | * @param values the values of each property to get |
| 12858 | */ |
| 12859 | getv(names: string[], values: (GObject.Value | any)[]): void; |
| 12860 | /** |
| 12861 | * Checks whether `object` has a [floating][floating-ref] reference. |
| 12862 | * @returns %TRUE if @object has a floating reference |
| 12863 | */ |
| 12864 | is_floating(): boolean; |
| 12865 | /** |
| 12866 | * Emits a "notify" signal for the property `property_name` on `object`. |
| 12867 | * |
| 12868 | * When possible, eg. when signaling a property change from within the class |
| 12869 | * that registered the property, you should use g_object_notify_by_pspec() |
| 12870 | * instead. |
| 12871 | * |
| 12872 | * Note that emission of the notify signal may be blocked with |
| 12873 | * g_object_freeze_notify(). In this case, the signal emissions are queued |
| 12874 | * and will be emitted (in reverse order) when g_object_thaw_notify() is |
| 12875 | * called. |
| 12876 | * @param property_name the name of a property installed on the class of @object. |
| 12877 | */ |
| 12878 | notify(property_name: string): void; |
| 12879 | /** |
| 12880 | * Emits a "notify" signal for the property specified by `pspec` on `object`. |
| 12881 | * |
| 12882 | * This function omits the property name lookup, hence it is faster than |
| 12883 | * g_object_notify(). |
| 12884 | * |
| 12885 | * One way to avoid using g_object_notify() from within the |
| 12886 | * class that registered the properties, and using g_object_notify_by_pspec() |
| 12887 | * instead, is to store the GParamSpec used with |
| 12888 | * g_object_class_install_property() inside a static array, e.g.: |
| 12889 | * |
| 12890 | * |
| 12891 | * ```c |
| 12892 | * typedef enum |
| 12893 | * { |
| 12894 | * PROP_FOO = 1, |
| 12895 | * PROP_LAST |
| 12896 | * } MyObjectProperty; |
| 12897 | * |
| 12898 | * static GParamSpec *properties[PROP_LAST]; |
| 12899 | * |
| 12900 | * static void |
| 12901 | * my_object_class_init (MyObjectClass *klass) |
| 12902 | * { |
| 12903 | * properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL, |
| 12904 | * 0, 100, |
| 12905 | * 50, |
| 12906 | * G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); |
| 12907 | * g_object_class_install_property (gobject_class, |
| 12908 | * PROP_FOO, |
| 12909 | * properties[PROP_FOO]); |
| 12910 | * } |
| 12911 | * ``` |
| 12912 | * |
| 12913 | * |
| 12914 | * and then notify a change on the "foo" property with: |
| 12915 | * |
| 12916 | * |
| 12917 | * ```c |
| 12918 | * g_object_notify_by_pspec (self, properties[PROP_FOO]); |
| 12919 | * ``` |
| 12920 | * |
| 12921 | * @param pspec the #GParamSpec of a property installed on the class of @object. |
| 12922 | */ |
| 12923 | notify_by_pspec(pspec: GObject.ParamSpec): void; |
| 12924 | /** |
| 12925 | * Increases the reference count of `object`. |
| 12926 | * |
| 12927 | * Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type |
| 12928 | * of `object` will be propagated to the return type (using the GCC typeof() |
| 12929 | * extension), so any casting the caller needs to do on the return type must be |
| 12930 | * explicit. |
| 12931 | * @returns the same @object |
| 12932 | */ |
| 12933 | ref(): GObject.Object; |
| 12934 | /** |
| 12935 | * Increase the reference count of `object,` and possibly remove the |
| 12936 | * [floating][floating-ref] reference, if `object` has a floating reference. |
| 12937 | * |
| 12938 | * In other words, if the object is floating, then this call "assumes |
| 12939 | * ownership" of the floating reference, converting it to a normal |
| 12940 | * reference by clearing the floating flag while leaving the reference |
| 12941 | * count unchanged. If the object is not floating, then this call |
| 12942 | * adds a new normal reference increasing the reference count by one. |
| 12943 | * |
| 12944 | * Since GLib 2.56, the type of `object` will be propagated to the return type |
| 12945 | * under the same conditions as for g_object_ref(). |
| 12946 | * @returns @object |
| 12947 | */ |
| 12948 | ref_sink(): GObject.Object; |
| 12949 | /** |
| 12950 | * Releases all references to other objects. This can be used to break |
| 12951 | * reference cycles. |
| 12952 | * |
| 12953 | * This function should only be called from object system implementations. |
| 12954 | */ |
| 12955 | run_dispose(): void; |
| 12956 | /** |
| 12957 | * Each object carries around a table of associations from |
| 12958 | * strings to pointers. This function lets you set an association. |
| 12959 | * |
| 12960 | * If the object already had an association with that name, |
| 12961 | * the old association will be destroyed. |
| 12962 | * |
| 12963 | * Internally, the `key` is converted to a #GQuark using g_quark_from_string(). |
| 12964 | * This means a copy of `key` is kept permanently (even after `object` has been |
| 12965 | * finalized) — so it is recommended to only use a small, bounded set of values |
| 12966 | * for `key` in your program, to avoid the #GQuark storage growing unbounded. |
| 12967 | * @param key name of the key |
| 12968 | * @param data data to associate with that key |
| 12969 | */ |
| 12970 | set_data(key: string, data?: any | null): void; |
| 12971 | /** |
| 12972 | * Sets a property on an object. |
| 12973 | * @param property_name The name of the property to set |
| 12974 | * @param value The value to set the property to |
| 12975 | */ |
| 12976 | set_property(property_name: string, value: GObject.Value | any): void; |
| 12977 | /** |
| 12978 | * Remove a specified datum from the object's data associations, |
| 12979 | * without invoking the association's destroy handler. |
| 12980 | * @param key name of the key |
| 12981 | * @returns the data if found, or %NULL if no such data exists. |
| 12982 | */ |
| 12983 | steal_data(key: string): any | null; |
| 12984 | /** |
| 12985 | * This function gets back user data pointers stored via |
| 12986 | * g_object_set_qdata() and removes the `data` from object |
| 12987 | * without invoking its destroy() function (if any was |
| 12988 | * set). |
| 12989 | * Usually, calling this function is only required to update |
| 12990 | * user data pointers with a destroy notifier, for example: |
| 12991 | * |
| 12992 | * ```c |
| 12993 | * void |
| 12994 | * object_add_to_user_list (GObject *object, |
| 12995 | * const gchar *new_string) |
| 12996 | * { |
| 12997 | * // the quark, naming the object data |
| 12998 | * GQuark quark_string_list = g_quark_from_static_string ("my-string-list"); |
| 12999 | * // retrieve the old string list |
| 13000 | * GList *list = g_object_steal_qdata (object, quark_string_list); |
| 13001 | * |
| 13002 | * // prepend new string |
| 13003 | * list = g_list_prepend (list, g_strdup (new_string)); |
| 13004 | * // this changed 'list', so we need to set it again |
| 13005 | * g_object_set_qdata_full (object, quark_string_list, list, free_string_list); |
| 13006 | * } |
| 13007 | * static void |
| 13008 | * free_string_list (gpointer data) |
| 13009 | * { |
| 13010 | * GList *node, *list = data; |
| 13011 | * |
| 13012 | * for (node = list; node; node = node->next) |
| 13013 | * g_free (node->data); |
| 13014 | * g_list_free (list); |
| 13015 | * } |
| 13016 | * ``` |
| 13017 | * |
| 13018 | * Using g_object_get_qdata() in the above example, instead of |
| 13019 | * g_object_steal_qdata() would have left the destroy function set, |
| 13020 | * and thus the partial string list would have been freed upon |
| 13021 | * g_object_set_qdata_full(). |
| 13022 | * @param quark A #GQuark, naming the user data pointer |
| 13023 | * @returns The user data pointer set, or %NULL |
| 13024 | */ |
| 13025 | steal_qdata(quark: GLib.Quark): any | null; |
| 13026 | /** |
| 13027 | * Reverts the effect of a previous call to |
| 13028 | * g_object_freeze_notify(). The freeze count is decreased on `object` |
| 13029 | * and when it reaches zero, queued "notify" signals are emitted. |
| 13030 | * |
| 13031 | * Duplicate notifications for each property are squashed so that at most one |
| 13032 | * #GObject::notify signal is emitted for each property, in the reverse order |
| 13033 | * in which they have been queued. |
| 13034 | * |
| 13035 | * It is an error to call this function when the freeze count is zero. |
| 13036 | */ |
| 13037 | thaw_notify(): void; |
| 13038 | /** |
| 13039 | * Decreases the reference count of `object`. When its reference count |
| 13040 | * drops to 0, the object is finalized (i.e. its memory is freed). |
| 13041 | * |
| 13042 | * If the pointer to the #GObject may be reused in future (for example, if it is |
| 13043 | * an instance variable of another object), it is recommended to clear the |
| 13044 | * pointer to %NULL rather than retain a dangling pointer to a potentially |
| 13045 | * invalid #GObject instance. Use g_clear_object() for this. |
| 13046 | */ |
| 13047 | unref(): void; |
| 13048 | /** |
| 13049 | * This function essentially limits the life time of the `closure` to |
| 13050 | * the life time of the object. That is, when the object is finalized, |
| 13051 | * the `closure` is invalidated by calling g_closure_invalidate() on |
| 13052 | * it, in order to prevent invocations of the closure with a finalized |
| 13053 | * (nonexisting) object. Also, g_object_ref() and g_object_unref() are |
| 13054 | * added as marshal guards to the `closure,` to ensure that an extra |
| 13055 | * reference count is held on `object` during invocation of the |
| 13056 | * `closure`. Usually, this function will be called on closures that |
| 13057 | * use this `object` as closure data. |
| 13058 | * @param closure #GClosure to watch |
| 13059 | */ |
| 13060 | watch_closure(closure: GObject.Closure): void; |
| 13061 | /** |
| 13062 | * the `constructed` function is called by g_object_new() as the |
| 13063 | * final step of the object creation process. At the point of the call, all |
| 13064 | * construction properties have been set on the object. The purpose of this |
| 13065 | * call is to allow for object initialisation steps that can only be performed |
| 13066 | * after construction properties have been set. `constructed` implementors |
| 13067 | * should chain up to the `constructed` call of their parent class to allow it |
| 13068 | * to complete its initialisation. |
| 13069 | */ |
| 13070 | vfunc_constructed(): void; |
| 13071 | /** |
| 13072 | * emits property change notification for a bunch |
| 13073 | * of properties. Overriding `dispatch_properties_changed` should be rarely |
| 13074 | * needed. |
| 13075 | * @param n_pspecs |
| 13076 | * @param pspecs |
| 13077 | */ |
| 13078 | vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void; |
| 13079 | /** |
| 13080 | * the `dispose` function is supposed to drop all references to other |
| 13081 | * objects, but keep the instance otherwise intact, so that client method |
| 13082 | * invocations still work. It may be run multiple times (due to reference |
| 13083 | * loops). Before returning, `dispose` should chain up to the `dispose` method |
| 13084 | * of the parent class. |
| 13085 | */ |
| 13086 | vfunc_dispose(): void; |
| 13087 | /** |
| 13088 | * instance finalization function, should finish the finalization of |
| 13089 | * the instance begun in `dispose` and chain up to the `finalize` method of the |
| 13090 | * parent class. |
| 13091 | */ |
| 13092 | vfunc_finalize(): void; |
| 13093 | /** |
| 13094 | * the generic getter for all properties of this type. Should be |
| 13095 | * overridden for every type with properties. |
| 13096 | * @param property_id |
| 13097 | * @param value |
| 13098 | * @param pspec |
| 13099 | */ |
| 13100 | vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void; |
| 13101 | /** |
| 13102 | * Emits a "notify" signal for the property `property_name` on `object`. |
| 13103 | * |
| 13104 | * When possible, eg. when signaling a property change from within the class |
| 13105 | * that registered the property, you should use g_object_notify_by_pspec() |
| 13106 | * instead. |
| 13107 | * |
| 13108 | * Note that emission of the notify signal may be blocked with |
| 13109 | * g_object_freeze_notify(). In this case, the signal emissions are queued |
| 13110 | * and will be emitted (in reverse order) when g_object_thaw_notify() is |
| 13111 | * called. |
| 13112 | * @param pspec |
| 13113 | */ |
| 13114 | vfunc_notify(pspec: GObject.ParamSpec): void; |
| 13115 | /** |
| 13116 | * the generic setter for all properties of this type. Should be |
| 13117 | * overridden for every type with properties. If implementations of |
| 13118 | * `set_property` don't emit property change notification explicitly, this will |
| 13119 | * be done implicitly by the type system. However, if the notify signal is |
| 13120 | * emitted explicitly, the type system will not emit it a second time. |
| 13121 | * @param property_id |
| 13122 | * @param value |
| 13123 | * @param pspec |
| 13124 | */ |
| 13125 | vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void; |
| 13126 | /** |
| 13127 | * Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to. |
| 13128 | * @param id Handler ID of the handler to be disconnected |
| 13129 | */ |
| 13130 | disconnect(id: number): void; |
| 13131 | /** |
| 13132 | * Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values. |
| 13133 | * @param properties Object containing the properties to set |
| 13134 | */ |
| 13135 | set(properties: { [key: string]: any }): void; |
| 13136 | /** |
| 13137 | * Blocks a handler of an instance so it will not be called during any signal emissions |
| 13138 | * @param id Handler ID of the handler to be blocked |
| 13139 | */ |
| 13140 | block_signal_handler(id: number): void; |
| 13141 | /** |
| 13142 | * Unblocks a handler so it will be called again during any signal emissions |
| 13143 | * @param id Handler ID of the handler to be unblocked |
| 13144 | */ |
| 13145 | unblock_signal_handler(id: number): void; |
| 13146 | /** |
| 13147 | * Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked. |
| 13148 | * @param detailedName Name of the signal to stop emission of |
| 13149 | */ |
| 13150 | stop_emission_by_name(detailedName: string): void; |
| 13151 | } |
| 13152 | |
| 13153 | namespace ListSelector { |
| 13154 | // Constructor properties interface |
| 13155 | |
| 13156 | interface ConstructorProps |
| 13157 | extends Gtk.TreeView.ConstructorProps, |
| 13158 | Atk.ImplementorIface.ConstructorProps, |
| 13159 | Gtk.Buildable.ConstructorProps, |
| 13160 | Gtk.Scrollable.ConstructorProps { |
| 13161 | collection: Gcr.Collection; |
| 13162 | } |
| 13163 | } |
| 13164 | |
| 13165 | /** |
| 13166 | * A selector widget to select 1 or more certificates or keys from a list. |
| 13167 | * |
| 13168 | * Live search is available for quick filtering. |
| 13169 | */ |
| 13170 | class ListSelector extends Gtk.TreeView implements Atk.ImplementorIface, Gtk.Buildable, Gtk.Scrollable { |
| 13171 | static $gtype: GObject.GType<ListSelector>; |
| 13172 | |
| 13173 | // Properties |
| 13174 | |
| 13175 | /** |
| 13176 | * The collection which contains the objects to display in the selector. |
| 13177 | */ |
| 13178 | get collection(): Gcr.Collection; |
| 13179 | |
| 13180 | // Constructors |
| 13181 | |
| 13182 | constructor(properties?: Partial<ListSelector.ConstructorProps>, ...args: any[]); |
| 13183 | |
| 13184 | _init(...args: any[]): void; |
| 13185 | |
| 13186 | static ['new'](collection: Gcr.Collection): ListSelector; |
| 13187 | // Conflicted with Gtk.TreeView.new |
| 13188 | |
| 13189 | static ['new'](...args: never[]): any; |
| 13190 | |
| 13191 | // Methods |
| 13192 | |
| 13193 | /** |
| 13194 | * Get the collection that this selector is displaying objects from. |
| 13195 | * @returns The collection, owned by the selector. |
| 13196 | */ |
| 13197 | get_collection(): Gcr.Collection; |
| 13198 | /** |
| 13199 | * Get a list of selected objects. |
| 13200 | * @returns the list of selected objects, to be released with g_list_free() |
| 13201 | */ |
| 13202 | get_selected(): GObject.Object[]; |
| 13203 | /** |
| 13204 | * Select certain objects in the selector. |
| 13205 | * @param selected the list of objects to select |
| 13206 | */ |
| 13207 | set_selected(selected: GObject.Object[]): void; |
| 13208 | |
| 13209 | // Inherited properties |
| 13210 | /** |
| 13211 | * Horizontal #GtkAdjustment of the scrollable widget. This adjustment is |
| 13212 | * shared between the scrollable widget and its parent. |
| 13213 | */ |
| 13214 | get hadjustment(): Gtk.Adjustment; |
| 13215 | set hadjustment(val: Gtk.Adjustment); |
| 13216 | /** |
| 13217 | * Determines whether horizontal scrolling should start once the scrollable |
| 13218 | * widget is allocated less than its minimum width or less than its natural width. |
| 13219 | */ |
| 13220 | get hscroll_policy(): Gtk.ScrollablePolicy; |
| 13221 | set hscroll_policy(val: Gtk.ScrollablePolicy); |
| 13222 | /** |
| 13223 | * Determines whether horizontal scrolling should start once the scrollable |
| 13224 | * widget is allocated less than its minimum width or less than its natural width. |
| 13225 | */ |
| 13226 | get hscrollPolicy(): Gtk.ScrollablePolicy; |
| 13227 | set hscrollPolicy(val: Gtk.ScrollablePolicy); |
| 13228 | /** |
| 13229 | * Verical #GtkAdjustment of the scrollable widget. This adjustment is shared |
| 13230 | * between the scrollable widget and its parent. |
| 13231 | */ |
| 13232 | get vadjustment(): Gtk.Adjustment; |
| 13233 | set vadjustment(val: Gtk.Adjustment); |
| 13234 | /** |
| 13235 | * Determines whether vertical scrolling should start once the scrollable |
| 13236 | * widget is allocated less than its minimum height or less than its natural height. |
| 13237 | */ |
| 13238 | get vscroll_policy(): Gtk.ScrollablePolicy; |
| 13239 | set vscroll_policy(val: Gtk.ScrollablePolicy); |
| 13240 | /** |
| 13241 | * Determines whether vertical scrolling should start once the scrollable |
| 13242 | * widget is allocated less than its minimum height or less than its natural height. |
| 13243 | */ |
| 13244 | get vscrollPolicy(): Gtk.ScrollablePolicy; |
| 13245 | set vscrollPolicy(val: Gtk.ScrollablePolicy); |
| 13246 | |
| 13247 | // Inherited methods |
| 13248 | /** |
| 13249 | * Returns the size of a non-scrolling border around the |
| 13250 | * outside of the scrollable. An example for this would |
| 13251 | * be treeview headers. GTK+ can use this information to |
| 13252 | * display overlayed graphics, like the overshoot indication, |
| 13253 | * at the right position. |
| 13254 | * @returns %TRUE if @border has been set |
| 13255 | */ |
| 13256 | get_border(): [boolean, Gtk.Border]; |
| 13257 | /** |
| 13258 | * Retrieves the #GtkAdjustment used for horizontal scrolling. |
| 13259 | * @returns horizontal #GtkAdjustment. |
| 13260 | */ |
| 13261 | get_hadjustment(): Gtk.Adjustment; |
| 13262 | /** |
| 13263 | * Gets the horizontal #GtkScrollablePolicy. |
| 13264 | * @returns The horizontal #GtkScrollablePolicy. |
| 13265 | */ |
| 13266 | get_hscroll_policy(): Gtk.ScrollablePolicy; |
| 13267 | /** |
| 13268 | * Retrieves the #GtkAdjustment used for vertical scrolling. |
| 13269 | * @returns vertical #GtkAdjustment. |
| 13270 | */ |
| 13271 | get_vadjustment(): Gtk.Adjustment; |
| 13272 | /** |
| 13273 | * Gets the vertical #GtkScrollablePolicy. |
| 13274 | * @returns The vertical #GtkScrollablePolicy. |
| 13275 | */ |
| 13276 | get_vscroll_policy(): Gtk.ScrollablePolicy; |
| 13277 | /** |
| 13278 | * Sets the horizontal adjustment of the #GtkScrollable. |
| 13279 | * @param hadjustment a #GtkAdjustment |
| 13280 | */ |
| 13281 | set_hadjustment(hadjustment?: Gtk.Adjustment | null): void; |
| 13282 | /** |
| 13283 | * Sets the #GtkScrollablePolicy to determine whether |
| 13284 | * horizontal scrolling should start below the minimum width or |
| 13285 | * below the natural width. |
| 13286 | * @param policy the horizontal #GtkScrollablePolicy |
| 13287 | */ |
| 13288 | set_hscroll_policy(policy: Gtk.ScrollablePolicy | null): void; |
| 13289 | /** |
| 13290 | * Sets the vertical adjustment of the #GtkScrollable. |
| 13291 | * @param vadjustment a #GtkAdjustment |
| 13292 | */ |
| 13293 | set_vadjustment(vadjustment?: Gtk.Adjustment | null): void; |
| 13294 | /** |
| 13295 | * Sets the #GtkScrollablePolicy to determine whether |
| 13296 | * vertical scrolling should start below the minimum height or |
| 13297 | * below the natural height. |
| 13298 | * @param policy the vertical #GtkScrollablePolicy |
| 13299 | */ |
| 13300 | set_vscroll_policy(policy: Gtk.ScrollablePolicy | null): void; |
| 13301 | /** |
| 13302 | * Returns the size of a non-scrolling border around the |
| 13303 | * outside of the scrollable. An example for this would |
| 13304 | * be treeview headers. GTK+ can use this information to |
| 13305 | * display overlayed graphics, like the overshoot indication, |
| 13306 | * at the right position. |
| 13307 | */ |
| 13308 | vfunc_get_border(): [boolean, Gtk.Border]; |
| 13309 | /** |
| 13310 | * Creates a binding between `source_property` on `source` and `target_property` |
| 13311 | * on `target`. |
| 13312 | * |
| 13313 | * Whenever the `source_property` is changed the `target_property` is |
| 13314 | * updated using the same value. For instance: |
| 13315 | * |
| 13316 | * |
| 13317 | * ```c |
| 13318 | * g_object_bind_property (action, "active", widget, "sensitive", 0); |
| 13319 | * ``` |
| 13320 | * |
| 13321 | * |
| 13322 | * Will result in the "sensitive" property of the widget #GObject instance to be |
| 13323 | * updated with the same value of the "active" property of the action #GObject |
| 13324 | * instance. |
| 13325 | * |
| 13326 | * If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual: |
| 13327 | * if `target_property` on `target` changes then the `source_property` on `source` |
| 13328 | * will be updated as well. |
| 13329 | * |
| 13330 | * The binding will automatically be removed when either the `source` or the |
| 13331 | * `target` instances are finalized. To remove the binding without affecting the |
| 13332 | * `source` and the `target` you can just call g_object_unref() on the returned |
| 13333 | * #GBinding instance. |
| 13334 | * |
| 13335 | * Removing the binding by calling g_object_unref() on it must only be done if |
| 13336 | * the binding, `source` and `target` are only used from a single thread and it |
| 13337 | * is clear that both `source` and `target` outlive the binding. Especially it |
| 13338 | * is not safe to rely on this if the binding, `source` or `target` can be |
| 13339 | * finalized from different threads. Keep another reference to the binding and |
| 13340 | * use g_binding_unbind() instead to be on the safe side. |
| 13341 | * |
| 13342 | * A #GObject can have multiple bindings. |
| 13343 | * @param source_property the property on @source to bind |
| 13344 | * @param target the target #GObject |
| 13345 | * @param target_property the property on @target to bind |
| 13346 | * @param flags flags to pass to #GBinding |
| 13347 | * @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero. |
| 13348 | */ |
| 13349 | bind_property( |
| 13350 | source_property: string, |
| 13351 | target: GObject.Object, |
| 13352 | target_property: string, |
| 13353 | flags: GObject.BindingFlags | null, |
| 13354 | ): GObject.Binding; |
| 13355 | /** |
| 13356 | * Complete version of g_object_bind_property(). |
| 13357 | * |
| 13358 | * Creates a binding between `source_property` on `source` and `target_property` |
| 13359 | * on `target,` allowing you to set the transformation functions to be used by |
| 13360 | * the binding. |
| 13361 | * |
| 13362 | * If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual: |
| 13363 | * if `target_property` on `target` changes then the `source_property` on `source` |
| 13364 | * will be updated as well. The `transform_from` function is only used in case |
| 13365 | * of bidirectional bindings, otherwise it will be ignored |
| 13366 | * |
| 13367 | * The binding will automatically be removed when either the `source` or the |
| 13368 | * `target` instances are finalized. This will release the reference that is |
| 13369 | * being held on the #GBinding instance; if you want to hold on to the |
| 13370 | * #GBinding instance, you will need to hold a reference to it. |
| 13371 | * |
| 13372 | * To remove the binding, call g_binding_unbind(). |
| 13373 | * |
| 13374 | * A #GObject can have multiple bindings. |
| 13375 | * |
| 13376 | * The same `user_data` parameter will be used for both `transform_to` |
| 13377 | * and `transform_from` transformation functions; the `notify` function will |
| 13378 | * be called once, when the binding is removed. If you need different data |
| 13379 | * for each transformation function, please use |
| 13380 | * g_object_bind_property_with_closures() instead. |
| 13381 | * @param source_property the property on @source to bind |
| 13382 | * @param target the target #GObject |
| 13383 | * @param target_property the property on @target to bind |
| 13384 | * @param flags flags to pass to #GBinding |
| 13385 | * @param transform_to the transformation function from the @source to the @target, or %NULL to use the default |
| 13386 | * @param transform_from the transformation function from the @target to the @source, or %NULL to use the default |
| 13387 | * @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required |
| 13388 | * @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero. |
| 13389 | */ |
| 13390 | bind_property_full( |
| 13391 | source_property: string, |
| 13392 | target: GObject.Object, |
| 13393 | target_property: string, |
| 13394 | flags: GObject.BindingFlags | null, |
| 13395 | transform_to?: GObject.BindingTransformFunc | null, |
| 13396 | transform_from?: GObject.BindingTransformFunc | null, |
| 13397 | notify?: GLib.DestroyNotify | null, |
| 13398 | ): GObject.Binding; |
| 13399 | // Conflicted with GObject.Object.bind_property_full |
| 13400 | bind_property_full(...args: never[]): any; |
| 13401 | /** |
| 13402 | * This function is intended for #GObject implementations to re-enforce |
| 13403 | * a [floating][floating-ref] object reference. Doing this is seldom |
| 13404 | * required: all #GInitiallyUnowneds are created with a floating reference |
| 13405 | * which usually just needs to be sunken by calling g_object_ref_sink(). |
| 13406 | */ |
| 13407 | force_floating(): void; |
| 13408 | /** |
| 13409 | * Increases the freeze count on `object`. If the freeze count is |
| 13410 | * non-zero, the emission of "notify" signals on `object` is |
| 13411 | * stopped. The signals are queued until the freeze count is decreased |
| 13412 | * to zero. Duplicate notifications are squashed so that at most one |
| 13413 | * #GObject::notify signal is emitted for each property modified while the |
| 13414 | * object is frozen. |
| 13415 | * |
| 13416 | * This is necessary for accessors that modify multiple properties to prevent |
| 13417 | * premature notification while the object is still being modified. |
| 13418 | */ |
| 13419 | freeze_notify(): void; |
| 13420 | /** |
| 13421 | * Gets a named field from the objects table of associations (see g_object_set_data()). |
| 13422 | * @param key name of the key for that association |
| 13423 | * @returns the data if found, or %NULL if no such data exists. |
| 13424 | */ |
| 13425 | get_data(key: string): any | null; |
| 13426 | /** |
| 13427 | * Gets a property of an object. |
| 13428 | * |
| 13429 | * The value can be: |
| 13430 | * - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60) |
| 13431 | * - a GObject.Value initialized with the expected type of the property |
| 13432 | * - a GObject.Value initialized with a type to which the expected type of the property can be transformed |
| 13433 | * |
| 13434 | * In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset. |
| 13435 | * |
| 13436 | * Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming. |
| 13437 | * @param property_name The name of the property to get |
| 13438 | * @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type |
| 13439 | */ |
| 13440 | get_property(property_name: string, value: GObject.Value | any): any; |
| 13441 | /** |
| 13442 | * This function gets back user data pointers stored via |
| 13443 | * g_object_set_qdata(). |
| 13444 | * @param quark A #GQuark, naming the user data pointer |
| 13445 | * @returns The user data pointer set, or %NULL |
| 13446 | */ |
| 13447 | get_qdata(quark: GLib.Quark): any | null; |
| 13448 | /** |
| 13449 | * Gets `n_properties` properties for an `object`. |
| 13450 | * Obtained properties will be set to `values`. All properties must be valid. |
| 13451 | * Warnings will be emitted and undefined behaviour may result if invalid |
| 13452 | * properties are passed in. |
| 13453 | * @param names the names of each property to get |
| 13454 | * @param values the values of each property to get |
| 13455 | */ |
| 13456 | getv(names: string[], values: (GObject.Value | any)[]): void; |
| 13457 | /** |
| 13458 | * Checks whether `object` has a [floating][floating-ref] reference. |
| 13459 | * @returns %TRUE if @object has a floating reference |
| 13460 | */ |
| 13461 | is_floating(): boolean; |
| 13462 | /** |
| 13463 | * Emits a "notify" signal for the property `property_name` on `object`. |
| 13464 | * |
| 13465 | * When possible, eg. when signaling a property change from within the class |
| 13466 | * that registered the property, you should use g_object_notify_by_pspec() |
| 13467 | * instead. |
| 13468 | * |
| 13469 | * Note that emission of the notify signal may be blocked with |
| 13470 | * g_object_freeze_notify(). In this case, the signal emissions are queued |
| 13471 | * and will be emitted (in reverse order) when g_object_thaw_notify() is |
| 13472 | * called. |
| 13473 | * @param property_name the name of a property installed on the class of @object. |
| 13474 | */ |
| 13475 | notify(property_name: string): void; |
| 13476 | /** |
| 13477 | * Emits a "notify" signal for the property specified by `pspec` on `object`. |
| 13478 | * |
| 13479 | * This function omits the property name lookup, hence it is faster than |
| 13480 | * g_object_notify(). |
| 13481 | * |
| 13482 | * One way to avoid using g_object_notify() from within the |
| 13483 | * class that registered the properties, and using g_object_notify_by_pspec() |
| 13484 | * instead, is to store the GParamSpec used with |
| 13485 | * g_object_class_install_property() inside a static array, e.g.: |
| 13486 | * |
| 13487 | * |
| 13488 | * ```c |
| 13489 | * typedef enum |
| 13490 | * { |
| 13491 | * PROP_FOO = 1, |
| 13492 | * PROP_LAST |
| 13493 | * } MyObjectProperty; |
| 13494 | * |
| 13495 | * static GParamSpec *properties[PROP_LAST]; |
| 13496 | * |
| 13497 | * static void |
| 13498 | * my_object_class_init (MyObjectClass *klass) |
| 13499 | * { |
| 13500 | * properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL, |
| 13501 | * 0, 100, |
| 13502 | * 50, |
| 13503 | * G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); |
| 13504 | * g_object_class_install_property (gobject_class, |
| 13505 | * PROP_FOO, |
| 13506 | * properties[PROP_FOO]); |
| 13507 | * } |
| 13508 | * ``` |
| 13509 | * |
| 13510 | * |
| 13511 | * and then notify a change on the "foo" property with: |
| 13512 | * |
| 13513 | * |
| 13514 | * ```c |
| 13515 | * g_object_notify_by_pspec (self, properties[PROP_FOO]); |
| 13516 | * ``` |
| 13517 | * |
| 13518 | * @param pspec the #GParamSpec of a property installed on the class of @object. |
| 13519 | */ |
| 13520 | notify_by_pspec(pspec: GObject.ParamSpec): void; |
| 13521 | /** |
| 13522 | * Increases the reference count of `object`. |
| 13523 | * |
| 13524 | * Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type |
| 13525 | * of `object` will be propagated to the return type (using the GCC typeof() |
| 13526 | * extension), so any casting the caller needs to do on the return type must be |
| 13527 | * explicit. |
| 13528 | * @returns the same @object |
| 13529 | */ |
| 13530 | ref(): GObject.Object; |
| 13531 | /** |
| 13532 | * Increase the reference count of `object,` and possibly remove the |
| 13533 | * [floating][floating-ref] reference, if `object` has a floating reference. |
| 13534 | * |
| 13535 | * In other words, if the object is floating, then this call "assumes |
| 13536 | * ownership" of the floating reference, converting it to a normal |
| 13537 | * reference by clearing the floating flag while leaving the reference |
| 13538 | * count unchanged. If the object is not floating, then this call |
| 13539 | * adds a new normal reference increasing the reference count by one. |
| 13540 | * |
| 13541 | * Since GLib 2.56, the type of `object` will be propagated to the return type |
| 13542 | * under the same conditions as for g_object_ref(). |
| 13543 | * @returns @object |
| 13544 | */ |
| 13545 | ref_sink(): GObject.Object; |
| 13546 | /** |
| 13547 | * Releases all references to other objects. This can be used to break |
| 13548 | * reference cycles. |
| 13549 | * |
| 13550 | * This function should only be called from object system implementations. |
| 13551 | */ |
| 13552 | run_dispose(): void; |
| 13553 | /** |
| 13554 | * Each object carries around a table of associations from |
| 13555 | * strings to pointers. This function lets you set an association. |
| 13556 | * |
| 13557 | * If the object already had an association with that name, |
| 13558 | * the old association will be destroyed. |
| 13559 | * |
| 13560 | * Internally, the `key` is converted to a #GQuark using g_quark_from_string(). |
| 13561 | * This means a copy of `key` is kept permanently (even after `object` has been |
| 13562 | * finalized) — so it is recommended to only use a small, bounded set of values |
| 13563 | * for `key` in your program, to avoid the #GQuark storage growing unbounded. |
| 13564 | * @param key name of the key |
| 13565 | * @param data data to associate with that key |
| 13566 | */ |
| 13567 | set_data(key: string, data?: any | null): void; |
| 13568 | /** |
| 13569 | * Sets a property on an object. |
| 13570 | * @param property_name The name of the property to set |
| 13571 | * @param value The value to set the property to |
| 13572 | */ |
| 13573 | set_property(property_name: string, value: GObject.Value | any): void; |
| 13574 | /** |
| 13575 | * Remove a specified datum from the object's data associations, |
| 13576 | * without invoking the association's destroy handler. |
| 13577 | * @param key name of the key |
| 13578 | * @returns the data if found, or %NULL if no such data exists. |
| 13579 | */ |
| 13580 | steal_data(key: string): any | null; |
| 13581 | /** |
| 13582 | * This function gets back user data pointers stored via |
| 13583 | * g_object_set_qdata() and removes the `data` from object |
| 13584 | * without invoking its destroy() function (if any was |
| 13585 | * set). |
| 13586 | * Usually, calling this function is only required to update |
| 13587 | * user data pointers with a destroy notifier, for example: |
| 13588 | * |
| 13589 | * ```c |
| 13590 | * void |
| 13591 | * object_add_to_user_list (GObject *object, |
| 13592 | * const gchar *new_string) |
| 13593 | * { |
| 13594 | * // the quark, naming the object data |
| 13595 | * GQuark quark_string_list = g_quark_from_static_string ("my-string-list"); |
| 13596 | * // retrieve the old string list |
| 13597 | * GList *list = g_object_steal_qdata (object, quark_string_list); |
| 13598 | * |
| 13599 | * // prepend new string |
| 13600 | * list = g_list_prepend (list, g_strdup (new_string)); |
| 13601 | * // this changed 'list', so we need to set it again |
| 13602 | * g_object_set_qdata_full (object, quark_string_list, list, free_string_list); |
| 13603 | * } |
| 13604 | * static void |
| 13605 | * free_string_list (gpointer data) |
| 13606 | * { |
| 13607 | * GList *node, *list = data; |
| 13608 | * |
| 13609 | * for (node = list; node; node = node->next) |
| 13610 | * g_free (node->data); |
| 13611 | * g_list_free (list); |
| 13612 | * } |
| 13613 | * ``` |
| 13614 | * |
| 13615 | * Using g_object_get_qdata() in the above example, instead of |
| 13616 | * g_object_steal_qdata() would have left the destroy function set, |
| 13617 | * and thus the partial string list would have been freed upon |
| 13618 | * g_object_set_qdata_full(). |
| 13619 | * @param quark A #GQuark, naming the user data pointer |
| 13620 | * @returns The user data pointer set, or %NULL |
| 13621 | */ |
| 13622 | steal_qdata(quark: GLib.Quark): any | null; |
| 13623 | /** |
| 13624 | * Reverts the effect of a previous call to |
| 13625 | * g_object_freeze_notify(). The freeze count is decreased on `object` |
| 13626 | * and when it reaches zero, queued "notify" signals are emitted. |
| 13627 | * |
| 13628 | * Duplicate notifications for each property are squashed so that at most one |
| 13629 | * #GObject::notify signal is emitted for each property, in the reverse order |
| 13630 | * in which they have been queued. |
| 13631 | * |
| 13632 | * It is an error to call this function when the freeze count is zero. |
| 13633 | */ |
| 13634 | thaw_notify(): void; |
| 13635 | /** |
| 13636 | * Decreases the reference count of `object`. When its reference count |
| 13637 | * drops to 0, the object is finalized (i.e. its memory is freed). |
| 13638 | * |
| 13639 | * If the pointer to the #GObject may be reused in future (for example, if it is |
| 13640 | * an instance variable of another object), it is recommended to clear the |
| 13641 | * pointer to %NULL rather than retain a dangling pointer to a potentially |
| 13642 | * invalid #GObject instance. Use g_clear_object() for this. |
| 13643 | */ |
| 13644 | unref(): void; |
| 13645 | /** |
| 13646 | * This function essentially limits the life time of the `closure` to |
| 13647 | * the life time of the object. That is, when the object is finalized, |
| 13648 | * the `closure` is invalidated by calling g_closure_invalidate() on |
| 13649 | * it, in order to prevent invocations of the closure with a finalized |
| 13650 | * (nonexisting) object. Also, g_object_ref() and g_object_unref() are |
| 13651 | * added as marshal guards to the `closure,` to ensure that an extra |
| 13652 | * reference count is held on `object` during invocation of the |
| 13653 | * `closure`. Usually, this function will be called on closures that |
| 13654 | * use this `object` as closure data. |
| 13655 | * @param closure #GClosure to watch |
| 13656 | */ |
| 13657 | watch_closure(closure: GObject.Closure): void; |
| 13658 | /** |
| 13659 | * the `constructed` function is called by g_object_new() as the |
| 13660 | * final step of the object creation process. At the point of the call, all |
| 13661 | * construction properties have been set on the object. The purpose of this |
| 13662 | * call is to allow for object initialisation steps that can only be performed |
| 13663 | * after construction properties have been set. `constructed` implementors |
| 13664 | * should chain up to the `constructed` call of their parent class to allow it |
| 13665 | * to complete its initialisation. |
| 13666 | */ |
| 13667 | vfunc_constructed(): void; |
| 13668 | /** |
| 13669 | * emits property change notification for a bunch |
| 13670 | * of properties. Overriding `dispatch_properties_changed` should be rarely |
| 13671 | * needed. |
| 13672 | * @param n_pspecs |
| 13673 | * @param pspecs |
| 13674 | */ |
| 13675 | vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void; |
| 13676 | /** |
| 13677 | * the `dispose` function is supposed to drop all references to other |
| 13678 | * objects, but keep the instance otherwise intact, so that client method |
| 13679 | * invocations still work. It may be run multiple times (due to reference |
| 13680 | * loops). Before returning, `dispose` should chain up to the `dispose` method |
| 13681 | * of the parent class. |
| 13682 | */ |
| 13683 | vfunc_dispose(): void; |
| 13684 | /** |
| 13685 | * instance finalization function, should finish the finalization of |
| 13686 | * the instance begun in `dispose` and chain up to the `finalize` method of the |
| 13687 | * parent class. |
| 13688 | */ |
| 13689 | vfunc_finalize(): void; |
| 13690 | /** |
| 13691 | * the generic getter for all properties of this type. Should be |
| 13692 | * overridden for every type with properties. |
| 13693 | * @param property_id |
| 13694 | * @param value |
| 13695 | * @param pspec |
| 13696 | */ |
| 13697 | vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void; |
| 13698 | /** |
| 13699 | * Emits a "notify" signal for the property `property_name` on `object`. |
| 13700 | * |
| 13701 | * When possible, eg. when signaling a property change from within the class |
| 13702 | * that registered the property, you should use g_object_notify_by_pspec() |
| 13703 | * instead. |
| 13704 | * |
| 13705 | * Note that emission of the notify signal may be blocked with |
| 13706 | * g_object_freeze_notify(). In this case, the signal emissions are queued |
| 13707 | * and will be emitted (in reverse order) when g_object_thaw_notify() is |
| 13708 | * called. |
| 13709 | * @param pspec |
| 13710 | */ |
| 13711 | vfunc_notify(pspec: GObject.ParamSpec): void; |
| 13712 | /** |
| 13713 | * the generic setter for all properties of this type. Should be |
| 13714 | * overridden for every type with properties. If implementations of |
| 13715 | * `set_property` don't emit property change notification explicitly, this will |
| 13716 | * be done implicitly by the type system. However, if the notify signal is |
| 13717 | * emitted explicitly, the type system will not emit it a second time. |
| 13718 | * @param property_id |
| 13719 | * @param value |
| 13720 | * @param pspec |
| 13721 | */ |
| 13722 | vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void; |
| 13723 | /** |
| 13724 | * Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to. |
| 13725 | * @param id Handler ID of the handler to be disconnected |
| 13726 | */ |
| 13727 | disconnect(id: number): void; |
| 13728 | /** |
| 13729 | * Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values. |
| 13730 | * @param properties Object containing the properties to set |
| 13731 | */ |
| 13732 | set(properties: { [key: string]: any }): void; |
| 13733 | /** |
| 13734 | * Blocks a handler of an instance so it will not be called during any signal emissions |
| 13735 | * @param id Handler ID of the handler to be blocked |
| 13736 | */ |
| 13737 | block_signal_handler(id: number): void; |
| 13738 | /** |
| 13739 | * Unblocks a handler so it will be called again during any signal emissions |
| 13740 | * @param id Handler ID of the handler to be unblocked |
| 13741 | */ |
| 13742 | unblock_signal_handler(id: number): void; |
| 13743 | /** |
| 13744 | * Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked. |
| 13745 | * @param detailedName Name of the signal to stop emission of |
| 13746 | */ |
| 13747 | stop_emission_by_name(detailedName: string): void; |
| 13748 | } |
| 13749 | |
| 13750 | namespace PromptDialog { |
| 13751 | // Constructor properties interface |
| 13752 | |
| 13753 | interface ConstructorProps |
| 13754 | extends Gtk.Dialog.ConstructorProps, |
| 13755 | Atk.ImplementorIface.ConstructorProps, |
| 13756 | Gcr.Prompt.ConstructorProps, |
| 13757 | Gtk.Buildable.ConstructorProps { |
| 13758 | choice_visible: boolean; |
| 13759 | choiceVisible: boolean; |
| 13760 | confirm_visible: boolean; |
| 13761 | confirmVisible: boolean; |
| 13762 | password_visible: boolean; |
| 13763 | passwordVisible: boolean; |
| 13764 | warning_visible: boolean; |
| 13765 | warningVisible: boolean; |
| 13766 | } |
| 13767 | } |
| 13768 | |
| 13769 | /** |
| 13770 | * A [iface`Gcr`.Prompt] implementation which shows a GTK dialog. The dialog |
| 13771 | * will remain visible (but insensitive) between prompts. If the user cancels |
| 13772 | * the dialog between prompts, then the dialog will be hidden. |
| 13773 | */ |
| 13774 | class PromptDialog extends Gtk.Dialog implements Atk.ImplementorIface, Gcr.Prompt, Gtk.Buildable { |
| 13775 | static $gtype: GObject.GType<PromptDialog>; |
| 13776 | |
| 13777 | // Properties |
| 13778 | |
| 13779 | /** |
| 13780 | * Whether the choice check box is visible or not. |
| 13781 | */ |
| 13782 | get choice_visible(): boolean; |
| 13783 | /** |
| 13784 | * Whether the choice check box is visible or not. |
| 13785 | */ |
| 13786 | get choiceVisible(): boolean; |
| 13787 | /** |
| 13788 | * Whether the password confirm entry is visible or not. |
| 13789 | */ |
| 13790 | get confirm_visible(): boolean; |
| 13791 | /** |
| 13792 | * Whether the password confirm entry is visible or not. |
| 13793 | */ |
| 13794 | get confirmVisible(): boolean; |
| 13795 | /** |
| 13796 | * Whether the password entry is visible or not. |
| 13797 | */ |
| 13798 | get password_visible(): boolean; |
| 13799 | /** |
| 13800 | * Whether the password entry is visible or not. |
| 13801 | */ |
| 13802 | get passwordVisible(): boolean; |
| 13803 | /** |
| 13804 | * Whether the warning label is visible or not. |
| 13805 | */ |
| 13806 | get warning_visible(): boolean; |
| 13807 | /** |
| 13808 | * Whether the warning label is visible or not. |
| 13809 | */ |
| 13810 | get warningVisible(): boolean; |
| 13811 | |
| 13812 | // Constructors |
| 13813 | |
| 13814 | constructor(properties?: Partial<PromptDialog.ConstructorProps>, ...args: any[]); |
| 13815 | |
| 13816 | _init(...args: any[]): void; |
| 13817 | |
| 13818 | // Inherited properties |
| 13819 | /** |
| 13820 | * The string handle of the caller's window. |
| 13821 | * |
| 13822 | * The caller window indicates to the prompt which window is prompting the |
| 13823 | * user. The prompt may choose to ignore this information or use it in whatever |
| 13824 | * way it sees fit. |
| 13825 | * |
| 13826 | * In X11, this will be a stringified version of the XWindow handle; in |
| 13827 | * Wayland this is the result of an export using the XDG foreign |
| 13828 | * protocol. |
| 13829 | */ |
| 13830 | get caller_window(): string; |
| 13831 | set caller_window(val: string); |
| 13832 | /** |
| 13833 | * The string handle of the caller's window. |
| 13834 | * |
| 13835 | * The caller window indicates to the prompt which window is prompting the |
| 13836 | * user. The prompt may choose to ignore this information or use it in whatever |
| 13837 | * way it sees fit. |
| 13838 | * |
| 13839 | * In X11, this will be a stringified version of the XWindow handle; in |
| 13840 | * Wayland this is the result of an export using the XDG foreign |
| 13841 | * protocol. |
| 13842 | */ |
| 13843 | get callerWindow(): string; |
| 13844 | set callerWindow(val: string); |
| 13845 | /** |
| 13846 | * The label for the cancel button in the prompt. |
| 13847 | */ |
| 13848 | get cancel_label(): string; |
| 13849 | set cancel_label(val: string); |
| 13850 | /** |
| 13851 | * The label for the cancel button in the prompt. |
| 13852 | */ |
| 13853 | get cancelLabel(): string; |
| 13854 | set cancelLabel(val: string); |
| 13855 | /** |
| 13856 | * Whether the additional choice is chosen or not. |
| 13857 | * |
| 13858 | * The additional choice would have been setup using #GcrPrompt:choice-label. |
| 13859 | */ |
| 13860 | get choice_chosen(): boolean; |
| 13861 | set choice_chosen(val: boolean); |
| 13862 | /** |
| 13863 | * Whether the additional choice is chosen or not. |
| 13864 | * |
| 13865 | * The additional choice would have been setup using #GcrPrompt:choice-label. |
| 13866 | */ |
| 13867 | get choiceChosen(): boolean; |
| 13868 | set choiceChosen(val: boolean); |
| 13869 | /** |
| 13870 | * The label for the additional choice. |
| 13871 | * |
| 13872 | * If this is a non-%NULL value then an additional boolean choice will be |
| 13873 | * displayed by the prompt allowing the user to select or deselect it. |
| 13874 | * |
| 13875 | * If %NULL, then no additional choice is displayed. |
| 13876 | * |
| 13877 | * The initial value of the choice can be set with #GcrPrompt:choice-chosen. |
| 13878 | */ |
| 13879 | get choice_label(): string; |
| 13880 | set choice_label(val: string); |
| 13881 | /** |
| 13882 | * The label for the additional choice. |
| 13883 | * |
| 13884 | * If this is a non-%NULL value then an additional boolean choice will be |
| 13885 | * displayed by the prompt allowing the user to select or deselect it. |
| 13886 | * |
| 13887 | * If %NULL, then no additional choice is displayed. |
| 13888 | * |
| 13889 | * The initial value of the choice can be set with #GcrPrompt:choice-chosen. |
| 13890 | */ |
| 13891 | get choiceLabel(): string; |
| 13892 | set choiceLabel(val: string); |
| 13893 | /** |
| 13894 | * The label for the continue button in the prompt. |
| 13895 | */ |
| 13896 | get continue_label(): string; |
| 13897 | set continue_label(val: string); |
| 13898 | /** |
| 13899 | * The label for the continue button in the prompt. |
| 13900 | */ |
| 13901 | get continueLabel(): string; |
| 13902 | set continueLabel(val: string); |
| 13903 | /** |
| 13904 | * The detailed description of the prompt. |
| 13905 | * |
| 13906 | * A prompt implementation may choose not to display this detailed description. |
| 13907 | * The prompt message should contain relevant information. |
| 13908 | */ |
| 13909 | get description(): string; |
| 13910 | set description(val: string); |
| 13911 | /** |
| 13912 | * The prompt message for the user. |
| 13913 | * |
| 13914 | * A prompt implementation should always display this message. |
| 13915 | */ |
| 13916 | get message(): string; |
| 13917 | set message(val: string); |
| 13918 | /** |
| 13919 | * Whether the prompt will prompt for a new password. |
| 13920 | * |
| 13921 | * This will cause the prompt implementation to ask the user to confirm the |
| 13922 | * password and/or display other relevant user interface for creating a new |
| 13923 | * password. |
| 13924 | */ |
| 13925 | get password_new(): boolean; |
| 13926 | set password_new(val: boolean); |
| 13927 | /** |
| 13928 | * Whether the prompt will prompt for a new password. |
| 13929 | * |
| 13930 | * This will cause the prompt implementation to ask the user to confirm the |
| 13931 | * password and/or display other relevant user interface for creating a new |
| 13932 | * password. |
| 13933 | */ |
| 13934 | get passwordNew(): boolean; |
| 13935 | set passwordNew(val: boolean); |
| 13936 | /** |
| 13937 | * Indication of the password strength. |
| 13938 | * |
| 13939 | * Prompts will return a zero value if the password is empty, and a value |
| 13940 | * greater than zero if the password has any characters. |
| 13941 | * |
| 13942 | * This is only valid after a successful prompt for a password. |
| 13943 | */ |
| 13944 | get password_strength(): number; |
| 13945 | /** |
| 13946 | * Indication of the password strength. |
| 13947 | * |
| 13948 | * Prompts will return a zero value if the password is empty, and a value |
| 13949 | * greater than zero if the password has any characters. |
| 13950 | * |
| 13951 | * This is only valid after a successful prompt for a password. |
| 13952 | */ |
| 13953 | get passwordStrength(): number; |
| 13954 | /** |
| 13955 | * The title of the prompt. |
| 13956 | * |
| 13957 | * A prompt implementation may choose not to display the prompt title. The |
| 13958 | * #GcrPrompt:message should contain relevant information. |
| 13959 | */ |
| 13960 | get title(): string; |
| 13961 | set title(val: string); |
| 13962 | /** |
| 13963 | * A prompt warning displayed on the prompt, or %NULL for no warning. |
| 13964 | * |
| 13965 | * This is a warning like "The password is incorrect." usually displayed to the |
| 13966 | * user about a previous 'unsuccessful' prompt. |
| 13967 | */ |
| 13968 | get warning(): string; |
| 13969 | set warning(val: string); |
| 13970 | |
| 13971 | // Inherited methods |
| 13972 | /** |
| 13973 | * Closes the prompt so that in can no longer be used to prompt. The various |
| 13974 | * prompt methods will return results as if the user dismissed the prompt. |
| 13975 | * |
| 13976 | * The prompt may also be closed by the implementor of the prompt object. |
| 13977 | * |
| 13978 | * This emits the [signal`Prompt:`:prompt-close] signal on the prompt object. |
| 13979 | */ |
| 13980 | close(): void; |
| 13981 | /** |
| 13982 | * Prompts for confirmation asking a cancel/continue style question. |
| 13983 | * Set the various properties on the prompt before calling this function to |
| 13984 | * represent the question correctly. |
| 13985 | * |
| 13986 | * This method will block until the a response is returned from the prompter. |
| 13987 | * |
| 13988 | * %GCR_PROMPT_REPLY_CONTINUE will be returned if the user confirms the prompt. The |
| 13989 | * return value will also be %GCR_PROMPT_REPLY_CANCEL if the user cancels or if |
| 13990 | * an error occurs. Check the `error` argument to tell the difference. |
| 13991 | * @param cancellable optional cancellation object |
| 13992 | * @returns the reply from the prompt |
| 13993 | */ |
| 13994 | confirm(cancellable?: Gio.Cancellable | null): Gcr.PromptReply; |
| 13995 | /** |
| 13996 | * Prompts for confirmation asking a cancel/continue style question. |
| 13997 | * Set the various properties on the prompt before calling this method to |
| 13998 | * represent the question correctly. |
| 13999 | * |
| 14000 | * This method will return immediately and complete asynchronously. |
| 14001 | * @param cancellable optional cancellation object |
| 14002 | */ |
| 14003 | confirm_async(cancellable?: Gio.Cancellable | null): Promise<Gcr.PromptReply>; |
| 14004 | /** |
| 14005 | * Prompts for confirmation asking a cancel/continue style question. |
| 14006 | * Set the various properties on the prompt before calling this method to |
| 14007 | * represent the question correctly. |
| 14008 | * |
| 14009 | * This method will return immediately and complete asynchronously. |
| 14010 | * @param cancellable optional cancellation object |
| 14011 | * @param callback called when the operation completes |
| 14012 | */ |
| 14013 | confirm_async(cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<this> | null): void; |
| 14014 | /** |
| 14015 | * Prompts for confirmation asking a cancel/continue style question. |
| 14016 | * Set the various properties on the prompt before calling this method to |
| 14017 | * represent the question correctly. |
| 14018 | * |
| 14019 | * This method will return immediately and complete asynchronously. |
| 14020 | * @param cancellable optional cancellation object |
| 14021 | * @param callback called when the operation completes |
| 14022 | */ |
| 14023 | confirm_async( |
| 14024 | cancellable?: Gio.Cancellable | null, |
| 14025 | callback?: Gio.AsyncReadyCallback<this> | null, |
| 14026 | ): Promise<Gcr.PromptReply> | void; |
| 14027 | /** |
| 14028 | * Complete an operation to prompt for confirmation. |
| 14029 | * |
| 14030 | * %GCR_PROMPT_REPLY_CONTINUE will be returned if the user confirms the prompt. The |
| 14031 | * return value will also be %GCR_PROMPT_REPLY_CANCEL if the user cancels or if |
| 14032 | * an error occurs. Check the `error` argument to tell the difference. |
| 14033 | * @param result asynchronous result passed to callback |
| 14034 | * @returns the reply from the prompt |
| 14035 | */ |
| 14036 | confirm_finish(result: Gio.AsyncResult): Gcr.PromptReply; |
| 14037 | /** |
| 14038 | * Prompts for confirmation asking a cancel/continue style question. |
| 14039 | * Set the various properties on the prompt before calling this function to |
| 14040 | * represent the question correctly. |
| 14041 | * |
| 14042 | * This method will block until the a response is returned from the prompter |
| 14043 | * and will run a main loop similar to a `gtk_dialog_run()`. The application |
| 14044 | * will remain responsive but care must be taken to handle reentrancy issues. |
| 14045 | * |
| 14046 | * %GCR_PROMPT_REPLY_CONTINUE will be returned if the user confirms the prompt. The |
| 14047 | * return value will also be %GCR_PROMPT_REPLY_CANCEL if the user cancels or if |
| 14048 | * an error occurs. Check the `error` argument to tell the difference. |
| 14049 | * @param cancellable optional cancellation object |
| 14050 | * @returns the reply from the prompt |
| 14051 | */ |
| 14052 | confirm_run(cancellable?: Gio.Cancellable | null): Gcr.PromptReply; |
| 14053 | /** |
| 14054 | * Get the string handle of the caller's window. |
| 14055 | * |
| 14056 | * The caller window indicates to the prompt which window is prompting the |
| 14057 | * user. The prompt may choose to ignore this information or use it in whatever |
| 14058 | * way it sees fit. |
| 14059 | * @returns a newly allocated string containing the string handle of the window. |
| 14060 | */ |
| 14061 | get_caller_window(): string; |
| 14062 | /** |
| 14063 | * Get the label for the cancel button. |
| 14064 | * |
| 14065 | * This is the button that results in a %GCR_PROMPT_REPLY_CANCEL reply |
| 14066 | * from the prompt. |
| 14067 | * @returns a newly allocated string containing the label |
| 14068 | */ |
| 14069 | get_cancel_label(): string; |
| 14070 | /** |
| 14071 | * Get whether the additional choice was chosen or not. |
| 14072 | * |
| 14073 | * The additional choice would have been setup using |
| 14074 | * gcr_prompt_set_choice_label(). |
| 14075 | * @returns whether chosen |
| 14076 | */ |
| 14077 | get_choice_chosen(): boolean; |
| 14078 | /** |
| 14079 | * Get the label for the additional choice. |
| 14080 | * |
| 14081 | * This will be %NULL if no additional choice is being displayed. |
| 14082 | * @returns a newly allocated string containing the additional choice or %NULL |
| 14083 | */ |
| 14084 | get_choice_label(): string; |
| 14085 | /** |
| 14086 | * Get the label for the continue button. |
| 14087 | * |
| 14088 | * This is the button that results in a %GCR_PROMPT_REPLY_CONTINUE reply |
| 14089 | * from the prompt. |
| 14090 | * @returns a newly allocated string containing the label |
| 14091 | */ |
| 14092 | get_continue_label(): string; |
| 14093 | /** |
| 14094 | * Get the detailed description of the prompt. |
| 14095 | * |
| 14096 | * A prompt implementation may choose not to display this detailed description. |
| 14097 | * The prompt message should contain relevant information. |
| 14098 | * @returns a newly allocated string containing the detailed description of the prompt |
| 14099 | */ |
| 14100 | get_description(): string; |
| 14101 | /** |
| 14102 | * Gets the prompt message for the user. |
| 14103 | * |
| 14104 | * A prompt implementation should always display this message. |
| 14105 | * @returns a newly allocated string containing the detailed description of the prompt |
| 14106 | */ |
| 14107 | get_message(): string; |
| 14108 | /** |
| 14109 | * Get whether the prompt will prompt for a new password. |
| 14110 | * |
| 14111 | * This will cause the prompt implementation to ask the user to confirm the |
| 14112 | * password and/or display other relevant user interface for creating a new |
| 14113 | * password. |
| 14114 | * @returns whether in new password mode or not |
| 14115 | */ |
| 14116 | get_password_new(): boolean; |
| 14117 | /** |
| 14118 | * Get indication of the password strength. |
| 14119 | * |
| 14120 | * Prompts will return a zero value if the password is empty, and a value |
| 14121 | * greater than zero if the password has any characters. |
| 14122 | * |
| 14123 | * This is only valid after a successful prompt for a password. |
| 14124 | * @returns zero if the password is empty, greater than zero if not |
| 14125 | */ |
| 14126 | get_password_strength(): number; |
| 14127 | /** |
| 14128 | * Gets the title of the prompt. |
| 14129 | * |
| 14130 | * A prompt implementation may choose not to display the prompt title. The |
| 14131 | * prompt message should contain relevant information. |
| 14132 | * @returns a newly allocated string containing the prompt title. |
| 14133 | */ |
| 14134 | get_title(): string; |
| 14135 | // Conflicted with Gtk.Window.get_title |
| 14136 | get_title(...args: never[]): any; |
| 14137 | /** |
| 14138 | * Get a prompt warning displayed on the prompt. |
| 14139 | * |
| 14140 | * This is a warning like "The password is incorrect." usually displayed to the |
| 14141 | * user about a previous 'unsuccessful' prompt. |
| 14142 | * |
| 14143 | * If this string is %NULL then no warning is displayed. |
| 14144 | * @returns a newly allocated string containing the prompt warning, or %NULL if no warning |
| 14145 | */ |
| 14146 | get_warning(): string; |
| 14147 | /** |
| 14148 | * Prompts for password. Set the various properties on the prompt before calling |
| 14149 | * this method to explain which password should be entered. |
| 14150 | * |
| 14151 | * This method will block until the a response is returned from the prompter. |
| 14152 | * |
| 14153 | * A password will be returned if the user enters a password successfully. |
| 14154 | * The returned password is valid until the next time a method is called |
| 14155 | * to display another prompt. |
| 14156 | * |
| 14157 | * %NULL will be returned if the user cancels or if an error occurs. Check the |
| 14158 | * `error` argument to tell the difference. |
| 14159 | * @param cancellable optional cancellation object |
| 14160 | * @returns the password owned by the prompt, or %NULL |
| 14161 | */ |
| 14162 | password(cancellable?: Gio.Cancellable | null): string; |
| 14163 | /** |
| 14164 | * Prompts for password. Set the various properties on the prompt before calling |
| 14165 | * this method to explain which password should be entered. |
| 14166 | * |
| 14167 | * This method will return immediately and complete asynchronously. |
| 14168 | * @param cancellable optional cancellation object |
| 14169 | */ |
| 14170 | password_async(cancellable?: Gio.Cancellable | null): Promise<string>; |
| 14171 | /** |
| 14172 | * Prompts for password. Set the various properties on the prompt before calling |
| 14173 | * this method to explain which password should be entered. |
| 14174 | * |
| 14175 | * This method will return immediately and complete asynchronously. |
| 14176 | * @param cancellable optional cancellation object |
| 14177 | * @param callback called when the operation completes |
| 14178 | */ |
| 14179 | password_async(cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<this> | null): void; |
| 14180 | /** |
| 14181 | * Prompts for password. Set the various properties on the prompt before calling |
| 14182 | * this method to explain which password should be entered. |
| 14183 | * |
| 14184 | * This method will return immediately and complete asynchronously. |
| 14185 | * @param cancellable optional cancellation object |
| 14186 | * @param callback called when the operation completes |
| 14187 | */ |
| 14188 | password_async( |
| 14189 | cancellable?: Gio.Cancellable | null, |
| 14190 | callback?: Gio.AsyncReadyCallback<this> | null, |
| 14191 | ): Promise<string> | void; |
| 14192 | /** |
| 14193 | * Complete an operation to prompt for a password. |
| 14194 | * |
| 14195 | * A password will be returned if the user enters a password successfully. |
| 14196 | * The returned password is valid until the next time a method is called |
| 14197 | * to display another prompt. |
| 14198 | * |
| 14199 | * %NULL will be returned if the user cancels or if an error occurs. Check the |
| 14200 | * `error` argument to tell the difference. |
| 14201 | * @param result asynchronous result passed to callback |
| 14202 | * @returns the password owned by the prompt, or %NULL |
| 14203 | */ |
| 14204 | password_finish(result: Gio.AsyncResult): string; |
| 14205 | /** |
| 14206 | * Prompts for password. Set the various properties on the prompt before calling |
| 14207 | * this method to explain which password should be entered. |
| 14208 | * |
| 14209 | * This method will block until the a response is returned from the prompter |
| 14210 | * and will run a main loop similar to a gtk_dialog_run(). The application |
| 14211 | * will remain responsive but care must be taken to handle reentrancy issues. |
| 14212 | * |
| 14213 | * A password will be returned if the user enters a password successfully. |
| 14214 | * The returned password is valid until the next time a method is called |
| 14215 | * to display another prompt. |
| 14216 | * |
| 14217 | * %NULL will be returned if the user cancels or if an error occurs. Check the |
| 14218 | * `error` argument to tell the difference. |
| 14219 | * @param cancellable optional cancellation object |
| 14220 | * @returns the password owned by the prompt, or %NULL |
| 14221 | */ |
| 14222 | password_run(cancellable?: Gio.Cancellable | null): string; |
| 14223 | /** |
| 14224 | * Reset the contents and properties of the prompt. |
| 14225 | */ |
| 14226 | reset(): void; |
| 14227 | /** |
| 14228 | * Set the string handle of the caller's window. |
| 14229 | * |
| 14230 | * The caller window indicates to the prompt which window is prompting the |
| 14231 | * user. The prompt may choose to ignore this information or use it in whatever |
| 14232 | * way it sees fit. |
| 14233 | * @param window_id the window id |
| 14234 | */ |
| 14235 | set_caller_window(window_id: string): void; |
| 14236 | /** |
| 14237 | * Set the label for the continue button. |
| 14238 | * |
| 14239 | * This is the button that results in a %GCR_PROMPT_REPLY_CANCEL reply |
| 14240 | * from the prompt. |
| 14241 | * @param cancel_label the label |
| 14242 | */ |
| 14243 | set_cancel_label(cancel_label: string): void; |
| 14244 | /** |
| 14245 | * Set whether the additional choice is chosen or not. |
| 14246 | * |
| 14247 | * The additional choice should be set up using gcr_prompt_set_choice_label(). |
| 14248 | * @param chosen whether chosen |
| 14249 | */ |
| 14250 | set_choice_chosen(chosen: boolean): void; |
| 14251 | /** |
| 14252 | * Set the label for the additional choice. |
| 14253 | * |
| 14254 | * If this is a non-%NULL value then an additional boolean choice will be |
| 14255 | * displayed by the prompt allowing the user to select or deselect it. |
| 14256 | * |
| 14257 | * The initial value of the choice can be set with the |
| 14258 | * gcr_prompt_set_choice_label() method. |
| 14259 | * |
| 14260 | * If this is %NULL, then no additional choice is being displayed. |
| 14261 | * @param choice_label the additional choice or %NULL |
| 14262 | */ |
| 14263 | set_choice_label(choice_label?: string | null): void; |
| 14264 | /** |
| 14265 | * Set the label for the continue button. |
| 14266 | * |
| 14267 | * This is the button that results in a %GCR_PROMPT_REPLY_CONTINUE reply |
| 14268 | * from the prompt. |
| 14269 | * @param continue_label the label |
| 14270 | */ |
| 14271 | set_continue_label(continue_label: string): void; |
| 14272 | /** |
| 14273 | * Set the detailed description of the prompt. |
| 14274 | * |
| 14275 | * A prompt implementation may choose not to display this detailed description. |
| 14276 | * Use gcr_prompt_set_message() to set a general message containing relevant |
| 14277 | * information. |
| 14278 | * @param description the detailed description |
| 14279 | */ |
| 14280 | set_description(description: string): void; |
| 14281 | /** |
| 14282 | * Sets the prompt message for the user. |
| 14283 | * |
| 14284 | * A prompt implementation should always display this message. |
| 14285 | * @param message the prompt message |
| 14286 | */ |
| 14287 | set_message(message: string): void; |
| 14288 | /** |
| 14289 | * Set whether the prompt will prompt for a new password. |
| 14290 | * |
| 14291 | * This will cause the prompt implementation to ask the user to confirm the |
| 14292 | * password and/or display other relevant user interface for creating a new |
| 14293 | * password. |
| 14294 | * @param new_password whether in new password mode or not |
| 14295 | */ |
| 14296 | set_password_new(new_password: boolean): void; |
| 14297 | /** |
| 14298 | * Sets the title of the prompt. |
| 14299 | * |
| 14300 | * A prompt implementation may choose not to display the prompt title. The |
| 14301 | * prompt message should contain relevant information. |
| 14302 | * @param title the prompt title |
| 14303 | */ |
| 14304 | set_title(title: string): void; |
| 14305 | /** |
| 14306 | * Set a prompt warning displayed on the prompt. |
| 14307 | * |
| 14308 | * This is a warning like "The password is incorrect." usually displayed to the |
| 14309 | * user about a previous 'unsuccessful' prompt. |
| 14310 | * |
| 14311 | * If this string is %NULL then no warning is displayed. |
| 14312 | * @param warning the warning or %NULL |
| 14313 | */ |
| 14314 | set_warning(warning?: string | null): void; |
| 14315 | /** |
| 14316 | * close a prompt |
| 14317 | */ |
| 14318 | vfunc_prompt_close(): void; |
| 14319 | /** |
| 14320 | * Prompts for confirmation asking a cancel/continue style question. |
| 14321 | * Set the various properties on the prompt before calling this method to |
| 14322 | * represent the question correctly. |
| 14323 | * |
| 14324 | * This method will return immediately and complete asynchronously. |
| 14325 | * @param cancellable optional cancellation object |
| 14326 | * @param callback called when the operation completes |
| 14327 | */ |
| 14328 | vfunc_prompt_confirm_async( |
| 14329 | cancellable?: Gio.Cancellable | null, |
| 14330 | callback?: Gio.AsyncReadyCallback<this> | null, |
| 14331 | ): void; |
| 14332 | /** |
| 14333 | * Complete an operation to prompt for confirmation. |
| 14334 | * |
| 14335 | * %GCR_PROMPT_REPLY_CONTINUE will be returned if the user confirms the prompt. The |
| 14336 | * return value will also be %GCR_PROMPT_REPLY_CANCEL if the user cancels or if |
| 14337 | * an error occurs. Check the `error` argument to tell the difference. |
| 14338 | * @param result asynchronous result passed to callback |
| 14339 | */ |
| 14340 | vfunc_prompt_confirm_finish(result: Gio.AsyncResult): Gcr.PromptReply; |
| 14341 | /** |
| 14342 | * Prompts for password. Set the various properties on the prompt before calling |
| 14343 | * this method to explain which password should be entered. |
| 14344 | * |
| 14345 | * This method will return immediately and complete asynchronously. |
| 14346 | * @param cancellable optional cancellation object |
| 14347 | * @param callback called when the operation completes |
| 14348 | */ |
| 14349 | vfunc_prompt_password_async( |
| 14350 | cancellable?: Gio.Cancellable | null, |
| 14351 | callback?: Gio.AsyncReadyCallback<this> | null, |
| 14352 | ): void; |
| 14353 | /** |
| 14354 | * Complete an operation to prompt for a password. |
| 14355 | * |
| 14356 | * A password will be returned if the user enters a password successfully. |
| 14357 | * The returned password is valid until the next time a method is called |
| 14358 | * to display another prompt. |
| 14359 | * |
| 14360 | * %NULL will be returned if the user cancels or if an error occurs. Check the |
| 14361 | * `error` argument to tell the difference. |
| 14362 | * @param result asynchronous result passed to callback |
| 14363 | */ |
| 14364 | vfunc_prompt_password_finish(result: Gio.AsyncResult): string; |
| 14365 | /** |
| 14366 | * Creates a binding between `source_property` on `source` and `target_property` |
| 14367 | * on `target`. |
| 14368 | * |
| 14369 | * Whenever the `source_property` is changed the `target_property` is |
| 14370 | * updated using the same value. For instance: |
| 14371 | * |
| 14372 | * |
| 14373 | * ```c |
| 14374 | * g_object_bind_property (action, "active", widget, "sensitive", 0); |
| 14375 | * ``` |
| 14376 | * |
| 14377 | * |
| 14378 | * Will result in the "sensitive" property of the widget #GObject instance to be |
| 14379 | * updated with the same value of the "active" property of the action #GObject |
| 14380 | * instance. |
| 14381 | * |
| 14382 | * If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual: |
| 14383 | * if `target_property` on `target` changes then the `source_property` on `source` |
| 14384 | * will be updated as well. |
| 14385 | * |
| 14386 | * The binding will automatically be removed when either the `source` or the |
| 14387 | * `target` instances are finalized. To remove the binding without affecting the |
| 14388 | * `source` and the `target` you can just call g_object_unref() on the returned |
| 14389 | * #GBinding instance. |
| 14390 | * |
| 14391 | * Removing the binding by calling g_object_unref() on it must only be done if |
| 14392 | * the binding, `source` and `target` are only used from a single thread and it |
| 14393 | * is clear that both `source` and `target` outlive the binding. Especially it |
| 14394 | * is not safe to rely on this if the binding, `source` or `target` can be |
| 14395 | * finalized from different threads. Keep another reference to the binding and |
| 14396 | * use g_binding_unbind() instead to be on the safe side. |
| 14397 | * |
| 14398 | * A #GObject can have multiple bindings. |
| 14399 | * @param source_property the property on @source to bind |
| 14400 | * @param target the target #GObject |
| 14401 | * @param target_property the property on @target to bind |
| 14402 | * @param flags flags to pass to #GBinding |
| 14403 | * @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero. |
| 14404 | */ |
| 14405 | bind_property( |
| 14406 | source_property: string, |
| 14407 | target: GObject.Object, |
| 14408 | target_property: string, |
| 14409 | flags: GObject.BindingFlags | null, |
| 14410 | ): GObject.Binding; |
| 14411 | /** |
| 14412 | * Complete version of g_object_bind_property(). |
| 14413 | * |
| 14414 | * Creates a binding between `source_property` on `source` and `target_property` |
| 14415 | * on `target,` allowing you to set the transformation functions to be used by |
| 14416 | * the binding. |
| 14417 | * |
| 14418 | * If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual: |
| 14419 | * if `target_property` on `target` changes then the `source_property` on `source` |
| 14420 | * will be updated as well. The `transform_from` function is only used in case |
| 14421 | * of bidirectional bindings, otherwise it will be ignored |
| 14422 | * |
| 14423 | * The binding will automatically be removed when either the `source` or the |
| 14424 | * `target` instances are finalized. This will release the reference that is |
| 14425 | * being held on the #GBinding instance; if you want to hold on to the |
| 14426 | * #GBinding instance, you will need to hold a reference to it. |
| 14427 | * |
| 14428 | * To remove the binding, call g_binding_unbind(). |
| 14429 | * |
| 14430 | * A #GObject can have multiple bindings. |
| 14431 | * |
| 14432 | * The same `user_data` parameter will be used for both `transform_to` |
| 14433 | * and `transform_from` transformation functions; the `notify` function will |
| 14434 | * be called once, when the binding is removed. If you need different data |
| 14435 | * for each transformation function, please use |
| 14436 | * g_object_bind_property_with_closures() instead. |
| 14437 | * @param source_property the property on @source to bind |
| 14438 | * @param target the target #GObject |
| 14439 | * @param target_property the property on @target to bind |
| 14440 | * @param flags flags to pass to #GBinding |
| 14441 | * @param transform_to the transformation function from the @source to the @target, or %NULL to use the default |
| 14442 | * @param transform_from the transformation function from the @target to the @source, or %NULL to use the default |
| 14443 | * @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required |
| 14444 | * @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero. |
| 14445 | */ |
| 14446 | bind_property_full( |
| 14447 | source_property: string, |
| 14448 | target: GObject.Object, |
| 14449 | target_property: string, |
| 14450 | flags: GObject.BindingFlags | null, |
| 14451 | transform_to?: GObject.BindingTransformFunc | null, |
| 14452 | transform_from?: GObject.BindingTransformFunc | null, |
| 14453 | notify?: GLib.DestroyNotify | null, |
| 14454 | ): GObject.Binding; |
| 14455 | // Conflicted with GObject.Object.bind_property_full |
| 14456 | bind_property_full(...args: never[]): any; |
| 14457 | /** |
| 14458 | * This function is intended for #GObject implementations to re-enforce |
| 14459 | * a [floating][floating-ref] object reference. Doing this is seldom |
| 14460 | * required: all #GInitiallyUnowneds are created with a floating reference |
| 14461 | * which usually just needs to be sunken by calling g_object_ref_sink(). |
| 14462 | */ |
| 14463 | force_floating(): void; |
| 14464 | /** |
| 14465 | * Increases the freeze count on `object`. If the freeze count is |
| 14466 | * non-zero, the emission of "notify" signals on `object` is |
| 14467 | * stopped. The signals are queued until the freeze count is decreased |
| 14468 | * to zero. Duplicate notifications are squashed so that at most one |
| 14469 | * #GObject::notify signal is emitted for each property modified while the |
| 14470 | * object is frozen. |
| 14471 | * |
| 14472 | * This is necessary for accessors that modify multiple properties to prevent |
| 14473 | * premature notification while the object is still being modified. |
| 14474 | */ |
| 14475 | freeze_notify(): void; |
| 14476 | /** |
| 14477 | * Gets a named field from the objects table of associations (see g_object_set_data()). |
| 14478 | * @param key name of the key for that association |
| 14479 | * @returns the data if found, or %NULL if no such data exists. |
| 14480 | */ |
| 14481 | get_data(key: string): any | null; |
| 14482 | /** |
| 14483 | * Gets a property of an object. |
| 14484 | * |
| 14485 | * The value can be: |
| 14486 | * - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60) |
| 14487 | * - a GObject.Value initialized with the expected type of the property |
| 14488 | * - a GObject.Value initialized with a type to which the expected type of the property can be transformed |
| 14489 | * |
| 14490 | * In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset. |
| 14491 | * |
| 14492 | * Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming. |
| 14493 | * @param property_name The name of the property to get |
| 14494 | * @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type |
| 14495 | */ |
| 14496 | get_property(property_name: string, value: GObject.Value | any): any; |
| 14497 | /** |
| 14498 | * This function gets back user data pointers stored via |
| 14499 | * g_object_set_qdata(). |
| 14500 | * @param quark A #GQuark, naming the user data pointer |
| 14501 | * @returns The user data pointer set, or %NULL |
| 14502 | */ |
| 14503 | get_qdata(quark: GLib.Quark): any | null; |
| 14504 | /** |
| 14505 | * Gets `n_properties` properties for an `object`. |
| 14506 | * Obtained properties will be set to `values`. All properties must be valid. |
| 14507 | * Warnings will be emitted and undefined behaviour may result if invalid |
| 14508 | * properties are passed in. |
| 14509 | * @param names the names of each property to get |
| 14510 | * @param values the values of each property to get |
| 14511 | */ |
| 14512 | getv(names: string[], values: (GObject.Value | any)[]): void; |
| 14513 | /** |
| 14514 | * Checks whether `object` has a [floating][floating-ref] reference. |
| 14515 | * @returns %TRUE if @object has a floating reference |
| 14516 | */ |
| 14517 | is_floating(): boolean; |
| 14518 | /** |
| 14519 | * Emits a "notify" signal for the property `property_name` on `object`. |
| 14520 | * |
| 14521 | * When possible, eg. when signaling a property change from within the class |
| 14522 | * that registered the property, you should use g_object_notify_by_pspec() |
| 14523 | * instead. |
| 14524 | * |
| 14525 | * Note that emission of the notify signal may be blocked with |
| 14526 | * g_object_freeze_notify(). In this case, the signal emissions are queued |
| 14527 | * and will be emitted (in reverse order) when g_object_thaw_notify() is |
| 14528 | * called. |
| 14529 | * @param property_name the name of a property installed on the class of @object. |
| 14530 | */ |
| 14531 | notify(property_name: string): void; |
| 14532 | /** |
| 14533 | * Emits a "notify" signal for the property specified by `pspec` on `object`. |
| 14534 | * |
| 14535 | * This function omits the property name lookup, hence it is faster than |
| 14536 | * g_object_notify(). |
| 14537 | * |
| 14538 | * One way to avoid using g_object_notify() from within the |
| 14539 | * class that registered the properties, and using g_object_notify_by_pspec() |
| 14540 | * instead, is to store the GParamSpec used with |
| 14541 | * g_object_class_install_property() inside a static array, e.g.: |
| 14542 | * |
| 14543 | * |
| 14544 | * ```c |
| 14545 | * typedef enum |
| 14546 | * { |
| 14547 | * PROP_FOO = 1, |
| 14548 | * PROP_LAST |
| 14549 | * } MyObjectProperty; |
| 14550 | * |
| 14551 | * static GParamSpec *properties[PROP_LAST]; |
| 14552 | * |
| 14553 | * static void |
| 14554 | * my_object_class_init (MyObjectClass *klass) |
| 14555 | * { |
| 14556 | * properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL, |
| 14557 | * 0, 100, |
| 14558 | * 50, |
| 14559 | * G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); |
| 14560 | * g_object_class_install_property (gobject_class, |
| 14561 | * PROP_FOO, |
| 14562 | * properties[PROP_FOO]); |
| 14563 | * } |
| 14564 | * ``` |
| 14565 | * |
| 14566 | * |
| 14567 | * and then notify a change on the "foo" property with: |
| 14568 | * |
| 14569 | * |
| 14570 | * ```c |
| 14571 | * g_object_notify_by_pspec (self, properties[PROP_FOO]); |
| 14572 | * ``` |
| 14573 | * |
| 14574 | * @param pspec the #GParamSpec of a property installed on the class of @object. |
| 14575 | */ |
| 14576 | notify_by_pspec(pspec: GObject.ParamSpec): void; |
| 14577 | /** |
| 14578 | * Increases the reference count of `object`. |
| 14579 | * |
| 14580 | * Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type |
| 14581 | * of `object` will be propagated to the return type (using the GCC typeof() |
| 14582 | * extension), so any casting the caller needs to do on the return type must be |
| 14583 | * explicit. |
| 14584 | * @returns the same @object |
| 14585 | */ |
| 14586 | ref(): GObject.Object; |
| 14587 | /** |
| 14588 | * Increase the reference count of `object,` and possibly remove the |
| 14589 | * [floating][floating-ref] reference, if `object` has a floating reference. |
| 14590 | * |
| 14591 | * In other words, if the object is floating, then this call "assumes |
| 14592 | * ownership" of the floating reference, converting it to a normal |
| 14593 | * reference by clearing the floating flag while leaving the reference |
| 14594 | * count unchanged. If the object is not floating, then this call |
| 14595 | * adds a new normal reference increasing the reference count by one. |
| 14596 | * |
| 14597 | * Since GLib 2.56, the type of `object` will be propagated to the return type |
| 14598 | * under the same conditions as for g_object_ref(). |
| 14599 | * @returns @object |
| 14600 | */ |
| 14601 | ref_sink(): GObject.Object; |
| 14602 | /** |
| 14603 | * Releases all references to other objects. This can be used to break |
| 14604 | * reference cycles. |
| 14605 | * |
| 14606 | * This function should only be called from object system implementations. |
| 14607 | */ |
| 14608 | run_dispose(): void; |
| 14609 | /** |
| 14610 | * Each object carries around a table of associations from |
| 14611 | * strings to pointers. This function lets you set an association. |
| 14612 | * |
| 14613 | * If the object already had an association with that name, |
| 14614 | * the old association will be destroyed. |
| 14615 | * |
| 14616 | * Internally, the `key` is converted to a #GQuark using g_quark_from_string(). |
| 14617 | * This means a copy of `key` is kept permanently (even after `object` has been |
| 14618 | * finalized) — so it is recommended to only use a small, bounded set of values |
| 14619 | * for `key` in your program, to avoid the #GQuark storage growing unbounded. |
| 14620 | * @param key name of the key |
| 14621 | * @param data data to associate with that key |
| 14622 | */ |
| 14623 | set_data(key: string, data?: any | null): void; |
| 14624 | /** |
| 14625 | * Sets a property on an object. |
| 14626 | * @param property_name The name of the property to set |
| 14627 | * @param value The value to set the property to |
| 14628 | */ |
| 14629 | set_property(property_name: string, value: GObject.Value | any): void; |
| 14630 | /** |
| 14631 | * Remove a specified datum from the object's data associations, |
| 14632 | * without invoking the association's destroy handler. |
| 14633 | * @param key name of the key |
| 14634 | * @returns the data if found, or %NULL if no such data exists. |
| 14635 | */ |
| 14636 | steal_data(key: string): any | null; |
| 14637 | /** |
| 14638 | * This function gets back user data pointers stored via |
| 14639 | * g_object_set_qdata() and removes the `data` from object |
| 14640 | * without invoking its destroy() function (if any was |
| 14641 | * set). |
| 14642 | * Usually, calling this function is only required to update |
| 14643 | * user data pointers with a destroy notifier, for example: |
| 14644 | * |
| 14645 | * ```c |
| 14646 | * void |
| 14647 | * object_add_to_user_list (GObject *object, |
| 14648 | * const gchar *new_string) |
| 14649 | * { |
| 14650 | * // the quark, naming the object data |
| 14651 | * GQuark quark_string_list = g_quark_from_static_string ("my-string-list"); |
| 14652 | * // retrieve the old string list |
| 14653 | * GList *list = g_object_steal_qdata (object, quark_string_list); |
| 14654 | * |
| 14655 | * // prepend new string |
| 14656 | * list = g_list_prepend (list, g_strdup (new_string)); |
| 14657 | * // this changed 'list', so we need to set it again |
| 14658 | * g_object_set_qdata_full (object, quark_string_list, list, free_string_list); |
| 14659 | * } |
| 14660 | * static void |
| 14661 | * free_string_list (gpointer data) |
| 14662 | * { |
| 14663 | * GList *node, *list = data; |
| 14664 | * |
| 14665 | * for (node = list; node; node = node->next) |
| 14666 | * g_free (node->data); |
| 14667 | * g_list_free (list); |
| 14668 | * } |
| 14669 | * ``` |
| 14670 | * |
| 14671 | * Using g_object_get_qdata() in the above example, instead of |
| 14672 | * g_object_steal_qdata() would have left the destroy function set, |
| 14673 | * and thus the partial string list would have been freed upon |
| 14674 | * g_object_set_qdata_full(). |
| 14675 | * @param quark A #GQuark, naming the user data pointer |
| 14676 | * @returns The user data pointer set, or %NULL |
| 14677 | */ |
| 14678 | steal_qdata(quark: GLib.Quark): any | null; |
| 14679 | /** |
| 14680 | * Reverts the effect of a previous call to |
| 14681 | * g_object_freeze_notify(). The freeze count is decreased on `object` |
| 14682 | * and when it reaches zero, queued "notify" signals are emitted. |
| 14683 | * |
| 14684 | * Duplicate notifications for each property are squashed so that at most one |
| 14685 | * #GObject::notify signal is emitted for each property, in the reverse order |
| 14686 | * in which they have been queued. |
| 14687 | * |
| 14688 | * It is an error to call this function when the freeze count is zero. |
| 14689 | */ |
| 14690 | thaw_notify(): void; |
| 14691 | /** |
| 14692 | * Decreases the reference count of `object`. When its reference count |
| 14693 | * drops to 0, the object is finalized (i.e. its memory is freed). |
| 14694 | * |
| 14695 | * If the pointer to the #GObject may be reused in future (for example, if it is |
| 14696 | * an instance variable of another object), it is recommended to clear the |
| 14697 | * pointer to %NULL rather than retain a dangling pointer to a potentially |
| 14698 | * invalid #GObject instance. Use g_clear_object() for this. |
| 14699 | */ |
| 14700 | unref(): void; |
| 14701 | /** |
| 14702 | * This function essentially limits the life time of the `closure` to |
| 14703 | * the life time of the object. That is, when the object is finalized, |
| 14704 | * the `closure` is invalidated by calling g_closure_invalidate() on |
| 14705 | * it, in order to prevent invocations of the closure with a finalized |
| 14706 | * (nonexisting) object. Also, g_object_ref() and g_object_unref() are |
| 14707 | * added as marshal guards to the `closure,` to ensure that an extra |
| 14708 | * reference count is held on `object` during invocation of the |
| 14709 | * `closure`. Usually, this function will be called on closures that |
| 14710 | * use this `object` as closure data. |
| 14711 | * @param closure #GClosure to watch |
| 14712 | */ |
| 14713 | watch_closure(closure: GObject.Closure): void; |
| 14714 | /** |
| 14715 | * the `constructed` function is called by g_object_new() as the |
| 14716 | * final step of the object creation process. At the point of the call, all |
| 14717 | * construction properties have been set on the object. The purpose of this |
| 14718 | * call is to allow for object initialisation steps that can only be performed |
| 14719 | * after construction properties have been set. `constructed` implementors |
| 14720 | * should chain up to the `constructed` call of their parent class to allow it |
| 14721 | * to complete its initialisation. |
| 14722 | */ |
| 14723 | vfunc_constructed(): void; |
| 14724 | /** |
| 14725 | * emits property change notification for a bunch |
| 14726 | * of properties. Overriding `dispatch_properties_changed` should be rarely |
| 14727 | * needed. |
| 14728 | * @param n_pspecs |
| 14729 | * @param pspecs |
| 14730 | */ |
| 14731 | vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void; |
| 14732 | /** |
| 14733 | * the `dispose` function is supposed to drop all references to other |
| 14734 | * objects, but keep the instance otherwise intact, so that client method |
| 14735 | * invocations still work. It may be run multiple times (due to reference |
| 14736 | * loops). Before returning, `dispose` should chain up to the `dispose` method |
| 14737 | * of the parent class. |
| 14738 | */ |
| 14739 | vfunc_dispose(): void; |
| 14740 | /** |
| 14741 | * instance finalization function, should finish the finalization of |
| 14742 | * the instance begun in `dispose` and chain up to the `finalize` method of the |
| 14743 | * parent class. |
| 14744 | */ |
| 14745 | vfunc_finalize(): void; |
| 14746 | /** |
| 14747 | * the generic getter for all properties of this type. Should be |
| 14748 | * overridden for every type with properties. |
| 14749 | * @param property_id |
| 14750 | * @param value |
| 14751 | * @param pspec |
| 14752 | */ |
| 14753 | vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void; |
| 14754 | /** |
| 14755 | * Emits a "notify" signal for the property `property_name` on `object`. |
| 14756 | * |
| 14757 | * When possible, eg. when signaling a property change from within the class |
| 14758 | * that registered the property, you should use g_object_notify_by_pspec() |
| 14759 | * instead. |
| 14760 | * |
| 14761 | * Note that emission of the notify signal may be blocked with |
| 14762 | * g_object_freeze_notify(). In this case, the signal emissions are queued |
| 14763 | * and will be emitted (in reverse order) when g_object_thaw_notify() is |
| 14764 | * called. |
| 14765 | * @param pspec |
| 14766 | */ |
| 14767 | vfunc_notify(pspec: GObject.ParamSpec): void; |
| 14768 | /** |
| 14769 | * the generic setter for all properties of this type. Should be |
| 14770 | * overridden for every type with properties. If implementations of |
| 14771 | * `set_property` don't emit property change notification explicitly, this will |
| 14772 | * be done implicitly by the type system. However, if the notify signal is |
| 14773 | * emitted explicitly, the type system will not emit it a second time. |
| 14774 | * @param property_id |
| 14775 | * @param value |
| 14776 | * @param pspec |
| 14777 | */ |
| 14778 | vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void; |
| 14779 | /** |
| 14780 | * Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to. |
| 14781 | * @param id Handler ID of the handler to be disconnected |
| 14782 | */ |
| 14783 | disconnect(id: number): void; |
| 14784 | /** |
| 14785 | * Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values. |
| 14786 | * @param properties Object containing the properties to set |
| 14787 | */ |
| 14788 | set(properties: { [key: string]: any }): void; |
| 14789 | /** |
| 14790 | * Blocks a handler of an instance so it will not be called during any signal emissions |
| 14791 | * @param id Handler ID of the handler to be blocked |
| 14792 | */ |
| 14793 | block_signal_handler(id: number): void; |
| 14794 | /** |
| 14795 | * Unblocks a handler so it will be called again during any signal emissions |
| 14796 | * @param id Handler ID of the handler to be unblocked |
| 14797 | */ |
| 14798 | unblock_signal_handler(id: number): void; |
| 14799 | /** |
| 14800 | * Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked. |
| 14801 | * @param detailedName Name of the signal to stop emission of |
| 14802 | */ |
| 14803 | stop_emission_by_name(detailedName: string): void; |
| 14804 | } |
| 14805 | |
| 14806 | namespace SecureEntryBuffer { |
| 14807 | // Constructor properties interface |
| 14808 | |
| 14809 | interface ConstructorProps extends Gtk.EntryBuffer.ConstructorProps {} |
| 14810 | } |
| 14811 | |
| 14812 | /** |
| 14813 | * A [class`Gtk`.EntryBuffer] that uses non-pageable memory. |
| 14814 | * |
| 14815 | * It's good practice to try to keep passwords or sensitive secrets out of |
| 14816 | * pageable memory whenever possible, so that they don't get written to disk. |
| 14817 | * |
| 14818 | * A [class`SecureEntryBuffer]` is a [class`Gtk`.EntryBuffer] to be used with |
| 14819 | * [class`Gtk`.Entry] which uses non-pageable memory to store a password placed |
| 14820 | * in the entry. In order to make any sense at all, the entry must have it's |
| 14821 | * visibility turned off, and just be displaying place holder characters for |
| 14822 | * the text. That is, a password style entry. |
| 14823 | * |
| 14824 | * Use [ctor`Gtk`.Entry.new_with_buffer] or [method`Gtk`.Entry.set_buffer] to set this buffer |
| 14825 | * on an entry. |
| 14826 | */ |
| 14827 | class SecureEntryBuffer extends Gtk.EntryBuffer { |
| 14828 | static $gtype: GObject.GType<SecureEntryBuffer>; |
| 14829 | |
| 14830 | // Constructors |
| 14831 | |
| 14832 | constructor(properties?: Partial<SecureEntryBuffer.ConstructorProps>, ...args: any[]); |
| 14833 | |
| 14834 | _init(...args: any[]): void; |
| 14835 | |
| 14836 | static ['new'](): SecureEntryBuffer; |
| 14837 | } |
| 14838 | |
| 14839 | namespace TreeSelector { |
| 14840 | // Constructor properties interface |
| 14841 | |
| 14842 | interface ConstructorProps |
| 14843 | extends Gtk.TreeView.ConstructorProps, |
| 14844 | Atk.ImplementorIface.ConstructorProps, |
| 14845 | Gtk.Buildable.ConstructorProps, |
| 14846 | Gtk.Scrollable.ConstructorProps { |
| 14847 | collection: Gcr.Collection; |
| 14848 | columns: any; |
| 14849 | } |
| 14850 | } |
| 14851 | |
| 14852 | /** |
| 14853 | * A tree selector can be used to select certificates or keys. It allows |
| 14854 | * the user to select multiple objects from a tree. |
| 14855 | */ |
| 14856 | class TreeSelector extends Gtk.TreeView implements Atk.ImplementorIface, Gtk.Buildable, Gtk.Scrollable { |
| 14857 | static $gtype: GObject.GType<TreeSelector>; |
| 14858 | |
| 14859 | // Properties |
| 14860 | |
| 14861 | /** |
| 14862 | * The collection which contains the objects to display in the selector. |
| 14863 | */ |
| 14864 | get collection(): Gcr.Collection; |
| 14865 | /** |
| 14866 | * The columns to use to display the objects. |
| 14867 | */ |
| 14868 | get columns(): any; |
| 14869 | |
| 14870 | // Constructors |
| 14871 | |
| 14872 | constructor(properties?: Partial<TreeSelector.ConstructorProps>, ...args: any[]); |
| 14873 | |
| 14874 | _init(...args: any[]): void; |
| 14875 | |
| 14876 | // Methods |
| 14877 | |
| 14878 | /** |
| 14879 | * Get the collection that this selector is displaying objects from. |
| 14880 | * @returns the collection, owned by the selector |
| 14881 | */ |
| 14882 | get_collection(): Gcr.Collection; |
| 14883 | /** |
| 14884 | * Get a list of selected objects. |
| 14885 | * @returns the list of selected objects, to be released with g_list_free() |
| 14886 | */ |
| 14887 | get_selected(): GObject.Object[]; |
| 14888 | /** |
| 14889 | * Select certain objects in the selector. |
| 14890 | * @param selected the list of objects to select |
| 14891 | */ |
| 14892 | set_selected(selected: GObject.Object[]): void; |
| 14893 | |
| 14894 | // Inherited properties |
| 14895 | /** |
| 14896 | * Horizontal #GtkAdjustment of the scrollable widget. This adjustment is |
| 14897 | * shared between the scrollable widget and its parent. |
| 14898 | */ |
| 14899 | get hadjustment(): Gtk.Adjustment; |
| 14900 | set hadjustment(val: Gtk.Adjustment); |
| 14901 | /** |
| 14902 | * Determines whether horizontal scrolling should start once the scrollable |
| 14903 | * widget is allocated less than its minimum width or less than its natural width. |
| 14904 | */ |
| 14905 | get hscroll_policy(): Gtk.ScrollablePolicy; |
| 14906 | set hscroll_policy(val: Gtk.ScrollablePolicy); |
| 14907 | /** |
| 14908 | * Determines whether horizontal scrolling should start once the scrollable |
| 14909 | * widget is allocated less than its minimum width or less than its natural width. |
| 14910 | */ |
| 14911 | get hscrollPolicy(): Gtk.ScrollablePolicy; |
| 14912 | set hscrollPolicy(val: Gtk.ScrollablePolicy); |
| 14913 | /** |
| 14914 | * Verical #GtkAdjustment of the scrollable widget. This adjustment is shared |
| 14915 | * between the scrollable widget and its parent. |
| 14916 | */ |
| 14917 | get vadjustment(): Gtk.Adjustment; |
| 14918 | set vadjustment(val: Gtk.Adjustment); |
| 14919 | /** |
| 14920 | * Determines whether vertical scrolling should start once the scrollable |
| 14921 | * widget is allocated less than its minimum height or less than its natural height. |
| 14922 | */ |
| 14923 | get vscroll_policy(): Gtk.ScrollablePolicy; |
| 14924 | set vscroll_policy(val: Gtk.ScrollablePolicy); |
| 14925 | /** |
| 14926 | * Determines whether vertical scrolling should start once the scrollable |
| 14927 | * widget is allocated less than its minimum height or less than its natural height. |
| 14928 | */ |
| 14929 | get vscrollPolicy(): Gtk.ScrollablePolicy; |
| 14930 | set vscrollPolicy(val: Gtk.ScrollablePolicy); |
| 14931 | |
| 14932 | // Inherited methods |
| 14933 | /** |
| 14934 | * Returns the size of a non-scrolling border around the |
| 14935 | * outside of the scrollable. An example for this would |
| 14936 | * be treeview headers. GTK+ can use this information to |
| 14937 | * display overlayed graphics, like the overshoot indication, |
| 14938 | * at the right position. |
| 14939 | * @returns %TRUE if @border has been set |
| 14940 | */ |
| 14941 | get_border(): [boolean, Gtk.Border]; |
| 14942 | /** |
| 14943 | * Retrieves the #GtkAdjustment used for horizontal scrolling. |
| 14944 | * @returns horizontal #GtkAdjustment. |
| 14945 | */ |
| 14946 | get_hadjustment(): Gtk.Adjustment; |
| 14947 | /** |
| 14948 | * Gets the horizontal #GtkScrollablePolicy. |
| 14949 | * @returns The horizontal #GtkScrollablePolicy. |
| 14950 | */ |
| 14951 | get_hscroll_policy(): Gtk.ScrollablePolicy; |
| 14952 | /** |
| 14953 | * Retrieves the #GtkAdjustment used for vertical scrolling. |
| 14954 | * @returns vertical #GtkAdjustment. |
| 14955 | */ |
| 14956 | get_vadjustment(): Gtk.Adjustment; |
| 14957 | /** |
| 14958 | * Gets the vertical #GtkScrollablePolicy. |
| 14959 | * @returns The vertical #GtkScrollablePolicy. |
| 14960 | */ |
| 14961 | get_vscroll_policy(): Gtk.ScrollablePolicy; |
| 14962 | /** |
| 14963 | * Sets the horizontal adjustment of the #GtkScrollable. |
| 14964 | * @param hadjustment a #GtkAdjustment |
| 14965 | */ |
| 14966 | set_hadjustment(hadjustment?: Gtk.Adjustment | null): void; |
| 14967 | /** |
| 14968 | * Sets the #GtkScrollablePolicy to determine whether |
| 14969 | * horizontal scrolling should start below the minimum width or |
| 14970 | * below the natural width. |
| 14971 | * @param policy the horizontal #GtkScrollablePolicy |
| 14972 | */ |
| 14973 | set_hscroll_policy(policy: Gtk.ScrollablePolicy | null): void; |
| 14974 | /** |
| 14975 | * Sets the vertical adjustment of the #GtkScrollable. |
| 14976 | * @param vadjustment a #GtkAdjustment |
| 14977 | */ |
| 14978 | set_vadjustment(vadjustment?: Gtk.Adjustment | null): void; |
| 14979 | /** |
| 14980 | * Sets the #GtkScrollablePolicy to determine whether |
| 14981 | * vertical scrolling should start below the minimum height or |
| 14982 | * below the natural height. |
| 14983 | * @param policy the vertical #GtkScrollablePolicy |
| 14984 | */ |
| 14985 | set_vscroll_policy(policy: Gtk.ScrollablePolicy | null): void; |
| 14986 | /** |
| 14987 | * Returns the size of a non-scrolling border around the |
| 14988 | * outside of the scrollable. An example for this would |
| 14989 | * be treeview headers. GTK+ can use this information to |
| 14990 | * display overlayed graphics, like the overshoot indication, |
| 14991 | * at the right position. |
| 14992 | */ |
| 14993 | vfunc_get_border(): [boolean, Gtk.Border]; |
| 14994 | /** |
| 14995 | * Creates a binding between `source_property` on `source` and `target_property` |
| 14996 | * on `target`. |
| 14997 | * |
| 14998 | * Whenever the `source_property` is changed the `target_property` is |
| 14999 | * updated using the same value. For instance: |
| 15000 | * |
| 15001 | * |
| 15002 | * ```c |
| 15003 | * g_object_bind_property (action, "active", widget, "sensitive", 0); |
| 15004 | * ``` |
| 15005 | * |
| 15006 | * |
| 15007 | * Will result in the "sensitive" property of the widget #GObject instance to be |
| 15008 | * updated with the same value of the "active" property of the action #GObject |
| 15009 | * instance. |
| 15010 | * |
| 15011 | * If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual: |
| 15012 | * if `target_property` on `target` changes then the `source_property` on `source` |
| 15013 | * will be updated as well. |
| 15014 | * |
| 15015 | * The binding will automatically be removed when either the `source` or the |
| 15016 | * `target` instances are finalized. To remove the binding without affecting the |
| 15017 | * `source` and the `target` you can just call g_object_unref() on the returned |
| 15018 | * #GBinding instance. |
| 15019 | * |
| 15020 | * Removing the binding by calling g_object_unref() on it must only be done if |
| 15021 | * the binding, `source` and `target` are only used from a single thread and it |
| 15022 | * is clear that both `source` and `target` outlive the binding. Especially it |
| 15023 | * is not safe to rely on this if the binding, `source` or `target` can be |
| 15024 | * finalized from different threads. Keep another reference to the binding and |
| 15025 | * use g_binding_unbind() instead to be on the safe side. |
| 15026 | * |
| 15027 | * A #GObject can have multiple bindings. |
| 15028 | * @param source_property the property on @source to bind |
| 15029 | * @param target the target #GObject |
| 15030 | * @param target_property the property on @target to bind |
| 15031 | * @param flags flags to pass to #GBinding |
| 15032 | * @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero. |
| 15033 | */ |
| 15034 | bind_property( |
| 15035 | source_property: string, |
| 15036 | target: GObject.Object, |
| 15037 | target_property: string, |
| 15038 | flags: GObject.BindingFlags | null, |
| 15039 | ): GObject.Binding; |
| 15040 | /** |
| 15041 | * Complete version of g_object_bind_property(). |
| 15042 | * |
| 15043 | * Creates a binding between `source_property` on `source` and `target_property` |
| 15044 | * on `target,` allowing you to set the transformation functions to be used by |
| 15045 | * the binding. |
| 15046 | * |
| 15047 | * If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual: |
| 15048 | * if `target_property` on `target` changes then the `source_property` on `source` |
| 15049 | * will be updated as well. The `transform_from` function is only used in case |
| 15050 | * of bidirectional bindings, otherwise it will be ignored |
| 15051 | * |
| 15052 | * The binding will automatically be removed when either the `source` or the |
| 15053 | * `target` instances are finalized. This will release the reference that is |
| 15054 | * being held on the #GBinding instance; if you want to hold on to the |
| 15055 | * #GBinding instance, you will need to hold a reference to it. |
| 15056 | * |
| 15057 | * To remove the binding, call g_binding_unbind(). |
| 15058 | * |
| 15059 | * A #GObject can have multiple bindings. |
| 15060 | * |
| 15061 | * The same `user_data` parameter will be used for both `transform_to` |
| 15062 | * and `transform_from` transformation functions; the `notify` function will |
| 15063 | * be called once, when the binding is removed. If you need different data |
| 15064 | * for each transformation function, please use |
| 15065 | * g_object_bind_property_with_closures() instead. |
| 15066 | * @param source_property the property on @source to bind |
| 15067 | * @param target the target #GObject |
| 15068 | * @param target_property the property on @target to bind |
| 15069 | * @param flags flags to pass to #GBinding |
| 15070 | * @param transform_to the transformation function from the @source to the @target, or %NULL to use the default |
| 15071 | * @param transform_from the transformation function from the @target to the @source, or %NULL to use the default |
| 15072 | * @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required |
| 15073 | * @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero. |
| 15074 | */ |
| 15075 | bind_property_full( |
| 15076 | source_property: string, |
| 15077 | target: GObject.Object, |
| 15078 | target_property: string, |
| 15079 | flags: GObject.BindingFlags | null, |
| 15080 | transform_to?: GObject.BindingTransformFunc | null, |
| 15081 | transform_from?: GObject.BindingTransformFunc | null, |
| 15082 | notify?: GLib.DestroyNotify | null, |
| 15083 | ): GObject.Binding; |
| 15084 | // Conflicted with GObject.Object.bind_property_full |
| 15085 | bind_property_full(...args: never[]): any; |
| 15086 | /** |
| 15087 | * This function is intended for #GObject implementations to re-enforce |
| 15088 | * a [floating][floating-ref] object reference. Doing this is seldom |
| 15089 | * required: all #GInitiallyUnowneds are created with a floating reference |
| 15090 | * which usually just needs to be sunken by calling g_object_ref_sink(). |
| 15091 | */ |
| 15092 | force_floating(): void; |
| 15093 | /** |
| 15094 | * Increases the freeze count on `object`. If the freeze count is |
| 15095 | * non-zero, the emission of "notify" signals on `object` is |
| 15096 | * stopped. The signals are queued until the freeze count is decreased |
| 15097 | * to zero. Duplicate notifications are squashed so that at most one |
| 15098 | * #GObject::notify signal is emitted for each property modified while the |
| 15099 | * object is frozen. |
| 15100 | * |
| 15101 | * This is necessary for accessors that modify multiple properties to prevent |
| 15102 | * premature notification while the object is still being modified. |
| 15103 | */ |
| 15104 | freeze_notify(): void; |
| 15105 | /** |
| 15106 | * Gets a named field from the objects table of associations (see g_object_set_data()). |
| 15107 | * @param key name of the key for that association |
| 15108 | * @returns the data if found, or %NULL if no such data exists. |
| 15109 | */ |
| 15110 | get_data(key: string): any | null; |
| 15111 | /** |
| 15112 | * Gets a property of an object. |
| 15113 | * |
| 15114 | * The value can be: |
| 15115 | * - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60) |
| 15116 | * - a GObject.Value initialized with the expected type of the property |
| 15117 | * - a GObject.Value initialized with a type to which the expected type of the property can be transformed |
| 15118 | * |
| 15119 | * In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset. |
| 15120 | * |
| 15121 | * Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming. |
| 15122 | * @param property_name The name of the property to get |
| 15123 | * @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type |
| 15124 | */ |
| 15125 | get_property(property_name: string, value: GObject.Value | any): any; |
| 15126 | /** |
| 15127 | * This function gets back user data pointers stored via |
| 15128 | * g_object_set_qdata(). |
| 15129 | * @param quark A #GQuark, naming the user data pointer |
| 15130 | * @returns The user data pointer set, or %NULL |
| 15131 | */ |
| 15132 | get_qdata(quark: GLib.Quark): any | null; |
| 15133 | /** |
| 15134 | * Gets `n_properties` properties for an `object`. |
| 15135 | * Obtained properties will be set to `values`. All properties must be valid. |
| 15136 | * Warnings will be emitted and undefined behaviour may result if invalid |
| 15137 | * properties are passed in. |
| 15138 | * @param names the names of each property to get |
| 15139 | * @param values the values of each property to get |
| 15140 | */ |
| 15141 | getv(names: string[], values: (GObject.Value | any)[]): void; |
| 15142 | /** |
| 15143 | * Checks whether `object` has a [floating][floating-ref] reference. |
| 15144 | * @returns %TRUE if @object has a floating reference |
| 15145 | */ |
| 15146 | is_floating(): boolean; |
| 15147 | /** |
| 15148 | * Emits a "notify" signal for the property `property_name` on `object`. |
| 15149 | * |
| 15150 | * When possible, eg. when signaling a property change from within the class |
| 15151 | * that registered the property, you should use g_object_notify_by_pspec() |
| 15152 | * instead. |
| 15153 | * |
| 15154 | * Note that emission of the notify signal may be blocked with |
| 15155 | * g_object_freeze_notify(). In this case, the signal emissions are queued |
| 15156 | * and will be emitted (in reverse order) when g_object_thaw_notify() is |
| 15157 | * called. |
| 15158 | * @param property_name the name of a property installed on the class of @object. |
| 15159 | */ |
| 15160 | notify(property_name: string): void; |
| 15161 | /** |
| 15162 | * Emits a "notify" signal for the property specified by `pspec` on `object`. |
| 15163 | * |
| 15164 | * This function omits the property name lookup, hence it is faster than |
| 15165 | * g_object_notify(). |
| 15166 | * |
| 15167 | * One way to avoid using g_object_notify() from within the |
| 15168 | * class that registered the properties, and using g_object_notify_by_pspec() |
| 15169 | * instead, is to store the GParamSpec used with |
| 15170 | * g_object_class_install_property() inside a static array, e.g.: |
| 15171 | * |
| 15172 | * |
| 15173 | * ```c |
| 15174 | * typedef enum |
| 15175 | * { |
| 15176 | * PROP_FOO = 1, |
| 15177 | * PROP_LAST |
| 15178 | * } MyObjectProperty; |
| 15179 | * |
| 15180 | * static GParamSpec *properties[PROP_LAST]; |
| 15181 | * |
| 15182 | * static void |
| 15183 | * my_object_class_init (MyObjectClass *klass) |
| 15184 | * { |
| 15185 | * properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL, |
| 15186 | * 0, 100, |
| 15187 | * 50, |
| 15188 | * G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); |
| 15189 | * g_object_class_install_property (gobject_class, |
| 15190 | * PROP_FOO, |
| 15191 | * properties[PROP_FOO]); |
| 15192 | * } |
| 15193 | * ``` |
| 15194 | * |
| 15195 | * |
| 15196 | * and then notify a change on the "foo" property with: |
| 15197 | * |
| 15198 | * |
| 15199 | * ```c |
| 15200 | * g_object_notify_by_pspec (self, properties[PROP_FOO]); |
| 15201 | * ``` |
| 15202 | * |
| 15203 | * @param pspec the #GParamSpec of a property installed on the class of @object. |
| 15204 | */ |
| 15205 | notify_by_pspec(pspec: GObject.ParamSpec): void; |
| 15206 | /** |
| 15207 | * Increases the reference count of `object`. |
| 15208 | * |
| 15209 | * Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type |
| 15210 | * of `object` will be propagated to the return type (using the GCC typeof() |
| 15211 | * extension), so any casting the caller needs to do on the return type must be |
| 15212 | * explicit. |
| 15213 | * @returns the same @object |
| 15214 | */ |
| 15215 | ref(): GObject.Object; |
| 15216 | /** |
| 15217 | * Increase the reference count of `object,` and possibly remove the |
| 15218 | * [floating][floating-ref] reference, if `object` has a floating reference. |
| 15219 | * |
| 15220 | * In other words, if the object is floating, then this call "assumes |
| 15221 | * ownership" of the floating reference, converting it to a normal |
| 15222 | * reference by clearing the floating flag while leaving the reference |
| 15223 | * count unchanged. If the object is not floating, then this call |
| 15224 | * adds a new normal reference increasing the reference count by one. |
| 15225 | * |
| 15226 | * Since GLib 2.56, the type of `object` will be propagated to the return type |
| 15227 | * under the same conditions as for g_object_ref(). |
| 15228 | * @returns @object |
| 15229 | */ |
| 15230 | ref_sink(): GObject.Object; |
| 15231 | /** |
| 15232 | * Releases all references to other objects. This can be used to break |
| 15233 | * reference cycles. |
| 15234 | * |
| 15235 | * This function should only be called from object system implementations. |
| 15236 | */ |
| 15237 | run_dispose(): void; |
| 15238 | /** |
| 15239 | * Each object carries around a table of associations from |
| 15240 | * strings to pointers. This function lets you set an association. |
| 15241 | * |
| 15242 | * If the object already had an association with that name, |
| 15243 | * the old association will be destroyed. |
| 15244 | * |
| 15245 | * Internally, the `key` is converted to a #GQuark using g_quark_from_string(). |
| 15246 | * This means a copy of `key` is kept permanently (even after `object` has been |
| 15247 | * finalized) — so it is recommended to only use a small, bounded set of values |
| 15248 | * for `key` in your program, to avoid the #GQuark storage growing unbounded. |
| 15249 | * @param key name of the key |
| 15250 | * @param data data to associate with that key |
| 15251 | */ |
| 15252 | set_data(key: string, data?: any | null): void; |
| 15253 | /** |
| 15254 | * Sets a property on an object. |
| 15255 | * @param property_name The name of the property to set |
| 15256 | * @param value The value to set the property to |
| 15257 | */ |
| 15258 | set_property(property_name: string, value: GObject.Value | any): void; |
| 15259 | /** |
| 15260 | * Remove a specified datum from the object's data associations, |
| 15261 | * without invoking the association's destroy handler. |
| 15262 | * @param key name of the key |
| 15263 | * @returns the data if found, or %NULL if no such data exists. |
| 15264 | */ |
| 15265 | steal_data(key: string): any | null; |
| 15266 | /** |
| 15267 | * This function gets back user data pointers stored via |
| 15268 | * g_object_set_qdata() and removes the `data` from object |
| 15269 | * without invoking its destroy() function (if any was |
| 15270 | * set). |
| 15271 | * Usually, calling this function is only required to update |
| 15272 | * user data pointers with a destroy notifier, for example: |
| 15273 | * |
| 15274 | * ```c |
| 15275 | * void |
| 15276 | * object_add_to_user_list (GObject *object, |
| 15277 | * const gchar *new_string) |
| 15278 | * { |
| 15279 | * // the quark, naming the object data |
| 15280 | * GQuark quark_string_list = g_quark_from_static_string ("my-string-list"); |
| 15281 | * // retrieve the old string list |
| 15282 | * GList *list = g_object_steal_qdata (object, quark_string_list); |
| 15283 | * |
| 15284 | * // prepend new string |
| 15285 | * list = g_list_prepend (list, g_strdup (new_string)); |
| 15286 | * // this changed 'list', so we need to set it again |
| 15287 | * g_object_set_qdata_full (object, quark_string_list, list, free_string_list); |
| 15288 | * } |
| 15289 | * static void |
| 15290 | * free_string_list (gpointer data) |
| 15291 | * { |
| 15292 | * GList *node, *list = data; |
| 15293 | * |
| 15294 | * for (node = list; node; node = node->next) |
| 15295 | * g_free (node->data); |
| 15296 | * g_list_free (list); |
| 15297 | * } |
| 15298 | * ``` |
| 15299 | * |
| 15300 | * Using g_object_get_qdata() in the above example, instead of |
| 15301 | * g_object_steal_qdata() would have left the destroy function set, |
| 15302 | * and thus the partial string list would have been freed upon |
| 15303 | * g_object_set_qdata_full(). |
| 15304 | * @param quark A #GQuark, naming the user data pointer |
| 15305 | * @returns The user data pointer set, or %NULL |
| 15306 | */ |
| 15307 | steal_qdata(quark: GLib.Quark): any | null; |
| 15308 | /** |
| 15309 | * Reverts the effect of a previous call to |
| 15310 | * g_object_freeze_notify(). The freeze count is decreased on `object` |
| 15311 | * and when it reaches zero, queued "notify" signals are emitted. |
| 15312 | * |
| 15313 | * Duplicate notifications for each property are squashed so that at most one |
| 15314 | * #GObject::notify signal is emitted for each property, in the reverse order |
| 15315 | * in which they have been queued. |
| 15316 | * |
| 15317 | * It is an error to call this function when the freeze count is zero. |
| 15318 | */ |
| 15319 | thaw_notify(): void; |
| 15320 | /** |
| 15321 | * Decreases the reference count of `object`. When its reference count |
| 15322 | * drops to 0, the object is finalized (i.e. its memory is freed). |
| 15323 | * |
| 15324 | * If the pointer to the #GObject may be reused in future (for example, if it is |
| 15325 | * an instance variable of another object), it is recommended to clear the |
| 15326 | * pointer to %NULL rather than retain a dangling pointer to a potentially |
| 15327 | * invalid #GObject instance. Use g_clear_object() for this. |
| 15328 | */ |
| 15329 | unref(): void; |
| 15330 | /** |
| 15331 | * This function essentially limits the life time of the `closure` to |
| 15332 | * the life time of the object. That is, when the object is finalized, |
| 15333 | * the `closure` is invalidated by calling g_closure_invalidate() on |
| 15334 | * it, in order to prevent invocations of the closure with a finalized |
| 15335 | * (nonexisting) object. Also, g_object_ref() and g_object_unref() are |
| 15336 | * added as marshal guards to the `closure,` to ensure that an extra |
| 15337 | * reference count is held on `object` during invocation of the |
| 15338 | * `closure`. Usually, this function will be called on closures that |
| 15339 | * use this `object` as closure data. |
| 15340 | * @param closure #GClosure to watch |
| 15341 | */ |
| 15342 | watch_closure(closure: GObject.Closure): void; |
| 15343 | /** |
| 15344 | * the `constructed` function is called by g_object_new() as the |
| 15345 | * final step of the object creation process. At the point of the call, all |
| 15346 | * construction properties have been set on the object. The purpose of this |
| 15347 | * call is to allow for object initialisation steps that can only be performed |
| 15348 | * after construction properties have been set. `constructed` implementors |
| 15349 | * should chain up to the `constructed` call of their parent class to allow it |
| 15350 | * to complete its initialisation. |
| 15351 | */ |
| 15352 | vfunc_constructed(): void; |
| 15353 | /** |
| 15354 | * emits property change notification for a bunch |
| 15355 | * of properties. Overriding `dispatch_properties_changed` should be rarely |
| 15356 | * needed. |
| 15357 | * @param n_pspecs |
| 15358 | * @param pspecs |
| 15359 | */ |
| 15360 | vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void; |
| 15361 | /** |
| 15362 | * the `dispose` function is supposed to drop all references to other |
| 15363 | * objects, but keep the instance otherwise intact, so that client method |
| 15364 | * invocations still work. It may be run multiple times (due to reference |
| 15365 | * loops). Before returning, `dispose` should chain up to the `dispose` method |
| 15366 | * of the parent class. |
| 15367 | */ |
| 15368 | vfunc_dispose(): void; |
| 15369 | /** |
| 15370 | * instance finalization function, should finish the finalization of |
| 15371 | * the instance begun in `dispose` and chain up to the `finalize` method of the |
| 15372 | * parent class. |
| 15373 | */ |
| 15374 | vfunc_finalize(): void; |
| 15375 | /** |
| 15376 | * the generic getter for all properties of this type. Should be |
| 15377 | * overridden for every type with properties. |
| 15378 | * @param property_id |
| 15379 | * @param value |
| 15380 | * @param pspec |
| 15381 | */ |
| 15382 | vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void; |
| 15383 | /** |
| 15384 | * Emits a "notify" signal for the property `property_name` on `object`. |
| 15385 | * |
| 15386 | * When possible, eg. when signaling a property change from within the class |
| 15387 | * that registered the property, you should use g_object_notify_by_pspec() |
| 15388 | * instead. |
| 15389 | * |
| 15390 | * Note that emission of the notify signal may be blocked with |
| 15391 | * g_object_freeze_notify(). In this case, the signal emissions are queued |
| 15392 | * and will be emitted (in reverse order) when g_object_thaw_notify() is |
| 15393 | * called. |
| 15394 | * @param pspec |
| 15395 | */ |
| 15396 | vfunc_notify(pspec: GObject.ParamSpec): void; |
| 15397 | /** |
| 15398 | * the generic setter for all properties of this type. Should be |
| 15399 | * overridden for every type with properties. If implementations of |
| 15400 | * `set_property` don't emit property change notification explicitly, this will |
| 15401 | * be done implicitly by the type system. However, if the notify signal is |
| 15402 | * emitted explicitly, the type system will not emit it a second time. |
| 15403 | * @param property_id |
| 15404 | * @param value |
| 15405 | * @param pspec |
| 15406 | */ |
| 15407 | vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void; |
| 15408 | /** |
| 15409 | * Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to. |
| 15410 | * @param id Handler ID of the handler to be disconnected |
| 15411 | */ |
| 15412 | disconnect(id: number): void; |
| 15413 | /** |
| 15414 | * Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values. |
| 15415 | * @param properties Object containing the properties to set |
| 15416 | */ |
| 15417 | set(properties: { [key: string]: any }): void; |
| 15418 | /** |
| 15419 | * Blocks a handler of an instance so it will not be called during any signal emissions |
| 15420 | * @param id Handler ID of the handler to be blocked |
| 15421 | */ |
| 15422 | block_signal_handler(id: number): void; |
| 15423 | /** |
| 15424 | * Unblocks a handler so it will be called again during any signal emissions |
| 15425 | * @param id Handler ID of the handler to be unblocked |
| 15426 | */ |
| 15427 | unblock_signal_handler(id: number): void; |
| 15428 | /** |
| 15429 | * Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked. |
| 15430 | * @param detailedName Name of the signal to stop emission of |
| 15431 | */ |
| 15432 | stop_emission_by_name(detailedName: string): void; |
| 15433 | } |
| 15434 | |
| 15435 | namespace UnlockOptionsWidget { |
| 15436 | // Constructor properties interface |
| 15437 | |
| 15438 | interface ConstructorProps |
| 15439 | extends Gtk.Bin.ConstructorProps, |
| 15440 | Atk.ImplementorIface.ConstructorProps, |
| 15441 | Gtk.Buildable.ConstructorProps { |
| 15442 | choice: string; |
| 15443 | ttl: number; |
| 15444 | } |
| 15445 | } |
| 15446 | |
| 15447 | /** |
| 15448 | * This widget displays a set of unlock options for the user to select. |
| 15449 | * |
| 15450 | * The user can choose between keeping caching the unlock indefinitely, or for |
| 15451 | * a given amount of time. |
| 15452 | * |
| 15453 | * Each option has a different name, for example #GCR_UNLOCK_OPTION_ALWAYS. These |
| 15454 | * names are used together with the various functions like |
| 15455 | * [method`UnlockOptionsWidget`.get_choice]. |
| 15456 | */ |
| 15457 | class UnlockOptionsWidget extends Gtk.Bin implements Atk.ImplementorIface, Gtk.Buildable { |
| 15458 | static $gtype: GObject.GType<UnlockOptionsWidget>; |
| 15459 | |
| 15460 | // Properties |
| 15461 | |
| 15462 | get choice(): string; |
| 15463 | set choice(val: string); |
| 15464 | get ttl(): number; |
| 15465 | set ttl(val: number); |
| 15466 | |
| 15467 | // Constructors |
| 15468 | |
| 15469 | constructor(properties?: Partial<UnlockOptionsWidget.ConstructorProps>, ...args: any[]); |
| 15470 | |
| 15471 | _init(...args: any[]): void; |
| 15472 | |
| 15473 | static ['new'](): UnlockOptionsWidget; |
| 15474 | |
| 15475 | // Methods |
| 15476 | |
| 15477 | /** |
| 15478 | * Get the currently selected option, like %GCR_UNLOCK_OPTION_ALWAYS. |
| 15479 | * @returns The currently selected option name. |
| 15480 | */ |
| 15481 | get_choice(): string; |
| 15482 | /** |
| 15483 | * Get the label for one of the options. Use an option name like |
| 15484 | * %GCR_UNLOCK_OPTION_ALWAYS. |
| 15485 | * @param option The option name |
| 15486 | * @returns The current label for the option. |
| 15487 | */ |
| 15488 | get_label(option: string): string; |
| 15489 | /** |
| 15490 | * Get the sensitivity state for one of the options. Use an option name like |
| 15491 | * %GCR_UNLOCK_OPTION_ALWAYS. |
| 15492 | * @param option The option name |
| 15493 | * @returns Whether the option is sensitive or not. |
| 15494 | */ |
| 15495 | get_sensitive(option: string): boolean; |
| 15496 | // Conflicted with Gtk.Widget.get_sensitive |
| 15497 | get_sensitive(...args: never[]): any; |
| 15498 | /** |
| 15499 | * Get the timeout setting set for unlock options that have a timeout. |
| 15500 | * This will also return a valid value if the currently selected option |
| 15501 | * does not have a timeout. |
| 15502 | * @returns The unlock timeout in seconds. |
| 15503 | */ |
| 15504 | get_ttl(): number; |
| 15505 | /** |
| 15506 | * Set the currently selected option. Use an option name like |
| 15507 | * %GCR_UNLOCK_OPTION_ALWAYS. |
| 15508 | * @param option The option name |
| 15509 | */ |
| 15510 | set_choice(option: string): void; |
| 15511 | /** |
| 15512 | * Set the label for one of the options. Use an option name like |
| 15513 | * %GCR_UNLOCK_OPTION_ALWAYS. |
| 15514 | * @param option The option name |
| 15515 | * @param text The new label |
| 15516 | */ |
| 15517 | set_label(option: string, text: string): void; |
| 15518 | /** |
| 15519 | * Set the sensitivity state for one of the options. Use an option name like |
| 15520 | * %GCR_UNLOCK_OPTION_ALWAYS. The reason will be displayed as a tooltip. |
| 15521 | * @param option The option name |
| 15522 | * @param sensitive The sensitivity state. |
| 15523 | * @param reason A user displayable string which contains the reason for the sensitivity. |
| 15524 | */ |
| 15525 | set_sensitive(option: string, sensitive: boolean, reason: string): void; |
| 15526 | // Conflicted with Gtk.Widget.set_sensitive |
| 15527 | set_sensitive(...args: never[]): any; |
| 15528 | /** |
| 15529 | * Set the current setting for the timeout. This can be set even when the |
| 15530 | * currently selected option does not have a timeout. |
| 15531 | * @param ttl The timeout to set, in seconds |
| 15532 | */ |
| 15533 | set_ttl(ttl: number): void; |
| 15534 | |
| 15535 | // Inherited methods |
| 15536 | /** |
| 15537 | * Creates a binding between `source_property` on `source` and `target_property` |
| 15538 | * on `target`. |
| 15539 | * |
| 15540 | * Whenever the `source_property` is changed the `target_property` is |
| 15541 | * updated using the same value. For instance: |
| 15542 | * |
| 15543 | * |
| 15544 | * ```c |
| 15545 | * g_object_bind_property (action, "active", widget, "sensitive", 0); |
| 15546 | * ``` |
| 15547 | * |
| 15548 | * |
| 15549 | * Will result in the "sensitive" property of the widget #GObject instance to be |
| 15550 | * updated with the same value of the "active" property of the action #GObject |
| 15551 | * instance. |
| 15552 | * |
| 15553 | * If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual: |
| 15554 | * if `target_property` on `target` changes then the `source_property` on `source` |
| 15555 | * will be updated as well. |
| 15556 | * |
| 15557 | * The binding will automatically be removed when either the `source` or the |
| 15558 | * `target` instances are finalized. To remove the binding without affecting the |
| 15559 | * `source` and the `target` you can just call g_object_unref() on the returned |
| 15560 | * #GBinding instance. |
| 15561 | * |
| 15562 | * Removing the binding by calling g_object_unref() on it must only be done if |
| 15563 | * the binding, `source` and `target` are only used from a single thread and it |
| 15564 | * is clear that both `source` and `target` outlive the binding. Especially it |
| 15565 | * is not safe to rely on this if the binding, `source` or `target` can be |
| 15566 | * finalized from different threads. Keep another reference to the binding and |
| 15567 | * use g_binding_unbind() instead to be on the safe side. |
| 15568 | * |
| 15569 | * A #GObject can have multiple bindings. |
| 15570 | * @param source_property the property on @source to bind |
| 15571 | * @param target the target #GObject |
| 15572 | * @param target_property the property on @target to bind |
| 15573 | * @param flags flags to pass to #GBinding |
| 15574 | * @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero. |
| 15575 | */ |
| 15576 | bind_property( |
| 15577 | source_property: string, |
| 15578 | target: GObject.Object, |
| 15579 | target_property: string, |
| 15580 | flags: GObject.BindingFlags | null, |
| 15581 | ): GObject.Binding; |
| 15582 | /** |
| 15583 | * Complete version of g_object_bind_property(). |
| 15584 | * |
| 15585 | * Creates a binding between `source_property` on `source` and `target_property` |
| 15586 | * on `target,` allowing you to set the transformation functions to be used by |
| 15587 | * the binding. |
| 15588 | * |
| 15589 | * If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual: |
| 15590 | * if `target_property` on `target` changes then the `source_property` on `source` |
| 15591 | * will be updated as well. The `transform_from` function is only used in case |
| 15592 | * of bidirectional bindings, otherwise it will be ignored |
| 15593 | * |
| 15594 | * The binding will automatically be removed when either the `source` or the |
| 15595 | * `target` instances are finalized. This will release the reference that is |
| 15596 | * being held on the #GBinding instance; if you want to hold on to the |
| 15597 | * #GBinding instance, you will need to hold a reference to it. |
| 15598 | * |
| 15599 | * To remove the binding, call g_binding_unbind(). |
| 15600 | * |
| 15601 | * A #GObject can have multiple bindings. |
| 15602 | * |
| 15603 | * The same `user_data` parameter will be used for both `transform_to` |
| 15604 | * and `transform_from` transformation functions; the `notify` function will |
| 15605 | * be called once, when the binding is removed. If you need different data |
| 15606 | * for each transformation function, please use |
| 15607 | * g_object_bind_property_with_closures() instead. |
| 15608 | * @param source_property the property on @source to bind |
| 15609 | * @param target the target #GObject |
| 15610 | * @param target_property the property on @target to bind |
| 15611 | * @param flags flags to pass to #GBinding |
| 15612 | * @param transform_to the transformation function from the @source to the @target, or %NULL to use the default |
| 15613 | * @param transform_from the transformation function from the @target to the @source, or %NULL to use the default |
| 15614 | * @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required |
| 15615 | * @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero. |
| 15616 | */ |
| 15617 | bind_property_full( |
| 15618 | source_property: string, |
| 15619 | target: GObject.Object, |
| 15620 | target_property: string, |
| 15621 | flags: GObject.BindingFlags | null, |
| 15622 | transform_to?: GObject.BindingTransformFunc | null, |
| 15623 | transform_from?: GObject.BindingTransformFunc | null, |
| 15624 | notify?: GLib.DestroyNotify | null, |
| 15625 | ): GObject.Binding; |
| 15626 | // Conflicted with GObject.Object.bind_property_full |
| 15627 | bind_property_full(...args: never[]): any; |
| 15628 | /** |
| 15629 | * This function is intended for #GObject implementations to re-enforce |
| 15630 | * a [floating][floating-ref] object reference. Doing this is seldom |
| 15631 | * required: all #GInitiallyUnowneds are created with a floating reference |
| 15632 | * which usually just needs to be sunken by calling g_object_ref_sink(). |
| 15633 | */ |
| 15634 | force_floating(): void; |
| 15635 | /** |
| 15636 | * Increases the freeze count on `object`. If the freeze count is |
| 15637 | * non-zero, the emission of "notify" signals on `object` is |
| 15638 | * stopped. The signals are queued until the freeze count is decreased |
| 15639 | * to zero. Duplicate notifications are squashed so that at most one |
| 15640 | * #GObject::notify signal is emitted for each property modified while the |
| 15641 | * object is frozen. |
| 15642 | * |
| 15643 | * This is necessary for accessors that modify multiple properties to prevent |
| 15644 | * premature notification while the object is still being modified. |
| 15645 | */ |
| 15646 | freeze_notify(): void; |
| 15647 | /** |
| 15648 | * Gets a named field from the objects table of associations (see g_object_set_data()). |
| 15649 | * @param key name of the key for that association |
| 15650 | * @returns the data if found, or %NULL if no such data exists. |
| 15651 | */ |
| 15652 | get_data(key: string): any | null; |
| 15653 | /** |
| 15654 | * Gets a property of an object. |
| 15655 | * |
| 15656 | * The value can be: |
| 15657 | * - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60) |
| 15658 | * - a GObject.Value initialized with the expected type of the property |
| 15659 | * - a GObject.Value initialized with a type to which the expected type of the property can be transformed |
| 15660 | * |
| 15661 | * In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset. |
| 15662 | * |
| 15663 | * Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming. |
| 15664 | * @param property_name The name of the property to get |
| 15665 | * @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type |
| 15666 | */ |
| 15667 | get_property(property_name: string, value: GObject.Value | any): any; |
| 15668 | /** |
| 15669 | * This function gets back user data pointers stored via |
| 15670 | * g_object_set_qdata(). |
| 15671 | * @param quark A #GQuark, naming the user data pointer |
| 15672 | * @returns The user data pointer set, or %NULL |
| 15673 | */ |
| 15674 | get_qdata(quark: GLib.Quark): any | null; |
| 15675 | /** |
| 15676 | * Gets `n_properties` properties for an `object`. |
| 15677 | * Obtained properties will be set to `values`. All properties must be valid. |
| 15678 | * Warnings will be emitted and undefined behaviour may result if invalid |
| 15679 | * properties are passed in. |
| 15680 | * @param names the names of each property to get |
| 15681 | * @param values the values of each property to get |
| 15682 | */ |
| 15683 | getv(names: string[], values: (GObject.Value | any)[]): void; |
| 15684 | /** |
| 15685 | * Checks whether `object` has a [floating][floating-ref] reference. |
| 15686 | * @returns %TRUE if @object has a floating reference |
| 15687 | */ |
| 15688 | is_floating(): boolean; |
| 15689 | /** |
| 15690 | * Emits a "notify" signal for the property `property_name` on `object`. |
| 15691 | * |
| 15692 | * When possible, eg. when signaling a property change from within the class |
| 15693 | * that registered the property, you should use g_object_notify_by_pspec() |
| 15694 | * instead. |
| 15695 | * |
| 15696 | * Note that emission of the notify signal may be blocked with |
| 15697 | * g_object_freeze_notify(). In this case, the signal emissions are queued |
| 15698 | * and will be emitted (in reverse order) when g_object_thaw_notify() is |
| 15699 | * called. |
| 15700 | * @param property_name the name of a property installed on the class of @object. |
| 15701 | */ |
| 15702 | notify(property_name: string): void; |
| 15703 | /** |
| 15704 | * Emits a "notify" signal for the property specified by `pspec` on `object`. |
| 15705 | * |
| 15706 | * This function omits the property name lookup, hence it is faster than |
| 15707 | * g_object_notify(). |
| 15708 | * |
| 15709 | * One way to avoid using g_object_notify() from within the |
| 15710 | * class that registered the properties, and using g_object_notify_by_pspec() |
| 15711 | * instead, is to store the GParamSpec used with |
| 15712 | * g_object_class_install_property() inside a static array, e.g.: |
| 15713 | * |
| 15714 | * |
| 15715 | * ```c |
| 15716 | * typedef enum |
| 15717 | * { |
| 15718 | * PROP_FOO = 1, |
| 15719 | * PROP_LAST |
| 15720 | * } MyObjectProperty; |
| 15721 | * |
| 15722 | * static GParamSpec *properties[PROP_LAST]; |
| 15723 | * |
| 15724 | * static void |
| 15725 | * my_object_class_init (MyObjectClass *klass) |
| 15726 | * { |
| 15727 | * properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL, |
| 15728 | * 0, 100, |
| 15729 | * 50, |
| 15730 | * G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); |
| 15731 | * g_object_class_install_property (gobject_class, |
| 15732 | * PROP_FOO, |
| 15733 | * properties[PROP_FOO]); |
| 15734 | * } |
| 15735 | * ``` |
| 15736 | * |
| 15737 | * |
| 15738 | * and then notify a change on the "foo" property with: |
| 15739 | * |
| 15740 | * |
| 15741 | * ```c |
| 15742 | * g_object_notify_by_pspec (self, properties[PROP_FOO]); |
| 15743 | * ``` |
| 15744 | * |
| 15745 | * @param pspec the #GParamSpec of a property installed on the class of @object. |
| 15746 | */ |
| 15747 | notify_by_pspec(pspec: GObject.ParamSpec): void; |
| 15748 | /** |
| 15749 | * Increases the reference count of `object`. |
| 15750 | * |
| 15751 | * Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type |
| 15752 | * of `object` will be propagated to the return type (using the GCC typeof() |
| 15753 | * extension), so any casting the caller needs to do on the return type must be |
| 15754 | * explicit. |
| 15755 | * @returns the same @object |
| 15756 | */ |
| 15757 | ref(): GObject.Object; |
| 15758 | /** |
| 15759 | * Increase the reference count of `object,` and possibly remove the |
| 15760 | * [floating][floating-ref] reference, if `object` has a floating reference. |
| 15761 | * |
| 15762 | * In other words, if the object is floating, then this call "assumes |
| 15763 | * ownership" of the floating reference, converting it to a normal |
| 15764 | * reference by clearing the floating flag while leaving the reference |
| 15765 | * count unchanged. If the object is not floating, then this call |
| 15766 | * adds a new normal reference increasing the reference count by one. |
| 15767 | * |
| 15768 | * Since GLib 2.56, the type of `object` will be propagated to the return type |
| 15769 | * under the same conditions as for g_object_ref(). |
| 15770 | * @returns @object |
| 15771 | */ |
| 15772 | ref_sink(): GObject.Object; |
| 15773 | /** |
| 15774 | * Releases all references to other objects. This can be used to break |
| 15775 | * reference cycles. |
| 15776 | * |
| 15777 | * This function should only be called from object system implementations. |
| 15778 | */ |
| 15779 | run_dispose(): void; |
| 15780 | /** |
| 15781 | * Each object carries around a table of associations from |
| 15782 | * strings to pointers. This function lets you set an association. |
| 15783 | * |
| 15784 | * If the object already had an association with that name, |
| 15785 | * the old association will be destroyed. |
| 15786 | * |
| 15787 | * Internally, the `key` is converted to a #GQuark using g_quark_from_string(). |
| 15788 | * This means a copy of `key` is kept permanently (even after `object` has been |
| 15789 | * finalized) — so it is recommended to only use a small, bounded set of values |
| 15790 | * for `key` in your program, to avoid the #GQuark storage growing unbounded. |
| 15791 | * @param key name of the key |
| 15792 | * @param data data to associate with that key |
| 15793 | */ |
| 15794 | set_data(key: string, data?: any | null): void; |
| 15795 | /** |
| 15796 | * Sets a property on an object. |
| 15797 | * @param property_name The name of the property to set |
| 15798 | * @param value The value to set the property to |
| 15799 | */ |
| 15800 | set_property(property_name: string, value: GObject.Value | any): void; |
| 15801 | /** |
| 15802 | * Remove a specified datum from the object's data associations, |
| 15803 | * without invoking the association's destroy handler. |
| 15804 | * @param key name of the key |
| 15805 | * @returns the data if found, or %NULL if no such data exists. |
| 15806 | */ |
| 15807 | steal_data(key: string): any | null; |
| 15808 | /** |
| 15809 | * This function gets back user data pointers stored via |
| 15810 | * g_object_set_qdata() and removes the `data` from object |
| 15811 | * without invoking its destroy() function (if any was |
| 15812 | * set). |
| 15813 | * Usually, calling this function is only required to update |
| 15814 | * user data pointers with a destroy notifier, for example: |
| 15815 | * |
| 15816 | * ```c |
| 15817 | * void |
| 15818 | * object_add_to_user_list (GObject *object, |
| 15819 | * const gchar *new_string) |
| 15820 | * { |
| 15821 | * // the quark, naming the object data |
| 15822 | * GQuark quark_string_list = g_quark_from_static_string ("my-string-list"); |
| 15823 | * // retrieve the old string list |
| 15824 | * GList *list = g_object_steal_qdata (object, quark_string_list); |
| 15825 | * |
| 15826 | * // prepend new string |
| 15827 | * list = g_list_prepend (list, g_strdup (new_string)); |
| 15828 | * // this changed 'list', so we need to set it again |
| 15829 | * g_object_set_qdata_full (object, quark_string_list, list, free_string_list); |
| 15830 | * } |
| 15831 | * static void |
| 15832 | * free_string_list (gpointer data) |
| 15833 | * { |
| 15834 | * GList *node, *list = data; |
| 15835 | * |
| 15836 | * for (node = list; node; node = node->next) |
| 15837 | * g_free (node->data); |
| 15838 | * g_list_free (list); |
| 15839 | * } |
| 15840 | * ``` |
| 15841 | * |
| 15842 | * Using g_object_get_qdata() in the above example, instead of |
| 15843 | * g_object_steal_qdata() would have left the destroy function set, |
| 15844 | * and thus the partial string list would have been freed upon |
| 15845 | * g_object_set_qdata_full(). |
| 15846 | * @param quark A #GQuark, naming the user data pointer |
| 15847 | * @returns The user data pointer set, or %NULL |
| 15848 | */ |
| 15849 | steal_qdata(quark: GLib.Quark): any | null; |
| 15850 | /** |
| 15851 | * Reverts the effect of a previous call to |
| 15852 | * g_object_freeze_notify(). The freeze count is decreased on `object` |
| 15853 | * and when it reaches zero, queued "notify" signals are emitted. |
| 15854 | * |
| 15855 | * Duplicate notifications for each property are squashed so that at most one |
| 15856 | * #GObject::notify signal is emitted for each property, in the reverse order |
| 15857 | * in which they have been queued. |
| 15858 | * |
| 15859 | * It is an error to call this function when the freeze count is zero. |
| 15860 | */ |
| 15861 | thaw_notify(): void; |
| 15862 | /** |
| 15863 | * Decreases the reference count of `object`. When its reference count |
| 15864 | * drops to 0, the object is finalized (i.e. its memory is freed). |
| 15865 | * |
| 15866 | * If the pointer to the #GObject may be reused in future (for example, if it is |
| 15867 | * an instance variable of another object), it is recommended to clear the |
| 15868 | * pointer to %NULL rather than retain a dangling pointer to a potentially |
| 15869 | * invalid #GObject instance. Use g_clear_object() for this. |
| 15870 | */ |
| 15871 | unref(): void; |
| 15872 | /** |
| 15873 | * This function essentially limits the life time of the `closure` to |
| 15874 | * the life time of the object. That is, when the object is finalized, |
| 15875 | * the `closure` is invalidated by calling g_closure_invalidate() on |
| 15876 | * it, in order to prevent invocations of the closure with a finalized |
| 15877 | * (nonexisting) object. Also, g_object_ref() and g_object_unref() are |
| 15878 | * added as marshal guards to the `closure,` to ensure that an extra |
| 15879 | * reference count is held on `object` during invocation of the |
| 15880 | * `closure`. Usually, this function will be called on closures that |
| 15881 | * use this `object` as closure data. |
| 15882 | * @param closure #GClosure to watch |
| 15883 | */ |
| 15884 | watch_closure(closure: GObject.Closure): void; |
| 15885 | /** |
| 15886 | * the `constructed` function is called by g_object_new() as the |
| 15887 | * final step of the object creation process. At the point of the call, all |
| 15888 | * construction properties have been set on the object. The purpose of this |
| 15889 | * call is to allow for object initialisation steps that can only be performed |
| 15890 | * after construction properties have been set. `constructed` implementors |
| 15891 | * should chain up to the `constructed` call of their parent class to allow it |
| 15892 | * to complete its initialisation. |
| 15893 | */ |
| 15894 | vfunc_constructed(): void; |
| 15895 | /** |
| 15896 | * emits property change notification for a bunch |
| 15897 | * of properties. Overriding `dispatch_properties_changed` should be rarely |
| 15898 | * needed. |
| 15899 | * @param n_pspecs |
| 15900 | * @param pspecs |
| 15901 | */ |
| 15902 | vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void; |
| 15903 | /** |
| 15904 | * the `dispose` function is supposed to drop all references to other |
| 15905 | * objects, but keep the instance otherwise intact, so that client method |
| 15906 | * invocations still work. It may be run multiple times (due to reference |
| 15907 | * loops). Before returning, `dispose` should chain up to the `dispose` method |
| 15908 | * of the parent class. |
| 15909 | */ |
| 15910 | vfunc_dispose(): void; |
| 15911 | /** |
| 15912 | * instance finalization function, should finish the finalization of |
| 15913 | * the instance begun in `dispose` and chain up to the `finalize` method of the |
| 15914 | * parent class. |
| 15915 | */ |
| 15916 | vfunc_finalize(): void; |
| 15917 | /** |
| 15918 | * the generic getter for all properties of this type. Should be |
| 15919 | * overridden for every type with properties. |
| 15920 | * @param property_id |
| 15921 | * @param value |
| 15922 | * @param pspec |
| 15923 | */ |
| 15924 | vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void; |
| 15925 | /** |
| 15926 | * Emits a "notify" signal for the property `property_name` on `object`. |
| 15927 | * |
| 15928 | * When possible, eg. when signaling a property change from within the class |
| 15929 | * that registered the property, you should use g_object_notify_by_pspec() |
| 15930 | * instead. |
| 15931 | * |
| 15932 | * Note that emission of the notify signal may be blocked with |
| 15933 | * g_object_freeze_notify(). In this case, the signal emissions are queued |
| 15934 | * and will be emitted (in reverse order) when g_object_thaw_notify() is |
| 15935 | * called. |
| 15936 | * @param pspec |
| 15937 | */ |
| 15938 | vfunc_notify(pspec: GObject.ParamSpec): void; |
| 15939 | /** |
| 15940 | * the generic setter for all properties of this type. Should be |
| 15941 | * overridden for every type with properties. If implementations of |
| 15942 | * `set_property` don't emit property change notification explicitly, this will |
| 15943 | * be done implicitly by the type system. However, if the notify signal is |
| 15944 | * emitted explicitly, the type system will not emit it a second time. |
| 15945 | * @param property_id |
| 15946 | * @param value |
| 15947 | * @param pspec |
| 15948 | */ |
| 15949 | vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void; |
| 15950 | /** |
| 15951 | * Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to. |
| 15952 | * @param id Handler ID of the handler to be disconnected |
| 15953 | */ |
| 15954 | disconnect(id: number): void; |
| 15955 | /** |
| 15956 | * Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values. |
| 15957 | * @param properties Object containing the properties to set |
| 15958 | */ |
| 15959 | set(properties: { [key: string]: any }): void; |
| 15960 | /** |
| 15961 | * Blocks a handler of an instance so it will not be called during any signal emissions |
| 15962 | * @param id Handler ID of the handler to be blocked |
| 15963 | */ |
| 15964 | block_signal_handler(id: number): void; |
| 15965 | /** |
| 15966 | * Unblocks a handler so it will be called again during any signal emissions |
| 15967 | * @param id Handler ID of the handler to be unblocked |
| 15968 | */ |
| 15969 | unblock_signal_handler(id: number): void; |
| 15970 | /** |
| 15971 | * Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked. |
| 15972 | * @param detailedName Name of the signal to stop emission of |
| 15973 | */ |
| 15974 | stop_emission_by_name(detailedName: string): void; |
| 15975 | } |
| 15976 | |
| 15977 | namespace ViewerWidget { |
| 15978 | // Signal callback interfaces |
| 15979 | |
| 15980 | interface Added { |
| 15981 | (renderer: Renderer, parsed: Gcr.Parsed): void; |
| 15982 | } |
| 15983 | |
| 15984 | // Constructor properties interface |
| 15985 | |
| 15986 | interface ConstructorProps |
| 15987 | extends Gtk.Box.ConstructorProps, |
| 15988 | Atk.ImplementorIface.ConstructorProps, |
| 15989 | Gtk.Buildable.ConstructorProps, |
| 15990 | Gtk.Orientable.ConstructorProps { |
| 15991 | display_name: string; |
| 15992 | displayName: string; |
| 15993 | parser: Gcr.Parser; |
| 15994 | } |
| 15995 | } |
| 15996 | |
| 15997 | /** |
| 15998 | * A viewer widget which can display certificates and keys that are |
| 15999 | * located in files. |
| 16000 | */ |
| 16001 | class ViewerWidget extends Gtk.Box implements Atk.ImplementorIface, Gtk.Buildable, Gtk.Orientable { |
| 16002 | static $gtype: GObject.GType<ViewerWidget>; |
| 16003 | |
| 16004 | // Properties |
| 16005 | |
| 16006 | /** |
| 16007 | * Display name for data being displayed. This is automatically |
| 16008 | * calculated from a loaded file, or can be explicitly set. |
| 16009 | * |
| 16010 | * Used as a hint when displaying a title for the data, but may be |
| 16011 | * overridden by the parsed data. |
| 16012 | */ |
| 16013 | get display_name(): string; |
| 16014 | set display_name(val: string); |
| 16015 | /** |
| 16016 | * Display name for data being displayed. This is automatically |
| 16017 | * calculated from a loaded file, or can be explicitly set. |
| 16018 | * |
| 16019 | * Used as a hint when displaying a title for the data, but may be |
| 16020 | * overridden by the parsed data. |
| 16021 | */ |
| 16022 | get displayName(): string; |
| 16023 | set displayName(val: string); |
| 16024 | /** |
| 16025 | * The parser used to parse loaded data into viewable items. |
| 16026 | */ |
| 16027 | get parser(): Gcr.Parser; |
| 16028 | |
| 16029 | // Constructors |
| 16030 | |
| 16031 | constructor(properties?: Partial<ViewerWidget.ConstructorProps>, ...args: any[]); |
| 16032 | |
| 16033 | _init(...args: any[]): void; |
| 16034 | |
| 16035 | static ['new'](): ViewerWidget; |
| 16036 | |
| 16037 | // Signals |
| 16038 | |
| 16039 | connect(id: string, callback: (...args: any[]) => any): number; |
| 16040 | connect_after(id: string, callback: (...args: any[]) => any): number; |
| 16041 | emit(id: string, ...args: any[]): void; |
| 16042 | connect(signal: 'added', callback: (_source: this, renderer: Renderer, parsed: Gcr.Parsed) => void): number; |
| 16043 | connect_after( |
| 16044 | signal: 'added', |
| 16045 | callback: (_source: this, renderer: Renderer, parsed: Gcr.Parsed) => void, |
| 16046 | ): number; |
| 16047 | emit(signal: 'added', renderer: Renderer, parsed: Gcr.Parsed): void; |
| 16048 | |
| 16049 | // Methods |
| 16050 | |
| 16051 | /** |
| 16052 | * Clear the error displayed on the viewer widget. |
| 16053 | */ |
| 16054 | clear_error(): void; |
| 16055 | /** |
| 16056 | * Get the display name for data being displayed. This is automatically |
| 16057 | * calculated from a loaded file, or can be explicitly set. |
| 16058 | * |
| 16059 | * Used as a hint when displaying a title for the data, but may be |
| 16060 | * overridden by the parsed data. |
| 16061 | * @returns the display name |
| 16062 | */ |
| 16063 | get_display_name(): string; |
| 16064 | /** |
| 16065 | * Get the parser used to parse loaded data into viewable items. |
| 16066 | * @returns the parser |
| 16067 | */ |
| 16068 | get_parser(): Gcr.Parser; |
| 16069 | /** |
| 16070 | * Get the viewer used to display the viewable items. |
| 16071 | * @returns the viewer |
| 16072 | */ |
| 16073 | get_viewer(): Viewer; |
| 16074 | /** |
| 16075 | * Parse and load some data to be displayed into the viewer widgets. The data |
| 16076 | * may contain multiple parseable items if the format can contain multiple |
| 16077 | * items. |
| 16078 | * @param display_name label for the loaded data |
| 16079 | * @param data data to load |
| 16080 | */ |
| 16081 | load_bytes(display_name: string | null, data: GLib.Bytes | Uint8Array): void; |
| 16082 | /** |
| 16083 | * Parse and load some data to be displayed into the viewer widgets. The data |
| 16084 | * may contain multiple parseable items if the format can contain multiple |
| 16085 | * items. |
| 16086 | * |
| 16087 | * This function will copy the data. Use [method`ViewerWidget`.load_bytes] to avoid |
| 16088 | * copying the data. |
| 16089 | * @param display_name label for the loaded data |
| 16090 | * @param data data to load |
| 16091 | */ |
| 16092 | load_data(display_name: string | null, data: Uint8Array | string): void; |
| 16093 | /** |
| 16094 | * Display contents of a file in the viewer widget. Multiple files can |
| 16095 | * be loaded. |
| 16096 | * @param file a file to load |
| 16097 | */ |
| 16098 | load_file(file: Gio.File): void; |
| 16099 | /** |
| 16100 | * Set the display name for data being displayed. Once explicitly |
| 16101 | * set it will no longer be calculated automatically by loading data. |
| 16102 | * |
| 16103 | * Used as a hint when displaying a title for the data, but may be |
| 16104 | * overridden by the parsed data. |
| 16105 | * @param display_name the display name |
| 16106 | */ |
| 16107 | set_display_name(display_name: string): void; |
| 16108 | /** |
| 16109 | * Show an error on the viewer widget. This is displayed on a info bar near |
| 16110 | * the edge of the widget. |
| 16111 | * @param message descriptive error message |
| 16112 | * @param error detailed error |
| 16113 | */ |
| 16114 | show_error(message: string, error?: GLib.Error | null): void; |
| 16115 | |
| 16116 | // Inherited properties |
| 16117 | /** |
| 16118 | * The orientation of the orientable. |
| 16119 | */ |
| 16120 | get orientation(): Gtk.Orientation; |
| 16121 | set orientation(val: Gtk.Orientation); |
| 16122 | |
| 16123 | // Inherited methods |
| 16124 | /** |
| 16125 | * Retrieves the orientation of the `orientable`. |
| 16126 | * @returns the orientation of the @orientable. |
| 16127 | */ |
| 16128 | get_orientation(): Gtk.Orientation; |
| 16129 | /** |
| 16130 | * Sets the orientation of the `orientable`. |
| 16131 | * @param orientation the orientable’s new orientation. |
| 16132 | */ |
| 16133 | set_orientation(orientation: Gtk.Orientation | null): void; |
| 16134 | /** |
| 16135 | * Creates a binding between `source_property` on `source` and `target_property` |
| 16136 | * on `target`. |
| 16137 | * |
| 16138 | * Whenever the `source_property` is changed the `target_property` is |
| 16139 | * updated using the same value. For instance: |
| 16140 | * |
| 16141 | * |
| 16142 | * ```c |
| 16143 | * g_object_bind_property (action, "active", widget, "sensitive", 0); |
| 16144 | * ``` |
| 16145 | * |
| 16146 | * |
| 16147 | * Will result in the "sensitive" property of the widget #GObject instance to be |
| 16148 | * updated with the same value of the "active" property of the action #GObject |
| 16149 | * instance. |
| 16150 | * |
| 16151 | * If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual: |
| 16152 | * if `target_property` on `target` changes then the `source_property` on `source` |
| 16153 | * will be updated as well. |
| 16154 | * |
| 16155 | * The binding will automatically be removed when either the `source` or the |
| 16156 | * `target` instances are finalized. To remove the binding without affecting the |
| 16157 | * `source` and the `target` you can just call g_object_unref() on the returned |
| 16158 | * #GBinding instance. |
| 16159 | * |
| 16160 | * Removing the binding by calling g_object_unref() on it must only be done if |
| 16161 | * the binding, `source` and `target` are only used from a single thread and it |
| 16162 | * is clear that both `source` and `target` outlive the binding. Especially it |
| 16163 | * is not safe to rely on this if the binding, `source` or `target` can be |
| 16164 | * finalized from different threads. Keep another reference to the binding and |
| 16165 | * use g_binding_unbind() instead to be on the safe side. |
| 16166 | * |
| 16167 | * A #GObject can have multiple bindings. |
| 16168 | * @param source_property the property on @source to bind |
| 16169 | * @param target the target #GObject |
| 16170 | * @param target_property the property on @target to bind |
| 16171 | * @param flags flags to pass to #GBinding |
| 16172 | * @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero. |
| 16173 | */ |
| 16174 | bind_property( |
| 16175 | source_property: string, |
| 16176 | target: GObject.Object, |
| 16177 | target_property: string, |
| 16178 | flags: GObject.BindingFlags | null, |
| 16179 | ): GObject.Binding; |
| 16180 | /** |
| 16181 | * Complete version of g_object_bind_property(). |
| 16182 | * |
| 16183 | * Creates a binding between `source_property` on `source` and `target_property` |
| 16184 | * on `target,` allowing you to set the transformation functions to be used by |
| 16185 | * the binding. |
| 16186 | * |
| 16187 | * If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual: |
| 16188 | * if `target_property` on `target` changes then the `source_property` on `source` |
| 16189 | * will be updated as well. The `transform_from` function is only used in case |
| 16190 | * of bidirectional bindings, otherwise it will be ignored |
| 16191 | * |
| 16192 | * The binding will automatically be removed when either the `source` or the |
| 16193 | * `target` instances are finalized. This will release the reference that is |
| 16194 | * being held on the #GBinding instance; if you want to hold on to the |
| 16195 | * #GBinding instance, you will need to hold a reference to it. |
| 16196 | * |
| 16197 | * To remove the binding, call g_binding_unbind(). |
| 16198 | * |
| 16199 | * A #GObject can have multiple bindings. |
| 16200 | * |
| 16201 | * The same `user_data` parameter will be used for both `transform_to` |
| 16202 | * and `transform_from` transformation functions; the `notify` function will |
| 16203 | * be called once, when the binding is removed. If you need different data |
| 16204 | * for each transformation function, please use |
| 16205 | * g_object_bind_property_with_closures() instead. |
| 16206 | * @param source_property the property on @source to bind |
| 16207 | * @param target the target #GObject |
| 16208 | * @param target_property the property on @target to bind |
| 16209 | * @param flags flags to pass to #GBinding |
| 16210 | * @param transform_to the transformation function from the @source to the @target, or %NULL to use the default |
| 16211 | * @param transform_from the transformation function from the @target to the @source, or %NULL to use the default |
| 16212 | * @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required |
| 16213 | * @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero. |
| 16214 | */ |
| 16215 | bind_property_full( |
| 16216 | source_property: string, |
| 16217 | target: GObject.Object, |
| 16218 | target_property: string, |
| 16219 | flags: GObject.BindingFlags | null, |
| 16220 | transform_to?: GObject.BindingTransformFunc | null, |
| 16221 | transform_from?: GObject.BindingTransformFunc | null, |
| 16222 | notify?: GLib.DestroyNotify | null, |
| 16223 | ): GObject.Binding; |
| 16224 | // Conflicted with GObject.Object.bind_property_full |
| 16225 | bind_property_full(...args: never[]): any; |
| 16226 | /** |
| 16227 | * This function is intended for #GObject implementations to re-enforce |
| 16228 | * a [floating][floating-ref] object reference. Doing this is seldom |
| 16229 | * required: all #GInitiallyUnowneds are created with a floating reference |
| 16230 | * which usually just needs to be sunken by calling g_object_ref_sink(). |
| 16231 | */ |
| 16232 | force_floating(): void; |
| 16233 | /** |
| 16234 | * Increases the freeze count on `object`. If the freeze count is |
| 16235 | * non-zero, the emission of "notify" signals on `object` is |
| 16236 | * stopped. The signals are queued until the freeze count is decreased |
| 16237 | * to zero. Duplicate notifications are squashed so that at most one |
| 16238 | * #GObject::notify signal is emitted for each property modified while the |
| 16239 | * object is frozen. |
| 16240 | * |
| 16241 | * This is necessary for accessors that modify multiple properties to prevent |
| 16242 | * premature notification while the object is still being modified. |
| 16243 | */ |
| 16244 | freeze_notify(): void; |
| 16245 | /** |
| 16246 | * Gets a named field from the objects table of associations (see g_object_set_data()). |
| 16247 | * @param key name of the key for that association |
| 16248 | * @returns the data if found, or %NULL if no such data exists. |
| 16249 | */ |
| 16250 | get_data(key: string): any | null; |
| 16251 | /** |
| 16252 | * Gets a property of an object. |
| 16253 | * |
| 16254 | * The value can be: |
| 16255 | * - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60) |
| 16256 | * - a GObject.Value initialized with the expected type of the property |
| 16257 | * - a GObject.Value initialized with a type to which the expected type of the property can be transformed |
| 16258 | * |
| 16259 | * In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset. |
| 16260 | * |
| 16261 | * Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming. |
| 16262 | * @param property_name The name of the property to get |
| 16263 | * @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type |
| 16264 | */ |
| 16265 | get_property(property_name: string, value: GObject.Value | any): any; |
| 16266 | /** |
| 16267 | * This function gets back user data pointers stored via |
| 16268 | * g_object_set_qdata(). |
| 16269 | * @param quark A #GQuark, naming the user data pointer |
| 16270 | * @returns The user data pointer set, or %NULL |
| 16271 | */ |
| 16272 | get_qdata(quark: GLib.Quark): any | null; |
| 16273 | /** |
| 16274 | * Gets `n_properties` properties for an `object`. |
| 16275 | * Obtained properties will be set to `values`. All properties must be valid. |
| 16276 | * Warnings will be emitted and undefined behaviour may result if invalid |
| 16277 | * properties are passed in. |
| 16278 | * @param names the names of each property to get |
| 16279 | * @param values the values of each property to get |
| 16280 | */ |
| 16281 | getv(names: string[], values: (GObject.Value | any)[]): void; |
| 16282 | /** |
| 16283 | * Checks whether `object` has a [floating][floating-ref] reference. |
| 16284 | * @returns %TRUE if @object has a floating reference |
| 16285 | */ |
| 16286 | is_floating(): boolean; |
| 16287 | /** |
| 16288 | * Emits a "notify" signal for the property `property_name` on `object`. |
| 16289 | * |
| 16290 | * When possible, eg. when signaling a property change from within the class |
| 16291 | * that registered the property, you should use g_object_notify_by_pspec() |
| 16292 | * instead. |
| 16293 | * |
| 16294 | * Note that emission of the notify signal may be blocked with |
| 16295 | * g_object_freeze_notify(). In this case, the signal emissions are queued |
| 16296 | * and will be emitted (in reverse order) when g_object_thaw_notify() is |
| 16297 | * called. |
| 16298 | * @param property_name the name of a property installed on the class of @object. |
| 16299 | */ |
| 16300 | notify(property_name: string): void; |
| 16301 | /** |
| 16302 | * Emits a "notify" signal for the property specified by `pspec` on `object`. |
| 16303 | * |
| 16304 | * This function omits the property name lookup, hence it is faster than |
| 16305 | * g_object_notify(). |
| 16306 | * |
| 16307 | * One way to avoid using g_object_notify() from within the |
| 16308 | * class that registered the properties, and using g_object_notify_by_pspec() |
| 16309 | * instead, is to store the GParamSpec used with |
| 16310 | * g_object_class_install_property() inside a static array, e.g.: |
| 16311 | * |
| 16312 | * |
| 16313 | * ```c |
| 16314 | * typedef enum |
| 16315 | * { |
| 16316 | * PROP_FOO = 1, |
| 16317 | * PROP_LAST |
| 16318 | * } MyObjectProperty; |
| 16319 | * |
| 16320 | * static GParamSpec *properties[PROP_LAST]; |
| 16321 | * |
| 16322 | * static void |
| 16323 | * my_object_class_init (MyObjectClass *klass) |
| 16324 | * { |
| 16325 | * properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL, |
| 16326 | * 0, 100, |
| 16327 | * 50, |
| 16328 | * G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); |
| 16329 | * g_object_class_install_property (gobject_class, |
| 16330 | * PROP_FOO, |
| 16331 | * properties[PROP_FOO]); |
| 16332 | * } |
| 16333 | * ``` |
| 16334 | * |
| 16335 | * |
| 16336 | * and then notify a change on the "foo" property with: |
| 16337 | * |
| 16338 | * |
| 16339 | * ```c |
| 16340 | * g_object_notify_by_pspec (self, properties[PROP_FOO]); |
| 16341 | * ``` |
| 16342 | * |
| 16343 | * @param pspec the #GParamSpec of a property installed on the class of @object. |
| 16344 | */ |
| 16345 | notify_by_pspec(pspec: GObject.ParamSpec): void; |
| 16346 | /** |
| 16347 | * Increases the reference count of `object`. |
| 16348 | * |
| 16349 | * Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type |
| 16350 | * of `object` will be propagated to the return type (using the GCC typeof() |
| 16351 | * extension), so any casting the caller needs to do on the return type must be |
| 16352 | * explicit. |
| 16353 | * @returns the same @object |
| 16354 | */ |
| 16355 | ref(): GObject.Object; |
| 16356 | /** |
| 16357 | * Increase the reference count of `object,` and possibly remove the |
| 16358 | * [floating][floating-ref] reference, if `object` has a floating reference. |
| 16359 | * |
| 16360 | * In other words, if the object is floating, then this call "assumes |
| 16361 | * ownership" of the floating reference, converting it to a normal |
| 16362 | * reference by clearing the floating flag while leaving the reference |
| 16363 | * count unchanged. If the object is not floating, then this call |
| 16364 | * adds a new normal reference increasing the reference count by one. |
| 16365 | * |
| 16366 | * Since GLib 2.56, the type of `object` will be propagated to the return type |
| 16367 | * under the same conditions as for g_object_ref(). |
| 16368 | * @returns @object |
| 16369 | */ |
| 16370 | ref_sink(): GObject.Object; |
| 16371 | /** |
| 16372 | * Releases all references to other objects. This can be used to break |
| 16373 | * reference cycles. |
| 16374 | * |
| 16375 | * This function should only be called from object system implementations. |
| 16376 | */ |
| 16377 | run_dispose(): void; |
| 16378 | /** |
| 16379 | * Each object carries around a table of associations from |
| 16380 | * strings to pointers. This function lets you set an association. |
| 16381 | * |
| 16382 | * If the object already had an association with that name, |
| 16383 | * the old association will be destroyed. |
| 16384 | * |
| 16385 | * Internally, the `key` is converted to a #GQuark using g_quark_from_string(). |
| 16386 | * This means a copy of `key` is kept permanently (even after `object` has been |
| 16387 | * finalized) — so it is recommended to only use a small, bounded set of values |
| 16388 | * for `key` in your program, to avoid the #GQuark storage growing unbounded. |
| 16389 | * @param key name of the key |
| 16390 | * @param data data to associate with that key |
| 16391 | */ |
| 16392 | set_data(key: string, data?: any | null): void; |
| 16393 | /** |
| 16394 | * Sets a property on an object. |
| 16395 | * @param property_name The name of the property to set |
| 16396 | * @param value The value to set the property to |
| 16397 | */ |
| 16398 | set_property(property_name: string, value: GObject.Value | any): void; |
| 16399 | /** |
| 16400 | * Remove a specified datum from the object's data associations, |
| 16401 | * without invoking the association's destroy handler. |
| 16402 | * @param key name of the key |
| 16403 | * @returns the data if found, or %NULL if no such data exists. |
| 16404 | */ |
| 16405 | steal_data(key: string): any | null; |
| 16406 | /** |
| 16407 | * This function gets back user data pointers stored via |
| 16408 | * g_object_set_qdata() and removes the `data` from object |
| 16409 | * without invoking its destroy() function (if any was |
| 16410 | * set). |
| 16411 | * Usually, calling this function is only required to update |
| 16412 | * user data pointers with a destroy notifier, for example: |
| 16413 | * |
| 16414 | * ```c |
| 16415 | * void |
| 16416 | * object_add_to_user_list (GObject *object, |
| 16417 | * const gchar *new_string) |
| 16418 | * { |
| 16419 | * // the quark, naming the object data |
| 16420 | * GQuark quark_string_list = g_quark_from_static_string ("my-string-list"); |
| 16421 | * // retrieve the old string list |
| 16422 | * GList *list = g_object_steal_qdata (object, quark_string_list); |
| 16423 | * |
| 16424 | * // prepend new string |
| 16425 | * list = g_list_prepend (list, g_strdup (new_string)); |
| 16426 | * // this changed 'list', so we need to set it again |
| 16427 | * g_object_set_qdata_full (object, quark_string_list, list, free_string_list); |
| 16428 | * } |
| 16429 | * static void |
| 16430 | * free_string_list (gpointer data) |
| 16431 | * { |
| 16432 | * GList *node, *list = data; |
| 16433 | * |
| 16434 | * for (node = list; node; node = node->next) |
| 16435 | * g_free (node->data); |
| 16436 | * g_list_free (list); |
| 16437 | * } |
| 16438 | * ``` |
| 16439 | * |
| 16440 | * Using g_object_get_qdata() in the above example, instead of |
| 16441 | * g_object_steal_qdata() would have left the destroy function set, |
| 16442 | * and thus the partial string list would have been freed upon |
| 16443 | * g_object_set_qdata_full(). |
| 16444 | * @param quark A #GQuark, naming the user data pointer |
| 16445 | * @returns The user data pointer set, or %NULL |
| 16446 | */ |
| 16447 | steal_qdata(quark: GLib.Quark): any | null; |
| 16448 | /** |
| 16449 | * Reverts the effect of a previous call to |
| 16450 | * g_object_freeze_notify(). The freeze count is decreased on `object` |
| 16451 | * and when it reaches zero, queued "notify" signals are emitted. |
| 16452 | * |
| 16453 | * Duplicate notifications for each property are squashed so that at most one |
| 16454 | * #GObject::notify signal is emitted for each property, in the reverse order |
| 16455 | * in which they have been queued. |
| 16456 | * |
| 16457 | * It is an error to call this function when the freeze count is zero. |
| 16458 | */ |
| 16459 | thaw_notify(): void; |
| 16460 | /** |
| 16461 | * Decreases the reference count of `object`. When its reference count |
| 16462 | * drops to 0, the object is finalized (i.e. its memory is freed). |
| 16463 | * |
| 16464 | * If the pointer to the #GObject may be reused in future (for example, if it is |
| 16465 | * an instance variable of another object), it is recommended to clear the |
| 16466 | * pointer to %NULL rather than retain a dangling pointer to a potentially |
| 16467 | * invalid #GObject instance. Use g_clear_object() for this. |
| 16468 | */ |
| 16469 | unref(): void; |
| 16470 | /** |
| 16471 | * This function essentially limits the life time of the `closure` to |
| 16472 | * the life time of the object. That is, when the object is finalized, |
| 16473 | * the `closure` is invalidated by calling g_closure_invalidate() on |
| 16474 | * it, in order to prevent invocations of the closure with a finalized |
| 16475 | * (nonexisting) object. Also, g_object_ref() and g_object_unref() are |
| 16476 | * added as marshal guards to the `closure,` to ensure that an extra |
| 16477 | * reference count is held on `object` during invocation of the |
| 16478 | * `closure`. Usually, this function will be called on closures that |
| 16479 | * use this `object` as closure data. |
| 16480 | * @param closure #GClosure to watch |
| 16481 | */ |
| 16482 | watch_closure(closure: GObject.Closure): void; |
| 16483 | /** |
| 16484 | * the `constructed` function is called by g_object_new() as the |
| 16485 | * final step of the object creation process. At the point of the call, all |
| 16486 | * construction properties have been set on the object. The purpose of this |
| 16487 | * call is to allow for object initialisation steps that can only be performed |
| 16488 | * after construction properties have been set. `constructed` implementors |
| 16489 | * should chain up to the `constructed` call of their parent class to allow it |
| 16490 | * to complete its initialisation. |
| 16491 | */ |
| 16492 | vfunc_constructed(): void; |
| 16493 | /** |
| 16494 | * emits property change notification for a bunch |
| 16495 | * of properties. Overriding `dispatch_properties_changed` should be rarely |
| 16496 | * needed. |
| 16497 | * @param n_pspecs |
| 16498 | * @param pspecs |
| 16499 | */ |
| 16500 | vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void; |
| 16501 | /** |
| 16502 | * the `dispose` function is supposed to drop all references to other |
| 16503 | * objects, but keep the instance otherwise intact, so that client method |
| 16504 | * invocations still work. It may be run multiple times (due to reference |
| 16505 | * loops). Before returning, `dispose` should chain up to the `dispose` method |
| 16506 | * of the parent class. |
| 16507 | */ |
| 16508 | vfunc_dispose(): void; |
| 16509 | /** |
| 16510 | * instance finalization function, should finish the finalization of |
| 16511 | * the instance begun in `dispose` and chain up to the `finalize` method of the |
| 16512 | * parent class. |
| 16513 | */ |
| 16514 | vfunc_finalize(): void; |
| 16515 | /** |
| 16516 | * the generic getter for all properties of this type. Should be |
| 16517 | * overridden for every type with properties. |
| 16518 | * @param property_id |
| 16519 | * @param value |
| 16520 | * @param pspec |
| 16521 | */ |
| 16522 | vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void; |
| 16523 | /** |
| 16524 | * Emits a "notify" signal for the property `property_name` on `object`. |
| 16525 | * |
| 16526 | * When possible, eg. when signaling a property change from within the class |
| 16527 | * that registered the property, you should use g_object_notify_by_pspec() |
| 16528 | * instead. |
| 16529 | * |
| 16530 | * Note that emission of the notify signal may be blocked with |
| 16531 | * g_object_freeze_notify(). In this case, the signal emissions are queued |
| 16532 | * and will be emitted (in reverse order) when g_object_thaw_notify() is |
| 16533 | * called. |
| 16534 | * @param pspec |
| 16535 | */ |
| 16536 | vfunc_notify(pspec: GObject.ParamSpec): void; |
| 16537 | /** |
| 16538 | * the generic setter for all properties of this type. Should be |
| 16539 | * overridden for every type with properties. If implementations of |
| 16540 | * `set_property` don't emit property change notification explicitly, this will |
| 16541 | * be done implicitly by the type system. However, if the notify signal is |
| 16542 | * emitted explicitly, the type system will not emit it a second time. |
| 16543 | * @param property_id |
| 16544 | * @param value |
| 16545 | * @param pspec |
| 16546 | */ |
| 16547 | vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void; |
| 16548 | /** |
| 16549 | * Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to. |
| 16550 | * @param id Handler ID of the handler to be disconnected |
| 16551 | */ |
| 16552 | disconnect(id: number): void; |
| 16553 | /** |
| 16554 | * Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values. |
| 16555 | * @param properties Object containing the properties to set |
| 16556 | */ |
| 16557 | set(properties: { [key: string]: any }): void; |
| 16558 | /** |
| 16559 | * Blocks a handler of an instance so it will not be called during any signal emissions |
| 16560 | * @param id Handler ID of the handler to be blocked |
| 16561 | */ |
| 16562 | block_signal_handler(id: number): void; |
| 16563 | /** |
| 16564 | * Unblocks a handler so it will be called again during any signal emissions |
| 16565 | * @param id Handler ID of the handler to be unblocked |
| 16566 | */ |
| 16567 | unblock_signal_handler(id: number): void; |
| 16568 | /** |
| 16569 | * Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked. |
| 16570 | * @param detailedName Name of the signal to stop emission of |
| 16571 | */ |
| 16572 | stop_emission_by_name(detailedName: string): void; |
| 16573 | } |
| 16574 | |
| 16575 | type CertificateRendererClass = typeof CertificateRenderer; |
| 16576 | abstract class CertificateRendererPrivate { |
| 16577 | static $gtype: GObject.GType<CertificateRendererPrivate>; |
| 16578 | |
| 16579 | // Constructors |
| 16580 | |
| 16581 | _init(...args: any[]): void; |
| 16582 | } |
| 16583 | |
| 16584 | type CertificateWidgetClass = typeof CertificateWidget; |
| 16585 | abstract class CertificateWidgetPrivate { |
| 16586 | static $gtype: GObject.GType<CertificateWidgetPrivate>; |
| 16587 | |
| 16588 | // Constructors |
| 16589 | |
| 16590 | _init(...args: any[]): void; |
| 16591 | } |
| 16592 | |
| 16593 | type CollectionModelClass = typeof CollectionModel; |
| 16594 | abstract class CollectionModelPrivate { |
| 16595 | static $gtype: GObject.GType<CollectionModelPrivate>; |
| 16596 | |
| 16597 | // Constructors |
| 16598 | |
| 16599 | _init(...args: any[]): void; |
| 16600 | } |
| 16601 | |
| 16602 | type ComboSelectorClass = typeof ComboSelector; |
| 16603 | abstract class ComboSelectorPrivate { |
| 16604 | static $gtype: GObject.GType<ComboSelectorPrivate>; |
| 16605 | |
| 16606 | // Constructors |
| 16607 | |
| 16608 | _init(...args: any[]): void; |
| 16609 | } |
| 16610 | |
| 16611 | type FailureRendererClass = typeof FailureRenderer; |
| 16612 | abstract class FailureRendererPrivate { |
| 16613 | static $gtype: GObject.GType<FailureRendererPrivate>; |
| 16614 | |
| 16615 | // Constructors |
| 16616 | |
| 16617 | _init(...args: any[]): void; |
| 16618 | } |
| 16619 | |
| 16620 | type ImportButtonClass = typeof ImportButton; |
| 16621 | abstract class ImportButtonPrivate { |
| 16622 | static $gtype: GObject.GType<ImportButtonPrivate>; |
| 16623 | |
| 16624 | // Constructors |
| 16625 | |
| 16626 | _init(...args: any[]): void; |
| 16627 | } |
| 16628 | |
| 16629 | type KeyRendererClass = typeof KeyRenderer; |
| 16630 | abstract class KeyRendererPrivate { |
| 16631 | static $gtype: GObject.GType<KeyRendererPrivate>; |
| 16632 | |
| 16633 | // Constructors |
| 16634 | |
| 16635 | _init(...args: any[]): void; |
| 16636 | } |
| 16637 | |
| 16638 | type KeyWidgetClass = typeof KeyWidget; |
| 16639 | abstract class KeyWidgetPrivate { |
| 16640 | static $gtype: GObject.GType<KeyWidgetPrivate>; |
| 16641 | |
| 16642 | // Constructors |
| 16643 | |
| 16644 | _init(...args: any[]): void; |
| 16645 | } |
| 16646 | |
| 16647 | type ListSelectorClass = typeof ListSelector; |
| 16648 | abstract class ListSelectorPrivate { |
| 16649 | static $gtype: GObject.GType<ListSelectorPrivate>; |
| 16650 | |
| 16651 | // Constructors |
| 16652 | |
| 16653 | _init(...args: any[]): void; |
| 16654 | } |
| 16655 | |
| 16656 | type PromptDialogClass = typeof PromptDialog; |
| 16657 | abstract class PromptDialogPrivate { |
| 16658 | static $gtype: GObject.GType<PromptDialogPrivate>; |
| 16659 | |
| 16660 | // Constructors |
| 16661 | |
| 16662 | _init(...args: any[]): void; |
| 16663 | } |
| 16664 | |
| 16665 | type RendererIface = typeof Renderer; |
| 16666 | type SecureEntryBufferClass = typeof SecureEntryBuffer; |
| 16667 | abstract class SecureEntryBufferPrivate { |
| 16668 | static $gtype: GObject.GType<SecureEntryBufferPrivate>; |
| 16669 | |
| 16670 | // Constructors |
| 16671 | |
| 16672 | _init(...args: any[]): void; |
| 16673 | } |
| 16674 | |
| 16675 | type TreeSelectorClass = typeof TreeSelector; |
| 16676 | abstract class TreeSelectorPrivate { |
| 16677 | static $gtype: GObject.GType<TreeSelectorPrivate>; |
| 16678 | |
| 16679 | // Constructors |
| 16680 | |
| 16681 | _init(...args: any[]): void; |
| 16682 | } |
| 16683 | |
| 16684 | type UnlockOptionsWidgetClass = typeof UnlockOptionsWidget; |
| 16685 | abstract class UnlockOptionsWidgetPrivate { |
| 16686 | static $gtype: GObject.GType<UnlockOptionsWidgetPrivate>; |
| 16687 | |
| 16688 | // Constructors |
| 16689 | |
| 16690 | _init(...args: any[]): void; |
| 16691 | } |
| 16692 | |
| 16693 | type ViewerIface = typeof Viewer; |
| 16694 | type ViewerWidgetClass = typeof ViewerWidget; |
| 16695 | namespace Renderer { |
| 16696 | // Constructor properties interface |
| 16697 | |
| 16698 | interface ConstructorProps extends GObject.Object.ConstructorProps { |
| 16699 | attributes: Gck.Attributes; |
| 16700 | label: string; |
| 16701 | } |
| 16702 | } |
| 16703 | |
| 16704 | export interface RendererNamespace { |
| 16705 | $gtype: GObject.GType<Renderer>; |
| 16706 | prototype: Renderer; |
| 16707 | |
| 16708 | /** |
| 16709 | * Create and initialize a renderer for the given attributes and label. These |
| 16710 | * renderers should have been preregistered via gcr_renderer_register(). |
| 16711 | * @param label The label for the renderer |
| 16712 | * @param attrs The attributes to render |
| 16713 | */ |
| 16714 | create(label: string | null, attrs: Gck.Attributes): Renderer | null; |
| 16715 | /** |
| 16716 | * Register a renderer to be created when matching attributes are passed to |
| 16717 | * gcr_renderer_create(). |
| 16718 | * @param renderer_type The renderer class type |
| 16719 | * @param attrs The attributes to match |
| 16720 | */ |
| 16721 | register(renderer_type: GObject.GType, attrs: Gck.Attributes): void; |
| 16722 | /** |
| 16723 | * Register all the well known renderers for certificates and keys known to the |
| 16724 | * Gcr library. |
| 16725 | */ |
| 16726 | register_well_known(): void; |
| 16727 | } |
| 16728 | interface Renderer extends GObject.Object { |
| 16729 | // Properties |
| 16730 | |
| 16731 | /** |
| 16732 | * The attributes to display. |
| 16733 | */ |
| 16734 | get attributes(): Gck.Attributes; |
| 16735 | set attributes(val: Gck.Attributes); |
| 16736 | /** |
| 16737 | * The label to display. |
| 16738 | */ |
| 16739 | get label(): string; |
| 16740 | set label(val: string); |
| 16741 | |
| 16742 | // Methods |
| 16743 | |
| 16744 | /** |
| 16745 | * Emit the #GcrRenderer::data-changed signal on the renderer. This is used by |
| 16746 | * renderer implementations. |
| 16747 | */ |
| 16748 | emit_data_changed(): void; |
| 16749 | /** |
| 16750 | * Get the PKCS#11 attributes, if any, set for this renderer to display. |
| 16751 | * @returns the attributes, owned by the renderer |
| 16752 | */ |
| 16753 | get_attributes(): Gck.Attributes | null; |
| 16754 | /** |
| 16755 | * Called by #GcrViewer when about to display a popup menu for the content |
| 16756 | * displayed by the renderer. The renderer can add a menu item if desired. |
| 16757 | * @param viewer The viewer that is displaying a popup |
| 16758 | * @param menu The popup menu being displayed |
| 16759 | */ |
| 16760 | popuplate_popup(viewer: Viewer, menu: Gtk.Menu): void; |
| 16761 | /** |
| 16762 | * Render the contents of the renderer to the given viewer. |
| 16763 | * @param viewer The viewer to render to. |
| 16764 | */ |
| 16765 | render_view(viewer: Viewer): void; |
| 16766 | /** |
| 16767 | * Set the PKCS#11 attributes for this renderer to display. |
| 16768 | * @param attrs attributes to set |
| 16769 | */ |
| 16770 | set_attributes(attrs?: Gck.Attributes | null): void; |
| 16771 | |
| 16772 | // Virtual methods |
| 16773 | |
| 16774 | /** |
| 16775 | * signal emitted when data being rendered changes |
| 16776 | */ |
| 16777 | vfunc_data_changed(): void; |
| 16778 | /** |
| 16779 | * method invoked to populate a popup menu with additional |
| 16780 | * renderer options |
| 16781 | * @param viewer |
| 16782 | * @param menu |
| 16783 | */ |
| 16784 | vfunc_populate_popup(viewer: Viewer, menu: Gtk.Menu): void; |
| 16785 | /** |
| 16786 | * Render the contents of the renderer to the given viewer. |
| 16787 | * @param viewer The viewer to render to. |
| 16788 | */ |
| 16789 | vfunc_render_view(viewer: Viewer): void; |
| 16790 | } |
| 16791 | |
| 16792 | export const Renderer: RendererNamespace & { |
| 16793 | new (): Renderer; // This allows `obj instanceof Renderer` |
| 16794 | }; |
| 16795 | |
| 16796 | namespace Viewer { |
| 16797 | // Constructor properties interface |
| 16798 | |
| 16799 | interface ConstructorProps extends Gtk.Widget.ConstructorProps {} |
| 16800 | } |
| 16801 | |
| 16802 | export interface ViewerNamespace { |
| 16803 | $gtype: GObject.GType<Viewer>; |
| 16804 | prototype: Viewer; |
| 16805 | |
| 16806 | /** |
| 16807 | * Get an implementation of #GcrViewer that supports a view |
| 16808 | * of multiple renderers. |
| 16809 | */ |
| 16810 | ['new'](): Viewer; |
| 16811 | /** |
| 16812 | * Get an implementation of #GcrViewer that supports a scrolled view |
| 16813 | * of multiple renderers. |
| 16814 | */ |
| 16815 | new_scrolled(): Viewer; |
| 16816 | } |
| 16817 | interface Viewer extends Gtk.Widget { |
| 16818 | // Methods |
| 16819 | |
| 16820 | /** |
| 16821 | * Add a renderer to this viewer. |
| 16822 | * @param renderer The renderer to add |
| 16823 | */ |
| 16824 | add_renderer(renderer: Renderer): void; |
| 16825 | /** |
| 16826 | * Get the number of renderers present in the viewer. |
| 16827 | * @returns The number of renderers. |
| 16828 | */ |
| 16829 | count_renderers(): number; |
| 16830 | /** |
| 16831 | * Get a pointer to the renderer at the given index. It is an error to request |
| 16832 | * an index that is out of bounds. |
| 16833 | * @param index_ The index of the renderer to get |
| 16834 | * @returns the render, owned by the viewer |
| 16835 | */ |
| 16836 | get_renderer(index_: number): Renderer; |
| 16837 | /** |
| 16838 | * Insert a renderer at a specific point in the viewer |
| 16839 | * @param renderer the renderer to insert |
| 16840 | * @param before the renderer to insert before |
| 16841 | */ |
| 16842 | insert_renderer(renderer: Renderer, before?: Renderer | null): void; |
| 16843 | /** |
| 16844 | * Remove a renderer from this viewer. |
| 16845 | * @param renderer The renderer to remove |
| 16846 | */ |
| 16847 | remove_renderer(renderer: Renderer): void; |
| 16848 | |
| 16849 | // Virtual methods |
| 16850 | |
| 16851 | /** |
| 16852 | * Add a renderer to this viewer. |
| 16853 | * @param renderer The renderer to add |
| 16854 | */ |
| 16855 | vfunc_add_renderer(renderer: Renderer): void; |
| 16856 | /** |
| 16857 | * Get the number of renderers present in the viewer. |
| 16858 | */ |
| 16859 | vfunc_count_renderers(): number; |
| 16860 | /** |
| 16861 | * Get a pointer to the renderer at the given index. It is an error to request |
| 16862 | * an index that is out of bounds. |
| 16863 | * @param index_ The index of the renderer to get |
| 16864 | */ |
| 16865 | vfunc_get_renderer(index_: number): Renderer; |
| 16866 | /** |
| 16867 | * Insert a renderer at a specific point in the viewer |
| 16868 | * @param renderer the renderer to insert |
| 16869 | * @param before the renderer to insert before |
| 16870 | */ |
| 16871 | vfunc_insert_renderer(renderer: Renderer, before?: Renderer | null): void; |
| 16872 | /** |
| 16873 | * Remove a renderer from this viewer. |
| 16874 | * @param renderer The renderer to remove |
| 16875 | */ |
| 16876 | vfunc_remove_renderer(renderer: Renderer): void; |
| 16877 | } |
| 16878 | |
| 16879 | export const Viewer: ViewerNamespace & { |
| 16880 | new (): Viewer; // This allows `obj instanceof Viewer` |
| 16881 | }; |
| 16882 | |
| 16883 | /** |
| 16884 | * Name of the imported GIR library |
| 16885 | * `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188 |
| 16886 | */ |
| 16887 | const __name__: string; |
| 16888 | /** |
| 16889 | * Version of the imported GIR library |
| 16890 | * `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189 |
| 16891 | */ |
| 16892 | const __version__: string; |
| 16893 | } |
| 16894 | |
| 16895 | export default GcrUi; |
| 16896 | } |
| 16897 | |
| 16898 | declare module 'gi://GcrUi' { |
| 16899 | import GcrUi3 from 'gi://GcrUi?version=3'; |
| 16900 | export default GcrUi3; |
| 16901 | } |
| 16902 | // END |