@girs/gio-2.0 2.76.1-3.2.0 → 2.77.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/gio-2.0.d.cts CHANGED
@@ -2175,6 +2175,9 @@ export enum FileMeasureFlags {
2175
2175
  * sizes. Normally, the block-size is used, if available, as this is a
2176
2176
  * more accurate representation of disk space used.
2177
2177
  * Compare with `du --apparent-size`.
2178
+ * Since GLib 2.78. and similarly to `du` since GNU Coreutils 9.2, this will
2179
+ * ignore the sizes of file types other than regular files and links, as the
2180
+ * sizes of other file types are not specified in a standard way.
2178
2181
  */
2179
2182
  APPARENT_SIZE,
2180
2183
  /**
@@ -4560,6 +4563,16 @@ export function dtls_client_connection_new(base_socket: DatagramBased, server_id
4560
4563
  * @returns the new #GDtlsServerConnection, or %NULL on error
4561
4564
  */
4562
4565
  export function dtls_server_connection_new(base_socket: DatagramBased, certificate: TlsCertificate | null): DtlsServerConnection
4566
+ /**
4567
+ * Constructs a #GFile from a vector of elements using the correct
4568
+ * separator for filenames.
4569
+ *
4570
+ * Using this function is equivalent to calling g_build_filenamev(),
4571
+ * followed by g_file_new_for_path() on the result.
4572
+ * @param args %NULL-terminated array of strings containing the path elements.
4573
+ * @returns a new #GFile
4574
+ */
4575
+ export function file_new_build_filenamev(args: string[]): File
4563
4576
  /**
4564
4577
  * Creates a #GFile with the given argument from the command line.
4565
4578
  * The value of `arg` can be either a URI, an absolute path or a
@@ -6996,6 +7009,34 @@ export interface ActionMap {
6996
7009
  * @param action_name the name of the action
6997
7010
  */
6998
7011
  remove_action(action_name: string | null): void
7012
+ /**
7013
+ * Remove actions from a #GActionMap. This is meant as the reverse of
7014
+ * g_action_map_add_action_entries().
7015
+ *
7016
+ *
7017
+ *
7018
+ * ```c
7019
+ * static const GActionEntry entries[] = {
7020
+ * { "quit", activate_quit },
7021
+ * { "print-string", activate_print_string, "s" }
7022
+ * };
7023
+ *
7024
+ * void
7025
+ * add_actions (GActionMap *map)
7026
+ * {
7027
+ * g_action_map_add_action_entries (map, entries, G_N_ELEMENTS (entries), NULL);
7028
+ * }
7029
+ *
7030
+ * void
7031
+ * remove_actions (GActionMap *map)
7032
+ * {
7033
+ * g_action_map_remove_action_entries (map, entries, G_N_ELEMENTS (entries));
7034
+ * }
7035
+ * ```
7036
+ *
7037
+ * @param entries a pointer to the first item in an array of #GActionEntry structs
7038
+ */
7039
+ remove_action_entries(entries: ActionEntry[]): void
6999
7040
 
7000
7041
  // Own virtual methods of Gio-2.0.Gio.ActionMap
7001
7042
 
@@ -14832,7 +14873,7 @@ export interface File {
14832
14873
  * - g_file_new_tmp_async() to asynchronously create a temporary file.
14833
14874
  * - g_file_new_tmp_dir_async() to asynchronously create a temporary directory.
14834
14875
  * - g_file_parse_name() from a UTF-8 string gotten from g_file_get_parse_name().
14835
- * - g_file_new_build_filename() to create a file from path elements.
14876
+ * - g_file_new_build_filename() or g_file_new_build_filenamev() to create a file from path elements.
14836
14877
  *
14837
14878
  * One way to think of a #GFile is as an abstraction of a pathname. For
14838
14879
  * normal files the system pathname is what is stored internally, but as
@@ -14913,6 +14954,16 @@ export class File extends GObject.Object {
14913
14954
 
14914
14955
  constructor(config?: File.ConstructorProperties)
14915
14956
  _init(config?: File.ConstructorProperties): void
14957
+ /**
14958
+ * Constructs a #GFile from a vector of elements using the correct
14959
+ * separator for filenames.
14960
+ *
14961
+ * Using this function is equivalent to calling g_build_filenamev(),
14962
+ * followed by g_file_new_for_path() on the result.
14963
+ * @param args %NULL-terminated array of strings containing the path elements.
14964
+ * @returns a new #GFile
14965
+ */
14966
+ static new_build_filenamev(args: string[]): File
14916
14967
  /**
14917
14968
  * Creates a #GFile with the given argument from the command line.
14918
14969
  * The value of `arg` can be either a URI, an absolute path or a
@@ -16707,6 +16758,9 @@ export interface PollableInputStream extends InputStream {
16707
16758
  * the stream may not actually be readable even after the source
16708
16759
  * triggers, so you should use g_pollable_input_stream_read_nonblocking()
16709
16760
  * rather than g_input_stream_read() from the callback.
16761
+ *
16762
+ * The behaviour of this method is undefined if
16763
+ * g_pollable_input_stream_can_poll() returns %FALSE for `stream`.
16710
16764
  * @param cancellable a #GCancellable, or %NULL
16711
16765
  * @returns a new #GSource
16712
16766
  */
@@ -16720,6 +16774,9 @@ export interface PollableInputStream extends InputStream {
16720
16774
  * non-blocking behavior, you should always use
16721
16775
  * g_pollable_input_stream_read_nonblocking(), which will return a
16722
16776
  * %G_IO_ERROR_WOULD_BLOCK error rather than blocking.
16777
+ *
16778
+ * The behaviour of this method is undefined if
16779
+ * g_pollable_input_stream_can_poll() returns %FALSE for `stream`.
16723
16780
  * @returns %TRUE if @stream is readable, %FALSE if not. If an error has occurred on @stream, this will result in g_pollable_input_stream_is_readable() returning %TRUE, and the next attempt to read will return the error.
16724
16781
  */
16725
16782
  is_readable(): boolean
@@ -16735,6 +16792,9 @@ export interface PollableInputStream extends InputStream {
16735
16792
  * if `cancellable` has already been cancelled when you call, which
16736
16793
  * may happen if you call this method after a source triggers due
16737
16794
  * to having been cancelled.
16795
+ *
16796
+ * The behaviour of this method is undefined if
16797
+ * g_pollable_input_stream_can_poll() returns %FALSE for `stream`.
16738
16798
  * @param cancellable a #GCancellable, or %NULL
16739
16799
  * @returns the number of bytes read, or -1 on error (including %G_IO_ERROR_WOULD_BLOCK).
16740
16800
  */
@@ -16763,6 +16823,9 @@ export interface PollableInputStream extends InputStream {
16763
16823
  * the stream may not actually be readable even after the source
16764
16824
  * triggers, so you should use g_pollable_input_stream_read_nonblocking()
16765
16825
  * rather than g_input_stream_read() from the callback.
16826
+ *
16827
+ * The behaviour of this method is undefined if
16828
+ * g_pollable_input_stream_can_poll() returns %FALSE for `stream`.
16766
16829
  * @virtual
16767
16830
  * @param cancellable a #GCancellable, or %NULL
16768
16831
  * @returns a new #GSource
@@ -16777,6 +16840,9 @@ export interface PollableInputStream extends InputStream {
16777
16840
  * non-blocking behavior, you should always use
16778
16841
  * g_pollable_input_stream_read_nonblocking(), which will return a
16779
16842
  * %G_IO_ERROR_WOULD_BLOCK error rather than blocking.
16843
+ *
16844
+ * The behaviour of this method is undefined if
16845
+ * g_pollable_input_stream_can_poll() returns %FALSE for `stream`.
16780
16846
  * @virtual
16781
16847
  * @returns %TRUE if @stream is readable, %FALSE if not. If an error has occurred on @stream, this will result in g_pollable_input_stream_is_readable() returning %TRUE, and the next attempt to read will return the error.
16782
16848
  */
@@ -16793,6 +16859,9 @@ export interface PollableInputStream extends InputStream {
16793
16859
  * if `cancellable` has already been cancelled when you call, which
16794
16860
  * may happen if you call this method after a source triggers due
16795
16861
  * to having been cancelled.
16862
+ *
16863
+ * The behaviour of this method is undefined if
16864
+ * g_pollable_input_stream_can_poll() returns %FALSE for `stream`.
16796
16865
  * @virtual
16797
16866
  * @returns the number of bytes read, or -1 on error (including %G_IO_ERROR_WOULD_BLOCK).
16798
16867
  */
@@ -16811,6 +16880,11 @@ export interface PollableInputStream extends InputStream {
16811
16880
  * can be polled for readiness to read. This can be used when
16812
16881
  * interfacing with a non-GIO API that expects
16813
16882
  * UNIX-file-descriptor-style asynchronous I/O rather than GIO-style.
16883
+ *
16884
+ * Some classes may implement #GPollableInputStream but have only certain
16885
+ * instances of that class be pollable. If g_pollable_input_stream_can_poll()
16886
+ * returns %FALSE, then the behavior of other #GPollableInputStream methods is
16887
+ * undefined.
16814
16888
  * @interface
16815
16889
  */
16816
16890
  export class PollableInputStream extends GObject.Object {
@@ -16859,6 +16933,9 @@ export interface PollableOutputStream extends OutputStream {
16859
16933
  * the stream may not actually be writable even after the source
16860
16934
  * triggers, so you should use g_pollable_output_stream_write_nonblocking()
16861
16935
  * rather than g_output_stream_write() from the callback.
16936
+ *
16937
+ * The behaviour of this method is undefined if
16938
+ * g_pollable_output_stream_can_poll() returns %FALSE for `stream`.
16862
16939
  * @param cancellable a #GCancellable, or %NULL
16863
16940
  * @returns a new #GSource
16864
16941
  */
@@ -16872,6 +16949,9 @@ export interface PollableOutputStream extends OutputStream {
16872
16949
  * non-blocking behavior, you should always use
16873
16950
  * g_pollable_output_stream_write_nonblocking(), which will return a
16874
16951
  * %G_IO_ERROR_WOULD_BLOCK error rather than blocking.
16952
+ *
16953
+ * The behaviour of this method is undefined if
16954
+ * g_pollable_output_stream_can_poll() returns %FALSE for `stream`.
16875
16955
  * @returns %TRUE if @stream is writable, %FALSE if not. If an error has occurred on @stream, this will result in g_pollable_output_stream_is_writable() returning %TRUE, and the next attempt to write will return the error.
16876
16956
  */
16877
16957
  is_writable(): boolean
@@ -16891,6 +16971,9 @@ export interface PollableOutputStream extends OutputStream {
16891
16971
  * Also note that if %G_IO_ERROR_WOULD_BLOCK is returned some underlying
16892
16972
  * transports like D/TLS require that you re-send the same `buffer` and
16893
16973
  * `count` in the next write call.
16974
+ *
16975
+ * The behaviour of this method is undefined if
16976
+ * g_pollable_output_stream_can_poll() returns %FALSE for `stream`.
16894
16977
  * @param buffer a buffer to write data from
16895
16978
  * @param cancellable a #GCancellable, or %NULL
16896
16979
  * @returns the number of bytes written, or -1 on error (including %G_IO_ERROR_WOULD_BLOCK).
@@ -16913,6 +16996,9 @@ export interface PollableOutputStream extends OutputStream {
16913
16996
  * Also note that if %G_POLLABLE_RETURN_WOULD_BLOCK is returned some underlying
16914
16997
  * transports like D/TLS require that you re-send the same `vectors` and
16915
16998
  * `n_vectors` in the next write call.
16999
+ *
17000
+ * The behaviour of this method is undefined if
17001
+ * g_pollable_output_stream_can_poll() returns %FALSE for `stream`.
16916
17002
  * @param vectors the buffer containing the #GOutputVectors to write.
16917
17003
  * @param cancellable a #GCancellable, or %NULL
16918
17004
  * @returns %@G_POLLABLE_RETURN_OK on success, %G_POLLABLE_RETURN_WOULD_BLOCK if the stream is not currently writable (and @error is *not* set), or %G_POLLABLE_RETURN_FAILED if there was an error in which case @error will be set.
@@ -16942,6 +17028,9 @@ export interface PollableOutputStream extends OutputStream {
16942
17028
  * the stream may not actually be writable even after the source
16943
17029
  * triggers, so you should use g_pollable_output_stream_write_nonblocking()
16944
17030
  * rather than g_output_stream_write() from the callback.
17031
+ *
17032
+ * The behaviour of this method is undefined if
17033
+ * g_pollable_output_stream_can_poll() returns %FALSE for `stream`.
16945
17034
  * @virtual
16946
17035
  * @param cancellable a #GCancellable, or %NULL
16947
17036
  * @returns a new #GSource
@@ -16956,6 +17045,9 @@ export interface PollableOutputStream extends OutputStream {
16956
17045
  * non-blocking behavior, you should always use
16957
17046
  * g_pollable_output_stream_write_nonblocking(), which will return a
16958
17047
  * %G_IO_ERROR_WOULD_BLOCK error rather than blocking.
17048
+ *
17049
+ * The behaviour of this method is undefined if
17050
+ * g_pollable_output_stream_can_poll() returns %FALSE for `stream`.
16959
17051
  * @virtual
16960
17052
  * @returns %TRUE if @stream is writable, %FALSE if not. If an error has occurred on @stream, this will result in g_pollable_output_stream_is_writable() returning %TRUE, and the next attempt to write will return the error.
16961
17053
  */
@@ -16976,6 +17068,9 @@ export interface PollableOutputStream extends OutputStream {
16976
17068
  * Also note that if %G_IO_ERROR_WOULD_BLOCK is returned some underlying
16977
17069
  * transports like D/TLS require that you re-send the same `buffer` and
16978
17070
  * `count` in the next write call.
17071
+ *
17072
+ * The behaviour of this method is undefined if
17073
+ * g_pollable_output_stream_can_poll() returns %FALSE for `stream`.
16979
17074
  * @virtual
16980
17075
  * @param buffer a buffer to write data from
16981
17076
  * @returns the number of bytes written, or -1 on error (including %G_IO_ERROR_WOULD_BLOCK).
@@ -16998,6 +17093,9 @@ export interface PollableOutputStream extends OutputStream {
16998
17093
  * Also note that if %G_POLLABLE_RETURN_WOULD_BLOCK is returned some underlying
16999
17094
  * transports like D/TLS require that you re-send the same `vectors` and
17000
17095
  * `n_vectors` in the next write call.
17096
+ *
17097
+ * The behaviour of this method is undefined if
17098
+ * g_pollable_output_stream_can_poll() returns %FALSE for `stream`.
17001
17099
  * @virtual
17002
17100
  * @param vectors the buffer containing the #GOutputVectors to write.
17003
17101
  * @returns %@G_POLLABLE_RETURN_OK on success, %G_POLLABLE_RETURN_WOULD_BLOCK if the stream is not currently writable (and @error is *not* set), or %G_POLLABLE_RETURN_FAILED if there was an error in which case @error will be set.
@@ -17017,6 +17115,11 @@ export interface PollableOutputStream extends OutputStream {
17017
17115
  * can be polled for readiness to write. This can be used when
17018
17116
  * interfacing with a non-GIO API that expects
17019
17117
  * UNIX-file-descriptor-style asynchronous I/O rather than GIO-style.
17118
+ *
17119
+ * Some classes may implement #GPollableOutputStream but have only certain
17120
+ * instances of that class be pollable. If g_pollable_output_stream_can_poll()
17121
+ * returns %FALSE, then the behavior of other #GPollableOutputStream methods is
17122
+ * undefined.
17020
17123
  * @interface
17021
17124
  */
17022
17125
  export class PollableOutputStream extends GObject.Object {
@@ -19089,19 +19192,34 @@ export interface AppInfoMonitor {
19089
19192
 
19090
19193
  /**
19091
19194
  * #GAppInfoMonitor is a very simple object used for monitoring the app
19092
- * info database for changes (ie: newly installed or removed
19093
- * applications).
19195
+ * info database for changes (newly installed or removed applications).
19094
19196
  *
19095
19197
  * Call g_app_info_monitor_get() to get a #GAppInfoMonitor and connect
19096
- * to the "changed" signal.
19198
+ * to the #GAppInfoMonitor::changed signal. The signal will be emitted once when
19199
+ * the app info database changes, and will not be emitted again until after the
19200
+ * next call to g_app_info_get_all() or another `g_app_info_*()` function. This
19201
+ * is because monitoring the app info database for changes is expensive.
19202
+ *
19203
+ * The following functions will re-arm the #GAppInfoMonitor::changed signal so
19204
+ * it can be emitted again:
19205
+ * - g_app_info_get_all()
19206
+ * - g_app_info_get_all_for_type()
19207
+ * - g_app_info_get_default_for_type()
19208
+ * - g_app_info_get_fallback_for_type()
19209
+ * - g_app_info_get_recommended_for_type()
19210
+ * - g_desktop_app_info_get_implementations()
19211
+ * - g_desktop_app_info_new()
19212
+ * - g_desktop_app_info_new_from_filename()
19213
+ * - g_desktop_app_info_new_from_keyfile()
19214
+ * - g_desktop_app_info_search()
19097
19215
  *
19098
19216
  * In the usual case, applications should try to make note of the change
19099
19217
  * (doing things like invalidating caches) but not act on it. In
19100
19218
  * particular, applications should avoid making calls to #GAppInfo APIs
19101
19219
  * in response to the change signal, deferring these until the time that
19102
- * the data is actually required. The exception to this case is when
19220
+ * the updated data is actually required. The exception to this case is when
19103
19221
  * application information is actually being displayed on the screen
19104
- * (eg: during a search or when the list of all applications is shown).
19222
+ * (for example, during a search or when the list of all applications is shown).
19105
19223
  * The reason for this is that changes to the list of installed
19106
19224
  * applications often come in groups (like during system updates) and
19107
19225
  * rescanning the list on every change is pointless and expensive.
@@ -19126,6 +19244,10 @@ export class AppInfoMonitor extends GObject.Object {
19126
19244
  * thread-default main context whenever the list of installed
19127
19245
  * applications (as reported by g_app_info_get_all()) may have changed.
19128
19246
  *
19247
+ * The #GAppInfoMonitor::changed signal will only be emitted once until
19248
+ * g_app_info_get_all() (or another `g_app_info_*()` function) is called. Doing
19249
+ * so will re-arm the signal ready to notify about the next change.
19250
+ *
19129
19251
  * You must only call g_object_unref() on the return value from under
19130
19252
  * the same main context as you created it.
19131
19253
  * @returns a reference to a #GAppInfoMonitor
@@ -19638,7 +19760,7 @@ export interface Application extends ActionGroup, ActionMap {
19638
19760
  * Increases the use count of `application`.
19639
19761
  *
19640
19762
  * Use this function to indicate that the application has a reason to
19641
- * continue to run. For example, g_application_hold() is called by GTK+
19763
+ * continue to run. For example, g_application_hold() is called by GTK
19642
19764
  * when a toplevel window is on the screen.
19643
19765
  *
19644
19766
  * To cancel the hold, call g_application_release().
@@ -20179,6 +20301,10 @@ export interface Application extends ActionGroup, ActionMap {
20179
20301
  * conveniently access them remotely. GIO provides a #GDBusMenuModel wrapper
20180
20302
  * for remote access to exported #GMenuModels.
20181
20303
  *
20304
+ * Note: Due to the fact that actions are exported on the session bus,
20305
+ * using `maybe` parameters is not supported, since D-Bus does not support
20306
+ * `maybe` types.
20307
+ *
20182
20308
  * There is a number of different entry points into a GApplication:
20183
20309
  *
20184
20310
  * - via 'Activate' (i.e. just starting the application)
@@ -26333,9 +26459,10 @@ export interface DebugControllerDBus extends DebugController, Initable {
26333
26459
  * #GDebugController:debug-enabled and, by default, g_log_get_debug_enabled().
26334
26460
  * default.
26335
26461
  *
26336
- * By default, all processes will be able to call `SetDebugEnabled()`. If this
26337
- * process is privileged, or might expose sensitive information in its debug
26338
- * output, you may want to restrict the ability to enable debug output to
26462
+ * By default, no processes are allowed to call `SetDebugEnabled()` unless a
26463
+ * #GDebugControllerDBus::authorize signal handler is installed. This is because
26464
+ * the process may be privileged, or might expose sensitive information in its
26465
+ * debug output. You may want to restrict the ability to enable debug output to
26339
26466
  * privileged users or processes.
26340
26467
  *
26341
26468
  * One option is to install a D-Bus security policy which restricts access to
@@ -27161,22 +27288,69 @@ export interface FileEnumerator {
27161
27288
  next_file(cancellable: Cancellable | null): FileInfo | null
27162
27289
  /**
27163
27290
  * Request information for a number of files from the enumerator asynchronously.
27164
- * When all i/o for the operation is finished the `callback` will be called with
27291
+ * When all I/O for the operation is finished the `callback` will be called with
27165
27292
  * the requested information.
27166
27293
  *
27167
27294
  * See the documentation of #GFileEnumerator for information about the
27168
27295
  * order of returned files.
27169
27296
  *
27170
- * The callback can be called with less than `num_files` files in case of error
27171
- * or at the end of the enumerator. In case of a partial error the callback will
27172
- * be called with any succeeding items and no error, and on the next request the
27173
- * error will be reported. If a request is cancelled the callback will be called
27174
- * with %G_IO_ERROR_CANCELLED.
27297
+ * Once the end of the enumerator is reached, or if an error occurs, the
27298
+ * `callback` will be called with an empty list. In this case, the previous call
27299
+ * to g_file_enumerator_next_files_async() will typically have returned fewer
27300
+ * than `num_files` items.
27301
+ *
27302
+ * If a request is cancelled the callback will be called with
27303
+ * %G_IO_ERROR_CANCELLED.
27304
+ *
27305
+ * This leads to the following pseudo-code usage:
27306
+ *
27307
+ * ```
27308
+ * g_autoptr(GFile) dir = get_directory ();
27309
+ * g_autoptr(GFileEnumerator) enumerator = NULL;
27310
+ * g_autolist(GFileInfo) files = NULL;
27311
+ * g_autoptr(GError) local_error = NULL;
27312
+ *
27313
+ * enumerator = yield g_file_enumerate_children_async (dir,
27314
+ * G_FILE_ATTRIBUTE_STANDARD_NAME ","
27315
+ * G_FILE_ATTRIBUTE_STANDARD_TYPE,
27316
+ * G_FILE_QUERY_INFO_NONE,
27317
+ * G_PRIORITY_DEFAULT,
27318
+ * cancellable,
27319
+ * …,
27320
+ * &local_error);
27321
+ * if (enumerator == NULL)
27322
+ * g_error ("Error enumerating: %s", local_error->message);
27323
+ *
27324
+ * // Loop until no files are returned, either because the end of the enumerator
27325
+ * // has been reached, or an error was returned.
27326
+ * do
27327
+ * {
27328
+ * files = yield g_file_enumerator_next_files_async (enumerator,
27329
+ * 5, // number of files to request
27330
+ * G_PRIORITY_DEFAULT,
27331
+ * cancellable,
27332
+ * …,
27333
+ * &local_error);
27334
+ *
27335
+ * // Process the returned files, but don’t assume that exactly 5 were returned.
27336
+ * for (GList *l = files; l != NULL; l = l->next)
27337
+ * {
27338
+ * GFileInfo *info = l->data;
27339
+ * handle_file_info (info);
27340
+ * }
27341
+ * }
27342
+ * while (files != NULL);
27343
+ *
27344
+ * if (local_error != NULL &&
27345
+ * !g_error_matches (local_error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
27346
+ * g_error ("Error while enumerating: %s", local_error->message);
27347
+ * ```
27348
+ *
27175
27349
  *
27176
27350
  * During an async request no other sync and async calls are allowed, and will
27177
27351
  * result in %G_IO_ERROR_PENDING errors.
27178
27352
  *
27179
- * Any outstanding i/o request with higher priority (lower numerical value) will
27353
+ * Any outstanding I/O request with higher priority (lower numerical value) will
27180
27354
  * be executed before an outstanding request with lower priority. Default
27181
27355
  * priority is %G_PRIORITY_DEFAULT.
27182
27356
  * @param num_files the number of file info objects to request
@@ -27192,22 +27366,69 @@ export interface FileEnumerator {
27192
27366
  * Promisified version of {@link next_files_async}
27193
27367
  *
27194
27368
  * Request information for a number of files from the enumerator asynchronously.
27195
- * When all i/o for the operation is finished the `callback` will be called with
27369
+ * When all I/O for the operation is finished the `callback` will be called with
27196
27370
  * the requested information.
27197
27371
  *
27198
27372
  * See the documentation of #GFileEnumerator for information about the
27199
27373
  * order of returned files.
27200
27374
  *
27201
- * The callback can be called with less than `num_files` files in case of error
27202
- * or at the end of the enumerator. In case of a partial error the callback will
27203
- * be called with any succeeding items and no error, and on the next request the
27204
- * error will be reported. If a request is cancelled the callback will be called
27205
- * with %G_IO_ERROR_CANCELLED.
27375
+ * Once the end of the enumerator is reached, or if an error occurs, the
27376
+ * `callback` will be called with an empty list. In this case, the previous call
27377
+ * to g_file_enumerator_next_files_async() will typically have returned fewer
27378
+ * than `num_files` items.
27379
+ *
27380
+ * If a request is cancelled the callback will be called with
27381
+ * %G_IO_ERROR_CANCELLED.
27382
+ *
27383
+ * This leads to the following pseudo-code usage:
27384
+ *
27385
+ * ```
27386
+ * g_autoptr(GFile) dir = get_directory ();
27387
+ * g_autoptr(GFileEnumerator) enumerator = NULL;
27388
+ * g_autolist(GFileInfo) files = NULL;
27389
+ * g_autoptr(GError) local_error = NULL;
27390
+ *
27391
+ * enumerator = yield g_file_enumerate_children_async (dir,
27392
+ * G_FILE_ATTRIBUTE_STANDARD_NAME ","
27393
+ * G_FILE_ATTRIBUTE_STANDARD_TYPE,
27394
+ * G_FILE_QUERY_INFO_NONE,
27395
+ * G_PRIORITY_DEFAULT,
27396
+ * cancellable,
27397
+ * …,
27398
+ * &local_error);
27399
+ * if (enumerator == NULL)
27400
+ * g_error ("Error enumerating: %s", local_error->message);
27401
+ *
27402
+ * // Loop until no files are returned, either because the end of the enumerator
27403
+ * // has been reached, or an error was returned.
27404
+ * do
27405
+ * {
27406
+ * files = yield g_file_enumerator_next_files_async (enumerator,
27407
+ * 5, // number of files to request
27408
+ * G_PRIORITY_DEFAULT,
27409
+ * cancellable,
27410
+ * …,
27411
+ * &local_error);
27412
+ *
27413
+ * // Process the returned files, but don’t assume that exactly 5 were returned.
27414
+ * for (GList *l = files; l != NULL; l = l->next)
27415
+ * {
27416
+ * GFileInfo *info = l->data;
27417
+ * handle_file_info (info);
27418
+ * }
27419
+ * }
27420
+ * while (files != NULL);
27421
+ *
27422
+ * if (local_error != NULL &&
27423
+ * !g_error_matches (local_error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
27424
+ * g_error ("Error while enumerating: %s", local_error->message);
27425
+ * ```
27426
+ *
27206
27427
  *
27207
27428
  * During an async request no other sync and async calls are allowed, and will
27208
27429
  * result in %G_IO_ERROR_PENDING errors.
27209
27430
  *
27210
- * Any outstanding i/o request with higher priority (lower numerical value) will
27431
+ * Any outstanding I/O request with higher priority (lower numerical value) will
27211
27432
  * be executed before an outstanding request with lower priority. Default
27212
27433
  * priority is %G_PRIORITY_DEFAULT.
27213
27434
  * @param num_files the number of file info objects to request
@@ -27279,22 +27500,69 @@ export interface FileEnumerator {
27279
27500
  vfunc_next_file(cancellable: Cancellable | null): FileInfo | null
27280
27501
  /**
27281
27502
  * Request information for a number of files from the enumerator asynchronously.
27282
- * When all i/o for the operation is finished the `callback` will be called with
27503
+ * When all I/O for the operation is finished the `callback` will be called with
27283
27504
  * the requested information.
27284
27505
  *
27285
27506
  * See the documentation of #GFileEnumerator for information about the
27286
27507
  * order of returned files.
27287
27508
  *
27288
- * The callback can be called with less than `num_files` files in case of error
27289
- * or at the end of the enumerator. In case of a partial error the callback will
27290
- * be called with any succeeding items and no error, and on the next request the
27291
- * error will be reported. If a request is cancelled the callback will be called
27292
- * with %G_IO_ERROR_CANCELLED.
27509
+ * Once the end of the enumerator is reached, or if an error occurs, the
27510
+ * `callback` will be called with an empty list. In this case, the previous call
27511
+ * to g_file_enumerator_next_files_async() will typically have returned fewer
27512
+ * than `num_files` items.
27513
+ *
27514
+ * If a request is cancelled the callback will be called with
27515
+ * %G_IO_ERROR_CANCELLED.
27516
+ *
27517
+ * This leads to the following pseudo-code usage:
27518
+ *
27519
+ * ```
27520
+ * g_autoptr(GFile) dir = get_directory ();
27521
+ * g_autoptr(GFileEnumerator) enumerator = NULL;
27522
+ * g_autolist(GFileInfo) files = NULL;
27523
+ * g_autoptr(GError) local_error = NULL;
27524
+ *
27525
+ * enumerator = yield g_file_enumerate_children_async (dir,
27526
+ * G_FILE_ATTRIBUTE_STANDARD_NAME ","
27527
+ * G_FILE_ATTRIBUTE_STANDARD_TYPE,
27528
+ * G_FILE_QUERY_INFO_NONE,
27529
+ * G_PRIORITY_DEFAULT,
27530
+ * cancellable,
27531
+ * …,
27532
+ * &local_error);
27533
+ * if (enumerator == NULL)
27534
+ * g_error ("Error enumerating: %s", local_error->message);
27535
+ *
27536
+ * // Loop until no files are returned, either because the end of the enumerator
27537
+ * // has been reached, or an error was returned.
27538
+ * do
27539
+ * {
27540
+ * files = yield g_file_enumerator_next_files_async (enumerator,
27541
+ * 5, // number of files to request
27542
+ * G_PRIORITY_DEFAULT,
27543
+ * cancellable,
27544
+ * …,
27545
+ * &local_error);
27546
+ *
27547
+ * // Process the returned files, but don’t assume that exactly 5 were returned.
27548
+ * for (GList *l = files; l != NULL; l = l->next)
27549
+ * {
27550
+ * GFileInfo *info = l->data;
27551
+ * handle_file_info (info);
27552
+ * }
27553
+ * }
27554
+ * while (files != NULL);
27555
+ *
27556
+ * if (local_error != NULL &&
27557
+ * !g_error_matches (local_error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
27558
+ * g_error ("Error while enumerating: %s", local_error->message);
27559
+ * ```
27560
+ *
27293
27561
  *
27294
27562
  * During an async request no other sync and async calls are allowed, and will
27295
27563
  * result in %G_IO_ERROR_PENDING errors.
27296
27564
  *
27297
- * Any outstanding i/o request with higher priority (lower numerical value) will
27565
+ * Any outstanding I/O request with higher priority (lower numerical value) will
27298
27566
  * be executed before an outstanding request with lower priority. Default
27299
27567
  * priority is %G_PRIORITY_DEFAULT.
27300
27568
  * @virtual
@@ -28159,7 +28427,7 @@ export interface FileInfo {
28159
28427
  * to the given symlink target.
28160
28428
  * @param symlink_target a static string containing a path to a symlink target.
28161
28429
  */
28162
- set_symlink_target(symlink_target: string | null): void
28430
+ set_symlink_target(symlink_target: string): void
28163
28431
  /**
28164
28432
  * Unsets a mask set by g_file_info_set_attribute_mask(), if one
28165
28433
  * is set.
@@ -30467,7 +30735,7 @@ export interface InputStream {
30467
30735
  * streaming APIs.
30468
30736
  *
30469
30737
  * All of these functions have async variants too.
30470
- * @interface
30738
+ * @class
30471
30739
  */
30472
30740
  export class InputStream extends GObject.Object {
30473
30741
 
@@ -33968,7 +34236,7 @@ export interface OutputStream {
33968
34236
  * streaming APIs.
33969
34237
  *
33970
34238
  * All of these functions have async variants too.
33971
- * @interface
34239
+ * @class
33972
34240
  */
33973
34241
  export class OutputStream extends GObject.Object {
33974
34242
 
@@ -34808,12 +35076,44 @@ export module Resolver {
34808
35076
  // Constructor properties interface
34809
35077
 
34810
35078
  export interface ConstructorProperties extends GObject.Object.ConstructorProperties {
35079
+
35080
+ // Own constructor properties of Gio-2.0.Gio.Resolver
35081
+
35082
+ /**
35083
+ * The timeout applied to all resolver lookups, in milliseconds.
35084
+ *
35085
+ * This may be changed through the lifetime of the #GResolver. The new value
35086
+ * will apply to any lookups started after the change, but not to any
35087
+ * already-ongoing lookups.
35088
+ *
35089
+ * If this is `0`, no timeout is applied to lookups.
35090
+ *
35091
+ * No timeout was applied to lookups before this property was added in
35092
+ * GLib 2.78.
35093
+ */
35094
+ timeout?: number | null
34811
35095
  }
34812
35096
 
34813
35097
  }
34814
35098
 
34815
35099
  export interface Resolver {
34816
35100
 
35101
+ // Own properties of Gio-2.0.Gio.Resolver
35102
+
35103
+ /**
35104
+ * The timeout applied to all resolver lookups, in milliseconds.
35105
+ *
35106
+ * This may be changed through the lifetime of the #GResolver. The new value
35107
+ * will apply to any lookups started after the change, but not to any
35108
+ * already-ongoing lookups.
35109
+ *
35110
+ * If this is `0`, no timeout is applied to lookups.
35111
+ *
35112
+ * No timeout was applied to lookups before this property was added in
35113
+ * GLib 2.78.
35114
+ */
35115
+ timeout: number
35116
+
34817
35117
  // Own fields of Gio-2.0.Gio.Resolver
34818
35118
 
34819
35119
  parent_instance: GObject.Object
@@ -34821,6 +35121,11 @@ export interface Resolver {
34821
35121
 
34822
35122
  // Owm methods of Gio-2.0.Gio.Resolver
34823
35123
 
35124
+ /**
35125
+ * Get the timeout applied to all resolver lookups. See #GResolver:timeout.
35126
+ * @returns the resolver timeout, in milliseconds, or `0` for no timeout
35127
+ */
35128
+ get_timeout(): number
34824
35129
  /**
34825
35130
  * Synchronously reverse-resolves `address` to determine its
34826
35131
  * associated hostname.
@@ -35123,6 +35428,11 @@ export interface Resolver {
35123
35428
  * itself as the default resolver for all later code to use.
35124
35429
  */
35125
35430
  set_default(): void
35431
+ /**
35432
+ * Set the timeout applied to all resolver lookups. See #GResolver:timeout.
35433
+ * @param timeout_ms timeout in milliseconds, or `0` for no timeouts
35434
+ */
35435
+ set_timeout(timeout_ms: number): void
35126
35436
 
35127
35437
  // Own virtual methods of Gio-2.0.Gio.Resolver
35128
35438
 
@@ -35319,6 +35629,9 @@ export interface Resolver {
35319
35629
 
35320
35630
  // Class property signals of Gio-2.0.Gio.Resolver
35321
35631
 
35632
+ connect(sigName: "notify::timeout", callback: (($obj: Resolver, pspec: GObject.ParamSpec) => void)): number
35633
+ connect_after(sigName: "notify::timeout", callback: (($obj: Resolver, pspec: GObject.ParamSpec) => void)): number
35634
+ emit(sigName: "notify::timeout", ...args: any[]): void
35322
35635
  connect(sigName: string, callback: (...args: any[]) => void): number
35323
35636
  connect_after(sigName: string, callback: (...args: any[]) => void): number
35324
35637
  emit(sigName: string, ...args: any[]): void
@@ -35334,6 +35647,10 @@ export interface Resolver {
35334
35647
  * #GNetworkAddress and #GNetworkService provide wrappers around
35335
35648
  * #GResolver functionality that also implement #GSocketConnectable,
35336
35649
  * making it easy to connect to a remote host/service.
35650
+ *
35651
+ * The default resolver (see g_resolver_get_default()) has a timeout of 30s set
35652
+ * on it since GLib 2.78. Earlier versions of GLib did not support resolver
35653
+ * timeouts.
35337
35654
  * @class
35338
35655
  */
35339
35656
  export class Resolver extends GObject.Object {
@@ -41650,6 +41967,13 @@ export interface Task extends AsyncResult {
41650
41967
  * do this. If you have a very large number of tasks to run (several tens of
41651
41968
  * tasks), but don't want them to all run at once, you should only queue a
41652
41969
  * limited number of them (around ten) at a time.
41970
+ *
41971
+ * Be aware that if your task depends on other tasks to complete, use of this
41972
+ * function could lead to a livelock if the other tasks also use this function
41973
+ * and enough of them (around 10) execute in a dependency chain, as that will
41974
+ * exhaust the thread pool. If this situation is possible, consider using a
41975
+ * separate worker thread or thread pool explicitly, rather than using
41976
+ * g_task_run_in_thread().
41653
41977
  * @param task_func a #GTaskThreadFunc
41654
41978
  */
41655
41979
  run_in_thread(task_func: TaskThreadFunc): void
@@ -45412,7 +45736,7 @@ export interface TlsInteraction {
45412
45736
  * initialization function. Any interactions not implemented will return
45413
45737
  * %G_TLS_INTERACTION_UNHANDLED. If a derived class implements an async method,
45414
45738
  * it must also implement the corresponding finish method.
45415
- * @class
45739
+ * @interface
45416
45740
  */
45417
45741
  export class TlsInteraction extends GObject.Object {
45418
45742