@girs/gdk-4.0 4.0.0-3.2.0 → 4.0.0-3.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  ![downloads/week](https://img.shields.io/npm/dw/@girs/gdk-4.0)
6
6
 
7
7
 
8
- GJS TypeScript type definitions for Gdk-4.0, generated from library version 4.0.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v3.2.0.
8
+ GJS TypeScript type definitions for Gdk-4.0, generated from library version 4.0.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v3.2.2.
9
9
 
10
10
 
11
11
  ## Install
package/gdk-4.0.d.cts CHANGED
@@ -13,12 +13,12 @@ import './gdk-4.0-import.d.ts';
13
13
  */
14
14
 
15
15
  import type cairo from '@girs/cairo-1.0';
16
+ import type GObject from '@girs/gobject-2.0';
17
+ import type GLib from '@girs/glib-2.0';
16
18
  import type PangoCairo from '@girs/pangocairo-1.0';
17
19
  import type Pango from '@girs/pango-1.0';
18
20
  import type HarfBuzz from '@girs/harfbuzz-0.0';
19
21
  import type freetype2 from '@girs/freetype2-2.0';
20
- import type GObject from '@girs/gobject-2.0';
21
- import type GLib from '@girs/glib-2.0';
22
22
  import type Gio from '@girs/gio-2.0';
23
23
  import type GdkPixbuf from '@girs/gdkpixbuf-2.0';
24
24
  import type GModule from '@girs/gmodule-2.0';
@@ -572,6 +572,46 @@ export enum MemoryFormat {
572
572
  * alpha. Since: 4.6
573
573
  */
574
574
  R32G32B32A32_FLOAT,
575
+ /**
576
+ * 2 bytes; for grayscale, alpha. The color
577
+ * values are premultiplied with the alpha value. Since: 4.12
578
+ */
579
+ G8A8_PREMULTIPLIED,
580
+ /**
581
+ * 2 bytes; for grayscale, alpha. Since: 4.12
582
+ */
583
+ G8A8,
584
+ /**
585
+ * One byte; for grayscale. The data is opaque.
586
+ * Since: 4.12
587
+ */
588
+ G8,
589
+ /**
590
+ * 2 guint16 values; for grayscale, alpha.
591
+ * The color values are premultiplied with the alpha value. Since: 4.12
592
+ */
593
+ G16A16_PREMULTIPLIED,
594
+ /**
595
+ * 2 guint16 values; for grayscale, alpha. Since: 4.12
596
+ */
597
+ G16A16,
598
+ /**
599
+ * One guint16 value; for grayscale. The data is opaque.
600
+ * Since: 4.12
601
+ */
602
+ G16,
603
+ /**
604
+ * One byte; for alpha.
605
+ * Since: 4.12
606
+ */
607
+ A8,
608
+ /**
609
+ * One guint16 value; for alpha.
610
+ * Since: 4.12
611
+ */
612
+ A16,
613
+ A16_FLOAT,
614
+ A32_FLOAT,
575
615
  /**
576
616
  * The number of formats. This value will change as
577
617
  * more formats get added, so do not rely on its concrete integer.
@@ -1204,6 +1244,10 @@ export enum ToplevelState {
1204
1244
  * whether the left edge is resizable
1205
1245
  */
1206
1246
  LEFT_RESIZABLE,
1247
+ /**
1248
+ * the surface is not visible to the user
1249
+ */
1250
+ SUSPENDED,
1207
1251
  }
1208
1252
  /**
1209
1253
  * Defines all possible DND actions.
@@ -3719,6 +3763,7 @@ export function content_serialize_finish(result: Gio.AsyncResult): boolean
3719
3763
  * @returns %TRUE if exactly one action was given
3720
3764
  */
3721
3765
  export function drag_action_is_unique(action: DragAction): boolean
3766
+ export function drag_surface_size_get_type(): GObject.GType
3722
3767
  /**
3723
3768
  * Returns the relative angle from `event1` to `event2`.
3724
3769
  *
@@ -4068,6 +4113,16 @@ export class DevicePad extends GObject.Object {
4068
4113
 
4069
4114
  export module DragSurface {
4070
4115
 
4116
+ // Signal callback interfaces
4117
+
4118
+ /**
4119
+ * Signal callback interface for `compute-size`
4120
+ */
4121
+ export interface ComputeSizeSignalCallback {
4122
+ ($obj: DragSurface, size: DragSurfaceSize): void
4123
+ }
4124
+
4125
+
4071
4126
  // Constructor properties interface
4072
4127
 
4073
4128
  export interface ConstructorProperties extends Surface.ConstructorProperties, GObject.Object.ConstructorProperties {
@@ -4087,6 +4142,12 @@ export interface DragSurface extends Surface {
4087
4142
  */
4088
4143
  present(width: number, height: number): boolean
4089
4144
 
4145
+ // Own signals of Gdk-4.0.Gdk.DragSurface
4146
+
4147
+ connect(sigName: "compute-size", callback: DragSurface.ComputeSizeSignalCallback): number
4148
+ connect_after(sigName: "compute-size", callback: DragSurface.ComputeSizeSignalCallback): number
4149
+ emit(sigName: "compute-size", size: DragSurfaceSize, ...args: any[]): void
4150
+
4090
4151
  // Class property signals of Gdk-4.0.Gdk.DragSurface
4091
4152
 
4092
4153
  connect(sigName: "notify::cursor", callback: (($obj: DragSurface, pspec: GObject.ParamSpec) => void)): number
@@ -4104,6 +4165,9 @@ export interface DragSurface extends Surface {
4104
4165
  connect(sigName: "notify::mapped", callback: (($obj: DragSurface, pspec: GObject.ParamSpec) => void)): number
4105
4166
  connect_after(sigName: "notify::mapped", callback: (($obj: DragSurface, pspec: GObject.ParamSpec) => void)): number
4106
4167
  emit(sigName: "notify::mapped", ...args: any[]): void
4168
+ connect(sigName: "notify::scale", callback: (($obj: DragSurface, pspec: GObject.ParamSpec) => void)): number
4169
+ connect_after(sigName: "notify::scale", callback: (($obj: DragSurface, pspec: GObject.ParamSpec) => void)): number
4170
+ emit(sigName: "notify::scale", ...args: any[]): void
4107
4171
  connect(sigName: "notify::scale-factor", callback: (($obj: DragSurface, pspec: GObject.ParamSpec) => void)): number
4108
4172
  connect_after(sigName: "notify::scale-factor", callback: (($obj: DragSurface, pspec: GObject.ParamSpec) => void)): number
4109
4173
  emit(sigName: "notify::scale-factor", ...args: any[]): void
@@ -4581,6 +4645,9 @@ export interface Popup extends Surface {
4581
4645
  connect(sigName: "notify::mapped", callback: (($obj: Popup, pspec: GObject.ParamSpec) => void)): number
4582
4646
  connect_after(sigName: "notify::mapped", callback: (($obj: Popup, pspec: GObject.ParamSpec) => void)): number
4583
4647
  emit(sigName: "notify::mapped", ...args: any[]): void
4648
+ connect(sigName: "notify::scale", callback: (($obj: Popup, pspec: GObject.ParamSpec) => void)): number
4649
+ connect_after(sigName: "notify::scale", callback: (($obj: Popup, pspec: GObject.ParamSpec) => void)): number
4650
+ emit(sigName: "notify::scale", ...args: any[]): void
4584
4651
  connect(sigName: "notify::scale-factor", callback: (($obj: Popup, pspec: GObject.ParamSpec) => void)): number
4585
4652
  connect_after(sigName: "notify::scale-factor", callback: (($obj: Popup, pspec: GObject.ParamSpec) => void)): number
4586
4653
  emit(sigName: "notify::scale-factor", ...args: any[]): void
@@ -4966,6 +5033,9 @@ export interface Toplevel extends Surface {
4966
5033
  connect(sigName: "notify::mapped", callback: (($obj: Toplevel, pspec: GObject.ParamSpec) => void)): number
4967
5034
  connect_after(sigName: "notify::mapped", callback: (($obj: Toplevel, pspec: GObject.ParamSpec) => void)): number
4968
5035
  emit(sigName: "notify::mapped", ...args: any[]): void
5036
+ connect(sigName: "notify::scale", callback: (($obj: Toplevel, pspec: GObject.ParamSpec) => void)): number
5037
+ connect_after(sigName: "notify::scale", callback: (($obj: Toplevel, pspec: GObject.ParamSpec) => void)): number
5038
+ emit(sigName: "notify::scale", ...args: any[]): void
4969
5039
  connect(sigName: "notify::scale-factor", callback: (($obj: Toplevel, pspec: GObject.ParamSpec) => void)): number
4970
5040
  connect_after(sigName: "notify::scale-factor", callback: (($obj: Toplevel, pspec: GObject.ParamSpec) => void)): number
4971
5041
  emit(sigName: "notify::scale-factor", ...args: any[]): void
@@ -8252,6 +8322,8 @@ export interface Event {
8252
8322
  get_pointer_emulated(): boolean
8253
8323
  /**
8254
8324
  * Extract the event surface relative x/y coordinates from an event.
8325
+ *
8326
+ * This position is in [surface coordinates](coordinates.html).
8255
8327
  */
8256
8328
  get_position(): [ /* returnType */ boolean, /* x */ number, /* y */ number ]
8257
8329
  /**
@@ -8682,9 +8754,6 @@ export interface GLContext {
8682
8754
  * Retrieves the OpenGL version of the `context`.
8683
8755
  *
8684
8756
  * The `context` must be realized prior to calling this function.
8685
- *
8686
- * If the `context` has never been made current, the version cannot
8687
- * be known and it will return 0 for both `major` and `minor`.
8688
8757
  */
8689
8758
  get_version(): [ /* major */ number, /* minor */ number ]
8690
8759
  /**
@@ -8987,6 +9056,337 @@ export class GLTexture extends Texture {
8987
9056
  _init(config?: GLTexture.ConstructorProperties): void
8988
9057
  }
8989
9058
 
9059
+ export module GLTextureBuilder {
9060
+
9061
+ // Constructor properties interface
9062
+
9063
+ export interface ConstructorProperties extends GObject.Object.ConstructorProperties {
9064
+
9065
+ // Own constructor properties of Gdk-4.0.Gdk.GLTextureBuilder
9066
+
9067
+ /**
9068
+ * The context owning the texture.
9069
+ */
9070
+ context?: GLContext | null
9071
+ /**
9072
+ * The format when downloading the texture.
9073
+ */
9074
+ format?: MemoryFormat | null
9075
+ /**
9076
+ * If the texture has a mipmap.
9077
+ */
9078
+ has_mipmap?: boolean | null
9079
+ /**
9080
+ * The height of the texture.
9081
+ */
9082
+ height?: number | null
9083
+ /**
9084
+ * The texture ID to use.
9085
+ */
9086
+ id?: number | null
9087
+ /**
9088
+ * An optional `GLSync` object.
9089
+ *
9090
+ * If this is set, GTK will wait on it before using the texture.
9091
+ */
9092
+ sync?: any | null
9093
+ /**
9094
+ * The update region for [property`Gdk`.GLTextureBuilder:update-texture].
9095
+ */
9096
+ update_region?: cairo.Region | null
9097
+ /**
9098
+ * The texture [property`Gdk`.GLTextureBuilder:update-region] is an update for.
9099
+ */
9100
+ update_texture?: Texture | null
9101
+ /**
9102
+ * The width of the texture.
9103
+ */
9104
+ width?: number | null
9105
+ }
9106
+
9107
+ }
9108
+
9109
+ export interface GLTextureBuilder {
9110
+
9111
+ // Own properties of Gdk-4.0.Gdk.GLTextureBuilder
9112
+
9113
+ /**
9114
+ * The context owning the texture.
9115
+ */
9116
+ context: GLContext
9117
+ /**
9118
+ * The format when downloading the texture.
9119
+ */
9120
+ format: MemoryFormat
9121
+ /**
9122
+ * If the texture has a mipmap.
9123
+ */
9124
+ has_mipmap: boolean
9125
+ /**
9126
+ * The height of the texture.
9127
+ */
9128
+ height: number
9129
+ /**
9130
+ * The texture ID to use.
9131
+ */
9132
+ id: number
9133
+ /**
9134
+ * An optional `GLSync` object.
9135
+ *
9136
+ * If this is set, GTK will wait on it before using the texture.
9137
+ */
9138
+ sync: any
9139
+ /**
9140
+ * The update region for [property`Gdk`.GLTextureBuilder:update-texture].
9141
+ */
9142
+ update_region: cairo.Region
9143
+ /**
9144
+ * The texture [property`Gdk`.GLTextureBuilder:update-region] is an update for.
9145
+ */
9146
+ update_texture: Texture
9147
+ /**
9148
+ * The width of the texture.
9149
+ */
9150
+ width: number
9151
+
9152
+ // Owm methods of Gdk-4.0.Gdk.GLTextureBuilder
9153
+
9154
+ /**
9155
+ * Builds a new `GdkTexture` with the values set up in the builder.
9156
+ *
9157
+ * The `destroy` function gets called when the returned texture gets released;
9158
+ * either when the texture is finalized or by an explicit call to
9159
+ * [method`Gdk`.GLTexture.release]. It should release all GL resources associated
9160
+ * with the texture, such as the [property`Gdk`.GLTextureBuilder:id] and the
9161
+ * [property`Gdk`.GLTextureBuilder:sync].
9162
+ *
9163
+ * Note that it is a programming error to call this function if any mandatory
9164
+ * property has not been set.
9165
+ *
9166
+ * It is possible to call this function multiple times to create multiple textures,
9167
+ * possibly with changing properties in between.
9168
+ * @param destroy destroy function to be called when the texture is released
9169
+ * @param data user data to pass to the destroy function
9170
+ * @returns a newly built `GdkTexture`
9171
+ */
9172
+ build(destroy: GLib.DestroyNotify | null, data: any | null): Texture
9173
+ /**
9174
+ * Gets the context previously set via gdk_gl_texture_builder_set_context() or
9175
+ * %NULL if none was set.
9176
+ * @returns The context
9177
+ */
9178
+ get_context(): GLContext | null
9179
+ /**
9180
+ * Gets the format previously set via gdk_gl_texture_builder_set_format().
9181
+ * @returns The format
9182
+ */
9183
+ get_format(): MemoryFormat
9184
+ /**
9185
+ * Gets whether the texture has a mipmap.
9186
+ * @returns Whether the texture has a mipmap
9187
+ */
9188
+ get_has_mipmap(): boolean
9189
+ /**
9190
+ * Gets the height previously set via gdk_gl_texture_builder_set_height() or
9191
+ * 0 if the height wasn't set.
9192
+ * @returns The height
9193
+ */
9194
+ get_height(): number
9195
+ /**
9196
+ * Gets the texture id previously set via gdk_gl_texture_builder_set_id() or
9197
+ * 0 if the id wasn't set.
9198
+ * @returns The id
9199
+ */
9200
+ get_id(): number
9201
+ /**
9202
+ * Gets the `GLsync` previously set via gdk_gl_texture_builder_set_sync().
9203
+ * @returns the `GLSync`
9204
+ */
9205
+ get_sync(): any | null
9206
+ /**
9207
+ * Gets the region previously set via gdk_gl_texture_builder_set_update_region() or
9208
+ * %NULL if none was set.
9209
+ * @returns The region
9210
+ */
9211
+ get_update_region(): cairo.Region | null
9212
+ /**
9213
+ * Gets the texture previously set via gdk_gl_texture_builder_set_update_texture() or
9214
+ * %NULL if none was set.
9215
+ * @returns The texture
9216
+ */
9217
+ get_update_texture(): Texture | null
9218
+ /**
9219
+ * Gets the width previously set via gdk_gl_texture_builder_set_width() or
9220
+ * 0 if the width wasn't set.
9221
+ * @returns The width
9222
+ */
9223
+ get_width(): number
9224
+ /**
9225
+ * Sets the context to be used for the texture. This is the context that owns
9226
+ * the texture.
9227
+ *
9228
+ * The context must be set before calling [method`Gdk`.GLTextureBuilder.build].
9229
+ * @param context The context the texture beongs to or %NULL to unset
9230
+ */
9231
+ set_context(context: GLContext | null): void
9232
+ /**
9233
+ * Sets the format of the texture. The default is `GDK_MEMORY_R8G8B8A8_PREMULTIPLIED`.
9234
+ *
9235
+ * The format is the preferred format the texture data should be downloaded to. The
9236
+ * format must be supported by the GL version of [property`Gdk`.GLTextureBuilder:context].
9237
+ *
9238
+ * GDK's texture download code assumes that the format corresponds to the storage
9239
+ * parameters of the GL texture in an obvious way. For example, a format of
9240
+ * `GDK_MEMORY_R16G16B16A16_PREMULTIPLIED` is expected to be stored as `GL_RGBA16`
9241
+ * texture, and `GDK_MEMORY_G8A8` is expected to be stored as `GL_RG8` texture.
9242
+ *
9243
+ * Setting the right format is particularly useful when using high bit depth textures
9244
+ * to preserve the bit depth, to set the correct value for unpremultiplied textures
9245
+ * and to make sure opaque textures are treated as such.
9246
+ *
9247
+ * Non-RGBA textures need to have swizzling parameters set up properly to be usable
9248
+ * in GSK's shaders.
9249
+ * @param format The texture's format
9250
+ */
9251
+ set_format(format: MemoryFormat): void
9252
+ /**
9253
+ * Sets whether the texture has a mipmap. This allows the renderer and other users of the
9254
+ * generated texture to use a higher quality downscaling.
9255
+ *
9256
+ * Typically, the `glGenerateMipmap` function is used to generate a mimap.
9257
+ * @param has_mipmap Whether the texture has a mipmap
9258
+ */
9259
+ set_has_mipmap(has_mipmap: boolean): void
9260
+ /**
9261
+ * Sets the height of the texture.
9262
+ *
9263
+ * The height must be set before calling [method`Gdk`.GLTextureBuilder.build].
9264
+ * @param height The texture's height or 0 to unset
9265
+ */
9266
+ set_height(height: number): void
9267
+ /**
9268
+ * Sets the texture id of the texture. The texture id must remain unmodified
9269
+ * until the texture was finalized. See [method`Gdk`.GLTextureBuilder.build]
9270
+ * for a longer discussion.
9271
+ *
9272
+ * The id must be set before calling [method`Gdk`.GLTextureBuilder.build].
9273
+ * @param id The texture id to be used for creating the texture
9274
+ */
9275
+ set_id(id: number): void
9276
+ /**
9277
+ * Sets the GLSync object to use for the texture.
9278
+ *
9279
+ * GTK will wait on this object before using the created `GdkTexture`.
9280
+ *
9281
+ * The `destroy` function that is passed to [method`Gdk`.GLTextureBuilder.build]
9282
+ * is responsible for freeing the sync object when it is no longer needed.
9283
+ * The texture builder does not destroy it and it is the callers
9284
+ * responsibility to make sure it doesn't leak.
9285
+ * @param sync the GLSync object
9286
+ */
9287
+ set_sync(sync: any | null): void
9288
+ /**
9289
+ * Sets the region to be updated by this texture. Together with
9290
+ * [property`Gdk`.GLTextureBuilder:update-texture] this describes an
9291
+ * update of a previous texture.
9292
+ *
9293
+ * When rendering animations of large textures, it is possible that
9294
+ * consecutive textures are only updating contents in parts of the texture.
9295
+ * It is then possible to describe this update via these two properties,
9296
+ * so that GTK can avoid rerendering parts that did not change.
9297
+ *
9298
+ * An example would be a screen recording where only the mouse pointer moves.
9299
+ * @param region the region to update
9300
+ */
9301
+ set_update_region(region: cairo.Region | null): void
9302
+ /**
9303
+ * Sets the texture to be updated by this texture. See
9304
+ * [method`Gdk`.GLTextureBuilder.set_update_region] for an explanation.
9305
+ * @param texture the texture to update
9306
+ */
9307
+ set_update_texture(texture: Texture | null): void
9308
+ /**
9309
+ * Sets the width of the texture.
9310
+ *
9311
+ * The width must be set before calling [method`Gdk`.GLTextureBuilder.build].
9312
+ * @param width The texture's width or 0 to unset
9313
+ */
9314
+ set_width(width: number): void
9315
+
9316
+ // Class property signals of Gdk-4.0.Gdk.GLTextureBuilder
9317
+
9318
+ connect(sigName: "notify::context", callback: (($obj: GLTextureBuilder, pspec: GObject.ParamSpec) => void)): number
9319
+ connect_after(sigName: "notify::context", callback: (($obj: GLTextureBuilder, pspec: GObject.ParamSpec) => void)): number
9320
+ emit(sigName: "notify::context", ...args: any[]): void
9321
+ connect(sigName: "notify::format", callback: (($obj: GLTextureBuilder, pspec: GObject.ParamSpec) => void)): number
9322
+ connect_after(sigName: "notify::format", callback: (($obj: GLTextureBuilder, pspec: GObject.ParamSpec) => void)): number
9323
+ emit(sigName: "notify::format", ...args: any[]): void
9324
+ connect(sigName: "notify::has-mipmap", callback: (($obj: GLTextureBuilder, pspec: GObject.ParamSpec) => void)): number
9325
+ connect_after(sigName: "notify::has-mipmap", callback: (($obj: GLTextureBuilder, pspec: GObject.ParamSpec) => void)): number
9326
+ emit(sigName: "notify::has-mipmap", ...args: any[]): void
9327
+ connect(sigName: "notify::height", callback: (($obj: GLTextureBuilder, pspec: GObject.ParamSpec) => void)): number
9328
+ connect_after(sigName: "notify::height", callback: (($obj: GLTextureBuilder, pspec: GObject.ParamSpec) => void)): number
9329
+ emit(sigName: "notify::height", ...args: any[]): void
9330
+ connect(sigName: "notify::id", callback: (($obj: GLTextureBuilder, pspec: GObject.ParamSpec) => void)): number
9331
+ connect_after(sigName: "notify::id", callback: (($obj: GLTextureBuilder, pspec: GObject.ParamSpec) => void)): number
9332
+ emit(sigName: "notify::id", ...args: any[]): void
9333
+ connect(sigName: "notify::sync", callback: (($obj: GLTextureBuilder, pspec: GObject.ParamSpec) => void)): number
9334
+ connect_after(sigName: "notify::sync", callback: (($obj: GLTextureBuilder, pspec: GObject.ParamSpec) => void)): number
9335
+ emit(sigName: "notify::sync", ...args: any[]): void
9336
+ connect(sigName: "notify::update-region", callback: (($obj: GLTextureBuilder, pspec: GObject.ParamSpec) => void)): number
9337
+ connect_after(sigName: "notify::update-region", callback: (($obj: GLTextureBuilder, pspec: GObject.ParamSpec) => void)): number
9338
+ emit(sigName: "notify::update-region", ...args: any[]): void
9339
+ connect(sigName: "notify::update-texture", callback: (($obj: GLTextureBuilder, pspec: GObject.ParamSpec) => void)): number
9340
+ connect_after(sigName: "notify::update-texture", callback: (($obj: GLTextureBuilder, pspec: GObject.ParamSpec) => void)): number
9341
+ emit(sigName: "notify::update-texture", ...args: any[]): void
9342
+ connect(sigName: "notify::width", callback: (($obj: GLTextureBuilder, pspec: GObject.ParamSpec) => void)): number
9343
+ connect_after(sigName: "notify::width", callback: (($obj: GLTextureBuilder, pspec: GObject.ParamSpec) => void)): number
9344
+ emit(sigName: "notify::width", ...args: any[]): void
9345
+ connect(sigName: string, callback: (...args: any[]) => void): number
9346
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
9347
+ emit(sigName: string, ...args: any[]): void
9348
+ disconnect(id: number): void
9349
+ }
9350
+
9351
+ /**
9352
+ * `GdkGLTextureBuilder` is a buider used to construct [class`Gdk`.Texture] objects from
9353
+ * GL textures.
9354
+ *
9355
+ * The operation is quite simple: Create a texture builder, set all the necessary
9356
+ * properties - keep in mind that the properties [property`Gdk`.GLTextureBuilder:context],
9357
+ * [property`Gdk`.GLTextureBuilder:id], [property`Gdk`.GLTextureBuilder:width], and
9358
+ * [property`Gdk`.GLTextureBuilder:height] are mandatory - and then call
9359
+ * [method`Gdk`.GLTextureBuilder.build] to create the new texture.
9360
+ *
9361
+ * `GdkGLTextureBuilder` can be used for quick one-shot construction of
9362
+ * textures as well as kept around and reused to construct multiple textures.
9363
+ * @class
9364
+ */
9365
+ export class GLTextureBuilder extends GObject.Object {
9366
+
9367
+ // Own properties of Gdk-4.0.Gdk.GLTextureBuilder
9368
+
9369
+ static name: string
9370
+ static $gtype: GObject.GType<GLTextureBuilder>
9371
+
9372
+ // Constructors of Gdk-4.0.Gdk.GLTextureBuilder
9373
+
9374
+ constructor(config?: GLTextureBuilder.ConstructorProperties)
9375
+ /**
9376
+ * Creates a new texture builder.
9377
+ * @constructor
9378
+ * @returns the new `GdkTextureBuilder`
9379
+ */
9380
+ constructor()
9381
+ /**
9382
+ * Creates a new texture builder.
9383
+ * @constructor
9384
+ * @returns the new `GdkTextureBuilder`
9385
+ */
9386
+ static new(): GLTextureBuilder
9387
+ _init(config?: GLTextureBuilder.ConstructorProperties): void
9388
+ }
9389
+
8990
9390
  export interface GrabBrokenEvent {
8991
9391
 
8992
9392
  // Owm methods of Gdk-4.0.Gdk.GrabBrokenEvent
@@ -9773,8 +10173,15 @@ export interface Surface {
9773
10173
  * Whether the surface is mapped.
9774
10174
  */
9775
10175
  readonly mapped: boolean
10176
+ /**
10177
+ * The scale of the surface.
10178
+ */
10179
+ readonly scale: number
9776
10180
  /**
9777
10181
  * The scale factor of the surface.
10182
+ *
10183
+ * The scale factor is the next larger integer,
10184
+ * compared to [property`Gdk`.Surface:scale].
9778
10185
  */
9779
10186
  readonly scale_factor: number
9780
10187
  /**
@@ -9908,6 +10315,21 @@ export interface Surface {
9908
10315
  * @returns %TRUE if the surface is mapped
9909
10316
  */
9910
10317
  get_mapped(): boolean
10318
+ /**
10319
+ * Returns the internal scale that maps from surface coordinates
10320
+ * to the actual device pixels.
10321
+ *
10322
+ * When the scale is bigger than 1, the windowing system prefers to get
10323
+ * buffers with a resolution that is bigger than the surface size (e.g.
10324
+ * to show the surface on a high-resolution display, or in a magnifier).
10325
+ *
10326
+ * Compare with [method`Gdk`.Surface.get_scale_factor], which returns the
10327
+ * next larger integer.
10328
+ *
10329
+ * The scale may change during the lifetime of the surface.
10330
+ * @returns the scale
10331
+ */
10332
+ get_scale(): number
9911
10333
  /**
9912
10334
  * Returns the internal scale factor that maps from surface coordinates
9913
10335
  * to the actual device pixels.
@@ -9919,7 +10341,7 @@ export interface Surface {
9919
10341
  * pixel-based data the scale value can be used to determine whether to
9920
10342
  * use a pixel resource with higher resolution data.
9921
10343
  *
9922
- * The scale of a surface may change during runtime.
10344
+ * The scale factor may change during the lifetime of the surface.
9923
10345
  * @returns the scale factor
9924
10346
  */
9925
10347
  get_scale_factor(): number
@@ -10067,6 +10489,9 @@ export interface Surface {
10067
10489
  connect(sigName: "notify::mapped", callback: (($obj: Surface, pspec: GObject.ParamSpec) => void)): number
10068
10490
  connect_after(sigName: "notify::mapped", callback: (($obj: Surface, pspec: GObject.ParamSpec) => void)): number
10069
10491
  emit(sigName: "notify::mapped", ...args: any[]): void
10492
+ connect(sigName: "notify::scale", callback: (($obj: Surface, pspec: GObject.ParamSpec) => void)): number
10493
+ connect_after(sigName: "notify::scale", callback: (($obj: Surface, pspec: GObject.ParamSpec) => void)): number
10494
+ emit(sigName: "notify::scale", ...args: any[]): void
10070
10495
  connect(sigName: "notify::scale-factor", callback: (($obj: Surface, pspec: GObject.ParamSpec) => void)): number
10071
10496
  connect_after(sigName: "notify::scale-factor", callback: (($obj: Surface, pspec: GObject.ParamSpec) => void)): number
10072
10497
  emit(sigName: "notify::scale-factor", ...args: any[]): void
@@ -10283,7 +10708,8 @@ export interface Texture extends Paintable, Gio.Icon, Gio.LoadableIcon {
10283
10708
  * multiple frames, and will be used for a long time.
10284
10709
  *
10285
10710
  * There are various ways to create `GdkTexture` objects from a
10286
- * [class`GdkPixbuf`.Pixbuf], or a Cairo surface, or other pixel data.
10711
+ * [class`GdkPixbuf`.Pixbuf], or from bytes stored in memory, a file, or a
10712
+ * [struct`Gio`.Resource].
10287
10713
  *
10288
10714
  * The ownership of the pixel data is transferred to the `GdkTexture`
10289
10715
  * instance; you can only make a copy of it, via [method`Gdk`.Texture.download].
@@ -10851,6 +11277,30 @@ export abstract class DragSurfaceInterface {
10851
11277
  static name: string
10852
11278
  }
10853
11279
 
11280
+ export interface DragSurfaceSize {
11281
+
11282
+ // Owm methods of Gdk-4.0.Gdk.DragSurfaceSize
11283
+
11284
+ /**
11285
+ * Sets the size the drag surface prefers to be resized to.
11286
+ * @param width the width
11287
+ * @param height the height
11288
+ */
11289
+ set_size(width: number, height: number): void
11290
+ }
11291
+
11292
+ /**
11293
+ * The `GdkDragSurfaceSize` struct contains information that is useful
11294
+ * to compute the size of a drag surface.
11295
+ * @record
11296
+ */
11297
+ export class DragSurfaceSize {
11298
+
11299
+ // Own properties of Gdk-4.0.Gdk.DragSurfaceSize
11300
+
11301
+ static name: string
11302
+ }
11303
+
10854
11304
  export interface EventSequence {
10855
11305
  }
10856
11306
 
@@ -11030,6 +11480,16 @@ export class FrameTimings {
11030
11480
  static name: string
11031
11481
  }
11032
11482
 
11483
+ export interface GLTextureBuilderClass {
11484
+ }
11485
+
11486
+ export abstract class GLTextureBuilderClass {
11487
+
11488
+ // Own properties of Gdk-4.0.Gdk.GLTextureBuilderClass
11489
+
11490
+ static name: string
11491
+ }
11492
+
11033
11493
  export interface GLTextureClass {
11034
11494
  }
11035
11495
 
@@ -11592,10 +12052,10 @@ export interface TextureDownloader {
11592
12052
  * be stored in the stride value.
11593
12053
  *
11594
12054
  * This function will abort if it tries to download a large texture and
11595
- * fails to allocate memory. If you think that may happen, you should
11596
- * handle memory allocation yourself and use
11597
- * gdk_texture_downloader_download_into() once allocation succeeded.
11598
- * @returns The downloaded pixels.
12055
+ * fails to allocate memory. If you think that may happen, you should handle
12056
+ * memory allocation yourself and use [method`Gdk`.TextureDownloader.download_into]
12057
+ * once allocation succeeded.
12058
+ * @returns The downloaded pixels
11599
12059
  */
11600
12060
  download_bytes(): [ /* returnType */ GLib.Bytes, /* out_stride */ number ]
11601
12061
  /**
package/gdk-4.0.d.ts CHANGED
@@ -13,12 +13,12 @@ import './gdk-4.0-import.d.ts';
13
13
  */
14
14
 
15
15
  import type cairo from '@girs/cairo-1.0';
16
+ import type GObject from '@girs/gobject-2.0';
17
+ import type GLib from '@girs/glib-2.0';
16
18
  import type PangoCairo from '@girs/pangocairo-1.0';
17
19
  import type Pango from '@girs/pango-1.0';
18
20
  import type HarfBuzz from '@girs/harfbuzz-0.0';
19
21
  import type freetype2 from '@girs/freetype2-2.0';
20
- import type GObject from '@girs/gobject-2.0';
21
- import type GLib from '@girs/glib-2.0';
22
22
  import type Gio from '@girs/gio-2.0';
23
23
  import type GdkPixbuf from '@girs/gdkpixbuf-2.0';
24
24
  import type GModule from '@girs/gmodule-2.0';
@@ -574,6 +574,46 @@ enum MemoryFormat {
574
574
  * alpha. Since: 4.6
575
575
  */
576
576
  R32G32B32A32_FLOAT,
577
+ /**
578
+ * 2 bytes; for grayscale, alpha. The color
579
+ * values are premultiplied with the alpha value. Since: 4.12
580
+ */
581
+ G8A8_PREMULTIPLIED,
582
+ /**
583
+ * 2 bytes; for grayscale, alpha. Since: 4.12
584
+ */
585
+ G8A8,
586
+ /**
587
+ * One byte; for grayscale. The data is opaque.
588
+ * Since: 4.12
589
+ */
590
+ G8,
591
+ /**
592
+ * 2 guint16 values; for grayscale, alpha.
593
+ * The color values are premultiplied with the alpha value. Since: 4.12
594
+ */
595
+ G16A16_PREMULTIPLIED,
596
+ /**
597
+ * 2 guint16 values; for grayscale, alpha. Since: 4.12
598
+ */
599
+ G16A16,
600
+ /**
601
+ * One guint16 value; for grayscale. The data is opaque.
602
+ * Since: 4.12
603
+ */
604
+ G16,
605
+ /**
606
+ * One byte; for alpha.
607
+ * Since: 4.12
608
+ */
609
+ A8,
610
+ /**
611
+ * One guint16 value; for alpha.
612
+ * Since: 4.12
613
+ */
614
+ A16,
615
+ A16_FLOAT,
616
+ A32_FLOAT,
577
617
  /**
578
618
  * The number of formats. This value will change as
579
619
  * more formats get added, so do not rely on its concrete integer.
@@ -1206,6 +1246,10 @@ enum ToplevelState {
1206
1246
  * whether the left edge is resizable
1207
1247
  */
1208
1248
  LEFT_RESIZABLE,
1249
+ /**
1250
+ * the surface is not visible to the user
1251
+ */
1252
+ SUSPENDED,
1209
1253
  }
1210
1254
  /**
1211
1255
  * Defines all possible DND actions.
@@ -3721,6 +3765,7 @@ function content_serialize_finish(result: Gio.AsyncResult): boolean
3721
3765
  * @returns %TRUE if exactly one action was given
3722
3766
  */
3723
3767
  function drag_action_is_unique(action: DragAction): boolean
3768
+ function drag_surface_size_get_type(): GObject.GType
3724
3769
  /**
3725
3770
  * Returns the relative angle from `event1` to `event2`.
3726
3771
  *
@@ -4070,6 +4115,16 @@ class DevicePad extends GObject.Object {
4070
4115
 
4071
4116
  module DragSurface {
4072
4117
 
4118
+ // Signal callback interfaces
4119
+
4120
+ /**
4121
+ * Signal callback interface for `compute-size`
4122
+ */
4123
+ interface ComputeSizeSignalCallback {
4124
+ ($obj: DragSurface, size: DragSurfaceSize): void
4125
+ }
4126
+
4127
+
4073
4128
  // Constructor properties interface
4074
4129
 
4075
4130
  interface ConstructorProperties extends Surface.ConstructorProperties, GObject.Object.ConstructorProperties {
@@ -4089,6 +4144,12 @@ interface DragSurface extends Surface {
4089
4144
  */
4090
4145
  present(width: number, height: number): boolean
4091
4146
 
4147
+ // Own signals of Gdk-4.0.Gdk.DragSurface
4148
+
4149
+ connect(sigName: "compute-size", callback: DragSurface.ComputeSizeSignalCallback): number
4150
+ connect_after(sigName: "compute-size", callback: DragSurface.ComputeSizeSignalCallback): number
4151
+ emit(sigName: "compute-size", size: DragSurfaceSize, ...args: any[]): void
4152
+
4092
4153
  // Class property signals of Gdk-4.0.Gdk.DragSurface
4093
4154
 
4094
4155
  connect(sigName: "notify::cursor", callback: (($obj: DragSurface, pspec: GObject.ParamSpec) => void)): number
@@ -4106,6 +4167,9 @@ interface DragSurface extends Surface {
4106
4167
  connect(sigName: "notify::mapped", callback: (($obj: DragSurface, pspec: GObject.ParamSpec) => void)): number
4107
4168
  connect_after(sigName: "notify::mapped", callback: (($obj: DragSurface, pspec: GObject.ParamSpec) => void)): number
4108
4169
  emit(sigName: "notify::mapped", ...args: any[]): void
4170
+ connect(sigName: "notify::scale", callback: (($obj: DragSurface, pspec: GObject.ParamSpec) => void)): number
4171
+ connect_after(sigName: "notify::scale", callback: (($obj: DragSurface, pspec: GObject.ParamSpec) => void)): number
4172
+ emit(sigName: "notify::scale", ...args: any[]): void
4109
4173
  connect(sigName: "notify::scale-factor", callback: (($obj: DragSurface, pspec: GObject.ParamSpec) => void)): number
4110
4174
  connect_after(sigName: "notify::scale-factor", callback: (($obj: DragSurface, pspec: GObject.ParamSpec) => void)): number
4111
4175
  emit(sigName: "notify::scale-factor", ...args: any[]): void
@@ -4583,6 +4647,9 @@ interface Popup extends Surface {
4583
4647
  connect(sigName: "notify::mapped", callback: (($obj: Popup, pspec: GObject.ParamSpec) => void)): number
4584
4648
  connect_after(sigName: "notify::mapped", callback: (($obj: Popup, pspec: GObject.ParamSpec) => void)): number
4585
4649
  emit(sigName: "notify::mapped", ...args: any[]): void
4650
+ connect(sigName: "notify::scale", callback: (($obj: Popup, pspec: GObject.ParamSpec) => void)): number
4651
+ connect_after(sigName: "notify::scale", callback: (($obj: Popup, pspec: GObject.ParamSpec) => void)): number
4652
+ emit(sigName: "notify::scale", ...args: any[]): void
4586
4653
  connect(sigName: "notify::scale-factor", callback: (($obj: Popup, pspec: GObject.ParamSpec) => void)): number
4587
4654
  connect_after(sigName: "notify::scale-factor", callback: (($obj: Popup, pspec: GObject.ParamSpec) => void)): number
4588
4655
  emit(sigName: "notify::scale-factor", ...args: any[]): void
@@ -4968,6 +5035,9 @@ interface Toplevel extends Surface {
4968
5035
  connect(sigName: "notify::mapped", callback: (($obj: Toplevel, pspec: GObject.ParamSpec) => void)): number
4969
5036
  connect_after(sigName: "notify::mapped", callback: (($obj: Toplevel, pspec: GObject.ParamSpec) => void)): number
4970
5037
  emit(sigName: "notify::mapped", ...args: any[]): void
5038
+ connect(sigName: "notify::scale", callback: (($obj: Toplevel, pspec: GObject.ParamSpec) => void)): number
5039
+ connect_after(sigName: "notify::scale", callback: (($obj: Toplevel, pspec: GObject.ParamSpec) => void)): number
5040
+ emit(sigName: "notify::scale", ...args: any[]): void
4971
5041
  connect(sigName: "notify::scale-factor", callback: (($obj: Toplevel, pspec: GObject.ParamSpec) => void)): number
4972
5042
  connect_after(sigName: "notify::scale-factor", callback: (($obj: Toplevel, pspec: GObject.ParamSpec) => void)): number
4973
5043
  emit(sigName: "notify::scale-factor", ...args: any[]): void
@@ -8254,6 +8324,8 @@ interface Event {
8254
8324
  get_pointer_emulated(): boolean
8255
8325
  /**
8256
8326
  * Extract the event surface relative x/y coordinates from an event.
8327
+ *
8328
+ * This position is in [surface coordinates](coordinates.html).
8257
8329
  */
8258
8330
  get_position(): [ /* returnType */ boolean, /* x */ number, /* y */ number ]
8259
8331
  /**
@@ -8684,9 +8756,6 @@ interface GLContext {
8684
8756
  * Retrieves the OpenGL version of the `context`.
8685
8757
  *
8686
8758
  * The `context` must be realized prior to calling this function.
8687
- *
8688
- * If the `context` has never been made current, the version cannot
8689
- * be known and it will return 0 for both `major` and `minor`.
8690
8759
  */
8691
8760
  get_version(): [ /* major */ number, /* minor */ number ]
8692
8761
  /**
@@ -8989,6 +9058,337 @@ class GLTexture extends Texture {
8989
9058
  _init(config?: GLTexture.ConstructorProperties): void
8990
9059
  }
8991
9060
 
9061
+ module GLTextureBuilder {
9062
+
9063
+ // Constructor properties interface
9064
+
9065
+ interface ConstructorProperties extends GObject.Object.ConstructorProperties {
9066
+
9067
+ // Own constructor properties of Gdk-4.0.Gdk.GLTextureBuilder
9068
+
9069
+ /**
9070
+ * The context owning the texture.
9071
+ */
9072
+ context?: GLContext | null
9073
+ /**
9074
+ * The format when downloading the texture.
9075
+ */
9076
+ format?: MemoryFormat | null
9077
+ /**
9078
+ * If the texture has a mipmap.
9079
+ */
9080
+ has_mipmap?: boolean | null
9081
+ /**
9082
+ * The height of the texture.
9083
+ */
9084
+ height?: number | null
9085
+ /**
9086
+ * The texture ID to use.
9087
+ */
9088
+ id?: number | null
9089
+ /**
9090
+ * An optional `GLSync` object.
9091
+ *
9092
+ * If this is set, GTK will wait on it before using the texture.
9093
+ */
9094
+ sync?: any | null
9095
+ /**
9096
+ * The update region for [property`Gdk`.GLTextureBuilder:update-texture].
9097
+ */
9098
+ update_region?: cairo.Region | null
9099
+ /**
9100
+ * The texture [property`Gdk`.GLTextureBuilder:update-region] is an update for.
9101
+ */
9102
+ update_texture?: Texture | null
9103
+ /**
9104
+ * The width of the texture.
9105
+ */
9106
+ width?: number | null
9107
+ }
9108
+
9109
+ }
9110
+
9111
+ interface GLTextureBuilder {
9112
+
9113
+ // Own properties of Gdk-4.0.Gdk.GLTextureBuilder
9114
+
9115
+ /**
9116
+ * The context owning the texture.
9117
+ */
9118
+ context: GLContext
9119
+ /**
9120
+ * The format when downloading the texture.
9121
+ */
9122
+ format: MemoryFormat
9123
+ /**
9124
+ * If the texture has a mipmap.
9125
+ */
9126
+ has_mipmap: boolean
9127
+ /**
9128
+ * The height of the texture.
9129
+ */
9130
+ height: number
9131
+ /**
9132
+ * The texture ID to use.
9133
+ */
9134
+ id: number
9135
+ /**
9136
+ * An optional `GLSync` object.
9137
+ *
9138
+ * If this is set, GTK will wait on it before using the texture.
9139
+ */
9140
+ sync: any
9141
+ /**
9142
+ * The update region for [property`Gdk`.GLTextureBuilder:update-texture].
9143
+ */
9144
+ update_region: cairo.Region
9145
+ /**
9146
+ * The texture [property`Gdk`.GLTextureBuilder:update-region] is an update for.
9147
+ */
9148
+ update_texture: Texture
9149
+ /**
9150
+ * The width of the texture.
9151
+ */
9152
+ width: number
9153
+
9154
+ // Owm methods of Gdk-4.0.Gdk.GLTextureBuilder
9155
+
9156
+ /**
9157
+ * Builds a new `GdkTexture` with the values set up in the builder.
9158
+ *
9159
+ * The `destroy` function gets called when the returned texture gets released;
9160
+ * either when the texture is finalized or by an explicit call to
9161
+ * [method`Gdk`.GLTexture.release]. It should release all GL resources associated
9162
+ * with the texture, such as the [property`Gdk`.GLTextureBuilder:id] and the
9163
+ * [property`Gdk`.GLTextureBuilder:sync].
9164
+ *
9165
+ * Note that it is a programming error to call this function if any mandatory
9166
+ * property has not been set.
9167
+ *
9168
+ * It is possible to call this function multiple times to create multiple textures,
9169
+ * possibly with changing properties in between.
9170
+ * @param destroy destroy function to be called when the texture is released
9171
+ * @param data user data to pass to the destroy function
9172
+ * @returns a newly built `GdkTexture`
9173
+ */
9174
+ build(destroy: GLib.DestroyNotify | null, data: any | null): Texture
9175
+ /**
9176
+ * Gets the context previously set via gdk_gl_texture_builder_set_context() or
9177
+ * %NULL if none was set.
9178
+ * @returns The context
9179
+ */
9180
+ get_context(): GLContext | null
9181
+ /**
9182
+ * Gets the format previously set via gdk_gl_texture_builder_set_format().
9183
+ * @returns The format
9184
+ */
9185
+ get_format(): MemoryFormat
9186
+ /**
9187
+ * Gets whether the texture has a mipmap.
9188
+ * @returns Whether the texture has a mipmap
9189
+ */
9190
+ get_has_mipmap(): boolean
9191
+ /**
9192
+ * Gets the height previously set via gdk_gl_texture_builder_set_height() or
9193
+ * 0 if the height wasn't set.
9194
+ * @returns The height
9195
+ */
9196
+ get_height(): number
9197
+ /**
9198
+ * Gets the texture id previously set via gdk_gl_texture_builder_set_id() or
9199
+ * 0 if the id wasn't set.
9200
+ * @returns The id
9201
+ */
9202
+ get_id(): number
9203
+ /**
9204
+ * Gets the `GLsync` previously set via gdk_gl_texture_builder_set_sync().
9205
+ * @returns the `GLSync`
9206
+ */
9207
+ get_sync(): any | null
9208
+ /**
9209
+ * Gets the region previously set via gdk_gl_texture_builder_set_update_region() or
9210
+ * %NULL if none was set.
9211
+ * @returns The region
9212
+ */
9213
+ get_update_region(): cairo.Region | null
9214
+ /**
9215
+ * Gets the texture previously set via gdk_gl_texture_builder_set_update_texture() or
9216
+ * %NULL if none was set.
9217
+ * @returns The texture
9218
+ */
9219
+ get_update_texture(): Texture | null
9220
+ /**
9221
+ * Gets the width previously set via gdk_gl_texture_builder_set_width() or
9222
+ * 0 if the width wasn't set.
9223
+ * @returns The width
9224
+ */
9225
+ get_width(): number
9226
+ /**
9227
+ * Sets the context to be used for the texture. This is the context that owns
9228
+ * the texture.
9229
+ *
9230
+ * The context must be set before calling [method`Gdk`.GLTextureBuilder.build].
9231
+ * @param context The context the texture beongs to or %NULL to unset
9232
+ */
9233
+ set_context(context: GLContext | null): void
9234
+ /**
9235
+ * Sets the format of the texture. The default is `GDK_MEMORY_R8G8B8A8_PREMULTIPLIED`.
9236
+ *
9237
+ * The format is the preferred format the texture data should be downloaded to. The
9238
+ * format must be supported by the GL version of [property`Gdk`.GLTextureBuilder:context].
9239
+ *
9240
+ * GDK's texture download code assumes that the format corresponds to the storage
9241
+ * parameters of the GL texture in an obvious way. For example, a format of
9242
+ * `GDK_MEMORY_R16G16B16A16_PREMULTIPLIED` is expected to be stored as `GL_RGBA16`
9243
+ * texture, and `GDK_MEMORY_G8A8` is expected to be stored as `GL_RG8` texture.
9244
+ *
9245
+ * Setting the right format is particularly useful when using high bit depth textures
9246
+ * to preserve the bit depth, to set the correct value for unpremultiplied textures
9247
+ * and to make sure opaque textures are treated as such.
9248
+ *
9249
+ * Non-RGBA textures need to have swizzling parameters set up properly to be usable
9250
+ * in GSK's shaders.
9251
+ * @param format The texture's format
9252
+ */
9253
+ set_format(format: MemoryFormat): void
9254
+ /**
9255
+ * Sets whether the texture has a mipmap. This allows the renderer and other users of the
9256
+ * generated texture to use a higher quality downscaling.
9257
+ *
9258
+ * Typically, the `glGenerateMipmap` function is used to generate a mimap.
9259
+ * @param has_mipmap Whether the texture has a mipmap
9260
+ */
9261
+ set_has_mipmap(has_mipmap: boolean): void
9262
+ /**
9263
+ * Sets the height of the texture.
9264
+ *
9265
+ * The height must be set before calling [method`Gdk`.GLTextureBuilder.build].
9266
+ * @param height The texture's height or 0 to unset
9267
+ */
9268
+ set_height(height: number): void
9269
+ /**
9270
+ * Sets the texture id of the texture. The texture id must remain unmodified
9271
+ * until the texture was finalized. See [method`Gdk`.GLTextureBuilder.build]
9272
+ * for a longer discussion.
9273
+ *
9274
+ * The id must be set before calling [method`Gdk`.GLTextureBuilder.build].
9275
+ * @param id The texture id to be used for creating the texture
9276
+ */
9277
+ set_id(id: number): void
9278
+ /**
9279
+ * Sets the GLSync object to use for the texture.
9280
+ *
9281
+ * GTK will wait on this object before using the created `GdkTexture`.
9282
+ *
9283
+ * The `destroy` function that is passed to [method`Gdk`.GLTextureBuilder.build]
9284
+ * is responsible for freeing the sync object when it is no longer needed.
9285
+ * The texture builder does not destroy it and it is the callers
9286
+ * responsibility to make sure it doesn't leak.
9287
+ * @param sync the GLSync object
9288
+ */
9289
+ set_sync(sync: any | null): void
9290
+ /**
9291
+ * Sets the region to be updated by this texture. Together with
9292
+ * [property`Gdk`.GLTextureBuilder:update-texture] this describes an
9293
+ * update of a previous texture.
9294
+ *
9295
+ * When rendering animations of large textures, it is possible that
9296
+ * consecutive textures are only updating contents in parts of the texture.
9297
+ * It is then possible to describe this update via these two properties,
9298
+ * so that GTK can avoid rerendering parts that did not change.
9299
+ *
9300
+ * An example would be a screen recording where only the mouse pointer moves.
9301
+ * @param region the region to update
9302
+ */
9303
+ set_update_region(region: cairo.Region | null): void
9304
+ /**
9305
+ * Sets the texture to be updated by this texture. See
9306
+ * [method`Gdk`.GLTextureBuilder.set_update_region] for an explanation.
9307
+ * @param texture the texture to update
9308
+ */
9309
+ set_update_texture(texture: Texture | null): void
9310
+ /**
9311
+ * Sets the width of the texture.
9312
+ *
9313
+ * The width must be set before calling [method`Gdk`.GLTextureBuilder.build].
9314
+ * @param width The texture's width or 0 to unset
9315
+ */
9316
+ set_width(width: number): void
9317
+
9318
+ // Class property signals of Gdk-4.0.Gdk.GLTextureBuilder
9319
+
9320
+ connect(sigName: "notify::context", callback: (($obj: GLTextureBuilder, pspec: GObject.ParamSpec) => void)): number
9321
+ connect_after(sigName: "notify::context", callback: (($obj: GLTextureBuilder, pspec: GObject.ParamSpec) => void)): number
9322
+ emit(sigName: "notify::context", ...args: any[]): void
9323
+ connect(sigName: "notify::format", callback: (($obj: GLTextureBuilder, pspec: GObject.ParamSpec) => void)): number
9324
+ connect_after(sigName: "notify::format", callback: (($obj: GLTextureBuilder, pspec: GObject.ParamSpec) => void)): number
9325
+ emit(sigName: "notify::format", ...args: any[]): void
9326
+ connect(sigName: "notify::has-mipmap", callback: (($obj: GLTextureBuilder, pspec: GObject.ParamSpec) => void)): number
9327
+ connect_after(sigName: "notify::has-mipmap", callback: (($obj: GLTextureBuilder, pspec: GObject.ParamSpec) => void)): number
9328
+ emit(sigName: "notify::has-mipmap", ...args: any[]): void
9329
+ connect(sigName: "notify::height", callback: (($obj: GLTextureBuilder, pspec: GObject.ParamSpec) => void)): number
9330
+ connect_after(sigName: "notify::height", callback: (($obj: GLTextureBuilder, pspec: GObject.ParamSpec) => void)): number
9331
+ emit(sigName: "notify::height", ...args: any[]): void
9332
+ connect(sigName: "notify::id", callback: (($obj: GLTextureBuilder, pspec: GObject.ParamSpec) => void)): number
9333
+ connect_after(sigName: "notify::id", callback: (($obj: GLTextureBuilder, pspec: GObject.ParamSpec) => void)): number
9334
+ emit(sigName: "notify::id", ...args: any[]): void
9335
+ connect(sigName: "notify::sync", callback: (($obj: GLTextureBuilder, pspec: GObject.ParamSpec) => void)): number
9336
+ connect_after(sigName: "notify::sync", callback: (($obj: GLTextureBuilder, pspec: GObject.ParamSpec) => void)): number
9337
+ emit(sigName: "notify::sync", ...args: any[]): void
9338
+ connect(sigName: "notify::update-region", callback: (($obj: GLTextureBuilder, pspec: GObject.ParamSpec) => void)): number
9339
+ connect_after(sigName: "notify::update-region", callback: (($obj: GLTextureBuilder, pspec: GObject.ParamSpec) => void)): number
9340
+ emit(sigName: "notify::update-region", ...args: any[]): void
9341
+ connect(sigName: "notify::update-texture", callback: (($obj: GLTextureBuilder, pspec: GObject.ParamSpec) => void)): number
9342
+ connect_after(sigName: "notify::update-texture", callback: (($obj: GLTextureBuilder, pspec: GObject.ParamSpec) => void)): number
9343
+ emit(sigName: "notify::update-texture", ...args: any[]): void
9344
+ connect(sigName: "notify::width", callback: (($obj: GLTextureBuilder, pspec: GObject.ParamSpec) => void)): number
9345
+ connect_after(sigName: "notify::width", callback: (($obj: GLTextureBuilder, pspec: GObject.ParamSpec) => void)): number
9346
+ emit(sigName: "notify::width", ...args: any[]): void
9347
+ connect(sigName: string, callback: (...args: any[]) => void): number
9348
+ connect_after(sigName: string, callback: (...args: any[]) => void): number
9349
+ emit(sigName: string, ...args: any[]): void
9350
+ disconnect(id: number): void
9351
+ }
9352
+
9353
+ /**
9354
+ * `GdkGLTextureBuilder` is a buider used to construct [class`Gdk`.Texture] objects from
9355
+ * GL textures.
9356
+ *
9357
+ * The operation is quite simple: Create a texture builder, set all the necessary
9358
+ * properties - keep in mind that the properties [property`Gdk`.GLTextureBuilder:context],
9359
+ * [property`Gdk`.GLTextureBuilder:id], [property`Gdk`.GLTextureBuilder:width], and
9360
+ * [property`Gdk`.GLTextureBuilder:height] are mandatory - and then call
9361
+ * [method`Gdk`.GLTextureBuilder.build] to create the new texture.
9362
+ *
9363
+ * `GdkGLTextureBuilder` can be used for quick one-shot construction of
9364
+ * textures as well as kept around and reused to construct multiple textures.
9365
+ * @class
9366
+ */
9367
+ class GLTextureBuilder extends GObject.Object {
9368
+
9369
+ // Own properties of Gdk-4.0.Gdk.GLTextureBuilder
9370
+
9371
+ static name: string
9372
+ static $gtype: GObject.GType<GLTextureBuilder>
9373
+
9374
+ // Constructors of Gdk-4.0.Gdk.GLTextureBuilder
9375
+
9376
+ constructor(config?: GLTextureBuilder.ConstructorProperties)
9377
+ /**
9378
+ * Creates a new texture builder.
9379
+ * @constructor
9380
+ * @returns the new `GdkTextureBuilder`
9381
+ */
9382
+ constructor()
9383
+ /**
9384
+ * Creates a new texture builder.
9385
+ * @constructor
9386
+ * @returns the new `GdkTextureBuilder`
9387
+ */
9388
+ static new(): GLTextureBuilder
9389
+ _init(config?: GLTextureBuilder.ConstructorProperties): void
9390
+ }
9391
+
8992
9392
  interface GrabBrokenEvent {
8993
9393
 
8994
9394
  // Owm methods of Gdk-4.0.Gdk.GrabBrokenEvent
@@ -9775,8 +10175,15 @@ interface Surface {
9775
10175
  * Whether the surface is mapped.
9776
10176
  */
9777
10177
  readonly mapped: boolean
10178
+ /**
10179
+ * The scale of the surface.
10180
+ */
10181
+ readonly scale: number
9778
10182
  /**
9779
10183
  * The scale factor of the surface.
10184
+ *
10185
+ * The scale factor is the next larger integer,
10186
+ * compared to [property`Gdk`.Surface:scale].
9780
10187
  */
9781
10188
  readonly scale_factor: number
9782
10189
  /**
@@ -9910,6 +10317,21 @@ interface Surface {
9910
10317
  * @returns %TRUE if the surface is mapped
9911
10318
  */
9912
10319
  get_mapped(): boolean
10320
+ /**
10321
+ * Returns the internal scale that maps from surface coordinates
10322
+ * to the actual device pixels.
10323
+ *
10324
+ * When the scale is bigger than 1, the windowing system prefers to get
10325
+ * buffers with a resolution that is bigger than the surface size (e.g.
10326
+ * to show the surface on a high-resolution display, or in a magnifier).
10327
+ *
10328
+ * Compare with [method`Gdk`.Surface.get_scale_factor], which returns the
10329
+ * next larger integer.
10330
+ *
10331
+ * The scale may change during the lifetime of the surface.
10332
+ * @returns the scale
10333
+ */
10334
+ get_scale(): number
9913
10335
  /**
9914
10336
  * Returns the internal scale factor that maps from surface coordinates
9915
10337
  * to the actual device pixels.
@@ -9921,7 +10343,7 @@ interface Surface {
9921
10343
  * pixel-based data the scale value can be used to determine whether to
9922
10344
  * use a pixel resource with higher resolution data.
9923
10345
  *
9924
- * The scale of a surface may change during runtime.
10346
+ * The scale factor may change during the lifetime of the surface.
9925
10347
  * @returns the scale factor
9926
10348
  */
9927
10349
  get_scale_factor(): number
@@ -10069,6 +10491,9 @@ interface Surface {
10069
10491
  connect(sigName: "notify::mapped", callback: (($obj: Surface, pspec: GObject.ParamSpec) => void)): number
10070
10492
  connect_after(sigName: "notify::mapped", callback: (($obj: Surface, pspec: GObject.ParamSpec) => void)): number
10071
10493
  emit(sigName: "notify::mapped", ...args: any[]): void
10494
+ connect(sigName: "notify::scale", callback: (($obj: Surface, pspec: GObject.ParamSpec) => void)): number
10495
+ connect_after(sigName: "notify::scale", callback: (($obj: Surface, pspec: GObject.ParamSpec) => void)): number
10496
+ emit(sigName: "notify::scale", ...args: any[]): void
10072
10497
  connect(sigName: "notify::scale-factor", callback: (($obj: Surface, pspec: GObject.ParamSpec) => void)): number
10073
10498
  connect_after(sigName: "notify::scale-factor", callback: (($obj: Surface, pspec: GObject.ParamSpec) => void)): number
10074
10499
  emit(sigName: "notify::scale-factor", ...args: any[]): void
@@ -10285,7 +10710,8 @@ interface Texture extends Paintable, Gio.Icon, Gio.LoadableIcon {
10285
10710
  * multiple frames, and will be used for a long time.
10286
10711
  *
10287
10712
  * There are various ways to create `GdkTexture` objects from a
10288
- * [class`GdkPixbuf`.Pixbuf], or a Cairo surface, or other pixel data.
10713
+ * [class`GdkPixbuf`.Pixbuf], or from bytes stored in memory, a file, or a
10714
+ * [struct`Gio`.Resource].
10289
10715
  *
10290
10716
  * The ownership of the pixel data is transferred to the `GdkTexture`
10291
10717
  * instance; you can only make a copy of it, via [method`Gdk`.Texture.download].
@@ -10853,6 +11279,30 @@ abstract class DragSurfaceInterface {
10853
11279
  static name: string
10854
11280
  }
10855
11281
 
11282
+ interface DragSurfaceSize {
11283
+
11284
+ // Owm methods of Gdk-4.0.Gdk.DragSurfaceSize
11285
+
11286
+ /**
11287
+ * Sets the size the drag surface prefers to be resized to.
11288
+ * @param width the width
11289
+ * @param height the height
11290
+ */
11291
+ set_size(width: number, height: number): void
11292
+ }
11293
+
11294
+ /**
11295
+ * The `GdkDragSurfaceSize` struct contains information that is useful
11296
+ * to compute the size of a drag surface.
11297
+ * @record
11298
+ */
11299
+ class DragSurfaceSize {
11300
+
11301
+ // Own properties of Gdk-4.0.Gdk.DragSurfaceSize
11302
+
11303
+ static name: string
11304
+ }
11305
+
10856
11306
  interface EventSequence {
10857
11307
  }
10858
11308
 
@@ -11032,6 +11482,16 @@ class FrameTimings {
11032
11482
  static name: string
11033
11483
  }
11034
11484
 
11485
+ interface GLTextureBuilderClass {
11486
+ }
11487
+
11488
+ abstract class GLTextureBuilderClass {
11489
+
11490
+ // Own properties of Gdk-4.0.Gdk.GLTextureBuilderClass
11491
+
11492
+ static name: string
11493
+ }
11494
+
11035
11495
  interface GLTextureClass {
11036
11496
  }
11037
11497
 
@@ -11594,10 +12054,10 @@ interface TextureDownloader {
11594
12054
  * be stored in the stride value.
11595
12055
  *
11596
12056
  * This function will abort if it tries to download a large texture and
11597
- * fails to allocate memory. If you think that may happen, you should
11598
- * handle memory allocation yourself and use
11599
- * gdk_texture_downloader_download_into() once allocation succeeded.
11600
- * @returns The downloaded pixels.
12057
+ * fails to allocate memory. If you think that may happen, you should handle
12058
+ * memory allocation yourself and use [method`Gdk`.TextureDownloader.download_into]
12059
+ * once allocation succeeded.
12060
+ * @returns The downloaded pixels
11601
12061
  */
11602
12062
  download_bytes(): [ /* returnType */ GLib.Bytes, /* out_stride */ number ]
11603
12063
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@girs/gdk-4.0",
3
- "version": "4.0.0-3.2.0",
3
+ "version": "4.0.0-3.2.2",
4
4
  "description": "GJS TypeScript type definitions for Gdk-4.0, generated from library version 4.0.0",
5
5
  "type": "module",
6
6
  "module": "gdk-4.0.js",
@@ -25,17 +25,17 @@
25
25
  "test:cjs": "NODE_OPTIONS=--max_old_space_size=9216 tsc --noEmit gdk-4.0.d.cts"
26
26
  },
27
27
  "dependencies": {
28
- "@girs/cairo-1.0": "^1.0.0-3.2.0",
29
- "@girs/freetype2-2.0": "^2.0.0-3.2.0",
30
- "@girs/gdkpixbuf-2.0": "^2.0.0-3.2.0",
31
- "@girs/gio-2.0": "^2.76.1-3.2.0",
32
- "@girs/gjs": "^3.2.0",
33
- "@girs/glib-2.0": "^2.76.1-3.2.0",
34
- "@girs/gmodule-2.0": "^2.0.0-3.2.0",
35
- "@girs/gobject-2.0": "^2.76.1-3.2.0",
36
- "@girs/harfbuzz-0.0": "^7.1.0-3.2.0",
37
- "@girs/pango-1.0": "^1.50.14-3.2.0",
38
- "@girs/pangocairo-1.0": "^1.0.0-3.2.0"
28
+ "@girs/cairo-1.0": "^1.0.0-3.2.2",
29
+ "@girs/freetype2-2.0": "^2.0.0-3.2.2",
30
+ "@girs/gdkpixbuf-2.0": "^2.0.0-3.2.2",
31
+ "@girs/gio-2.0": "^2.77.0-3.2.2",
32
+ "@girs/gjs": "^3.2.2",
33
+ "@girs/glib-2.0": "^2.77.0-3.2.2",
34
+ "@girs/gmodule-2.0": "^2.0.0-3.2.2",
35
+ "@girs/gobject-2.0": "^2.77.0-3.2.2",
36
+ "@girs/harfbuzz-0.0": "^7.1.0-3.2.2",
37
+ "@girs/pango-1.0": "^1.51.0-3.2.2",
38
+ "@girs/pangocairo-1.0": "^1.0.0-3.2.2"
39
39
  },
40
40
  "devDependencies": {
41
41
  "typescript": "*"
package/typedoc.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "entryPoints": ["./gdk-4.0.d.ts","./gdk-4.0-ambient.d.ts","./gdk-4.0-import.d.ts"],
2
+ "entryPoints": ["./gdk-4.0.d.ts"],
3
3
  "readme": "./README.md",
4
4
  "name": "Gdk-4.0",
5
5
  "tsconfig": "./tsconfig.json"