Regenerate, restoring full UpCast functionality.
[girtod.git] / gtk2 / gio2.d
blob1be69f82f9996d2355be2224f6adb01abc71579f
1 // *** DO NOT EDIT ***
2 // Automatically generated from "/usr/share/gir-1.0/Gio-2.0.gir"
4 module Gio2;
5 public import gtk2.glib2;
6 alias gtk2.glib2 GLib2;
7 public import gtk2.gobject2;
8 alias gtk2.gobject2 GObject2;
10 // package: "gio-2.0";
12 // package: "gio-unix-2.0";
13 // C header: "/sw/x86/gtk2/glib-2.32.0/include/gio-unix-2.0/gio/gdesktopappinfo.h";
14 // C header: "/sw/x86/gtk2/glib-2.32.0/include/gio-unix-2.0/gio/gfiledescriptorbased.h";
15 // C header: "/sw/x86/gtk2/glib-2.32.0/include/gio-unix-2.0/gio/gunixconnection.h";
16 // C header: "/sw/x86/gtk2/glib-2.32.0/include/gio-unix-2.0/gio/gunixcredentialsmessage.h";
17 // C header: "/sw/x86/gtk2/glib-2.32.0/include/gio-unix-2.0/gio/gunixfdlist.h";
18 // C header: "/sw/x86/gtk2/glib-2.32.0/include/gio-unix-2.0/gio/gunixfdmessage.h";
19 // C header: "/sw/x86/gtk2/glib-2.32.0/include/gio-unix-2.0/gio/gunixinputstream.h";
20 // C header: "/sw/x86/gtk2/glib-2.32.0/include/gio-unix-2.0/gio/gunixmounts.h";
21 // C header: "/sw/x86/gtk2/glib-2.32.0/include/gio-unix-2.0/gio/gunixoutputstream.h";
22 // C header: "/sw/x86/gtk2/glib-2.32.0/include/gio-unix-2.0/gio/gunixsocketaddress.h";
23 // C header: "gio/gio.h";
25 // c:symbol-prefixes: ["g"]
26 // c:identifier-prefixes: ["G"]
28 // module Gio2;
31 // #GAction represents a single named action.
32 //
33 // The main interface to an action is that it can be activated with
34 // g_action_activate(). This results in the 'activate' signal being
35 // emitted. An activation has a #GVariant parameter (which may be
36 // %NULL). The correct type for the parameter is determined by a static
37 // parameter type (which is given at construction time).
38 //
39 // An action may optionally have a state, in which case the state may be
40 // set with g_action_change_state(). This call takes a #GVariant. The
41 // correct type for the state is determined by a static state type
42 // (which is given at construction time).
43 //
44 // The state may have a hint associated with it, specifying its valid
45 // range.
46 //
47 // #GAction is merely the interface to the concept of an action, as
48 // described above. Various implementations of actions exist, including
49 // #GSimpleAction and #GtkAction.
50 //
51 // In all cases, the implementing class is responsible for storing the
52 // name of the action, the parameter type, the enabled state, the
53 // optional state type and the state and emitting the appropriate
54 // signals when these change. The implementor responsible for filtering
55 // calls to g_action_activate() and g_action_change_state() for type
56 // safety and for the state being enabled.
57 //
58 // Probably the only useful thing to do with a #GAction is to put it
59 // inside of a #GSimpleActionGroup.
60 struct Action /* Interface */ {
61 mixin template __interface__() {
62 // VERSION: 2.28
63 // Activates the action.
64 //
65 // @parameter must be the correct type of parameter for the action (ie:
66 // the parameter type given at construction time). If the parameter
67 // type was %NULL then @parameter must also be %NULL.
68 // <parameter>: the parameter to the activation
69 void activate(AT0)(AT0 /*GLib2.Variant*/ parameter=null) nothrow {
70 g_action_activate(cast(Action*)&this, UpCast!(GLib2.Variant*)(parameter));
73 // VERSION: 2.30
74 // Request for the state of @action to be changed to @value.
75 //
76 // The action must be stateful and @value must be of the correct type.
77 // See g_action_get_state_type().
78 //
79 // This call merely requests a change. The action may refuse to change
80 // its state or may change its state to something other than @value.
81 // See g_action_get_state_hint().
82 //
83 // If the @value GVariant is floating, it is consumed.
84 // <value>: the new state
85 void change_state(AT0)(AT0 /*GLib2.Variant*/ value) nothrow {
86 g_action_change_state(cast(Action*)&this, UpCast!(GLib2.Variant*)(value));
89 // VERSION: 2.28
90 // Checks if @action is currently enabled.
91 //
92 // An action must be enabled in order to be activated or in order to
93 // have its state changed from outside callers.
94 // RETURNS: whether the action is enabled
95 int get_enabled()() nothrow {
96 return g_action_get_enabled(cast(Action*)&this);
99 // VERSION: 2.28
100 // Queries the name of @action.
101 // RETURNS: the name of the action
102 char* get_name()() nothrow {
103 return g_action_get_name(cast(Action*)&this);
106 // VERSION: 2.28
107 // Queries the type of the parameter that must be given when activating
108 // @action.
110 // When activating the action using g_action_activate(), the #GVariant
111 // given to that function must be of the type returned by this function.
113 // In the case that this function returns %NULL, you must not give any
114 // #GVariant, but %NULL instead.
115 // RETURNS: the parameter type
116 GLib2.VariantType* get_parameter_type()() nothrow {
117 return g_action_get_parameter_type(cast(Action*)&this);
120 // VERSION: 2.28
121 // Queries the current state of @action.
123 // If the action is not stateful then %NULL will be returned. If the
124 // action is stateful then the type of the return value is the type
125 // given by g_action_get_state_type().
127 // The return value (if non-%NULL) should be freed with
128 // g_variant_unref() when it is no longer required.
129 // RETURNS: the current state of the action
130 GLib2.Variant* /*new*/ get_state()() nothrow {
131 return g_action_get_state(cast(Action*)&this);
134 // VERSION: 2.28
135 // Requests a hint about the valid range of values for the state of
136 // @action.
138 // If %NULL is returned it either means that the action is not stateful
139 // or that there is no hint about the valid range of values for the
140 // state of the action.
142 // If a #GVariant array is returned then each item in the array is a
143 // possible value for the state. If a #GVariant pair (ie: two-tuple) is
144 // returned then the tuple specifies the inclusive lower and upper bound
145 // of valid values for the state.
147 // In any case, the information is merely a hint. It may be possible to
148 // have a state value outside of the hinted range and setting a value
149 // within the range may fail.
151 // The return value (if non-%NULL) should be freed with
152 // g_variant_unref() when it is no longer required.
153 // RETURNS: the state range hint
154 GLib2.Variant* /*new*/ get_state_hint()() nothrow {
155 return g_action_get_state_hint(cast(Action*)&this);
158 // VERSION: 2.28
159 // Queries the type of the state of @action.
161 // If the action is stateful (e.g. created with
162 // g_simple_action_new_stateful()) then this function returns the
163 // #GVariantType of the state. This is the type of the initial value
164 // given as the state. All calls to g_action_change_state() must give a
165 // #GVariant of this type and g_action_get_state() will return a
166 // #GVariant of the same type.
168 // If the action is not stateful (e.g. created with g_simple_action_new())
169 // then this function will return %NULL. In that case, g_action_get_state()
170 // will return %NULL and you must not call g_action_change_state().
171 // RETURNS: the state type, if the action is stateful
172 GLib2.VariantType* get_state_type()() nothrow {
173 return g_action_get_state_type(cast(Action*)&this);
176 mixin __interface__;
180 // This struct defines a single action. It is for use with
181 // g_action_map_add_action_entries().
183 // The order of the items in the structure are intended to reflect
184 // frequency of use. It is permissible to use an incomplete initialiser
185 // in order to leave some of the later values as %NULL. All values
186 // after @name are optional. Additional optional fields may be added in
187 // the future.
189 // See g_action_map_add_action_entries() for an example.
190 struct ActionEntry {
191 char* name;
192 extern (C) void function (SimpleAction* action, GLib2.Variant* parameter, void* user_data) nothrow activate;
193 char* parameter_type, state;
194 extern (C) void function (SimpleAction* action, GLib2.Variant* value, void* user_data) nothrow change_state;
195 private size_t[3] padding;
199 // #GActionGroup represents a group of actions. Actions can be used to
200 // expose functionality in a structured way, either from one part of a
201 // program to another, or to the outside world. Action groups are often
202 // used together with a #GMenuModel that provides additional
203 // representation data for displaying the actions to the user, e.g. in
204 // a menu.
206 // The main way to interact with the actions in a GActionGroup is to
207 // activate them with g_action_group_activate_action(). Activating an
208 // action may require a #GVariant parameter. The required type of the
209 // parameter can be inquired with g_action_group_get_action_parameter_type().
210 // Actions may be disabled, see g_action_group_get_action_enabled().
211 // Activating a disabled action has no effect.
213 // Actions may optionally have a state in the form of a #GVariant. The
214 // current state of an action can be inquired with
215 // g_action_group_get_action_state(). Activating a stateful action may
216 // change its state, but it is also possible to set the state by calling
217 // g_action_group_change_action_state().
219 // As typical example, consider a text editing application which has an
220 // option to change the current font to 'bold'. A good way to represent
221 // this would be a stateful action, with a boolean state. Activating the
222 // action would toggle the state.
224 // Each action in the group has a unique name (which is a string). All
225 // method calls, except g_action_group_list_actions() take the name of
226 // an action as an argument.
228 // The #GActionGroup API is meant to be the 'public' API to the action
229 // group. The calls here are exactly the interaction that 'external
230 // forces' (eg: UI, incoming D-Bus messages, etc.) are supposed to have
231 // with actions. 'Internal' APIs (ie: ones meant only to be accessed by
232 // the action group implementation) are found on subclasses. This is
233 // why you will find - for example - g_action_group_get_action_enabled()
234 // but not an equivalent <function>set()</function> call.
236 // Signals are emitted on the action group in response to state changes
237 // on individual actions.
239 // Implementations of #GActionGroup should provide implementations for
240 // the virtual functions g_action_group_list_actions() and
241 // g_action_group_query_action(). The other virtual functions should
242 // not be implemented - their "wrappers" are actually implemented with
243 // calls to g_action_group_query_action().
244 struct ActionGroup /* Interface */ {
245 mixin template __interface__() {
246 // VERSION: 2.28
247 // Emits the #GActionGroup::action-added signal on @action_group.
249 // This function should only be called by #GActionGroup implementations.
250 // <action_name>: the name of an action in the group
251 void action_added(AT0)(AT0 /*char*/ action_name) nothrow {
252 g_action_group_action_added(cast(ActionGroup*)&this, toCString!(char*)(action_name));
255 // VERSION: 2.28
256 // Emits the #GActionGroup::action-enabled-changed signal on @action_group.
258 // This function should only be called by #GActionGroup implementations.
259 // <action_name>: the name of an action in the group
260 // <enabled>: whether or not the action is now enabled
261 void action_enabled_changed(AT0)(AT0 /*char*/ action_name, int enabled) nothrow {
262 g_action_group_action_enabled_changed(cast(ActionGroup*)&this, toCString!(char*)(action_name), enabled);
265 // VERSION: 2.28
266 // Emits the #GActionGroup::action-removed signal on @action_group.
268 // This function should only be called by #GActionGroup implementations.
269 // <action_name>: the name of an action in the group
270 void action_removed(AT0)(AT0 /*char*/ action_name) nothrow {
271 g_action_group_action_removed(cast(ActionGroup*)&this, toCString!(char*)(action_name));
274 // VERSION: 2.28
275 // Emits the #GActionGroup::action-state-changed signal on @action_group.
277 // This function should only be called by #GActionGroup implementations.
278 // <action_name>: the name of an action in the group
279 // <state>: the new state of the named action
280 void action_state_changed(AT0, AT1)(AT0 /*char*/ action_name, AT1 /*GLib2.Variant*/ state) nothrow {
281 g_action_group_action_state_changed(cast(ActionGroup*)&this, toCString!(char*)(action_name), UpCast!(GLib2.Variant*)(state));
284 // VERSION: 2.28
285 // Activate the named action within @action_group.
287 // If the action is expecting a parameter, then the correct type of
288 // parameter must be given as @parameter. If the action is expecting no
289 // parameters then @parameter must be %NULL. See
290 // g_action_group_get_action_parameter_type().
291 // <action_name>: the name of the action to activate
292 // <parameter>: parameters to the activation
293 void activate_action(AT0, AT1)(AT0 /*char*/ action_name, AT1 /*GLib2.Variant*/ parameter=null) nothrow {
294 g_action_group_activate_action(cast(ActionGroup*)&this, toCString!(char*)(action_name), UpCast!(GLib2.Variant*)(parameter));
297 // VERSION: 2.28
298 // Request for the state of the named action within @action_group to be
299 // changed to @value.
301 // The action must be stateful and @value must be of the correct type.
302 // See g_action_group_get_action_state_type().
304 // This call merely requests a change. The action may refuse to change
305 // its state or may change its state to something other than @value.
306 // See g_action_group_get_action_state_hint().
308 // If the @value GVariant is floating, it is consumed.
309 // <action_name>: the name of the action to request the change on
310 // <value>: the new state
311 void change_action_state(AT0, AT1)(AT0 /*char*/ action_name, AT1 /*GLib2.Variant*/ value) nothrow {
312 g_action_group_change_action_state(cast(ActionGroup*)&this, toCString!(char*)(action_name), UpCast!(GLib2.Variant*)(value));
315 // VERSION: 2.28
316 // Checks if the named action within @action_group is currently enabled.
318 // An action must be enabled in order to be activated or in order to
319 // have its state changed from outside callers.
320 // RETURNS: whether or not the action is currently enabled
321 // <action_name>: the name of the action to query
322 int get_action_enabled(AT0)(AT0 /*char*/ action_name) nothrow {
323 return g_action_group_get_action_enabled(cast(ActionGroup*)&this, toCString!(char*)(action_name));
326 // VERSION: 2.28
327 // Queries the type of the parameter that must be given when activating
328 // the named action within @action_group.
330 // When activating the action using g_action_group_activate_action(),
331 // the #GVariant given to that function must be of the type returned
332 // by this function.
334 // In the case that this function returns %NULL, you must not give any
335 // #GVariant, but %NULL instead.
337 // The parameter type of a particular action will never change but it is
338 // possible for an action to be removed and for a new action to be added
339 // with the same name but a different parameter type.
340 // RETURNS: the parameter type
341 // <action_name>: the name of the action to query
342 GLib2.VariantType* get_action_parameter_type(AT0)(AT0 /*char*/ action_name) nothrow {
343 return g_action_group_get_action_parameter_type(cast(ActionGroup*)&this, toCString!(char*)(action_name));
346 // VERSION: 2.28
347 // Queries the current state of the named action within @action_group.
349 // If the action is not stateful then %NULL will be returned. If the
350 // action is stateful then the type of the return value is the type
351 // given by g_action_group_get_action_state_type().
353 // The return value (if non-%NULL) should be freed with
354 // g_variant_unref() when it is no longer required.
355 // RETURNS: the current state of the action
356 // <action_name>: the name of the action to query
357 GLib2.Variant* /*new*/ get_action_state(AT0)(AT0 /*char*/ action_name) nothrow {
358 return g_action_group_get_action_state(cast(ActionGroup*)&this, toCString!(char*)(action_name));
361 // VERSION: 2.28
362 // Requests a hint about the valid range of values for the state of the
363 // named action within @action_group.
365 // If %NULL is returned it either means that the action is not stateful
366 // or that there is no hint about the valid range of values for the
367 // state of the action.
369 // If a #GVariant array is returned then each item in the array is a
370 // possible value for the state. If a #GVariant pair (ie: two-tuple) is
371 // returned then the tuple specifies the inclusive lower and upper bound
372 // of valid values for the state.
374 // In any case, the information is merely a hint. It may be possible to
375 // have a state value outside of the hinted range and setting a value
376 // within the range may fail.
378 // The return value (if non-%NULL) should be freed with
379 // g_variant_unref() when it is no longer required.
380 // RETURNS: the state range hint
381 // <action_name>: the name of the action to query
382 GLib2.Variant* /*new*/ get_action_state_hint(AT0)(AT0 /*char*/ action_name) nothrow {
383 return g_action_group_get_action_state_hint(cast(ActionGroup*)&this, toCString!(char*)(action_name));
386 // VERSION: 2.28
387 // Queries the type of the state of the named action within
388 // @action_group.
390 // If the action is stateful then this function returns the
391 // #GVariantType of the state. All calls to
392 // g_action_group_change_action_state() must give a #GVariant of this
393 // type and g_action_group_get_action_state() will return a #GVariant
394 // of the same type.
396 // If the action is not stateful then this function will return %NULL.
397 // In that case, g_action_group_get_action_state() will return %NULL
398 // and you must not call g_action_group_change_action_state().
400 // The state type of a particular action will never change but it is
401 // possible for an action to be removed and for a new action to be added
402 // with the same name but a different state type.
403 // RETURNS: the state type, if the action is stateful
404 // <action_name>: the name of the action to query
405 GLib2.VariantType* /*new*/ get_action_state_type(AT0)(AT0 /*char*/ action_name) nothrow {
406 return g_action_group_get_action_state_type(cast(ActionGroup*)&this, toCString!(char*)(action_name));
409 // VERSION: 2.28
410 // Checks if the named action exists within @action_group.
411 // RETURNS: whether the named action exists
412 // <action_name>: the name of the action to check for
413 int has_action(AT0)(AT0 /*char*/ action_name) nothrow {
414 return g_action_group_has_action(cast(ActionGroup*)&this, toCString!(char*)(action_name));
417 // VERSION: 2.28
418 // Lists the actions contained within @action_group.
420 // The caller is responsible for freeing the list with g_strfreev() when
421 // it is no longer required.
423 // actions in the groupb
424 // RETURNS: a %NULL-terminated array of the names of the
425 char** /*new*/ list_actions()() nothrow {
426 return g_action_group_list_actions(cast(ActionGroup*)&this);
429 // VERSION: 2.32
430 // Queries all aspects of the named action within an @action_group.
432 // This function acquires the information available from
433 // g_action_group_has_action(), g_action_group_get_action_enabled(),
434 // g_action_group_get_action_parameter_type(),
435 // g_action_group_get_action_state_type(),
436 // g_action_group_get_action_state_hint() and
437 // g_action_group_get_action_state() with a single function call.
439 // This provides two main benefits.
441 // The first is the improvement in efficiency that comes with not having
442 // to perform repeated lookups of the action in order to discover
443 // different things about it. The second is that implementing
444 // #GActionGroup can now be done by only overriding this one virtual
445 // function.
447 // The interface provides a default implementation of this function that
448 // calls the individual functions, as required, to fetch the
449 // information. The interface also provides default implementations of
450 // those functions that call this function. All implementations,
451 // therefore, must override either this function or all of the others.
453 // If the action exists, %TRUE is returned and any of the requested
454 // fields (as indicated by having a non-%NULL reference passed in) are
455 // filled. If the action doesn't exist, %FALSE is returned and the
456 // fields may or may not have been modified.
457 // RETURNS: %TRUE if the action exists, else %FALSE
458 // <action_name>: the name of an action in the group
459 // <enabled>: if the action is presently enabled
460 // <parameter_type>: the parameter type, or %NULL if none needed
461 // <state_type>: the state type, or %NULL if stateless
462 // <state_hint>: the state hint, or %NULL if none
463 // <state>: the current state, or %NULL if stateless
464 int query_action(AT0, AT1, AT2, AT3, AT4)(AT0 /*char*/ action_name, /*out*/ int* enabled, /*out*/ AT1 /*GLib2.VariantType**/ parameter_type, /*out*/ AT2 /*GLib2.VariantType**/ state_type, /*out*/ AT3 /*GLib2.Variant**/ state_hint, /*out*/ AT4 /*GLib2.Variant**/ state) nothrow {
465 return g_action_group_query_action(cast(ActionGroup*)&this, toCString!(char*)(action_name), enabled, UpCast!(GLib2.VariantType**)(parameter_type), UpCast!(GLib2.VariantType**)(state_type), UpCast!(GLib2.Variant**)(state_hint), UpCast!(GLib2.Variant**)(state));
468 // VERSION: 2.28
469 // Signals that a new action was just added to the group.
470 // This signal is emitted after the action has been added
471 // and is now visible.
472 // <action_name>: the name of the action in @action_group
473 extern (C) alias static void function (ActionGroup* this_, char* action_name, void* user_data=null) nothrow signal_action_added;
475 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
476 return super_.signal_connect!name(cb, data, cf);
479 ulong signal_connect(string name:"action-added", CB/*:signal_action_added*/)
480 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
481 if (is(typeof(cb)==signal_action_added)||_ttmm!(CB, signal_action_added)()) {
482 return signal_connect_data!()(&this, cast(char*)"action-added",
483 cast(GObject2.Callback)cb, data, null, cf);
486 // VERSION: 2.28
487 // Signals that the enabled status of the named action has changed.
488 // <action_name>: the name of the action in @action_group
489 // <enabled>: whether the action is enabled or not
490 extern (C) alias static void function (ActionGroup* this_, char* action_name, c_int enabled, void* user_data=null) nothrow signal_action_enabled_changed;
491 ulong signal_connect(string name:"action-enabled-changed", CB/*:signal_action_enabled_changed*/)
492 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
493 if (is(typeof(cb)==signal_action_enabled_changed)||_ttmm!(CB, signal_action_enabled_changed)()) {
494 return signal_connect_data!()(&this, cast(char*)"action-enabled-changed",
495 cast(GObject2.Callback)cb, data, null, cf);
498 // VERSION: 2.28
499 // Signals that an action is just about to be removed from the group.
500 // This signal is emitted before the action is removed, so the action
501 // is still visible and can be queried from the signal handler.
502 // <action_name>: the name of the action in @action_group
503 extern (C) alias static void function (ActionGroup* this_, char* action_name, void* user_data=null) nothrow signal_action_removed;
504 ulong signal_connect(string name:"action-removed", CB/*:signal_action_removed*/)
505 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
506 if (is(typeof(cb)==signal_action_removed)||_ttmm!(CB, signal_action_removed)()) {
507 return signal_connect_data!()(&this, cast(char*)"action-removed",
508 cast(GObject2.Callback)cb, data, null, cf);
511 // VERSION: 2.28
512 // Signals that the state of the named action has changed.
513 // <action_name>: the name of the action in @action_group
514 // <value>: the new value of the state
515 extern (C) alias static void function (ActionGroup* this_, char* action_name, GLib2.Variant* value, void* user_data=null) nothrow signal_action_state_changed;
516 ulong signal_connect(string name:"action-state-changed", CB/*:signal_action_state_changed*/)
517 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
518 if (is(typeof(cb)==signal_action_state_changed)||_ttmm!(CB, signal_action_state_changed)()) {
519 return signal_connect_data!()(&this, cast(char*)"action-state-changed",
520 cast(GObject2.Callback)cb, data, null, cf);
523 mixin __interface__;
526 // The virtual function table for #GActionGroup.
527 struct ActionGroupInterface /* Version 2.28 */ {
528 GObject2.TypeInterface g_iface;
530 // RETURNS: whether the named action exists
531 // <action_name>: the name of the action to check for
532 extern (C) int function (ActionGroup* action_group, char* action_name) nothrow has_action;
533 // RETURNS: a %NULL-terminated array of the names of the
534 extern (C) char** /*new*/ function (ActionGroup* action_group) nothrow list_actions;
536 // RETURNS: whether or not the action is currently enabled
537 // <action_name>: the name of the action to query
538 extern (C) int function (ActionGroup* action_group, char* action_name) nothrow get_action_enabled;
540 // RETURNS: the parameter type
541 // <action_name>: the name of the action to query
542 extern (C) GLib2.VariantType* function (ActionGroup* action_group, char* action_name) nothrow get_action_parameter_type;
544 // RETURNS: the state type, if the action is stateful
545 // <action_name>: the name of the action to query
546 extern (C) GLib2.VariantType* /*new*/ function (ActionGroup* action_group, char* action_name) nothrow get_action_state_type;
548 // RETURNS: the state range hint
549 // <action_name>: the name of the action to query
550 extern (C) GLib2.Variant* /*new*/ function (ActionGroup* action_group, char* action_name) nothrow get_action_state_hint;
552 // RETURNS: the current state of the action
553 // <action_name>: the name of the action to query
554 extern (C) GLib2.Variant* /*new*/ function (ActionGroup* action_group, char* action_name) nothrow get_action_state;
556 // <action_name>: the name of the action to request the change on
557 // <value>: the new state
558 extern (C) void function (ActionGroup* action_group, char* action_name, GLib2.Variant* value) nothrow change_action_state;
560 // <action_name>: the name of the action to activate
561 // <parameter>: parameters to the activation
562 extern (C) void function (ActionGroup* action_group, char* action_name, GLib2.Variant* parameter=null) nothrow activate_action;
563 // <action_name>: the name of an action in the group
564 extern (C) void function (ActionGroup* action_group, char* action_name) nothrow action_added;
565 // <action_name>: the name of an action in the group
566 extern (C) void function (ActionGroup* action_group, char* action_name) nothrow action_removed;
568 // <action_name>: the name of an action in the group
569 // <enabled>: whether or not the action is now enabled
570 extern (C) void function (ActionGroup* action_group, char* action_name, int enabled) nothrow action_enabled_changed;
572 // <action_name>: the name of an action in the group
573 // <state>: the new state of the named action
574 extern (C) void function (ActionGroup* action_group, char* action_name, GLib2.Variant* state) nothrow action_state_changed;
576 // RETURNS: %TRUE if the action exists, else %FALSE
577 // <action_name>: the name of an action in the group
578 // <enabled>: if the action is presently enabled
579 // <parameter_type>: the parameter type, or %NULL if none needed
580 // <state_type>: the state type, or %NULL if stateless
581 // <state_hint>: the state hint, or %NULL if none
582 // <state>: the current state, or %NULL if stateless
583 extern (C) int function (ActionGroup* action_group, char* action_name, /*out*/ int* enabled, /*out*/ GLib2.VariantType** parameter_type, /*out*/ GLib2.VariantType** state_type, /*out*/ GLib2.Variant** state_hint, /*out*/ GLib2.Variant** state) nothrow query_action;
586 // The virtual function table for #GAction.
587 struct ActionInterface /* Version 2.28 */ {
588 GObject2.TypeInterface g_iface;
589 // RETURNS: the name of the action
590 extern (C) char* function (Action* action) nothrow get_name;
591 // RETURNS: the parameter type
592 extern (C) GLib2.VariantType* function (Action* action) nothrow get_parameter_type;
593 // RETURNS: the state type, if the action is stateful
594 extern (C) GLib2.VariantType* function (Action* action) nothrow get_state_type;
595 // RETURNS: the state range hint
596 extern (C) GLib2.Variant* /*new*/ function (Action* action) nothrow get_state_hint;
597 // RETURNS: whether the action is enabled
598 extern (C) int function (Action* action) nothrow get_enabled;
599 // RETURNS: the current state of the action
600 extern (C) GLib2.Variant* /*new*/ function (Action* action) nothrow get_state;
601 // <value>: the new state
602 extern (C) void function (Action* action, GLib2.Variant* value) nothrow change_state;
603 // <parameter>: the parameter to the activation
604 extern (C) void function (Action* action, GLib2.Variant* parameter=null) nothrow activate;
608 // The GActionMap interface is implemented by #GActionGroup
609 // implementations that operate by containing a number of
610 // named #GAction instances, such as #GSimpleActionGroup.
612 // One useful application of this interface is to map the
613 // names of actions from various action groups to unique,
614 // prefixed names (e.g. by prepending "app." or "win.").
615 // This is the motivation for the 'Map' part of the interface
616 // name.
617 struct ActionMap /* Interface */ {
618 mixin template __interface__() {
619 // VERSION: 2.32
620 // Adds an action to the @action_map.
622 // If the action map already contains an action with the same name
623 // as @action then the old action is dropped from the action map.
625 // The action map takes its own reference on @action.
626 // <action>: a #GAction
627 void add_action(AT0)(AT0 /*Action*/ action) nothrow {
628 g_action_map_add_action(cast(ActionMap*)&this, UpCast!(Action*)(action));
631 // VERSION: 2.32
632 // A convenience function for creating multiple #GSimpleAction instances
633 // and adding them to a #GActionMap.
635 // Each action is constructed as per one #GActionEntry.
637 // <example>
638 // <title>Using g_action_map_add_action_entries()</title>
639 // <programlisting>
640 // static void
641 // activate_quit (GSimpleAction *simple,
642 // GVariant *parameter,
643 // gpointer user_data)
644 // {
645 // exit (0);
646 // }
648 // static void
649 // activate_print_string (GSimpleAction *simple,
650 // GVariant *parameter,
651 // gpointer user_data)
652 // {
653 // g_print ("%s\n", g_variant_get_string (parameter, NULL));
654 // }
656 // static GActionGroup *
657 // create_action_group (void)
658 // {
659 // const GActionEntry entries[] = {
660 // { "quit", activate_quit },
661 // { "print-string", activate_print_string, "s" }
662 // };
663 // GSimpleActionGroup *group;
665 // group = g_simple_action_group_new ();
666 // g_action_map_add_action_entries (G_ACTION_MAP (group), entries, G_N_ELEMENTS (entries), NULL);
668 // return G_ACTION_GROUP (group);
669 // }
670 // </programlisting>
671 // </example>
672 // <entries>: a pointer to the first item in an array of #GActionEntry structs
673 // <n_entries>: the length of @entries, or -1 if @entries is %NULL-terminated
674 // <user_data>: the user data for signal connections
675 void add_action_entries(AT0, AT1)(AT0 /*ActionEntry*/ entries, int n_entries, AT1 /*void*/ user_data) nothrow {
676 g_action_map_add_action_entries(cast(ActionMap*)&this, UpCast!(ActionEntry*)(entries), n_entries, UpCast!(void*)(user_data));
679 // VERSION: 2.32
680 // Looks up the action with the name @action_name in @action_map.
682 // If no such action exists, returns %NULL.
683 // RETURNS: a #GAction, or %NULL
684 // <action_name>: the name of an action
685 Action* lookup_action(AT0)(AT0 /*char*/ action_name) nothrow {
686 return g_action_map_lookup_action(cast(ActionMap*)&this, toCString!(char*)(action_name));
689 // VERSION: 2.32
690 // Removes the named action from the action map.
692 // If no action of this name is in the map then nothing happens.
693 // <action_name>: the name of the action
694 void remove_action(AT0)(AT0 /*char*/ action_name) nothrow {
695 g_action_map_remove_action(cast(ActionMap*)&this, toCString!(char*)(action_name));
698 mixin __interface__;
701 // The virtual function table for #GActionMap.
702 struct ActionMapInterface /* Version 2.32 */ {
703 GObject2.TypeInterface g_iface;
705 // RETURNS: a #GAction, or %NULL
706 // <action_name>: the name of an action
707 extern (C) Action* function (ActionMap* action_map, char* action_name) nothrow lookup_action;
708 // <action>: a #GAction
709 extern (C) void function (ActionMap* action_map, Action* action) nothrow add_action;
710 // <action_name>: the name of the action
711 extern (C) void function (ActionMap* action_map, char* action_name) nothrow remove_action;
715 // #GAppInfo and #GAppLaunchContext are used for describing and launching
716 // applications installed on the system.
718 // As of GLib 2.20, URIs will always be converted to POSIX paths
719 // (using g_file_get_path()) when using g_app_info_launch() even if
720 // the application requested an URI and not a POSIX path. For example
721 // for an desktop-file based application with Exec key <literal>totem
722 // &percnt;U</literal> and a single URI,
723 // <literal>sftp://foo/file.avi</literal>, then
724 // <literal>/home/user/.gvfs/sftp on foo/file.avi</literal> will be
725 // passed. This will only work if a set of suitable GIO extensions
726 // (such as gvfs 2.26 compiled with FUSE support), is available and
727 // operational; if this is not the case, the URI will be passed
728 // unmodified to the application. Some URIs, such as
729 // <literal>mailto:</literal>, of course cannot be mapped to a POSIX
730 // path (in gvfs there's no FUSE mount for it); such URIs will be
731 // passed unmodified to the application.
733 // Specifically for gvfs 2.26 and later, the POSIX URI will be mapped
734 // back to the GIO URI in the #GFile constructors (since gvfs
735 // implements the #GVfs extension point). As such, if the application
736 // needs to examine the URI, it needs to use g_file_get_uri() or
737 // similar on #GFile. In other words, an application cannot assume
738 // that the URI passed to e.g. g_file_new_for_commandline_arg() is
739 // equal to the result of g_file_get_uri(). The following snippet
740 // illustrates this:
742 // <programlisting>
743 // GFile *f;
744 // char *uri;
746 // file = g_file_new_for_commandline_arg (uri_from_commandline);
748 // uri = g_file_get_uri (file);
749 // strcmp (uri, uri_from_commandline) == 0; // FALSE
750 // g_free (uri);
752 // if (g_file_has_uri_scheme (file, "cdda"))
753 // {
754 // // do something special with uri
755 // }
756 // g_object_unref (file);
757 // </programlisting>
759 // This code will work when both <literal>cdda://sr0/Track
760 // 1.wav</literal> and <literal>/home/user/.gvfs/cdda on sr0/Track
761 // 1.wav</literal> is passed to the application. It should be noted
762 // that it's generally not safe for applications to rely on the format
763 // of a particular URIs. Different launcher applications (e.g. file
764 // managers) may have different ideas of what a given URI means.
765 struct AppInfo /* Interface */ {
766 mixin template __interface__() {
767 // Creates a new #GAppInfo from the given information.
768 // RETURNS: new #GAppInfo for given command.
769 // <commandline>: the commandline to use
770 // <application_name>: the application name, or %NULL to use @commandline
771 // <flags>: flags that can specify details of the created #GAppInfo
772 static AppInfo* /*new*/ create_from_commandline(AT0, AT1, AT2)(AT0 /*char*/ commandline, AT1 /*char*/ application_name, AppInfoCreateFlags flags, AT2 /*GLib2.Error**/ error=null) nothrow {
773 return g_app_info_create_from_commandline(toCString!(char*)(commandline), toCString!(char*)(application_name), flags, UpCast!(GLib2.Error**)(error));
776 // Gets a list of all of the applications currently registered
777 // on this system.
779 // For desktop files, this includes applications that have
780 // <literal>NoDisplay=true</literal> set or are excluded from
781 // display by means of <literal>OnlyShowIn</literal> or
782 // <literal>NotShowIn</literal>. See g_app_info_should_show().
783 // The returned list does not include applications which have
784 // the <literal>Hidden</literal> key set.
785 // RETURNS: a newly allocated #GList of references to #GAppInfo<!---->s.
786 static GLib2.List* /*new*/ get_all()() nothrow {
787 return g_app_info_get_all();
790 // Gets a list of all #GAppInfos for a given content type,
791 // including the recommended and fallback #GAppInfos. See
792 // g_app_info_get_recommended_for_type() and
793 // g_app_info_get_fallback_for_type().
795 // for given @content_type or %NULL on error.
796 // RETURNS: #GList of #GAppInfos
797 // <content_type>: the content type to find a #GAppInfo for
798 static GLib2.List* /*new*/ get_all_for_type(AT0)(AT0 /*char*/ content_type) nothrow {
799 return g_app_info_get_all_for_type(toCString!(char*)(content_type));
802 // Gets the default #GAppInfo for a given content type.
804 // %NULL on error.
805 // RETURNS: #GAppInfo for given @content_type or
806 // <content_type>: the content type to find a #GAppInfo for
807 // <must_support_uris>: if %TRUE, the #GAppInfo is expected to support URIs
808 static AppInfo* /*new*/ get_default_for_type(AT0)(AT0 /*char*/ content_type, int must_support_uris) nothrow {
809 return g_app_info_get_default_for_type(toCString!(char*)(content_type), must_support_uris);
812 // Gets the default application for handling URIs with
813 // the given URI scheme. A URI scheme is the initial part
814 // of the URI, up to but not including the ':', e.g. "http",
815 // "ftp" or "sip".
816 // RETURNS: #GAppInfo for given @uri_scheme or %NULL on error.
817 // <uri_scheme>: a string containing a URI scheme.
818 static AppInfo* /*new*/ get_default_for_uri_scheme(AT0)(AT0 /*char*/ uri_scheme) nothrow {
819 return g_app_info_get_default_for_uri_scheme(toCString!(char*)(uri_scheme));
822 // VERSION: 2.28
823 // Gets a list of fallback #GAppInfos for a given content type, i.e.
824 // those applications which claim to support the given content type
825 // by MIME type subclassing and not directly.
827 // for given @content_type or %NULL on error.
828 // RETURNS: #GList of #GAppInfos
829 // <content_type>: the content type to find a #GAppInfo for
830 static GLib2.List* /*new*/ get_fallback_for_type(AT0)(AT0 /*char*/ content_type) nothrow {
831 return g_app_info_get_fallback_for_type(toCString!(char*)(content_type));
834 // VERSION: 2.28
835 // Gets a list of recommended #GAppInfos for a given content type, i.e.
836 // those applications which claim to support the given content type exactly,
837 // and not by MIME type subclassing.
838 // Note that the first application of the list is the last used one, i.e.
839 // the last one for which g_app_info_set_as_last_used_for_type() has been
840 // called.
842 // for given @content_type or %NULL on error.
843 // RETURNS: #GList of #GAppInfos
844 // <content_type>: the content type to find a #GAppInfo for
845 static GLib2.List* /*new*/ get_recommended_for_type(AT0)(AT0 /*char*/ content_type) nothrow {
846 return g_app_info_get_recommended_for_type(toCString!(char*)(content_type));
849 // Utility function that launches the default application
850 // registered to handle the specified uri. Synchronous I/O
851 // is done on the uri to detect the type of the file if
852 // required.
853 // RETURNS: %TRUE on success, %FALSE on error.
854 // <uri>: the uri to show
855 // <launch_context>: an optional #GAppLaunchContext.
856 static int launch_default_for_uri(AT0, AT1, AT2)(AT0 /*char*/ uri, AT1 /*AppLaunchContext*/ launch_context, AT2 /*GLib2.Error**/ error=null) nothrow {
857 return g_app_info_launch_default_for_uri(toCString!(char*)(uri), UpCast!(AppLaunchContext*)(launch_context), UpCast!(GLib2.Error**)(error));
860 // VERSION: 2.20
861 // Removes all changes to the type associations done by
862 // g_app_info_set_as_default_for_type(),
863 // g_app_info_set_as_default_for_extension(),
864 // g_app_info_add_supports_type() or
865 // g_app_info_remove_supports_type().
866 // <content_type>: a content type
867 static void reset_type_associations(AT0)(AT0 /*char*/ content_type) nothrow {
868 g_app_info_reset_type_associations(toCString!(char*)(content_type));
871 // Adds a content type to the application information to indicate the
872 // application is capable of opening files with the given content type.
873 // RETURNS: %TRUE on success, %FALSE on error.
874 // <content_type>: a string.
875 int add_supports_type(AT0, AT1)(AT0 /*char*/ content_type, AT1 /*GLib2.Error**/ error=null) nothrow {
876 return g_app_info_add_supports_type(cast(AppInfo*)&this, toCString!(char*)(content_type), UpCast!(GLib2.Error**)(error));
879 // VERSION: 2.20
880 // Obtains the information whether the #GAppInfo can be deleted.
881 // See g_app_info_delete().
882 // RETURNS: %TRUE if @appinfo can be deleted
883 int can_delete()() nothrow {
884 return g_app_info_can_delete(cast(AppInfo*)&this);
887 // Checks if a supported content type can be removed from an application.
889 // content types from a given @appinfo, %FALSE if not.
890 // RETURNS: %TRUE if it is possible to remove supported
891 int can_remove_supports_type()() nothrow {
892 return g_app_info_can_remove_supports_type(cast(AppInfo*)&this);
895 // VERSION: 2.20
896 // Tries to delete a #GAppInfo.
898 // On some platforms, there may be a difference between user-defined
899 // #GAppInfo<!-- -->s which can be deleted, and system-wide ones which
900 // cannot. See g_app_info_can_delete().
901 // RETURNS: %TRUE if @appinfo has been deleted
902 int delete_()() nothrow {
903 return g_app_info_delete(cast(AppInfo*)&this);
906 // Creates a duplicate of a #GAppInfo.
907 // RETURNS: a duplicate of @appinfo.
908 AppInfo* /*new*/ dup()() nothrow {
909 return g_app_info_dup(cast(AppInfo*)&this);
912 // Checks if two #GAppInfo<!-- -->s are equal.
913 // RETURNS: %TRUE if @appinfo1 is equal to @appinfo2. %FALSE otherwise.
914 // <appinfo2>: the second #GAppInfo.
915 int equal(AT0)(AT0 /*AppInfo*/ appinfo2) nothrow {
916 return g_app_info_equal(cast(AppInfo*)&this, UpCast!(AppInfo*)(appinfo2));
919 // VERSION: 2.20
920 // Gets the commandline with which the application will be
921 // started.
923 // or %NULL if this information is not available
924 // RETURNS: a string containing the @appinfo's commandline,
925 char* get_commandline()() nothrow {
926 return g_app_info_get_commandline(cast(AppInfo*)&this);
929 // Gets a human-readable description of an installed application.
931 // application @appinfo, or %NULL if none.
932 // RETURNS: a string containing a description of the
933 char* get_description()() nothrow {
934 return g_app_info_get_description(cast(AppInfo*)&this);
937 // VERSION: 2.24
938 // Gets the display name of the application. The display name is often more
939 // descriptive to the user than the name itself.
941 // no display name is available.
942 // RETURNS: the display name of the application for @appinfo, or the name if
943 char* get_display_name()() nothrow {
944 return g_app_info_get_display_name(cast(AppInfo*)&this);
947 // Gets the executable's name for the installed application.
949 // binaries name
950 // RETURNS: a string containing the @appinfo's application
951 char* get_executable()() nothrow {
952 return g_app_info_get_executable(cast(AppInfo*)&this);
955 // Gets the icon for the application.
957 // if there is no default icon.
958 // RETURNS: the default #GIcon for @appinfo or %NULL
959 Icon* get_icon()() nothrow {
960 return g_app_info_get_icon(cast(AppInfo*)&this);
963 // Gets the ID of an application. An id is a string that
964 // identifies the application. The exact format of the id is
965 // platform dependent. For instance, on Unix this is the
966 // desktop file id from the xdg menu specification.
968 // Note that the returned ID may be %NULL, depending on how
969 // the @appinfo has been constructed.
970 // RETURNS: a string containing the application's ID.
971 char* get_id()() nothrow {
972 return g_app_info_get_id(cast(AppInfo*)&this);
975 // Gets the installed name of the application.
976 // RETURNS: the name of the application for @appinfo.
977 char* get_name()() nothrow {
978 return g_app_info_get_name(cast(AppInfo*)&this);
981 // Launches the application. Passes @files to the launched application
982 // as arguments, using the optional @launch_context to get information
983 // about the details of the launcher (like what screen it is on).
984 // On error, @error will be set accordingly.
986 // To launch the application without arguments pass a %NULL @files list.
988 // Note that even if the launch is successful the application launched
989 // can fail to start if it runs into problems during startup. There is
990 // no way to detect this.
992 // Some URIs can be changed when passed through a GFile (for instance
993 // unsupported URIs with strange formats like mailto:), so if you have
994 // a textual URI you want to pass in as argument, consider using
995 // g_app_info_launch_uris() instead.
997 // The launched application inherits the environment of the launching
998 // process, but it can be modified with g_app_launch_context_setenv() and
999 // g_app_launch_context_unsetenv().
1001 // On UNIX, this function sets the <envar>GIO_LAUNCHED_DESKTOP_FILE</envar>
1002 // environment variable with the path of the launched desktop file and
1003 // <envar>GIO_LAUNCHED_DESKTOP_FILE_PID</envar> to the process
1004 // id of the launched process. This can be used to ignore
1005 // <envar>GIO_LAUNCHED_DESKTOP_FILE</envar>, should it be inherited
1006 // by further processes. The <envar>DISPLAY</envar> and
1007 // <envar>DESKTOP_STARTUP_ID</envar> environment variables are also
1008 // set, based on information provided in @launch_context.
1009 // RETURNS: %TRUE on successful launch, %FALSE otherwise.
1010 // <files>: a #GList of #GFile objects
1011 // <launch_context>: a #GAppLaunchContext or %NULL
1012 int launch(AT0, AT1, AT2)(AT0 /*GLib2.List*/ files, AT1 /*AppLaunchContext*/ launch_context, AT2 /*GLib2.Error**/ error=null) nothrow {
1013 return g_app_info_launch(cast(AppInfo*)&this, UpCast!(GLib2.List*)(files), UpCast!(AppLaunchContext*)(launch_context), UpCast!(GLib2.Error**)(error));
1016 // Launches the application. This passes the @uris to the launched application
1017 // as arguments, using the optional @launch_context to get information
1018 // about the details of the launcher (like what screen it is on).
1019 // On error, @error will be set accordingly.
1021 // To launch the application without arguments pass a %NULL @uris list.
1023 // Note that even if the launch is successful the application launched
1024 // can fail to start if it runs into problems during startup. There is
1025 // no way to detect this.
1026 // RETURNS: %TRUE on successful launch, %FALSE otherwise.
1027 // <uris>: a #GList containing URIs to launch.
1028 // <launch_context>: a #GAppLaunchContext or %NULL
1029 int launch_uris(AT0, AT1, AT2)(AT0 /*GLib2.List*/ uris, AT1 /*AppLaunchContext*/ launch_context, AT2 /*GLib2.Error**/ error=null) nothrow {
1030 return g_app_info_launch_uris(cast(AppInfo*)&this, UpCast!(GLib2.List*)(uris), UpCast!(AppLaunchContext*)(launch_context), UpCast!(GLib2.Error**)(error));
1033 // Removes a supported type from an application, if possible.
1034 // RETURNS: %TRUE on success, %FALSE on error.
1035 // <content_type>: a string.
1036 int remove_supports_type(AT0, AT1)(AT0 /*char*/ content_type, AT1 /*GLib2.Error**/ error=null) nothrow {
1037 return g_app_info_remove_supports_type(cast(AppInfo*)&this, toCString!(char*)(content_type), UpCast!(GLib2.Error**)(error));
1040 // Sets the application as the default handler for the given file extension.
1041 // RETURNS: %TRUE on success, %FALSE on error.
1042 // <extension>: a string containing the file extension (without the dot).
1043 int set_as_default_for_extension(AT0, AT1)(AT0 /*char*/ extension, AT1 /*GLib2.Error**/ error=null) nothrow {
1044 return g_app_info_set_as_default_for_extension(cast(AppInfo*)&this, toCString!(char*)(extension), UpCast!(GLib2.Error**)(error));
1047 // Sets the application as the default handler for a given type.
1048 // RETURNS: %TRUE on success, %FALSE on error.
1049 // <content_type>: the content type.
1050 int set_as_default_for_type(AT0, AT1)(AT0 /*char*/ content_type, AT1 /*GLib2.Error**/ error=null) nothrow {
1051 return g_app_info_set_as_default_for_type(cast(AppInfo*)&this, toCString!(char*)(content_type), UpCast!(GLib2.Error**)(error));
1054 // Sets the application as the last used application for a given type.
1055 // This will make the application appear as first in the list returned
1056 // by g_app_info_get_recommended_for_type(), regardless of the default
1057 // application for that content type.
1058 // RETURNS: %TRUE on success, %FALSE on error.
1059 // <content_type>: the content type.
1060 int set_as_last_used_for_type(AT0, AT1)(AT0 /*char*/ content_type, AT1 /*GLib2.Error**/ error=null) nothrow {
1061 return g_app_info_set_as_last_used_for_type(cast(AppInfo*)&this, toCString!(char*)(content_type), UpCast!(GLib2.Error**)(error));
1064 // Checks if the application info should be shown in menus that
1065 // list available applications.
1066 // RETURNS: %TRUE if the @appinfo should be shown, %FALSE otherwise.
1067 int should_show()() nothrow {
1068 return g_app_info_should_show(cast(AppInfo*)&this);
1071 // Checks if the application accepts files as arguments.
1072 // RETURNS: %TRUE if the @appinfo supports files.
1073 int supports_files()() nothrow {
1074 return g_app_info_supports_files(cast(AppInfo*)&this);
1077 // Checks if the application supports reading files and directories from URIs.
1078 // RETURNS: %TRUE if the @appinfo supports URIs.
1079 int supports_uris()() nothrow {
1080 return g_app_info_supports_uris(cast(AppInfo*)&this);
1083 mixin __interface__;
1086 // Flags used when creating a #GAppInfo.
1087 enum AppInfoCreateFlags {
1088 NONE = 0,
1089 NEEDS_TERMINAL = 1,
1090 SUPPORTS_URIS = 2,
1091 SUPPORTS_STARTUP_NOTIFICATION = 4
1093 // Application Information interface, for operating system portability.
1094 struct AppInfoIface {
1095 GObject2.TypeInterface g_iface;
1096 // RETURNS: a duplicate of @appinfo.
1097 extern (C) AppInfo* /*new*/ function (AppInfo* appinfo) nothrow dup;
1099 // RETURNS: %TRUE if @appinfo1 is equal to @appinfo2. %FALSE otherwise.
1100 // <appinfo2>: the second #GAppInfo.
1101 extern (C) int function (AppInfo* appinfo1, AppInfo* appinfo2) nothrow equal;
1102 // RETURNS: a string containing the application's ID.
1103 extern (C) char* function (AppInfo* appinfo) nothrow get_id;
1104 // RETURNS: the name of the application for @appinfo.
1105 extern (C) char* function (AppInfo* appinfo) nothrow get_name;
1106 // RETURNS: a string containing a description of the
1107 extern (C) char* function (AppInfo* appinfo) nothrow get_description;
1108 // RETURNS: a string containing the @appinfo's application
1109 extern (C) char* function (AppInfo* appinfo) nothrow get_executable;
1110 // RETURNS: the default #GIcon for @appinfo or %NULL
1111 extern (C) Icon* function (AppInfo* appinfo) nothrow get_icon;
1113 // RETURNS: %TRUE on successful launch, %FALSE otherwise.
1114 // <files>: a #GList of #GFile objects
1115 // <launch_context>: a #GAppLaunchContext or %NULL
1116 extern (C) int function (AppInfo* appinfo, GLib2.List* files, AppLaunchContext* launch_context, GLib2.Error** error=null) nothrow launch;
1117 // RETURNS: %TRUE if the @appinfo supports URIs.
1118 extern (C) int function (AppInfo* appinfo) nothrow supports_uris;
1119 // RETURNS: %TRUE if the @appinfo supports files.
1120 extern (C) int function (AppInfo* appinfo) nothrow supports_files;
1122 // RETURNS: %TRUE on successful launch, %FALSE otherwise.
1123 // <uris>: a #GList containing URIs to launch.
1124 // <launch_context>: a #GAppLaunchContext or %NULL
1125 extern (C) int function (AppInfo* appinfo, GLib2.List* uris, AppLaunchContext* launch_context, GLib2.Error** error=null) nothrow launch_uris;
1126 // RETURNS: %TRUE if the @appinfo should be shown, %FALSE otherwise.
1127 extern (C) int function (AppInfo* appinfo) nothrow should_show;
1129 // RETURNS: %TRUE on success, %FALSE on error.
1130 // <content_type>: the content type.
1131 extern (C) int function (AppInfo* appinfo, char* content_type, GLib2.Error** error=null) nothrow set_as_default_for_type;
1133 // RETURNS: %TRUE on success, %FALSE on error.
1134 // <extension>: a string containing the file extension (without the dot).
1135 extern (C) int function (AppInfo* appinfo, char* extension, GLib2.Error** error=null) nothrow set_as_default_for_extension;
1137 // RETURNS: %TRUE on success, %FALSE on error.
1138 // <content_type>: a string.
1139 extern (C) int function (AppInfo* appinfo, char* content_type, GLib2.Error** error=null) nothrow add_supports_type;
1140 // RETURNS: %TRUE if it is possible to remove supported
1141 extern (C) int function (AppInfo* appinfo) nothrow can_remove_supports_type;
1143 // RETURNS: %TRUE on success, %FALSE on error.
1144 // <content_type>: a string.
1145 extern (C) int function (AppInfo* appinfo, char* content_type, GLib2.Error** error=null) nothrow remove_supports_type;
1146 // RETURNS: %TRUE if @appinfo can be deleted
1147 extern (C) int function (AppInfo* appinfo) nothrow can_delete;
1148 // RETURNS: %TRUE if @appinfo has been deleted
1149 extern (C) int function (AppInfo* appinfo) nothrow do_delete;
1150 // RETURNS: a string containing the @appinfo's commandline,
1151 extern (C) char* function (AppInfo* appinfo) nothrow get_commandline;
1152 // RETURNS: the display name of the application for @appinfo, or the name if
1153 extern (C) char* function (AppInfo* appinfo) nothrow get_display_name;
1155 // RETURNS: %TRUE on success, %FALSE on error.
1156 // <content_type>: the content type.
1157 extern (C) int function (AppInfo* appinfo, char* content_type, GLib2.Error** error=null) nothrow set_as_last_used_for_type;
1161 // Integrating the launch with the launching application. This is used to
1162 // handle for instance startup notification and launching the new application
1163 // on the same screen as the launching window.
1164 struct AppLaunchContext /* : GObject.Object */ {
1165 alias parent_instance this;
1166 alias parent_instance super_;
1167 alias parent_instance object;
1168 GObject2.Object parent_instance;
1169 private AppLaunchContextPrivate* priv;
1172 // Creates a new application launch context. This is not normally used,
1173 // instead you instantiate a subclass of this, such as #GdkAppLaunchContext.
1174 // RETURNS: a #GAppLaunchContext.
1175 static AppLaunchContext* /*new*/ new_()() nothrow {
1176 return g_app_launch_context_new();
1178 static auto opCall()() {
1179 return g_app_launch_context_new();
1182 // Gets the display string for the @context. This is used to ensure new
1183 // applications are started on the same display as the launching
1184 // application, by setting the <envar>DISPLAY</envar> environment variable.
1185 // RETURNS: a display string for the display.
1186 // <info>: a #GAppInfo
1187 // <files>: a #GList of #GFile objects
1188 char* /*new*/ get_display(AT0, AT1)(AT0 /*AppInfo*/ info, AT1 /*GLib2.List*/ files) nothrow {
1189 return g_app_launch_context_get_display(&this, UpCast!(AppInfo*)(info), UpCast!(GLib2.List*)(files));
1192 // VERSION: 2.32
1193 // Gets the complete environment variable list to be passed to
1194 // the child process when @context is used to launch an application.
1195 // This is a %NULL-terminated array of strings, where each string has
1196 // the form <literal>KEY=VALUE</literal>.
1198 // child's environment
1199 // RETURNS: the
1200 char** /*new*/ get_environment()() nothrow {
1201 return g_app_launch_context_get_environment(&this);
1204 // Initiates startup notification for the application and returns the
1205 // <envar>DESKTOP_STARTUP_ID</envar> for the launched operation,
1206 // if supported.
1208 // Startup notification IDs are defined in the <ulink
1209 // url="http://standards.freedesktop.org/startup-notification-spec/startup-notification-latest.txt">
1210 // FreeDesktop.Org Startup Notifications standard</ulink>.
1212 // not supported.
1213 // RETURNS: a startup notification ID for the application, or %NULL if
1214 // <info>: a #GAppInfo
1215 // <files>: a #GList of of #GFile objects
1216 char* /*new*/ get_startup_notify_id(AT0, AT1)(AT0 /*AppInfo*/ info, AT1 /*GLib2.List*/ files) nothrow {
1217 return g_app_launch_context_get_startup_notify_id(&this, UpCast!(AppInfo*)(info), UpCast!(GLib2.List*)(files));
1220 // Called when an application has failed to launch, so that it can cancel
1221 // the application startup notification started in g_app_launch_context_get_startup_notify_id().
1222 // <startup_notify_id>: the startup notification id that was returned by g_app_launch_context_get_startup_notify_id().
1223 void launch_failed(AT0)(AT0 /*char*/ startup_notify_id) nothrow {
1224 g_app_launch_context_launch_failed(&this, toCString!(char*)(startup_notify_id));
1227 // VERSION: 2.32
1228 // Arranges for @variable to be set to @value in the child's
1229 // environment when @context is used to launch an application.
1230 // <variable>: the environment variable to set
1231 // <value>: the value for to set the variable to.
1232 void setenv(AT0, AT1)(AT0 /*char*/ variable, AT1 /*char*/ value) nothrow {
1233 g_app_launch_context_setenv(&this, toCString!(char*)(variable), toCString!(char*)(value));
1236 // VERSION: 2.32
1237 // Arranges for @variable to be unset in the child's environment
1238 // when @context is used to launch an application.
1239 // <variable>: the environment variable to remove
1240 void unsetenv(AT0)(AT0 /*char*/ variable) nothrow {
1241 g_app_launch_context_unsetenv(&this, toCString!(char*)(variable));
1245 struct AppLaunchContextClass {
1246 GObject2.ObjectClass parent_class;
1248 // RETURNS: a display string for the display.
1249 // <info>: a #GAppInfo
1250 // <files>: a #GList of #GFile objects
1251 extern (C) char* /*new*/ function (AppLaunchContext* context, AppInfo* info, GLib2.List* files) nothrow get_display;
1253 // RETURNS: a startup notification ID for the application, or %NULL if
1254 // <info>: a #GAppInfo
1255 // <files>: a #GList of of #GFile objects
1256 extern (C) char* /*new*/ function (AppLaunchContext* context, AppInfo* info, GLib2.List* files) nothrow get_startup_notify_id;
1257 // <startup_notify_id>: the startup notification id that was returned by g_app_launch_context_get_startup_notify_id().
1258 extern (C) void function (AppLaunchContext* context, char* startup_notify_id) nothrow launch_failed;
1259 extern (C) void function () nothrow _g_reserved1;
1260 extern (C) void function () nothrow _g_reserved2;
1261 extern (C) void function () nothrow _g_reserved3;
1262 extern (C) void function () nothrow _g_reserved4;
1263 extern (C) void function () nothrow _g_reserved5;
1266 struct AppLaunchContextPrivate {
1270 // A #GApplication is the foundation of an application, unique for a
1271 // given application identifier. The GApplication class wraps some
1272 // low-level platform-specific services and is intended to act as the
1273 // foundation for higher-level application classes such as
1274 // #GtkApplication or #MxApplication. In general, you should not use
1275 // this class outside of a higher level framework.
1277 // One of the core features that GApplication provides is process
1278 // uniqueness, in the context of a "session". The session concept is
1279 // platform-dependent, but corresponds roughly to a graphical desktop
1280 // login. When your application is launched again, its arguments
1281 // are passed through platform communication to the already running
1282 // program. The already running instance of the program is called the
1283 // <firstterm>primary instance</firstterm>. On Linux, the D-Bus session
1284 // bus is used for communication.
1286 // GApplication provides convenient life cycle management by maintaining
1287 // a <firstterm>use count</firstterm> for the primary application instance.
1288 // The use count can be changed using g_application_hold() and
1289 // g_application_release(). If it drops to zero, the application exits.
1290 // Higher-level classes such as #GtkApplication employ the use count to
1291 // ensure that the application stays alive as long as it has any opened
1292 // windows.
1294 // Before using GApplication, you must choose an "application identifier".
1295 // The expected form of an application identifier is very close to that of
1296 // of a <ulink url="http://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-names-interface">DBus bus name</ulink>.
1297 // Examples include: "com.example.MyApp", "org.example.internal-apps.Calculator".
1298 // For details on valid application identifiers, see g_application_id_is_valid().
1300 // On Linux, the application identifier is claimed as a well-known bus name
1301 // on the user's session bus. This means that the uniqueness of your
1302 // application is scoped to the current session. It also means that your
1303 // application may provide additional services (through registration of other
1304 // object paths) at that bus name. The registration of these object paths
1305 // should be done with the shared GDBus session bus. Note that due to the
1306 // internal architecture of GDBus, method calls can be dispatched at any time
1307 // (even if a main loop is not running). For this reason, you must ensure that
1308 // any object paths that you wish to register are registered before #GApplication
1309 // attempts to acquire the bus name of your application (which happens in
1310 // g_application_register()). Unfortunately, this means that you cannot use
1311 // g_application_get_is_remote() to decide if you want to register object paths.
1313 // GApplication also implements the #GActionGroup and #GActionMap
1314 // interfaces and lets you easily export actions by adding them with
1315 // g_action_map_add_action(). When invoking an action by calling
1316 // g_action_group_activate_action() on the application, it is always
1317 // invoked in the primary instance. The actions are also exported on
1318 // the session bus, and GIO provides the #GDBusActionGroup wrapper to
1319 // conveniently access them remotely. GIO provides a #GDBusMenuModel wrapper
1320 // for remote access to exported #GMenuModels.
1322 // There is a number of different entry points into a GApplication:
1323 // <itemizedlist>
1324 // <listitem>via 'Activate' (i.e. just starting the application)</listitem>
1325 // <listitem>via 'Open' (i.e. opening some files)</listitem>
1326 // <listitem>by handling a command-line</listitem>
1327 // <listitem>via activating an action</listitem>
1328 // </itemizedlist>
1329 // The #GApplication::startup signal lets you handle the application
1330 // initialization for all of these in a single place.
1332 // Regardless of which of these entry points is used to start the application,
1333 // GApplication passes some <firstterm id="platform-data">platform
1334 // data</firstterm> from the launching instance to the primary instance,
1335 // in the form of a #GVariant dictionary mapping strings to variants.
1336 // To use platform data, override the @before_emit or @after_emit virtual
1337 // functions in your #GApplication subclass. When dealing with
1338 // #GApplicationCommandLine objects, the platform data is directly
1339 // available via g_application_command_line_get_cwd(),
1340 // g_application_command_line_get_environ() and
1341 // g_application_command_line_get_platform_data().
1343 // As the name indicates, the platform data may vary depending on the
1344 // operating system, but it always includes the current directory (key
1345 // "cwd"), and optionally the environment (ie the set of environment
1346 // variables and their values) of the calling process (key "environ").
1347 // The environment is only added to the platform data if the
1348 // %G_APPLICATION_SEND_ENVIRONMENT flag is set. #GApplication subclasses
1349 // can add their own platform data by overriding the @add_platform_data
1350 // virtual function. For instance, #GtkApplication adds startup notification
1351 // data in this way.
1353 // To parse commandline arguments you may handle the
1354 // #GApplication::command-line signal or override the local_command_line()
1355 // vfunc, to parse them in either the primary instance or the local instance,
1356 // respectively.
1358 // <example id="gapplication-example-open"><title>Opening files with a GApplication</title>
1359 // <programlisting>
1360 // <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-open.c">
1361 // <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
1362 // </xi:include>
1363 // </programlisting>
1364 // </example>
1366 // <example id="gapplication-example-actions"><title>A GApplication with actions</title>
1367 // <programlisting>
1368 // <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-actions.c">
1369 // <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
1370 // </xi:include>
1371 // </programlisting>
1372 // </example>
1374 // <example id="gapplication-example-menu"><title>A GApplication with menus</title>
1375 // <programlisting>
1376 // <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-menu.c">
1377 // <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
1378 // </xi:include>
1379 // </programlisting>
1380 // </example>
1381 struct Application /* : GObject.Object */ /* Version 2.28 */ {
1382 mixin ActionGroup.__interface__;
1383 mixin ActionMap.__interface__;
1384 alias parent_instance this;
1385 alias parent_instance super_;
1386 alias parent_instance object;
1387 GObject2.Object parent_instance;
1388 private ApplicationPrivate* priv;
1391 // Creates a new #GApplication instance.
1393 // This function calls g_type_init() for you.
1395 // The application id must be valid. See g_application_id_is_valid().
1396 // RETURNS: a new #GApplication instance
1397 // <application_id>: the application id
1398 // <flags>: the application flags
1399 static Application* /*new*/ new_(AT0)(AT0 /*char*/ application_id, ApplicationFlags flags) nothrow {
1400 return g_application_new(toCString!(char*)(application_id), flags);
1402 static auto opCall(AT0)(AT0 /*char*/ application_id, ApplicationFlags flags) {
1403 return g_application_new(toCString!(char*)(application_id), flags);
1406 // VERSION: 2.32
1407 // Returns the default #GApplication instance for this process.
1409 // Normally there is only one #GApplication per process and it becomes
1410 // the default when it is created. You can exercise more control over
1411 // this by using g_application_set_default().
1413 // If there is no default application then %NULL is returned.
1414 // RETURNS: the default application for this process, or %NULL
1415 static Application* get_default()() nothrow {
1416 return g_application_get_default();
1419 // Checks if @application_id is a valid application identifier.
1421 // A valid ID is required for calls to g_application_new() and
1422 // g_application_set_application_id().
1424 // For convenience, the restrictions on application identifiers are
1425 // reproduced here:
1426 // <itemizedlist>
1427 // <listitem>Application identifiers must contain only the ASCII characters "[A-Z][a-z][0-9]_-." and must not begin with a digit.</listitem>
1428 // <listitem>Application identifiers must contain at least one '.' (period) character (and thus at least three elements).</listitem>
1429 // <listitem>Application identifiers must not begin or end with a '.' (period) character.</listitem>
1430 // <listitem>Application identifiers must not contain consecutive '.' (period) characters.</listitem>
1431 // <listitem>Application identifiers must not exceed 255 characters.</listitem>
1432 // </itemizedlist>
1433 // RETURNS: %TRUE if @application_id is valid
1434 // <application_id>: a potential application identifier
1435 static int id_is_valid(AT0)(AT0 /*char*/ application_id) nothrow {
1436 return g_application_id_is_valid(toCString!(char*)(application_id));
1439 // VERSION: 2.28
1440 // Activates the application.
1442 // In essence, this results in the #GApplication::activate signal being
1443 // emitted in the primary instance.
1445 // The application must be registered before calling this function.
1446 void activate()() nothrow {
1447 g_application_activate(&this);
1450 // VERSION: 2.28
1451 // Gets the unique identifier for @application.
1452 // RETURNS: the identifier for @application, owned by @application
1453 char* get_application_id()() nothrow {
1454 return g_application_get_application_id(&this);
1457 // VERSION: 2.28
1458 // Gets the flags for @application.
1460 // See #GApplicationFlags.
1461 // RETURNS: the flags for @application
1462 ApplicationFlags get_flags()() nothrow {
1463 return g_application_get_flags(&this);
1466 // VERSION: 2.28
1467 // Gets the current inactivity timeout for the application.
1469 // This is the amount of time (in milliseconds) after the last call to
1470 // g_application_release() before the application stops running.
1471 // RETURNS: the timeout, in milliseconds
1472 uint get_inactivity_timeout()() nothrow {
1473 return g_application_get_inactivity_timeout(&this);
1476 // VERSION: 2.28
1477 // Checks if @application is registered.
1479 // An application is registered if g_application_register() has been
1480 // successfully called.
1481 // RETURNS: %TRUE if @application is registered
1482 int get_is_registered()() nothrow {
1483 return g_application_get_is_registered(&this);
1486 // VERSION: 2.28
1487 // Checks if @application is remote.
1489 // If @application is remote then it means that another instance of
1490 // application already exists (the 'primary' instance). Calls to
1491 // perform actions on @application will result in the actions being
1492 // performed by the primary instance.
1494 // The value of this property cannot be accessed before
1495 // g_application_register() has been called. See
1496 // g_application_get_is_registered().
1497 // RETURNS: %TRUE if @application is remote
1498 int get_is_remote()() nothrow {
1499 return g_application_get_is_remote(&this);
1502 // Increases the use count of @application.
1504 // Use this function to indicate that the application has a reason to
1505 // continue to run. For example, g_application_hold() is called by GTK+
1506 // when a toplevel window is on the screen.
1508 // To cancel the hold, call g_application_release().
1509 void hold()() nothrow {
1510 g_application_hold(&this);
1513 // VERSION: 2.28
1514 // Opens the given files.
1516 // In essence, this results in the #GApplication::open signal being emitted
1517 // in the primary instance.
1519 // @n_files must be greater than zero.
1521 // @hint is simply passed through to the ::open signal. It is
1522 // intended to be used by applications that have multiple modes for
1523 // opening files (eg: "view" vs "edit", etc). Unless you have a need
1524 // for this functionality, you should use "".
1526 // The application must be registered before calling this function
1527 // and it must have the %G_APPLICATION_HANDLES_OPEN flag set.
1528 // <files>: an array of #GFiles to open
1529 // <n_files>: the length of the @files array
1530 // <hint>: a hint (or ""), but never %NULL
1531 void open(AT0, AT1)(AT0 /*File**/ files, int n_files, AT1 /*char*/ hint) nothrow {
1532 g_application_open(&this, UpCast!(File**)(files), n_files, toCString!(char*)(hint));
1535 // VERSION: 2.32
1536 // Immediately quits the application.
1538 // Upon return to the mainloop, g_application_run() will return,
1539 // calling only the 'shutdown' function before doing so.
1541 // The hold count is ignored.
1543 // The result of calling g_application_run() again after it returns is
1544 // unspecified.
1545 void quit()() nothrow {
1546 g_application_quit(&this);
1549 // VERSION: 2.28
1550 // Attempts registration of the application.
1552 // This is the point at which the application discovers if it is the
1553 // primary instance or merely acting as a remote for an already-existing
1554 // primary instance. This is implemented by attempting to acquire the
1555 // application identifier as a unique bus name on the session bus using
1556 // GDBus.
1558 // Due to the internal architecture of GDBus, method calls can be
1559 // dispatched at any time (even if a main loop is not running). For
1560 // this reason, you must ensure that any object paths that you wish to
1561 // register are registered before calling this function.
1563 // If the application has already been registered then %TRUE is
1564 // returned with no work performed.
1566 // The #GApplication::startup signal is emitted if registration succeeds
1567 // and @application is the primary instance.
1569 // In the event of an error (such as @cancellable being cancelled, or a
1570 // failure to connect to the session bus), %FALSE is returned and @error
1571 // is set appropriately.
1573 // Note: the return value of this function is not an indicator that this
1574 // instance is or is not the primary instance of the application. See
1575 // g_application_get_is_remote() for that.
1576 // RETURNS: %TRUE if registration succeeded
1577 // <cancellable>: a #GCancellable, or %NULL
1578 int register(AT0, AT1)(AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
1579 return g_application_register(&this, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
1582 // Decrease the use count of @application.
1584 // When the use count reaches zero, the application will stop running.
1586 // Never call this function except to cancel the effect of a previous
1587 // call to g_application_hold().
1588 void release()() nothrow {
1589 g_application_release(&this);
1592 // VERSION: 2.28
1593 // Runs the application.
1595 // This function is intended to be run from main() and its return value
1596 // is intended to be returned by main(). Although you are expected to pass
1597 // the @argc, @argv parameters from main() to this function, it is possible
1598 // to pass %NULL if @argv is not available or commandline handling is not
1599 // required.
1601 // First, the local_command_line() virtual function is invoked.
1602 // This function always runs on the local instance. It gets passed a pointer
1603 // to a %NULL-terminated copy of @argv and is expected to remove the arguments
1604 // that it handled (shifting up remaining arguments). See
1605 // <xref linkend="gapplication-example-cmdline2"/> for an example of
1606 // parsing @argv manually. Alternatively, you may use the #GOptionContext API,
1607 // after setting <literal>argc = g_strv_length (argv);</literal>.
1609 // The last argument to local_command_line() is a pointer to the @status
1610 // variable which can used to set the exit status that is returned from
1611 // g_application_run().
1613 // If local_command_line() returns %TRUE, the command line is expected
1614 // to be completely handled, including possibly registering as the primary
1615 // instance, calling g_application_activate() or g_application_open(), etc.
1617 // If local_command_line() returns %FALSE then the application is registered
1618 // and the #GApplication::command-line signal is emitted in the primary
1619 // instance (which may or may not be this instance). The signal handler
1620 // gets passed a #GApplicationCommandLine object that (among other things)
1621 // contains the remaining commandline arguments that have not been handled
1622 // by local_command_line().
1624 // If the application has the %G_APPLICATION_HANDLES_COMMAND_LINE
1625 // flag set then the default implementation of local_command_line()
1626 // always returns %FALSE immediately, resulting in the commandline
1627 // always being handled in the primary instance.
1629 // Otherwise, the default implementation of local_command_line() tries
1630 // to do a couple of things that are probably reasonable for most
1631 // applications. First, g_application_register() is called to attempt
1632 // to register the application. If that works, then the command line
1633 // arguments are inspected. If no commandline arguments are given, then
1634 // g_application_activate() is called. If commandline arguments are
1635 // given and the %G_APPLICATION_HANDLES_OPEN flag is set then they
1636 // are assumed to be filenames and g_application_open() is called.
1638 // If you need to handle commandline arguments that are not filenames,
1639 // and you don't mind commandline handling to happen in the primary
1640 // instance, you should set %G_APPLICATION_HANDLES_COMMAND_LINE and
1641 // process the commandline arguments in your #GApplication::command-line
1642 // signal handler, either manually or using the #GOptionContext API.
1644 // If you are interested in doing more complicated local handling of the
1645 // commandline then you should implement your own #GApplication subclass
1646 // and override local_command_line(). In this case, you most likely want
1647 // to return %TRUE from your local_command_line() implementation to
1648 // suppress the default handling. See
1649 // <xref linkend="gapplication-example-cmdline2"/> for an example.
1651 // If, after the above is done, the use count of the application is zero
1652 // then the exit status is returned immediately. If the use count is
1653 // non-zero then the default main context is iterated until the use count
1654 // falls to zero, at which point 0 is returned.
1656 // If the %G_APPLICATION_IS_SERVICE flag is set, then the exiting at
1657 // use count of zero is delayed for a while (ie: the instance stays
1658 // around to provide its <emphasis>service</emphasis> to others).
1659 // RETURNS: the exit status
1660 // <argc>: the argc from main() (or 0 if @argv is %NULL)
1661 // <argv>: the argv from main(), or %NULL
1662 int run(AT0)(int argc, AT0 /*char**/ argv=null) nothrow {
1663 return g_application_run(&this, argc, toCString!(char**)(argv));
1666 // VERSION: 2.28
1667 // This used to be how actions were associated with a #GApplication.
1668 // Now there is #GActionMap for that.
1671 // Deprecated:2.32:Use the #GActionMap interface instead. Never ever
1672 // mix use of this API with use of #GActionMap on the same @application
1673 // or things will go very badly wrong. This function is known to
1674 // introduce buggy behaviour (ie: signals not emitted on changes to the
1675 // action group), so you should really use #GActionMap instead.
1676 // <action_group>: a #GActionGroup, or %NULL
1677 void set_action_group(AT0)(AT0 /*ActionGroup*/ action_group=null) nothrow {
1678 g_application_set_action_group(&this, UpCast!(ActionGroup*)(action_group));
1681 // VERSION: 2.28
1682 // Sets the unique identifier for @application.
1684 // The application id can only be modified if @application has not yet
1685 // been registered.
1687 // The application id must be valid. See g_application_id_is_valid().
1688 // <application_id>: the identifier for @application
1689 void set_application_id(AT0)(AT0 /*char*/ application_id) nothrow {
1690 g_application_set_application_id(&this, toCString!(char*)(application_id));
1693 // VERSION: 2.32
1694 // Sets or unsets the default application for the process, as returned
1695 // by g_application_get_default().
1697 // This function does not take its own reference on @application. If
1698 // @application is destroyed then the default application will revert
1699 // back to %NULL.
1700 void set_default()() nothrow {
1701 g_application_set_default(&this);
1704 // VERSION: 2.28
1705 // Sets the flags for @application.
1707 // The flags can only be modified if @application has not yet been
1708 // registered.
1710 // See #GApplicationFlags.
1711 // <flags>: the flags for @application
1712 void set_flags()(ApplicationFlags flags) nothrow {
1713 g_application_set_flags(&this, flags);
1716 // VERSION: 2.28
1717 // Sets the current inactivity timeout for the application.
1719 // This is the amount of time (in milliseconds) after the last call to
1720 // g_application_release() before the application stops running.
1722 // This call has no side effects of its own. The value set here is only
1723 // used for next time g_application_release() drops the use count to
1724 // zero. Any timeouts currently in progress are not impacted.
1725 // <inactivity_timeout>: the timeout, in milliseconds
1726 void set_inactivity_timeout()(uint inactivity_timeout) nothrow {
1727 g_application_set_inactivity_timeout(&this, inactivity_timeout);
1730 // The ::activate signal is emitted on the primary instance when an
1731 // activation occurs. See g_application_activate().
1732 extern (C) alias static void function (Application* this_, void* user_data=null) nothrow signal_activate;
1734 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
1735 return super_.signal_connect!name(cb, data, cf);
1738 ulong signal_connect(string name:"activate", CB/*:signal_activate*/)
1739 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
1740 if (is(typeof(cb)==signal_activate)||_ttmm!(CB, signal_activate)()) {
1741 return signal_connect_data!()(&this, cast(char*)"activate",
1742 cast(GObject2.Callback)cb, data, null, cf);
1745 // The ::command-line signal is emitted on the primary instance when
1746 // a commandline is not handled locally. See g_application_run() and
1747 // the #GApplicationCommandLine documentation for more information.
1749 // process. See g_application_command_line_set_exit_status().
1750 // RETURNS: An integer that is set as the exit status for the calling
1751 // <command_line>: a #GApplicationCommandLine representing the passed commandline
1752 extern (C) alias static int function (Application* this_, ApplicationCommandLine* command_line, void* user_data=null) nothrow signal_command_line;
1753 ulong signal_connect(string name:"command-line", CB/*:signal_command_line*/)
1754 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
1755 if (is(typeof(cb)==signal_command_line)||_ttmm!(CB, signal_command_line)()) {
1756 return signal_connect_data!()(&this, cast(char*)"command-line",
1757 cast(GObject2.Callback)cb, data, null, cf);
1760 // The ::open signal is emitted on the primary instance when there are
1761 // files to open. See g_application_open() for more information.
1762 // <files>: an array of #GFiles
1763 // <n_files>: the length of @files
1764 // <hint>: a hint provided by the calling instance
1765 extern (C) alias static void function (Application* this_, File* files, int n_files, char* hint, void* user_data=null) nothrow signal_open;
1766 ulong signal_connect(string name:"open", CB/*:signal_open*/)
1767 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
1768 if (is(typeof(cb)==signal_open)||_ttmm!(CB, signal_open)()) {
1769 return signal_connect_data!()(&this, cast(char*)"open",
1770 cast(GObject2.Callback)cb, data, null, cf);
1773 // The ::shutdown signal is emitted only on the registered primary instance
1774 // immediately after the main loop terminates.
1775 extern (C) alias static void function (Application* this_, void* user_data=null) nothrow signal_shutdown;
1776 ulong signal_connect(string name:"shutdown", CB/*:signal_shutdown*/)
1777 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
1778 if (is(typeof(cb)==signal_shutdown)||_ttmm!(CB, signal_shutdown)()) {
1779 return signal_connect_data!()(&this, cast(char*)"shutdown",
1780 cast(GObject2.Callback)cb, data, null, cf);
1783 // The ::startup signal is emitted on the primary instance immediately
1784 // after registration. See g_application_register().
1785 extern (C) alias static void function (Application* this_, void* user_data=null) nothrow signal_startup;
1786 ulong signal_connect(string name:"startup", CB/*:signal_startup*/)
1787 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
1788 if (is(typeof(cb)==signal_startup)||_ttmm!(CB, signal_startup)()) {
1789 return signal_connect_data!()(&this, cast(char*)"startup",
1790 cast(GObject2.Callback)cb, data, null, cf);
1794 // Virtual function table for #GApplication.
1795 struct ApplicationClass /* Version 2.28 */ {
1796 private GObject2.ObjectClass parent_class;
1797 extern (C) void function (Application* application) nothrow startup;
1798 extern (C) void function (Application* application) nothrow activate;
1800 // <files>: an array of #GFiles to open
1801 // <n_files>: the length of the @files array
1802 // <hint>: a hint (or ""), but never %NULL
1803 extern (C) void function (Application* application, File** files, int n_files, char* hint) nothrow open;
1804 extern (C) int function (Application* application, ApplicationCommandLine* command_line) nothrow command_line;
1805 extern (C) int function (Application* application, char*** arguments, int* exit_status) nothrow local_command_line;
1806 extern (C) void function (Application* application, GLib2.Variant* platform_data) nothrow before_emit;
1807 extern (C) void function (Application* application, GLib2.Variant* platform_data) nothrow after_emit;
1808 extern (C) void function (Application* application, GLib2.VariantBuilder* builder) nothrow add_platform_data;
1809 extern (C) void function (Application* application) nothrow quit_mainloop;
1810 extern (C) void function (Application* application) nothrow run_mainloop;
1811 extern (C) void function (Application* application) nothrow shutdown;
1812 private void*[11] padding;
1816 // #GApplicationCommandLine represents a command-line invocation of
1817 // an application. It is created by #GApplication and emitted
1818 // in the #GApplication::command-line signal and virtual function.
1820 // The class contains the list of arguments that the program was invoked
1821 // with. It is also possible to query if the commandline invocation was
1822 // local (ie: the current process is running in direct response to the
1823 // invocation) or remote (ie: some other process forwarded the
1824 // commandline to this process).
1826 // The GApplicationCommandLine object can provide the @argc and @argv
1827 // parameters for use with the #GOptionContext command-line parsing API,
1828 // with the g_application_command_line_get_arguments() function. See
1829 // <xref linkend="gapplication-example-cmdline3"/> for an example.
1831 // The exit status of the originally-invoked process may be set and
1832 // messages can be printed to stdout or stderr of that process. The
1833 // lifecycle of the originally-invoked process is tied to the lifecycle
1834 // of this object (ie: the process exits when the last reference is
1835 // dropped).
1837 // The main use for #GApplicationCommandLine (and the
1838 // #GApplication::command-line signal) is 'Emacs server' like use cases:
1839 // You can set the <envar>EDITOR</envar> environment variable to have
1840 // e.g. git use your favourite editor to edit commit messages, and if you
1841 // already have an instance of the editor running, the editing will happen
1842 // in the running instance, instead of opening a new one. An important
1843 // aspect of this use case is that the process that gets started by git
1844 // does not return until the editing is done.
1846 // <example id="gapplication-example-cmdline"><title>Handling commandline arguments with GApplication</title>
1847 // <para>
1848 // A simple example where the commandline is completely handled
1849 // in the #GApplication::command-line handler. The launching instance exits
1850 // once the signal handler in the primary instance has returned, and the
1851 // return value of the signal handler becomes the exit status of the launching
1852 // instance.
1853 // </para>
1854 // <programlisting>
1855 // <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-cmdline.c">
1856 // <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
1857 // </xi:include>
1858 // </programlisting>
1859 // </example>
1861 // <example id="gapplication-example-cmdline2"><title>Split commandline handling</title>
1862 // <para>
1863 // An example of split commandline handling. Options that start with
1864 // <literal>--local-</literal> are handled locally, all other options are
1865 // passed to the #GApplication::command-line handler which runs in the primary
1866 // instance.
1867 // </para>
1868 // <programlisting>
1869 // <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-cmdline2.c">
1870 // <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
1871 // </xi:include>
1872 // </programlisting>
1873 // </example>
1875 // <example id="gapplication-example-cmdline3"><title>Deferred commandline handling</title>
1876 // <para>
1877 // An example of deferred commandline handling. Here, the commandline is
1878 // not completely handled before the #GApplication::command-line handler
1879 // returns. Instead, we keep a reference to the GApplicationCommandLine
1880 // object and handle it later(in this example, in an idle). Note that it
1881 // is necessary to hold the application until you are done with the
1882 // commandline.
1883 // </para>
1884 // <para>
1885 // This example also shows how to use #GOptionContext for parsing the
1886 // commandline arguments. Note that it is necessary to disable the
1887 // built-in help-handling of #GOptionContext, since it calls exit()
1888 // after printing help, which is not what you want to happen in
1889 // the primary instance.
1890 // </para>
1891 // <programlisting>
1892 // <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-cmdline3.c">
1893 // <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
1894 // </xi:include>
1895 // </programlisting>
1896 // </example>
1897 struct ApplicationCommandLine /* : GObject.Object */ {
1898 alias parent_instance this;
1899 alias parent_instance super_;
1900 alias parent_instance object;
1901 GObject2.Object parent_instance;
1902 private ApplicationCommandLinePrivate* priv;
1905 // VERSION: 2.28
1906 // Gets the list of arguments that was passed on the command line.
1908 // The strings in the array may contain non-utf8 data.
1910 // The return value is %NULL-terminated and should be freed using
1911 // g_strfreev().
1913 // containing the arguments (the argv)
1914 // RETURNS: the string array
1915 // <argc>: the length of the arguments array, or %NULL
1916 char** /*new*/ get_arguments()(/*out*/ int* argc) nothrow {
1917 return g_application_command_line_get_arguments(&this, argc);
1920 // VERSION: 2.28
1921 // Gets the working directory of the command line invocation.
1922 // The string may contain non-utf8 data.
1924 // It is possible that the remote application did not send a working
1925 // directory, so this may be %NULL.
1927 // The return value should not be modified or freed and is valid for as
1928 // long as @cmdline exists.
1929 // RETURNS: the current directory, or %NULL
1930 char* get_cwd()() nothrow {
1931 return g_application_command_line_get_cwd(&this);
1934 // VERSION: 2.28
1935 // Gets the contents of the 'environ' variable of the command line
1936 // invocation, as would be returned by g_get_environ(), ie as a
1937 // %NULL-terminated list of strings in the form 'NAME=VALUE'.
1938 // The strings may contain non-utf8 data.
1940 // The remote application usually does not send an environment. Use
1941 // %G_APPLICATION_SEND_ENVIRONMENT to affect that. Even with this flag
1942 // set it is possible that the environment is still not available (due
1943 // to invocation messages from other applications).
1945 // The return value should not be modified or freed and is valid for as
1946 // long as @cmdline exists.
1948 // See g_application_command_line_getenv() if you are only interested
1949 // in the value of a single environment variable.
1951 // strings, or %NULL if they were not sent
1952 // RETURNS: the environment
1953 char** get_environ()() nothrow {
1954 return g_application_command_line_get_environ(&this);
1957 // VERSION: 2.28
1958 // Gets the exit status of @cmdline. See
1959 // g_application_command_line_set_exit_status() for more information.
1960 // RETURNS: the exit status
1961 int get_exit_status()() nothrow {
1962 return g_application_command_line_get_exit_status(&this);
1965 // VERSION: 2.28
1966 // Determines if @cmdline represents a remote invocation.
1967 // RETURNS: %TRUE if the invocation was remote
1968 int get_is_remote()() nothrow {
1969 return g_application_command_line_get_is_remote(&this);
1972 // VERSION: 2.28
1973 // Gets the platform data associated with the invocation of @cmdline.
1975 // This is a #GVariant dictionary containing information about the
1976 // context in which the invocation occurred. It typically contains
1977 // information like the current working directory and the startup
1978 // notification ID.
1980 // For local invocation, it will be %NULL.
1981 // RETURNS: the platform data, or %NULL
1982 GLib2.Variant* /*new*/ get_platform_data()() nothrow {
1983 return g_application_command_line_get_platform_data(&this);
1986 // VERSION: 2.28
1987 // Gets the value of a particular environment variable of the command
1988 // line invocation, as would be returned by g_getenv(). The strings may
1989 // contain non-utf8 data.
1991 // The remote application usually does not send an environment. Use
1992 // %G_APPLICATION_SEND_ENVIRONMENT to affect that. Even with this flag
1993 // set it is possible that the environment is still not available (due
1994 // to invocation messages from other applications).
1996 // The return value should not be modified or freed and is valid for as
1997 // long as @cmdline exists.
1998 // RETURNS: the value of the variable, or %NULL if unset or unsent
1999 // <name>: the environment variable to get
2000 char* getenv(AT0)(AT0 /*char*/ name) nothrow {
2001 return g_application_command_line_getenv(&this, toCString!(char*)(name));
2004 // Unintrospectable method: print() / g_application_command_line_print()
2005 // VERSION: 2.28
2006 // Formats a message and prints it using the stdout print handler in the
2007 // invoking process.
2009 // If @cmdline is a local invocation then this is exactly equivalent to
2010 // g_print(). If @cmdline is remote then this is equivalent to calling
2011 // g_print() in the invoking process.
2012 // <format>: a printf-style format string
2013 /+ Not available -- variadic methods unsupported - use the C function directly.
2014 alias g_application_command_line_print print; // Variadic
2017 // Unintrospectable method: printerr() / g_application_command_line_printerr()
2018 // VERSION: 2.28
2019 // Formats a message and prints it using the stderr print handler in the
2020 // invoking process.
2022 // If @cmdline is a local invocation then this is exactly equivalent to
2023 // g_printerr(). If @cmdline is remote then this is equivalent to
2024 // calling g_printerr() in the invoking process.
2025 // <format>: a printf-style format string
2026 /+ Not available -- variadic methods unsupported - use the C function directly.
2027 alias g_application_command_line_printerr printerr; // Variadic
2030 // VERSION: 2.28
2031 // Sets the exit status that will be used when the invoking process
2032 // exits.
2034 // The return value of the #GApplication::command-line signal is
2035 // passed to this function when the handler returns. This is the usual
2036 // way of setting the exit status.
2038 // In the event that you want the remote invocation to continue running
2039 // and want to decide on the exit status in the future, you can use this
2040 // call. For the case of a remote invocation, the remote process will
2041 // typically exit when the last reference is dropped on @cmdline. The
2042 // exit status of the remote process will be equal to the last value
2043 // that was set with this function.
2045 // In the case that the commandline invocation is local, the situation
2046 // is slightly more complicated. If the commandline invocation results
2047 // in the mainloop running (ie: because the use-count of the application
2048 // increased to a non-zero value) then the application is considered to
2049 // have been 'successful' in a certain sense, and the exit status is
2050 // always zero. If the application use count is zero, though, the exit
2051 // status of the local #GApplicationCommandLine is used.
2052 // <exit_status>: the exit status
2053 void set_exit_status()(int exit_status) nothrow {
2054 g_application_command_line_set_exit_status(&this, exit_status);
2059 // The <structname>GApplicationCommandLineClass</structname> structure
2060 // contains private data only
2061 struct ApplicationCommandLineClass /* Version 2.28 */ {
2062 private GObject2.ObjectClass parent_class;
2063 extern (C) void function (ApplicationCommandLine* cmdline, char* message) nothrow print_literal;
2064 extern (C) void function (ApplicationCommandLine* cmdline, char* message) nothrow printerr_literal;
2065 private void*[12] padding;
2068 struct ApplicationCommandLinePrivate {
2071 // Flags used to define the behaviour of a #GApplication.
2072 enum ApplicationFlags /* Version 2.28 */ {
2073 FLAGS_NONE = 0,
2074 IS_SERVICE = 1,
2075 IS_LAUNCHER = 2,
2076 HANDLES_OPEN = 4,
2077 HANDLES_COMMAND_LINE = 8,
2078 SEND_ENVIRONMENT = 16,
2079 NON_UNIQUE = 32
2081 struct ApplicationPrivate {
2085 // #GAskPasswordFlags are used to request specific information from the
2086 // user, or to notify the user of their choices in an authentication
2087 // situation.
2088 enum AskPasswordFlags {
2089 NEED_PASSWORD = 1,
2090 NEED_USERNAME = 2,
2091 NEED_DOMAIN = 4,
2092 SAVING_SUPPORTED = 8,
2093 ANONYMOUS_SUPPORTED = 16
2096 // This is the asynchronous version of #GInitable; it behaves the same
2097 // in all ways except that initialization is asynchronous. For more details
2098 // see the descriptions on #GInitable.
2100 // A class may implement both the #GInitable and #GAsyncInitable interfaces.
2102 // Users of objects implementing this are not intended to use the interface
2103 // method directly; instead it will be used automatically in various ways.
2104 // For C applications you generally just call g_async_initable_new_async()
2105 // directly, or indirectly via a foo_thing_new_async() wrapper. This will call
2106 // g_async_initable_init_async() under the cover, calling back with %NULL and
2107 // a set %GError on failure.
2109 // A typical implementation might look something like this:
2111 // |[
2112 // enum {
2113 // NOT_INITIALIZED,
2114 // INITIALIZING,
2115 // INITIALIZED
2116 // };
2118 // static void
2119 // _foo_ready_cb (Foo *self)
2120 // {
2121 // GList *l;
2123 // self->priv->state = INITIALIZED;
2125 // for (l = self->priv->init_results; l != NULL; l = l->next)
2126 // {
2127 // GSimpleAsyncResult *simple = l->data;
2129 // if (!self->priv->success)
2130 // g_simple_async_result_set_error (simple, ...);
2132 // g_simple_async_result_complete (simple);
2133 // g_object_unref (simple);
2134 // }
2136 // g_list_free (self->priv->init_results);
2137 // self->priv->init_results = NULL;
2138 // }
2140 // static void
2141 // foo_init_async (GAsyncInitable *initable,
2142 // int io_priority,
2143 // GCancellable *cancellable,
2144 // GAsyncReadyCallback callback,
2145 // gpointer user_data)
2146 // {
2147 // Foo *self = FOO (initable);
2148 // GSimpleAsyncResult *simple;
2150 // simple = g_simple_async_result_new (G_OBJECT (initable)
2151 // callback,
2152 // user_data,
2153 // foo_init_async);
2155 // switch (self->priv->state)
2156 // {
2157 // case NOT_INITIALIZED:
2158 // _foo_get_ready (self);
2159 // self->priv->init_results = g_list_append (self->priv->init_results,
2160 // simple);
2161 // self->priv->state = INITIALIZING;
2162 // break;
2163 // case INITIALIZING:
2164 // self->priv->init_results = g_list_append (self->priv->init_results,
2165 // simple);
2166 // break;
2167 // case INITIALIZED:
2168 // if (!self->priv->success)
2169 // g_simple_async_result_set_error (simple, ...);
2171 // g_simple_async_result_complete_in_idle (simple);
2172 // g_object_unref (simple);
2173 // break;
2174 // }
2175 // }
2177 // static gboolean
2178 // foo_init_finish (GAsyncInitable *initable,
2179 // GAsyncResult *result,
2180 // GError **error)
2181 // {
2182 // g_return_val_if_fail (g_simple_async_result_is_valid (result,
2183 // G_OBJECT (initable), foo_init_async), FALSE);
2185 // if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result),
2186 // error))
2187 // return FALSE;
2189 // return TRUE;
2190 // }
2192 // static void
2193 // foo_async_initable_iface_init (gpointer g_iface,
2194 // gpointer data)
2195 // {
2196 // GAsyncInitableIface *iface = g_iface;
2198 // iface->init_async = foo_init_async;
2199 // iface->init_finish = foo_init_finish;
2200 // }
2201 // ]|
2202 struct AsyncInitable /* Interface */ /* Version 2.22 */ {
2203 mixin template __interface__() {
2204 // Unintrospectable function: new_async() / g_async_initable_new_async()
2205 // VERSION: 2.22
2206 // Helper function for constructing #GAsyncInitable object. This is
2207 // similar to g_object_new() but also initializes the object asynchronously.
2209 // When the initialization is finished, @callback will be called. You can
2210 // then call g_async_initable_new_finish() to get the new object and check
2211 // for any errors.
2212 // <object_type>: a #GType supporting #GAsyncInitable.
2213 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the operation.
2214 // <cancellable>: optional #GCancellable object, %NULL to ignore.
2215 // <callback>: a #GAsyncReadyCallback to call when the initialization is finished
2216 // <user_data>: the data to pass to callback function
2217 // <first_property_name>: the name of the first property, or %NULL if no properties
2218 alias g_async_initable_new_async new_async; // Variadic
2220 // Unintrospectable function: new_valist_async() / g_async_initable_new_valist_async()
2221 // VERSION: 2.22
2222 // Helper function for constructing #GAsyncInitable object. This is
2223 // similar to g_object_new_valist() but also initializes the object
2224 // asynchronously.
2226 // When the initialization is finished, @callback will be called. You can
2227 // then call g_async_initable_new_finish() to get the new object and check
2228 // for any errors.
2229 // <object_type>: a #GType supporting #GAsyncInitable.
2230 // <first_property_name>: the name of the first property, followed by the value, and other property value pairs, and ended by %NULL.
2231 // <var_args>: The var args list generated from @first_property_name.
2232 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the operation.
2233 // <cancellable>: optional #GCancellable object, %NULL to ignore.
2234 // <callback>: a #GAsyncReadyCallback to call when the initialization is finished
2235 // <user_data>: the data to pass to callback function
2236 static void new_valist_async(AT0, AT1, AT2)(Type object_type, AT0 /*char*/ first_property_name, va_list var_args, int io_priority, AT1 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT2 /*void*/ user_data) nothrow {
2237 g_async_initable_new_valist_async(object_type, toCString!(char*)(first_property_name), var_args, io_priority, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
2240 // VERSION: 2.22
2241 // Helper function for constructing #GAsyncInitable object. This is
2242 // similar to g_object_newv() but also initializes the object asynchronously.
2244 // When the initialization is finished, @callback will be called. You can
2245 // then call g_async_initable_new_finish() to get the new object and check
2246 // for any errors.
2247 // <object_type>: a #GType supporting #GAsyncInitable.
2248 // <n_parameters>: the number of parameters in @parameters
2249 // <parameters>: the parameters to use to construct the object
2250 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the operation.
2251 // <cancellable>: optional #GCancellable object, %NULL to ignore.
2252 // <callback>: a #GAsyncReadyCallback to call when the initialization is finished
2253 // <user_data>: the data to pass to callback function
2254 static void newv_async(AT0, AT1, AT2)(Type object_type, uint n_parameters, AT0 /*GObject2.Parameter*/ parameters, int io_priority, AT1 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT2 /*void*/ user_data) nothrow {
2255 g_async_initable_newv_async(object_type, n_parameters, UpCast!(GObject2.Parameter*)(parameters), io_priority, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
2258 // VERSION: 2.22
2259 // Starts asynchronous initialization of the object implementing the
2260 // interface. This must be done before any real use of the object after
2261 // initial construction. If the object also implements #GInitable you can
2262 // optionally call g_initable_init() instead.
2264 // When the initialization is finished, @callback will be called. You can
2265 // then call g_async_initable_init_finish() to get the result of the
2266 // initialization.
2268 // Implementations may also support cancellation. If @cancellable is not
2269 // %NULL, then initialization can be cancelled by triggering the cancellable
2270 // object from another thread. If the operation was cancelled, the error
2271 // %G_IO_ERROR_CANCELLED will be returned. If @cancellable is not %NULL, and
2272 // the object doesn't support cancellable initialization, the error
2273 // %G_IO_ERROR_NOT_SUPPORTED will be returned.
2275 // As with #GInitable, if the object is not initialized, or initialization
2276 // returns with an error, then all operations on the object except
2277 // g_object_ref() and g_object_unref() are considered to be invalid, and
2278 // have undefined behaviour. They will often fail with g_critical() or
2279 // g_warning(), but this must not be relied on.
2281 // Implementations of this method must be idempotent: i.e. multiple calls
2282 // to this function with the same argument should return the same results.
2283 // Only the first call initializes the object; further calls return the result
2284 // of the first call. This is so that it's safe to implement the singleton
2285 // pattern in the GObject constructor function.
2287 // For classes that also support the #GInitable interface, the default
2288 // implementation of this method will run the g_initable_init() function
2289 // in a thread, so if you want to support asynchronous initialization via
2290 // threads, just implement the #GAsyncInitable interface without overriding
2291 // any interface methods.
2292 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the operation.
2293 // <cancellable>: optional #GCancellable object, %NULL to ignore.
2294 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
2295 // <user_data>: the data to pass to callback function
2296 void init_async(AT0, AT1)(int io_priority, AT0 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT1 /*void*/ user_data) nothrow {
2297 g_async_initable_init_async(cast(AsyncInitable*)&this, io_priority, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
2300 // VERSION: 2.22
2301 // Finishes asynchronous initialization and returns the result.
2302 // See g_async_initable_init_async().
2304 // will return %FALSE and set @error appropriately if present.
2305 // RETURNS: %TRUE if successful. If an error has occurred, this function
2306 // <res>: a #GAsyncResult.
2307 int init_finish(AT0, AT1)(AT0 /*AsyncResult*/ res, AT1 /*GLib2.Error**/ error=null) nothrow {
2308 return g_async_initable_init_finish(cast(AsyncInitable*)&this, UpCast!(AsyncResult*)(res), UpCast!(GLib2.Error**)(error));
2311 // VERSION: 2.22
2312 // Finishes the async construction for the various g_async_initable_new
2313 // calls, returning the created object or %NULL on error.
2315 // Free with g_object_unref().
2316 // RETURNS: a newly created #GObject, or %NULL on error.
2317 // <res>: the #GAsyncResult from the callback
2318 GObject2.Object* /*new*/ new_finish(AT0, AT1)(AT0 /*AsyncResult*/ res, AT1 /*GLib2.Error**/ error=null) nothrow {
2319 return g_async_initable_new_finish(cast(AsyncInitable*)&this, UpCast!(AsyncResult*)(res), UpCast!(GLib2.Error**)(error));
2322 mixin __interface__;
2326 // Provides an interface for asynchronous initializing object such that
2327 // initialization may fail.
2328 struct AsyncInitableIface /* Version 2.22 */ {
2329 GObject2.TypeInterface g_iface;
2331 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the operation.
2332 // <cancellable>: optional #GCancellable object, %NULL to ignore.
2333 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
2334 // <user_data>: the data to pass to callback function
2335 extern (C) void function (AsyncInitable* initable, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow init_async;
2337 // RETURNS: %TRUE if successful. If an error has occurred, this function
2338 // <res>: a #GAsyncResult.
2339 extern (C) int function (AsyncInitable* initable, AsyncResult* res, GLib2.Error** error=null) nothrow init_finish;
2343 // Type definition for a function that will be called back when an asynchronous
2344 // operation within GIO has been completed.
2345 // <source_object>: the object the asynchronous operation was started with.
2346 // <res>: a #GAsyncResult.
2347 // <user_data>: user data passed to the callback.
2348 extern (C) alias void function (GObject2.Object* source_object, AsyncResult* res, void* user_data) nothrow AsyncReadyCallback;
2351 // Provides a base class for implementing asynchronous function results.
2353 // Asynchronous operations are broken up into two separate operations
2354 // which are chained together by a #GAsyncReadyCallback. To begin
2355 // an asynchronous operation, provide a #GAsyncReadyCallback to the
2356 // asynchronous function. This callback will be triggered when the
2357 // operation has completed, and will be passed a #GAsyncResult instance
2358 // filled with the details of the operation's success or failure, the
2359 // object the asynchronous function was started for and any error codes
2360 // returned. The asynchronous callback function is then expected to call
2361 // the corresponding "_finish()" function, passing the object the
2362 // function was called for, the #GAsyncResult instance, and (optionally)
2363 // an @error to grab any error conditions that may have occurred.
2365 // The "_finish()" function for an operation takes the generic result
2366 // (of type #GAsyncResult) and returns the specific result that the
2367 // operation in question yields (e.g. a #GFileEnumerator for a
2368 // "enumerate children" operation). If the result or error status of the
2369 // operation is not needed, there is no need to call the "_finish()"
2370 // function; GIO will take care of cleaning up the result and error
2371 // information after the #GAsyncReadyCallback returns. You can pass
2372 // %NULL for the #GAsyncReadyCallback if you don't need to take any
2373 // action at all after the operation completes. Applications may also
2374 // take a reference to the #GAsyncResult and call "_finish()" later;
2375 // however, the "_finish()" function may be called at most once.
2377 // Example of a typical asynchronous operation flow:
2378 // |[
2379 // void _theoretical_frobnitz_async (Theoretical *t,
2380 // GCancellable *c,
2381 // GAsyncReadyCallback *cb,
2382 // gpointer u);
2384 // gboolean _theoretical_frobnitz_finish (Theoretical *t,
2385 // GAsyncResult *res,
2386 // GError **e);
2388 // static void
2389 // frobnitz_result_func (GObject *source_object,
2390 // GAsyncResult *res,
2391 // gpointer user_data)
2392 // {
2393 // gboolean success = FALSE;
2395 // success = _theoretical_frobnitz_finish (source_object, res, NULL);
2397 // if (success)
2398 // g_printf ("Hurray!\n");
2399 // else
2400 // g_printf ("Uh oh!\n");
2402 // /<!-- -->* ... *<!-- -->/
2404 // }
2406 // int main (int argc, void *argv[])
2407 // {
2408 // /<!-- -->* ... *<!-- -->/
2410 // _theoretical_frobnitz_async (theoretical_data,
2411 // NULL,
2412 // frobnitz_result_func,
2413 // NULL);
2415 // /<!-- -->* ... *<!-- -->/
2416 // }
2417 // ]|
2419 // The callback for an asynchronous operation is called only once, and is
2420 // always called, even in the case of a cancelled operation. On cancellation
2421 // the result is a %G_IO_ERROR_CANCELLED error.
2422 struct AsyncResult /* Interface */ {
2423 mixin template __interface__() {
2424 // Gets the source object from a #GAsyncResult.
2426 // or %NULL if there is none.
2427 // RETURNS: a new reference to the source object for the @res,
2428 GObject2.Object* /*new*/ get_source_object()() nothrow {
2429 return g_async_result_get_source_object(cast(AsyncResult*)&this);
2432 // Gets the user data from a #GAsyncResult.
2433 // RETURNS: the user data for @res.
2434 void* /*new*/ get_user_data()() nothrow {
2435 return g_async_result_get_user_data(cast(AsyncResult*)&this);
2438 mixin __interface__;
2441 // Interface definition for #GAsyncResult.
2442 struct AsyncResultIface {
2443 GObject2.TypeInterface g_iface;
2444 // RETURNS: the user data for @res.
2445 extern (C) void* /*new*/ function (AsyncResult* res) nothrow get_user_data;
2446 // RETURNS: a new reference to the source object for the @res,
2447 extern (C) GObject2.Object* /*new*/ function (AsyncResult* res) nothrow get_source_object;
2451 // Buffered input stream implements #GFilterInputStream and provides
2452 // for buffered reads.
2454 // By default, #GBufferedInputStream's buffer size is set at 4 kilobytes.
2456 // To create a buffered input stream, use g_buffered_input_stream_new(),
2457 // or g_buffered_input_stream_new_sized() to specify the buffer's size at
2458 // construction.
2460 // To get the size of a buffer within a buffered input stream, use
2461 // g_buffered_input_stream_get_buffer_size(). To change the size of a
2462 // buffered input stream's buffer, use
2463 // g_buffered_input_stream_set_buffer_size(). Note that the buffer's size
2464 // cannot be reduced below the size of the data within the buffer.
2465 struct BufferedInputStream /* : FilterInputStream */ {
2466 alias parent_instance this;
2467 alias parent_instance super_;
2468 alias parent_instance filterinputstream;
2469 FilterInputStream parent_instance;
2470 private BufferedInputStreamPrivate* priv;
2473 // Creates a new #GInputStream from the given @base_stream, with
2474 // a buffer set to the default size (4 kilobytes).
2475 // RETURNS: a #GInputStream for the given @base_stream.
2476 // <base_stream>: a #GInputStream
2477 static BufferedInputStream* /*new*/ new_(AT0)(AT0 /*InputStream*/ base_stream) nothrow {
2478 return g_buffered_input_stream_new(UpCast!(InputStream*)(base_stream));
2480 static auto opCall(AT0)(AT0 /*InputStream*/ base_stream) {
2481 return g_buffered_input_stream_new(UpCast!(InputStream*)(base_stream));
2484 // Creates a new #GBufferedInputStream from the given @base_stream,
2485 // with a buffer set to @size.
2486 // RETURNS: a #GInputStream.
2487 // <base_stream>: a #GInputStream
2488 // <size>: a #gsize
2489 static BufferedInputStream* /*new*/ new_sized(AT0)(AT0 /*InputStream*/ base_stream, size_t size) nothrow {
2490 return g_buffered_input_stream_new_sized(UpCast!(InputStream*)(base_stream), size);
2492 static auto opCall(AT0)(AT0 /*InputStream*/ base_stream, size_t size) {
2493 return g_buffered_input_stream_new_sized(UpCast!(InputStream*)(base_stream), size);
2496 // Tries to read @count bytes from the stream into the buffer.
2497 // Will block during this read.
2499 // If @count is zero, returns zero and does nothing. A value of @count
2500 // larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
2502 // On success, the number of bytes read into the buffer is returned.
2503 // It is not an error if this is not the same as the requested size, as it
2504 // can happen e.g. near the end of a file. Zero is returned on end of file
2505 // (or if @count is zero), but never otherwise.
2507 // If @count is -1 then the attempted read size is equal to the number of
2508 // bytes that are required to fill the buffer.
2510 // If @cancellable is not %NULL, then the operation can be cancelled by
2511 // triggering the cancellable object from another thread. If the operation
2512 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
2513 // operation was partially finished when the operation was cancelled the
2514 // partial result will be returned, without an error.
2516 // On error -1 is returned and @error is set accordingly.
2518 // For the asynchronous, non-blocking, version of this function, see
2519 // g_buffered_input_stream_fill_async().
2521 // or -1 on error.
2522 // RETURNS: the number of bytes read into @stream's buffer, up to @count,
2523 // <count>: the number of bytes that will be read from the stream
2524 // <cancellable>: optional #GCancellable object, %NULL to ignore
2525 ssize_t fill(AT0, AT1)(ssize_t count, AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
2526 return g_buffered_input_stream_fill(&this, count, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
2529 // Reads data into @stream's buffer asynchronously, up to @count size.
2530 // @io_priority can be used to prioritize reads. For the synchronous
2531 // version of this function, see g_buffered_input_stream_fill().
2533 // If @count is -1 then the attempted read size is equal to the number
2534 // of bytes that are required to fill the buffer.
2535 // <count>: the number of bytes that will be read from the stream
2536 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request
2537 // <cancellable>: optional #GCancellable object
2538 // <callback>: a #GAsyncReadyCallback
2539 // <user_data>: a #gpointer
2540 void fill_async(AT0, AT1)(ssize_t count, int io_priority, AT0 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT1 /*void*/ user_data) nothrow {
2541 g_buffered_input_stream_fill_async(&this, count, io_priority, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
2544 // Finishes an asynchronous read.
2545 // RETURNS: a #gssize of the read stream, or %-1 on an error.
2546 // <result>: a #GAsyncResult
2547 ssize_t fill_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
2548 return g_buffered_input_stream_fill_finish(&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
2551 // Gets the size of the available data within the stream.
2552 // RETURNS: size of the available stream.
2553 size_t get_available()() nothrow {
2554 return g_buffered_input_stream_get_available(&this);
2557 // Gets the size of the input buffer.
2558 // RETURNS: the current buffer size.
2559 size_t get_buffer_size()() nothrow {
2560 return g_buffered_input_stream_get_buffer_size(&this);
2563 // Peeks in the buffer, copying data of size @count into @buffer,
2564 // offset @offset bytes.
2565 // RETURNS: a #gsize of the number of bytes peeked, or -1 on error.
2566 // <buffer>: a pointer to an allocated chunk of memory
2567 // <offset>: a #gsize
2568 // <count>: a #gsize
2569 size_t peek(AT0)(AT0 /*ubyte*/ buffer, size_t offset, size_t count) nothrow {
2570 return g_buffered_input_stream_peek(&this, UpCast!(ubyte*)(buffer), offset, count);
2573 // Returns the buffer with the currently available bytes. The returned
2574 // buffer must not be modified and will become invalid when reading from
2575 // the stream or filling the buffer.
2577 // read-only buffer
2578 // <count>: a #gsize to get the number of bytes available in the buffer
2579 ubyte* peek_buffer(AT0)(/*out*/ AT0 /*size_t*/ count) nothrow {
2580 return g_buffered_input_stream_peek_buffer(&this, UpCast!(size_t*)(count));
2583 // Tries to read a single byte from the stream or the buffer. Will block
2584 // during this read.
2586 // On success, the byte read from the stream is returned. On end of stream
2587 // -1 is returned but it's not an exceptional error and @error is not set.
2589 // If @cancellable is not %NULL, then the operation can be cancelled by
2590 // triggering the cancellable object from another thread. If the operation
2591 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
2592 // operation was partially finished when the operation was cancelled the
2593 // partial result will be returned, without an error.
2595 // On error -1 is returned and @error is set accordingly.
2596 // RETURNS: the byte read from the @stream, or -1 on end of stream or error.
2597 // <cancellable>: optional #GCancellable object, %NULL to ignore
2598 int read_byte(AT0, AT1)(AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
2599 return g_buffered_input_stream_read_byte(&this, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
2602 // Sets the size of the internal buffer of @stream to @size, or to the
2603 // size of the contents of the buffer. The buffer can never be resized
2604 // smaller than its current contents.
2605 // <size>: a #gsize
2606 void set_buffer_size()(size_t size) nothrow {
2607 g_buffered_input_stream_set_buffer_size(&this, size);
2611 struct BufferedInputStreamClass {
2612 FilterInputStreamClass parent_class;
2614 // RETURNS: the number of bytes read into @stream's buffer, up to @count,
2615 // <count>: the number of bytes that will be read from the stream
2616 // <cancellable>: optional #GCancellable object, %NULL to ignore
2617 extern (C) ssize_t function (BufferedInputStream* stream, ssize_t count, Cancellable* cancellable, GLib2.Error** error=null) nothrow fill;
2619 // <count>: the number of bytes that will be read from the stream
2620 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request
2621 // <cancellable>: optional #GCancellable object
2622 // <callback>: a #GAsyncReadyCallback
2623 // <user_data>: a #gpointer
2624 extern (C) void function (BufferedInputStream* stream, ssize_t count, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow fill_async;
2626 // RETURNS: a #gssize of the read stream, or %-1 on an error.
2627 // <result>: a #GAsyncResult
2628 extern (C) ssize_t function (BufferedInputStream* stream, AsyncResult* result, GLib2.Error** error=null) nothrow fill_finish;
2629 extern (C) void function () nothrow _g_reserved1;
2630 extern (C) void function () nothrow _g_reserved2;
2631 extern (C) void function () nothrow _g_reserved3;
2632 extern (C) void function () nothrow _g_reserved4;
2633 extern (C) void function () nothrow _g_reserved5;
2636 struct BufferedInputStreamPrivate {
2640 // Buffered output stream implements #GFilterOutputStream and provides
2641 // for buffered writes.
2643 // By default, #GBufferedOutputStream's buffer size is set at 4 kilobytes.
2645 // To create a buffered output stream, use g_buffered_output_stream_new(),
2646 // or g_buffered_output_stream_new_sized() to specify the buffer's size
2647 // at construction.
2649 // To get the size of a buffer within a buffered input stream, use
2650 // g_buffered_output_stream_get_buffer_size(). To change the size of a
2651 // buffered output stream's buffer, use
2652 // g_buffered_output_stream_set_buffer_size(). Note that the buffer's
2653 // size cannot be reduced below the size of the data within the buffer.
2654 struct BufferedOutputStream /* : FilterOutputStream */ {
2655 alias parent_instance this;
2656 alias parent_instance super_;
2657 alias parent_instance filteroutputstream;
2658 FilterOutputStream parent_instance;
2659 BufferedOutputStreamPrivate* priv;
2662 // Creates a new buffered output stream for a base stream.
2663 // RETURNS: a #GOutputStream for the given @base_stream.
2664 // <base_stream>: a #GOutputStream.
2665 static BufferedOutputStream* /*new*/ new_(AT0)(AT0 /*OutputStream*/ base_stream) nothrow {
2666 return g_buffered_output_stream_new(UpCast!(OutputStream*)(base_stream));
2668 static auto opCall(AT0)(AT0 /*OutputStream*/ base_stream) {
2669 return g_buffered_output_stream_new(UpCast!(OutputStream*)(base_stream));
2672 // Creates a new buffered output stream with a given buffer size.
2673 // RETURNS: a #GOutputStream with an internal buffer set to @size.
2674 // <base_stream>: a #GOutputStream.
2675 // <size>: a #gsize.
2676 static BufferedOutputStream* /*new*/ new_sized(AT0)(AT0 /*OutputStream*/ base_stream, size_t size) nothrow {
2677 return g_buffered_output_stream_new_sized(UpCast!(OutputStream*)(base_stream), size);
2679 static auto opCall(AT0)(AT0 /*OutputStream*/ base_stream, size_t size) {
2680 return g_buffered_output_stream_new_sized(UpCast!(OutputStream*)(base_stream), size);
2683 // Checks if the buffer automatically grows as data is added.
2685 // %FALSE otherwise.
2686 // RETURNS: %TRUE if the @stream's buffer automatically grows,
2687 int get_auto_grow()() nothrow {
2688 return g_buffered_output_stream_get_auto_grow(&this);
2691 // Gets the size of the buffer in the @stream.
2692 // RETURNS: the current size of the buffer.
2693 size_t get_buffer_size()() nothrow {
2694 return g_buffered_output_stream_get_buffer_size(&this);
2697 // Sets whether or not the @stream's buffer should automatically grow.
2698 // If @auto_grow is true, then each write will just make the buffer
2699 // larger, and you must manually flush the buffer to actually write out
2700 // the data to the underlying stream.
2701 // <auto_grow>: a #gboolean.
2702 void set_auto_grow()(int auto_grow) nothrow {
2703 g_buffered_output_stream_set_auto_grow(&this, auto_grow);
2706 // Sets the size of the internal buffer to @size.
2707 // <size>: a #gsize.
2708 void set_buffer_size()(size_t size) nothrow {
2709 g_buffered_output_stream_set_buffer_size(&this, size);
2713 struct BufferedOutputStreamClass {
2714 FilterOutputStreamClass parent_class;
2715 extern (C) void function () nothrow _g_reserved1;
2716 extern (C) void function () nothrow _g_reserved2;
2719 struct BufferedOutputStreamPrivate {
2723 // VERSION: 2.26
2724 // Invoked when a connection to a message bus has been obtained.
2725 // <connection>: The #GDBusConnection to a message bus.
2726 // <name>: The name that is requested to be owned.
2727 // <user_data>: User data passed to g_bus_own_name().
2728 extern (C) alias void function (DBusConnection* connection, char* name, void* user_data) nothrow BusAcquiredCallback;
2731 // VERSION: 2.26
2732 // Invoked when the name is acquired.
2733 // <connection>: The #GDBusConnection on which to acquired the name.
2734 // <name>: The name being owned.
2735 // <user_data>: User data passed to g_bus_own_name() or g_bus_own_name_on_connection().
2736 extern (C) alias void function (DBusConnection* connection, char* name, void* user_data) nothrow BusNameAcquiredCallback;
2739 // VERSION: 2.26
2740 // Invoked when the name being watched is known to have to have a owner.
2741 // <connection>: The #GDBusConnection the name is being watched on.
2742 // <name>: The name being watched.
2743 // <name_owner>: Unique name of the owner of the name being watched.
2744 // <user_data>: User data passed to g_bus_watch_name().
2745 extern (C) alias void function (DBusConnection* connection, char* name, char* name_owner, void* user_data) nothrow BusNameAppearedCallback;
2748 // VERSION: 2.26
2749 // Invoked when the name is lost or @connection has been closed.
2750 // <connection>: The #GDBusConnection on which to acquire the name or %NULL if the connection was disconnected.
2751 // <name>: The name being owned.
2752 // <user_data>: User data passed to g_bus_own_name() or g_bus_own_name_on_connection().
2753 extern (C) alias void function (DBusConnection* connection, char* name, void* user_data) nothrow BusNameLostCallback;
2755 // Flags used in g_bus_own_name().
2756 enum BusNameOwnerFlags /* Version 2.26 */ {
2757 NONE = 0,
2758 ALLOW_REPLACEMENT = 1,
2759 REPLACE = 2
2762 // VERSION: 2.26
2763 // Invoked when the name being watched is known not to have to have a owner.
2764 // <connection>: The #GDBusConnection the name is being watched on.
2765 // <name>: The name being watched.
2766 // <user_data>: User data passed to g_bus_watch_name().
2767 extern (C) alias void function (DBusConnection* connection, char* name, void* user_data) nothrow BusNameVanishedCallback;
2769 // Flags used in g_bus_watch_name().
2770 enum BusNameWatcherFlags /* Version 2.26 */ {
2771 NONE = 0,
2772 AUTO_START = 1
2774 // An enumeration for well-known message buses.
2775 enum BusType /* Version 2.26 */ {
2776 STARTER = -1,
2777 NONE = 0,
2778 SYSTEM = 1,
2779 SESSION = 2
2782 // GCancellable is a thread-safe operation cancellation stack used
2783 // throughout GIO to allow for cancellation of synchronous and
2784 // asynchronous operations.
2785 struct Cancellable /* : GObject.Object */ {
2786 alias parent_instance this;
2787 alias parent_instance super_;
2788 alias parent_instance object;
2789 GObject2.Object parent_instance;
2790 private CancellablePrivate* priv;
2793 // Creates a new #GCancellable object.
2795 // Applications that want to start one or more operations
2796 // that should be cancellable should create a #GCancellable
2797 // and pass it to the operations.
2799 // One #GCancellable can be used in multiple consecutive
2800 // operations or in multiple concurrent operations.
2801 // RETURNS: a #GCancellable.
2802 static Cancellable* /*new*/ new_()() nothrow {
2803 return g_cancellable_new();
2805 static auto opCall()() {
2806 return g_cancellable_new();
2809 // Gets the top cancellable from the stack.
2811 // if the stack is empty.
2812 // RETURNS: a #GCancellable from the top of the stack, or %NULL
2813 static Cancellable* get_current()() nothrow {
2814 return g_cancellable_get_current();
2817 // Will set @cancellable to cancelled, and will emit the
2818 // #GCancellable::cancelled signal. (However, see the warning about
2819 // race conditions in the documentation for that signal if you are
2820 // planning to connect to it.)
2822 // This function is thread-safe. In other words, you can safely call
2823 // it from a thread other than the one running the operation that was
2824 // passed the @cancellable.
2826 // The convention within gio is that cancelling an asynchronous
2827 // operation causes it to complete asynchronously. That is, if you
2828 // cancel the operation from the same thread in which it is running,
2829 // then the operation's #GAsyncReadyCallback will not be invoked until
2830 // the application returns to the main loop.
2831 void cancel()() nothrow {
2832 g_cancellable_cancel(&this);
2835 // VERSION: 2.22
2836 // Convenience function to connect to the #GCancellable::cancelled
2837 // signal. Also handles the race condition that may happen
2838 // if the cancellable is cancelled right before connecting.
2840 // @callback is called at most once, either directly at the
2841 // time of the connect if @cancellable is already cancelled,
2842 // or when @cancellable is cancelled in some thread.
2844 // @data_destroy_func will be called when the handler is
2845 // disconnected, or immediately if the cancellable is already
2846 // cancelled.
2848 // See #GCancellable::cancelled for details on how to use this.
2850 // been cancelled.
2851 // RETURNS: The id of the signal handler or 0 if @cancellable has already
2852 // <callback>: The #GCallback to connect.
2853 // <data>: Data to pass to @callback.
2854 // <data_destroy_func>: Free function for @data or %NULL.
2855 c_ulong connect(AT0)(GObject2.Callback callback, AT0 /*void*/ data, GLib2.DestroyNotify data_destroy_func) nothrow {
2856 return g_cancellable_connect(&this, callback, UpCast!(void*)(data), data_destroy_func);
2859 // VERSION: 2.22
2860 // Disconnects a handler from a cancellable instance similar to
2861 // g_signal_handler_disconnect(). Additionally, in the event that a
2862 // signal handler is currently running, this call will block until the
2863 // handler has finished. Calling this function from a
2864 // #GCancellable::cancelled signal handler will therefore result in a
2865 // deadlock.
2867 // This avoids a race condition where a thread cancels at the
2868 // same time as the cancellable operation is finished and the
2869 // signal handler is removed. See #GCancellable::cancelled for
2870 // details on how to use this.
2872 // If @cancellable is %NULL or @handler_id is %0 this function does
2873 // nothing.
2874 // <handler_id>: Handler id of the handler to be disconnected, or %0.
2875 void disconnect()(c_ulong handler_id) nothrow {
2876 g_cancellable_disconnect(&this, handler_id);
2879 // Gets the file descriptor for a cancellable job. This can be used to
2880 // implement cancellable operations on Unix systems. The returned fd will
2881 // turn readable when @cancellable is cancelled.
2883 // You are not supposed to read from the fd yourself, just check for
2884 // readable status. Reading to unset the readable status is done
2885 // with g_cancellable_reset().
2887 // After a successful return from this function, you should use
2888 // g_cancellable_release_fd() to free up resources allocated for
2889 // the returned file descriptor.
2891 // See also g_cancellable_make_pollfd().
2893 // is not supported, or on errors.
2894 // RETURNS: A valid file descriptor. %-1 if the file descriptor
2895 int get_fd()() nothrow {
2896 return g_cancellable_get_fd(&this);
2899 // Checks if a cancellable job has been cancelled.
2901 // FALSE if called with %NULL or if item is not cancelled.
2902 // RETURNS: %TRUE if @cancellable is cancelled,
2903 int is_cancelled()() nothrow {
2904 return g_cancellable_is_cancelled(&this);
2907 // VERSION: 2.22
2908 // Creates a #GPollFD corresponding to @cancellable; this can be passed
2909 // to g_poll() and used to poll for cancellation. This is useful both
2910 // for unix systems without a native poll and for portability to
2911 // windows.
2913 // When this function returns %TRUE, you should use
2914 // g_cancellable_release_fd() to free up resources allocated for the
2915 // @pollfd. After a %FALSE return, do not call g_cancellable_release_fd().
2917 // If this function returns %FALSE, either no @cancellable was given or
2918 // resource limits prevent this function from allocating the necessary
2919 // structures for polling. (On Linux, you will likely have reached
2920 // the maximum number of file descriptors.) The suggested way to handle
2921 // these cases is to ignore the @cancellable.
2923 // You are not supposed to read from the fd yourself, just check for
2924 // readable status. Reading to unset the readable status is done
2925 // with g_cancellable_reset().
2927 // failure to prepare the cancellable.
2928 // RETURNS: %TRUE if @pollfd was successfully initialized, %FALSE on
2929 // <pollfd>: a pointer to a #GPollFD
2930 int make_pollfd(AT0)(AT0 /*GLib2.PollFD*/ pollfd) nothrow {
2931 return g_cancellable_make_pollfd(&this, UpCast!(GLib2.PollFD*)(pollfd));
2934 // Pops @cancellable off the cancellable stack (verifying that @cancellable
2935 // is on the top of the stack).
2936 void pop_current()() nothrow {
2937 g_cancellable_pop_current(&this);
2940 // Pushes @cancellable onto the cancellable stack. The current
2941 // cancellable can then be received using g_cancellable_get_current().
2943 // This is useful when implementing cancellable operations in
2944 // code that does not allow you to pass down the cancellable object.
2946 // This is typically called automatically by e.g. #GFile operations,
2947 // so you rarely have to call this yourself.
2948 void push_current()() nothrow {
2949 g_cancellable_push_current(&this);
2952 // VERSION: 2.22
2953 // Releases a resources previously allocated by g_cancellable_get_fd()
2954 // or g_cancellable_make_pollfd().
2956 // For compatibility reasons with older releases, calling this function
2957 // is not strictly required, the resources will be automatically freed
2958 // when the @cancellable is finalized. However, the @cancellable will
2959 // block scarce file descriptors until it is finalized if this function
2960 // is not called. This can cause the application to run out of file
2961 // descriptors when many #GCancellables are used at the same time.
2962 void release_fd()() nothrow {
2963 g_cancellable_release_fd(&this);
2966 // Resets @cancellable to its uncancelled state.
2968 // If cancellable is currently in use by any cancellable operation
2969 // then the behavior of this function is undefined.
2970 void reset()() nothrow {
2971 g_cancellable_reset(&this);
2974 // If the @cancellable is cancelled, sets the error to notify
2975 // that the operation was cancelled.
2976 // RETURNS: %TRUE if @cancellable was cancelled, %FALSE if it was not
2977 int set_error_if_cancelled(AT0)(AT0 /*GLib2.Error**/ error=null) nothrow {
2978 return g_cancellable_set_error_if_cancelled(&this, UpCast!(GLib2.Error**)(error));
2981 // Unintrospectable method: source_new() / g_cancellable_source_new()
2982 // VERSION: 2.28
2983 // Creates a source that triggers if @cancellable is cancelled and
2984 // calls its callback of type #GCancellableSourceFunc. This is
2985 // primarily useful for attaching to another (non-cancellable) source
2986 // with g_source_add_child_source() to add cancellability to it.
2988 // For convenience, you can call this with a %NULL #GCancellable,
2989 // in which case the source will never trigger.
2990 // RETURNS: the new #GSource.
2991 GLib2.Source* /*new*/ source_new()() nothrow {
2992 return g_cancellable_source_new(&this);
2995 // Emitted when the operation has been cancelled.
2997 // Can be used by implementations of cancellable operations. If the
2998 // operation is cancelled from another thread, the signal will be
2999 // emitted in the thread that cancelled the operation, not the
3000 // thread that is running the operation.
3002 // Note that disconnecting from this signal (or any signal) in a
3003 // multi-threaded program is prone to race conditions. For instance
3004 // it is possible that a signal handler may be invoked even
3005 // <emphasis>after</emphasis> a call to
3006 // g_signal_handler_disconnect() for that handler has already
3007 // returned.
3009 // There is also a problem when cancellation happen
3010 // right before connecting to the signal. If this happens the
3011 // signal will unexpectedly not be emitted, and checking before
3012 // connecting to the signal leaves a race condition where this is
3013 // still happening.
3015 // In order to make it safe and easy to connect handlers there
3016 // are two helper functions: g_cancellable_connect() and
3017 // g_cancellable_disconnect() which protect against problems
3018 // like this.
3020 // An example of how to us this:
3021 // |[
3022 // /<!-- -->* Make sure we don't do any unnecessary work if already cancelled *<!-- -->/
3023 // if (g_cancellable_set_error_if_cancelled (cancellable))
3024 // return;
3026 // /<!-- -->* Set up all the data needed to be able to
3027 // * handle cancellation of the operation *<!-- -->/
3028 // my_data = my_data_new (...);
3030 // id = 0;
3031 // if (cancellable)
3032 // id = g_cancellable_connect (cancellable,
3033 // G_CALLBACK (cancelled_handler)
3034 // data, NULL);
3036 // /<!-- -->* cancellable operation here... *<!-- -->/
3038 // g_cancellable_disconnect (cancellable, id);
3040 // /<!-- -->* cancelled_handler is never called after this, it
3041 // * is now safe to free the data *<!-- -->/
3042 // my_data_free (my_data);
3043 // ]|
3045 // Note that the cancelled signal is emitted in the thread that
3046 // the user cancelled from, which may be the main thread. So, the
3047 // cancellable signal should not do something that can block.
3048 extern (C) alias static void function (Cancellable* this_, void* user_data=null) nothrow signal_cancelled;
3050 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
3051 return super_.signal_connect!name(cb, data, cf);
3054 ulong signal_connect(string name:"cancelled", CB/*:signal_cancelled*/)
3055 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
3056 if (is(typeof(cb)==signal_cancelled)||_ttmm!(CB, signal_cancelled)()) {
3057 return signal_connect_data!()(&this, cast(char*)"cancelled",
3058 cast(GObject2.Callback)cb, data, null, cf);
3062 struct CancellableClass {
3063 GObject2.ObjectClass parent_class;
3064 extern (C) void function (Cancellable* cancellable) nothrow cancelled;
3065 extern (C) void function () nothrow _g_reserved1;
3066 extern (C) void function () nothrow _g_reserved2;
3067 extern (C) void function () nothrow _g_reserved3;
3068 extern (C) void function () nothrow _g_reserved4;
3069 extern (C) void function () nothrow _g_reserved5;
3072 struct CancellablePrivate {
3076 // VERSION: 2.28
3077 // This is the function type of the callback used for the #GSource
3078 // returned by g_cancellable_source_new().
3079 // RETURNS: it should return %FALSE if the source should be removed.
3080 // <cancellable>: the #GCancellable
3081 // <user_data>: data passed in by the user.
3082 extern (C) alias int function (Cancellable* cancellable, void* user_data) nothrow CancellableSourceFunc;
3085 // #GCharsetConverter is an implementation of #GConverter based on
3086 // GIConv.
3087 struct CharsetConverter /* : GObject.Object */ {
3088 mixin Converter.__interface__;
3089 mixin Initable.__interface__;
3090 alias method_parent this;
3091 alias method_parent super_;
3092 alias method_parent object;
3093 GObject2.Object method_parent;
3096 // VERSION: 2.24
3097 // Creates a new #GCharsetConverter.
3098 // RETURNS: a new #GCharsetConverter or %NULL on error.
3099 // <to_charset>: destination charset
3100 // <from_charset>: source charset
3101 static CharsetConverter* /*new*/ new_(AT0, AT1, AT2)(AT0 /*char*/ to_charset, AT1 /*char*/ from_charset, AT2 /*GLib2.Error**/ error=null) nothrow {
3102 return g_charset_converter_new(toCString!(char*)(to_charset), toCString!(char*)(from_charset), UpCast!(GLib2.Error**)(error));
3104 static auto opCall(AT0, AT1, AT2)(AT0 /*char*/ to_charset, AT1 /*char*/ from_charset, AT2 /*GLib2.Error**/ error=null) {
3105 return g_charset_converter_new(toCString!(char*)(to_charset), toCString!(char*)(from_charset), UpCast!(GLib2.Error**)(error));
3108 // VERSION: 2.24
3109 // Gets the number of fallbacks that @converter has applied so far.
3110 // RETURNS: the number of fallbacks that @converter has applied
3111 uint get_num_fallbacks()() nothrow {
3112 return g_charset_converter_get_num_fallbacks(&this);
3115 // VERSION: 2.24
3116 // Gets the #GCharsetConverter:use-fallback property.
3117 // RETURNS: %TRUE if fallbacks are used by @converter
3118 int get_use_fallback()() nothrow {
3119 return g_charset_converter_get_use_fallback(&this);
3122 // VERSION: 2.24
3123 // Sets the #GCharsetConverter:use-fallback property.
3124 // <use_fallback>: %TRUE to use fallbacks
3125 void set_use_fallback()(int use_fallback) nothrow {
3126 g_charset_converter_set_use_fallback(&this, use_fallback);
3130 struct CharsetConverterClass {
3131 GObject2.ObjectClass parent_class;
3135 // #GConverter is implemented by objects that convert
3136 // binary data in various ways. The conversion can be
3137 // stateful and may fail at any place.
3139 // Some example conversions are: character set conversion,
3140 // compression, decompression and regular expression
3141 // replace.
3142 struct Converter /* Interface */ /* Version 2.24 */ {
3143 mixin template __interface__() {
3144 // VERSION: 2.24
3145 // This is the main operation used when converting data. It is to be called
3146 // multiple times in a loop, and each time it will do some work, i.e.
3147 // producing some output (in @outbuf) or consuming some input (from @inbuf) or
3148 // both. If its not possible to do any work an error is returned.
3150 // Note that a single call may not consume all input (or any input at all).
3151 // Also a call may produce output even if given no input, due to state stored
3152 // in the converter producing output.
3154 // If any data was either produced or consumed, and then an error happens, then
3155 // only the successful conversion is reported and the error is returned on the
3156 // next call.
3158 // A full conversion loop involves calling this method repeatedly, each time
3159 // giving it new input and space output space. When there is no more input
3160 // data after the data in @inbuf, the flag %G_CONVERTER_INPUT_AT_END must be set.
3161 // The loop will be (unless some error happens) returning %G_CONVERTER_CONVERTED
3162 // each time until all data is consumed and all output is produced, then
3163 // %G_CONVERTER_FINISHED is returned instead. Note, that %G_CONVERTER_FINISHED
3164 // may be returned even if %G_CONVERTER_INPUT_AT_END is not set, for instance
3165 // in a decompression converter where the end of data is detectable from the
3166 // data (and there might even be other data after the end of the compressed data).
3168 // When some data has successfully been converted @bytes_read and is set to
3169 // the number of bytes read from @inbuf, and @bytes_written is set to indicate
3170 // how many bytes was written to @outbuf. If there are more data to output
3171 // or consume (i.e. unless the %G_CONVERTER_INPUT_AT_END is specified) then
3172 // %G_CONVERTER_CONVERTED is returned, and if no more data is to be output
3173 // then %G_CONVERTER_FINISHED is returned.
3175 // On error %G_CONVERTER_ERROR is returned and @error is set accordingly.
3176 // Some errors need special handling:
3178 // %G_IO_ERROR_NO_SPACE is returned if there is not enough space
3179 // to write the resulting converted data, the application should
3180 // call the function again with a larger @outbuf to continue.
3182 // %G_IO_ERROR_PARTIAL_INPUT is returned if there is not enough
3183 // input to fully determine what the conversion should produce,
3184 // and the %G_CONVERTER_INPUT_AT_END flag is not set. This happens for
3185 // example with an incomplete multibyte sequence when converting text,
3186 // or when a regexp matches up to the end of the input (and may match
3187 // further input). It may also happen when @inbuf_size is zero and
3188 // there is no more data to produce.
3190 // When this happens the application should read more input and then
3191 // call the function again. If further input shows that there is no
3192 // more data call the function again with the same data but with
3193 // the %G_CONVERTER_INPUT_AT_END flag set. This may cause the conversion
3194 // to finish as e.g. in the regexp match case (or, to fail again with
3195 // %G_IO_ERROR_PARTIAL_INPUT in e.g. a charset conversion where the
3196 // input is actually partial).
3198 // After g_converter_convert() has returned %G_CONVERTER_FINISHED the
3199 // converter object is in an invalid state where its not allowed
3200 // to call g_converter_convert() anymore. At this time you can only
3201 // free the object or call g_converter_reset() to reset it to the
3202 // initial state.
3204 // If the flag %G_CONVERTER_FLUSH is set then conversion is modified
3205 // to try to write out all internal state to the output. The application
3206 // has to call the function multiple times with the flag set, and when
3207 // the available input has been consumed and all internal state has
3208 // been produced then %G_CONVERTER_FLUSHED (or %G_CONVERTER_FINISHED if
3209 // really at the end) is returned instead of %G_CONVERTER_CONVERTED.
3210 // This is somewhat similar to what happens at the end of the input stream,
3211 // but done in the middle of the data.
3213 // This has different meanings for different conversions. For instance
3214 // in a compression converter it would mean that we flush all the
3215 // compression state into output such that if you uncompress the
3216 // compressed data you get back all the input data. Doing this may
3217 // make the final file larger due to padding though. Another example
3218 // is a regexp conversion, where if you at the end of the flushed data
3219 // have a match, but there is also a potential longer match. In the
3220 // non-flushed case we would ask for more input, but when flushing we
3221 // treat this as the end of input and do the match.
3223 // Flushing is not always possible (like if a charset converter flushes
3224 // at a partial multibyte sequence). Converters are supposed to try
3225 // to produce as much output as possible and then return an error
3226 // (typically %G_IO_ERROR_PARTIAL_INPUT).
3227 // RETURNS: a #GConverterResult, %G_CONVERTER_ERROR on error.
3228 // <inbuf>: the buffer containing the data to convert.
3229 // <inbuf_size>: the number of bytes in @inbuf
3230 // <outbuf>: a buffer to write converted data in.
3231 // <outbuf_size>: the number of bytes in @outbuf, must be at least one
3232 // <flags>: a #GConverterFlags controlling the conversion details
3233 // <bytes_read>: will be set to the number of bytes read from @inbuf on success
3234 // <bytes_written>: will be set to the number of bytes written to @outbuf on success
3235 ConverterResult convert(AT0, AT1, AT2, AT3, AT4)(AT0 /*ubyte*/ inbuf, size_t inbuf_size, AT1 /*void*/ outbuf, size_t outbuf_size, ConverterFlags flags, /*out*/ AT2 /*size_t*/ bytes_read, /*out*/ AT3 /*size_t*/ bytes_written, AT4 /*GLib2.Error**/ error=null) nothrow {
3236 return g_converter_convert(cast(Converter*)&this, UpCast!(ubyte*)(inbuf), inbuf_size, UpCast!(void*)(outbuf), outbuf_size, flags, UpCast!(size_t*)(bytes_read), UpCast!(size_t*)(bytes_written), UpCast!(GLib2.Error**)(error));
3239 // VERSION: 2.24
3240 // Resets all internal state in the converter, making it behave
3241 // as if it was just created. If the converter has any internal
3242 // state that would produce output then that output is lost.
3243 void reset()() nothrow {
3244 g_converter_reset(cast(Converter*)&this);
3247 mixin __interface__;
3250 // Flags used when calling a g_converter_convert().
3251 enum ConverterFlags /* Version 2.24 */ {
3252 G_CONVERTER_NO_FLAGS = 0,
3253 INPUT_AT_END = 1,
3254 FLUSH = 2
3257 // Provides an interface for converting data from one type
3258 // to another type. The conversion can be stateful
3259 // and may fail at any place.
3260 struct ConverterIface /* Version 2.24 */ {
3261 GObject2.TypeInterface g_iface;
3263 // RETURNS: a #GConverterResult, %G_CONVERTER_ERROR on error.
3264 // <inbuf>: the buffer containing the data to convert.
3265 // <inbuf_size>: the number of bytes in @inbuf
3266 // <outbuf>: a buffer to write converted data in.
3267 // <outbuf_size>: the number of bytes in @outbuf, must be at least one
3268 // <flags>: a #GConverterFlags controlling the conversion details
3269 // <bytes_read>: will be set to the number of bytes read from @inbuf on success
3270 // <bytes_written>: will be set to the number of bytes written to @outbuf on success
3271 extern (C) ConverterResult function (Converter* converter, ubyte* inbuf, size_t inbuf_size, void* outbuf, size_t outbuf_size, ConverterFlags flags, /*out*/ size_t* bytes_read, /*out*/ size_t* bytes_written, GLib2.Error** error=null) nothrow convert;
3272 extern (C) void function (Converter* converter) nothrow reset;
3276 // Converter input stream implements #GInputStream and allows
3277 // conversion of data of various types during reading.
3278 struct ConverterInputStream /* : FilterInputStream */ {
3279 alias parent_instance this;
3280 alias parent_instance super_;
3281 alias parent_instance filterinputstream;
3282 FilterInputStream parent_instance;
3283 private ConverterInputStreamPrivate* priv;
3286 // Creates a new converter input stream for the @base_stream.
3287 // RETURNS: a new #GInputStream.
3288 // <base_stream>: a #GInputStream
3289 // <converter>: a #GConverter
3290 static ConverterInputStream* /*new*/ new_(AT0, AT1)(AT0 /*InputStream*/ base_stream, AT1 /*Converter*/ converter) nothrow {
3291 return g_converter_input_stream_new(UpCast!(InputStream*)(base_stream), UpCast!(Converter*)(converter));
3293 static auto opCall(AT0, AT1)(AT0 /*InputStream*/ base_stream, AT1 /*Converter*/ converter) {
3294 return g_converter_input_stream_new(UpCast!(InputStream*)(base_stream), UpCast!(Converter*)(converter));
3297 // VERSION: 2.24
3298 // Gets the #GConverter that is used by @converter_stream.
3299 // RETURNS: the converter of the converter input stream
3300 Converter* get_converter()() nothrow {
3301 return g_converter_input_stream_get_converter(&this);
3305 struct ConverterInputStreamClass {
3306 FilterInputStreamClass parent_class;
3307 extern (C) void function () nothrow _g_reserved1;
3308 extern (C) void function () nothrow _g_reserved2;
3309 extern (C) void function () nothrow _g_reserved3;
3310 extern (C) void function () nothrow _g_reserved4;
3311 extern (C) void function () nothrow _g_reserved5;
3314 struct ConverterInputStreamPrivate {
3318 // Converter output stream implements #GOutputStream and allows
3319 // conversion of data of various types during reading.
3320 struct ConverterOutputStream /* : FilterOutputStream */ {
3321 alias parent_instance this;
3322 alias parent_instance super_;
3323 alias parent_instance filteroutputstream;
3324 FilterOutputStream parent_instance;
3325 private ConverterOutputStreamPrivate* priv;
3328 // Creates a new converter output stream for the @base_stream.
3329 // RETURNS: a new #GOutputStream.
3330 // <base_stream>: a #GOutputStream
3331 // <converter>: a #GConverter
3332 static ConverterOutputStream* /*new*/ new_(AT0, AT1)(AT0 /*OutputStream*/ base_stream, AT1 /*Converter*/ converter) nothrow {
3333 return g_converter_output_stream_new(UpCast!(OutputStream*)(base_stream), UpCast!(Converter*)(converter));
3335 static auto opCall(AT0, AT1)(AT0 /*OutputStream*/ base_stream, AT1 /*Converter*/ converter) {
3336 return g_converter_output_stream_new(UpCast!(OutputStream*)(base_stream), UpCast!(Converter*)(converter));
3339 // VERSION: 2.24
3340 // Gets the #GConverter that is used by @converter_stream.
3341 // RETURNS: the converter of the converter output stream
3342 Converter* get_converter()() nothrow {
3343 return g_converter_output_stream_get_converter(&this);
3347 struct ConverterOutputStreamClass {
3348 FilterOutputStreamClass parent_class;
3349 extern (C) void function () nothrow _g_reserved1;
3350 extern (C) void function () nothrow _g_reserved2;
3351 extern (C) void function () nothrow _g_reserved3;
3352 extern (C) void function () nothrow _g_reserved4;
3353 extern (C) void function () nothrow _g_reserved5;
3356 struct ConverterOutputStreamPrivate {
3359 // Results returned from g_converter_convert().
3360 enum ConverterResult /* Version 2.24 */ {
3361 ERROR = 0,
3362 CONVERTED = 1,
3363 FINISHED = 2,
3364 FLUSHED = 3
3367 // The #GCredentials type is a reference-counted wrapper for native
3368 // credentials. This information is typically used for identifying,
3369 // authenticating and authorizing other processes.
3371 // Some operating systems supports looking up the credentials of the
3372 // remote peer of a communication endpoint - see e.g.
3373 // g_socket_get_credentials().
3375 // Some operating systems supports securely sending and receiving
3376 // credentials over a Unix Domain Socket, see
3377 // #GUnixCredentialsMessage, g_unix_connection_send_credentials() and
3378 // g_unix_connection_receive_credentials() for details.
3380 // On Linux, the native credential type is a <type>struct ucred</type>
3381 // - see the
3382 // <citerefentry><refentrytitle>unix</refentrytitle><manvolnum>7</manvolnum></citerefentry>
3383 // man page for details. This corresponds to
3384 // %G_CREDENTIALS_TYPE_LINUX_UCRED.
3386 // On FreeBSD, the native credential type is a <type>struct cmsgcred</type>.
3387 // This corresponds to %G_CREDENTIALS_TYPE_FREEBSD_CMSGCRED.
3389 // On OpenBSD, the native credential type is a <type>struct sockpeercred</type>.
3390 // This corresponds to %G_CREDENTIALS_TYPE_OPENBSD_SOCKPEERCRED.
3391 struct Credentials /* : GObject.Object */ /* Version 2.26 */ {
3392 alias method_parent this;
3393 alias method_parent super_;
3394 alias method_parent object;
3395 GObject2.Object method_parent;
3398 // VERSION: 2.26
3399 // Creates a new #GCredentials object with credentials matching the
3400 // the current process.
3401 // RETURNS: A #GCredentials. Free with g_object_unref().
3402 static Credentials* /*new*/ new_()() nothrow {
3403 return g_credentials_new();
3405 static auto opCall()() {
3406 return g_credentials_new();
3409 // Unintrospectable method: get_native() / g_credentials_get_native()
3410 // VERSION: 2.26
3411 // Gets a pointer to native credentials of type @native_type from
3412 // @credentials.
3414 // It is a programming error (which will cause an warning to be
3415 // logged) to use this method if there is no #GCredentials support for
3416 // the OS or if @native_type isn't supported by the OS.
3418 // operation there is no #GCredentials support for the OS or if
3419 // @native_type isn't supported by the OS. Do not free the returned
3420 // data, it is owned by @credentials.
3421 // RETURNS: The pointer to native credentials or %NULL if the
3422 // <native_type>: The type of native credentials to get.
3423 void* get_native()(CredentialsType native_type) nothrow {
3424 return g_credentials_get_native(&this, native_type);
3427 // VERSION: 2.26
3428 // Tries to get the UNIX user identifier from @credentials. This
3429 // method is only available on UNIX platforms.
3431 // This operation can fail if #GCredentials is not supported on the
3432 // OS or if the native credentials type does not contain information
3433 // about the UNIX user.
3434 // RETURNS: The UNIX user identifier or -1 if @error is set.
3435 uint get_unix_user(AT0)(AT0 /*GLib2.Error**/ error=null) nothrow {
3436 return g_credentials_get_unix_user(&this, UpCast!(GLib2.Error**)(error));
3439 // VERSION: 2.26
3440 // Checks if @credentials and @other_credentials is the same user.
3442 // This operation can fail if #GCredentials is not supported on the
3443 // the OS.
3445 // user, %FALSE otherwise or if @error is set.
3446 // RETURNS: %TRUE if @credentials and @other_credentials has the same
3447 // <other_credentials>: A #GCredentials.
3448 int is_same_user(AT0, AT1)(AT0 /*Credentials*/ other_credentials, AT1 /*GLib2.Error**/ error=null) nothrow {
3449 return g_credentials_is_same_user(&this, UpCast!(Credentials*)(other_credentials), UpCast!(GLib2.Error**)(error));
3452 // VERSION: 2.26
3453 // Copies the native credentials of type @native_type from @native
3454 // into @credentials.
3456 // It is a programming error (which will cause an warning to be
3457 // logged) to use this method if there is no #GCredentials support for
3458 // the OS or if @native_type isn't supported by the OS.
3459 // <native_type>: The type of native credentials to set.
3460 // <native>: A pointer to native credentials.
3461 void set_native(AT0)(CredentialsType native_type, AT0 /*void*/ native) nothrow {
3462 g_credentials_set_native(&this, native_type, UpCast!(void*)(native));
3465 // VERSION: 2.26
3466 // Tries to set the UNIX user identifier on @credentials. This method
3467 // is only available on UNIX platforms.
3469 // This operation can fail if #GCredentials is not supported on the
3470 // OS or if the native credentials type does not contain information
3471 // about the UNIX user.
3472 // RETURNS: %TRUE if @uid was set, %FALSE if error is set.
3473 // <uid>: The UNIX user identifier to set.
3474 int set_unix_user(AT0)(uint uid, AT0 /*GLib2.Error**/ error=null) nothrow {
3475 return g_credentials_set_unix_user(&this, uid, UpCast!(GLib2.Error**)(error));
3478 // VERSION: 2.26
3479 // Creates a human-readable textual representation of @credentials
3480 // that can be used in logging and debug messages. The format of the
3481 // returned string may change in future GLib release.
3482 // RETURNS: A string that should be freed with g_free().
3483 char* /*new*/ to_string()() nothrow {
3484 return g_credentials_to_string(&this);
3488 // Class structure for #GCredentials.
3489 struct CredentialsClass /* Version 2.26 */ {
3492 // Enumeration describing different kinds of native credential types.
3493 enum CredentialsType /* Version 2.26 */ {
3494 INVALID = 0,
3495 LINUX_UCRED = 1,
3496 FREEBSD_CMSGCRED = 2,
3497 OPENBSD_SOCKPEERCRED = 3
3500 // #GDBusActionGroup is an implementation of the #GActionGroup
3501 // interface that can be used as a proxy for an action group
3502 // that is exported over D-Bus with g_dbus_connection_export_action_group().
3503 struct DBusActionGroup /* : GObject.Object */ {
3504 mixin ActionGroup.__interface__;
3505 mixin RemoteActionGroup.__interface__;
3506 alias method_parent this;
3507 alias method_parent super_;
3508 alias method_parent object;
3509 GObject2.Object method_parent;
3512 // VERSION: 2.32
3513 // Obtains a #GDBusActionGroup for the action group which is exported at
3514 // the given @bus_name and @object_path.
3516 // The thread default main context is taken at the time of this call.
3517 // All signals on the menu model (and any linked models) are reported
3518 // with respect to this context. All calls on the returned menu model
3519 // (and linked models) must also originate from this same context, with
3520 // the thread default main context unchanged.
3522 // This call is non-blocking. The returned action group may or may not
3523 // already be filled in. The correct thing to do is connect the signals
3524 // for the action group to monitor for changes and then to call
3525 // g_action_group_list_actions() to get the initial list.
3526 // RETURNS: a #GDBusActionGroup
3527 // <connection>: A #GDBusConnection
3528 // <bus_name>: the bus name which exports the action group
3529 // <object_path>: the object path at which the action group is exported
3530 static DBusActionGroup* /*new*/ get(AT0, AT1, AT2)(AT0 /*DBusConnection*/ connection, AT1 /*char*/ bus_name, AT2 /*char*/ object_path) nothrow {
3531 return g_dbus_action_group_get(UpCast!(DBusConnection*)(connection), toCString!(char*)(bus_name), toCString!(char*)(object_path));
3535 // Information about an annotation.
3536 struct DBusAnnotationInfo /* Version 2.26 */ {
3537 int ref_count;
3538 char* key, value;
3539 DBusAnnotationInfo*[666] annotations;
3542 // VERSION: 2.26
3543 // If @info is statically allocated does nothing. Otherwise increases
3544 // the reference count.
3545 // RETURNS: The same @info.
3546 DBusAnnotationInfo* /*new*/ ref_()() nothrow {
3547 return g_dbus_annotation_info_ref(&this);
3550 // VERSION: 2.26
3551 // If @info is statically allocated, does nothing. Otherwise decreases
3552 // the reference count of @info. When its reference count drops to 0,
3553 // the memory used is freed.
3554 void unref()() nothrow {
3555 g_dbus_annotation_info_unref(&this);
3558 // VERSION: 2.26
3559 // Looks up the value of an annotation.
3561 // This cost of this function is O(n) in number of annotations.
3562 // RETURNS: The value or %NULL if not found. Do not free, it is owned by @annotations.
3563 // <annotations>: A %NULL-terminated array of annotations or %NULL.
3564 // <name>: The name of the annotation to look up.
3565 static char* lookup(AT0, AT1)(AT0 /*DBusAnnotationInfo**/ annotations, AT1 /*char*/ name) nothrow {
3566 return g_dbus_annotation_info_lookup(UpCast!(DBusAnnotationInfo**)(annotations), toCString!(char*)(name));
3570 // Information about an argument for a method or a signal.
3571 struct DBusArgInfo /* Version 2.26 */ {
3572 int ref_count;
3573 char* name, signature;
3574 DBusAnnotationInfo*[666] annotations;
3577 // VERSION: 2.26
3578 // If @info is statically allocated does nothing. Otherwise increases
3579 // the reference count.
3580 // RETURNS: The same @info.
3581 DBusArgInfo* /*new*/ ref_()() nothrow {
3582 return g_dbus_arg_info_ref(&this);
3585 // VERSION: 2.26
3586 // If @info is statically allocated, does nothing. Otherwise decreases
3587 // the reference count of @info. When its reference count drops to 0,
3588 // the memory used is freed.
3589 void unref()() nothrow {
3590 g_dbus_arg_info_unref(&this);
3595 // The #GDBusAuthObserver type provides a mechanism for participating
3596 // in how a #GDBusServer (or a #GDBusConnection) authenticates remote
3597 // peers. Simply instantiate a #GDBusAuthObserver and connect to the
3598 // signals you are interested in. Note that new signals may be added
3599 // in the future
3601 // For example, if you only want to allow D-Bus connections from
3602 // processes owned by the same uid as the server, you would use a
3603 // signal handler like the following:
3604 // <example id="auth-observer"><title>Controlling Authentication</title><programlisting>
3605 // static gboolean
3606 // on_authorize_authenticated_peer (GDBusAuthObserver *observer,
3607 // GIOStream *stream,
3608 // GCredentials *credentials,
3609 // gpointer user_data)
3610 // {
3611 // gboolean authorized;
3613 // authorized = FALSE;
3614 // if (credentials != NULL)
3615 // {
3616 // GCredentials *own_credentials;
3617 // own_credentials = g_credentials_new ();
3618 // if (g_credentials_is_same_user (credentials, own_credentials, NULL))
3619 // authorized = TRUE;
3620 // g_object_unref (own_credentials);
3621 // }
3623 // return authorized;
3624 // }
3625 // </programlisting></example>
3626 struct DBusAuthObserver /* : GObject.Object */ /* Version 2.26 */ {
3627 alias method_parent this;
3628 alias method_parent super_;
3629 alias method_parent object;
3630 GObject2.Object method_parent;
3633 // VERSION: 2.26
3634 // Creates a new #GDBusAuthObserver object.
3635 // RETURNS: A #GDBusAuthObserver. Free with g_object_unref().
3636 static DBusAuthObserver* /*new*/ new_()() nothrow {
3637 return g_dbus_auth_observer_new();
3639 static auto opCall()() {
3640 return g_dbus_auth_observer_new();
3643 // VERSION: 2.26
3644 // Emits the #GDBusAuthObserver::authorize-authenticated-peer signal on @observer.
3645 // RETURNS: %TRUE if the peer is authorized, %FALSE if not.
3646 // <stream>: A #GIOStream for the #GDBusConnection.
3647 // <credentials>: Credentials received from the peer or %NULL.
3648 int authorize_authenticated_peer(AT0, AT1)(AT0 /*IOStream*/ stream, AT1 /*Credentials*/ credentials) nothrow {
3649 return g_dbus_auth_observer_authorize_authenticated_peer(&this, UpCast!(IOStream*)(stream), UpCast!(Credentials*)(credentials));
3652 // VERSION: 2.26
3653 // Emitted to check if a peer that is successfully authenticated
3654 // is authorized.
3655 // RETURNS: %TRUE if the peer is authorized, %FALSE if not.
3656 // <stream>: A #GIOStream for the #GDBusConnection.
3657 // <credentials>: Credentials received from the peer or %NULL.
3658 extern (C) alias static c_int function (DBusAuthObserver* this_, IOStream* stream, Credentials* credentials, void* user_data=null) nothrow signal_authorize_authenticated_peer;
3660 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
3661 return super_.signal_connect!name(cb, data, cf);
3664 ulong signal_connect(string name:"authorize-authenticated-peer", CB/*:signal_authorize_authenticated_peer*/)
3665 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
3666 if (is(typeof(cb)==signal_authorize_authenticated_peer)||_ttmm!(CB, signal_authorize_authenticated_peer)()) {
3667 return signal_connect_data!()(&this, cast(char*)"authorize-authenticated-peer",
3668 cast(GObject2.Callback)cb, data, null, cf);
3672 // Flags used in g_dbus_connection_call() and similar APIs.
3673 enum DBusCallFlags /* Version 2.26 */ {
3674 NONE = 0,
3675 NO_AUTO_START = 1
3677 // Capabilities negotiated with the remote peer.
3678 enum DBusCapabilityFlags /* Version 2.26 */ {
3679 NONE = 0,
3680 UNIX_FD_PASSING = 1
3683 // The #GDBusConnection type is used for D-Bus connections to remote
3684 // peers such as a message buses. It is a low-level API that offers a
3685 // lot of flexibility. For instance, it lets you establish a connection
3686 // over any transport that can by represented as an #GIOStream.
3688 // This class is rarely used directly in D-Bus clients. If you are writing
3689 // an D-Bus client, it is often easier to use the g_bus_own_name(),
3690 // g_bus_watch_name() or g_dbus_proxy_new_for_bus() APIs.
3692 // As an exception to the usual GLib rule that a particular object must not be
3693 // used by two threads at the same time, #GDBusConnection's methods may be
3694 // called from any thread<footnote>
3695 // <para>
3696 // This is so that g_bus_get() and g_bus_get_sync() can safely return the
3697 // same #GDBusConnection when called from any thread.
3698 // </para>
3699 // </footnote>.
3701 // Most of the ways to obtain a #GDBusConnection automatically initialize it
3702 // (i.e. connect to D-Bus): for instance, g_dbus_connection_new() and
3703 // g_bus_get(), and the synchronous versions of those methods, give you an
3704 // initialized connection. Language bindings for GIO should use
3705 // g_initable_new() or g_async_initable_new_async(), which also initialize the
3706 // connection.
3708 // If you construct an uninitialized #GDBusConnection, such as via
3709 // g_object_new(), you must initialize it via g_initable_init() or
3710 // g_async_initable_init_async() before using its methods or properties.
3711 // Calling methods or accessing properties on a #GDBusConnection that has not
3712 // completed initialization successfully is considered to be invalid, and leads
3713 // to undefined behaviour. In particular, if initialization fails with a
3714 // #GError, the only valid thing you can do with that #GDBusConnection is to
3715 // free it with g_object_unref().
3717 // <example id="gdbus-server"><title>D-Bus server example</title><programlisting><xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gdbus-example-server.c"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting></example>
3719 // <example id="gdbus-subtree-server"><title>D-Bus subtree example</title><programlisting><xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gdbus-example-subtree.c"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting></example>
3721 // <example id="gdbus-unix-fd-client"><title>D-Bus UNIX File Descriptor example</title><programlisting><xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gdbus-example-unix-fd-client.c"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting></example>
3723 // <example id="gdbus-export"><title>Exporting a GObject</title><programlisting><xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gdbus-example-export.c"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting></example>
3724 struct DBusConnection /* : GObject.Object */ /* Version 2.26 */ {
3725 mixin AsyncInitable.__interface__;
3726 mixin Initable.__interface__;
3727 alias method_parent this;
3728 alias method_parent super_;
3729 alias method_parent object;
3730 GObject2.Object method_parent;
3733 // VERSION: 2.26
3734 // Finishes an operation started with g_dbus_connection_new().
3735 // RETURNS: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
3736 // <res>: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_new().
3737 static DBusConnection* /*new*/ new_finish(AT0, AT1)(AT0 /*AsyncResult*/ res, AT1 /*GLib2.Error**/ error=null) nothrow {
3738 return g_dbus_connection_new_finish(UpCast!(AsyncResult*)(res), UpCast!(GLib2.Error**)(error));
3740 static auto opCall(AT0, AT1)(AT0 /*AsyncResult*/ res, AT1 /*GLib2.Error**/ error=null) {
3741 return g_dbus_connection_new_finish(UpCast!(AsyncResult*)(res), UpCast!(GLib2.Error**)(error));
3744 // VERSION: 2.26
3745 // Finishes an operation started with g_dbus_connection_new_for_address().
3746 // RETURNS: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
3747 // <res>: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_new().
3748 static DBusConnection* /*new*/ new_for_address_finish(AT0, AT1)(AT0 /*AsyncResult*/ res, AT1 /*GLib2.Error**/ error=null) nothrow {
3749 return g_dbus_connection_new_for_address_finish(UpCast!(AsyncResult*)(res), UpCast!(GLib2.Error**)(error));
3751 static auto opCall(AT0, AT1)(AT0 /*AsyncResult*/ res, AT1 /*GLib2.Error**/ error=null) {
3752 return g_dbus_connection_new_for_address_finish(UpCast!(AsyncResult*)(res), UpCast!(GLib2.Error**)(error));
3755 // VERSION: 2.26
3756 // Synchronously connects and sets up a D-Bus client connection for
3757 // exchanging D-Bus messages with an endpoint specified by @address
3758 // which must be in the D-Bus address format.
3760 // This constructor can only be used to initiate client-side
3761 // connections - use g_dbus_connection_new_sync() if you need to act
3762 // as the server. In particular, @flags cannot contain the
3763 // %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER or
3764 // %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS flags.
3766 // This is a synchronous failable constructor. See
3767 // g_dbus_connection_new_for_address() for the asynchronous version.
3769 // If @observer is not %NULL it may be used to control the
3770 // authentication process.
3771 // RETURNS: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
3772 // <address>: A D-Bus address.
3773 // <flags>: Flags describing how to make the connection.
3774 // <observer>: A #GDBusAuthObserver or %NULL.
3775 // <cancellable>: A #GCancellable or %NULL.
3776 static DBusConnection* /*new*/ new_for_address_sync(AT0, AT1, AT2, AT3)(AT0 /*char*/ address, DBusConnectionFlags flags, AT1 /*DBusAuthObserver*/ observer, AT2 /*Cancellable*/ cancellable, AT3 /*GLib2.Error**/ error=null) nothrow {
3777 return g_dbus_connection_new_for_address_sync(toCString!(char*)(address), flags, UpCast!(DBusAuthObserver*)(observer), UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
3779 static auto opCall(AT0, AT1, AT2, AT3)(AT0 /*char*/ address, DBusConnectionFlags flags, AT1 /*DBusAuthObserver*/ observer, AT2 /*Cancellable*/ cancellable, AT3 /*GLib2.Error**/ error=null) {
3780 return g_dbus_connection_new_for_address_sync(toCString!(char*)(address), flags, UpCast!(DBusAuthObserver*)(observer), UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
3783 // VERSION: 2.26
3784 // Synchronously sets up a D-Bus connection for exchanging D-Bus messages
3785 // with the end represented by @stream.
3787 // If @stream is a #GSocketConnection, then the corresponding #GSocket
3788 // will be put into non-blocking mode.
3790 // The D-Bus connection will interact with @stream from a worker thread.
3791 // As a result, the caller should not interact with @stream after this
3792 // method has been called, except by calling g_object_unref() on it.
3794 // If @observer is not %NULL it may be used to control the
3795 // authentication process.
3797 // This is a synchronous failable constructor. See
3798 // g_dbus_connection_new() for the asynchronous version.
3799 // RETURNS: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
3800 // <stream>: A #GIOStream.
3801 // <guid>: The GUID to use if a authenticating as a server or %NULL.
3802 // <flags>: Flags describing how to make the connection.
3803 // <observer>: A #GDBusAuthObserver or %NULL.
3804 // <cancellable>: A #GCancellable or %NULL.
3805 static DBusConnection* /*new*/ new_sync(AT0, AT1, AT2, AT3, AT4)(AT0 /*IOStream*/ stream, AT1 /*char*/ guid, DBusConnectionFlags flags, AT2 /*DBusAuthObserver*/ observer, AT3 /*Cancellable*/ cancellable, AT4 /*GLib2.Error**/ error=null) nothrow {
3806 return g_dbus_connection_new_sync(UpCast!(IOStream*)(stream), toCString!(char*)(guid), flags, UpCast!(DBusAuthObserver*)(observer), UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
3808 static auto opCall(AT0, AT1, AT2, AT3, AT4)(AT0 /*IOStream*/ stream, AT1 /*char*/ guid, DBusConnectionFlags flags, AT2 /*DBusAuthObserver*/ observer, AT3 /*Cancellable*/ cancellable, AT4 /*GLib2.Error**/ error=null) {
3809 return g_dbus_connection_new_sync(UpCast!(IOStream*)(stream), toCString!(char*)(guid), flags, UpCast!(DBusAuthObserver*)(observer), UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
3812 // VERSION: 2.26
3813 // Asynchronously sets up a D-Bus connection for exchanging D-Bus messages
3814 // with the end represented by @stream.
3816 // If @stream is a #GSocketConnection, then the corresponding #GSocket
3817 // will be put into non-blocking mode.
3819 // The D-Bus connection will interact with @stream from a worker thread.
3820 // As a result, the caller should not interact with @stream after this
3821 // method has been called, except by calling g_object_unref() on it.
3823 // If @observer is not %NULL it may be used to control the
3824 // authentication process.
3826 // When the operation is finished, @callback will be invoked. You can
3827 // then call g_dbus_connection_new_finish() to get the result of the
3828 // operation.
3830 // This is a asynchronous failable constructor. See
3831 // g_dbus_connection_new_sync() for the synchronous
3832 // version.
3833 // <stream>: A #GIOStream.
3834 // <guid>: The GUID to use if a authenticating as a server or %NULL.
3835 // <flags>: Flags describing how to make the connection.
3836 // <observer>: A #GDBusAuthObserver or %NULL.
3837 // <cancellable>: A #GCancellable or %NULL.
3838 // <callback>: A #GAsyncReadyCallback to call when the request is satisfied.
3839 // <user_data>: The data to pass to @callback.
3840 static void new_(AT0, AT1, AT2, AT3, AT4)(AT0 /*IOStream*/ stream, AT1 /*char*/ guid, DBusConnectionFlags flags, AT2 /*DBusAuthObserver*/ observer, AT3 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT4 /*void*/ user_data) nothrow {
3841 g_dbus_connection_new(UpCast!(IOStream*)(stream), toCString!(char*)(guid), flags, UpCast!(DBusAuthObserver*)(observer), UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
3844 // VERSION: 2.26
3845 // Asynchronously connects and sets up a D-Bus client connection for
3846 // exchanging D-Bus messages with an endpoint specified by @address
3847 // which must be in the D-Bus address format.
3849 // This constructor can only be used to initiate client-side
3850 // connections - use g_dbus_connection_new() if you need to act as the
3851 // server. In particular, @flags cannot contain the
3852 // %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER or
3853 // %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS flags.
3855 // When the operation is finished, @callback will be invoked. You can
3856 // then call g_dbus_connection_new_finish() to get the result of the
3857 // operation.
3859 // If @observer is not %NULL it may be used to control the
3860 // authentication process.
3862 // This is a asynchronous failable constructor. See
3863 // g_dbus_connection_new_for_address_sync() for the synchronous
3864 // version.
3865 // <address>: A D-Bus address.
3866 // <flags>: Flags describing how to make the connection.
3867 // <observer>: A #GDBusAuthObserver or %NULL.
3868 // <cancellable>: A #GCancellable or %NULL.
3869 // <callback>: A #GAsyncReadyCallback to call when the request is satisfied.
3870 // <user_data>: The data to pass to @callback.
3871 static void new_for_address(AT0, AT1, AT2, AT3)(AT0 /*char*/ address, DBusConnectionFlags flags, AT1 /*DBusAuthObserver*/ observer, AT2 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT3 /*void*/ user_data) nothrow {
3872 g_dbus_connection_new_for_address(toCString!(char*)(address), flags, UpCast!(DBusAuthObserver*)(observer), UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
3875 // VERSION: 2.26
3876 // Adds a message filter. Filters are handlers that are run on all
3877 // incoming and outgoing messages, prior to standard dispatch. Filters
3878 // are run in the order that they were added. The same handler can be
3879 // added as a filter more than once, in which case it will be run more
3880 // than once. Filters added during a filter callback won't be run on
3881 // the message being processed. Filter functions are allowed to modify
3882 // and even drop messages.
3884 // Note that filters are run in a dedicated message handling thread so
3885 // they can't block and, generally, can't do anything but signal a
3886 // worker thread. Also note that filters are rarely needed - use API
3887 // such as g_dbus_connection_send_message_with_reply(),
3888 // g_dbus_connection_signal_subscribe() or g_dbus_connection_call() instead.
3890 // If a filter consumes an incoming message the message is not
3891 // dispatched anywhere else - not even the standard dispatch machinery
3892 // (that API such as g_dbus_connection_signal_subscribe() and
3893 // g_dbus_connection_send_message_with_reply() relies on) will see the
3894 // message. Similary, if a filter consumes an outgoing message, the
3895 // message will not be sent to the other peer.
3897 // g_dbus_connection_remove_filter().
3898 // RETURNS: A filter identifier that can be used with
3899 // <filter_function>: A filter function.
3900 // <user_data>: User data to pass to @filter_function.
3901 // <user_data_free_func>: Function to free @user_data with when filter is removed or %NULL.
3902 uint add_filter(AT0)(DBusMessageFilterFunction filter_function, AT0 /*void*/ user_data, GLib2.DestroyNotify user_data_free_func) nothrow {
3903 return g_dbus_connection_add_filter(&this, filter_function, UpCast!(void*)(user_data), user_data_free_func);
3906 // VERSION: 2.26
3907 // Asynchronously invokes the @method_name method on the
3908 // @interface_name D-Bus interface on the remote object at
3909 // @object_path owned by @bus_name.
3911 // If @connection is closed then the operation will fail with
3912 // %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will
3913 // fail with %G_IO_ERROR_CANCELLED. If @parameters contains a value
3914 // not compatible with the D-Bus protocol, the operation fails with
3915 // %G_IO_ERROR_INVALID_ARGUMENT.
3917 // If @reply_type is non-%NULL then the reply will be checked for having this type and an
3918 // error will be raised if it does not match. Said another way, if you give a @reply_type
3919 // then any non-%NULL return value will be of this type.
3921 // If the @parameters #GVariant is floating, it is consumed. This allows
3922 // convenient 'inline' use of g_variant_new(), e.g.:
3923 // |[
3924 // g_dbus_connection_call (connection,
3925 // "org.freedesktop.StringThings",
3926 // "/org/freedesktop/StringThings",
3927 // "org.freedesktop.StringThings",
3928 // "TwoStrings",
3929 // g_variant_new ("(ss)",
3930 // "Thing One",
3931 // "Thing Two"),
3932 // NULL,
3933 // G_DBUS_CALL_FLAGS_NONE,
3934 // -1,
3935 // NULL,
3936 // (GAsyncReadyCallback) two_strings_done,
3937 // NULL);
3938 // ]|
3940 // This is an asynchronous method. When the operation is finished, @callback will be invoked
3941 // in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
3942 // of the thread you are calling this method from. You can then call
3943 // g_dbus_connection_call_finish() to get the result of the operation.
3944 // See g_dbus_connection_call_sync() for the synchronous version of this
3945 // function.
3947 // If @callback is %NULL then the D-Bus method call message will be sent with
3948 // the %G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED flag set.
3949 // <bus_name>: A unique or well-known bus name or %NULL if @connection is not a message bus connection.
3950 // <object_path>: Path of remote object.
3951 // <interface_name>: D-Bus interface to invoke method on.
3952 // <method_name>: The name of the method to invoke.
3953 // <parameters>: A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
3954 // <reply_type>: The expected type of the reply, or %NULL.
3955 // <flags>: Flags from the #GDBusCallFlags enumeration.
3956 // <timeout_msec>: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
3957 // <cancellable>: A #GCancellable or %NULL.
3958 // <callback>: A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result of the method invocation.
3959 // <user_data>: The data to pass to @callback.
3960 void call(AT0, AT1, AT2, AT3, AT4, AT5, AT6, AT7)(AT0 /*char*/ bus_name, AT1 /*char*/ object_path, AT2 /*char*/ interface_name, AT3 /*char*/ method_name, AT4 /*GLib2.Variant*/ parameters, AT5 /*GLib2.VariantType*/ reply_type, DBusCallFlags flags, int timeout_msec, AT6 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT7 /*void*/ user_data) nothrow {
3961 g_dbus_connection_call(&this, toCString!(char*)(bus_name), toCString!(char*)(object_path), toCString!(char*)(interface_name), toCString!(char*)(method_name), UpCast!(GLib2.Variant*)(parameters), UpCast!(GLib2.VariantType*)(reply_type), flags, timeout_msec, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
3964 // VERSION: 2.26
3965 // Finishes an operation started with g_dbus_connection_call().
3967 // return values. Free with g_variant_unref().
3968 // RETURNS: %NULL if @error is set. Otherwise a #GVariant tuple with
3969 // <res>: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_call().
3970 GLib2.Variant* /*new*/ call_finish(AT0, AT1)(AT0 /*AsyncResult*/ res, AT1 /*GLib2.Error**/ error=null) nothrow {
3971 return g_dbus_connection_call_finish(&this, UpCast!(AsyncResult*)(res), UpCast!(GLib2.Error**)(error));
3974 // VERSION: 2.26
3975 // Synchronously invokes the @method_name method on the
3976 // @interface_name D-Bus interface on the remote object at
3977 // @object_path owned by @bus_name.
3979 // If @connection is closed then the operation will fail with
3980 // %G_IO_ERROR_CLOSED. If @cancellable is canceled, the
3981 // operation will fail with %G_IO_ERROR_CANCELLED. If @parameters
3982 // contains a value not compatible with the D-Bus protocol, the operation
3983 // fails with %G_IO_ERROR_INVALID_ARGUMENT.
3984 // If @reply_type is non-%NULL then the reply will be checked for having
3985 // this type and an error will be raised if it does not match. Said
3986 // another way, if you give a @reply_type then any non-%NULL return
3987 // value will be of this type.
3989 // If the @parameters #GVariant is floating, it is consumed.
3990 // This allows convenient 'inline' use of g_variant_new(), e.g.:
3991 // |[
3992 // g_dbus_connection_call_sync (connection,
3993 // "org.freedesktop.StringThings",
3994 // "/org/freedesktop/StringThings",
3995 // "org.freedesktop.StringThings",
3996 // "TwoStrings",
3997 // g_variant_new ("(ss)",
3998 // "Thing One",
3999 // "Thing Two"),
4000 // NULL,
4001 // G_DBUS_CALL_FLAGS_NONE,
4002 // -1,
4003 // NULL,
4004 // &amp;error);
4005 // ]|
4007 // The calling thread is blocked until a reply is received. See
4008 // g_dbus_connection_call() for the asynchronous version of
4009 // this method.
4011 // return values. Free with g_variant_unref().
4012 // RETURNS: %NULL if @error is set. Otherwise a #GVariant tuple with
4013 // <bus_name>: A unique or well-known bus name.
4014 // <object_path>: Path of remote object.
4015 // <interface_name>: D-Bus interface to invoke method on.
4016 // <method_name>: The name of the method to invoke.
4017 // <parameters>: A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
4018 // <reply_type>: The expected type of the reply, or %NULL.
4019 // <flags>: Flags from the #GDBusCallFlags enumeration.
4020 // <timeout_msec>: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
4021 // <cancellable>: A #GCancellable or %NULL.
4022 GLib2.Variant* /*new*/ call_sync(AT0, AT1, AT2, AT3, AT4, AT5, AT6, AT7)(AT0 /*char*/ bus_name, AT1 /*char*/ object_path, AT2 /*char*/ interface_name, AT3 /*char*/ method_name, AT4 /*GLib2.Variant*/ parameters, AT5 /*GLib2.VariantType*/ reply_type, DBusCallFlags flags, int timeout_msec, AT6 /*Cancellable*/ cancellable, AT7 /*GLib2.Error**/ error=null) nothrow {
4023 return g_dbus_connection_call_sync(&this, toCString!(char*)(bus_name), toCString!(char*)(object_path), toCString!(char*)(interface_name), toCString!(char*)(method_name), UpCast!(GLib2.Variant*)(parameters), UpCast!(GLib2.VariantType*)(reply_type), flags, timeout_msec, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
4026 // VERSION: 2.30
4027 // Like g_dbus_connection_call() but also takes a #GUnixFDList object.
4029 // This method is only available on UNIX.
4030 // <bus_name>: A unique or well-known bus name or %NULL if @connection is not a message bus connection.
4031 // <object_path>: Path of remote object.
4032 // <interface_name>: D-Bus interface to invoke method on.
4033 // <method_name>: The name of the method to invoke.
4034 // <parameters>: A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
4035 // <reply_type>: The expected type of the reply, or %NULL.
4036 // <flags>: Flags from the #GDBusCallFlags enumeration.
4037 // <timeout_msec>: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
4038 // <fd_list>: A #GUnixFDList or %NULL.
4039 // <cancellable>: A #GCancellable or %NULL.
4040 // <callback>: A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't * care about the result of the method invocation.
4041 // <user_data>: The data to pass to @callback.
4042 void call_with_unix_fd_list(AT0, AT1, AT2, AT3, AT4, AT5, AT6, AT7, AT8)(AT0 /*char*/ bus_name, AT1 /*char*/ object_path, AT2 /*char*/ interface_name, AT3 /*char*/ method_name, AT4 /*GLib2.Variant*/ parameters, AT5 /*GLib2.VariantType*/ reply_type, DBusCallFlags flags, int timeout_msec, AT6 /*UnixFDList*/ fd_list, AT7 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT8 /*void*/ user_data) nothrow {
4043 g_dbus_connection_call_with_unix_fd_list(&this, toCString!(char*)(bus_name), toCString!(char*)(object_path), toCString!(char*)(interface_name), toCString!(char*)(method_name), UpCast!(GLib2.Variant*)(parameters), UpCast!(GLib2.VariantType*)(reply_type), flags, timeout_msec, UpCast!(UnixFDList*)(fd_list), UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
4046 // VERSION: 2.30
4047 // Finishes an operation started with g_dbus_connection_call_with_unix_fd_list().
4049 // return values. Free with g_variant_unref().
4050 // RETURNS: %NULL if @error is set. Otherwise a #GVariant tuple with
4051 // <out_fd_list>: Return location for a #GUnixFDList or %NULL.
4052 // <res>: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_call_with_unix_fd_list().
4053 GLib2.Variant* /*new*/ call_with_unix_fd_list_finish(AT0, AT1, AT2)(/*out*/ AT0 /*UnixFDList**/ out_fd_list, AT1 /*AsyncResult*/ res, AT2 /*GLib2.Error**/ error=null) nothrow {
4054 return g_dbus_connection_call_with_unix_fd_list_finish(&this, UpCast!(UnixFDList**)(out_fd_list), UpCast!(AsyncResult*)(res), UpCast!(GLib2.Error**)(error));
4057 // VERSION: 2.30
4058 // Like g_dbus_connection_call_sync() but also takes and returns #GUnixFDList objects.
4060 // This method is only available on UNIX.
4062 // return values. Free with g_variant_unref().
4063 // RETURNS: %NULL if @error is set. Otherwise a #GVariant tuple with
4064 // <bus_name>: A unique or well-known bus name.
4065 // <object_path>: Path of remote object.
4066 // <interface_name>: D-Bus interface to invoke method on.
4067 // <method_name>: The name of the method to invoke.
4068 // <parameters>: A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
4069 // <reply_type>: The expected type of the reply, or %NULL.
4070 // <flags>: Flags from the #GDBusCallFlags enumeration.
4071 // <timeout_msec>: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
4072 // <fd_list>: A #GUnixFDList or %NULL.
4073 // <out_fd_list>: Return location for a #GUnixFDList or %NULL.
4074 // <cancellable>: A #GCancellable or %NULL.
4075 GLib2.Variant* /*new*/ call_with_unix_fd_list_sync(AT0, AT1, AT2, AT3, AT4, AT5, AT6, AT7, AT8, AT9)(AT0 /*char*/ bus_name, AT1 /*char*/ object_path, AT2 /*char*/ interface_name, AT3 /*char*/ method_name, AT4 /*GLib2.Variant*/ parameters, AT5 /*GLib2.VariantType*/ reply_type, DBusCallFlags flags, int timeout_msec, AT6 /*UnixFDList*/ fd_list, /*out*/ AT7 /*UnixFDList**/ out_fd_list, AT8 /*Cancellable*/ cancellable, AT9 /*GLib2.Error**/ error=null) nothrow {
4076 return g_dbus_connection_call_with_unix_fd_list_sync(&this, toCString!(char*)(bus_name), toCString!(char*)(object_path), toCString!(char*)(interface_name), toCString!(char*)(method_name), UpCast!(GLib2.Variant*)(parameters), UpCast!(GLib2.VariantType*)(reply_type), flags, timeout_msec, UpCast!(UnixFDList*)(fd_list), UpCast!(UnixFDList**)(out_fd_list), UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
4079 // VERSION: 2.26
4080 // Closes @connection. Note that this never causes the process to
4081 // exit (this might only happen if the other end of a shared message
4082 // bus connection disconnects, see #GDBusConnection:exit-on-close).
4084 // Once the connection is closed, operations such as sending a message
4085 // will return with the error %G_IO_ERROR_CLOSED. Closing a connection
4086 // will not automatically flush the connection so queued messages may
4087 // be lost. Use g_dbus_connection_flush() if you need such guarantees.
4089 // If @connection is already closed, this method fails with
4090 // %G_IO_ERROR_CLOSED.
4092 // When @connection has been closed, the #GDBusConnection::closed
4093 // signal is emitted in the <link
4094 // linkend="g-main-context-push-thread-default">thread-default main
4095 // loop</link> of the thread that @connection was constructed in.
4097 // This is an asynchronous method. When the operation is finished,
4098 // @callback will be invoked in the <link
4099 // linkend="g-main-context-push-thread-default">thread-default main
4100 // loop</link> of the thread you are calling this method from. You can
4101 // then call g_dbus_connection_close_finish() to get the result of the
4102 // operation. See g_dbus_connection_close_sync() for the synchronous
4103 // version.
4104 // <cancellable>: A #GCancellable or %NULL.
4105 // <callback>: A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result.
4106 // <user_data>: The data to pass to @callback.
4107 void close(AT0, AT1)(AT0 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT1 /*void*/ user_data) nothrow {
4108 g_dbus_connection_close(&this, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
4111 // VERSION: 2.26
4112 // Finishes an operation started with g_dbus_connection_close().
4113 // RETURNS: %TRUE if the operation succeeded, %FALSE if @error is set.
4114 // <res>: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_close().
4115 int close_finish(AT0, AT1)(AT0 /*AsyncResult*/ res, AT1 /*GLib2.Error**/ error=null) nothrow {
4116 return g_dbus_connection_close_finish(&this, UpCast!(AsyncResult*)(res), UpCast!(GLib2.Error**)(error));
4119 // VERSION: 2.26
4120 // Synchronously closees @connection. The calling thread is blocked
4121 // until this is done. See g_dbus_connection_close() for the
4122 // asynchronous version of this method and more details about what it
4123 // does.
4124 // RETURNS: %TRUE if the operation succeeded, %FALSE if @error is set.
4125 // <cancellable>: A #GCancellable or %NULL.
4126 int close_sync(AT0, AT1)(AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
4127 return g_dbus_connection_close_sync(&this, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
4130 // VERSION: 2.26
4131 // Emits a signal.
4133 // If the parameters GVariant is floating, it is consumed.
4135 // This can only fail if @parameters is not compatible with the D-Bus protocol.
4136 // RETURNS: %TRUE unless @error is set.
4137 // <destination_bus_name>: The unique bus name for the destination for the signal or %NULL to emit to all listeners.
4138 // <object_path>: Path of remote object.
4139 // <interface_name>: D-Bus interface to emit a signal on.
4140 // <signal_name>: The name of the signal to emit.
4141 // <parameters>: A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
4142 int emit_signal(AT0, AT1, AT2, AT3, AT4, AT5)(AT0 /*char*/ destination_bus_name, AT1 /*char*/ object_path, AT2 /*char*/ interface_name, AT3 /*char*/ signal_name, AT4 /*GLib2.Variant*/ parameters, AT5 /*GLib2.Error**/ error=null) nothrow {
4143 return g_dbus_connection_emit_signal(&this, toCString!(char*)(destination_bus_name), toCString!(char*)(object_path), toCString!(char*)(interface_name), toCString!(char*)(signal_name), UpCast!(GLib2.Variant*)(parameters), UpCast!(GLib2.Error**)(error));
4146 // VERSION: 2.32
4147 // Exports @action_group on @connection at @object_path.
4149 // The implemented D-Bus API should be considered private. It is
4150 // subject to change in the future.
4152 // A given object path can only have one action group exported on it.
4153 // If this constraint is violated, the export will fail and 0 will be
4154 // returned (with @error set accordingly).
4156 // You can unexport the action group using
4157 // g_dbus_connection_unexport_action_group() with the return value of
4158 // this function.
4160 // The thread default main context is taken at the time of this call.
4161 // All incoming action activations and state change requests are
4162 // reported from this context. Any changes on the action group that
4163 // cause it to emit signals must also come from this same context.
4164 // Since incoming action activations and state change requests are
4165 // rather likely to cause changes on the action group, this effectively
4166 // limits a given action group to being exported from only one main
4167 // context.
4168 // RETURNS: the ID of the export (never zero), or 0 in case of failure
4169 // <object_path>: a D-Bus object path
4170 // <action_group>: a #GActionGroup
4171 uint export_action_group(AT0, AT1, AT2)(AT0 /*char*/ object_path, AT1 /*ActionGroup*/ action_group, AT2 /*GLib2.Error**/ error=null) nothrow {
4172 return g_dbus_connection_export_action_group(&this, toCString!(char*)(object_path), UpCast!(ActionGroup*)(action_group), UpCast!(GLib2.Error**)(error));
4175 // VERSION: 2.32
4176 // Exports @menu on @connection at @object_path.
4178 // The implemented D-Bus API should be considered private.
4179 // It is subject to change in the future.
4181 // An object path can only have one action group exported on it. If this
4182 // constraint is violated, the export will fail and 0 will be
4183 // returned (with @error set accordingly).
4185 // You can unexport the menu model using
4186 // g_dbus_connection_unexport_menu_model() with the return value of
4187 // this function.
4188 // RETURNS: the ID of the export (never zero), or 0 in case of failure
4189 // <object_path>: a D-Bus object path
4190 // <menu>: a #GMenuModel
4191 uint export_menu_model(AT0, AT1, AT2)(AT0 /*char*/ object_path, AT1 /*MenuModel*/ menu, AT2 /*GLib2.Error**/ error=null) nothrow {
4192 return g_dbus_connection_export_menu_model(&this, toCString!(char*)(object_path), UpCast!(MenuModel*)(menu), UpCast!(GLib2.Error**)(error));
4195 // VERSION: 2.26
4196 // Asynchronously flushes @connection, that is, writes all queued
4197 // outgoing message to the transport and then flushes the transport
4198 // (using g_output_stream_flush_async()). This is useful in programs
4199 // that wants to emit a D-Bus signal and then exit
4200 // immediately. Without flushing the connection, there is no guarantee
4201 // that the message has been sent to the networking buffers in the OS
4202 // kernel.
4204 // This is an asynchronous method. When the operation is finished,
4205 // @callback will be invoked in the <link
4206 // linkend="g-main-context-push-thread-default">thread-default main
4207 // loop</link> of the thread you are calling this method from. You can
4208 // then call g_dbus_connection_flush_finish() to get the result of the
4209 // operation. See g_dbus_connection_flush_sync() for the synchronous
4210 // version.
4211 // <cancellable>: A #GCancellable or %NULL.
4212 // <callback>: A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result.
4213 // <user_data>: The data to pass to @callback.
4214 void flush(AT0, AT1)(AT0 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT1 /*void*/ user_data) nothrow {
4215 g_dbus_connection_flush(&this, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
4218 // VERSION: 2.26
4219 // Finishes an operation started with g_dbus_connection_flush().
4220 // RETURNS: %TRUE if the operation succeeded, %FALSE if @error is set.
4221 // <res>: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_flush().
4222 int flush_finish(AT0, AT1)(AT0 /*AsyncResult*/ res, AT1 /*GLib2.Error**/ error=null) nothrow {
4223 return g_dbus_connection_flush_finish(&this, UpCast!(AsyncResult*)(res), UpCast!(GLib2.Error**)(error));
4226 // VERSION: 2.26
4227 // Synchronously flushes @connection. The calling thread is blocked
4228 // until this is done. See g_dbus_connection_flush() for the
4229 // asynchronous version of this method and more details about what it
4230 // does.
4231 // RETURNS: %TRUE if the operation succeeded, %FALSE if @error is set.
4232 // <cancellable>: A #GCancellable or %NULL.
4233 int flush_sync(AT0, AT1)(AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
4234 return g_dbus_connection_flush_sync(&this, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
4237 // VERSION: 2.26
4238 // Gets the capabilities negotiated with the remote peer
4239 // RETURNS: Zero or more flags from the #GDBusCapabilityFlags enumeration.
4240 DBusCapabilityFlags get_capabilities()() nothrow {
4241 return g_dbus_connection_get_capabilities(&this);
4244 // VERSION: 2.26
4245 // Gets whether the process is terminated when @connection is
4246 // closed by the remote peer. See
4247 // #GDBusConnection:exit-on-close for more details.
4249 // closed by the remote peer.
4250 // RETURNS: Whether the process is terminated when @connection is
4251 int get_exit_on_close()() nothrow {
4252 return g_dbus_connection_get_exit_on_close(&this);
4255 // VERSION: 2.26
4256 // The GUID of the peer performing the role of server when
4257 // authenticating. See #GDBusConnection:guid for more details.
4259 // @connection.
4260 // RETURNS: The GUID. Do not free this string, it is owned by
4261 char* get_guid()() nothrow {
4262 return g_dbus_connection_get_guid(&this);
4265 // VERSION: 2.26
4266 // Gets the credentials of the authenticated peer. This will always
4267 // return %NULL unless @connection acted as a server
4268 // (e.g. %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER was passed)
4269 // when set up and the client passed credentials as part of the
4270 // authentication process.
4272 // In a message bus setup, the message bus is always the server and
4273 // each application is a client. So this method will always return
4274 // %NULL for message bus clients.
4276 // this object, it is owned by @connection.
4277 // RETURNS: A #GCredentials or %NULL if not available. Do not free
4278 Credentials* get_peer_credentials()() nothrow {
4279 return g_dbus_connection_get_peer_credentials(&this);
4282 // VERSION: 2.26
4283 // Gets the underlying stream used for IO.
4285 // While the #GDBusConnection is active, it will interact with this
4286 // stream from a worker thread, so it is not safe to interact with
4287 // the stream directly.
4288 // RETURNS: the stream used for IO
4289 IOStream* get_stream()() nothrow {
4290 return g_dbus_connection_get_stream(&this);
4293 // VERSION: 2.26
4294 // Gets the unique name of @connection as assigned by the message
4295 // bus. This can also be used to figure out if @connection is a
4296 // message bus connection.
4298 // bus connection. Do not free this string, it is owned by
4299 // @connection.
4300 // RETURNS: The unique name or %NULL if @connection is not a message
4301 char* get_unique_name()() nothrow {
4302 return g_dbus_connection_get_unique_name(&this);
4305 // VERSION: 2.26
4306 // Gets whether @connection is closed.
4307 // RETURNS: %TRUE if the connection is closed, %FALSE otherwise.
4308 int is_closed()() nothrow {
4309 return g_dbus_connection_is_closed(&this);
4312 // VERSION: 2.26
4313 // Registers callbacks for exported objects at @object_path with the
4314 // D-Bus interface that is described in @interface_info.
4316 // Calls to functions in @vtable (and @user_data_free_func) will
4317 // happen in the <link linkend="g-main-context-push-thread-default">thread-default main
4318 // loop</link> of the thread you are calling this method from.
4320 // Note that all #GVariant values passed to functions in @vtable will match
4321 // the signature given in @interface_info - if a remote caller passes
4322 // incorrect values, the <literal>org.freedesktop.DBus.Error.InvalidArgs</literal>
4323 // is returned to the remote caller.
4325 // Additionally, if the remote caller attempts to invoke methods or
4326 // access properties not mentioned in @interface_info the
4327 // <literal>org.freedesktop.DBus.Error.UnknownMethod</literal> resp.
4328 // <literal>org.freedesktop.DBus.Error.InvalidArgs</literal> errors
4329 // are returned to the caller.
4331 // It is considered a programming error if the
4332 // #GDBusInterfaceGetPropertyFunc function in @vtable returns a
4333 // #GVariant of incorrect type.
4335 // If an existing callback is already registered at @object_path and
4336 // @interface_name, then @error is set to #G_IO_ERROR_EXISTS.
4338 // GDBus automatically implements the standard D-Bus interfaces
4339 // org.freedesktop.DBus.Properties, org.freedesktop.DBus.Introspectable
4340 // and org.freedesktop.Peer, so you don't have to implement those for
4341 // the objects you export. You <emphasis>can</emphasis> implement
4342 // org.freedesktop.DBus.Properties yourself, e.g. to handle getting
4343 // and setting of properties asynchronously.
4345 // Note that the reference count on @interface_info will be
4346 // incremented by 1 (unless allocated statically, e.g. if the
4347 // reference count is -1, see g_dbus_interface_info_ref()) for as long
4348 // as the object is exported. Also note that @vtable will be copied.
4350 // See <xref linkend="gdbus-server"/> for an example of how to use this method.
4352 // that can be used with g_dbus_connection_unregister_object() .
4353 // RETURNS: 0 if @error is set, otherwise a registration id (never 0)
4354 // <object_path>: The object path to register at.
4355 // <interface_info>: Introspection data for the interface.
4356 // <vtable>: A #GDBusInterfaceVTable to call into or %NULL.
4357 // <user_data>: Data to pass to functions in @vtable.
4358 // <user_data_free_func>: Function to call when the object path is unregistered.
4359 uint register_object(AT0, AT1, AT2, AT3, AT4)(AT0 /*char*/ object_path, AT1 /*DBusInterfaceInfo*/ interface_info, AT2 /*DBusInterfaceVTable*/ vtable, AT3 /*void*/ user_data, GLib2.DestroyNotify user_data_free_func, AT4 /*GLib2.Error**/ error=null) nothrow {
4360 return g_dbus_connection_register_object(&this, toCString!(char*)(object_path), UpCast!(DBusInterfaceInfo*)(interface_info), UpCast!(DBusInterfaceVTable*)(vtable), UpCast!(void*)(user_data), user_data_free_func, UpCast!(GLib2.Error**)(error));
4363 // VERSION: 2.26
4364 // Registers a whole subtree of <quote>dynamic</quote> objects.
4366 // The @enumerate and @introspection functions in @vtable are used to
4367 // convey, to remote callers, what nodes exist in the subtree rooted
4368 // by @object_path.
4370 // When handling remote calls into any node in the subtree, first the
4371 // @enumerate function is used to check if the node exists. If the node exists
4372 // or the #G_DBUS_SUBTREE_FLAGS_DISPATCH_TO_UNENUMERATED_NODES flag is set
4373 // the @introspection function is used to check if the node supports the
4374 // requested method. If so, the @dispatch function is used to determine
4375 // where to dispatch the call. The collected #GDBusInterfaceVTable and
4376 // #gpointer will be used to call into the interface vtable for processing
4377 // the request.
4379 // All calls into user-provided code will be invoked in the <link
4380 // linkend="g-main-context-push-thread-default">thread-default main
4381 // loop</link> of the thread you are calling this method from.
4383 // If an existing subtree is already registered at @object_path or
4384 // then @error is set to #G_IO_ERROR_EXISTS.
4386 // Note that it is valid to register regular objects (using
4387 // g_dbus_connection_register_object()) in a subtree registered with
4388 // g_dbus_connection_register_subtree() - if so, the subtree handler
4389 // is tried as the last resort. One way to think about a subtree
4390 // handler is to consider it a <quote>fallback handler</quote>
4391 // for object paths not registered via g_dbus_connection_register_object()
4392 // or other bindings.
4394 // Note that @vtable will be copied so you cannot change it after
4395 // registration.
4397 // See <xref linkend="gdbus-subtree-server"/> for an example of how to use this method.
4399 // that can be used with g_dbus_connection_unregister_subtree() .
4400 // RETURNS: 0 if @error is set, otherwise a subtree registration id (never 0)
4401 // <object_path>: The object path to register the subtree at.
4402 // <vtable>: A #GDBusSubtreeVTable to enumerate, introspect and dispatch nodes in the subtree.
4403 // <flags>: Flags used to fine tune the behavior of the subtree.
4404 // <user_data>: Data to pass to functions in @vtable.
4405 // <user_data_free_func>: Function to call when the subtree is unregistered.
4406 uint register_subtree(AT0, AT1, AT2, AT3)(AT0 /*char*/ object_path, AT1 /*DBusSubtreeVTable*/ vtable, DBusSubtreeFlags flags, AT2 /*void*/ user_data, GLib2.DestroyNotify user_data_free_func, AT3 /*GLib2.Error**/ error=null) nothrow {
4407 return g_dbus_connection_register_subtree(&this, toCString!(char*)(object_path), UpCast!(DBusSubtreeVTable*)(vtable), flags, UpCast!(void*)(user_data), user_data_free_func, UpCast!(GLib2.Error**)(error));
4410 // VERSION: 2.26
4411 // Removes a filter.
4412 // <filter_id>: an identifier obtained from g_dbus_connection_add_filter()
4413 void remove_filter()(uint filter_id) nothrow {
4414 g_dbus_connection_remove_filter(&this, filter_id);
4417 // VERSION: 2.26
4418 // Asynchronously sends @message to the peer represented by @connection.
4420 // Unless @flags contain the
4421 // %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number
4422 // will be assigned by @connection and set on @message via
4423 // g_dbus_message_set_serial(). If @out_serial is not %NULL, then the
4424 // serial number used will be written to this location prior to
4425 // submitting the message to the underlying transport.
4427 // If @connection is closed then the operation will fail with
4428 // %G_IO_ERROR_CLOSED. If @message is not well-formed,
4429 // the operation fails with %G_IO_ERROR_INVALID_ARGUMENT.
4431 // See <xref linkend="gdbus-server"/> and <xref
4432 // linkend="gdbus-unix-fd-client"/> for an example of how to use this
4433 // low-level API to send and receive UNIX file descriptors.
4435 // Note that @message must be unlocked, unless @flags contain the
4436 // %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
4438 // transmission, %FALSE if @error is set.
4439 // RETURNS: %TRUE if the message was well-formed and queued for
4440 // <message>: A #GDBusMessage
4441 // <flags>: Flags affecting how the message is sent.
4442 // <out_serial>: Return location for serial number assigned to @message when sending it or %NULL.
4443 int send_message(AT0, AT1, AT2)(AT0 /*DBusMessage*/ message, DBusSendMessageFlags flags, /*out*/ AT1 /*uint*/ out_serial, AT2 /*GLib2.Error**/ error=null) nothrow {
4444 return g_dbus_connection_send_message(&this, UpCast!(DBusMessage*)(message), flags, UpCast!(uint*)(out_serial), UpCast!(GLib2.Error**)(error));
4447 // VERSION: 2.26
4448 // Asynchronously sends @message to the peer represented by @connection.
4450 // Unless @flags contain the
4451 // %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number
4452 // will be assigned by @connection and set on @message via
4453 // g_dbus_message_set_serial(). If @out_serial is not %NULL, then the
4454 // serial number used will be written to this location prior to
4455 // submitting the message to the underlying transport.
4457 // If @connection is closed then the operation will fail with
4458 // %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will
4459 // fail with %G_IO_ERROR_CANCELLED. If @message is not well-formed,
4460 // the operation fails with %G_IO_ERROR_INVALID_ARGUMENT.
4462 // This is an asynchronous method. When the operation is finished, @callback will be invoked
4463 // in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
4464 // of the thread you are calling this method from. You can then call
4465 // g_dbus_connection_send_message_with_reply_finish() to get the result of the operation.
4466 // See g_dbus_connection_send_message_with_reply_sync() for the synchronous version.
4468 // Note that @message must be unlocked, unless @flags contain the
4469 // %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
4471 // See <xref linkend="gdbus-server"/> and <xref
4472 // linkend="gdbus-unix-fd-client"/> for an example of how to use this
4473 // low-level API to send and receive UNIX file descriptors.
4474 // <message>: A #GDBusMessage.
4475 // <flags>: Flags affecting how the message is sent.
4476 // <timeout_msec>: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
4477 // <out_serial>: Return location for serial number assigned to @message when sending it or %NULL.
4478 // <cancellable>: A #GCancellable or %NULL.
4479 // <callback>: A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result.
4480 // <user_data>: The data to pass to @callback.
4481 void send_message_with_reply(AT0, AT1, AT2, AT3)(AT0 /*DBusMessage*/ message, DBusSendMessageFlags flags, int timeout_msec, /*out*/ AT1 /*uint*/ out_serial, AT2 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT3 /*void*/ user_data) nothrow {
4482 g_dbus_connection_send_message_with_reply(&this, UpCast!(DBusMessage*)(message), flags, timeout_msec, UpCast!(uint*)(out_serial), UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
4485 // VERSION: 2.26
4486 // Finishes an operation started with g_dbus_connection_send_message_with_reply().
4488 // Note that @error is only set if a local in-process error
4489 // occurred. That is to say that the returned #GDBusMessage object may
4490 // be of type %G_DBUS_MESSAGE_TYPE_ERROR. Use
4491 // g_dbus_message_to_gerror() to transcode this to a #GError.
4493 // See <xref linkend="gdbus-server"/> and <xref
4494 // linkend="gdbus-unix-fd-client"/> for an example of how to use this
4495 // low-level API to send and receive UNIX file descriptors.
4496 // RETURNS: A locked #GDBusMessage or %NULL if @error is set.
4497 // <res>: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_send_message_with_reply().
4498 DBusMessage* /*new*/ send_message_with_reply_finish(AT0, AT1)(AT0 /*AsyncResult*/ res, AT1 /*GLib2.Error**/ error=null) nothrow {
4499 return g_dbus_connection_send_message_with_reply_finish(&this, UpCast!(AsyncResult*)(res), UpCast!(GLib2.Error**)(error));
4502 // VERSION: 2.26
4503 // Synchronously sends @message to the peer represented by @connection
4504 // and blocks the calling thread until a reply is received or the
4505 // timeout is reached. See g_dbus_connection_send_message_with_reply()
4506 // for the asynchronous version of this method.
4508 // Unless @flags contain the
4509 // %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number
4510 // will be assigned by @connection and set on @message via
4511 // g_dbus_message_set_serial(). If @out_serial is not %NULL, then the
4512 // serial number used will be written to this location prior to
4513 // submitting the message to the underlying transport.
4515 // If @connection is closed then the operation will fail with
4516 // %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will
4517 // fail with %G_IO_ERROR_CANCELLED. If @message is not well-formed,
4518 // the operation fails with %G_IO_ERROR_INVALID_ARGUMENT.
4520 // Note that @error is only set if a local in-process error
4521 // occurred. That is to say that the returned #GDBusMessage object may
4522 // be of type %G_DBUS_MESSAGE_TYPE_ERROR. Use
4523 // g_dbus_message_to_gerror() to transcode this to a #GError.
4525 // See <xref linkend="gdbus-server"/> and <xref
4526 // linkend="gdbus-unix-fd-client"/> for an example of how to use this
4527 // low-level API to send and receive UNIX file descriptors.
4529 // Note that @message must be unlocked, unless @flags contain the
4530 // %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
4531 // RETURNS: A locked #GDBusMessage that is the reply to @message or %NULL if @error is set.
4532 // <message>: A #GDBusMessage.
4533 // <flags>: Flags affecting how the message is sent.
4534 // <timeout_msec>: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
4535 // <out_serial>: Return location for serial number assigned to @message when sending it or %NULL.
4536 // <cancellable>: A #GCancellable or %NULL.
4537 DBusMessage* /*new*/ send_message_with_reply_sync(AT0, AT1, AT2, AT3)(AT0 /*DBusMessage*/ message, DBusSendMessageFlags flags, int timeout_msec, /*out*/ AT1 /*uint*/ out_serial, AT2 /*Cancellable*/ cancellable, AT3 /*GLib2.Error**/ error=null) nothrow {
4538 return g_dbus_connection_send_message_with_reply_sync(&this, UpCast!(DBusMessage*)(message), flags, timeout_msec, UpCast!(uint*)(out_serial), UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
4541 // VERSION: 2.26
4542 // Sets whether the process should be terminated when @connection is
4543 // closed by the remote peer. See #GDBusConnection:exit-on-close for
4544 // more details.
4546 // Note that this function should be used with care. Most modern UNIX
4547 // desktops tie the notion of a user session the session bus, and expect
4548 // all of a users applications to quit when their bus connection goes away.
4549 // If you are setting @exit_on_close to %FALSE for the shared session
4550 // bus connection, you should make sure that your application exits
4551 // when the user session ends.
4552 // <exit_on_close>: Whether the process should be terminated when @connection is closed by the remote peer.
4553 void set_exit_on_close()(int exit_on_close) nothrow {
4554 g_dbus_connection_set_exit_on_close(&this, exit_on_close);
4557 // VERSION: 2.26
4558 // Subscribes to signals on @connection and invokes @callback with a
4559 // whenever the signal is received. Note that @callback
4560 // will be invoked in the <link
4561 // linkend="g-main-context-push-thread-default">thread-default main
4562 // loop</link> of the thread you are calling this method from.
4564 // If @connection is not a message bus connection, @sender must be
4565 // %NULL.
4567 // If @sender is a well-known name note that @callback is invoked with
4568 // the unique name for the owner of @sender, not the well-known name
4569 // as one would expect. This is because the message bus rewrites the
4570 // name. As such, to avoid certain race conditions, users should be
4571 // tracking the name owner of the well-known name and use that when
4572 // processing the received signal.
4573 // RETURNS: A subscription identifier that can be used with g_dbus_connection_signal_unsubscribe().
4574 // <sender>: Sender name to match on (unique or well-known name) or %NULL to listen from all senders.
4575 // <interface_name>: D-Bus interface name to match on or %NULL to match on all interfaces.
4576 // <member>: D-Bus signal name to match on or %NULL to match on all signals.
4577 // <object_path>: Object path to match on or %NULL to match on all object paths.
4578 // <arg0>: Contents of first string argument to match on or %NULL to match on all kinds of arguments.
4579 // <flags>: Flags describing how to subscribe to the signal (currently unused).
4580 // <callback>: Callback to invoke when there is a signal matching the requested data.
4581 // <user_data>: User data to pass to @callback.
4582 // <user_data_free_func>: Function to free @user_data with when subscription is removed or %NULL.
4583 uint signal_subscribe(AT0, AT1, AT2, AT3, AT4, AT5)(AT0 /*char*/ sender, AT1 /*char*/ interface_name, AT2 /*char*/ member, AT3 /*char*/ object_path, AT4 /*char*/ arg0, DBusSignalFlags flags, DBusSignalCallback callback, AT5 /*void*/ user_data, GLib2.DestroyNotify user_data_free_func=null) nothrow {
4584 return g_dbus_connection_signal_subscribe(&this, toCString!(char*)(sender), toCString!(char*)(interface_name), toCString!(char*)(member), toCString!(char*)(object_path), toCString!(char*)(arg0), flags, callback, UpCast!(void*)(user_data), user_data_free_func);
4587 // VERSION: 2.26
4588 // Unsubscribes from signals.
4589 // <subscription_id>: A subscription id obtained from g_dbus_connection_signal_subscribe().
4590 void signal_unsubscribe()(uint subscription_id) nothrow {
4591 g_dbus_connection_signal_unsubscribe(&this, subscription_id);
4594 // VERSION: 2.26
4595 // If @connection was created with
4596 // %G_DBUS_CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING, this method
4597 // starts processing messages. Does nothing on if @connection wasn't
4598 // created with this flag or if the method has already been called.
4599 void start_message_processing()() nothrow {
4600 g_dbus_connection_start_message_processing(&this);
4603 // VERSION: 2.32
4604 // Reverses the effect of a previous call to
4605 // g_dbus_connection_export_action_group().
4607 // It is an error to call this function with an ID that wasn't returned
4608 // from g_dbus_connection_export_action_group() or to call it with the
4609 // same ID more than once.
4610 // <export_id>: the ID from g_dbus_connection_export_action_group()
4611 void unexport_action_group()(uint export_id) nothrow {
4612 g_dbus_connection_unexport_action_group(&this, export_id);
4615 // VERSION: 2.32
4616 // Reverses the effect of a previous call to
4617 // g_dbus_connection_export_menu_model().
4619 // It is an error to call this function with an ID that wasn't returned
4620 // from g_dbus_connection_export_menu_model() or to call it with the
4621 // same ID more than once.
4622 // <export_id>: the ID from g_dbus_connection_export_menu_model()
4623 void unexport_menu_model()(uint export_id) nothrow {
4624 g_dbus_connection_unexport_menu_model(&this, export_id);
4627 // VERSION: 2.26
4628 // Unregisters an object.
4629 // RETURNS: %TRUE if the object was unregistered, %FALSE otherwise.
4630 // <registration_id>: A registration id obtained from g_dbus_connection_register_object().
4631 int unregister_object()(uint registration_id) nothrow {
4632 return g_dbus_connection_unregister_object(&this, registration_id);
4635 // VERSION: 2.26
4636 // Unregisters a subtree.
4637 // RETURNS: %TRUE if the subtree was unregistered, %FALSE otherwise.
4638 // <registration_id>: A subtree registration id obtained from g_dbus_connection_register_subtree().
4639 int unregister_subtree()(uint registration_id) nothrow {
4640 return g_dbus_connection_unregister_subtree(&this, registration_id);
4643 // VERSION: 2.26
4644 // Emitted when the connection is closed.
4646 // The cause of this event can be
4647 // <itemizedlist>
4648 // <listitem><para>
4649 // If g_dbus_connection_close() is called. In this case
4650 // @remote_peer_vanished is set to %FALSE and @error is %NULL.
4651 // </para></listitem>
4652 // <listitem><para>
4653 // If the remote peer closes the connection. In this case
4654 // @remote_peer_vanished is set to %TRUE and @error is set.
4655 // </para></listitem>
4656 // <listitem><para>
4657 // If the remote peer sends invalid or malformed data. In this
4658 // case @remote_peer_vanished is set to %FALSE and @error
4659 // is set.
4660 // </para></listitem>
4661 // </itemizedlist>
4663 // Upon receiving this signal, you should give up your reference to
4664 // @connection. You are guaranteed that this signal is emitted only
4665 // once.
4666 // <remote_peer_vanished>: %TRUE if @connection is closed because the remote peer closed its end of the connection.
4667 // <error>: A #GError with more details about the event or %NULL.
4668 extern (C) alias static void function (DBusConnection* this_, c_int remote_peer_vanished, GLib2.Error* error, void* user_data=null) nothrow signal_closed;
4670 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
4671 return super_.signal_connect!name(cb, data, cf);
4674 ulong signal_connect(string name:"closed", CB/*:signal_closed*/)
4675 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
4676 if (is(typeof(cb)==signal_closed)||_ttmm!(CB, signal_closed)()) {
4677 return signal_connect_data!()(&this, cast(char*)"closed",
4678 cast(GObject2.Callback)cb, data, null, cf);
4682 // Flags used when creating a new #GDBusConnection.
4683 enum DBusConnectionFlags /* Version 2.26 */ {
4684 NONE = 0,
4685 AUTHENTICATION_CLIENT = 1,
4686 AUTHENTICATION_SERVER = 2,
4687 AUTHENTICATION_ALLOW_ANONYMOUS = 4,
4688 MESSAGE_BUS_CONNECTION = 8,
4689 DELAY_MESSAGE_PROCESSING = 16
4692 // Certain timeout errors, e.g. while starting a service. Warning: this is
4693 // Error codes for the %G_DBUS_ERROR error domain.
4694 enum DBusError /* Version 2.26 */ {
4695 FAILED = 0,
4696 NO_MEMORY = 1,
4697 SERVICE_UNKNOWN = 2,
4698 NAME_HAS_NO_OWNER = 3,
4699 NO_REPLY = 4,
4700 IO_ERROR = 5,
4701 BAD_ADDRESS = 6,
4702 NOT_SUPPORTED = 7,
4703 LIMITS_EXCEEDED = 8,
4704 ACCESS_DENIED = 9,
4705 AUTH_FAILED = 10,
4706 NO_SERVER = 11,
4707 TIMEOUT = 12,
4708 NO_NETWORK = 13,
4709 ADDRESS_IN_USE = 14,
4710 DISCONNECTED = 15,
4711 INVALID_ARGS = 16,
4712 FILE_NOT_FOUND = 17,
4713 FILE_EXISTS = 18,
4714 UNKNOWN_METHOD = 19,
4715 TIMED_OUT = 20,
4716 MATCH_RULE_NOT_FOUND = 21,
4717 MATCH_RULE_INVALID = 22,
4718 SPAWN_EXEC_FAILED = 23,
4719 SPAWN_FORK_FAILED = 24,
4720 SPAWN_CHILD_EXITED = 25,
4721 SPAWN_CHILD_SIGNALED = 26,
4722 SPAWN_FAILED = 27,
4723 SPAWN_SETUP_FAILED = 28,
4724 SPAWN_CONFIG_INVALID = 29,
4725 SPAWN_SERVICE_INVALID = 30,
4726 SPAWN_SERVICE_NOT_FOUND = 31,
4727 SPAWN_PERMISSIONS_INVALID = 32,
4728 SPAWN_FILE_INVALID = 33,
4729 SPAWN_NO_MEMORY = 34,
4730 UNIX_PROCESS_ID_UNKNOWN = 35,
4731 INVALID_SIGNATURE = 36,
4732 INVALID_FILE_CONTENT = 37,
4733 SELINUX_SECURITY_CONTEXT_UNKNOWN = 38,
4734 ADT_AUDIT_DATA_UNKNOWN = 39,
4735 OBJECT_PATH_IN_USE = 40
4737 // Struct used in g_dbus_error_register_error_domain().
4738 struct DBusErrorEntry /* Version 2.26 */ {
4739 int error_code;
4740 char* dbus_error_name;
4744 // The #GDBusInterface type is the base type for D-Bus interfaces both
4745 // on the service side (see #GDBusInterfaceSkeleton) and client side
4746 // (see #GDBusProxy).
4747 struct DBusInterface /* Interface */ /* Version 2.30 */ {
4748 mixin template __interface__() {
4749 // VERSION: 2.32
4750 // Gets the #GDBusObject that @interface_ belongs to, if any.
4752 // reference should be freed with g_object_unref().
4753 // RETURNS: A #GDBusObject or %NULL. The returned
4754 DBusObject* /*new*/ dup_object()() nothrow {
4755 return g_dbus_interface_dup_object(cast(DBusInterface*)&this);
4758 // VERSION: 2.30
4759 // Gets D-Bus introspection information for the D-Bus interface
4760 // implemented by @interface_.
4761 // RETURNS: A #GDBusInterfaceInfo. Do not free.
4762 DBusInterfaceInfo* get_info()() nothrow {
4763 return g_dbus_interface_get_info(cast(DBusInterface*)&this);
4766 // Unintrospectable method: get_object() / g_dbus_interface_get_object()
4767 // VERSION: 2.30
4768 // Gets the #GDBusObject that @interface_ belongs to, if any.
4770 // <warning>It is not safe to use the returned object if @interface_
4771 // or the returned object is being used from other threads. See
4772 // g_dbus_interface_dup_object() for a thread-safe
4773 // alternative.</warning>
4775 // reference belongs to @interface_ and should not be freed.
4776 // RETURNS: A #GDBusObject or %NULL. The returned
4777 DBusObject* get_object()() nothrow {
4778 return g_dbus_interface_get_object(cast(DBusInterface*)&this);
4781 // VERSION: 2.30
4782 // Sets the #GDBusObject for @interface_ to @object.
4784 // Note that @interface_ will hold a weak reference to @object.
4785 // <object>: A #GDBusObject or %NULL.
4786 void set_object(AT0)(AT0 /*DBusObject*/ object) nothrow {
4787 g_dbus_interface_set_object(cast(DBusInterface*)&this, UpCast!(DBusObject*)(object));
4790 mixin __interface__;
4794 // VERSION: 2.26
4795 // The type of the @get_property function in #GDBusInterfaceVTable.
4797 // @error is set. If the returned #GVariant is floating, it is
4798 // consumed - otherwise its reference count is decreased by one.
4799 // RETURNS: A #GVariant with the value for @property_name or %NULL if
4800 // <connection>: A #GDBusConnection.
4801 // <sender>: The unique bus name of the remote caller.
4802 // <object_path>: The object path that the method was invoked on.
4803 // <interface_name>: The D-Bus interface name for the property.
4804 // <property_name>: The name of the property to get the value of.
4805 // <error>: Return location for error.
4806 // <user_data>: The @user_data #gpointer passed to g_dbus_connection_register_object().
4807 extern (C) alias GLib2.Variant* /*new*/ function (DBusConnection* connection, char* sender, char* object_path, char* interface_name, char* property_name, GLib2.Error** error, void* user_data) nothrow DBusInterfaceGetPropertyFunc;
4809 // Base type for D-Bus interfaces.
4810 struct DBusInterfaceIface /* Version 2.30 */ {
4811 GObject2.TypeInterface parent_iface;
4812 // RETURNS: A #GDBusInterfaceInfo. Do not free.
4813 extern (C) DBusInterfaceInfo* function (DBusInterface* interface_) nothrow get_info;
4814 // RETURNS: A #GDBusObject or %NULL. The returned
4815 extern (C) DBusObject* function (DBusInterface* interface_) nothrow get_object;
4816 // <object>: A #GDBusObject or %NULL.
4817 extern (C) void function (DBusInterface* interface_, DBusObject* object) nothrow set_object;
4818 // RETURNS: A #GDBusObject or %NULL. The returned
4819 extern (C) DBusObject* /*new*/ function (DBusInterface* interface_) nothrow dup_object;
4822 // Information about a D-Bus interface.
4823 struct DBusInterfaceInfo /* Version 2.26 */ {
4824 int ref_count;
4825 char* name;
4826 DBusMethodInfo*[666] methods;
4827 DBusSignalInfo*[666] signals;
4828 DBusPropertyInfo*[666] properties;
4829 DBusAnnotationInfo*[666] annotations;
4832 // VERSION: 2.30
4833 // Builds a lookup-cache to speed up
4834 // g_dbus_interface_info_lookup_method(),
4835 // g_dbus_interface_info_lookup_signal() and
4836 // g_dbus_interface_info_lookup_property().
4838 // If this has already been called with @info, the existing cache is
4839 // used and its use count is increased.
4841 // Note that @info cannot be modified until
4842 // g_dbus_interface_info_cache_release() is called.
4843 void cache_build()() nothrow {
4844 g_dbus_interface_info_cache_build(&this);
4847 // VERSION: 2.30
4848 // Decrements the usage count for the cache for @info built by
4849 // g_dbus_interface_info_cache_build() (if any) and frees the
4850 // resources used by the cache if the usage count drops to zero.
4851 void cache_release()() nothrow {
4852 g_dbus_interface_info_cache_release(&this);
4855 // VERSION: 2.26
4856 // Appends an XML representation of @info (and its children) to @string_builder.
4858 // This function is typically used for generating introspection XML
4859 // documents at run-time for handling the
4860 // <literal>org.freedesktop.DBus.Introspectable.Introspect</literal>
4861 // method.
4862 // <indent>: Indentation level.
4863 // <string_builder>: A #GString to to append XML data to.
4864 void generate_xml(AT0)(uint indent, /*out*/ AT0 /*GLib2.String*/ string_builder) nothrow {
4865 g_dbus_interface_info_generate_xml(&this, indent, UpCast!(GLib2.String*)(string_builder));
4868 // VERSION: 2.26
4869 // Looks up information about a method.
4871 // This cost of this function is O(n) in number of methods unless
4872 // g_dbus_interface_info_cache_build() has been used on @info.
4873 // RETURNS: A #GDBusMethodInfo or %NULL if not found. Do not free, it is owned by @info.
4874 // <name>: A D-Bus method name (typically in CamelCase)
4875 DBusMethodInfo* lookup_method(AT0)(AT0 /*char*/ name) nothrow {
4876 return g_dbus_interface_info_lookup_method(&this, toCString!(char*)(name));
4879 // VERSION: 2.26
4880 // Looks up information about a property.
4882 // This cost of this function is O(n) in number of properties unless
4883 // g_dbus_interface_info_cache_build() has been used on @info.
4884 // RETURNS: A #GDBusPropertyInfo or %NULL if not found. Do not free, it is owned by @info.
4885 // <name>: A D-Bus property name (typically in CamelCase).
4886 DBusPropertyInfo* lookup_property(AT0)(AT0 /*char*/ name) nothrow {
4887 return g_dbus_interface_info_lookup_property(&this, toCString!(char*)(name));
4890 // VERSION: 2.26
4891 // Looks up information about a signal.
4893 // This cost of this function is O(n) in number of signals unless
4894 // g_dbus_interface_info_cache_build() has been used on @info.
4895 // RETURNS: A #GDBusSignalInfo or %NULL if not found. Do not free, it is owned by @info.
4896 // <name>: A D-Bus signal name (typically in CamelCase)
4897 DBusSignalInfo* lookup_signal(AT0)(AT0 /*char*/ name) nothrow {
4898 return g_dbus_interface_info_lookup_signal(&this, toCString!(char*)(name));
4901 // VERSION: 2.26
4902 // If @info is statically allocated does nothing. Otherwise increases
4903 // the reference count.
4904 // RETURNS: The same @info.
4905 DBusInterfaceInfo* /*new*/ ref_()() nothrow {
4906 return g_dbus_interface_info_ref(&this);
4909 // VERSION: 2.26
4910 // If @info is statically allocated, does nothing. Otherwise decreases
4911 // the reference count of @info. When its reference count drops to 0,
4912 // the memory used is freed.
4913 void unref()() nothrow {
4914 g_dbus_interface_info_unref(&this);
4919 // VERSION: 2.26
4920 // The type of the @method_call function in #GDBusInterfaceVTable.
4921 // <connection>: A #GDBusConnection.
4922 // <sender>: The unique bus name of the remote caller.
4923 // <object_path>: The object path that the method was invoked on.
4924 // <interface_name>: The D-Bus interface name the method was invoked on.
4925 // <method_name>: The name of the method that was invoked.
4926 // <parameters>: A #GVariant tuple with parameters.
4927 // <invocation>: A #GDBusMethodInvocation object that can be used to return a value or error.
4928 // <user_data>: The @user_data #gpointer passed to g_dbus_connection_register_object().
4929 extern (C) alias void function (DBusConnection* connection, char* sender, char* object_path, char* interface_name, char* method_name, GLib2.Variant* parameters, DBusMethodInvocation* invocation, void* user_data) nothrow DBusInterfaceMethodCallFunc;
4932 // VERSION: 2.26
4933 // The type of the @set_property function in #GDBusInterfaceVTable.
4934 // RETURNS: %TRUE if the property was set to @value, %FALSE if @error is set.
4935 // <connection>: A #GDBusConnection.
4936 // <sender>: The unique bus name of the remote caller.
4937 // <object_path>: The object path that the method was invoked on.
4938 // <interface_name>: The D-Bus interface name for the property.
4939 // <property_name>: The name of the property to get the value of.
4940 // <value>: The value to set the property to.
4941 // <error>: Return location for error.
4942 // <user_data>: The @user_data #gpointer passed to g_dbus_connection_register_object().
4943 extern (C) alias int function (DBusConnection* connection, char* sender, char* object_path, char* interface_name, char* property_name, GLib2.Variant* value, GLib2.Error** error, void* user_data) nothrow DBusInterfaceSetPropertyFunc;
4945 // Abstract base class for D-Bus interfaces on the service side.
4946 struct DBusInterfaceSkeleton /* : GObject.Object */ /* Version 2.30 */ {
4947 mixin DBusInterface.__interface__;
4948 alias parent_instance this;
4949 alias parent_instance super_;
4950 alias parent_instance object;
4951 GObject2.Object parent_instance;
4952 private DBusInterfaceSkeletonPrivate* priv;
4955 // VERSION: 2.30
4956 // Exports @interface_ at @object_path on @connection.
4958 // This can be called multiple times to export the same @interface_
4959 // onto multiple connections however the @object_path provided must be
4960 // the same for all connections.
4962 // Use g_dbus_interface_skeleton_unexport() to unexport the object.
4964 // @error set.
4965 // RETURNS: %TRUE if the interface was exported on @connection, otherwise %FALSE with
4966 // <connection>: A #GDBusConnection to export @interface_ on.
4967 // <object_path>: The path to export the interface at.
4968 int export_(AT0, AT1, AT2)(AT0 /*DBusConnection*/ connection, AT1 /*char*/ object_path, AT2 /*GLib2.Error**/ error=null) nothrow {
4969 return g_dbus_interface_skeleton_export(&this, UpCast!(DBusConnection*)(connection), toCString!(char*)(object_path), UpCast!(GLib2.Error**)(error));
4972 // VERSION: 2.30
4973 // If @interface_ has outstanding changes, request for these changes to be
4974 // emitted immediately.
4976 // For example, an exported D-Bus interface may queue up property
4977 // changes and emit the
4978 // <literal>org.freedesktop.DBus.Properties::PropertiesChanged</literal>
4979 // signal later (e.g. in an idle handler). This technique is useful
4980 // for collapsing multiple property changes into one.
4981 void flush()() nothrow {
4982 g_dbus_interface_skeleton_flush(&this);
4985 // VERSION: 2.30
4986 // Gets the first connection that @interface_ is exported on, if any.
4988 // not exported anywhere. Do not free, the object belongs to @interface_.
4989 // RETURNS: A #GDBusConnection or %NULL if @interface_ is
4990 DBusConnection* get_connection()() nothrow {
4991 return g_dbus_interface_skeleton_get_connection(&this);
4994 // VERSION: 2.32
4995 // Gets a list of the connections that @interface_ is exported on.
4997 // all the connections that @interface_ is exported on. The returned
4998 // list should be freed with g_list_free() after each element has
4999 // been freed with g_object_unref().
5000 // RETURNS: A list of
5001 GLib2.List* /*new*/ get_connections()() nothrow {
5002 return g_dbus_interface_skeleton_get_connections(&this);
5005 // VERSION: 2.30
5006 // Gets the #GDBusInterfaceSkeletonFlags that describes what the behavior
5007 // of @interface_
5008 // RETURNS: One or more flags from the #GDBusInterfaceSkeletonFlags enumeration.
5009 DBusInterfaceSkeletonFlags get_flags()() nothrow {
5010 return g_dbus_interface_skeleton_get_flags(&this);
5013 // VERSION: 2.30
5014 // Gets D-Bus introspection information for the D-Bus interface
5015 // implemented by @interface_.
5016 // RETURNS: A #GDBusInterfaceInfo (never %NULL). Do not free.
5017 DBusInterfaceInfo* get_info()() nothrow {
5018 return g_dbus_interface_skeleton_get_info(&this);
5021 // VERSION: 2.30
5022 // Gets the object path that @interface_ is exported on, if any.
5024 // anywhere. Do not free, the string belongs to @interface_.
5025 // RETURNS: A string owned by @interface_ or %NULL if @interface_ is not exported
5026 char* get_object_path()() nothrow {
5027 return g_dbus_interface_skeleton_get_object_path(&this);
5030 // VERSION: 2.30
5031 // Gets all D-Bus properties for @interface_.
5032 // RETURNS: A #GVariant of type <link linkend="G-VARIANT-TYPE-VARDICT:CAPS">'a{sv}'</link>. Free with g_variant_unref().
5033 GLib2.Variant* /*new*/ get_properties()() nothrow {
5034 return g_dbus_interface_skeleton_get_properties(&this);
5037 // Unintrospectable method: get_vtable() / g_dbus_interface_skeleton_get_vtable()
5038 // VERSION: 2.30
5039 // Gets the interface vtable for the D-Bus interface implemented by
5040 // @interface_. The returned function pointers should expect @interface_
5041 // itself to be passed as @user_data.
5042 // RETURNS: A #GDBusInterfaceVTable (never %NULL).
5043 DBusInterfaceVTable* get_vtable()() nothrow {
5044 return g_dbus_interface_skeleton_get_vtable(&this);
5047 // VERSION: 2.32
5048 // Checks if @interface_ is export on @connection.
5049 // RETURNS: %TRUE if @interface_ is exported on @connection, %FALSE otherwise.
5050 // <connection>: A #GDBusConnection.
5051 int has_connection(AT0)(AT0 /*DBusConnection*/ connection) nothrow {
5052 return g_dbus_interface_skeleton_has_connection(&this, UpCast!(DBusConnection*)(connection));
5055 // VERSION: 2.30
5056 // Sets flags describing what the behavior of @skeleton should be.
5057 // <flags>: Flags from the #GDBusInterfaceSkeletonFlags enumeration.
5058 void set_flags()(DBusInterfaceSkeletonFlags flags) nothrow {
5059 g_dbus_interface_skeleton_set_flags(&this, flags);
5062 // VERSION: 2.30
5063 // Stops exporting @interface_ on all connections it is exported on.
5065 // To unexport @interface_ from only a single connection, use
5066 // g_dbus_interface_skeleton_unexport_from_connection()
5067 void unexport()() nothrow {
5068 g_dbus_interface_skeleton_unexport(&this);
5071 // VERSION: 2.32
5072 // Stops exporting @interface_ on @connection.
5074 // To stop exporting on all connections the interface is exported on,
5075 // use g_dbus_interface_skeleton_unexport().
5076 // <connection>: A #GDBusConnection.
5077 void unexport_from_connection(AT0)(AT0 /*DBusConnection*/ connection) nothrow {
5078 g_dbus_interface_skeleton_unexport_from_connection(&this, UpCast!(DBusConnection*)(connection));
5081 // VERSION: 2.30
5082 // Emitted when a method is invoked by a remote caller and used to
5083 // determine if the method call is authorized.
5085 // Note that this signal is emitted in a thread dedicated to
5086 // handling the method call so handlers are allowed to perform
5087 // blocking IO. This means that it is appropriate to call
5088 // e.g. <ulink
5089 // url="http://hal.freedesktop.org/docs/polkit/PolkitAuthority.html#polkit-authority-check-authorization-sync">polkit_authority_check_authorization_sync()</ulink>
5090 // with the <ulink
5091 // url="http://hal.freedesktop.org/docs/polkit/PolkitAuthority.html#POLKIT-CHECK-AUTHORIZATION-FLAGS-ALLOW-USER-INTERACTION:CAPS">POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION</ulink> flag set.
5093 // If %FALSE is returned then no further handlers are run and the
5094 // signal handler must take a reference to @invocation and finish
5095 // handling the call (e.g. return an error via
5096 // g_dbus_method_invocation_return_error()).
5098 // Otherwise, if %TRUE is returned, signal emission continues. If no
5099 // handlers return %FALSE, then the method is dispatched. If
5100 // @interface has an enclosing #GDBusObjectSkeleton, then the
5101 // #GDBusObjectSkeleton::authorize-method signal handlers run before
5102 // the handlers for this signal.
5104 // The default class handler just returns %TRUE.
5106 // Please note that the common case is optimized: if no signals
5107 // handlers are connected and the default class handler isn't
5108 // overridden (for both @interface and the enclosing
5109 // #GDBusObjectSkeleton, if any) and #GDBusInterfaceSkeleton:g-flags does
5110 // not have the
5111 // %G_DBUS_INTERFACE_SKELETON_FLAGS_HANDLE_METHOD_INVOCATIONS_IN_THREAD
5112 // flags set, no dedicated thread is ever used and the call will be
5113 // handled in the same thread as the object that @interface belongs
5114 // to was exported in.
5115 // RETURNS: %TRUE if the call is authorized, %FALSE otherwise.
5116 // <invocation>: A #GDBusMethodInvocation.
5117 extern (C) alias static c_int function (DBusInterfaceSkeleton* this_, DBusMethodInvocation* invocation, void* user_data=null) nothrow signal_g_authorize_method;
5119 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
5120 return super_.signal_connect!name(cb, data, cf);
5123 ulong signal_connect(string name:"g-authorize-method", CB/*:signal_g_authorize_method*/)
5124 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
5125 if (is(typeof(cb)==signal_g_authorize_method)||_ttmm!(CB, signal_g_authorize_method)()) {
5126 return signal_connect_data!()(&this, cast(char*)"g-authorize-method",
5127 cast(GObject2.Callback)cb, data, null, cf);
5131 // Class structure for #GDBusInterfaceSkeleton.
5132 struct DBusInterfaceSkeletonClass /* Version 2.30 */ {
5133 GObject2.ObjectClass parent_class;
5134 // RETURNS: A #GDBusInterfaceInfo (never %NULL). Do not free.
5135 extern (C) DBusInterfaceInfo* function (DBusInterfaceSkeleton* interface_) nothrow get_info;
5137 // Unintrospectable functionp: get_vtable() / ()
5139 // RETURNS: A #GDBusInterfaceVTable (never %NULL).
5140 extern (C) DBusInterfaceVTable* function (DBusInterfaceSkeleton* interface_) nothrow get_vtable;
5141 // RETURNS: A #GVariant of type <link linkend="G-VARIANT-TYPE-VARDICT:CAPS">'a{sv}'</link>. Free with g_variant_unref().
5142 extern (C) GLib2.Variant* /*new*/ function (DBusInterfaceSkeleton* interface_) nothrow get_properties;
5143 extern (C) void function (DBusInterfaceSkeleton* interface_) nothrow flush;
5144 private void*[8] vfunc_padding;
5145 extern (C) int function (DBusInterfaceSkeleton* interface_, DBusMethodInvocation* invocation) nothrow g_authorize_method;
5146 private void*[8] signal_padding;
5149 // Flags describing the behavior of a #GDBusInterfaceSkeleton instance.
5150 enum DBusInterfaceSkeletonFlags /* Version 2.30 */ {
5151 NONE = 0,
5152 HANDLE_METHOD_INVOCATIONS_IN_THREAD = 1
5154 struct DBusInterfaceSkeletonPrivate {
5158 // Virtual table for handling properties and method calls for a D-Bus
5159 // interface.
5161 // If you want to handle getting/setting D-Bus properties asynchronously, simply
5162 // register an object with the <literal>org.freedesktop.DBus.Properties</literal>
5163 // D-Bus interface using g_dbus_connection_register_object().
5164 struct DBusInterfaceVTable /* Version 2.26 */ {
5165 DBusInterfaceMethodCallFunc method_call;
5166 DBusInterfaceGetPropertyFunc get_property;
5167 DBusInterfaceSetPropertyFunc set_property;
5168 private void*[8] padding;
5172 // #GDBusMenuModel is an implementation of #GMenuModel that can be used
5173 // as a proxy for a menu model that is exported over D-Bus with
5174 // g_dbus_connection_export_menu_model().
5175 struct DBusMenuModel /* : MenuModel */ {
5176 alias method_parent this;
5177 alias method_parent super_;
5178 alias method_parent menumodel;
5179 MenuModel method_parent;
5182 // VERSION: 2.32
5183 // Obtains a #GDBusMenuModel for the menu model which is exported
5184 // at the given @bus_name and @object_path.
5186 // The thread default main context is taken at the time of this call.
5187 // All signals on the menu model (and any linked models) are reported
5188 // with respect to this context. All calls on the returned menu model
5189 // (and linked models) must also originate from this same context, with
5190 // the thread default main context unchanged.
5192 // g_object_unref().
5193 // RETURNS: a #GDBusMenuModel object. Free with
5194 // <connection>: a #GDBusConnection
5195 // <bus_name>: the bus name which exports the menu model
5196 // <object_path>: the object path at which the menu model is exported
5197 static DBusMenuModel* /*new*/ get(AT0, AT1, AT2)(AT0 /*DBusConnection*/ connection, AT1 /*char*/ bus_name, AT2 /*char*/ object_path) nothrow {
5198 return g_dbus_menu_model_get(UpCast!(DBusConnection*)(connection), toCString!(char*)(bus_name), toCString!(char*)(object_path));
5203 // A type for representing D-Bus messages that can be sent or received
5204 // on a #GDBusConnection.
5205 struct DBusMessage /* : GObject.Object */ /* Version 2.26 */ {
5206 alias method_parent this;
5207 alias method_parent super_;
5208 alias method_parent object;
5209 GObject2.Object method_parent;
5212 // VERSION: 2.26
5213 // Creates a new empty #GDBusMessage.
5214 // RETURNS: A #GDBusMessage. Free with g_object_unref().
5215 static DBusMessage* /*new*/ new_()() nothrow {
5216 return g_dbus_message_new();
5218 static auto opCall()() {
5219 return g_dbus_message_new();
5222 // VERSION: 2.26
5223 // Creates a new #GDBusMessage from the data stored at @blob. The byte
5224 // order that the message was in can be retrieved using
5225 // g_dbus_message_get_byte_order().
5227 // g_object_unref().
5228 // RETURNS: A new #GDBusMessage or %NULL if @error is set. Free with
5229 // <blob>: A blob represent a binary D-Bus message.
5230 // <blob_len>: The length of @blob.
5231 // <capabilities>: A #GDBusCapabilityFlags describing what protocol features are supported.
5232 static DBusMessage* /*new*/ new_from_blob(AT0, AT1)(AT0 /*ubyte*/ blob, size_t blob_len, DBusCapabilityFlags capabilities, AT1 /*GLib2.Error**/ error=null) nothrow {
5233 return g_dbus_message_new_from_blob(UpCast!(ubyte*)(blob), blob_len, capabilities, UpCast!(GLib2.Error**)(error));
5235 static auto opCall(AT0, AT1)(AT0 /*ubyte*/ blob, size_t blob_len, DBusCapabilityFlags capabilities, AT1 /*GLib2.Error**/ error=null) {
5236 return g_dbus_message_new_from_blob(UpCast!(ubyte*)(blob), blob_len, capabilities, UpCast!(GLib2.Error**)(error));
5239 // VERSION: 2.26
5240 // Creates a new #GDBusMessage for a method call.
5241 // RETURNS: A #GDBusMessage. Free with g_object_unref().
5242 // <name>: A valid D-Bus name or %NULL.
5243 // <path>: A valid object path.
5244 // <interface_>: A valid D-Bus interface name or %NULL.
5245 // <method>: A valid method name.
5246 static DBusMessage* /*new*/ new_method_call(AT0, AT1, AT2, AT3)(AT0 /*char*/ name, AT1 /*char*/ path, AT2 /*char*/ interface_, AT3 /*char*/ method) nothrow {
5247 return g_dbus_message_new_method_call(toCString!(char*)(name), toCString!(char*)(path), toCString!(char*)(interface_), toCString!(char*)(method));
5249 static auto opCall(AT0, AT1, AT2, AT3)(AT0 /*char*/ name, AT1 /*char*/ path, AT2 /*char*/ interface_, AT3 /*char*/ method) {
5250 return g_dbus_message_new_method_call(toCString!(char*)(name), toCString!(char*)(path), toCString!(char*)(interface_), toCString!(char*)(method));
5253 // VERSION: 2.26
5254 // Creates a new #GDBusMessage for a signal emission.
5255 // RETURNS: A #GDBusMessage. Free with g_object_unref().
5256 // <path>: A valid object path.
5257 // <interface_>: A valid D-Bus interface name.
5258 // <signal>: A valid signal name.
5259 static DBusMessage* /*new*/ new_signal(AT0, AT1, AT2)(AT0 /*char*/ path, AT1 /*char*/ interface_, AT2 /*char*/ signal) nothrow {
5260 return g_dbus_message_new_signal(toCString!(char*)(path), toCString!(char*)(interface_), toCString!(char*)(signal));
5262 static auto opCall(AT0, AT1, AT2)(AT0 /*char*/ path, AT1 /*char*/ interface_, AT2 /*char*/ signal) {
5263 return g_dbus_message_new_signal(toCString!(char*)(path), toCString!(char*)(interface_), toCString!(char*)(signal));
5266 // VERSION: 2.26
5267 // Utility function to calculate how many bytes are needed to
5268 // completely deserialize the D-Bus message stored at @blob.
5270 // @blob contains invalid data or not enough data is available to
5271 // determine the size).
5272 // RETURNS: Number of bytes needed or -1 if @error is set (e.g. if
5273 // <blob>: A blob represent a binary D-Bus message.
5274 // <blob_len>: The length of @blob (must be at least 16).
5275 static ssize_t bytes_needed(AT0, AT1)(AT0 /*ubyte*/ blob, size_t blob_len, AT1 /*GLib2.Error**/ error=null) nothrow {
5276 return g_dbus_message_bytes_needed(UpCast!(ubyte*)(blob), blob_len, UpCast!(GLib2.Error**)(error));
5279 // VERSION: 2.26
5280 // Copies @message. The copy is a deep copy and the returned
5281 // #GDBusMessage is completely identical except that it is guaranteed
5282 // to not be locked.
5284 // This operation can fail if e.g. @message contains file descriptors
5285 // and the per-process or system-wide open files limit is reached.
5287 // Free with g_object_unref().
5288 // RETURNS: A new #GDBusMessage or %NULL if @error is set.
5289 DBusMessage* /*new*/ copy(AT0)(AT0 /*GLib2.Error**/ error=null) nothrow {
5290 return g_dbus_message_copy(&this, UpCast!(GLib2.Error**)(error));
5293 // VERSION: 2.26
5294 // Convenience to get the first item in the body of @message.
5296 // @message is not a string.
5297 // RETURNS: The string item or %NULL if the first item in the body of
5298 char* get_arg0()() nothrow {
5299 return g_dbus_message_get_arg0(&this);
5302 // VERSION: 2.26
5303 // Gets the body of a message.
5304 // RETURNS: A #GVariant or %NULL if the body is empty. Do not free, it is owned by @message.
5305 GLib2.Variant* /*new*/ get_body()() nothrow {
5306 return g_dbus_message_get_body(&this);
5309 // Gets the byte order of @message.
5310 // RETURNS: The byte order.
5311 DBusMessageByteOrder get_byte_order()() nothrow {
5312 return g_dbus_message_get_byte_order(&this);
5315 // VERSION: 2.26
5316 // Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION header field.
5317 // RETURNS: The value.
5318 char* get_destination()() nothrow {
5319 return g_dbus_message_get_destination(&this);
5322 // VERSION: 2.26
5323 // Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field.
5324 // RETURNS: The value.
5325 char* get_error_name()() nothrow {
5326 return g_dbus_message_get_error_name(&this);
5329 // VERSION: 2.26
5330 // Gets the flags for @message.
5331 // RETURNS: Flags that are set (typically values from the #GDBusMessageFlags enumeration bitwise ORed together).
5332 DBusMessageFlags get_flags()() nothrow {
5333 return g_dbus_message_get_flags(&this);
5336 // VERSION: 2.26
5337 // Gets a header field on @message.
5339 // otherwise. Do not free, it is owned by @message.
5340 // RETURNS: A #GVariant with the value if the header was found, %NULL
5341 // <header_field>: A 8-bit unsigned integer (typically a value from the #GDBusMessageHeaderField enumeration)
5342 GLib2.Variant* /*new*/ get_header()(DBusMessageHeaderField header_field) nothrow {
5343 return g_dbus_message_get_header(&this, header_field);
5346 // VERSION: 2.26
5347 // Gets an array of all header fields on @message that are set.
5349 // terminated by %G_DBUS_MESSAGE_HEADER_FIELD_INVALID. Each element
5350 // is a #guchar. Free with g_free().
5351 // RETURNS: An array of header fields
5352 ubyte* get_header_fields()() nothrow {
5353 return g_dbus_message_get_header_fields(&this);
5356 // VERSION: 2.26
5357 // Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE header field.
5358 // RETURNS: The value.
5359 char* get_interface()() nothrow {
5360 return g_dbus_message_get_interface(&this);
5363 // VERSION: 2.26
5364 // Checks whether @message is locked. To monitor changes to this
5365 // value, conncet to the #GObject::notify signal to listen for changes
5366 // on the #GDBusMessage:locked property.
5367 // RETURNS: %TRUE if @message is locked, %FALSE otherwise.
5368 int get_locked()() nothrow {
5369 return g_dbus_message_get_locked(&this);
5372 // VERSION: 2.26
5373 // Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_MEMBER header field.
5374 // RETURNS: The value.
5375 char* get_member()() nothrow {
5376 return g_dbus_message_get_member(&this);
5379 // VERSION: 2.26
5380 // Gets the type of @message.
5381 // RETURNS: A 8-bit unsigned integer (typically a value from the #GDBusMessageType enumeration).
5382 DBusMessageType get_message_type()() nothrow {
5383 return g_dbus_message_get_message_type(&this);
5386 // VERSION: 2.26
5387 // Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header field.
5388 // RETURNS: The value.
5389 uint get_num_unix_fds()() nothrow {
5390 return g_dbus_message_get_num_unix_fds(&this);
5393 // VERSION: 2.26
5394 // Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_PATH header field.
5395 // RETURNS: The value.
5396 char* get_path()() nothrow {
5397 return g_dbus_message_get_path(&this);
5400 // VERSION: 2.26
5401 // Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL header field.
5402 // RETURNS: The value.
5403 uint get_reply_serial()() nothrow {
5404 return g_dbus_message_get_reply_serial(&this);
5407 // VERSION: 2.26
5408 // Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_SENDER header field.
5409 // RETURNS: The value.
5410 char* get_sender()() nothrow {
5411 return g_dbus_message_get_sender(&this);
5414 // VERSION: 2.26
5415 // Gets the serial for @message.
5416 // RETURNS: A #guint32.
5417 uint get_serial()() nothrow {
5418 return g_dbus_message_get_serial(&this);
5421 // VERSION: 2.26
5422 // Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field.
5423 // RETURNS: The value.
5424 char* get_signature()() nothrow {
5425 return g_dbus_message_get_signature(&this);
5428 // VERSION: 2.26
5429 // Gets the UNIX file descriptors associated with @message, if any.
5431 // This method is only available on UNIX.
5433 // associated. Do not free, this object is owned by @message.
5434 // RETURNS: A #GUnixFDList or %NULL if no file descriptors are
5435 UnixFDList* get_unix_fd_list()() nothrow {
5436 return g_dbus_message_get_unix_fd_list(&this);
5439 // VERSION: 2.26
5440 // If @message is locked, does nothing. Otherwise locks the message.
5441 void lock()() nothrow {
5442 g_dbus_message_lock(&this);
5445 // Unintrospectable method: new_method_error() / g_dbus_message_new_method_error()
5446 // VERSION: 2.26
5447 // Creates a new #GDBusMessage that is an error reply to @method_call_message.
5448 // RETURNS: A #GDBusMessage. Free with g_object_unref().
5449 // <error_name>: A valid D-Bus error name.
5450 // <error_message_format>: The D-Bus error message in a printf() format.
5451 /+ Not available -- variadic methods unsupported - use the C function directly.
5452 alias g_dbus_message_new_method_error new_method_error; // Variadic
5455 // VERSION: 2.26
5456 // Creates a new #GDBusMessage that is an error reply to @method_call_message.
5457 // RETURNS: A #GDBusMessage. Free with g_object_unref().
5458 // <error_name>: A valid D-Bus error name.
5459 // <error_message>: The D-Bus error message.
5460 DBusMessage* /*new*/ new_method_error_literal(AT0, AT1)(AT0 /*char*/ error_name, AT1 /*char*/ error_message) nothrow {
5461 return g_dbus_message_new_method_error_literal(&this, toCString!(char*)(error_name), toCString!(char*)(error_message));
5464 // Unintrospectable method: new_method_error_valist() / g_dbus_message_new_method_error_valist()
5465 // VERSION: 2.26
5466 // Like g_dbus_message_new_method_error() but intended for language bindings.
5467 // RETURNS: A #GDBusMessage. Free with g_object_unref().
5468 // <error_name>: A valid D-Bus error name.
5469 // <error_message_format>: The D-Bus error message in a printf() format.
5470 // <var_args>: Arguments for @error_message_format.
5471 DBusMessage* /*new*/ new_method_error_valist(AT0, AT1)(AT0 /*char*/ error_name, AT1 /*char*/ error_message_format, va_list var_args) nothrow {
5472 return g_dbus_message_new_method_error_valist(&this, toCString!(char*)(error_name), toCString!(char*)(error_message_format), var_args);
5475 // VERSION: 2.26
5476 // Creates a new #GDBusMessage that is a reply to @method_call_message.
5477 // RETURNS: #GDBusMessage. Free with g_object_unref().
5478 DBusMessage* /*new*/ new_method_reply()() nothrow {
5479 return g_dbus_message_new_method_reply(&this);
5482 // VERSION: 2.26
5483 // Produces a human-readable multi-line description of @message.
5485 // The contents of the description has no ABI guarantees, the contents
5486 // and formatting is subject to change at any time. Typical output
5487 // looks something like this:
5488 // <programlisting>
5489 // Flags: none
5490 // Version: 0
5491 // Serial: 4
5492 // Headers:
5493 // path -> objectpath '/org/gtk/GDBus/TestObject'
5494 // interface -> 'org.gtk.GDBus.TestInterface'
5495 // member -> 'GimmeStdout'
5496 // destination -> ':1.146'
5497 // Body: ()
5498 // UNIX File Descriptors:
5499 // (none)
5500 // </programlisting>
5501 // or
5502 // <programlisting>
5503 // Flags: no-reply-expected
5504 // Version: 0
5505 // Serial: 477
5506 // Headers:
5507 // reply-serial -> uint32 4
5508 // destination -> ':1.159'
5509 // sender -> ':1.146'
5510 // num-unix-fds -> uint32 1
5511 // Body: ()
5512 // UNIX File Descriptors:
5513 // fd 12: dev=0:10,mode=020620,ino=5,uid=500,gid=5,rdev=136:2,size=0,atime=1273085037,mtime=1273085851,ctime=1272982635
5514 // </programlisting>
5515 // RETURNS: A string that should be freed with g_free().
5516 // <indent>: Indentation level.
5517 char* /*new*/ print()(uint indent) nothrow {
5518 return g_dbus_message_print(&this, indent);
5521 // VERSION: 2.26
5522 // Sets the body @message. As a side-effect the
5523 // %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field is set to the
5524 // type string of @body (or cleared if @body is %NULL).
5526 // If @body is floating, @message assumes ownership of @body.
5527 // <body>: Either %NULL or a #GVariant that is a tuple.
5528 void set_body(AT0)(AT0 /*GLib2.Variant*/ body_) nothrow {
5529 g_dbus_message_set_body(&this, UpCast!(GLib2.Variant*)(body_));
5532 // Sets the byte order of @message.
5533 // <byte_order>: The byte order.
5534 void set_byte_order()(DBusMessageByteOrder byte_order) nothrow {
5535 g_dbus_message_set_byte_order(&this, byte_order);
5538 // VERSION: 2.26
5539 // Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION header field.
5540 // <value>: The value to set.
5541 void set_destination(AT0)(AT0 /*char*/ value) nothrow {
5542 g_dbus_message_set_destination(&this, toCString!(char*)(value));
5545 // VERSION: 2.26
5546 // Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field.
5547 // <value>: The value to set.
5548 void set_error_name(AT0)(AT0 /*char*/ value) nothrow {
5549 g_dbus_message_set_error_name(&this, toCString!(char*)(value));
5552 // VERSION: 2.26
5553 // Sets the flags to set on @message.
5554 // <flags>: Flags for @message that are set (typically values from the #GDBusMessageFlags enumeration bitwise ORed together).
5555 void set_flags()(DBusMessageFlags flags) nothrow {
5556 g_dbus_message_set_flags(&this, flags);
5559 // VERSION: 2.26
5560 // Sets a header field on @message.
5562 // If @value is floating, @message assumes ownership of @value.
5563 // <header_field>: A 8-bit unsigned integer (typically a value from the #GDBusMessageHeaderField enumeration)
5564 // <value>: A #GVariant to set the header field or %NULL to clear the header field.
5565 void set_header(AT0)(DBusMessageHeaderField header_field, AT0 /*GLib2.Variant*/ value) nothrow {
5566 g_dbus_message_set_header(&this, header_field, UpCast!(GLib2.Variant*)(value));
5569 // VERSION: 2.26
5570 // Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE header field.
5571 // <value>: The value to set.
5572 void set_interface(AT0)(AT0 /*char*/ value) nothrow {
5573 g_dbus_message_set_interface(&this, toCString!(char*)(value));
5576 // VERSION: 2.26
5577 // Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_MEMBER header field.
5578 // <value>: The value to set.
5579 void set_member(AT0)(AT0 /*char*/ value) nothrow {
5580 g_dbus_message_set_member(&this, toCString!(char*)(value));
5583 // VERSION: 2.26
5584 // Sets @message to be of @type.
5585 // <type>: A 8-bit unsigned integer (typically a value from the #GDBusMessageType enumeration).
5586 void set_message_type()(DBusMessageType type) nothrow {
5587 g_dbus_message_set_message_type(&this, type);
5590 // VERSION: 2.26
5591 // Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header field.
5592 // <value>: The value to set.
5593 void set_num_unix_fds()(uint value) nothrow {
5594 g_dbus_message_set_num_unix_fds(&this, value);
5597 // VERSION: 2.26
5598 // Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_PATH header field.
5599 // <value>: The value to set.
5600 void set_path(AT0)(AT0 /*char*/ value) nothrow {
5601 g_dbus_message_set_path(&this, toCString!(char*)(value));
5604 // VERSION: 2.26
5605 // Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL header field.
5606 // <value>: The value to set.
5607 void set_reply_serial()(uint value) nothrow {
5608 g_dbus_message_set_reply_serial(&this, value);
5611 // VERSION: 2.26
5612 // Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_SENDER header field.
5613 // <value>: The value to set.
5614 void set_sender(AT0)(AT0 /*char*/ value) nothrow {
5615 g_dbus_message_set_sender(&this, toCString!(char*)(value));
5618 // VERSION: 2.26
5619 // Sets the serial for @message.
5620 // <serial>: A #guint32.
5621 void set_serial()(uint serial) nothrow {
5622 g_dbus_message_set_serial(&this, serial);
5625 // VERSION: 2.26
5626 // Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field.
5627 // <value>: The value to set.
5628 void set_signature(AT0)(AT0 /*char*/ value) nothrow {
5629 g_dbus_message_set_signature(&this, toCString!(char*)(value));
5632 // VERSION: 2.26
5633 // Sets the UNIX file descriptors associated with @message. As a
5634 // side-effect the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header
5635 // field is set to the number of fds in @fd_list (or cleared if
5636 // @fd_list is %NULL).
5638 // This method is only available on UNIX.
5639 // <fd_list>: A #GUnixFDList or %NULL.
5640 void set_unix_fd_list(AT0)(AT0 /*UnixFDList*/ fd_list=null) nothrow {
5641 g_dbus_message_set_unix_fd_list(&this, UpCast!(UnixFDList*)(fd_list));
5644 // VERSION: 2.26
5645 // Serializes @message to a blob. The byte order returned by
5646 // g_dbus_message_get_byte_order() will be used.
5648 // valid binary D-Bus message of @out_size bytes generated by @message
5649 // or %NULL if @error is set. Free with g_free().
5650 // RETURNS: A pointer to a
5651 // <out_size>: Return location for size of generated blob.
5652 // <capabilities>: A #GDBusCapabilityFlags describing what protocol features are supported.
5653 ubyte* /*new*/ to_blob(AT0, AT1)(/*out*/ AT0 /*size_t*/ out_size, DBusCapabilityFlags capabilities, AT1 /*GLib2.Error**/ error=null) nothrow {
5654 return g_dbus_message_to_blob(&this, UpCast!(size_t*)(out_size), capabilities, UpCast!(GLib2.Error**)(error));
5657 // VERSION: 2.26
5658 // If @message is not of type %G_DBUS_MESSAGE_TYPE_ERROR does
5659 // nothing and returns %FALSE.
5661 // Otherwise this method encodes the error in @message as a #GError
5662 // using g_dbus_error_set_dbus_error() using the information in the
5663 // %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field of @message as
5664 // well as the first string item in @message's body.
5665 // RETURNS: %TRUE if @error was set, %FALSE otherwise.
5666 int to_gerror(AT0)(AT0 /*GLib2.Error**/ error=null) nothrow {
5667 return g_dbus_message_to_gerror(&this, UpCast!(GLib2.Error**)(error));
5671 // Enumeration used to describe the byte order of a D-Bus message.
5672 enum DBusMessageByteOrder /* Version 2.26 */ {
5673 BIG_ENDIAN = 66,
5674 LITTLE_ENDIAN = 108
5677 // VERSION: 2.26
5678 // Signature for function used in g_dbus_connection_add_filter().
5680 // A filter function is passed a #GDBusMessage and expected to return
5681 // a #GDBusMessage too. Passive filter functions that don't modify the
5682 // message can simply return the @message object:
5683 // |[
5684 // static GDBusMessage *
5685 // passive_filter (GDBusConnection *connection
5686 // GDBusMessage *message,
5687 // gboolean incoming,
5688 // gpointer user_data)
5689 // {
5690 // /<!-- -->* inspect @message *<!-- -->/
5691 // return message;
5692 // }
5693 // ]|
5694 // Filter functions that wants to drop a message can simply return %NULL:
5695 // |[
5696 // static GDBusMessage *
5697 // drop_filter (GDBusConnection *connection
5698 // GDBusMessage *message,
5699 // gboolean incoming,
5700 // gpointer user_data)
5701 // {
5702 // if (should_drop_message)
5703 // {
5704 // g_object_unref (message);
5705 // message = NULL;
5706 // }
5707 // return message;
5708 // }
5709 // ]|
5710 // Finally, a filter function may modify a message by copying it:
5711 // |[
5712 // static GDBusMessage *
5713 // modifying_filter (GDBusConnection *connection
5714 // GDBusMessage *message,
5715 // gboolean incoming,
5716 // gpointer user_data)
5717 // {
5718 // GDBusMessage *copy;
5719 // GError *error;
5721 // error = NULL;
5722 // copy = g_dbus_message_copy (message, &error);
5723 // /<!-- -->* handle @error being is set *<!-- -->/
5724 // g_object_unref (message);
5726 // /<!-- -->* modify @copy *<!-- -->/
5728 // return copy;
5729 // }
5730 // ]|
5731 // If the returned #GDBusMessage is different from @message and cannot
5732 // be sent on @connection (it could use features, such as file
5733 // descriptors, not compatible with @connection), then a warning is
5734 // logged to <emphasis>standard error</emphasis>. Applications can
5735 // check this ahead of time using g_dbus_message_to_blob() passing a
5736 // #GDBusCapabilityFlags value obtained from @connection.
5738 // g_object_unref() or %NULL to drop the message. Passive filter
5739 // functions can simply return the passed @message object.
5740 // RETURNS: A #GDBusMessage that will be freed with
5741 // <connection>: A #GDBusConnection.
5742 // <message>: A locked #GDBusMessage that the filter function takes ownership of.
5743 // <incoming>: %TRUE if it is a message received from the other peer, %FALSE if it is a message to be sent to the other peer.
5744 // <user_data>: User data passed when adding the filter.
5745 extern (C) alias DBusMessage* /*new*/ function (DBusConnection* connection, DBusMessage* message, int incoming, void* user_data) nothrow DBusMessageFilterFunction;
5747 // Message flags used in #GDBusMessage.
5748 enum DBusMessageFlags /* Version 2.26 */ {
5749 NONE = 0,
5750 NO_REPLY_EXPECTED = 1,
5751 NO_AUTO_START = 2
5753 // Header fields used in #GDBusMessage.
5754 enum DBusMessageHeaderField /* Version 2.26 */ {
5755 INVALID = 0,
5756 PATH = 1,
5757 INTERFACE = 2,
5758 MEMBER = 3,
5759 ERROR_NAME = 4,
5760 REPLY_SERIAL = 5,
5761 DESTINATION = 6,
5762 SENDER = 7,
5763 SIGNATURE = 8,
5764 NUM_UNIX_FDS = 9
5766 // Message types used in #GDBusMessage.
5767 enum DBusMessageType /* Version 2.26 */ {
5768 INVALID = 0,
5769 METHOD_CALL = 1,
5770 METHOD_RETURN = 2,
5771 ERROR = 3,
5772 SIGNAL = 4
5774 // Information about a method on an D-Bus interface.
5775 struct DBusMethodInfo /* Version 2.26 */ {
5776 int ref_count;
5777 char* name;
5778 DBusArgInfo*[666] in_args, out_args;
5779 DBusAnnotationInfo*[666] annotations;
5782 // VERSION: 2.26
5783 // If @info is statically allocated does nothing. Otherwise increases
5784 // the reference count.
5785 // RETURNS: The same @info.
5786 DBusMethodInfo* /*new*/ ref_()() nothrow {
5787 return g_dbus_method_info_ref(&this);
5790 // VERSION: 2.26
5791 // If @info is statically allocated, does nothing. Otherwise decreases
5792 // the reference count of @info. When its reference count drops to 0,
5793 // the memory used is freed.
5794 void unref()() nothrow {
5795 g_dbus_method_info_unref(&this);
5800 // Instances of the #GDBusMethodInvocation class are used when
5801 // handling D-Bus method calls. It provides a way to asynchronously
5802 // return results and errors.
5804 // The normal way to obtain a #GDBusMethodInvocation object is to receive
5805 // it as an argument to the handle_method_call() function in a
5806 // #GDBusInterfaceVTable that was passed to g_dbus_connection_register_object().
5807 struct DBusMethodInvocation /* : GObject.Object */ /* Version 2.26 */ {
5808 alias method_parent this;
5809 alias method_parent super_;
5810 alias method_parent object;
5811 GObject2.Object method_parent;
5814 // VERSION: 2.26
5815 // Gets the #GDBusConnection the method was invoked on.
5816 // RETURNS: A #GDBusConnection. Do not free, it is owned by @invocation.
5817 DBusConnection* get_connection()() nothrow {
5818 return g_dbus_method_invocation_get_connection(&this);
5821 // VERSION: 2.26
5822 // Gets the name of the D-Bus interface the method was invoked on.
5823 // RETURNS: A string. Do not free, it is owned by @invocation.
5824 char* get_interface_name()() nothrow {
5825 return g_dbus_method_invocation_get_interface_name(&this);
5828 // VERSION: 2.26
5829 // Gets the #GDBusMessage for the method invocation. This is useful if
5830 // you need to use low-level protocol features, such as UNIX file
5831 // descriptor passing, that cannot be properly expressed in the
5832 // #GVariant API.
5834 // See <xref linkend="gdbus-server"/> and <xref
5835 // linkend="gdbus-unix-fd-client"/> for an example of how to use this
5836 // low-level API to send and receive UNIX file descriptors.
5837 // RETURNS: #GDBusMessage. Do not free, it is owned by @invocation.
5838 DBusMessage* get_message()() nothrow {
5839 return g_dbus_method_invocation_get_message(&this);
5842 // VERSION: 2.26
5843 // Gets information about the method call, if any.
5844 // RETURNS: A #GDBusMethodInfo or %NULL. Do not free, it is owned by @invocation.
5845 DBusMethodInfo* get_method_info()() nothrow {
5846 return g_dbus_method_invocation_get_method_info(&this);
5849 // VERSION: 2.26
5850 // Gets the name of the method that was invoked.
5851 // RETURNS: A string. Do not free, it is owned by @invocation.
5852 char* get_method_name()() nothrow {
5853 return g_dbus_method_invocation_get_method_name(&this);
5856 // VERSION: 2.26
5857 // Gets the object path the method was invoked on.
5858 // RETURNS: A string. Do not free, it is owned by @invocation.
5859 char* get_object_path()() nothrow {
5860 return g_dbus_method_invocation_get_object_path(&this);
5863 // VERSION: 2.26
5864 // Gets the parameters of the method invocation. If there are no input
5865 // parameters then this will return a GVariant with 0 children rather than NULL.
5866 // RETURNS: A #GVariant tuple. Do not unref this because it is owned by @invocation.
5867 GLib2.Variant* get_parameters()() nothrow {
5868 return g_dbus_method_invocation_get_parameters(&this);
5871 // VERSION: 2.26
5872 // Gets the bus name that invoked the method.
5873 // RETURNS: A string. Do not free, it is owned by @invocation.
5874 char* get_sender()() nothrow {
5875 return g_dbus_method_invocation_get_sender(&this);
5878 // Unintrospectable method: get_user_data() / g_dbus_method_invocation_get_user_data()
5879 // VERSION: 2.26
5880 // Gets the @user_data #gpointer passed to g_dbus_connection_register_object().
5881 // RETURNS: A #gpointer.
5882 void* get_user_data()() nothrow {
5883 return g_dbus_method_invocation_get_user_data(&this);
5886 // VERSION: 2.26
5887 // Finishes handling a D-Bus method call by returning an error.
5889 // This method will free @invocation, you cannot use it afterwards.
5890 // <error_name>: A valid D-Bus error name.
5891 // <error_message>: A valid D-Bus error message.
5892 void return_dbus_error(AT0, AT1)(AT0 /*char*/ error_name, AT1 /*char*/ error_message) nothrow {
5893 g_dbus_method_invocation_return_dbus_error(&this, toCString!(char*)(error_name), toCString!(char*)(error_message));
5896 // Unintrospectable method: return_error() / g_dbus_method_invocation_return_error()
5897 // VERSION: 2.26
5898 // Finishes handling a D-Bus method call by returning an error.
5900 // See g_dbus_error_encode_gerror() for details about what error name
5901 // will be returned on the wire. In a nutshell, if the given error is
5902 // registered using g_dbus_error_register_error() the name given
5903 // during registration is used. Otherwise, a name of the form
5904 // <literal>org.gtk.GDBus.UnmappedGError.Quark...</literal> is
5905 // used. This provides transparent mapping of #GError between
5906 // applications using GDBus.
5908 // If you are writing an application intended to be portable,
5909 // <emphasis>always</emphasis> register errors with g_dbus_error_register_error()
5910 // or use g_dbus_method_invocation_return_dbus_error().
5912 // This method will free @invocation, you cannot use it afterwards.
5913 // <domain>: A #GQuark for the #GError error domain.
5914 // <code>: The error code.
5915 // <format>: printf()-style format.
5916 /+ Not available -- variadic methods unsupported - use the C function directly.
5917 alias g_dbus_method_invocation_return_error return_error; // Variadic
5920 // VERSION: 2.26
5921 // Like g_dbus_method_invocation_return_error() but without printf()-style formatting.
5923 // This method will free @invocation, you cannot use it afterwards.
5924 // <domain>: A #GQuark for the #GError error domain.
5925 // <code>: The error code.
5926 // <message>: The error message.
5927 void return_error_literal(AT0)(GLib2.Quark domain, int code, AT0 /*char*/ message) nothrow {
5928 g_dbus_method_invocation_return_error_literal(&this, domain, code, toCString!(char*)(message));
5931 // Unintrospectable method: return_error_valist() / g_dbus_method_invocation_return_error_valist()
5932 // VERSION: 2.26
5933 // Like g_dbus_method_invocation_return_error() but intended for
5934 // language bindings.
5936 // This method will free @invocation, you cannot use it afterwards.
5937 // <domain>: A #GQuark for the #GError error domain.
5938 // <code>: The error code.
5939 // <format>: printf()-style format.
5940 // <var_args>: #va_list of parameters for @format.
5941 void return_error_valist(AT0)(GLib2.Quark domain, int code, AT0 /*char*/ format, va_list var_args) nothrow {
5942 g_dbus_method_invocation_return_error_valist(&this, domain, code, toCString!(char*)(format), var_args);
5945 // VERSION: 2.26
5946 // Like g_dbus_method_invocation_return_error() but takes a #GError
5947 // instead of the error domain, error code and message.
5949 // This method will free @invocation, you cannot use it afterwards.
5950 // <error>: A #GError.
5951 void return_gerror(AT0)(AT0 /*GLib2.Error*/ error) nothrow {
5952 g_dbus_method_invocation_return_gerror(&this, UpCast!(GLib2.Error*)(error));
5955 // VERSION: 2.26
5956 // Finishes handling a D-Bus method call by returning @parameters.
5957 // If the @parameters GVariant is floating, it is consumed.
5959 // It is an error if @parameters is not of the right format.
5961 // This method will free @invocation, you cannot use it afterwards.
5962 // <parameters>: A #GVariant tuple with out parameters for the method or %NULL if not passing any parameters.
5963 void return_value(AT0)(AT0 /*GLib2.Variant*/ parameters=null) nothrow {
5964 g_dbus_method_invocation_return_value(&this, UpCast!(GLib2.Variant*)(parameters));
5967 // VERSION: 2.30
5968 // Like g_dbus_method_invocation_return_value() but also takes a #GUnixFDList.
5970 // This method is only available on UNIX.
5972 // This method will free @invocation, you cannot use it afterwards.
5973 // <parameters>: A #GVariant tuple with out parameters for the method or %NULL if not passing any parameters.
5974 // <fd_list>: A #GUnixFDList or %NULL.
5975 void return_value_with_unix_fd_list(AT0, AT1)(AT0 /*GLib2.Variant*/ parameters=null, AT1 /*UnixFDList*/ fd_list=null) nothrow {
5976 g_dbus_method_invocation_return_value_with_unix_fd_list(&this, UpCast!(GLib2.Variant*)(parameters), UpCast!(UnixFDList*)(fd_list));
5979 // Unintrospectable method: take_error() / g_dbus_method_invocation_take_error()
5980 // VERSION: 2.30
5981 // Like g_dbus_method_invocation_return_gerror() but takes ownership
5982 // of @error so the caller does not need to free it.
5984 // This method will free @invocation, you cannot use it afterwards.
5985 // <error>: A #GError.
5986 void take_error(AT0)(AT0 /*GLib2.Error*/ error) nothrow {
5987 g_dbus_method_invocation_take_error(&this, UpCast!(GLib2.Error*)(error));
5991 // Information about nodes in a remote object hierarchy.
5992 struct DBusNodeInfo /* Version 2.26 */ {
5993 int ref_count;
5994 char* path;
5995 DBusInterfaceInfo*[666] interfaces;
5996 DBusNodeInfo*[666] nodes;
5997 DBusAnnotationInfo*[666] annotations;
6000 // VERSION: 2.26
6001 // Parses @xml_data and returns a #GDBusNodeInfo representing the data.
6003 // Note that this routine is using a
6004 // <link linkend="glib-Simple-XML-Subset-Parser.description">GMarkup</link>-based
6005 // parser that only accepts a subset of valid XML documents.
6007 // with g_dbus_node_info_unref().
6008 // RETURNS: A #GDBusNodeInfo structure or %NULL if @error is set. Free
6009 // <xml_data>: Valid D-Bus introspection XML.
6010 static DBusNodeInfo* /*new*/ new_for_xml(AT0, AT1)(AT0 /*char*/ xml_data, AT1 /*GLib2.Error**/ error=null) nothrow {
6011 return g_dbus_node_info_new_for_xml(toCString!(char*)(xml_data), UpCast!(GLib2.Error**)(error));
6013 static auto opCall(AT0, AT1)(AT0 /*char*/ xml_data, AT1 /*GLib2.Error**/ error=null) {
6014 return g_dbus_node_info_new_for_xml(toCString!(char*)(xml_data), UpCast!(GLib2.Error**)(error));
6017 // VERSION: 2.26
6018 // Appends an XML representation of @info (and its children) to @string_builder.
6020 // This function is typically used for generating introspection XML documents at run-time for
6021 // handling the <literal>org.freedesktop.DBus.Introspectable.Introspect</literal> method.
6022 // <indent>: Indentation level.
6023 // <string_builder>: A #GString to to append XML data to.
6024 void generate_xml(AT0)(uint indent, /*out*/ AT0 /*GLib2.String*/ string_builder) nothrow {
6025 g_dbus_node_info_generate_xml(&this, indent, UpCast!(GLib2.String*)(string_builder));
6028 // VERSION: 2.26
6029 // Looks up information about an interface.
6031 // This cost of this function is O(n) in number of interfaces.
6032 // RETURNS: A #GDBusInterfaceInfo or %NULL if not found. Do not free, it is owned by @info.
6033 // <name>: A D-Bus interface name.
6034 DBusInterfaceInfo* lookup_interface(AT0)(AT0 /*char*/ name) nothrow {
6035 return g_dbus_node_info_lookup_interface(&this, toCString!(char*)(name));
6038 // VERSION: 2.26
6039 // If @info is statically allocated does nothing. Otherwise increases
6040 // the reference count.
6041 // RETURNS: The same @info.
6042 DBusNodeInfo* /*new*/ ref_()() nothrow {
6043 return g_dbus_node_info_ref(&this);
6046 // VERSION: 2.26
6047 // If @info is statically allocated, does nothing. Otherwise decreases
6048 // the reference count of @info. When its reference count drops to 0,
6049 // the memory used is freed.
6050 void unref()() nothrow {
6051 g_dbus_node_info_unref(&this);
6056 // The #GDBusObject type is the base type for D-Bus objects on both
6057 // the service side (see #GDBusObjectSkeleton) and the client side
6058 // (see #GDBusObjectProxy). It is essentially just a container of
6059 // interfaces.
6060 struct DBusObject /* Interface */ {
6061 mixin template __interface__() {
6062 // VERSION: 2.30
6063 // Gets the D-Bus interface with name @interface_name associated with
6064 // @object, if any.
6066 // #GDBusInterface that must be freed with g_object_unref().
6067 // RETURNS: %NULL if not found, otherwise a
6068 // <interface_name>: A D-Bus interface name.
6069 DBusInterface* /*new*/ get_interface(AT0)(AT0 /*char*/ interface_name) nothrow {
6070 return g_dbus_object_get_interface(cast(DBusObject*)&this, toCString!(char*)(interface_name));
6073 // VERSION: 2.30
6074 // Gets the D-Bus interfaces associated with @object.
6076 // The returned list must be freed by g_list_free() after each element has been freed
6077 // with g_object_unref().
6078 // RETURNS: A list of #GDBusInterface instances.
6079 GLib2.List* /*new*/ get_interfaces()() nothrow {
6080 return g_dbus_object_get_interfaces(cast(DBusObject*)&this);
6083 // VERSION: 2.30
6084 // Gets the object path for @object.
6085 // RETURNS: A string owned by @object. Do not free.
6086 char* get_object_path()() nothrow {
6087 return g_dbus_object_get_object_path(cast(DBusObject*)&this);
6090 // VERSION: 2.30
6091 // Emitted when @interface is added to @object.
6092 // <interface>: The #GDBusInterface that was added.
6093 extern (C) alias static void function (DBusObject* this_, DBusInterface* interface_, void* user_data=null) nothrow signal_interface_added;
6095 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
6096 return super_.signal_connect!name(cb, data, cf);
6099 ulong signal_connect(string name:"interface-added", CB/*:signal_interface_added*/)
6100 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
6101 if (is(typeof(cb)==signal_interface_added)||_ttmm!(CB, signal_interface_added)()) {
6102 return signal_connect_data!()(&this, cast(char*)"interface-added",
6103 cast(GObject2.Callback)cb, data, null, cf);
6106 // VERSION: 2.30
6107 // Emitted when @interface is removed from @object.
6108 // <interface>: The #GDBusInterface that was removed.
6109 extern (C) alias static void function (DBusObject* this_, DBusInterface* interface_, void* user_data=null) nothrow signal_interface_removed;
6110 ulong signal_connect(string name:"interface-removed", CB/*:signal_interface_removed*/)
6111 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
6112 if (is(typeof(cb)==signal_interface_removed)||_ttmm!(CB, signal_interface_removed)()) {
6113 return signal_connect_data!()(&this, cast(char*)"interface-removed",
6114 cast(GObject2.Callback)cb, data, null, cf);
6117 mixin __interface__;
6120 // Base object type for D-Bus objects.
6121 struct DBusObjectIface /* Version 2.30 */ {
6122 GObject2.TypeInterface parent_iface;
6123 // RETURNS: A string owned by @object. Do not free.
6124 extern (C) char* function (DBusObject* object) nothrow get_object_path;
6125 // RETURNS: A list of #GDBusInterface instances.
6126 extern (C) GLib2.List* /*new*/ function (DBusObject* object) nothrow get_interfaces;
6128 // RETURNS: %NULL if not found, otherwise a
6129 // <interface_name>: A D-Bus interface name.
6130 extern (C) DBusInterface* /*new*/ function (DBusObject* object, char* interface_name) nothrow get_interface;
6131 extern (C) void function (DBusObject* object, DBusInterface* interface_) nothrow interface_added;
6132 extern (C) void function (DBusObject* object, DBusInterface* interface_) nothrow interface_removed;
6136 // The #GDBusObjectManager type is the base type for service- and
6137 // client-side implementations of the standardized <ulink
6138 // url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">org.freedesktop.DBus.ObjectManager</ulink>
6139 // interface.
6141 // See #GDBusObjectManagerClient for the client-side implementation
6142 // and #GDBusObjectManagerServer for the service-side implementation.
6143 struct DBusObjectManager /* Interface */ {
6144 mixin template __interface__() {
6145 // VERSION: 2.30
6146 // Gets the interface proxy for @interface_name at @object_path, if
6147 // any.
6149 // with g_object_unref().
6150 // RETURNS: A #GDBusInterface instance or %NULL. Free
6151 // <object_path>: Object path to lookup.
6152 // <interface_name>: D-Bus interface name to lookup.
6153 DBusInterface* /*new*/ get_interface(AT0, AT1)(AT0 /*char*/ object_path, AT1 /*char*/ interface_name) nothrow {
6154 return g_dbus_object_manager_get_interface(cast(DBusObjectManager*)&this, toCString!(char*)(object_path), toCString!(char*)(interface_name));
6157 // VERSION: 2.30
6158 // Gets the #GDBusObjectProxy at @object_path, if any.
6160 // g_object_unref().
6161 // RETURNS: A #GDBusObject or %NULL. Free with
6162 // <object_path>: Object path to lookup.
6163 DBusObject* /*new*/ get_object(AT0)(AT0 /*char*/ object_path) nothrow {
6164 return g_dbus_object_manager_get_object(cast(DBusObjectManager*)&this, toCString!(char*)(object_path));
6167 // VERSION: 2.30
6168 // Gets the object path that @manager is for.
6169 // RETURNS: A string owned by @manager. Do not free.
6170 char* get_object_path()() nothrow {
6171 return g_dbus_object_manager_get_object_path(cast(DBusObjectManager*)&this);
6174 // VERSION: 2.30
6175 // Gets all #GDBusObject objects known to @manager.
6177 // #GDBusObject objects. The returned list should be freed with
6178 // g_list_free() after each element has been freed with
6179 // g_object_unref().
6180 // RETURNS: A list of
6181 GLib2.List* /*new*/ get_objects()() nothrow {
6182 return g_dbus_object_manager_get_objects(cast(DBusObjectManager*)&this);
6185 // VERSION: 2.30
6186 // Emitted when @interface is added to @object.
6188 // This signal exists purely as a convenience to avoid having to
6189 // connect signals to all objects managed by @manager.
6190 // <object>: The #GDBusObject on which an interface was added.
6191 // <interface>: The #GDBusInterface that was added.
6192 extern (C) alias static void function (DBusObjectManager* this_, DBusObject* object, DBusInterface* interface_, void* user_data=null) nothrow signal_interface_added;
6194 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
6195 return super_.signal_connect!name(cb, data, cf);
6198 ulong signal_connect(string name:"interface-added", CB/*:signal_interface_added*/)
6199 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
6200 if (is(typeof(cb)==signal_interface_added)||_ttmm!(CB, signal_interface_added)()) {
6201 return signal_connect_data!()(&this, cast(char*)"interface-added",
6202 cast(GObject2.Callback)cb, data, null, cf);
6205 // VERSION: 2.30
6206 // Emitted when @interface has been removed from @object.
6208 // This signal exists purely as a convenience to avoid having to
6209 // connect signals to all objects managed by @manager.
6210 // <object>: The #GDBusObject on which an interface was removed.
6211 // <interface>: The #GDBusInterface that was removed.
6212 extern (C) alias static void function (DBusObjectManager* this_, DBusObject* object, DBusInterface* interface_, void* user_data=null) nothrow signal_interface_removed;
6213 ulong signal_connect(string name:"interface-removed", CB/*:signal_interface_removed*/)
6214 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
6215 if (is(typeof(cb)==signal_interface_removed)||_ttmm!(CB, signal_interface_removed)()) {
6216 return signal_connect_data!()(&this, cast(char*)"interface-removed",
6217 cast(GObject2.Callback)cb, data, null, cf);
6220 // VERSION: 2.30
6221 // Emitted when @object is added to @manager.
6222 // <object>: The #GDBusObject that was added.
6223 extern (C) alias static void function (DBusObjectManager* this_, DBusObject* object, void* user_data=null) nothrow signal_object_added;
6224 ulong signal_connect(string name:"object-added", CB/*:signal_object_added*/)
6225 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
6226 if (is(typeof(cb)==signal_object_added)||_ttmm!(CB, signal_object_added)()) {
6227 return signal_connect_data!()(&this, cast(char*)"object-added",
6228 cast(GObject2.Callback)cb, data, null, cf);
6231 // VERSION: 2.30
6232 // Emitted when @object is removed from @manager.
6233 // <object>: The #GDBusObject that was removed.
6234 extern (C) alias static void function (DBusObjectManager* this_, DBusObject* object, void* user_data=null) nothrow signal_object_removed;
6235 ulong signal_connect(string name:"object-removed", CB/*:signal_object_removed*/)
6236 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
6237 if (is(typeof(cb)==signal_object_removed)||_ttmm!(CB, signal_object_removed)()) {
6238 return signal_connect_data!()(&this, cast(char*)"object-removed",
6239 cast(GObject2.Callback)cb, data, null, cf);
6242 mixin __interface__;
6246 // #GDBusObjectManagerClient is used to create, monitor and delete object
6247 // proxies for remote objects exported by a #GDBusObjectManagerServer (or any
6248 // code implementing the <ulink
6249 // url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">org.freedesktop.DBus.ObjectManager</ulink>
6250 // interface).
6252 // Once an instance of this type has been created, you can connect to
6253 // the #GDBusObjectManager::object-added and
6254 // #GDBusObjectManager::object-removed signals and inspect the
6255 // #GDBusObjectProxy objects returned by
6256 // g_dbus_object_manager_get_objects().
6258 // If the name for a #GDBusObjectManagerClient is not owned by anyone at
6259 // object construction time, the default behavior is to request the
6260 // message bus to launch an owner for the name. This behavior can be
6261 // disabled using the %G_DBUS_OBJECT_MANAGER_CLIENT_FLAGS_DO_NOT_AUTO_START
6262 // flag. It's also worth noting that this only works if the name of
6263 // interest is activatable in the first place. E.g. in some cases it
6264 // is not possible to launch an owner for the requested name. In this
6265 // case, #GDBusObjectManagerClient object construction still succeeds but
6266 // there will be no object proxies
6267 // (e.g. g_dbus_object_manager_get_objects() returns the empty list) and
6268 // the #GDBusObjectManagerClient:name-owner property is %NULL.
6270 // The owner of the requested name can come and go (for example
6271 // consider a system service being restarted) – #GDBusObjectManagerClient
6272 // handles this case too; simply connect to the #GObject::notify
6273 // signal to watch for changes on the #GDBusObjectManagerClient:name-owner
6274 // property. When the name owner vanishes, the behavior is that
6275 // #GDBusObjectManagerClient:name-owner is set to %NULL (this includes
6276 // emission of the #GObject::notify signal) and then
6277 // #GDBusObjectManager::object-removed signals are synthesized
6278 // for all currently existing object proxies. Since
6279 // #GDBusObjectManagerClient:name-owner is %NULL when this happens, you can
6280 // use this information to disambiguate a synthesized signal from a
6281 // genuine signal caused by object removal on the remote
6282 // #GDBusObjectManager. Similarly, when a new name owner appears,
6283 // #GDBusObjectManager::object-added signals are synthesized
6284 // while #GDBusObjectManagerClient:name-owner is still %NULL. Only when all
6285 // object proxies have been added, the #GDBusObjectManagerClient:name-owner
6286 // is set to the new name owner (this includes emission of the
6287 // #GObject::notify signal). Furthermore, you are guaranteed that
6288 // #GDBusObjectManagerClient:name-owner will alternate between a name owner
6289 // (e.g. <literal>:1.42</literal>) and %NULL even in the case where
6290 // the name of interest is atomically replaced
6292 // Ultimately, #GDBusObjectManagerClient is used to obtain #GDBusProxy
6293 // instances. All signals (including the
6294 // <literal>org.freedesktop.DBus.Properties::PropertiesChanged</literal>
6295 // signal) delivered to #GDBusProxy instances are guaranteed to
6296 // originate from the name owner. This guarantee along with the
6297 // behavior described above, means that certain race conditions
6298 // including the <emphasis><quote>half the proxy is from the old owner
6299 // and the other half is from the new owner</quote></emphasis> problem
6300 // cannot happen.
6302 // To avoid having the application connect to signals on the returned
6303 // #GDBusObjectProxy and #GDBusProxy objects, the
6304 // #GDBusObject::interface-added,
6305 // #GDBusObject::interface-removed,
6306 // #GDBusProxy::g-properties-changed and
6307 // #GDBusProxy::g-signal signals
6308 // are also emitted on the #GDBusObjectManagerClient instance managing these
6309 // objects. The signals emitted are
6310 // #GDBusObjectManager::interface-added,
6311 // #GDBusObjectManager::interface-removed,
6312 // #GDBusObjectManagerClient::interface-proxy-properties-changed and
6313 // #GDBusObjectManagerClient::interface-proxy-signal.
6315 // Note that all callbacks and signals are emitted in the
6316 // <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
6317 // that the #GDBusObjectManagerClient object was constructed
6318 // in. Additionally, the #GDBusObjectProxy and #GDBusProxy objects
6319 // originating from the #GDBusObjectManagerClient object will be created in
6320 // the same context and, consequently, will deliver signals in the
6321 // same main loop.
6322 struct DBusObjectManagerClient /* : GObject.Object */ /* Version 2.30 */ {
6323 mixin AsyncInitable.__interface__;
6324 mixin DBusObjectManager.__interface__;
6325 mixin Initable.__interface__;
6326 alias parent_instance this;
6327 alias parent_instance super_;
6328 alias parent_instance object;
6329 GObject2.Object parent_instance;
6330 private DBusObjectManagerClientPrivate* priv;
6333 // VERSION: 2.30
6334 // Finishes an operation started with g_dbus_object_manager_client_new().
6336 // #GDBusObjectManagerClient object or %NULL if @error is set. Free
6337 // with g_object_unref().
6338 // RETURNS: A
6339 // <res>: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_object_manager_client_new().
6340 static DBusObjectManagerClient* /*new*/ new_finish(AT0, AT1)(AT0 /*AsyncResult*/ res, AT1 /*GLib2.Error**/ error=null) nothrow {
6341 return g_dbus_object_manager_client_new_finish(UpCast!(AsyncResult*)(res), UpCast!(GLib2.Error**)(error));
6343 static auto opCall(AT0, AT1)(AT0 /*AsyncResult*/ res, AT1 /*GLib2.Error**/ error=null) {
6344 return g_dbus_object_manager_client_new_finish(UpCast!(AsyncResult*)(res), UpCast!(GLib2.Error**)(error));
6347 // VERSION: 2.30
6348 // Finishes an operation started with g_dbus_object_manager_client_new_for_bus().
6350 // #GDBusObjectManagerClient object or %NULL if @error is set. Free
6351 // with g_object_unref().
6352 // RETURNS: A
6353 // <res>: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_object_manager_client_new_for_bus().
6354 static DBusObjectManagerClient* /*new*/ new_for_bus_finish(AT0, AT1)(AT0 /*AsyncResult*/ res, AT1 /*GLib2.Error**/ error=null) nothrow {
6355 return g_dbus_object_manager_client_new_for_bus_finish(UpCast!(AsyncResult*)(res), UpCast!(GLib2.Error**)(error));
6357 static auto opCall(AT0, AT1)(AT0 /*AsyncResult*/ res, AT1 /*GLib2.Error**/ error=null) {
6358 return g_dbus_object_manager_client_new_for_bus_finish(UpCast!(AsyncResult*)(res), UpCast!(GLib2.Error**)(error));
6361 // VERSION: 2.30
6362 // Like g_dbus_object_manager_client_new_sync() but takes a #GBusType instead
6363 // of a #GDBusConnection.
6365 // This is a synchronous failable constructor - the calling thread is
6366 // blocked until a reply is received. See g_dbus_object_manager_client_new_for_bus()
6367 // for the asynchronous version.
6369 // #GDBusObjectManagerClient object or %NULL if @error is set. Free
6370 // with g_object_unref().
6371 // RETURNS: A
6372 // <bus_type>: A #GBusType.
6373 // <flags>: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
6374 // <name>: The owner of the control object (unique or well-known name).
6375 // <object_path>: The object path of the control object.
6376 // <get_proxy_type_func>: A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
6377 // <get_proxy_type_user_data>: User data to pass to @get_proxy_type_func.
6378 // <get_proxy_type_destroy_notify>: Free function for @get_proxy_type_user_data or %NULL.
6379 // <cancellable>: A #GCancellable or %NULL
6380 static DBusObjectManagerClient* /*new*/ new_for_bus_sync(AT0, AT1, AT2, AT3, AT4)(BusType bus_type, DBusObjectManagerClientFlags flags, AT0 /*char*/ name, AT1 /*char*/ object_path, DBusProxyTypeFunc get_proxy_type_func, AT2 /*void*/ get_proxy_type_user_data, GLib2.DestroyNotify get_proxy_type_destroy_notify, AT3 /*Cancellable*/ cancellable, AT4 /*GLib2.Error**/ error=null) nothrow {
6381 return g_dbus_object_manager_client_new_for_bus_sync(bus_type, flags, toCString!(char*)(name), toCString!(char*)(object_path), get_proxy_type_func, UpCast!(void*)(get_proxy_type_user_data), get_proxy_type_destroy_notify, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
6383 static auto opCall(AT0, AT1, AT2, AT3, AT4)(BusType bus_type, DBusObjectManagerClientFlags flags, AT0 /*char*/ name, AT1 /*char*/ object_path, DBusProxyTypeFunc get_proxy_type_func, AT2 /*void*/ get_proxy_type_user_data, GLib2.DestroyNotify get_proxy_type_destroy_notify, AT3 /*Cancellable*/ cancellable, AT4 /*GLib2.Error**/ error=null) {
6384 return g_dbus_object_manager_client_new_for_bus_sync(bus_type, flags, toCString!(char*)(name), toCString!(char*)(object_path), get_proxy_type_func, UpCast!(void*)(get_proxy_type_user_data), get_proxy_type_destroy_notify, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
6387 // VERSION: 2.30
6388 // Creates a new #GDBusObjectManagerClient object.
6390 // This is a synchronous failable constructor - the calling thread is
6391 // blocked until a reply is received. See g_dbus_object_manager_client_new()
6392 // for the asynchronous version.
6394 // #GDBusObjectManagerClient object or %NULL if @error is set. Free
6395 // with g_object_unref().
6396 // RETURNS: A
6397 // <connection>: A #GDBusConnection.
6398 // <flags>: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
6399 // <name>: The owner of the control object (unique or well-known name).
6400 // <object_path>: The object path of the control object.
6401 // <get_proxy_type_func>: A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
6402 // <get_proxy_type_user_data>: User data to pass to @get_proxy_type_func.
6403 // <get_proxy_type_destroy_notify>: Free function for @get_proxy_type_user_data or %NULL.
6404 // <cancellable>: A #GCancellable or %NULL
6405 static DBusObjectManagerClient* /*new*/ new_sync(AT0, AT1, AT2, AT3, AT4, AT5)(AT0 /*DBusConnection*/ connection, DBusObjectManagerClientFlags flags, AT1 /*char*/ name, AT2 /*char*/ object_path, DBusProxyTypeFunc get_proxy_type_func, AT3 /*void*/ get_proxy_type_user_data, GLib2.DestroyNotify get_proxy_type_destroy_notify, AT4 /*Cancellable*/ cancellable, AT5 /*GLib2.Error**/ error=null) nothrow {
6406 return g_dbus_object_manager_client_new_sync(UpCast!(DBusConnection*)(connection), flags, toCString!(char*)(name), toCString!(char*)(object_path), get_proxy_type_func, UpCast!(void*)(get_proxy_type_user_data), get_proxy_type_destroy_notify, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
6408 static auto opCall(AT0, AT1, AT2, AT3, AT4, AT5)(AT0 /*DBusConnection*/ connection, DBusObjectManagerClientFlags flags, AT1 /*char*/ name, AT2 /*char*/ object_path, DBusProxyTypeFunc get_proxy_type_func, AT3 /*void*/ get_proxy_type_user_data, GLib2.DestroyNotify get_proxy_type_destroy_notify, AT4 /*Cancellable*/ cancellable, AT5 /*GLib2.Error**/ error=null) {
6409 return g_dbus_object_manager_client_new_sync(UpCast!(DBusConnection*)(connection), flags, toCString!(char*)(name), toCString!(char*)(object_path), get_proxy_type_func, UpCast!(void*)(get_proxy_type_user_data), get_proxy_type_destroy_notify, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
6412 // VERSION: 2.30
6413 // Asynchronously creates a new #GDBusObjectManagerClient object.
6415 // This is an asynchronous failable constructor. When the result is
6416 // ready, @callback will be invoked in the
6417 // <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
6418 // of the thread you are calling this method from. You can
6419 // then call g_dbus_object_manager_client_new_finish() to get the result. See
6420 // g_dbus_object_manager_client_new_sync() for the synchronous version.
6421 // <connection>: A #GDBusConnection.
6422 // <flags>: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
6423 // <name>: The owner of the control object (unique or well-known name).
6424 // <object_path>: The object path of the control object.
6425 // <get_proxy_type_func>: A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
6426 // <get_proxy_type_user_data>: User data to pass to @get_proxy_type_func.
6427 // <get_proxy_type_destroy_notify>: Free function for @get_proxy_type_user_data or %NULL.
6428 // <cancellable>: A #GCancellable or %NULL
6429 // <callback>: A #GAsyncReadyCallback to call when the request is satisfied.
6430 // <user_data>: The data to pass to @callback.
6431 static void new_(AT0, AT1, AT2, AT3, AT4, AT5)(AT0 /*DBusConnection*/ connection, DBusObjectManagerClientFlags flags, AT1 /*char*/ name, AT2 /*char*/ object_path, DBusProxyTypeFunc get_proxy_type_func, AT3 /*void*/ get_proxy_type_user_data, GLib2.DestroyNotify get_proxy_type_destroy_notify, AT4 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT5 /*void*/ user_data) nothrow {
6432 g_dbus_object_manager_client_new(UpCast!(DBusConnection*)(connection), flags, toCString!(char*)(name), toCString!(char*)(object_path), get_proxy_type_func, UpCast!(void*)(get_proxy_type_user_data), get_proxy_type_destroy_notify, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
6435 // VERSION: 2.30
6436 // Like g_dbus_object_manager_client_new() but takes a #GBusType instead of a
6437 // #GDBusConnection.
6439 // This is an asynchronous failable constructor. When the result is
6440 // ready, @callback will be invoked in the
6441 // <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
6442 // of the thread you are calling this method from. You can
6443 // then call g_dbus_object_manager_client_new_for_bus_finish() to get the result. See
6444 // g_dbus_object_manager_client_new_for_bus_sync() for the synchronous version.
6445 // <bus_type>: A #GBusType.
6446 // <flags>: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
6447 // <name>: The owner of the control object (unique or well-known name).
6448 // <object_path>: The object path of the control object.
6449 // <get_proxy_type_func>: A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
6450 // <get_proxy_type_user_data>: User data to pass to @get_proxy_type_func.
6451 // <get_proxy_type_destroy_notify>: Free function for @get_proxy_type_user_data or %NULL.
6452 // <cancellable>: A #GCancellable or %NULL
6453 // <callback>: A #GAsyncReadyCallback to call when the request is satisfied.
6454 // <user_data>: The data to pass to @callback.
6455 static void new_for_bus(AT0, AT1, AT2, AT3, AT4)(BusType bus_type, DBusObjectManagerClientFlags flags, AT0 /*char*/ name, AT1 /*char*/ object_path, DBusProxyTypeFunc get_proxy_type_func, AT2 /*void*/ get_proxy_type_user_data, GLib2.DestroyNotify get_proxy_type_destroy_notify, AT3 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT4 /*void*/ user_data) nothrow {
6456 g_dbus_object_manager_client_new_for_bus(bus_type, flags, toCString!(char*)(name), toCString!(char*)(object_path), get_proxy_type_func, UpCast!(void*)(get_proxy_type_user_data), get_proxy_type_destroy_notify, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
6459 // VERSION: 2.30
6460 // Gets the #GDBusConnection used by @manager.
6462 // the object belongs to @manager.
6463 // RETURNS: A #GDBusConnection object. Do not free,
6464 DBusConnection* get_connection()() nothrow {
6465 return g_dbus_object_manager_client_get_connection(&this);
6468 // VERSION: 2.30
6469 // Gets the flags that @manager was constructed with.
6471 // enumeration.
6472 // RETURNS: Zero of more flags from the #GDBusObjectManagerClientFlags
6473 DBusObjectManagerClientFlags get_flags()() nothrow {
6474 return g_dbus_object_manager_client_get_flags(&this);
6477 // VERSION: 2.30
6478 // Gets the name that @manager is for.
6480 // belongs to @manager.
6481 // RETURNS: A unique or well-known name. Do not free, the string
6482 char* get_name()() nothrow {
6483 return g_dbus_object_manager_client_get_name(&this);
6486 // VERSION: 2.30
6487 // The unique name that owns the name that @manager is for or %NULL if
6488 // no-one currently owns that name. You can connect to the
6489 // #GObject::notify signal to track changes to the
6490 // #GDBusObjectManagerClient:name-owner property.
6492 // g_free().
6493 // RETURNS: The name owner or %NULL if no name owner exists. Free with
6494 char* /*new*/ get_name_owner()() nothrow {
6495 return g_dbus_object_manager_client_get_name_owner(&this);
6498 // VERSION: 2.30
6499 // Emitted when one or more D-Bus properties on proxy changes. The
6500 // local cache has already been updated when this signal fires. Note
6501 // that both @changed_properties and @invalidated_properties are
6502 // guaranteed to never be %NULL (either may be empty though).
6504 // This signal exists purely as a convenience to avoid having to
6505 // connect signals to all interface proxies managed by @manager.
6507 // This signal is emitted in the
6508 // <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
6509 // that @manager was constructed in.
6510 // <object_proxy>: The #GDBusObjectProxy on which an interface has properties that are changing.
6511 // <interface_proxy>: The #GDBusProxy that has properties that are changing.
6512 // <changed_properties>: A #GVariant containing the properties that changed.
6513 // <invalidated_properties>: A %NULL terminated array of properties that was invalidated.
6514 extern (C) alias static void function (DBusObjectManagerClient* this_, DBusObjectProxy* object_proxy, DBusProxy* interface_proxy, GLib2.Variant* changed_properties, char* invalidated_properties, void* user_data=null) nothrow signal_interface_proxy_properties_changed;
6516 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
6517 return super_.signal_connect!name(cb, data, cf);
6520 ulong signal_connect(string name:"interface-proxy-properties-changed", CB/*:signal_interface_proxy_properties_changed*/)
6521 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
6522 if (is(typeof(cb)==signal_interface_proxy_properties_changed)||_ttmm!(CB, signal_interface_proxy_properties_changed)()) {
6523 return signal_connect_data!()(&this, cast(char*)"interface-proxy-properties-changed",
6524 cast(GObject2.Callback)cb, data, null, cf);
6527 // VERSION: 2.30
6528 // Emitted when a D-Bus signal is received on @interface_proxy.
6530 // This signal exists purely as a convenience to avoid having to
6531 // connect signals to all interface proxies managed by @manager.
6533 // This signal is emitted in the
6534 // <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
6535 // that @manager was constructed in.
6536 // <object_proxy>: The #GDBusObjectProxy on which an interface is emitting a D-Bus signal.
6537 // <interface_proxy>: The #GDBusProxy that is emitting a D-Bus signal.
6538 // <sender_name>: The sender of the signal or NULL if the connection is not a bus connection.
6539 // <signal_name>: The signal name.
6540 // <parameters>: A #GVariant tuple with parameters for the signal.
6541 extern (C) alias static void function (DBusObjectManagerClient* this_, DBusObjectProxy* object_proxy, DBusProxy* interface_proxy, char* sender_name, char* signal_name, GLib2.Variant* parameters, void* user_data=null) nothrow signal_interface_proxy_signal;
6542 ulong signal_connect(string name:"interface-proxy-signal", CB/*:signal_interface_proxy_signal*/)
6543 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
6544 if (is(typeof(cb)==signal_interface_proxy_signal)||_ttmm!(CB, signal_interface_proxy_signal)()) {
6545 return signal_connect_data!()(&this, cast(char*)"interface-proxy-signal",
6546 cast(GObject2.Callback)cb, data, null, cf);
6550 // Class structure for #GDBusObjectManagerClient.
6551 struct DBusObjectManagerClientClass /* Version 2.30 */ {
6552 GObject2.ObjectClass parent_class;
6553 extern (C) void function (DBusObjectManagerClient* manager, DBusObjectProxy* object_proxy, DBusProxy* interface_proxy, char* sender_name, char* signal_name, GLib2.Variant* parameters) nothrow interface_proxy_signal;
6554 extern (C) void function (DBusObjectManagerClient* manager, DBusObjectProxy* object_proxy, DBusProxy* interface_proxy, GLib2.Variant* changed_properties, char** invalidated_properties) nothrow interface_proxy_properties_changed;
6555 private void*[8] padding;
6558 // Flags used when constructing a #GDBusObjectManagerClient.
6559 enum DBusObjectManagerClientFlags /* Version 2.30 */ {
6560 NONE = 0,
6561 DO_NOT_AUTO_START = 1
6563 struct DBusObjectManagerClientPrivate {
6566 // Base type for D-Bus object managers.
6567 struct DBusObjectManagerIface /* Version 2.30 */ {
6568 GObject2.TypeInterface parent_iface;
6569 // RETURNS: A string owned by @manager. Do not free.
6570 extern (C) char* function (DBusObjectManager* manager) nothrow get_object_path;
6571 // RETURNS: A list of
6572 extern (C) GLib2.List* /*new*/ function (DBusObjectManager* manager) nothrow get_objects;
6574 // RETURNS: A #GDBusObject or %NULL. Free with
6575 // <object_path>: Object path to lookup.
6576 extern (C) DBusObject* /*new*/ function (DBusObjectManager* manager, char* object_path) nothrow get_object;
6578 // RETURNS: A #GDBusInterface instance or %NULL. Free
6579 // <object_path>: Object path to lookup.
6580 // <interface_name>: D-Bus interface name to lookup.
6581 extern (C) DBusInterface* /*new*/ function (DBusObjectManager* manager, char* object_path, char* interface_name) nothrow get_interface;
6582 extern (C) void function (DBusObjectManager* manager, DBusObject* object) nothrow object_added;
6583 extern (C) void function (DBusObjectManager* manager, DBusObject* object) nothrow object_removed;
6584 extern (C) void function (DBusObjectManager* manager, DBusObject* object, DBusInterface* interface_) nothrow interface_added;
6585 extern (C) void function (DBusObjectManager* manager, DBusObject* object, DBusInterface* interface_) nothrow interface_removed;
6589 // #GDBusObjectManagerServer is used to export #GDBusObject instances using
6590 // the standardized <ulink
6591 // url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">org.freedesktop.DBus.ObjectManager</ulink>
6592 // interface. For example, remote D-Bus clients can get all objects
6593 // and properties in a single call. Additionally, any change in the
6594 // object hierarchy is broadcast using signals. This means that D-Bus
6595 // clients can keep caches up to date by only listening to D-Bus
6596 // signals.
6598 // See #GDBusObjectManagerClient for the client-side code that is
6599 // intended to be used with #GDBusObjectManagerServer or any D-Bus
6600 // object implementing the org.freedesktop.DBus.ObjectManager
6601 // interface.
6602 struct DBusObjectManagerServer /* : GObject.Object */ /* Version 2.30 */ {
6603 mixin DBusObjectManager.__interface__;
6604 alias parent_instance this;
6605 alias parent_instance super_;
6606 alias parent_instance object;
6607 GObject2.Object parent_instance;
6608 private DBusObjectManagerServerPrivate* priv;
6611 // VERSION: 2.30
6612 // Creates a new #GDBusObjectManagerServer object.
6614 // The returned server isn't yet exported on any connection. To do so,
6615 // use g_dbus_object_manager_server_set_connection(). Normally you
6616 // want to export all of your objects before doing so to avoid <ulink
6617 // url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">InterfacesAdded</ulink>
6618 // signals being emitted.
6619 // RETURNS: A #GDBusObjectManagerServer object. Free with g_object_unref().
6620 // <object_path>: The object path to export the manager object at.
6621 static DBusObjectManagerServer* /*new*/ new_(AT0)(AT0 /*char*/ object_path) nothrow {
6622 return g_dbus_object_manager_server_new(toCString!(char*)(object_path));
6624 static auto opCall(AT0)(AT0 /*char*/ object_path) {
6625 return g_dbus_object_manager_server_new(toCString!(char*)(object_path));
6628 // VERSION: 2.30
6629 // Exports @object on @manager.
6631 // If there is already a #GDBusObject exported at the object path,
6632 // then the old object is removed.
6634 // The object path for @object must be in the hierarchy rooted by the
6635 // object path for @manager.
6637 // Note that @manager will take a reference on @object for as long as
6638 // it is exported.
6639 // <object>: A #GDBusObjectSkeleton.
6640 void export_(AT0)(AT0 /*DBusObjectSkeleton*/ object) nothrow {
6641 g_dbus_object_manager_server_export(&this, UpCast!(DBusObjectSkeleton*)(object));
6644 // VERSION: 2.30
6645 // Like g_dbus_object_manager_server_export() but appends a string of
6646 // the form <literal>_N</literal> (with N being a natural number) to
6647 // @object<!-- -->'s object path if an object with the given path
6648 // already exists. As such, the #GDBusObjectProxy:g-object-path property
6649 // of @object may be modified.
6650 // <object>: An object.
6651 void export_uniquely(AT0)(AT0 /*DBusObjectSkeleton*/ object) nothrow {
6652 g_dbus_object_manager_server_export_uniquely(&this, UpCast!(DBusObjectSkeleton*)(object));
6655 // VERSION: 2.30
6656 // Gets the #GDBusConnection used by @manager.
6658 // @manager isn't exported on a connection. The returned object should
6659 // be freed with g_object_unref().
6660 // RETURNS: A #GDBusConnection object or %NULL if
6661 DBusConnection* /*new*/ get_connection()() nothrow {
6662 return g_dbus_object_manager_server_get_connection(&this);
6665 // Exports all objects managed by @manager on @connection. If
6666 // @connection is %NULL, stops exporting objects.
6667 // <connection>: A #GDBusConnection or %NULL.
6668 void set_connection(AT0)(AT0 /*DBusConnection*/ connection=null) nothrow {
6669 g_dbus_object_manager_server_set_connection(&this, UpCast!(DBusConnection*)(connection));
6672 // VERSION: 2.30
6673 // If @manager has an object at @path, removes the object. Otherwise
6674 // does nothing.
6676 // Note that @object_path must be in the hierarchy rooted by the
6677 // object path for @manager.
6678 // RETURNS: %TRUE if object at @object_path was removed, %FALSE otherwise.
6679 // <object_path>: An object path.
6680 int unexport(AT0)(AT0 /*char*/ object_path) nothrow {
6681 return g_dbus_object_manager_server_unexport(&this, toCString!(char*)(object_path));
6685 // Class structure for #GDBusObjectManagerServer.
6686 struct DBusObjectManagerServerClass /* Version 2.30 */ {
6687 GObject2.ObjectClass parent_class;
6688 private void*[8] padding;
6691 struct DBusObjectManagerServerPrivate {
6695 // A #GDBusObjectProxy is an object used to represent a remote object
6696 // with one or more D-Bus interfaces. Normally, you don't instantiate
6697 // a #GDBusObjectProxy yourself - typically #GDBusObjectManagerClient
6698 // is used to obtain it.
6699 struct DBusObjectProxy /* : GObject.Object */ /* Version 2.30 */ {
6700 mixin DBusObject.__interface__;
6701 alias parent_instance this;
6702 alias parent_instance super_;
6703 alias parent_instance object;
6704 GObject2.Object parent_instance;
6705 private DBusObjectProxyPrivate* priv;
6708 // VERSION: 2.30
6709 // Creates a new #GDBusObjectProxy for the given connection and
6710 // object path.
6711 // RETURNS: a new #GDBusObjectProxy
6712 // <connection>: a #GDBusConnection
6713 // <object_path>: the object path
6714 static DBusObjectProxy* /*new*/ new_(AT0, AT1)(AT0 /*DBusConnection*/ connection, AT1 /*char*/ object_path) nothrow {
6715 return g_dbus_object_proxy_new(UpCast!(DBusConnection*)(connection), toCString!(char*)(object_path));
6717 static auto opCall(AT0, AT1)(AT0 /*DBusConnection*/ connection, AT1 /*char*/ object_path) {
6718 return g_dbus_object_proxy_new(UpCast!(DBusConnection*)(connection), toCString!(char*)(object_path));
6721 // VERSION: 2.30
6722 // Gets the connection that @proxy is for.
6724 // object is owned by @proxy.
6725 // RETURNS: A #GDBusConnection. Do not free, the
6726 DBusConnection* get_connection()() nothrow {
6727 return g_dbus_object_proxy_get_connection(&this);
6731 // Class structure for #GDBusObjectProxy.
6732 struct DBusObjectProxyClass /* Version 2.30 */ {
6733 GObject2.ObjectClass parent_class;
6734 private void*[8] padding;
6737 struct DBusObjectProxyPrivate {
6741 // A #GDBusObjectSkeleton instance is essentially a group of D-Bus
6742 // interfaces. The set of exported interfaces on the object may be
6743 // dynamic and change at runtime.
6745 // This type is intended to be used with #GDBusObjectManager.
6746 struct DBusObjectSkeleton /* : GObject.Object */ /* Version 2.30 */ {
6747 mixin DBusObject.__interface__;
6748 alias parent_instance this;
6749 alias parent_instance super_;
6750 alias parent_instance object;
6751 GObject2.Object parent_instance;
6752 private DBusObjectSkeletonPrivate* priv;
6755 // VERSION: 2.30
6756 // Creates a new #GDBusObjectSkeleton.
6757 // RETURNS: A #GDBusObjectSkeleton. Free with g_object_unref().
6758 // <object_path>: An object path.
6759 static DBusObjectSkeleton* /*new*/ new_(AT0)(AT0 /*char*/ object_path) nothrow {
6760 return g_dbus_object_skeleton_new(toCString!(char*)(object_path));
6762 static auto opCall(AT0)(AT0 /*char*/ object_path) {
6763 return g_dbus_object_skeleton_new(toCString!(char*)(object_path));
6766 // VERSION: 2.30
6767 // Adds @interface_ to @object.
6769 // If @object already contains a #GDBusInterfaceSkeleton with the same
6770 // interface name, it is removed before @interface_ is added.
6772 // Note that @object takes its own reference on @interface_ and holds
6773 // it until removed.
6774 // <interface_>: A #GDBusInterfaceSkeleton.
6775 void add_interface(AT0)(AT0 /*DBusInterfaceSkeleton*/ interface_) nothrow {
6776 g_dbus_object_skeleton_add_interface(&this, UpCast!(DBusInterfaceSkeleton*)(interface_));
6779 // VERSION: 2.30
6780 // This method simply calls g_dbus_interface_skeleton_flush() on all
6781 // interfaces belonging to @object. See that method for when flushing
6782 // is useful.
6783 void flush()() nothrow {
6784 g_dbus_object_skeleton_flush(&this);
6787 // VERSION: 2.30
6788 // Removes @interface_ from @object.
6789 // <interface_>: A #GDBusInterfaceSkeleton.
6790 void remove_interface(AT0)(AT0 /*DBusInterfaceSkeleton*/ interface_) nothrow {
6791 g_dbus_object_skeleton_remove_interface(&this, UpCast!(DBusInterfaceSkeleton*)(interface_));
6794 // VERSION: 2.30
6795 // Removes the #GDBusInterface with @interface_name from @object.
6797 // If no D-Bus interface of the given interface exists, this function
6798 // does nothing.
6799 // <interface_name>: A D-Bus interface name.
6800 void remove_interface_by_name(AT0)(AT0 /*char*/ interface_name) nothrow {
6801 g_dbus_object_skeleton_remove_interface_by_name(&this, toCString!(char*)(interface_name));
6804 // VERSION: 2.30
6805 // Sets the object path for @object.
6806 // <object_path>: A valid D-Bus object path.
6807 void set_object_path(AT0)(AT0 /*char*/ object_path) nothrow {
6808 g_dbus_object_skeleton_set_object_path(&this, toCString!(char*)(object_path));
6811 // VERSION: 2.30
6812 // Emitted when a method is invoked by a remote caller and used to
6813 // determine if the method call is authorized.
6815 // This signal is like #GDBusInterfaceSkeleton<!-- -->'s
6816 // #GDBusInterfaceSkeleton::g-authorize-method signal, except that it is
6817 // for the enclosing object.
6819 // The default class handler just returns %TRUE.
6820 // RETURNS: %TRUE if the call is authorized, %FALSE otherwise.
6821 // <interface>: The #GDBusInterfaceSkeleton that @invocation is for.
6822 // <invocation>: A #GDBusMethodInvocation.
6823 extern (C) alias static c_int function (DBusObjectSkeleton* this_, DBusInterfaceSkeleton* interface_, DBusMethodInvocation* invocation, void* user_data=null) nothrow signal_authorize_method;
6825 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
6826 return super_.signal_connect!name(cb, data, cf);
6829 ulong signal_connect(string name:"authorize-method", CB/*:signal_authorize_method*/)
6830 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
6831 if (is(typeof(cb)==signal_authorize_method)||_ttmm!(CB, signal_authorize_method)()) {
6832 return signal_connect_data!()(&this, cast(char*)"authorize-method",
6833 cast(GObject2.Callback)cb, data, null, cf);
6837 // Class structure for #GDBusObjectSkeleton.
6838 struct DBusObjectSkeletonClass /* Version 2.30 */ {
6839 GObject2.ObjectClass parent_class;
6840 extern (C) int function (DBusObjectSkeleton* object, DBusInterfaceSkeleton* interface_, DBusMethodInvocation* invocation) nothrow authorize_method;
6841 private void*[8] padding;
6844 struct DBusObjectSkeletonPrivate {
6847 // Information about a D-Bus property on a D-Bus interface.
6848 struct DBusPropertyInfo /* Version 2.26 */ {
6849 int ref_count;
6850 char* name, signature;
6851 DBusPropertyInfoFlags flags;
6852 DBusAnnotationInfo*[666] annotations;
6855 // VERSION: 2.26
6856 // If @info is statically allocated does nothing. Otherwise increases
6857 // the reference count.
6858 // RETURNS: The same @info.
6859 DBusPropertyInfo* /*new*/ ref_()() nothrow {
6860 return g_dbus_property_info_ref(&this);
6863 // VERSION: 2.26
6864 // If @info is statically allocated, does nothing. Otherwise decreases
6865 // the reference count of @info. When its reference count drops to 0,
6866 // the memory used is freed.
6867 void unref()() nothrow {
6868 g_dbus_property_info_unref(&this);
6872 // Flags describing the access control of a D-Bus property.
6873 enum DBusPropertyInfoFlags /* Version 2.26 */ {
6874 NONE = 0,
6875 READABLE = 1,
6876 WRITABLE = 2
6879 // #GDBusProxy is a base class used for proxies to access a D-Bus
6880 // interface on a remote object. A #GDBusProxy can be constructed for
6881 // both well-known and unique names.
6883 // By default, #GDBusProxy will cache all properties (and listen to
6884 // changes) of the remote object, and proxy all signals that gets
6885 // emitted. This behaviour can be changed by passing suitable
6886 // #GDBusProxyFlags when the proxy is created. If the proxy is for a
6887 // well-known name, the property cache is flushed when the name owner
6888 // vanishes and reloaded when a name owner appears.
6890 // If a #GDBusProxy is used for a well-known name, the owner of the
6891 // name is tracked and can be read from
6892 // #GDBusProxy:g-name-owner. Connect to the #GObject::notify signal to
6893 // get notified of changes. Additionally, only signals and property
6894 // changes emitted from the current name owner are considered and
6895 // calls are always sent to the current name owner. This avoids a
6896 // number of race conditions when the name is lost by one owner and
6897 // claimed by another. However, if no name owner currently exists,
6898 // then calls will be sent to the well-known name which may result in
6899 // the message bus launching an owner (unless
6900 // %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START is set).
6902 // The generic #GDBusProxy::g-properties-changed and
6903 // #GDBusProxy::g-signal signals are not very convenient to work
6904 // with. Therefore, the recommended way of working with proxies is to
6905 // subclass #GDBusProxy, and have more natural properties and signals
6906 // in your derived class. See <xref linkend="gdbus-example-gdbus-codegen"/>
6907 // for how this can easily be done using the
6908 // <command><link linkend="gdbus-codegen">gdbus-codegen</link></command>
6909 // tool.
6911 // A #GDBusProxy instance can be used from multiple threads but note
6912 // that all signals (e.g. #GDBusProxy::g-signal, #GDBusProxy::g-properties-changed
6913 // and #GObject::notify) are emitted in the
6914 // <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
6915 // of the thread where the instance was constructed.
6917 // <example id="gdbus-wellknown-proxy"><title>GDBusProxy for a well-known-name</title><programlisting><xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gdbus-example-watch-proxy.c"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting></example>
6918 struct DBusProxy /* : GObject.Object */ /* Version 2.26 */ {
6919 mixin AsyncInitable.__interface__;
6920 mixin DBusInterface.__interface__;
6921 mixin Initable.__interface__;
6922 alias parent_instance this;
6923 alias parent_instance super_;
6924 alias parent_instance object;
6925 GObject2.Object parent_instance;
6926 private DBusProxyPrivate* priv;
6929 // VERSION: 2.26
6930 // Finishes creating a #GDBusProxy.
6931 // RETURNS: A #GDBusProxy or %NULL if @error is set. Free with g_object_unref().
6932 // <res>: A #GAsyncResult obtained from the #GAsyncReadyCallback function passed to g_dbus_proxy_new().
6933 static DBusProxy* /*new*/ new_finish(AT0, AT1)(AT0 /*AsyncResult*/ res, AT1 /*GLib2.Error**/ error=null) nothrow {
6934 return g_dbus_proxy_new_finish(UpCast!(AsyncResult*)(res), UpCast!(GLib2.Error**)(error));
6936 static auto opCall(AT0, AT1)(AT0 /*AsyncResult*/ res, AT1 /*GLib2.Error**/ error=null) {
6937 return g_dbus_proxy_new_finish(UpCast!(AsyncResult*)(res), UpCast!(GLib2.Error**)(error));
6940 // VERSION: 2.26
6941 // Finishes creating a #GDBusProxy.
6942 // RETURNS: A #GDBusProxy or %NULL if @error is set. Free with g_object_unref().
6943 // <res>: A #GAsyncResult obtained from the #GAsyncReadyCallback function passed to g_dbus_proxy_new_for_bus().
6944 static DBusProxy* /*new*/ new_for_bus_finish(AT0, AT1)(AT0 /*AsyncResult*/ res, AT1 /*GLib2.Error**/ error=null) nothrow {
6945 return g_dbus_proxy_new_for_bus_finish(UpCast!(AsyncResult*)(res), UpCast!(GLib2.Error**)(error));
6947 static auto opCall(AT0, AT1)(AT0 /*AsyncResult*/ res, AT1 /*GLib2.Error**/ error=null) {
6948 return g_dbus_proxy_new_for_bus_finish(UpCast!(AsyncResult*)(res), UpCast!(GLib2.Error**)(error));
6951 // VERSION: 2.26
6952 // Like g_dbus_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
6954 // See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
6955 // RETURNS: A #GDBusProxy or %NULL if error is set. Free with g_object_unref().
6956 // <bus_type>: A #GBusType.
6957 // <flags>: Flags used when constructing the proxy.
6958 // <info>: A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
6959 // <name>: A bus name (well-known or unique).
6960 // <object_path>: An object path.
6961 // <interface_name>: A D-Bus interface name.
6962 // <cancellable>: A #GCancellable or %NULL.
6963 static DBusProxy* /*new*/ new_for_bus_sync(AT0, AT1, AT2, AT3, AT4, AT5)(BusType bus_type, DBusProxyFlags flags, AT0 /*DBusInterfaceInfo*/ info, AT1 /*char*/ name, AT2 /*char*/ object_path, AT3 /*char*/ interface_name, AT4 /*Cancellable*/ cancellable, AT5 /*GLib2.Error**/ error=null) nothrow {
6964 return g_dbus_proxy_new_for_bus_sync(bus_type, flags, UpCast!(DBusInterfaceInfo*)(info), toCString!(char*)(name), toCString!(char*)(object_path), toCString!(char*)(interface_name), UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
6966 static auto opCall(AT0, AT1, AT2, AT3, AT4, AT5)(BusType bus_type, DBusProxyFlags flags, AT0 /*DBusInterfaceInfo*/ info, AT1 /*char*/ name, AT2 /*char*/ object_path, AT3 /*char*/ interface_name, AT4 /*Cancellable*/ cancellable, AT5 /*GLib2.Error**/ error=null) {
6967 return g_dbus_proxy_new_for_bus_sync(bus_type, flags, UpCast!(DBusInterfaceInfo*)(info), toCString!(char*)(name), toCString!(char*)(object_path), toCString!(char*)(interface_name), UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
6970 // VERSION: 2.26
6971 // Creates a proxy for accessing @interface_name on the remote object
6972 // at @object_path owned by @name at @connection and synchronously
6973 // loads D-Bus properties unless the
6974 // %G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES flag is used.
6976 // If the %G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS flag is not set, also sets up
6977 // match rules for signals. Connect to the #GDBusProxy::g-signal signal
6978 // to handle signals from the remote object.
6980 // If @name is a well-known name and the
6981 // %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START flag isn't set and no name
6982 // owner currently exists, the message bus will be requested to launch
6983 // a name owner for the name.
6985 // This is a synchronous failable constructor. See g_dbus_proxy_new()
6986 // and g_dbus_proxy_new_finish() for the asynchronous version.
6988 // See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
6989 // RETURNS: A #GDBusProxy or %NULL if error is set. Free with g_object_unref().
6990 // <connection>: A #GDBusConnection.
6991 // <flags>: Flags used when constructing the proxy.
6992 // <info>: A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
6993 // <name>: A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
6994 // <object_path>: An object path.
6995 // <interface_name>: A D-Bus interface name.
6996 // <cancellable>: A #GCancellable or %NULL.
6997 static DBusProxy* /*new*/ new_sync(AT0, AT1, AT2, AT3, AT4, AT5, AT6)(AT0 /*DBusConnection*/ connection, DBusProxyFlags flags, AT1 /*DBusInterfaceInfo*/ info, AT2 /*char*/ name, AT3 /*char*/ object_path, AT4 /*char*/ interface_name, AT5 /*Cancellable*/ cancellable, AT6 /*GLib2.Error**/ error=null) nothrow {
6998 return g_dbus_proxy_new_sync(UpCast!(DBusConnection*)(connection), flags, UpCast!(DBusInterfaceInfo*)(info), toCString!(char*)(name), toCString!(char*)(object_path), toCString!(char*)(interface_name), UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
7000 static auto opCall(AT0, AT1, AT2, AT3, AT4, AT5, AT6)(AT0 /*DBusConnection*/ connection, DBusProxyFlags flags, AT1 /*DBusInterfaceInfo*/ info, AT2 /*char*/ name, AT3 /*char*/ object_path, AT4 /*char*/ interface_name, AT5 /*Cancellable*/ cancellable, AT6 /*GLib2.Error**/ error=null) {
7001 return g_dbus_proxy_new_sync(UpCast!(DBusConnection*)(connection), flags, UpCast!(DBusInterfaceInfo*)(info), toCString!(char*)(name), toCString!(char*)(object_path), toCString!(char*)(interface_name), UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
7004 // VERSION: 2.26
7005 // Creates a proxy for accessing @interface_name on the remote object
7006 // at @object_path owned by @name at @connection and asynchronously
7007 // loads D-Bus properties unless the
7008 // %G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES flag is used. Connect to
7009 // the #GDBusProxy::g-properties-changed signal to get notified about
7010 // property changes.
7012 // If the %G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS flag is not set, also sets up
7013 // match rules for signals. Connect to the #GDBusProxy::g-signal signal
7014 // to handle signals from the remote object.
7016 // If @name is a well-known name and the
7017 // %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START flag isn't set and no name
7018 // owner currently exists, the message bus will be requested to launch
7019 // a name owner for the name.
7021 // This is a failable asynchronous constructor - when the proxy is
7022 // ready, @callback will be invoked and you can use
7023 // g_dbus_proxy_new_finish() to get the result.
7025 // See g_dbus_proxy_new_sync() and for a synchronous version of this constructor.
7027 // See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
7028 // <connection>: A #GDBusConnection.
7029 // <flags>: Flags used when constructing the proxy.
7030 // <info>: A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
7031 // <name>: A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
7032 // <object_path>: An object path.
7033 // <interface_name>: A D-Bus interface name.
7034 // <cancellable>: A #GCancellable or %NULL.
7035 // <callback>: Callback function to invoke when the proxy is ready.
7036 // <user_data>: User data to pass to @callback.
7037 static void new_(AT0, AT1, AT2, AT3, AT4, AT5, AT6)(AT0 /*DBusConnection*/ connection, DBusProxyFlags flags, AT1 /*DBusInterfaceInfo*/ info, AT2 /*char*/ name, AT3 /*char*/ object_path, AT4 /*char*/ interface_name, AT5 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT6 /*void*/ user_data) nothrow {
7038 g_dbus_proxy_new(UpCast!(DBusConnection*)(connection), flags, UpCast!(DBusInterfaceInfo*)(info), toCString!(char*)(name), toCString!(char*)(object_path), toCString!(char*)(interface_name), UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
7041 // VERSION: 2.26
7042 // Like g_dbus_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
7044 // See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
7045 // <bus_type>: A #GBusType.
7046 // <flags>: Flags used when constructing the proxy.
7047 // <info>: A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
7048 // <name>: A bus name (well-known or unique).
7049 // <object_path>: An object path.
7050 // <interface_name>: A D-Bus interface name.
7051 // <cancellable>: A #GCancellable or %NULL.
7052 // <callback>: Callback function to invoke when the proxy is ready.
7053 // <user_data>: User data to pass to @callback.
7054 static void new_for_bus(AT0, AT1, AT2, AT3, AT4, AT5)(BusType bus_type, DBusProxyFlags flags, AT0 /*DBusInterfaceInfo*/ info, AT1 /*char*/ name, AT2 /*char*/ object_path, AT3 /*char*/ interface_name, AT4 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT5 /*void*/ user_data) nothrow {
7055 g_dbus_proxy_new_for_bus(bus_type, flags, UpCast!(DBusInterfaceInfo*)(info), toCString!(char*)(name), toCString!(char*)(object_path), toCString!(char*)(interface_name), UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
7058 // VERSION: 2.26
7059 // Asynchronously invokes the @method_name method on @proxy.
7061 // If @method_name contains any dots, then @name is split into interface and
7062 // method name parts. This allows using @proxy for invoking methods on
7063 // other interfaces.
7065 // If the #GDBusConnection associated with @proxy is closed then
7066 // the operation will fail with %G_IO_ERROR_CLOSED. If
7067 // @cancellable is canceled, the operation will fail with
7068 // %G_IO_ERROR_CANCELLED. If @parameters contains a value not
7069 // compatible with the D-Bus protocol, the operation fails with
7070 // %G_IO_ERROR_INVALID_ARGUMENT.
7072 // If the @parameters #GVariant is floating, it is consumed. This allows
7073 // convenient 'inline' use of g_variant_new(), e.g.:
7074 // |[
7075 // g_dbus_proxy_call (proxy,
7076 // "TwoStrings",
7077 // g_variant_new ("(ss)",
7078 // "Thing One",
7079 // "Thing Two"),
7080 // G_DBUS_CALL_FLAGS_NONE,
7081 // -1,
7082 // NULL,
7083 // (GAsyncReadyCallback) two_strings_done,
7084 // &amp;data);
7085 // ]|
7087 // If @proxy has an expected interface (see
7088 // #GDBusProxy:g-interface-info) and @method_name is referenced by it,
7089 // then the return value is checked against the return type.
7091 // This is an asynchronous method. When the operation is finished,
7092 // @callback will be invoked in the
7093 // <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
7094 // of the thread you are calling this method from.
7095 // You can then call g_dbus_proxy_call_finish() to get the result of
7096 // the operation. See g_dbus_proxy_call_sync() for the synchronous
7097 // version of this method.
7099 // If @callback is %NULL then the D-Bus method call message will be sent with
7100 // the %G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED flag set.
7101 // <method_name>: Name of method to invoke.
7102 // <parameters>: A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
7103 // <flags>: Flags from the #GDBusCallFlags enumeration.
7104 // <timeout_msec>: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
7105 // <cancellable>: A #GCancellable or %NULL.
7106 // <callback>: A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result of the method invocation.
7107 // <user_data>: The data to pass to @callback.
7108 void call(AT0, AT1, AT2, AT3)(AT0 /*char*/ method_name, AT1 /*GLib2.Variant*/ parameters, DBusCallFlags flags, int timeout_msec, AT2 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT3 /*void*/ user_data) nothrow {
7109 g_dbus_proxy_call(&this, toCString!(char*)(method_name), UpCast!(GLib2.Variant*)(parameters), flags, timeout_msec, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
7112 // VERSION: 2.26
7113 // Finishes an operation started with g_dbus_proxy_call().
7115 // return values. Free with g_variant_unref().
7116 // RETURNS: %NULL if @error is set. Otherwise a #GVariant tuple with
7117 // <res>: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_proxy_call().
7118 GLib2.Variant* /*new*/ call_finish(AT0, AT1)(AT0 /*AsyncResult*/ res, AT1 /*GLib2.Error**/ error=null) nothrow {
7119 return g_dbus_proxy_call_finish(&this, UpCast!(AsyncResult*)(res), UpCast!(GLib2.Error**)(error));
7122 // VERSION: 2.26
7123 // Synchronously invokes the @method_name method on @proxy.
7125 // If @method_name contains any dots, then @name is split into interface and
7126 // method name parts. This allows using @proxy for invoking methods on
7127 // other interfaces.
7129 // If the #GDBusConnection associated with @proxy is disconnected then
7130 // the operation will fail with %G_IO_ERROR_CLOSED. If
7131 // @cancellable is canceled, the operation will fail with
7132 // %G_IO_ERROR_CANCELLED. If @parameters contains a value not
7133 // compatible with the D-Bus protocol, the operation fails with
7134 // %G_IO_ERROR_INVALID_ARGUMENT.
7136 // If the @parameters #GVariant is floating, it is consumed. This allows
7137 // convenient 'inline' use of g_variant_new(), e.g.:
7138 // |[
7139 // g_dbus_proxy_call_sync (proxy,
7140 // "TwoStrings",
7141 // g_variant_new ("(ss)",
7142 // "Thing One",
7143 // "Thing Two"),
7144 // G_DBUS_CALL_FLAGS_NONE,
7145 // -1,
7146 // NULL,
7147 // &amp;error);
7148 // ]|
7150 // The calling thread is blocked until a reply is received. See
7151 // g_dbus_proxy_call() for the asynchronous version of this
7152 // method.
7154 // If @proxy has an expected interface (see
7155 // #GDBusProxy:g-interface-info) and @method_name is referenced by it,
7156 // then the return value is checked against the return type.
7158 // return values. Free with g_variant_unref().
7159 // RETURNS: %NULL if @error is set. Otherwise a #GVariant tuple with
7160 // <method_name>: Name of method to invoke.
7161 // <parameters>: A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
7162 // <flags>: Flags from the #GDBusCallFlags enumeration.
7163 // <timeout_msec>: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
7164 // <cancellable>: A #GCancellable or %NULL.
7165 GLib2.Variant* /*new*/ call_sync(AT0, AT1, AT2, AT3)(AT0 /*char*/ method_name, AT1 /*GLib2.Variant*/ parameters, DBusCallFlags flags, int timeout_msec, AT2 /*Cancellable*/ cancellable, AT3 /*GLib2.Error**/ error=null) nothrow {
7166 return g_dbus_proxy_call_sync(&this, toCString!(char*)(method_name), UpCast!(GLib2.Variant*)(parameters), flags, timeout_msec, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
7169 // VERSION: 2.30
7170 // Like g_dbus_proxy_call() but also takes a #GUnixFDList object.
7172 // This method is only available on UNIX.
7173 // <method_name>: Name of method to invoke.
7174 // <parameters>: A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
7175 // <flags>: Flags from the #GDBusCallFlags enumeration.
7176 // <timeout_msec>: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
7177 // <fd_list>: A #GUnixFDList or %NULL.
7178 // <cancellable>: A #GCancellable or %NULL.
7179 // <callback>: A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result of the method invocation.
7180 // <user_data>: The data to pass to @callback.
7181 void call_with_unix_fd_list(AT0, AT1, AT2, AT3, AT4)(AT0 /*char*/ method_name, AT1 /*GLib2.Variant*/ parameters, DBusCallFlags flags, int timeout_msec, AT2 /*UnixFDList*/ fd_list, AT3 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT4 /*void*/ user_data) nothrow {
7182 g_dbus_proxy_call_with_unix_fd_list(&this, toCString!(char*)(method_name), UpCast!(GLib2.Variant*)(parameters), flags, timeout_msec, UpCast!(UnixFDList*)(fd_list), UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
7185 // VERSION: 2.30
7186 // Finishes an operation started with g_dbus_proxy_call_with_unix_fd_list().
7188 // return values. Free with g_variant_unref().
7189 // RETURNS: %NULL if @error is set. Otherwise a #GVariant tuple with
7190 // <out_fd_list>: Return location for a #GUnixFDList or %NULL.
7191 // <res>: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_proxy_call_with_unix_fd_list().
7192 GLib2.Variant* /*new*/ call_with_unix_fd_list_finish(AT0, AT1, AT2)(/*out*/ AT0 /*UnixFDList**/ out_fd_list, AT1 /*AsyncResult*/ res, AT2 /*GLib2.Error**/ error=null) nothrow {
7193 return g_dbus_proxy_call_with_unix_fd_list_finish(&this, UpCast!(UnixFDList**)(out_fd_list), UpCast!(AsyncResult*)(res), UpCast!(GLib2.Error**)(error));
7196 // VERSION: 2.30
7197 // Like g_dbus_proxy_call_sync() but also takes and returns #GUnixFDList objects.
7199 // This method is only available on UNIX.
7201 // return values. Free with g_variant_unref().
7202 // RETURNS: %NULL if @error is set. Otherwise a #GVariant tuple with
7203 // <method_name>: Name of method to invoke.
7204 // <parameters>: A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
7205 // <flags>: Flags from the #GDBusCallFlags enumeration.
7206 // <timeout_msec>: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
7207 // <fd_list>: A #GUnixFDList or %NULL.
7208 // <out_fd_list>: Return location for a #GUnixFDList or %NULL.
7209 // <cancellable>: A #GCancellable or %NULL.
7210 GLib2.Variant* /*new*/ call_with_unix_fd_list_sync(AT0, AT1, AT2, AT3, AT4, AT5)(AT0 /*char*/ method_name, AT1 /*GLib2.Variant*/ parameters, DBusCallFlags flags, int timeout_msec, AT2 /*UnixFDList*/ fd_list, /*out*/ AT3 /*UnixFDList**/ out_fd_list, AT4 /*Cancellable*/ cancellable, AT5 /*GLib2.Error**/ error=null) nothrow {
7211 return g_dbus_proxy_call_with_unix_fd_list_sync(&this, toCString!(char*)(method_name), UpCast!(GLib2.Variant*)(parameters), flags, timeout_msec, UpCast!(UnixFDList*)(fd_list), UpCast!(UnixFDList**)(out_fd_list), UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
7214 // VERSION: 2.26
7215 // Looks up the value for a property from the cache. This call does no
7216 // blocking IO.
7218 // If @proxy has an expected interface (see
7219 // #GDBusProxy:g-interface-info) and @property_name is referenced by
7220 // it, then @value is checked against the type of the property.
7222 // for @property_name or %NULL if the value is not in the cache. The
7223 // returned reference must be freed with g_variant_unref().
7224 // RETURNS: A reference to the #GVariant instance that holds the value
7225 // <property_name>: Property name.
7226 GLib2.Variant* /*new*/ get_cached_property(AT0)(AT0 /*char*/ property_name) nothrow {
7227 return g_dbus_proxy_get_cached_property(&this, toCString!(char*)(property_name));
7230 // VERSION: 2.26
7231 // Gets the names of all cached properties on @proxy.
7233 // @proxy has no cached properties. Free the returned array with
7234 // g_strfreev().
7235 // RETURNS: A %NULL-terminated array of strings or %NULL if
7236 char** /*new*/ get_cached_property_names()() nothrow {
7237 return g_dbus_proxy_get_cached_property_names(&this);
7240 // VERSION: 2.26
7241 // Gets the connection @proxy is for.
7242 // RETURNS: A #GDBusConnection owned by @proxy. Do not free.
7243 DBusConnection* get_connection()() nothrow {
7244 return g_dbus_proxy_get_connection(&this);
7247 // VERSION: 2.26
7248 // Gets the timeout to use if -1 (specifying default timeout) is
7249 // passed as @timeout_msec in the g_dbus_proxy_call() and
7250 // g_dbus_proxy_call_sync() functions.
7252 // See the #GDBusProxy:g-default-timeout property for more details.
7253 // RETURNS: Timeout to use for @proxy.
7254 int get_default_timeout()() nothrow {
7255 return g_dbus_proxy_get_default_timeout(&this);
7258 // VERSION: 2.26
7259 // Gets the flags that @proxy was constructed with.
7260 // RETURNS: Flags from the #GDBusProxyFlags enumeration.
7261 DBusProxyFlags get_flags()() nothrow {
7262 return g_dbus_proxy_get_flags(&this);
7265 // VERSION: 2.26
7266 // Returns the #GDBusInterfaceInfo, if any, specifying the interface
7267 // that @proxy conforms to. See the #GDBusProxy:g-interface-info
7268 // property for more details.
7270 // object, it is owned by @proxy.
7271 // RETURNS: A #GDBusInterfaceInfo or %NULL. Do not unref the returned
7272 DBusInterfaceInfo* /*new*/ get_interface_info()() nothrow {
7273 return g_dbus_proxy_get_interface_info(&this);
7276 // VERSION: 2.26
7277 // Gets the D-Bus interface name @proxy is for.
7278 // RETURNS: A string owned by @proxy. Do not free.
7279 char* get_interface_name()() nothrow {
7280 return g_dbus_proxy_get_interface_name(&this);
7283 // VERSION: 2.26
7284 // Gets the name that @proxy was constructed for.
7285 // RETURNS: A string owned by @proxy. Do not free.
7286 char* get_name()() nothrow {
7287 return g_dbus_proxy_get_name(&this);
7290 // VERSION: 2.26
7291 // The unique name that owns the name that @proxy is for or %NULL if
7292 // no-one currently owns that name. You may connect to the
7293 // #GObject::notify signal to track changes to the
7294 // #GDBusProxy:g-name-owner property.
7295 // RETURNS: The name owner or %NULL if no name owner exists. Free with g_free().
7296 char* /*new*/ get_name_owner()() nothrow {
7297 return g_dbus_proxy_get_name_owner(&this);
7300 // VERSION: 2.26
7301 // Gets the object path @proxy is for.
7302 // RETURNS: A string owned by @proxy. Do not free.
7303 char* get_object_path()() nothrow {
7304 return g_dbus_proxy_get_object_path(&this);
7307 // VERSION: 2.26
7308 // If @value is not %NULL, sets the cached value for the property with
7309 // name @property_name to the value in @value.
7311 // If @value is %NULL, then the cached value is removed from the
7312 // property cache.
7314 // If @proxy has an expected interface (see
7315 // #GDBusProxy:g-interface-info) and @property_name is referenced by
7316 // it, then @value is checked against the type of the property.
7318 // If the @value #GVariant is floating, it is consumed. This allows
7319 // convenient 'inline' use of g_variant_new(), e.g.
7320 // |[
7321 // g_dbus_proxy_set_cached_property (proxy,
7322 // "SomeProperty",
7323 // g_variant_new ("(si)",
7324 // "A String",
7325 // 42));
7326 // ]|
7328 // Normally you will not need to use this method since @proxy is
7329 // tracking changes using the
7330 // <literal>org.freedesktop.DBus.Properties.PropertiesChanged</literal>
7331 // D-Bus signal. However, for performance reasons an object may decide
7332 // to not use this signal for some properties and instead use a
7333 // proprietary out-of-band mechanism to transmit changes.
7335 // As a concrete example, consider an object with a property
7336 // <literal>ChatroomParticipants</literal> which is an array of
7337 // strings. Instead of transmitting the same (long) array every time
7338 // the property changes, it is more efficient to only transmit the
7339 // delta using e.g. signals <literal>ChatroomParticipantJoined(String
7340 // name)</literal> and <literal>ChatroomParticipantParted(String
7341 // name)</literal>.
7342 // <property_name>: Property name.
7343 // <value>: Value for the property or %NULL to remove it from the cache.
7344 void set_cached_property(AT0, AT1)(AT0 /*char*/ property_name, AT1 /*GLib2.Variant*/ value=null) nothrow {
7345 g_dbus_proxy_set_cached_property(&this, toCString!(char*)(property_name), UpCast!(GLib2.Variant*)(value));
7348 // VERSION: 2.26
7349 // Sets the timeout to use if -1 (specifying default timeout) is
7350 // passed as @timeout_msec in the g_dbus_proxy_call() and
7351 // g_dbus_proxy_call_sync() functions.
7353 // See the #GDBusProxy:g-default-timeout property for more details.
7354 // <timeout_msec>: Timeout in milliseconds.
7355 void set_default_timeout()(int timeout_msec) nothrow {
7356 g_dbus_proxy_set_default_timeout(&this, timeout_msec);
7359 // VERSION: 2.26
7360 // Ensure that interactions with @proxy conform to the given
7361 // interface. See the #GDBusProxy:g-interface-info property for more
7362 // details.
7363 // <info>: Minimum interface this proxy conforms to or %NULL to unset.
7364 void set_interface_info(AT0)(AT0 /*DBusInterfaceInfo*/ info=null) nothrow {
7365 g_dbus_proxy_set_interface_info(&this, UpCast!(DBusInterfaceInfo*)(info));
7368 // VERSION: 2.26
7369 // Emitted when one or more D-Bus properties on @proxy changes. The
7370 // local cache has already been updated when this signal fires. Note
7371 // that both @changed_properties and @invalidated_properties are
7372 // guaranteed to never be %NULL (either may be empty though).
7374 // If the proxy has the flag
7375 // %G_DBUS_PROXY_FLAGS_GET_INVALIDATED_PROPERTIES set, then
7376 // @invalidated_properties will always be empty.
7378 // This signal corresponds to the
7379 // <literal>PropertiesChanged</literal> D-Bus signal on the
7380 // <literal>org.freedesktop.DBus.Properties</literal> interface.
7381 // <changed_properties>: A #GVariant containing the properties that changed
7382 // <invalidated_properties>: A %NULL terminated array of properties that was invalidated
7383 extern (C) alias static void function (DBusProxy* this_, GLib2.Variant* changed_properties, char* invalidated_properties, void* user_data=null) nothrow signal_g_properties_changed;
7385 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
7386 return super_.signal_connect!name(cb, data, cf);
7389 ulong signal_connect(string name:"g-properties-changed", CB/*:signal_g_properties_changed*/)
7390 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
7391 if (is(typeof(cb)==signal_g_properties_changed)||_ttmm!(CB, signal_g_properties_changed)()) {
7392 return signal_connect_data!()(&this, cast(char*)"g-properties-changed",
7393 cast(GObject2.Callback)cb, data, null, cf);
7396 // VERSION: 2.26
7397 // Emitted when a signal from the remote object and interface that @proxy is for, has been received.
7398 // <sender_name>: The sender of the signal or %NULL if the connection is not a bus connection.
7399 // <signal_name>: The name of the signal.
7400 // <parameters>: A #GVariant tuple with parameters for the signal.
7401 extern (C) alias static void function (DBusProxy* this_, char* sender_name, char* signal_name, GLib2.Variant* parameters, void* user_data=null) nothrow signal_g_signal;
7402 ulong signal_connect(string name:"g-signal", CB/*:signal_g_signal*/)
7403 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
7404 if (is(typeof(cb)==signal_g_signal)||_ttmm!(CB, signal_g_signal)()) {
7405 return signal_connect_data!()(&this, cast(char*)"g-signal",
7406 cast(GObject2.Callback)cb, data, null, cf);
7410 // Class structure for #GDBusProxy.
7411 struct DBusProxyClass /* Version 2.26 */ {
7412 private GObject2.ObjectClass parent_class;
7413 extern (C) void function (DBusProxy* proxy, GLib2.Variant* changed_properties, char** invalidated_properties) nothrow g_properties_changed;
7414 extern (C) void function (DBusProxy* proxy, char* sender_name, char* signal_name, GLib2.Variant* parameters) nothrow g_signal;
7415 private void*[32] padding;
7418 // Flags used when constructing an instance of a #GDBusProxy derived class.
7419 enum DBusProxyFlags /* Version 2.26 */ {
7420 NONE = 0,
7421 DO_NOT_LOAD_PROPERTIES = 1,
7422 DO_NOT_CONNECT_SIGNALS = 2,
7423 DO_NOT_AUTO_START = 4,
7424 GET_INVALIDATED_PROPERTIES = 8
7426 struct DBusProxyPrivate {
7430 // VERSION: 2.30
7431 // Function signature for a function used to determine the #GType to
7432 // use for an interface proxy (if @interface_name is not %NULL) or
7433 // object proxy (if @interface_name is %NULL).
7435 // This function is called in the
7436 // <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
7437 // that @manager was constructed in.
7439 // must be a #GDBusProxy<!-- -->- or #GDBusObjectProxy<!-- -->-derived
7440 // type.
7441 // RETURNS: A #GType to use for the remote object. The returned type
7442 // <manager>: A #GDBusObjectManagerClient.
7443 // <object_path>: The object path of the remote object.
7444 // <interface_name>: The interface name of the remote object or %NULL if a #GDBusObjectProxy #GType is requested.
7445 // <user_data>: User data.
7446 extern (C) alias Type function (DBusObjectManagerClient* manager, char* object_path, char* interface_name, void* user_data) nothrow DBusProxyTypeFunc;
7448 // Flags used when sending #GDBusMessage<!-- -->s on a #GDBusConnection.
7449 enum DBusSendMessageFlags /* Version 2.26 */ {
7450 NONE = 0,
7451 PRESERVE_SERIAL = 1
7454 // #GDBusServer is a helper for listening to and accepting D-Bus
7455 // connections. This can be used to create a new D-Bus server, allowing two
7456 // peers to use the D-Bus protocol for their own specialized communication.
7457 // A server instance provided in this way will not perform message routing or
7458 // implement the org.freedesktop.DBus interface.
7460 // To just export an object on a well-known name on a message bus, such as the
7461 // session or system bus, you should instead use g_bus_own_name().
7463 // <example id="gdbus-peer-to-peer"><title>D-Bus peer-to-peer example</title><programlisting><xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gdbus-example-peer.c"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting></example>
7464 struct DBusServer /* : GObject.Object */ /* Version 2.26 */ {
7465 mixin Initable.__interface__;
7466 alias method_parent this;
7467 alias method_parent super_;
7468 alias method_parent object;
7469 GObject2.Object method_parent;
7472 // VERSION: 2.26
7473 // Creates a new D-Bus server that listens on the first address in
7474 // @address that works.
7476 // Once constructed, you can use g_dbus_server_get_client_address() to
7477 // get a D-Bus address string that clients can use to connect.
7479 // Connect to the #GDBusServer::new-connection signal to handle
7480 // incoming connections.
7482 // The returned #GDBusServer isn't active - you have to start it with
7483 // g_dbus_server_start().
7485 // See <xref linkend="gdbus-peer-to-peer"/> for how #GDBusServer can
7486 // be used.
7488 // This is a synchronous failable constructor. See
7489 // g_dbus_server_new() for the asynchronous version.
7491 // g_object_unref().
7492 // RETURNS: A #GDBusServer or %NULL if @error is set. Free with
7493 // <address>: A D-Bus address.
7494 // <flags>: Flags from the #GDBusServerFlags enumeration.
7495 // <guid>: A D-Bus GUID.
7496 // <observer>: A #GDBusAuthObserver or %NULL.
7497 // <cancellable>: A #GCancellable or %NULL.
7498 static DBusServer* /*new*/ new_sync(AT0, AT1, AT2, AT3, AT4)(AT0 /*char*/ address, DBusServerFlags flags, AT1 /*char*/ guid, AT2 /*DBusAuthObserver*/ observer, AT3 /*Cancellable*/ cancellable, AT4 /*GLib2.Error**/ error=null) nothrow {
7499 return g_dbus_server_new_sync(toCString!(char*)(address), flags, toCString!(char*)(guid), UpCast!(DBusAuthObserver*)(observer), UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
7501 static auto opCall(AT0, AT1, AT2, AT3, AT4)(AT0 /*char*/ address, DBusServerFlags flags, AT1 /*char*/ guid, AT2 /*DBusAuthObserver*/ observer, AT3 /*Cancellable*/ cancellable, AT4 /*GLib2.Error**/ error=null) {
7502 return g_dbus_server_new_sync(toCString!(char*)(address), flags, toCString!(char*)(guid), UpCast!(DBusAuthObserver*)(observer), UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
7505 // VERSION: 2.26
7506 // Gets a D-Bus address string that can be used by clients to connect
7507 // to @server.
7509 // by @server.
7510 // RETURNS: A D-Bus address string. Do not free, the string is owned
7511 char* get_client_address()() nothrow {
7512 return g_dbus_server_get_client_address(&this);
7515 // VERSION: 2.26
7516 // Gets the flags for @server.
7517 // RETURNS: A set of flags from the #GDBusServerFlags enumeration.
7518 DBusServerFlags get_flags()() nothrow {
7519 return g_dbus_server_get_flags(&this);
7522 // VERSION: 2.26
7523 // Gets the GUID for @server.
7524 // RETURNS: A D-Bus GUID. Do not free this string, it is owned by @server.
7525 char* get_guid()() nothrow {
7526 return g_dbus_server_get_guid(&this);
7529 // VERSION: 2.26
7530 // Gets whether @server is active.
7531 // RETURNS: %TRUE if server is active, %FALSE otherwise.
7532 int is_active()() nothrow {
7533 return g_dbus_server_is_active(&this);
7536 // VERSION: 2.26
7537 // Starts @server.
7538 void start()() nothrow {
7539 g_dbus_server_start(&this);
7542 // VERSION: 2.26
7543 // Stops @server.
7544 void stop()() nothrow {
7545 g_dbus_server_stop(&this);
7548 // VERSION: 2.26
7549 // Emitted when a new authenticated connection has been made. Use
7550 // g_dbus_connection_get_peer_credentials() to figure out what
7551 // identity (if any), was authenticated.
7553 // If you want to accept the connection, take a reference to the
7554 // @connection object and return %TRUE. When you are done with the
7555 // connection call g_dbus_connection_close() and give up your
7556 // reference. Note that the other peer may disconnect at any time -
7557 // a typical thing to do when accepting a connection is to listen to
7558 // the #GDBusConnection::closed signal.
7560 // If #GDBusServer:flags contains %G_DBUS_SERVER_FLAGS_RUN_IN_THREAD
7561 // then the signal is emitted in a new thread dedicated to the
7562 // connection. Otherwise the signal is emitted in the <link
7563 // linkend="g-main-context-push-thread-default">thread-default main
7564 // loop</link> of the thread that @server was constructed in.
7566 // You are guaranteed that signal handlers for this signal runs
7567 // before incoming messages on @connection are processed. This means
7568 // that it's suitable to call g_dbus_connection_register_object() or
7569 // similar from the signal handler.
7571 // run.
7572 // RETURNS: %TRUE to claim @connection, %FALSE to let other handlers
7573 // <connection>: A #GDBusConnection for the new connection.
7574 extern (C) alias static c_int function (DBusServer* this_, DBusConnection* connection, void* user_data=null) nothrow signal_new_connection;
7576 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
7577 return super_.signal_connect!name(cb, data, cf);
7580 ulong signal_connect(string name:"new-connection", CB/*:signal_new_connection*/)
7581 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
7582 if (is(typeof(cb)==signal_new_connection)||_ttmm!(CB, signal_new_connection)()) {
7583 return signal_connect_data!()(&this, cast(char*)"new-connection",
7584 cast(GObject2.Callback)cb, data, null, cf);
7588 // Flags used when creating a #GDBusServer.
7589 enum DBusServerFlags /* Version 2.26 */ {
7590 NONE = 0,
7591 RUN_IN_THREAD = 1,
7592 AUTHENTICATION_ALLOW_ANONYMOUS = 2
7595 // VERSION: 2.26
7596 // Signature for callback function used in g_dbus_connection_signal_subscribe().
7597 // <connection>: A #GDBusConnection.
7598 // <sender_name>: The unique bus name of the sender of the signal.
7599 // <object_path>: The object path that the signal was emitted on.
7600 // <interface_name>: The name of the interface.
7601 // <signal_name>: The name of the signal.
7602 // <parameters>: A #GVariant tuple with parameters for the signal.
7603 // <user_data>: User data passed when subscribing to the signal.
7604 extern (C) alias void function (DBusConnection* connection, char* sender_name, char* object_path, char* interface_name, char* signal_name, GLib2.Variant* parameters, void* user_data) nothrow DBusSignalCallback;
7606 // Flags used when subscribing to signals via g_dbus_connection_signal_subscribe().
7607 enum DBusSignalFlags /* Version 2.26 */ {
7608 NONE = 0,
7609 NO_MATCH_RULE = 1
7611 // Information about a signal on a D-Bus interface.
7612 struct DBusSignalInfo /* Version 2.26 */ {
7613 int ref_count;
7614 char* name;
7615 DBusArgInfo*[666] args;
7616 DBusAnnotationInfo*[666] annotations;
7619 // VERSION: 2.26
7620 // If @info is statically allocated does nothing. Otherwise increases
7621 // the reference count.
7622 // RETURNS: The same @info.
7623 DBusSignalInfo* /*new*/ ref_()() nothrow {
7624 return g_dbus_signal_info_ref(&this);
7627 // VERSION: 2.26
7628 // If @info is statically allocated, does nothing. Otherwise decreases
7629 // the reference count of @info. When its reference count drops to 0,
7630 // the memory used is freed.
7631 void unref()() nothrow {
7632 g_dbus_signal_info_unref(&this);
7637 // VERSION: 2.26
7638 // The type of the @dispatch function in #GDBusSubtreeVTable.
7640 // Subtrees are flat. @node, if non-%NULL, is always exactly one
7641 // segment of the object path (ie: it never contains a slash).
7642 // RETURNS: A #GDBusInterfaceVTable or %NULL if you don't want to handle the methods.
7643 // <connection>: A #GDBusConnection.
7644 // <sender>: The unique bus name of the remote caller.
7645 // <object_path>: The object path that was registered with g_dbus_connection_register_subtree().
7646 // <interface_name>: The D-Bus interface name that the method call or property access is for.
7647 // <node>: A node that is a child of @object_path (relative to @object_path) or %NULL for the root of the subtree.
7648 // <out_user_data>: Return location for user data to pass to functions in the returned #GDBusInterfaceVTable (never %NULL).
7649 // <user_data>: The @user_data #gpointer passed to g_dbus_connection_register_subtree().
7650 extern (C) alias DBusInterfaceVTable* function (DBusConnection* connection, char* sender, char* object_path, char* interface_name, char* node, void** out_user_data, void* user_data) nothrow DBusSubtreeDispatchFunc;
7653 // Unintrospectable callback: DBusSubtreeEnumerateFunc() / ()
7654 // VERSION: 2.26
7655 // The type of the @enumerate function in #GDBusSubtreeVTable.
7657 // This function is called when generating introspection data and also
7658 // when preparing to dispatch incoming messages in the event that the
7659 // %G_DBUS_SUBTREE_FLAGS_DISPATCH_TO_UNENUMERATED_NODES flag is not
7660 // specified (ie: to verify that the object path is valid).
7662 // Hierarchies are not supported; the items that you return should not
7663 // contain the '/' character.
7665 // The return value will be freed with g_strfreev().
7666 // RETURNS: A newly allocated array of strings for node names that are children of @object_path.
7667 // <connection>: A #GDBusConnection.
7668 // <sender>: The unique bus name of the remote caller.
7669 // <object_path>: The object path that was registered with g_dbus_connection_register_subtree().
7670 // <user_data>: The @user_data #gpointer passed to g_dbus_connection_register_subtree().
7671 extern (C) alias char** function (DBusConnection* connection, char* sender, char* object_path, void* user_data) nothrow DBusSubtreeEnumerateFunc;
7673 // Flags passed to g_dbus_connection_register_subtree().
7674 enum DBusSubtreeFlags /* Version 2.26 */ {
7675 NONE = 0,
7676 DISPATCH_TO_UNENUMERATED_NODES = 1
7679 // VERSION: 2.26
7680 // The type of the @introspect function in #GDBusSubtreeVTable.
7682 // Subtrees are flat. @node, if non-%NULL, is always exactly one
7683 // segment of the object path (ie: it never contains a slash).
7685 // This function should return %NULL to indicate that there is no object
7686 // at this node.
7688 // If this function returns non-%NULL, the return value is expected to
7689 // be a %NULL-terminated array of pointers to #GDBusInterfaceInfo
7690 // structures describing the interfaces implemented by @node. This
7691 // array will have g_dbus_interface_info_unref() called on each item
7692 // before being freed with g_free().
7694 // The difference between returning %NULL and an array containing zero
7695 // items is that the standard DBus interfaces will returned to the
7696 // remote introspector in the empty array case, but not in the %NULL
7697 // case.
7698 // RETURNS: A %NULL-terminated array of pointers to #GDBusInterfaceInfo, or %NULL.
7699 // <connection>: A #GDBusConnection.
7700 // <sender>: The unique bus name of the remote caller.
7701 // <object_path>: The object path that was registered with g_dbus_connection_register_subtree().
7702 // <node>: A node that is a child of @object_path (relative to @object_path) or %NULL for the root of the subtree.
7703 // <user_data>: The @user_data #gpointer passed to g_dbus_connection_register_subtree().
7704 extern (C) alias DBusInterfaceInfo** /*new*/ function (DBusConnection* connection, char* sender, char* object_path, char* node, void* user_data) nothrow DBusSubtreeIntrospectFunc;
7706 // Virtual table for handling subtrees registered with g_dbus_connection_register_subtree().
7707 struct DBusSubtreeVTable /* Version 2.26 */ {
7708 DBusSubtreeEnumerateFunc enumerate;
7709 DBusSubtreeIntrospectFunc introspect;
7710 DBusSubtreeDispatchFunc dispatch;
7711 private void*[8] padding;
7714 enum DESKTOP_APP_INFO_LOOKUP_EXTENSION_POINT_NAME = "gio-desktop-app-info-lookup";
7716 // Data input stream implements #GInputStream and includes functions for
7717 // reading structured data directly from a binary input stream.
7718 struct DataInputStream /* : BufferedInputStream */ {
7719 alias parent_instance this;
7720 alias parent_instance super_;
7721 alias parent_instance bufferedinputstream;
7722 BufferedInputStream parent_instance;
7723 private DataInputStreamPrivate* priv;
7726 // Creates a new data input stream for the @base_stream.
7727 // RETURNS: a new #GDataInputStream.
7728 // <base_stream>: a #GInputStream.
7729 static DataInputStream* /*new*/ new_(AT0)(AT0 /*InputStream*/ base_stream) nothrow {
7730 return g_data_input_stream_new(UpCast!(InputStream*)(base_stream));
7732 static auto opCall(AT0)(AT0 /*InputStream*/ base_stream) {
7733 return g_data_input_stream_new(UpCast!(InputStream*)(base_stream));
7736 // Gets the byte order for the data input stream.
7737 // RETURNS: the @stream's current #GDataStreamByteOrder.
7738 DataStreamByteOrder get_byte_order()() nothrow {
7739 return g_data_input_stream_get_byte_order(&this);
7742 // Gets the current newline type for the @stream.
7743 // RETURNS: #GDataStreamNewlineType for the given @stream.
7744 DataStreamNewlineType get_newline_type()() nothrow {
7745 return g_data_input_stream_get_newline_type(&this);
7748 // Reads an unsigned 8-bit/1-byte value from @stream.
7750 // if an error occurred.
7751 // RETURNS: an unsigned 8-bit/1-byte value read from the @stream or %0
7752 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7753 ubyte read_byte(AT0, AT1)(AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
7754 return g_data_input_stream_read_byte(&this, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
7757 // Reads a 16-bit/2-byte value from @stream.
7759 // In order to get the correct byte order for this read operation,
7760 // see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
7762 // an error occurred.
7763 // RETURNS: a signed 16-bit/2-byte value read from @stream or %0 if
7764 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7765 short read_int16(AT0, AT1)(AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
7766 return g_data_input_stream_read_int16(&this, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
7769 // Reads a signed 32-bit/4-byte value from @stream.
7771 // In order to get the correct byte order for this read operation,
7772 // see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
7774 // If @cancellable is not %NULL, then the operation can be cancelled by
7775 // triggering the cancellable object from another thread. If the operation
7776 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
7778 // an error occurred.
7779 // RETURNS: a signed 32-bit/4-byte value read from the @stream or %0 if
7780 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7781 int read_int32(AT0, AT1)(AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
7782 return g_data_input_stream_read_int32(&this, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
7785 // Reads a 64-bit/8-byte value from @stream.
7787 // In order to get the correct byte order for this read operation,
7788 // see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
7790 // If @cancellable is not %NULL, then the operation can be cancelled by
7791 // triggering the cancellable object from another thread. If the operation
7792 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
7794 // an error occurred.
7795 // RETURNS: a signed 64-bit/8-byte value read from @stream or %0 if
7796 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7797 long read_int64(AT0, AT1)(AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
7798 return g_data_input_stream_read_int64(&this, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
7801 // Reads a line from the data input stream. Note that no encoding
7802 // checks or conversion is performed; the input is not guaranteed to
7803 // be UTF-8, and may in fact have embedded NUL characters.
7805 // If @cancellable is not %NULL, then the operation can be cancelled by
7806 // triggering the cancellable object from another thread. If the operation
7807 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
7809 // NUL terminated byte array with the line that was read in (without
7810 // the newlines). Set @length to a #gsize to get the length of the
7811 // read line. On an error, it will return %NULL and @error will be
7812 // set. If there's no content to read, it will still return %NULL,
7813 // but @error won't be set.
7814 // RETURNS: a
7815 // <length>: a #gsize to get the length of the data read in.
7816 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7817 ubyte* /*new*/ read_line(AT0, AT1, AT2)(/*out*/ AT0 /*size_t*/ length, AT1 /*Cancellable*/ cancellable, AT2 /*GLib2.Error**/ error=null) nothrow {
7818 return g_data_input_stream_read_line(&this, UpCast!(size_t*)(length), UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
7821 // VERSION: 2.20
7822 // The asynchronous version of g_data_input_stream_read_line(). It is
7823 // an error to have two outstanding calls to this function.
7825 // When the operation is finished, @callback will be called. You
7826 // can then call g_data_input_stream_read_line_finish() to get
7827 // the result of the operation.
7828 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
7829 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7830 // <callback>: callback to call when the request is satisfied.
7831 // <user_data>: the data to pass to callback function.
7832 void read_line_async(AT0, AT1)(int io_priority, AT0 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT1 /*void*/ user_data) nothrow {
7833 g_data_input_stream_read_line_async(&this, io_priority, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
7836 // VERSION: 2.20
7837 // Finish an asynchronous call started by
7838 // g_data_input_stream_read_line_async(). Note the warning about
7839 // string encoding in g_data_input_stream_read_line() applies here as
7840 // well.
7842 // NUL-terminated byte array with the line that was read in
7843 // (without the newlines). Set @length to a #gsize to get the
7844 // length of the read line. On an error, it will return %NULL and
7845 // @error will be set. If there's no content to read, it will
7846 // still return %NULL, but @error won't be set.
7847 // RETURNS: a
7848 // <result>: the #GAsyncResult that was provided to the callback.
7849 // <length>: a #gsize to get the length of the data read in.
7850 ubyte* /*new*/ read_line_finish(AT0, AT1, AT2)(AT0 /*AsyncResult*/ result, /*out*/ AT1 /*size_t*/ length, AT2 /*GLib2.Error**/ error=null) nothrow {
7851 return g_data_input_stream_read_line_finish(&this, UpCast!(AsyncResult*)(result), UpCast!(size_t*)(length), UpCast!(GLib2.Error**)(error));
7854 // VERSION: 2.30
7855 // Finish an asynchronous call started by
7856 // g_data_input_stream_read_line_async().
7858 // (without the newlines). Set @length to a #gsize to get the length
7859 // of the read line. On an error, it will return %NULL and @error
7860 // will be set. For UTF-8 conversion errors, the set error domain is
7861 // %G_CONVERT_ERROR. If there's no content to read, it will still
7862 // return %NULL, but @error won't be set.
7863 // RETURNS: a string with the line that was read in
7864 // <result>: the #GAsyncResult that was provided to the callback.
7865 // <length>: a #gsize to get the length of the data read in.
7866 char* /*new*/ read_line_finish_utf8(AT0, AT1, AT2)(AT0 /*AsyncResult*/ result, /*out*/ AT1 /*size_t*/ length, AT2 /*GLib2.Error**/ error=null) nothrow {
7867 return g_data_input_stream_read_line_finish_utf8(&this, UpCast!(AsyncResult*)(result), UpCast!(size_t*)(length), UpCast!(GLib2.Error**)(error));
7870 // VERSION: 2.30
7871 // Reads a UTF-8 encoded line from the data input stream.
7873 // If @cancellable is not %NULL, then the operation can be cancelled by
7874 // triggering the cancellable object from another thread. If the operation
7875 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
7877 // line that was read in (without the newlines). Set @length to a
7878 // #gsize to get the length of the read line. On an error, it will
7879 // return %NULL and @error will be set. For UTF-8 conversion errors,
7880 // the set error domain is %G_CONVERT_ERROR. If there's no content to
7881 // read, it will still return %NULL, but @error won't be set.
7882 // RETURNS: a NUL terminated UTF-8 string with the
7883 // <length>: a #gsize to get the length of the data read in.
7884 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7885 char* /*new*/ read_line_utf8(AT0, AT1, AT2)(/*out*/ AT0 /*size_t*/ length, AT1 /*Cancellable*/ cancellable, AT2 /*GLib2.Error**/ error=null) nothrow {
7886 return g_data_input_stream_read_line_utf8(&this, UpCast!(size_t*)(length), UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
7889 // Reads an unsigned 16-bit/2-byte value from @stream.
7891 // In order to get the correct byte order for this read operation,
7892 // see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
7894 // an error occurred.
7895 // RETURNS: an unsigned 16-bit/2-byte value read from the @stream or %0 if
7896 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7897 ushort read_uint16(AT0, AT1)(AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
7898 return g_data_input_stream_read_uint16(&this, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
7901 // Reads an unsigned 32-bit/4-byte value from @stream.
7903 // In order to get the correct byte order for this read operation,
7904 // see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
7906 // If @cancellable is not %NULL, then the operation can be cancelled by
7907 // triggering the cancellable object from another thread. If the operation
7908 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
7910 // an error occurred.
7911 // RETURNS: an unsigned 32-bit/4-byte value read from the @stream or %0 if
7912 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7913 uint read_uint32(AT0, AT1)(AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
7914 return g_data_input_stream_read_uint32(&this, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
7917 // Reads an unsigned 64-bit/8-byte value from @stream.
7919 // In order to get the correct byte order for this read operation,
7920 // see g_data_input_stream_get_byte_order().
7922 // If @cancellable is not %NULL, then the operation can be cancelled by
7923 // triggering the cancellable object from another thread. If the operation
7924 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
7926 // an error occurred.
7927 // RETURNS: an unsigned 64-bit/8-byte read from @stream or %0 if
7928 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7929 ulong read_uint64(AT0, AT1)(AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
7930 return g_data_input_stream_read_uint64(&this, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
7933 // Reads a string from the data input stream, up to the first
7934 // occurrence of any of the stop characters.
7936 // Note that, in contrast to g_data_input_stream_read_until_async(),
7937 // this function consumes the stop character that it finds.
7939 // Don't use this function in new code. Its functionality is
7940 // inconsistent with g_data_input_stream_read_until_async(). Both
7941 // functions will be marked as deprecated in a future release. Use
7942 // g_data_input_stream_read_upto() instead, but note that that function
7943 // does not consume the stop character.
7945 // before encountering any of the stop characters. Set @length to
7946 // a #gsize to get the length of the string. This function will
7947 // return %NULL on an error.
7948 // RETURNS: a string with the data that was read
7949 // <stop_chars>: characters to terminate the read.
7950 // <length>: a #gsize to get the length of the data read in.
7951 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7952 char* /*new*/ read_until(AT0, AT1, AT2, AT3)(AT0 /*char*/ stop_chars, /*out*/ AT1 /*size_t*/ length, AT2 /*Cancellable*/ cancellable, AT3 /*GLib2.Error**/ error=null) nothrow {
7953 return g_data_input_stream_read_until(&this, toCString!(char*)(stop_chars), UpCast!(size_t*)(length), UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
7956 // VERSION: 2.20
7957 // The asynchronous version of g_data_input_stream_read_until().
7958 // It is an error to have two outstanding calls to this function.
7960 // Note that, in contrast to g_data_input_stream_read_until(),
7961 // this function does not consume the stop character that it finds. You
7962 // must read it for yourself.
7964 // When the operation is finished, @callback will be called. You
7965 // can then call g_data_input_stream_read_until_finish() to get
7966 // the result of the operation.
7968 // Don't use this function in new code. Its functionality is
7969 // inconsistent with g_data_input_stream_read_until(). Both functions
7970 // will be marked as deprecated in a future release. Use
7971 // g_data_input_stream_read_upto_async() instead.
7972 // <stop_chars>: characters to terminate the read.
7973 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
7974 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7975 // <callback>: callback to call when the request is satisfied.
7976 // <user_data>: the data to pass to callback function.
7977 void read_until_async(AT0, AT1, AT2)(AT0 /*char*/ stop_chars, int io_priority, AT1 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT2 /*void*/ user_data) nothrow {
7978 g_data_input_stream_read_until_async(&this, toCString!(char*)(stop_chars), io_priority, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
7981 // VERSION: 2.20
7982 // Finish an asynchronous call started by
7983 // g_data_input_stream_read_until_async().
7986 // before encountering any of the stop characters. Set @length to
7987 // a #gsize to get the length of the string. This function will
7988 // return %NULL on an error.
7989 // RETURNS: a string with the data that was read
7990 // <result>: the #GAsyncResult that was provided to the callback.
7991 // <length>: a #gsize to get the length of the data read in.
7992 char* /*new*/ read_until_finish(AT0, AT1, AT2)(AT0 /*AsyncResult*/ result, /*out*/ AT1 /*size_t*/ length, AT2 /*GLib2.Error**/ error=null) nothrow {
7993 return g_data_input_stream_read_until_finish(&this, UpCast!(AsyncResult*)(result), UpCast!(size_t*)(length), UpCast!(GLib2.Error**)(error));
7996 // VERSION: 2.26
7997 // Reads a string from the data input stream, up to the first
7998 // occurrence of any of the stop characters.
8000 // In contrast to g_data_input_stream_read_until(), this function
8001 // does <emphasis>not</emphasis> consume the stop character. You have
8002 // to use g_data_input_stream_read_byte() to get it before calling
8003 // g_data_input_stream_read_upto() again.
8005 // Note that @stop_chars may contain '\0' if @stop_chars_len is
8006 // specified.
8008 // before encountering any of the stop characters. Set @length to
8009 // a #gsize to get the length of the string. This function will
8010 // return %NULL on an error
8011 // RETURNS: a string with the data that was read
8012 // <stop_chars>: characters to terminate the read
8013 // <stop_chars_len>: length of @stop_chars. May be -1 if @stop_chars is nul-terminated
8014 // <length>: a #gsize to get the length of the data read in
8015 // <cancellable>: optional #GCancellable object, %NULL to ignore
8016 char* /*new*/ read_upto(AT0, AT1, AT2, AT3)(AT0 /*char*/ stop_chars, ssize_t stop_chars_len, /*out*/ AT1 /*size_t*/ length, AT2 /*Cancellable*/ cancellable, AT3 /*GLib2.Error**/ error=null) nothrow {
8017 return g_data_input_stream_read_upto(&this, toCString!(char*)(stop_chars), stop_chars_len, UpCast!(size_t*)(length), UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
8020 // VERSION: 2.26
8021 // The asynchronous version of g_data_input_stream_read_upto().
8022 // It is an error to have two outstanding calls to this function.
8024 // In contrast to g_data_input_stream_read_until(), this function
8025 // does <emphasis>not</emphasis> consume the stop character. You have
8026 // to use g_data_input_stream_read_byte() to get it before calling
8027 // g_data_input_stream_read_upto() again.
8029 // Note that @stop_chars may contain '\0' if @stop_chars_len is
8030 // specified.
8032 // When the operation is finished, @callback will be called. You
8033 // can then call g_data_input_stream_read_upto_finish() to get
8034 // the result of the operation.
8035 // <stop_chars>: characters to terminate the read
8036 // <stop_chars_len>: length of @stop_chars. May be -1 if @stop_chars is nul-terminated
8037 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
8038 // <cancellable>: optional #GCancellable object, %NULL to ignore
8039 // <callback>: callback to call when the request is satisfied
8040 // <user_data>: the data to pass to callback function
8041 void read_upto_async(AT0, AT1, AT2)(AT0 /*char*/ stop_chars, ssize_t stop_chars_len, int io_priority, AT1 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT2 /*void*/ user_data) nothrow {
8042 g_data_input_stream_read_upto_async(&this, toCString!(char*)(stop_chars), stop_chars_len, io_priority, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
8045 // VERSION: 2.24
8046 // Finish an asynchronous call started by
8047 // g_data_input_stream_read_upto_async().
8049 // Note that this function does <emphasis>not</emphasis> consume the
8050 // stop character. You have to use g_data_input_stream_read_byte() to
8051 // get it before calling g_data_input_stream_read_upto_async() again.
8053 // before encountering any of the stop characters. Set @length to
8054 // a #gsize to get the length of the string. This function will
8055 // return %NULL on an error.
8056 // RETURNS: a string with the data that was read
8057 // <result>: the #GAsyncResult that was provided to the callback
8058 // <length>: a #gsize to get the length of the data read in
8059 char* /*new*/ read_upto_finish(AT0, AT1, AT2)(AT0 /*AsyncResult*/ result, /*out*/ AT1 /*size_t*/ length, AT2 /*GLib2.Error**/ error=null) nothrow {
8060 return g_data_input_stream_read_upto_finish(&this, UpCast!(AsyncResult*)(result), UpCast!(size_t*)(length), UpCast!(GLib2.Error**)(error));
8063 // This function sets the byte order for the given @stream. All subsequent
8064 // reads from the @stream will be read in the given @order.
8065 // <order>: a #GDataStreamByteOrder to set.
8066 void set_byte_order()(DataStreamByteOrder order) nothrow {
8067 g_data_input_stream_set_byte_order(&this, order);
8070 // Sets the newline type for the @stream.
8072 // Note that using G_DATA_STREAM_NEWLINE_TYPE_ANY is slightly unsafe. If a read
8073 // chunk ends in "CR" we must read an additional byte to know if this is "CR" or
8074 // "CR LF", and this might block if there is no more data available.
8075 // <type>: the type of new line return as #GDataStreamNewlineType.
8076 void set_newline_type()(DataStreamNewlineType type) nothrow {
8077 g_data_input_stream_set_newline_type(&this, type);
8081 struct DataInputStreamClass {
8082 BufferedInputStreamClass parent_class;
8083 extern (C) void function () nothrow _g_reserved1;
8084 extern (C) void function () nothrow _g_reserved2;
8085 extern (C) void function () nothrow _g_reserved3;
8086 extern (C) void function () nothrow _g_reserved4;
8087 extern (C) void function () nothrow _g_reserved5;
8090 struct DataInputStreamPrivate {
8094 // Data output stream implements #GOutputStream and includes functions for
8095 // writing data directly to an output stream.
8096 struct DataOutputStream /* : FilterOutputStream */ {
8097 alias parent_instance this;
8098 alias parent_instance super_;
8099 alias parent_instance filteroutputstream;
8100 FilterOutputStream parent_instance;
8101 private DataOutputStreamPrivate* priv;
8104 // Creates a new data output stream for @base_stream.
8105 // RETURNS: #GDataOutputStream.
8106 // <base_stream>: a #GOutputStream.
8107 static DataOutputStream* /*new*/ new_(AT0)(AT0 /*OutputStream*/ base_stream) nothrow {
8108 return g_data_output_stream_new(UpCast!(OutputStream*)(base_stream));
8110 static auto opCall(AT0)(AT0 /*OutputStream*/ base_stream) {
8111 return g_data_output_stream_new(UpCast!(OutputStream*)(base_stream));
8114 // Gets the byte order for the stream.
8115 // RETURNS: the #GDataStreamByteOrder for the @stream.
8116 DataStreamByteOrder get_byte_order()() nothrow {
8117 return g_data_output_stream_get_byte_order(&this);
8120 // Puts a byte into the output stream.
8121 // RETURNS: %TRUE if @data was successfully added to the @stream.
8122 // <data>: a #guchar.
8123 // <cancellable>: optional #GCancellable object, %NULL to ignore.
8124 int put_byte(AT0, AT1)(ubyte data, AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
8125 return g_data_output_stream_put_byte(&this, data, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
8128 // Puts a signed 16-bit integer into the output stream.
8129 // RETURNS: %TRUE if @data was successfully added to the @stream.
8130 // <data>: a #gint16.
8131 // <cancellable>: optional #GCancellable object, %NULL to ignore.
8132 int put_int16(AT0, AT1)(short data, AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
8133 return g_data_output_stream_put_int16(&this, data, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
8136 // Puts a signed 32-bit integer into the output stream.
8137 // RETURNS: %TRUE if @data was successfully added to the @stream.
8138 // <data>: a #gint32.
8139 // <cancellable>: optional #GCancellable object, %NULL to ignore.
8140 int put_int32(AT0, AT1)(int data, AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
8141 return g_data_output_stream_put_int32(&this, data, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
8144 // Puts a signed 64-bit integer into the stream.
8145 // RETURNS: %TRUE if @data was successfully added to the @stream.
8146 // <data>: a #gint64.
8147 // <cancellable>: optional #GCancellable object, %NULL to ignore.
8148 int put_int64(AT0, AT1)(long data, AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
8149 return g_data_output_stream_put_int64(&this, data, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
8152 // Puts a string into the output stream.
8153 // RETURNS: %TRUE if @string was successfully added to the @stream.
8154 // <str>: a string.
8155 // <cancellable>: optional #GCancellable object, %NULL to ignore.
8156 int put_string(AT0, AT1, AT2)(AT0 /*char*/ str, AT1 /*Cancellable*/ cancellable, AT2 /*GLib2.Error**/ error=null) nothrow {
8157 return g_data_output_stream_put_string(&this, toCString!(char*)(str), UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
8160 // Puts an unsigned 16-bit integer into the output stream.
8161 // RETURNS: %TRUE if @data was successfully added to the @stream.
8162 // <data>: a #guint16.
8163 // <cancellable>: optional #GCancellable object, %NULL to ignore.
8164 int put_uint16(AT0, AT1)(ushort data, AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
8165 return g_data_output_stream_put_uint16(&this, data, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
8168 // Puts an unsigned 32-bit integer into the stream.
8169 // RETURNS: %TRUE if @data was successfully added to the @stream.
8170 // <data>: a #guint32.
8171 // <cancellable>: optional #GCancellable object, %NULL to ignore.
8172 int put_uint32(AT0, AT1)(uint data, AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
8173 return g_data_output_stream_put_uint32(&this, data, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
8176 // Puts an unsigned 64-bit integer into the stream.
8177 // RETURNS: %TRUE if @data was successfully added to the @stream.
8178 // <data>: a #guint64.
8179 // <cancellable>: optional #GCancellable object, %NULL to ignore.
8180 int put_uint64(AT0, AT1)(ulong data, AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
8181 return g_data_output_stream_put_uint64(&this, data, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
8184 // Sets the byte order of the data output stream to @order.
8185 // <order>: a %GDataStreamByteOrder.
8186 void set_byte_order()(DataStreamByteOrder order) nothrow {
8187 g_data_output_stream_set_byte_order(&this, order);
8191 struct DataOutputStreamClass {
8192 FilterOutputStreamClass parent_class;
8193 extern (C) void function () nothrow _g_reserved1;
8194 extern (C) void function () nothrow _g_reserved2;
8195 extern (C) void function () nothrow _g_reserved3;
8196 extern (C) void function () nothrow _g_reserved4;
8197 extern (C) void function () nothrow _g_reserved5;
8200 struct DataOutputStreamPrivate {
8204 // #GDataStreamByteOrder is used to ensure proper endianness of streaming data sources
8205 // across various machine architectures.
8206 enum DataStreamByteOrder {
8207 BIG_ENDIAN = 0,
8208 LITTLE_ENDIAN = 1,
8209 HOST_ENDIAN = 2
8211 // #GDataStreamNewlineType is used when checking for or setting the line endings for a given file.
8212 enum DataStreamNewlineType {
8213 LF = 0,
8214 CR = 1,
8215 CR_LF = 2,
8216 ANY = 3
8219 // #GDesktopAppInfo is an implementation of #GAppInfo based on
8220 // desktop files.
8222 // Note that <filename>&lt;gio/gdesktopappinfo.h&gt;</filename> belongs to
8223 // the UNIX-specific GIO interfaces, thus you have to use the
8224 // <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
8225 struct DesktopAppInfo /* : GObject.Object */ {
8226 mixin AppInfo.__interface__;
8227 alias method_parent this;
8228 alias method_parent super_;
8229 alias method_parent object;
8230 GObject2.Object method_parent;
8233 // Creates a new #GDesktopAppInfo based on a desktop file id.
8235 // A desktop file id is the basename of the desktop file, including the
8236 // .desktop extension. GIO is looking for a desktop file with this name
8237 // in the <filename>applications</filename> subdirectories of the XDG data
8238 // directories (i.e. the directories specified in the
8239 // <envar>XDG_DATA_HOME</envar> and <envar>XDG_DATA_DIRS</envar> environment
8240 // variables). GIO also supports the prefix-to-subdirectory mapping that is
8241 // described in the <ulink url="http://standards.freedesktop.org/menu-spec/latest/">Menu Spec</ulink>
8242 // (i.e. a desktop id of kde-foo.desktop will match
8243 // <filename>/usr/share/applications/kde/foo.desktop</filename>).
8244 // RETURNS: a new #GDesktopAppInfo, or %NULL if no desktop file with that id
8245 // <desktop_id>: the desktop file id
8246 static DesktopAppInfo* /*new*/ new_(AT0)(AT0 /*char*/ desktop_id) nothrow {
8247 return g_desktop_app_info_new(toCString!(char*)(desktop_id));
8249 static auto opCall(AT0)(AT0 /*char*/ desktop_id) {
8250 return g_desktop_app_info_new(toCString!(char*)(desktop_id));
8253 // Creates a new #GDesktopAppInfo.
8254 // RETURNS: a new #GDesktopAppInfo or %NULL on error.
8255 // <filename>: the path of a desktop file, in the GLib filename encoding
8256 static DesktopAppInfo* /*new*/ new_from_filename(AT0)(AT0 /*char*/ filename) nothrow {
8257 return g_desktop_app_info_new_from_filename(toCString!(char*)(filename));
8259 static auto opCall(AT0)(AT0 /*char*/ filename) {
8260 return g_desktop_app_info_new_from_filename(toCString!(char*)(filename));
8263 // VERSION: 2.18
8264 // Creates a new #GDesktopAppInfo.
8265 // RETURNS: a new #GDesktopAppInfo or %NULL on error.
8266 // <key_file>: an opened #GKeyFile
8267 static DesktopAppInfo* /*new*/ new_from_keyfile(AT0)(AT0 /*GLib2.KeyFile*/ key_file) nothrow {
8268 return g_desktop_app_info_new_from_keyfile(UpCast!(GLib2.KeyFile*)(key_file));
8270 static auto opCall(AT0)(AT0 /*GLib2.KeyFile*/ key_file) {
8271 return g_desktop_app_info_new_from_keyfile(UpCast!(GLib2.KeyFile*)(key_file));
8274 // Sets the name of the desktop that the application is running in.
8275 // This is used by g_app_info_should_show() and
8276 // g_desktop_app_info_get_show_in() to evaluate the
8277 // <literal>OnlyShowIn</literal> and <literal>NotShowIn</literal>
8278 // desktop entry fields.
8280 // The <ulink url="http://standards.freedesktop.org/menu-spec/latest/">Desktop
8281 // Menu specification</ulink> recognizes the following:
8282 // <simplelist>
8283 // <member>GNOME</member>
8284 // <member>KDE</member>
8285 // <member>ROX</member>
8286 // <member>XFCE</member>
8287 // <member>LXDE</member>
8288 // <member>Unity</member>
8289 // <member>Old</member>
8290 // </simplelist>
8292 // Should be called only once; subsequent calls are ignored.
8293 // <desktop_env>: a string specifying what desktop this is
8294 static void set_desktop_env(AT0)(AT0 /*char*/ desktop_env) nothrow {
8295 g_desktop_app_info_set_desktop_env(toCString!(char*)(desktop_env));
8298 // Gets the categories from the desktop file.
8300 // i.e. no attempt is made to split it by ';' or validate it.
8301 // RETURNS: The unparsed Categories key from the desktop file;
8302 char* get_categories()() nothrow {
8303 return g_desktop_app_info_get_categories(&this);
8306 // VERSION: 2.24
8307 // When @info was created from a known filename, return it. In some
8308 // situations such as the #GDesktopAppInfo returned from
8309 // g_desktop_app_info_new_from_keyfile(), this function will return %NULL.
8310 // RETURNS: The full path to the file for @info, or %NULL if not known.
8311 char* get_filename()() nothrow {
8312 return g_desktop_app_info_get_filename(&this);
8315 // Gets the generic name from the destkop file.
8316 // RETURNS: The value of the GenericName key
8317 char* get_generic_name()() nothrow {
8318 return g_desktop_app_info_get_generic_name(&this);
8321 // A desktop file is hidden if the Hidden key in it is
8322 // set to True.
8323 // RETURNS: %TRUE if hidden, %FALSE otherwise.
8324 int get_is_hidden()() nothrow {
8325 return g_desktop_app_info_get_is_hidden(&this);
8328 // VERSION: 2.32
8329 // Gets the keywords from the desktop file.
8330 // RETURNS: The value of the Keywords key
8331 char** get_keywords()() nothrow {
8332 return g_desktop_app_info_get_keywords(&this);
8335 // VERSION: 2.30
8336 // Gets the value of the NoDisplay key, which helps determine if the
8337 // application info should be shown in menus. See
8338 // #G_KEY_FILE_DESKTOP_KEY_NO_DISPLAY and g_app_info_should_show().
8339 // RETURNS: The value of the NoDisplay key
8340 int get_nodisplay()() nothrow {
8341 return g_desktop_app_info_get_nodisplay(&this);
8344 // VERSION: 2.30
8345 // Checks if the application info should be shown in menus that list available
8346 // applications for a specific name of the desktop, based on the
8347 // <literal>OnlyShowIn</literal> and <literal>NotShowIn</literal> keys.
8349 // If @desktop_env is %NULL, then the name of the desktop set with
8350 // g_desktop_app_info_set_desktop_env() is used.
8352 // Note that g_app_info_should_show() for @info will include this check (with
8353 // %NULL for @desktop_env) as well as additional checks.
8355 // <literal>OnlyShowIn</literal> and <literal>NotShowIn</literal> keys, %FALSE
8356 // otherwise.
8357 // RETURNS: %TRUE if the @info should be shown in @desktop_env according to the
8358 // <desktop_env>: a string specifying a desktop name
8359 int get_show_in(AT0)(AT0 /*char*/ desktop_env) nothrow {
8360 return g_desktop_app_info_get_show_in(&this, toCString!(char*)(desktop_env));
8363 // This function performs the equivalent of g_app_info_launch_uris(),
8364 // but is intended primarily for operating system components that
8365 // launch applications. Ordinary applications should use
8366 // g_app_info_launch_uris().
8368 // In contrast to g_app_info_launch_uris(), all processes created will
8369 // always be run directly as children as if by the UNIX fork()/exec()
8370 // calls.
8372 // This guarantee allows additional control over the exact environment
8373 // of the child processes, which is provided via a setup function
8374 // @user_setup, as well as the process identifier of each child process
8375 // via @pid_callback. See g_spawn_async() for more information about the
8376 // semantics of the @user_setup function.
8377 // RETURNS: %TRUE on successful launch, %FALSE otherwise.
8378 // <uris>: List of URIs
8379 // <launch_context>: a #GAppLaunchContext
8380 // <spawn_flags>: #GSpawnFlags, used for each process
8381 // <user_setup>: a #GSpawnChildSetupFunc, used once for each process.
8382 // <user_setup_data>: User data for @user_setup
8383 // <pid_callback>: Callback for child processes
8384 // <pid_callback_data>: User data for @callback
8385 int launch_uris_as_manager(AT0, AT1, AT2, AT3, AT4)(AT0 /*GLib2.List*/ uris, AT1 /*AppLaunchContext*/ launch_context, GLib2.SpawnFlags spawn_flags, GLib2.SpawnChildSetupFunc user_setup, AT2 /*void*/ user_setup_data, DesktopAppLaunchCallback pid_callback, AT3 /*void*/ pid_callback_data, AT4 /*GLib2.Error**/ error=null) nothrow {
8386 return g_desktop_app_info_launch_uris_as_manager(&this, UpCast!(GLib2.List*)(uris), UpCast!(AppLaunchContext*)(launch_context), spawn_flags, user_setup, UpCast!(void*)(user_setup_data), pid_callback, UpCast!(void*)(pid_callback_data), UpCast!(GLib2.Error**)(error));
8390 struct DesktopAppInfoClass {
8391 GObject2.ObjectClass parent_class;
8395 // Interface that is used by backends to associate default
8396 // handlers with URI schemes.
8397 struct DesktopAppInfoLookup /* Interface */ {
8398 mixin template __interface__() {
8399 // DEPRECATED method: get_default_for_uri_scheme - The #GDesktopAppInfoLookup interface is deprecated and unused by gio.
8400 // Gets the default application for launching applications
8401 // using this URI scheme for a particular GDesktopAppInfoLookup
8402 // implementation.
8404 // The GDesktopAppInfoLookup interface and this function is used
8405 // to implement g_app_info_get_default_for_uri_scheme() backends
8406 // in a GIO module. There is no reason for applications to use it
8407 // directly. Applications should use g_app_info_get_default_for_uri_scheme().
8408 // RETURNS: #GAppInfo for given @uri_scheme or %NULL on error.
8409 // <uri_scheme>: a string containing a URI scheme.
8410 AppInfo* /*new*/ get_default_for_uri_scheme(AT0)(AT0 /*char*/ uri_scheme) nothrow {
8411 return g_desktop_app_info_lookup_get_default_for_uri_scheme(cast(DesktopAppInfoLookup*)&this, toCString!(char*)(uri_scheme));
8414 mixin __interface__;
8417 struct DesktopAppInfoLookupIface {
8418 GObject2.TypeInterface g_iface;
8420 // RETURNS: #GAppInfo for given @uri_scheme or %NULL on error.
8421 // <uri_scheme>: a string containing a URI scheme.
8422 extern (C) AppInfo* /*new*/ function (DesktopAppInfoLookup* lookup, char* uri_scheme) nothrow get_default_for_uri_scheme;
8426 // During invocation, g_desktop_app_info_launch_uris_as_manager() may
8427 // create one or more child processes. This callback is invoked once
8428 // for each, providing the process ID.
8429 // <appinfo>: a #GDesktopAppInfo
8430 // <pid>: Process identifier
8431 // <user_data>: User data
8432 extern (C) alias void function (DesktopAppInfo* appinfo, GLib2.Pid pid, void* user_data) nothrow DesktopAppLaunchCallback;
8435 // #GDrive - this represent a piece of hardware connected to the machine.
8436 // It's generally only created for removable hardware or hardware with
8437 // removable media.
8439 // #GDrive is a container class for #GVolume objects that stem from
8440 // the same piece of media. As such, #GDrive abstracts a drive with
8441 // (or without) removable media and provides operations for querying
8442 // whether media is available, determing whether media change is
8443 // automatically detected and ejecting the media.
8445 // If the #GDrive reports that media isn't automatically detected, one
8446 // can poll for media; typically one should not do this periodically
8447 // as a poll for media operation is potententially expensive and may
8448 // spin up the drive creating noise.
8450 // #GDrive supports starting and stopping drives with authentication
8451 // support for the former. This can be used to support a diverse set
8452 // of use cases including connecting/disconnecting iSCSI devices,
8453 // powering down external disk enclosures and starting/stopping
8454 // multi-disk devices such as RAID devices. Note that the actual
8455 // semantics and side-effects of starting/stopping a #GDrive may vary
8456 // according to implementation. To choose the correct verbs in e.g. a
8457 // file manager, use g_drive_get_start_stop_type().
8459 // For porting from GnomeVFS note that there is no equivalent of
8460 // #GDrive in that API.
8461 struct Drive /* Interface */ {
8462 mixin template __interface__() {
8463 // Checks if a drive can be ejected.
8464 // RETURNS: %TRUE if the @drive can be ejected, %FALSE otherwise.
8465 int can_eject()() nothrow {
8466 return g_drive_can_eject(cast(Drive*)&this);
8469 // Checks if a drive can be polled for media changes.
8471 // %FALSE otherwise.
8472 // RETURNS: %TRUE if the @drive can be polled for media changes,
8473 int can_poll_for_media()() nothrow {
8474 return g_drive_can_poll_for_media(cast(Drive*)&this);
8477 // VERSION: 2.22
8478 // Checks if a drive can be started.
8479 // RETURNS: %TRUE if the @drive can be started, %FALSE otherwise.
8480 int can_start()() nothrow {
8481 return g_drive_can_start(cast(Drive*)&this);
8484 // VERSION: 2.22
8485 // Checks if a drive can be started degraded.
8486 // RETURNS: %TRUE if the @drive can be started degraded, %FALSE otherwise.
8487 int can_start_degraded()() nothrow {
8488 return g_drive_can_start_degraded(cast(Drive*)&this);
8491 // VERSION: 2.22
8492 // Checks if a drive can be stopped.
8493 // RETURNS: %TRUE if the @drive can be stopped, %FALSE otherwise.
8494 int can_stop()() nothrow {
8495 return g_drive_can_stop(cast(Drive*)&this);
8498 // DEPRECATED (v2.22) method: eject - Use g_drive_eject_with_operation() instead.
8499 // Asynchronously ejects a drive.
8501 // When the operation is finished, @callback will be called.
8502 // You can then call g_drive_eject_finish() to obtain the
8503 // result of the operation.
8504 // <flags>: flags affecting the unmount if required for eject
8505 // <cancellable>: optional #GCancellable object, %NULL to ignore.
8506 // <callback>: a #GAsyncReadyCallback, or %NULL.
8507 // <user_data>: user data to pass to @callback
8508 void eject(AT0, AT1)(MountUnmountFlags flags, AT0 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT1 /*void*/ user_data) nothrow {
8509 g_drive_eject(cast(Drive*)&this, flags, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
8512 // DEPRECATED (v2.22) method: eject_finish - Use g_drive_eject_with_operation_finish() instead.
8513 // Finishes ejecting a drive.
8515 // %FALSE otherwise.
8516 // RETURNS: %TRUE if the drive has been ejected successfully,
8517 // <result>: a #GAsyncResult.
8518 int eject_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
8519 return g_drive_eject_finish(cast(Drive*)&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
8522 // VERSION: 2.22
8523 // Ejects a drive. This is an asynchronous operation, and is
8524 // finished by calling g_drive_eject_with_operation_finish() with the @drive
8525 // and #GAsyncResult data returned in the @callback.
8526 // <flags>: flags affecting the unmount if required for eject
8527 // <mount_operation>: a #GMountOperation or %NULL to avoid user interaction.
8528 // <cancellable>: optional #GCancellable object, %NULL to ignore.
8529 // <callback>: a #GAsyncReadyCallback, or %NULL.
8530 // <user_data>: user data passed to @callback.
8531 void eject_with_operation(AT0, AT1, AT2)(MountUnmountFlags flags, AT0 /*MountOperation*/ mount_operation, AT1 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT2 /*void*/ user_data) nothrow {
8532 g_drive_eject_with_operation(cast(Drive*)&this, flags, UpCast!(MountOperation*)(mount_operation), UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
8535 // VERSION: 2.22
8536 // Finishes ejecting a drive. If any errors occurred during the operation,
8537 // @error will be set to contain the errors and %FALSE will be returned.
8538 // RETURNS: %TRUE if the drive was successfully ejected. %FALSE otherwise.
8539 // <result>: a #GAsyncResult.
8540 int eject_with_operation_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
8541 return g_drive_eject_with_operation_finish(cast(Drive*)&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
8544 // Gets the kinds of identifiers that @drive has.
8545 // Use g_drive_get_identifier() to obtain the identifiers
8546 // themselves.
8548 // array of strings containing kinds of identifiers. Use g_strfreev()
8549 // to free.
8550 // RETURNS: a %NULL-terminated
8551 char** /*new*/ enumerate_identifiers()() nothrow {
8552 return g_drive_enumerate_identifiers(cast(Drive*)&this);
8555 // Gets the icon for @drive.
8557 // Free the returned object with g_object_unref().
8558 // RETURNS: #GIcon for the @drive.
8559 Icon* /*new*/ get_icon()() nothrow {
8560 return g_drive_get_icon(cast(Drive*)&this);
8563 // Gets the identifier of the given kind for @drive.
8565 // requested identfier, or %NULL if the #GDrive
8566 // doesn't have this kind of identifier.
8567 // RETURNS: a newly allocated string containing the
8568 // <kind>: the kind of identifier to return
8569 char* /*new*/ get_identifier(AT0)(AT0 /*char*/ kind) nothrow {
8570 return g_drive_get_identifier(cast(Drive*)&this, toCString!(char*)(kind));
8573 // Gets the name of @drive.
8575 // string should be freed when no longer needed.
8576 // RETURNS: a string containing @drive's name. The returned
8577 char* /*new*/ get_name()() nothrow {
8578 return g_drive_get_name(cast(Drive*)&this);
8581 // VERSION: 2.32
8582 // Gets the sort key for @drive, if any.
8583 // RETURNS: Sorting key for @drive or %NULL if no such key is available.
8584 char* get_sort_key()() nothrow {
8585 return g_drive_get_sort_key(cast(Drive*)&this);
8588 // VERSION: 2.22
8589 // Gets a hint about how a drive can be started/stopped.
8590 // RETURNS: A value from the #GDriveStartStopType enumeration.
8591 DriveStartStopType get_start_stop_type()() nothrow {
8592 return g_drive_get_start_stop_type(cast(Drive*)&this);
8595 // Get a list of mountable volumes for @drive.
8597 // The returned list should be freed with g_list_free(), after
8598 // its elements have been unreffed with g_object_unref().
8599 // RETURNS: #GList containing any #GVolume objects on the given @drive.
8600 GLib2.List* /*new*/ get_volumes()() nothrow {
8601 return g_drive_get_volumes(cast(Drive*)&this);
8604 // Checks if the @drive has media. Note that the OS may not be polling
8605 // the drive for media changes; see g_drive_is_media_check_automatic()
8606 // for more details.
8607 // RETURNS: %TRUE if @drive has media, %FALSE otherwise.
8608 int has_media()() nothrow {
8609 return g_drive_has_media(cast(Drive*)&this);
8612 // Check if @drive has any mountable volumes.
8613 // RETURNS: %TRUE if the @drive contains volumes, %FALSE otherwise.
8614 int has_volumes()() nothrow {
8615 return g_drive_has_volumes(cast(Drive*)&this);
8618 // Checks if @drive is capabable of automatically detecting media changes.
8620 // media changes, %FALSE otherwise.
8621 // RETURNS: %TRUE if the @drive is capabable of automatically detecting
8622 int is_media_check_automatic()() nothrow {
8623 return g_drive_is_media_check_automatic(cast(Drive*)&this);
8626 // Checks if the @drive supports removable media.
8627 // RETURNS: %TRUE if @drive supports removable media, %FALSE otherwise.
8628 int is_media_removable()() nothrow {
8629 return g_drive_is_media_removable(cast(Drive*)&this);
8632 // Asynchronously polls @drive to see if media has been inserted or removed.
8634 // When the operation is finished, @callback will be called.
8635 // You can then call g_drive_poll_for_media_finish() to obtain the
8636 // result of the operation.
8637 // <cancellable>: optional #GCancellable object, %NULL to ignore.
8638 // <callback>: a #GAsyncReadyCallback, or %NULL.
8639 // <user_data>: user data to pass to @callback
8640 void poll_for_media(AT0, AT1)(AT0 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT1 /*void*/ user_data) nothrow {
8641 g_drive_poll_for_media(cast(Drive*)&this, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
8644 // Finishes an operation started with g_drive_poll_for_media() on a drive.
8646 // %FALSE otherwise.
8647 // RETURNS: %TRUE if the drive has been poll_for_mediaed successfully,
8648 // <result>: a #GAsyncResult.
8649 int poll_for_media_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
8650 return g_drive_poll_for_media_finish(cast(Drive*)&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
8653 // VERSION: 2.22
8654 // Asynchronously starts a drive.
8656 // When the operation is finished, @callback will be called.
8657 // You can then call g_drive_start_finish() to obtain the
8658 // result of the operation.
8659 // <flags>: flags affecting the start operation.
8660 // <mount_operation>: a #GMountOperation or %NULL to avoid user interaction.
8661 // <cancellable>: optional #GCancellable object, %NULL to ignore.
8662 // <callback>: a #GAsyncReadyCallback, or %NULL.
8663 // <user_data>: user data to pass to @callback
8664 void start(AT0, AT1, AT2)(DriveStartFlags flags, AT0 /*MountOperation*/ mount_operation, AT1 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT2 /*void*/ user_data) nothrow {
8665 g_drive_start(cast(Drive*)&this, flags, UpCast!(MountOperation*)(mount_operation), UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
8668 // VERSION: 2.22
8669 // Finishes starting a drive.
8671 // %FALSE otherwise.
8672 // RETURNS: %TRUE if the drive has been started successfully,
8673 // <result>: a #GAsyncResult.
8674 int start_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
8675 return g_drive_start_finish(cast(Drive*)&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
8678 // VERSION: 2.22
8679 // Asynchronously stops a drive.
8681 // When the operation is finished, @callback will be called.
8682 // You can then call g_drive_stop_finish() to obtain the
8683 // result of the operation.
8684 // <flags>: flags affecting the unmount if required for stopping.
8685 // <mount_operation>: a #GMountOperation or %NULL to avoid user interaction.
8686 // <cancellable>: optional #GCancellable object, %NULL to ignore.
8687 // <callback>: a #GAsyncReadyCallback, or %NULL.
8688 // <user_data>: user data to pass to @callback
8689 void stop(AT0, AT1, AT2)(MountUnmountFlags flags, AT0 /*MountOperation*/ mount_operation, AT1 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT2 /*void*/ user_data) nothrow {
8690 g_drive_stop(cast(Drive*)&this, flags, UpCast!(MountOperation*)(mount_operation), UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
8693 // VERSION: 2.22
8694 // Finishes stopping a drive.
8696 // %FALSE otherwise.
8697 // RETURNS: %TRUE if the drive has been stopped successfully,
8698 // <result>: a #GAsyncResult.
8699 int stop_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
8700 return g_drive_stop_finish(cast(Drive*)&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
8702 // Emitted when the drive's state has changed.
8703 extern (C) alias static void function (Drive* this_, void* user_data=null) nothrow signal_changed;
8705 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
8706 return super_.signal_connect!name(cb, data, cf);
8709 ulong signal_connect(string name:"changed", CB/*:signal_changed*/)
8710 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
8711 if (is(typeof(cb)==signal_changed)||_ttmm!(CB, signal_changed)()) {
8712 return signal_connect_data!()(&this, cast(char*)"changed",
8713 cast(GObject2.Callback)cb, data, null, cf);
8716 // This signal is emitted when the #GDrive have been
8717 // disconnected. If the recipient is holding references to the
8718 // object they should release them so the object can be
8719 // finalized.
8720 extern (C) alias static void function (Drive* this_, void* user_data=null) nothrow signal_disconnected;
8721 ulong signal_connect(string name:"disconnected", CB/*:signal_disconnected*/)
8722 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
8723 if (is(typeof(cb)==signal_disconnected)||_ttmm!(CB, signal_disconnected)()) {
8724 return signal_connect_data!()(&this, cast(char*)"disconnected",
8725 cast(GObject2.Callback)cb, data, null, cf);
8728 // Emitted when the physical eject button (if any) of a drive has
8729 // been pressed.
8730 extern (C) alias static void function (Drive* this_, void* user_data=null) nothrow signal_eject_button;
8731 ulong signal_connect(string name:"eject-button", CB/*:signal_eject_button*/)
8732 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
8733 if (is(typeof(cb)==signal_eject_button)||_ttmm!(CB, signal_eject_button)()) {
8734 return signal_connect_data!()(&this, cast(char*)"eject-button",
8735 cast(GObject2.Callback)cb, data, null, cf);
8738 // VERSION: 2.22
8739 // Emitted when the physical stop button (if any) of a drive has
8740 // been pressed.
8741 extern (C) alias static void function (Drive* this_, void* user_data=null) nothrow signal_stop_button;
8742 ulong signal_connect(string name:"stop-button", CB/*:signal_stop_button*/)
8743 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
8744 if (is(typeof(cb)==signal_stop_button)||_ttmm!(CB, signal_stop_button)()) {
8745 return signal_connect_data!()(&this, cast(char*)"stop-button",
8746 cast(GObject2.Callback)cb, data, null, cf);
8749 mixin __interface__;
8752 // Interface for creating #GDrive implementations.
8753 struct DriveIface {
8754 GObject2.TypeInterface g_iface;
8755 extern (C) void function (Drive* drive) nothrow changed;
8756 extern (C) void function (Drive* drive) nothrow disconnected;
8757 extern (C) void function (Drive* drive) nothrow eject_button;
8758 // RETURNS: a string containing @drive's name. The returned
8759 extern (C) char* /*new*/ function (Drive* drive) nothrow get_name;
8760 // RETURNS: #GIcon for the @drive.
8761 extern (C) Icon* /*new*/ function (Drive* drive) nothrow get_icon;
8762 // RETURNS: %TRUE if the @drive contains volumes, %FALSE otherwise.
8763 extern (C) int function (Drive* drive) nothrow has_volumes;
8764 // RETURNS: #GList containing any #GVolume objects on the given @drive.
8765 extern (C) GLib2.List* /*new*/ function (Drive* drive) nothrow get_volumes;
8766 // RETURNS: %TRUE if @drive supports removable media, %FALSE otherwise.
8767 extern (C) int function (Drive* drive) nothrow is_media_removable;
8768 // RETURNS: %TRUE if @drive has media, %FALSE otherwise.
8769 extern (C) int function (Drive* drive) nothrow has_media;
8770 // RETURNS: %TRUE if the @drive is capabable of automatically detecting
8771 extern (C) int function (Drive* drive) nothrow is_media_check_automatic;
8772 // RETURNS: %TRUE if the @drive can be ejected, %FALSE otherwise.
8773 extern (C) int function (Drive* drive) nothrow can_eject;
8774 // RETURNS: %TRUE if the @drive can be polled for media changes,
8775 extern (C) int function (Drive* drive) nothrow can_poll_for_media;
8777 // <flags>: flags affecting the unmount if required for eject
8778 // <cancellable>: optional #GCancellable object, %NULL to ignore.
8779 // <callback>: a #GAsyncReadyCallback, or %NULL.
8780 // <user_data>: user data to pass to @callback
8781 extern (C) void function (Drive* drive, MountUnmountFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow eject;
8783 // RETURNS: %TRUE if the drive has been ejected successfully,
8784 // <result>: a #GAsyncResult.
8785 extern (C) int function (Drive* drive, AsyncResult* result, GLib2.Error** error=null) nothrow eject_finish;
8787 // <cancellable>: optional #GCancellable object, %NULL to ignore.
8788 // <callback>: a #GAsyncReadyCallback, or %NULL.
8789 // <user_data>: user data to pass to @callback
8790 extern (C) void function (Drive* drive, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow poll_for_media;
8792 // RETURNS: %TRUE if the drive has been poll_for_mediaed successfully,
8793 // <result>: a #GAsyncResult.
8794 extern (C) int function (Drive* drive, AsyncResult* result, GLib2.Error** error=null) nothrow poll_for_media_finish;
8796 // RETURNS: a newly allocated string containing the
8797 // <kind>: the kind of identifier to return
8798 extern (C) char* /*new*/ function (Drive* drive, char* kind) nothrow get_identifier;
8799 // RETURNS: a %NULL-terminated
8800 extern (C) char** /*new*/ function (Drive* drive) nothrow enumerate_identifiers;
8801 // RETURNS: A value from the #GDriveStartStopType enumeration.
8802 extern (C) DriveStartStopType function (Drive* drive) nothrow get_start_stop_type;
8803 // RETURNS: %TRUE if the @drive can be started, %FALSE otherwise.
8804 extern (C) int function (Drive* drive) nothrow can_start;
8805 // RETURNS: %TRUE if the @drive can be started degraded, %FALSE otherwise.
8806 extern (C) int function (Drive* drive) nothrow can_start_degraded;
8808 // <flags>: flags affecting the start operation.
8809 // <mount_operation>: a #GMountOperation or %NULL to avoid user interaction.
8810 // <cancellable>: optional #GCancellable object, %NULL to ignore.
8811 // <callback>: a #GAsyncReadyCallback, or %NULL.
8812 // <user_data>: user data to pass to @callback
8813 extern (C) void function (Drive* drive, DriveStartFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow start;
8815 // RETURNS: %TRUE if the drive has been started successfully,
8816 // <result>: a #GAsyncResult.
8817 extern (C) int function (Drive* drive, AsyncResult* result, GLib2.Error** error=null) nothrow start_finish;
8818 // RETURNS: %TRUE if the @drive can be stopped, %FALSE otherwise.
8819 extern (C) int function (Drive* drive) nothrow can_stop;
8821 // <flags>: flags affecting the unmount if required for stopping.
8822 // <mount_operation>: a #GMountOperation or %NULL to avoid user interaction.
8823 // <cancellable>: optional #GCancellable object, %NULL to ignore.
8824 // <callback>: a #GAsyncReadyCallback, or %NULL.
8825 // <user_data>: user data to pass to @callback
8826 extern (C) void function (Drive* drive, MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow stop;
8828 // RETURNS: %TRUE if the drive has been stopped successfully,
8829 // <result>: a #GAsyncResult.
8830 extern (C) int function (Drive* drive, AsyncResult* result, GLib2.Error** error=null) nothrow stop_finish;
8831 extern (C) void function (Drive* drive) nothrow stop_button;
8833 // <flags>: flags affecting the unmount if required for eject
8834 // <mount_operation>: a #GMountOperation or %NULL to avoid user interaction.
8835 // <cancellable>: optional #GCancellable object, %NULL to ignore.
8836 // <callback>: a #GAsyncReadyCallback, or %NULL.
8837 // <user_data>: user data passed to @callback.
8838 extern (C) void function (Drive* drive, MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow eject_with_operation;
8840 // RETURNS: %TRUE if the drive was successfully ejected. %FALSE otherwise.
8841 // <result>: a #GAsyncResult.
8842 extern (C) int function (Drive* drive, AsyncResult* result, GLib2.Error** error=null) nothrow eject_with_operation_finish;
8843 // RETURNS: Sorting key for @drive or %NULL if no such key is available.
8844 extern (C) char* function (Drive* drive) nothrow get_sort_key;
8847 // Flags used when starting a drive.
8848 enum DriveStartFlags /* Version 2.22 */ {
8849 NONE = 0
8851 // Enumeration describing how a drive can be started/stopped.
8852 enum DriveStartStopType /* Version 2.22 */ {
8853 UNKNOWN = 0,
8854 SHUTDOWN = 1,
8855 NETWORK = 2,
8856 MULTIDISK = 3,
8857 PASSWORD = 4
8860 // #GEmblem is an implementation of #GIcon that supports
8861 // having an emblem, which is an icon with additional properties.
8862 // It can than be added to a #GEmblemedIcon.
8864 // Currently, only metainformation about the emblem's origin is
8865 // supported. More may be added in the future.
8866 struct Emblem /* : GObject.Object */ {
8867 mixin Icon.__interface__;
8868 alias method_parent this;
8869 alias method_parent super_;
8870 alias method_parent object;
8871 GObject2.Object method_parent;
8874 // VERSION: 2.18
8875 // Creates a new emblem for @icon.
8876 // RETURNS: a new #GEmblem.
8877 // <icon>: a GIcon containing the icon.
8878 static Emblem* /*new*/ new_(AT0)(AT0 /*Icon*/ icon) nothrow {
8879 return g_emblem_new(UpCast!(Icon*)(icon));
8881 static auto opCall(AT0)(AT0 /*Icon*/ icon) {
8882 return g_emblem_new(UpCast!(Icon*)(icon));
8885 // VERSION: 2.18
8886 // Creates a new emblem for @icon.
8887 // RETURNS: a new #GEmblem.
8888 // <icon>: a GIcon containing the icon.
8889 // <origin>: a GEmblemOrigin enum defining the emblem's origin
8890 static Emblem* /*new*/ new_with_origin(AT0)(AT0 /*Icon*/ icon, EmblemOrigin origin) nothrow {
8891 return g_emblem_new_with_origin(UpCast!(Icon*)(icon), origin);
8893 static auto opCall(AT0)(AT0 /*Icon*/ icon, EmblemOrigin origin) {
8894 return g_emblem_new_with_origin(UpCast!(Icon*)(icon), origin);
8897 // VERSION: 2.18
8898 // Gives back the icon from @emblem.
8900 // the emblem and should not be modified or freed.
8901 // RETURNS: a #GIcon. The returned object belongs to
8902 Icon* get_icon()() nothrow {
8903 return g_emblem_get_icon(&this);
8906 // VERSION: 2.18
8907 // Gets the origin of the emblem.
8908 // RETURNS: the origin of the emblem
8909 EmblemOrigin get_origin()() nothrow {
8910 return g_emblem_get_origin(&this);
8914 struct EmblemClass {
8918 // GEmblemOrigin is used to add information about the origin of the emblem
8919 // to #GEmblem.
8920 enum EmblemOrigin /* Version 2.18 */ {
8921 UNKNOWN = 0,
8922 DEVICE = 1,
8923 LIVEMETADATA = 2,
8924 TAG = 3
8927 // #GEmblemedIcon is an implementation of #GIcon that supports
8928 // adding an emblem to an icon. Adding multiple emblems to an
8929 // icon is ensured via g_emblemed_icon_add_emblem().
8931 // Note that #GEmblemedIcon allows no control over the position
8932 // of the emblems. See also #GEmblem for more information.
8933 struct EmblemedIcon /* : GObject.Object */ {
8934 mixin Icon.__interface__;
8935 alias parent_instance this;
8936 alias parent_instance super_;
8937 alias parent_instance object;
8938 GObject2.Object parent_instance;
8939 private EmblemedIconPrivate* priv;
8942 // VERSION: 2.18
8943 // Creates a new emblemed icon for @icon with the emblem @emblem.
8944 // RETURNS: a new #GIcon
8945 // <icon>: a #GIcon
8946 // <emblem>: a #GEmblem, or %NULL
8947 static EmblemedIcon* /*new*/ new_(AT0, AT1)(AT0 /*Icon*/ icon, AT1 /*Emblem*/ emblem=null) nothrow {
8948 return g_emblemed_icon_new(UpCast!(Icon*)(icon), UpCast!(Emblem*)(emblem));
8950 static auto opCall(AT0, AT1)(AT0 /*Icon*/ icon, AT1 /*Emblem*/ emblem=null) {
8951 return g_emblemed_icon_new(UpCast!(Icon*)(icon), UpCast!(Emblem*)(emblem));
8954 // VERSION: 2.18
8955 // Adds @emblem to the #GList of #GEmblem <!-- -->s.
8956 // <emblem>: a #GEmblem
8957 void add_emblem(AT0)(AT0 /*Emblem*/ emblem) nothrow {
8958 g_emblemed_icon_add_emblem(&this, UpCast!(Emblem*)(emblem));
8961 // VERSION: 2.28
8962 // Removes all the emblems from @icon.
8963 void clear_emblems()() nothrow {
8964 g_emblemed_icon_clear_emblems(&this);
8967 // VERSION: 2.18
8968 // Gets the list of emblems for the @icon.
8970 // #GEmblem <!-- -->s that is owned by @emblemed
8971 // RETURNS: a #GList of
8972 GLib2.List* get_emblems()() nothrow {
8973 return g_emblemed_icon_get_emblems(&this);
8976 // VERSION: 2.18
8977 // Gets the main icon for @emblemed.
8978 // RETURNS: a #GIcon that is owned by @emblemed
8979 Icon* get_icon()() nothrow {
8980 return g_emblemed_icon_get_icon(&this);
8984 struct EmblemedIconClass {
8985 GObject2.ObjectClass parent_class;
8988 struct EmblemedIconPrivate {
8991 enum FILE_ATTRIBUTE_ACCESS_CAN_DELETE = "access::can-delete";
8992 enum FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE = "access::can-execute";
8993 enum FILE_ATTRIBUTE_ACCESS_CAN_READ = "access::can-read";
8994 enum FILE_ATTRIBUTE_ACCESS_CAN_RENAME = "access::can-rename";
8995 enum FILE_ATTRIBUTE_ACCESS_CAN_TRASH = "access::can-trash";
8996 enum FILE_ATTRIBUTE_ACCESS_CAN_WRITE = "access::can-write";
8997 enum FILE_ATTRIBUTE_DOS_IS_ARCHIVE = "dos::is-archive";
8998 enum FILE_ATTRIBUTE_DOS_IS_SYSTEM = "dos::is-system";
8999 enum FILE_ATTRIBUTE_ETAG_VALUE = "etag::value";
9000 enum FILE_ATTRIBUTE_FILESYSTEM_FREE = "filesystem::free";
9001 enum FILE_ATTRIBUTE_FILESYSTEM_READONLY = "filesystem::readonly";
9002 enum FILE_ATTRIBUTE_FILESYSTEM_SIZE = "filesystem::size";
9003 enum FILE_ATTRIBUTE_FILESYSTEM_TYPE = "filesystem::type";
9004 enum FILE_ATTRIBUTE_FILESYSTEM_USED = "filesystem::used";
9005 enum FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW = "filesystem::use-preview";
9006 enum FILE_ATTRIBUTE_GVFS_BACKEND = "gvfs::backend";
9007 enum FILE_ATTRIBUTE_ID_FILE = "id::file";
9008 enum FILE_ATTRIBUTE_ID_FILESYSTEM = "id::filesystem";
9009 enum FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT = "mountable::can-eject";
9010 enum FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT = "mountable::can-mount";
9011 enum FILE_ATTRIBUTE_MOUNTABLE_CAN_POLL = "mountable::can-poll";
9012 enum FILE_ATTRIBUTE_MOUNTABLE_CAN_START = "mountable::can-start";
9013 enum FILE_ATTRIBUTE_MOUNTABLE_CAN_START_DEGRADED = "mountable::can-start-degraded";
9014 enum FILE_ATTRIBUTE_MOUNTABLE_CAN_STOP = "mountable::can-stop";
9015 enum FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT = "mountable::can-unmount";
9016 enum FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI = "mountable::hal-udi";
9017 enum FILE_ATTRIBUTE_MOUNTABLE_IS_MEDIA_CHECK_AUTOMATIC = "mountable::is-media-check-automatic";
9018 enum FILE_ATTRIBUTE_MOUNTABLE_START_STOP_TYPE = "mountable::start-stop-type";
9019 enum FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE = "mountable::unix-device";
9020 enum FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE_FILE = "mountable::unix-device-file";
9021 enum FILE_ATTRIBUTE_OWNER_GROUP = "owner::group";
9022 enum FILE_ATTRIBUTE_OWNER_USER = "owner::user";
9023 enum FILE_ATTRIBUTE_OWNER_USER_REAL = "owner::user-real";
9024 enum FILE_ATTRIBUTE_PREVIEW_ICON = "preview::icon";
9025 enum FILE_ATTRIBUTE_SELINUX_CONTEXT = "selinux::context";
9026 enum FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE = "standard::allocated-size";
9027 enum FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE = "standard::content-type";
9028 enum FILE_ATTRIBUTE_STANDARD_COPY_NAME = "standard::copy-name";
9029 enum FILE_ATTRIBUTE_STANDARD_DESCRIPTION = "standard::description";
9030 enum FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME = "standard::display-name";
9031 enum FILE_ATTRIBUTE_STANDARD_EDIT_NAME = "standard::edit-name";
9032 enum FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE = "standard::fast-content-type";
9033 enum FILE_ATTRIBUTE_STANDARD_ICON = "standard::icon";
9034 enum FILE_ATTRIBUTE_STANDARD_IS_BACKUP = "standard::is-backup";
9035 enum FILE_ATTRIBUTE_STANDARD_IS_HIDDEN = "standard::is-hidden";
9036 enum FILE_ATTRIBUTE_STANDARD_IS_SYMLINK = "standard::is-symlink";
9037 enum FILE_ATTRIBUTE_STANDARD_IS_VIRTUAL = "standard::is-virtual";
9038 enum FILE_ATTRIBUTE_STANDARD_NAME = "standard::name";
9039 enum FILE_ATTRIBUTE_STANDARD_SIZE = "standard::size";
9040 enum FILE_ATTRIBUTE_STANDARD_SORT_ORDER = "standard::sort-order";
9041 enum FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET = "standard::symlink-target";
9042 enum FILE_ATTRIBUTE_STANDARD_TARGET_URI = "standard::target-uri";
9043 enum FILE_ATTRIBUTE_STANDARD_TYPE = "standard::type";
9044 enum FILE_ATTRIBUTE_THUMBNAILING_FAILED = "thumbnail::failed";
9045 enum FILE_ATTRIBUTE_THUMBNAIL_PATH = "thumbnail::path";
9046 enum FILE_ATTRIBUTE_TIME_ACCESS = "time::access";
9047 enum FILE_ATTRIBUTE_TIME_ACCESS_USEC = "time::access-usec";
9048 enum FILE_ATTRIBUTE_TIME_CHANGED = "time::changed";
9049 enum FILE_ATTRIBUTE_TIME_CHANGED_USEC = "time::changed-usec";
9050 enum FILE_ATTRIBUTE_TIME_CREATED = "time::created";
9051 enum FILE_ATTRIBUTE_TIME_CREATED_USEC = "time::created-usec";
9052 enum FILE_ATTRIBUTE_TIME_MODIFIED = "time::modified";
9053 enum FILE_ATTRIBUTE_TIME_MODIFIED_USEC = "time::modified-usec";
9054 enum FILE_ATTRIBUTE_TRASH_DELETION_DATE = "trash::deletion-date";
9055 enum FILE_ATTRIBUTE_TRASH_ITEM_COUNT = "trash::item-count";
9056 enum FILE_ATTRIBUTE_TRASH_ORIG_PATH = "trash::orig-path";
9057 enum FILE_ATTRIBUTE_UNIX_BLOCKS = "unix::blocks";
9058 enum FILE_ATTRIBUTE_UNIX_BLOCK_SIZE = "unix::block-size";
9059 enum FILE_ATTRIBUTE_UNIX_DEVICE = "unix::device";
9060 enum FILE_ATTRIBUTE_UNIX_GID = "unix::gid";
9061 enum FILE_ATTRIBUTE_UNIX_INODE = "unix::inode";
9062 enum FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT = "unix::is-mountpoint";
9063 enum FILE_ATTRIBUTE_UNIX_MODE = "unix::mode";
9064 enum FILE_ATTRIBUTE_UNIX_NLINK = "unix::nlink";
9065 enum FILE_ATTRIBUTE_UNIX_RDEV = "unix::rdev";
9066 enum FILE_ATTRIBUTE_UNIX_UID = "unix::uid";
9068 // #GFile is a high level abstraction for manipulating files on a
9069 // virtual file system. #GFile<!-- -->s are lightweight, immutable
9070 // objects that do no I/O upon creation. It is necessary to understand that
9071 // #GFile objects do not represent files, merely an identifier for a file. All
9072 // file content I/O is implemented as streaming operations (see #GInputStream and
9073 // #GOutputStream).
9075 // To construct a #GFile, you can use:
9076 // g_file_new_for_path() if you have a path.
9077 // g_file_new_for_uri() if you have a URI.
9078 // g_file_new_for_commandline_arg() for a command line argument.
9079 // g_file_new_tmp() to create a temporary file from a template.
9080 // g_file_parse_name() from a utf8 string gotten from g_file_get_parse_name().
9082 // One way to think of a #GFile is as an abstraction of a pathname. For normal
9083 // files the system pathname is what is stored internally, but as #GFile<!-- -->s
9084 // are extensible it could also be something else that corresponds to a pathname
9085 // in a userspace implementation of a filesystem.
9087 // #GFile<!-- -->s make up hierarchies of directories and files that correspond to the
9088 // files on a filesystem. You can move through the file system with #GFile using
9089 // g_file_get_parent() to get an identifier for the parent directory, g_file_get_child()
9090 // to get a child within a directory, g_file_resolve_relative_path() to resolve a relative
9091 // path between two #GFile<!-- -->s. There can be multiple hierarchies, so you may not
9092 // end up at the same root if you repeatedly call g_file_get_parent() on two different
9093 // files.
9095 // All #GFile<!-- -->s have a basename (get with g_file_get_basename()). These names
9096 // are byte strings that are used to identify the file on the filesystem (relative to
9097 // its parent directory) and there is no guarantees that they have any particular charset
9098 // encoding or even make any sense at all. If you want to use filenames in a user
9099 // interface you should use the display name that you can get by requesting the
9100 // %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME attribute with g_file_query_info().
9101 // This is guaranteed to be in utf8 and can be used in a user interface. But always
9102 // store the real basename or the #GFile to use to actually access the file, because
9103 // there is no way to go from a display name to the actual name.
9105 // Using #GFile as an identifier has the same weaknesses as using a path in that
9106 // there may be multiple aliases for the same file. For instance, hard or
9107 // soft links may cause two different #GFile<!-- -->s to refer to the same file.
9108 // Other possible causes for aliases are: case insensitive filesystems, short
9109 // and long names on Fat/NTFS, or bind mounts in Linux. If you want to check if
9110 // two #GFile<!-- -->s point to the same file you can query for the
9111 // %G_FILE_ATTRIBUTE_ID_FILE attribute. Note that #GFile does some trivial
9112 // canonicalization of pathnames passed in, so that trivial differences in the
9113 // path string used at creation (duplicated slashes, slash at end of path, "."
9114 // or ".." path segments, etc) does not create different #GFile<!-- -->s.
9116 // Many #GFile operations have both synchronous and asynchronous versions
9117 // to suit your application. Asynchronous versions of synchronous functions
9118 // simply have _async() appended to their function names. The asynchronous
9119 // I/O functions call a #GAsyncReadyCallback which is then used to finalize
9120 // the operation, producing a GAsyncResult which is then passed to the
9121 // function's matching _finish() operation.
9123 // Some #GFile operations do not have synchronous analogs, as they may
9124 // take a very long time to finish, and blocking may leave an application
9125 // unusable. Notable cases include:
9126 // g_file_mount_mountable() to mount a mountable file.
9127 // g_file_unmount_mountable_with_operation() to unmount a mountable file.
9128 // g_file_eject_mountable_with_operation() to eject a mountable file.
9130 // <para id="gfile-etag"><indexterm><primary>entity tag</primary></indexterm>
9131 // One notable feature of #GFile<!-- -->s are entity tags, or "etags" for
9132 // short. Entity tags are somewhat like a more abstract version of the
9133 // traditional mtime, and can be used to quickly determine if the file has
9134 // been modified from the version on the file system. See the HTTP 1.1
9135 // <ulink url="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html">specification</ulink>
9136 // for HTTP Etag headers, which are a very similar concept.
9137 // </para>
9138 struct File /* Interface */ {
9139 mixin template __interface__() {
9140 // Creates a #GFile with the given argument from the command line. The value of
9141 // @arg can be either a URI, an absolute path or a relative path resolved
9142 // relative to the current working directory.
9143 // This operation never fails, but the returned object might not support any
9144 // I/O operation if @arg points to a malformed path.
9146 // Free the returned object with g_object_unref().
9147 // RETURNS: a new #GFile.
9148 // <arg>: a command line string.
9149 static File* /*new*/ new_for_commandline_arg(AT0)(AT0 /*char*/ arg) nothrow {
9150 return g_file_new_for_commandline_arg(toCString!(char*)(arg));
9153 // Constructs a #GFile for a given path. This operation never
9154 // fails, but the returned object might not support any I/O
9155 // operation if @path is malformed.
9157 // Free the returned object with g_object_unref().
9158 // RETURNS: a new #GFile for the given @path.
9159 // <path>: a string containing a relative or absolute path. The string must be encoded in the glib filename encoding.
9160 static File* /*new*/ new_for_path(AT0)(AT0 /*char*/ path) nothrow {
9161 return g_file_new_for_path(toCString!(char*)(path));
9164 // Constructs a #GFile for a given URI. This operation never
9165 // fails, but the returned object might not support any I/O
9166 // operation if @uri is malformed or if the uri type is
9167 // not supported.
9169 // Free the returned object with g_object_unref().
9170 // RETURNS: a new #GFile for the given @uri.
9171 // <uri>: a UTF8 string containing a URI.
9172 static File* /*new*/ new_for_uri(AT0)(AT0 /*char*/ uri) nothrow {
9173 return g_file_new_for_uri(toCString!(char*)(uri));
9176 // VERSION: 2.32
9177 // Opens a file in the preferred directory for temporary files (as
9178 // returned by g_get_tmp_dir()) and returns a #GFile and
9179 // #GFileIOStream pointing to it.
9181 // @tmpl should be a string in the GLib file name encoding
9182 // containing a sequence of six 'X' characters, and containing no
9183 // directory components. If it is %NULL, a default template is used.
9185 // Unlike the other #GFile constructors, this will return %NULL if
9186 // a temporary file could not be created.
9188 // Free the returned object with g_object_unref().
9189 // RETURNS: a new #GFile.
9190 // <tmpl>: Template for the file name, as in g_file_open_tmp(), or %NULL for a default template.
9191 // <iostream>: on return, a #GFileIOStream for the created file.
9192 static File* /*new*/ new_tmp(AT0, AT1, AT2)(AT0 /*char*/ tmpl, /*out*/ AT1 /*FileIOStream**/ iostream, AT2 /*GLib2.Error**/ error=null) nothrow {
9193 return g_file_new_tmp(toCString!(char*)(tmpl), UpCast!(FileIOStream**)(iostream), UpCast!(GLib2.Error**)(error));
9196 // Constructs a #GFile with the given @parse_name (i.e. something given by g_file_get_parse_name()).
9197 // This operation never fails, but the returned object might not support any I/O
9198 // operation if the @parse_name cannot be parsed.
9199 // RETURNS: a new #GFile.
9200 // <parse_name>: a file name or path to be parsed.
9201 static File* /*new*/ parse_name(AT0)(AT0 /*char*/ parse_name) nothrow {
9202 return g_file_parse_name(toCString!(char*)(parse_name));
9205 // Gets an output stream for appending data to the file. If
9206 // the file doesn't already exist it is created.
9208 // By default files created are generally readable by everyone,
9209 // but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
9210 // will be made readable only to the current user, to the level that
9211 // is supported on the target filesystem.
9213 // If @cancellable is not %NULL, then the operation can be cancelled by
9214 // triggering the cancellable object from another thread. If the operation
9215 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9217 // Some file systems don't allow all file names, and may
9218 // return an %G_IO_ERROR_INVALID_FILENAME error.
9219 // If the file is a directory the %G_IO_ERROR_IS_DIRECTORY error will be
9220 // returned. Other errors are possible too, and depend on what kind of
9221 // filesystem the file is on.
9223 // Free the returned object with g_object_unref().
9224 // RETURNS: a #GFileOutputStream, or %NULL on error.
9225 // <flags>: a set of #GFileCreateFlags.
9226 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9227 FileOutputStream* /*new*/ append_to(AT0, AT1)(FileCreateFlags flags, AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
9228 return g_file_append_to(cast(File*)&this, flags, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
9231 // Asynchronously opens @file for appending.
9233 // For more details, see g_file_append_to() which is
9234 // the synchronous version of this call.
9236 // When the operation is finished, @callback will be called. You can then call
9237 // g_file_append_to_finish() to get the result of the operation.
9238 // <flags>: a set of #GFileCreateFlags.
9239 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
9240 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9241 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
9242 // <user_data>: the data to pass to callback function
9243 void append_to_async(AT0, AT1)(FileCreateFlags flags, int io_priority, AT0 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT1 /*void*/ user_data) nothrow {
9244 g_file_append_to_async(cast(File*)&this, flags, io_priority, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
9247 // Finishes an asynchronous file append operation started with
9248 // g_file_append_to_async().
9250 // Free the returned object with g_object_unref().
9251 // RETURNS: a valid #GFileOutputStream or %NULL on error.
9252 // <res>: #GAsyncResult
9253 FileOutputStream* /*new*/ append_to_finish(AT0, AT1)(AT0 /*AsyncResult*/ res, AT1 /*GLib2.Error**/ error=null) nothrow {
9254 return g_file_append_to_finish(cast(File*)&this, UpCast!(AsyncResult*)(res), UpCast!(GLib2.Error**)(error));
9257 // Copies the file @source to the location specified by @destination.
9258 // Can not handle recursive copies of directories.
9260 // If the flag #G_FILE_COPY_OVERWRITE is specified an already
9261 // existing @destination file is overwritten.
9263 // If the flag #G_FILE_COPY_NOFOLLOW_SYMLINKS is specified then symlinks
9264 // will be copied as symlinks, otherwise the target of the
9265 // @source symlink will be copied.
9267 // If @cancellable is not %NULL, then the operation can be cancelled by
9268 // triggering the cancellable object from another thread. If the operation
9269 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9271 // If @progress_callback is not %NULL, then the operation can be monitored by
9272 // setting this to a #GFileProgressCallback function. @progress_callback_data
9273 // will be passed to this function. It is guaranteed that this callback will
9274 // be called after all data has been transferred with the total number of bytes
9275 // copied during the operation.
9277 // If the @source file does not exist then the G_IO_ERROR_NOT_FOUND
9278 // error is returned, independent on the status of the @destination.
9280 // If #G_FILE_COPY_OVERWRITE is not specified and the target exists, then the
9281 // error G_IO_ERROR_EXISTS is returned.
9283 // If trying to overwrite a file over a directory the G_IO_ERROR_IS_DIRECTORY
9284 // error is returned. If trying to overwrite a directory with a directory the
9285 // G_IO_ERROR_WOULD_MERGE error is returned.
9287 // If the source is a directory and the target does not exist, or
9288 // #G_FILE_COPY_OVERWRITE is specified and the target is a file, then the
9289 // G_IO_ERROR_WOULD_RECURSE error is returned.
9291 // If you are interested in copying the #GFile object itself (not the on-disk
9292 // file), see g_file_dup().
9293 // RETURNS: %TRUE on success, %FALSE otherwise.
9294 // <destination>: destination #GFile
9295 // <flags>: set of #GFileCopyFlags
9296 // <cancellable>: optional #GCancellable object, %NULL to ignore
9297 // <progress_callback>: function to callback with progress information, or %NULL if progress information is not needed
9298 // <progress_callback_data>: user data to pass to @progress_callback
9299 int copy(AT0, AT1, AT2, AT3)(AT0 /*File*/ destination, FileCopyFlags flags, AT1 /*Cancellable*/ cancellable, FileProgressCallback progress_callback, AT2 /*void*/ progress_callback_data, AT3 /*GLib2.Error**/ error=null) nothrow {
9300 return g_file_copy(cast(File*)&this, UpCast!(File*)(destination), flags, UpCast!(Cancellable*)(cancellable), progress_callback, UpCast!(void*)(progress_callback_data), UpCast!(GLib2.Error**)(error));
9303 // Unintrospectable method: copy_async() / g_file_copy_async()
9304 // Copies the file @source to the location specified by @destination
9305 // asynchronously. For details of the behaviour, see g_file_copy().
9307 // If @progress_callback is not %NULL, then that function that will be called
9308 // just like in g_file_copy(), however the callback will run in the main loop,
9309 // not in the thread that is doing the I/O operation.
9311 // When the operation is finished, @callback will be called. You can then call
9312 // g_file_copy_finish() to get the result of the operation.
9313 // <destination>: destination #GFile
9314 // <flags>: set of #GFileCopyFlags
9315 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request
9316 // <cancellable>: optional #GCancellable object, %NULL to ignore
9317 // <progress_callback>: function to callback with progress information, or %NULL if progress information is not needed
9318 // <progress_callback_data>: user data to pass to @progress_callback
9319 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
9320 // <user_data>: the data to pass to callback function
9321 void copy_async(AT0, AT1, AT2, AT3)(AT0 /*File*/ destination, FileCopyFlags flags, int io_priority, AT1 /*Cancellable*/ cancellable, FileProgressCallback progress_callback, AT2 /*void*/ progress_callback_data, AsyncReadyCallback callback, AT3 /*void*/ user_data) nothrow {
9322 g_file_copy_async(cast(File*)&this, UpCast!(File*)(destination), flags, io_priority, UpCast!(Cancellable*)(cancellable), progress_callback, UpCast!(void*)(progress_callback_data), callback, UpCast!(void*)(user_data));
9325 // Copies the file attributes from @source to @destination.
9327 // Normally only a subset of the file attributes are copied,
9328 // those that are copies in a normal file copy operation
9329 // (which for instance does not include e.g. owner). However
9330 // if #G_FILE_COPY_ALL_METADATA is specified in @flags, then
9331 // all the metadata that is possible to copy is copied. This
9332 // is useful when implementing move by copy + delete source.
9333 // RETURNS: %TRUE if the attributes were copied successfully, %FALSE otherwise.
9334 // <destination>: a #GFile to copy attributes to.
9335 // <flags>: a set of #GFileCopyFlags.
9336 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9337 int copy_attributes(AT0, AT1, AT2)(AT0 /*File*/ destination, FileCopyFlags flags, AT1 /*Cancellable*/ cancellable, AT2 /*GLib2.Error**/ error=null) nothrow {
9338 return g_file_copy_attributes(cast(File*)&this, UpCast!(File*)(destination), flags, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
9341 // Finishes copying the file started with
9342 // g_file_copy_async().
9343 // RETURNS: a %TRUE on success, %FALSE on error.
9344 // <res>: a #GAsyncResult.
9345 int copy_finish(AT0, AT1)(AT0 /*AsyncResult*/ res, AT1 /*GLib2.Error**/ error=null) nothrow {
9346 return g_file_copy_finish(cast(File*)&this, UpCast!(AsyncResult*)(res), UpCast!(GLib2.Error**)(error));
9349 // Creates a new file and returns an output stream for writing to it.
9350 // The file must not already exist.
9352 // By default files created are generally readable by everyone,
9353 // but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
9354 // will be made readable only to the current user, to the level that
9355 // is supported on the target filesystem.
9357 // If @cancellable is not %NULL, then the operation can be cancelled by
9358 // triggering the cancellable object from another thread. If the operation
9359 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9361 // If a file or directory with this name already exists the G_IO_ERROR_EXISTS
9362 // error will be returned.
9363 // Some file systems don't allow all file names, and may
9364 // return an G_IO_ERROR_INVALID_FILENAME error, and if the name
9365 // is to long G_IO_ERROR_FILENAME_TOO_LONG will be returned.
9366 // Other errors are possible too, and depend on what kind of
9367 // filesystem the file is on.
9369 // %NULL on error.
9370 // Free the returned object with g_object_unref().
9371 // RETURNS: a #GFileOutputStream for the newly created file, or
9372 // <flags>: a set of #GFileCreateFlags.
9373 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9374 FileOutputStream* /*new*/ create(AT0, AT1)(FileCreateFlags flags, AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
9375 return g_file_create(cast(File*)&this, flags, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
9378 // Asynchronously creates a new file and returns an output stream for writing to it.
9379 // The file must not already exist.
9381 // For more details, see g_file_create() which is
9382 // the synchronous version of this call.
9384 // When the operation is finished, @callback will be called. You can then call
9385 // g_file_create_finish() to get the result of the operation.
9386 // <flags>: a set of #GFileCreateFlags.
9387 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
9388 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9389 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
9390 // <user_data>: the data to pass to callback function
9391 void create_async(AT0, AT1)(FileCreateFlags flags, int io_priority, AT0 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT1 /*void*/ user_data) nothrow {
9392 g_file_create_async(cast(File*)&this, flags, io_priority, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
9395 // Finishes an asynchronous file create operation started with
9396 // g_file_create_async().
9398 // Free the returned object with g_object_unref().
9399 // RETURNS: a #GFileOutputStream or %NULL on error.
9400 // <res>: a #GAsyncResult.
9401 FileOutputStream* /*new*/ create_finish(AT0, AT1)(AT0 /*AsyncResult*/ res, AT1 /*GLib2.Error**/ error=null) nothrow {
9402 return g_file_create_finish(cast(File*)&this, UpCast!(AsyncResult*)(res), UpCast!(GLib2.Error**)(error));
9405 // VERSION: 2.22
9406 // Creates a new file and returns a stream for reading and writing to it.
9407 // The file must not already exist.
9409 // By default files created are generally readable by everyone,
9410 // but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
9411 // will be made readable only to the current user, to the level that
9412 // is supported on the target filesystem.
9414 // If @cancellable is not %NULL, then the operation can be cancelled by
9415 // triggering the cancellable object from another thread. If the operation
9416 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9418 // If a file or directory with this name already exists the %G_IO_ERROR_EXISTS
9419 // error will be returned. Some file systems don't allow all file names,
9420 // and may return an %G_IO_ERROR_INVALID_FILENAME error, and if the name
9421 // is too long, %G_IO_ERROR_FILENAME_TOO_LONG will be returned. Other errors
9422 // are possible too, and depend on what kind of filesystem the file is on.
9424 // Note that in many non-local file cases read and write streams are not
9425 // supported, so make sure you really need to do read and write streaming,
9426 // rather than just opening for reading or writing.
9428 // Free the returned object with g_object_unref().
9429 // RETURNS: a #GFileIOStream for the newly created file, or %NULL on error.
9430 // <flags>: a set of #GFileCreateFlags
9431 // <cancellable>: optional #GCancellable object, %NULL to ignore
9432 FileIOStream* /*new*/ create_readwrite(AT0, AT1)(FileCreateFlags flags, AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
9433 return g_file_create_readwrite(cast(File*)&this, flags, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
9436 // VERSION: 2.22
9437 // Asynchronously creates a new file and returns a stream for reading and
9438 // writing to it. The file must not already exist.
9440 // For more details, see g_file_create_readwrite() which is
9441 // the synchronous version of this call.
9443 // When the operation is finished, @callback will be called. You can then
9444 // call g_file_create_readwrite_finish() to get the result of the operation.
9445 // <flags>: a set of #GFileCreateFlags
9446 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request
9447 // <cancellable>: optional #GCancellable object, %NULL to ignore
9448 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
9449 // <user_data>: the data to pass to callback function
9450 void create_readwrite_async(AT0, AT1)(FileCreateFlags flags, int io_priority, AT0 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT1 /*void*/ user_data) nothrow {
9451 g_file_create_readwrite_async(cast(File*)&this, flags, io_priority, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
9454 // VERSION: 2.22
9455 // Finishes an asynchronous file create operation started with
9456 // g_file_create_readwrite_async().
9458 // Free the returned object with g_object_unref().
9459 // RETURNS: a #GFileIOStream or %NULL on error.
9460 // <res>: a #GAsyncResult
9461 FileIOStream* /*new*/ create_readwrite_finish(AT0, AT1)(AT0 /*AsyncResult*/ res, AT1 /*GLib2.Error**/ error=null) nothrow {
9462 return g_file_create_readwrite_finish(cast(File*)&this, UpCast!(AsyncResult*)(res), UpCast!(GLib2.Error**)(error));
9465 // Deletes a file. If the @file is a directory, it will only be deleted if it
9466 // is empty.
9468 // If @cancellable is not %NULL, then the operation can be cancelled by
9469 // triggering the cancellable object from another thread. If the operation
9470 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9471 // RETURNS: %TRUE if the file was deleted. %FALSE otherwise.
9472 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9473 int delete_(AT0, AT1)(AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
9474 return g_file_delete(cast(File*)&this, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
9477 // Duplicates a #GFile handle. This operation does not duplicate
9478 // the actual file or directory represented by the #GFile; see
9479 // g_file_copy() if attempting to copy a file.
9481 // This call does no blocking i/o.
9482 // RETURNS: a new #GFile that is a duplicate of the given #GFile.
9483 File* /*new*/ dup()() nothrow {
9484 return g_file_dup(cast(File*)&this);
9487 // DEPRECATED (v2.22) method: eject_mountable - Use g_file_eject_mountable_with_operation() instead.
9488 // Starts an asynchronous eject on a mountable.
9489 // When this operation has completed, @callback will be called with
9490 // @user_user data, and the operation can be finalized with
9491 // g_file_eject_mountable_finish().
9493 // If @cancellable is not %NULL, then the operation can be cancelled by
9494 // triggering the cancellable object from another thread. If the operation
9495 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9496 // <flags>: flags affecting the operation
9497 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9498 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
9499 // <user_data>: the data to pass to callback function
9500 void eject_mountable(AT0, AT1)(MountUnmountFlags flags, AT0 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT1 /*void*/ user_data) nothrow {
9501 g_file_eject_mountable(cast(File*)&this, flags, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
9504 // DEPRECATED (v2.22) method: eject_mountable_finish - Use g_file_eject_mountable_with_operation_finish() instead.
9505 // Finishes an asynchronous eject operation started by
9506 // g_file_eject_mountable().
9508 // otherwise.
9509 // RETURNS: %TRUE if the @file was ejected successfully. %FALSE
9510 // <result>: a #GAsyncResult.
9511 int eject_mountable_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
9512 return g_file_eject_mountable_finish(cast(File*)&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
9515 // VERSION: 2.22
9516 // Starts an asynchronous eject on a mountable.
9517 // When this operation has completed, @callback will be called with
9518 // @user_user data, and the operation can be finalized with
9519 // g_file_eject_mountable_with_operation_finish().
9521 // If @cancellable is not %NULL, then the operation can be cancelled by
9522 // triggering the cancellable object from another thread. If the operation
9523 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9524 // <flags>: flags affecting the operation
9525 // <mount_operation>: a #GMountOperation, or %NULL to avoid user interaction.
9526 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9527 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
9528 // <user_data>: the data to pass to callback function
9529 void eject_mountable_with_operation(AT0, AT1, AT2)(MountUnmountFlags flags, AT0 /*MountOperation*/ mount_operation, AT1 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT2 /*void*/ user_data) nothrow {
9530 g_file_eject_mountable_with_operation(cast(File*)&this, flags, UpCast!(MountOperation*)(mount_operation), UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
9533 // VERSION: 2.22
9534 // Finishes an asynchronous eject operation started by
9535 // g_file_eject_mountable_with_operation().
9537 // otherwise.
9538 // RETURNS: %TRUE if the @file was ejected successfully. %FALSE
9539 // <result>: a #GAsyncResult.
9540 int eject_mountable_with_operation_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
9541 return g_file_eject_mountable_with_operation_finish(cast(File*)&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
9544 // Gets the requested information about the files in a directory. The result
9545 // is a #GFileEnumerator object that will give out #GFileInfo objects for
9546 // all the files in the directory.
9548 // The @attributes value is a string that specifies the file attributes that
9549 // should be gathered. It is not an error if it's not possible to read a particular
9550 // requested attribute from a file - it just won't be set. @attributes should
9551 // be a comma-separated list of attributes or attribute wildcards. The wildcard "*"
9552 // means all attributes, and a wildcard like "standard::*" means all attributes in the standard
9553 // namespace. An example attribute query be "standard::*,owner::user".
9554 // The standard attributes are available as defines, like #G_FILE_ATTRIBUTE_STANDARD_NAME.
9556 // If @cancellable is not %NULL, then the operation can be cancelled by
9557 // triggering the cancellable object from another thread. If the operation
9558 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9560 // If the file does not exist, the G_IO_ERROR_NOT_FOUND error will be returned.
9561 // If the file is not a directory, the G_FILE_ERROR_NOTDIR error will be returned.
9562 // Other errors are possible too.
9564 // Free the returned object with g_object_unref().
9565 // RETURNS: A #GFileEnumerator if successful, %NULL on error.
9566 // <attributes>: an attribute query string.
9567 // <flags>: a set of #GFileQueryInfoFlags.
9568 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9569 FileEnumerator* /*new*/ enumerate_children(AT0, AT1, AT2)(AT0 /*char*/ attributes, FileQueryInfoFlags flags, AT1 /*Cancellable*/ cancellable, AT2 /*GLib2.Error**/ error=null) nothrow {
9570 return g_file_enumerate_children(cast(File*)&this, toCString!(char*)(attributes), flags, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
9573 // Asynchronously gets the requested information about the files in a directory. The result
9574 // is a #GFileEnumerator object that will give out #GFileInfo objects for
9575 // all the files in the directory.
9577 // For more details, see g_file_enumerate_children() which is
9578 // the synchronous version of this call.
9580 // When the operation is finished, @callback will be called. You can then call
9581 // g_file_enumerate_children_finish() to get the result of the operation.
9582 // <attributes>: an attribute query string.
9583 // <flags>: a set of #GFileQueryInfoFlags.
9584 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
9585 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9586 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
9587 // <user_data>: the data to pass to callback function
9588 void enumerate_children_async(AT0, AT1, AT2)(AT0 /*char*/ attributes, FileQueryInfoFlags flags, int io_priority, AT1 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT2 /*void*/ user_data) nothrow {
9589 g_file_enumerate_children_async(cast(File*)&this, toCString!(char*)(attributes), flags, io_priority, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
9592 // Finishes an async enumerate children operation.
9593 // See g_file_enumerate_children_async().
9595 // Free the returned object with g_object_unref().
9596 // RETURNS: a #GFileEnumerator or %NULL if an error occurred.
9597 // <res>: a #GAsyncResult.
9598 FileEnumerator* /*new*/ enumerate_children_finish(AT0, AT1)(AT0 /*AsyncResult*/ res, AT1 /*GLib2.Error**/ error=null) nothrow {
9599 return g_file_enumerate_children_finish(cast(File*)&this, UpCast!(AsyncResult*)(res), UpCast!(GLib2.Error**)(error));
9602 // Checks equality of two given #GFile<!-- -->s. Note that two
9603 // #GFile<!-- -->s that differ can still refer to the same
9604 // file on the filesystem due to various forms of filename
9605 // aliasing.
9607 // This call does no blocking i/o.
9609 // %FALSE if either is not a #GFile.
9610 // RETURNS: %TRUE if @file1 and @file2 are equal.
9611 // <file2>: the second #GFile.
9612 int equal(AT0)(AT0 /*File*/ file2) nothrow {
9613 return g_file_equal(cast(File*)&this, UpCast!(File*)(file2));
9616 // Gets a #GMount for the #GFile.
9618 // If the #GFileIface for @file does not have a mount (e.g. possibly a
9619 // remote share), @error will be set to %G_IO_ERROR_NOT_FOUND and %NULL
9620 // will be returned.
9622 // If @cancellable is not %NULL, then the operation can be cancelled by
9623 // triggering the cancellable object from another thread. If the operation
9624 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9626 // Free the returned object with g_object_unref().
9627 // RETURNS: a #GMount where the @file is located or %NULL on error.
9628 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9629 Mount* /*new*/ find_enclosing_mount(AT0, AT1)(AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
9630 return g_file_find_enclosing_mount(cast(File*)&this, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
9633 // Asynchronously gets the mount for the file.
9635 // For more details, see g_file_find_enclosing_mount() which is
9636 // the synchronous version of this call.
9638 // When the operation is finished, @callback will be called. You can then call
9639 // g_file_find_enclosing_mount_finish() to get the result of the operation.
9640 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
9641 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9642 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
9643 // <user_data>: the data to pass to callback function
9644 void find_enclosing_mount_async(AT0, AT1)(int io_priority, AT0 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT1 /*void*/ user_data) nothrow {
9645 g_file_find_enclosing_mount_async(cast(File*)&this, io_priority, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
9648 // Finishes an asynchronous find mount request.
9649 // See g_file_find_enclosing_mount_async().
9651 // Free the returned object with g_object_unref().
9652 // RETURNS: #GMount for given @file or %NULL on error.
9653 // <res>: a #GAsyncResult
9654 Mount* /*new*/ find_enclosing_mount_finish(AT0, AT1)(AT0 /*AsyncResult*/ res, AT1 /*GLib2.Error**/ error=null) nothrow {
9655 return g_file_find_enclosing_mount_finish(cast(File*)&this, UpCast!(AsyncResult*)(res), UpCast!(GLib2.Error**)(error));
9658 // Gets the base name (the last component of the path) for a given #GFile.
9660 // If called for the top level of a system (such as the filesystem root
9661 // or a uri like sftp://host/) it will return a single directory separator
9662 // (and on Windows, possibly a drive letter).
9664 // The base name is a byte string (*not* UTF-8). It has no defined encoding
9665 // or rules other than it may not contain zero bytes. If you want to use
9666 // filenames in a user interface you should use the display name that you
9667 // can get by requesting the %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME
9668 // attribute with g_file_query_info().
9670 // This call does no blocking i/o.
9672 // if given #GFile is invalid. The returned string should be
9673 // freed with g_free() when no longer needed.
9674 // RETURNS: string containing the #GFile's base name, or %NULL
9675 char* /*new*/ get_basename()() nothrow {
9676 return g_file_get_basename(cast(File*)&this);
9679 // Gets a child of @file with basename equal to @name.
9681 // Note that the file with that specific name might not exist, but
9682 // you can still have a #GFile that points to it. You can use this
9683 // for instance to create that file.
9685 // This call does no blocking i/o.
9687 // Free the returned object with g_object_unref().
9688 // RETURNS: a #GFile to a child specified by @name.
9689 // <name>: string containing the child's basename.
9690 File* /*new*/ get_child(AT0)(AT0 /*char*/ name) nothrow {
9691 return g_file_get_child(cast(File*)&this, toCString!(char*)(name));
9694 // Gets the child of @file for a given @display_name (i.e. a UTF8
9695 // version of the name). If this function fails, it returns %NULL and @error will be
9696 // set. This is very useful when constructing a GFile for a new file
9697 // and the user entered the filename in the user interface, for instance
9698 // when you select a directory and type a filename in the file selector.
9700 // This call does no blocking i/o.
9702 // %NULL if the display name couldn't be converted.
9703 // Free the returned object with g_object_unref().
9704 // RETURNS: a #GFile to the specified child, or
9705 // <display_name>: string to a possible child.
9706 File* /*new*/ get_child_for_display_name(AT0, AT1)(AT0 /*char*/ display_name, AT1 /*GLib2.Error**/ error=null) nothrow {
9707 return g_file_get_child_for_display_name(cast(File*)&this, toCString!(char*)(display_name), UpCast!(GLib2.Error**)(error));
9710 // Gets the parent directory for the @file.
9711 // If the @file represents the root directory of the
9712 // file system, then %NULL will be returned.
9714 // This call does no blocking i/o.
9716 // #GFile or %NULL if there is no parent.
9717 // Free the returned object with g_object_unref().
9718 // RETURNS: a #GFile structure to the parent of the given
9719 File* /*new*/ get_parent()() nothrow {
9720 return g_file_get_parent(cast(File*)&this);
9723 // Gets the parse name of the @file.
9724 // A parse name is a UTF-8 string that describes the
9725 // file such that one can get the #GFile back using
9726 // g_file_parse_name().
9728 // This is generally used to show the #GFile as a nice
9729 // full-pathname kind of string in a user interface,
9730 // like in a location entry.
9732 // For local files with names that can safely be converted
9733 // to UTF8 the pathname is used, otherwise the IRI is used
9734 // (a form of URI that allows UTF8 characters unescaped).
9736 // This call does no blocking i/o.
9738 // string should be freed with g_free() when no longer needed.
9739 // RETURNS: a string containing the #GFile's parse name. The returned
9740 char* /*new*/ get_parse_name()() nothrow {
9741 return g_file_get_parse_name(cast(File*)&this);
9744 // Gets the local pathname for #GFile, if one exists.
9746 // This call does no blocking i/o.
9748 // no such path exists. The returned string should be
9749 // freed with g_free() when no longer needed.
9750 // RETURNS: string containing the #GFile's path, or %NULL if
9751 char* /*new*/ get_path()() nothrow {
9752 return g_file_get_path(cast(File*)&this);
9755 // Gets the path for @descendant relative to @parent.
9757 // This call does no blocking i/o.
9759 // to @parent, or %NULL if @descendant doesn't have @parent as prefix.
9760 // The returned string should be freed with g_free() when no longer needed.
9761 // RETURNS: string with the relative path from @descendant
9762 // <descendant>: input #GFile.
9763 char* /*new*/ get_relative_path(AT0)(AT0 /*File*/ descendant) nothrow {
9764 return g_file_get_relative_path(cast(File*)&this, UpCast!(File*)(descendant));
9767 // Gets the URI for the @file.
9769 // This call does no blocking i/o.
9771 // The returned string should be freed with g_free() when no longer needed.
9772 // RETURNS: a string containing the #GFile's URI.
9773 char* /*new*/ get_uri()() nothrow {
9774 return g_file_get_uri(cast(File*)&this);
9777 // Gets the URI scheme for a #GFile.
9778 // RFC 3986 decodes the scheme as:
9779 // <programlisting>
9780 // URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
9781 // </programlisting>
9782 // Common schemes include "file", "http", "ftp", etc.
9784 // This call does no blocking i/o.
9786 // #GFile. The returned string should be freed with g_free()
9787 // when no longer needed.
9788 // RETURNS: a string containing the URI scheme for the given
9789 char* /*new*/ get_uri_scheme()() nothrow {
9790 return g_file_get_uri_scheme(cast(File*)&this);
9793 // VERSION: 2.24
9794 // Checks if @file has a parent, and optionally, if it is @parent.
9796 // If @parent is %NULL then this function returns %TRUE if @file has any
9797 // parent at all. If @parent is non-%NULL then %TRUE is only returned
9798 // if @file is a child of @parent.
9800 // case that @parent is %NULL).
9801 // RETURNS: %TRUE if @file is a child of @parent (or any parent in the
9802 // <parent>: the parent to check for, or %NULL
9803 int has_parent(AT0)(AT0 /*File*/ parent=null) nothrow {
9804 return g_file_has_parent(cast(File*)&this, UpCast!(File*)(parent));
9807 // Checks whether @file has the prefix specified by @prefix. In other word,
9808 // if the names of initial elements of @file<!-- -->s pathname match @prefix.
9809 // Only full pathname elements are matched, so a path like /foo is not
9810 // considered a prefix of /foobar, only of /foo/bar.
9812 // This call does no i/o, as it works purely on names. As such it can
9813 // sometimes return %FALSE even if @file is inside a @prefix (from a
9814 // filesystem point of view), because the prefix of @file is an alias
9815 // of @prefix.
9817 // %FALSE otherwise.
9818 // RETURNS: %TRUE if the @files's parent, grandparent, etc is @prefix.
9819 // <prefix>: input #GFile.
9820 int has_prefix(AT0)(AT0 /*File*/ prefix) nothrow {
9821 return g_file_has_prefix(cast(File*)&this, UpCast!(File*)(prefix));
9824 // Checks to see if a #GFile has a given URI scheme.
9826 // This call does no blocking i/o.
9828 // given URI scheme, %FALSE if URI scheme is %NULL,
9829 // not supported, or #GFile is invalid.
9830 // RETURNS: %TRUE if #GFile's backend supports the
9831 // <uri_scheme>: a string containing a URI scheme.
9832 int has_uri_scheme(AT0)(AT0 /*char*/ uri_scheme) nothrow {
9833 return g_file_has_uri_scheme(cast(File*)&this, toCString!(char*)(uri_scheme));
9836 // Creates a hash value for a #GFile.
9838 // This call does no blocking i/o.
9840 // integer that can be used as hash value for the #GFile.
9841 // This function is intended for easily hashing a #GFile to
9842 // add to a #GHashTable or similar data structure.
9843 // RETURNS: 0 if @file is not a valid #GFile, otherwise an
9844 uint hash()() nothrow {
9845 return g_file_hash(cast(File*)&this);
9848 // Checks to see if a file is native to the platform.
9850 // A native file s one expressed in the platform-native filename format,
9851 // e.g. "C:\Windows" or "/usr/bin/". This does not mean the file is local,
9852 // as it might be on a locally mounted remote filesystem.
9854 // On some systems non-native files may be available using
9855 // the native filesystem via a userspace filesystem (FUSE), in
9856 // these cases this call will return %FALSE, but g_file_get_path()
9857 // will still return a native path.
9859 // This call does no blocking i/o.
9860 // RETURNS: %TRUE if file is native.
9861 int is_native()() nothrow {
9862 return g_file_is_native(cast(File*)&this);
9865 // Loads the content of the file into memory. The data is always
9866 // zero-terminated, but this is not included in the resultant @length.
9867 // The returned @content should be freed with g_free() when no longer
9868 // needed.
9870 // If @cancellable is not %NULL, then the operation can be cancelled by
9871 // triggering the cancellable object from another thread. If the operation
9872 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9874 // %FALSE if there were errors.
9875 // RETURNS: %TRUE if the @file's contents were successfully loaded.
9876 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9877 // <contents>: a location to place the contents of the file.
9878 // <length>: a location to place the length of the contents of the file, or %NULL if the length is not needed
9879 // <etag_out>: a location to place the current entity tag for the file, or %NULL if the entity tag is not needed
9880 int load_contents(AT0, AT1, AT2, AT3, AT4)(AT0 /*Cancellable*/ cancellable, /*out*/ AT1 /*ubyte**/ contents, /*out*/ AT2 /*size_t*/ length, /*out*/ AT3 /*char**/ etag_out, AT4 /*GLib2.Error**/ error=null) nothrow {
9881 return g_file_load_contents(cast(File*)&this, UpCast!(Cancellable*)(cancellable), UpCast!(ubyte**)(contents), UpCast!(size_t*)(length), toCString!(char**)(etag_out), UpCast!(GLib2.Error**)(error));
9884 // Starts an asynchronous load of the @file's contents.
9886 // For more details, see g_file_load_contents() which is
9887 // the synchronous version of this call.
9889 // When the load operation has completed, @callback will be called
9890 // with @user data. To finish the operation, call
9891 // g_file_load_contents_finish() with the #GAsyncResult returned by
9892 // the @callback.
9894 // If @cancellable is not %NULL, then the operation can be cancelled by
9895 // triggering the cancellable object from another thread. If the operation
9896 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9897 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9898 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
9899 // <user_data>: the data to pass to callback function
9900 void load_contents_async(AT0, AT1)(AT0 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT1 /*void*/ user_data) nothrow {
9901 g_file_load_contents_async(cast(File*)&this, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
9904 // Finishes an asynchronous load of the @file's contents.
9905 // The contents are placed in @contents, and @length is set to the
9906 // size of the @contents string. The @content should be freed with
9907 // g_free() when no longer needed. If @etag_out is present, it will be
9908 // set to the new entity tag for the @file.
9910 // present, it will be set appropriately.
9911 // RETURNS: %TRUE if the load was successful. If %FALSE and @error is
9912 // <res>: a #GAsyncResult.
9913 // <contents>: a location to place the contents of the file.
9914 // <length>: a location to place the length of the contents of the file, or %NULL if the length is not needed
9915 // <etag_out>: a location to place the current entity tag for the file, or %NULL if the entity tag is not needed
9916 int load_contents_finish(AT0, AT1, AT2, AT3, AT4)(AT0 /*AsyncResult*/ res, /*out*/ AT1 /*ubyte**/ contents, /*out*/ AT2 /*size_t*/ length, /*out*/ AT3 /*char**/ etag_out, AT4 /*GLib2.Error**/ error=null) nothrow {
9917 return g_file_load_contents_finish(cast(File*)&this, UpCast!(AsyncResult*)(res), UpCast!(ubyte**)(contents), UpCast!(size_t*)(length), toCString!(char**)(etag_out), UpCast!(GLib2.Error**)(error));
9920 // Unintrospectable method: load_partial_contents_async() / g_file_load_partial_contents_async()
9921 // Reads the partial contents of a file. A #GFileReadMoreCallback should be
9922 // used to stop reading from the file when appropriate, else this function
9923 // will behave exactly as g_file_load_contents_async(). This operation
9924 // can be finished by g_file_load_partial_contents_finish().
9926 // Users of this function should be aware that @user_data is passed to
9927 // both the @read_more_callback and the @callback.
9929 // If @cancellable is not %NULL, then the operation can be cancelled by
9930 // triggering the cancellable object from another thread. If the operation
9931 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9932 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9933 // <read_more_callback>: a #GFileReadMoreCallback to receive partial data and to specify whether further data should be read.
9934 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
9935 // <user_data>: the data to pass to the callback functions.
9936 void load_partial_contents_async(AT0, AT1)(AT0 /*Cancellable*/ cancellable, FileReadMoreCallback read_more_callback, AsyncReadyCallback callback, AT1 /*void*/ user_data) nothrow {
9937 g_file_load_partial_contents_async(cast(File*)&this, UpCast!(Cancellable*)(cancellable), read_more_callback, callback, UpCast!(void*)(user_data));
9940 // Finishes an asynchronous partial load operation that was started
9941 // with g_file_load_partial_contents_async(). The data is always
9942 // zero-terminated, but this is not included in the resultant @length.
9943 // The returned @content should be freed with g_free() when no longer
9944 // needed.
9946 // present, it will be set appropriately.
9947 // RETURNS: %TRUE if the load was successful. If %FALSE and @error is
9948 // <res>: a #GAsyncResult.
9949 // <contents>: a location to place the contents of the file.
9950 // <length>: a location to place the length of the contents of the file, or %NULL if the length is not needed
9951 // <etag_out>: a location to place the current entity tag for the file, or %NULL if the entity tag is not needed
9952 int load_partial_contents_finish(AT0, AT1, AT2, AT3, AT4)(AT0 /*AsyncResult*/ res, /*out*/ AT1 /*ubyte**/ contents, /*out*/ AT2 /*size_t*/ length, /*out*/ AT3 /*char**/ etag_out, AT4 /*GLib2.Error**/ error=null) nothrow {
9953 return g_file_load_partial_contents_finish(cast(File*)&this, UpCast!(AsyncResult*)(res), UpCast!(ubyte**)(contents), UpCast!(size_t*)(length), toCString!(char**)(etag_out), UpCast!(GLib2.Error**)(error));
9956 // Creates a directory. Note that this will only create a child directory of
9957 // the immediate parent directory of the path or URI given by the #GFile. To
9958 // recursively create directories, see g_file_make_directory_with_parents().
9959 // This function will fail if the parent directory does not exist, setting
9960 // @error to %G_IO_ERROR_NOT_FOUND. If the file system doesn't support creating
9961 // directories, this function will fail, setting @error to
9962 // %G_IO_ERROR_NOT_SUPPORTED.
9964 // For a local #GFile the newly created directory will have the default
9965 // (current) ownership and permissions of the current process.
9967 // If @cancellable is not %NULL, then the operation can be cancelled by
9968 // triggering the cancellable object from another thread. If the operation
9969 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9970 // RETURNS: %TRUE on successful creation, %FALSE otherwise.
9971 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9972 int make_directory(AT0, AT1)(AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
9973 return g_file_make_directory(cast(File*)&this, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
9976 // VERSION: 2.18
9977 // Creates a directory and any parent directories that may not exist similar to
9978 // 'mkdir -p'. If the file system does not support creating directories, this
9979 // function will fail, setting @error to %G_IO_ERROR_NOT_SUPPORTED. If the
9980 // directory itself already exists, this function will fail setting @error
9981 // to %G_IO_ERROR_EXISTS, unlike the similar g_mkdir_with_parents().
9983 // For a local #GFile the newly created directories will have the default
9984 // (current) ownership and permissions of the current process.
9986 // If @cancellable is not %NULL, then the operation can be cancelled by
9987 // triggering the cancellable object from another thread. If the operation
9988 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9990 // otherwise.
9991 // RETURNS: %TRUE if all directories have been successfully created, %FALSE
9992 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9993 int make_directory_with_parents(AT0, AT1)(AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
9994 return g_file_make_directory_with_parents(cast(File*)&this, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
9997 // Creates a symbolic link named @file which contains the string
9998 // @symlink_value.
10000 // If @cancellable is not %NULL, then the operation can be cancelled by
10001 // triggering the cancellable object from another thread. If the operation
10002 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10003 // RETURNS: %TRUE on the creation of a new symlink, %FALSE otherwise.
10004 // <symlink_value>: a string with the path for the target of the new symlink
10005 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10006 int make_symbolic_link(AT0, AT1, AT2)(AT0 /*char*/ symlink_value, AT1 /*Cancellable*/ cancellable, AT2 /*GLib2.Error**/ error=null) nothrow {
10007 return g_file_make_symbolic_link(cast(File*)&this, toCString!(char*)(symlink_value), UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
10010 // VERSION: 2.18
10011 // Obtains a file or directory monitor for the given file, depending
10012 // on the type of the file.
10014 // If @cancellable is not %NULL, then the operation can be cancelled by
10015 // triggering the cancellable object from another thread. If the operation
10016 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10018 // Free the returned object with g_object_unref().
10019 // RETURNS: a #GFileMonitor for the given @file, or %NULL on error.
10020 // <flags>: a set of #GFileMonitorFlags
10021 // <cancellable>: optional #GCancellable object, %NULL to ignore
10022 FileMonitor* /*new*/ monitor(AT0, AT1)(FileMonitorFlags flags, AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
10023 return g_file_monitor(cast(File*)&this, flags, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
10026 // Obtains a directory monitor for the given file.
10027 // This may fail if directory monitoring is not supported.
10029 // If @cancellable is not %NULL, then the operation can be cancelled by
10030 // triggering the cancellable object from another thread. If the operation
10031 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10033 // Free the returned object with g_object_unref().
10034 // RETURNS: a #GFileMonitor for the given @file, or %NULL on error.
10035 // <flags>: a set of #GFileMonitorFlags.
10036 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10037 FileMonitor* /*new*/ monitor_directory(AT0, AT1)(FileMonitorFlags flags, AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
10038 return g_file_monitor_directory(cast(File*)&this, flags, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
10041 // Obtains a file monitor for the given file. If no file notification
10042 // mechanism exists, then regular polling of the file is used.
10044 // If @cancellable is not %NULL, then the operation can be cancelled by
10045 // triggering the cancellable object from another thread. If the operation
10046 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10048 // Free the returned object with g_object_unref().
10049 // RETURNS: a #GFileMonitor for the given @file, or %NULL on error.
10050 // <flags>: a set of #GFileMonitorFlags.
10051 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10052 FileMonitor* /*new*/ monitor_file(AT0, AT1)(FileMonitorFlags flags, AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
10053 return g_file_monitor_file(cast(File*)&this, flags, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
10056 // Starts a @mount_operation, mounting the volume that contains the file @location.
10058 // When this operation has completed, @callback will be called with
10059 // @user_user data, and the operation can be finalized with
10060 // g_file_mount_enclosing_volume_finish().
10062 // If @cancellable is not %NULL, then the operation can be cancelled by
10063 // triggering the cancellable object from another thread. If the operation
10064 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10065 // <flags>: flags affecting the operation
10066 // <mount_operation>: a #GMountOperation or %NULL to avoid user interaction.
10067 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10068 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
10069 // <user_data>: the data to pass to callback function
10070 void mount_enclosing_volume(AT0, AT1, AT2)(MountMountFlags flags, AT0 /*MountOperation*/ mount_operation, AT1 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT2 /*void*/ user_data) nothrow {
10071 g_file_mount_enclosing_volume(cast(File*)&this, flags, UpCast!(MountOperation*)(mount_operation), UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
10074 // Finishes a mount operation started by g_file_mount_enclosing_volume().
10076 // has occurred, this function will return %FALSE and set @error
10077 // appropriately if present.
10078 // RETURNS: %TRUE if successful. If an error
10079 // <result>: a #GAsyncResult.
10080 int mount_enclosing_volume_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
10081 return g_file_mount_enclosing_volume_finish(cast(File*)&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
10084 // Mounts a file of type G_FILE_TYPE_MOUNTABLE.
10085 // Using @mount_operation, you can request callbacks when, for instance,
10086 // passwords are needed during authentication.
10088 // If @cancellable is not %NULL, then the operation can be cancelled by
10089 // triggering the cancellable object from another thread. If the operation
10090 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10092 // When the operation is finished, @callback will be called. You can then call
10093 // g_file_mount_mountable_finish() to get the result of the operation.
10094 // <flags>: flags affecting the operation
10095 // <mount_operation>: a #GMountOperation, or %NULL to avoid user interaction.
10096 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10097 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
10098 // <user_data>: the data to pass to callback function
10099 void mount_mountable(AT0, AT1, AT2)(MountMountFlags flags, AT0 /*MountOperation*/ mount_operation, AT1 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT2 /*void*/ user_data) nothrow {
10100 g_file_mount_mountable(cast(File*)&this, flags, UpCast!(MountOperation*)(mount_operation), UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
10103 // Finishes a mount operation. See g_file_mount_mountable() for details.
10105 // Finish an asynchronous mount operation that was started
10106 // with g_file_mount_mountable().
10108 // Free the returned object with g_object_unref().
10109 // RETURNS: a #GFile or %NULL on error.
10110 // <result>: a #GAsyncResult.
10111 File* /*new*/ mount_mountable_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
10112 return g_file_mount_mountable_finish(cast(File*)&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
10115 // Tries to move the file or directory @source to the location specified by @destination.
10116 // If native move operations are supported then this is used, otherwise a copy + delete
10117 // fallback is used. The native implementation may support moving directories (for instance
10118 // on moves inside the same filesystem), but the fallback code does not.
10120 // If the flag #G_FILE_COPY_OVERWRITE is specified an already
10121 // existing @destination file is overwritten.
10123 // If the flag #G_FILE_COPY_NOFOLLOW_SYMLINKS is specified then symlinks
10124 // will be copied as symlinks, otherwise the target of the
10125 // @source symlink will be copied.
10127 // If @cancellable is not %NULL, then the operation can be cancelled by
10128 // triggering the cancellable object from another thread. If the operation
10129 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10131 // If @progress_callback is not %NULL, then the operation can be monitored by
10132 // setting this to a #GFileProgressCallback function. @progress_callback_data
10133 // will be passed to this function. It is guaranteed that this callback will
10134 // be called after all data has been transferred with the total number of bytes
10135 // copied during the operation.
10137 // If the @source file does not exist then the G_IO_ERROR_NOT_FOUND
10138 // error is returned, independent on the status of the @destination.
10140 // If #G_FILE_COPY_OVERWRITE is not specified and the target exists, then the
10141 // error G_IO_ERROR_EXISTS is returned.
10143 // If trying to overwrite a file over a directory the G_IO_ERROR_IS_DIRECTORY
10144 // error is returned. If trying to overwrite a directory with a directory the
10145 // G_IO_ERROR_WOULD_MERGE error is returned.
10147 // If the source is a directory and the target does not exist, or #G_FILE_COPY_OVERWRITE is
10148 // specified and the target is a file, then the G_IO_ERROR_WOULD_RECURSE error
10149 // may be returned (if the native move operation isn't available).
10150 // RETURNS: %TRUE on successful move, %FALSE otherwise.
10151 // <destination>: #GFile pointing to the destination location.
10152 // <flags>: set of #GFileCopyFlags.
10153 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10154 // <progress_callback>: #GFileProgressCallback function for updates.
10155 // <progress_callback_data>: gpointer to user data for the callback function.
10156 int move(AT0, AT1, AT2, AT3)(AT0 /*File*/ destination, FileCopyFlags flags, AT1 /*Cancellable*/ cancellable, FileProgressCallback progress_callback, AT2 /*void*/ progress_callback_data, AT3 /*GLib2.Error**/ error=null) nothrow {
10157 return g_file_move(cast(File*)&this, UpCast!(File*)(destination), flags, UpCast!(Cancellable*)(cancellable), progress_callback, UpCast!(void*)(progress_callback_data), UpCast!(GLib2.Error**)(error));
10160 // VERSION: 2.22
10161 // Opens an existing file for reading and writing. The result is
10162 // a #GFileIOStream that can be used to read and write the contents of the file.
10164 // If @cancellable is not %NULL, then the operation can be cancelled by
10165 // triggering the cancellable object from another thread. If the operation
10166 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10168 // If the file does not exist, the G_IO_ERROR_NOT_FOUND error will be returned.
10169 // If the file is a directory, the G_IO_ERROR_IS_DIRECTORY error will be returned.
10170 // Other errors are possible too, and depend on what kind of filesystem the file is on.
10171 // Note that in many non-local file cases read and write streams are not supported,
10172 // so make sure you really need to do read and write streaming, rather than
10173 // just opening for reading or writing.
10175 // Free the returned object with g_object_unref().
10176 // RETURNS: #GFileIOStream or %NULL on error.
10177 // <cancellable>: a #GCancellable
10178 FileIOStream* /*new*/ open_readwrite(AT0, AT1)(AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
10179 return g_file_open_readwrite(cast(File*)&this, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
10182 // VERSION: 2.22
10183 // Asynchronously opens @file for reading and writing.
10185 // For more details, see g_file_open_readwrite() which is
10186 // the synchronous version of this call.
10188 // When the operation is finished, @callback will be called. You can then call
10189 // g_file_open_readwrite_finish() to get the result of the operation.
10190 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
10191 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10192 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
10193 // <user_data>: the data to pass to callback function
10194 void open_readwrite_async(AT0, AT1)(int io_priority, AT0 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT1 /*void*/ user_data) nothrow {
10195 g_file_open_readwrite_async(cast(File*)&this, io_priority, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
10198 // VERSION: 2.22
10199 // Finishes an asynchronous file read operation started with
10200 // g_file_open_readwrite_async().
10202 // Free the returned object with g_object_unref().
10203 // RETURNS: a #GFileIOStream or %NULL on error.
10204 // <res>: a #GAsyncResult.
10205 FileIOStream* /*new*/ open_readwrite_finish(AT0, AT1)(AT0 /*AsyncResult*/ res, AT1 /*GLib2.Error**/ error=null) nothrow {
10206 return g_file_open_readwrite_finish(cast(File*)&this, UpCast!(AsyncResult*)(res), UpCast!(GLib2.Error**)(error));
10209 // VERSION: 2.22
10210 // Polls a file of type G_FILE_TYPE_MOUNTABLE.
10212 // If @cancellable is not %NULL, then the operation can be cancelled by
10213 // triggering the cancellable object from another thread. If the operation
10214 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10216 // When the operation is finished, @callback will be called. You can then call
10217 // g_file_mount_mountable_finish() to get the result of the operation.
10218 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10219 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
10220 // <user_data>: the data to pass to callback function
10221 void poll_mountable(AT0, AT1)(AT0 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT1 /*void*/ user_data) nothrow {
10222 g_file_poll_mountable(cast(File*)&this, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
10225 // VERSION: 2.22
10226 // Finishes a poll operation. See g_file_poll_mountable() for details.
10228 // Finish an asynchronous poll operation that was polled
10229 // with g_file_poll_mountable().
10231 // otherwise.
10232 // RETURNS: %TRUE if the operation finished successfully. %FALSE
10233 // <result>: a #GAsyncResult.
10234 int poll_mountable_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
10235 return g_file_poll_mountable_finish(cast(File*)&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
10238 // Returns the #GAppInfo that is registered as the default
10239 // application to handle the file specified by @file.
10241 // If @cancellable is not %NULL, then the operation can be cancelled by
10242 // triggering the cancellable object from another thread. If the operation
10243 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10245 // When you are done with it, release it with g_object_unref()
10246 // RETURNS: a #GAppInfo if the handle was found, %NULL if there were errors.
10247 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10248 AppInfo* /*new*/ query_default_handler(AT0, AT1)(AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
10249 return g_file_query_default_handler(cast(File*)&this, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
10252 // Utility function to check if a particular file exists. This is
10253 // implemented using g_file_query_info() and as such does blocking I/O.
10255 // Note that in many cases it is racy to first check for file existence
10256 // and then execute something based on the outcome of that, because the
10257 // file might have been created or removed in between the operations. The
10258 // general approach to handling that is to not check, but just do the
10259 // operation and handle the errors as they come.
10261 // As an example of race-free checking, take the case of reading a file, and
10262 // if it doesn't exist, creating it. There are two racy versions: read it, and
10263 // on error create it; and: check if it exists, if not create it. These
10264 // can both result in two processes creating the file (with perhaps a partially
10265 // written file as the result). The correct approach is to always try to create
10266 // the file with g_file_create() which will either atomically create the file
10267 // or fail with a G_IO_ERROR_EXISTS error.
10269 // However, in many cases an existence check is useful in a user
10270 // interface, for instance to make a menu item sensitive/insensitive, so that
10271 // you don't have to fool users that something is possible and then just show
10272 // and error dialog. If you do this, you should make sure to also handle the
10273 // errors that can happen due to races when you execute the operation.
10274 // RETURNS: %TRUE if the file exists (and can be detected without error), %FALSE otherwise (or if cancelled).
10275 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10276 int query_exists(AT0)(AT0 /*Cancellable*/ cancellable=null) nothrow {
10277 return g_file_query_exists(cast(File*)&this, UpCast!(Cancellable*)(cancellable));
10280 // VERSION: 2.18
10281 // Utility function to inspect the #GFileType of a file. This is
10282 // implemented using g_file_query_info() and as such does blocking I/O.
10284 // The primary use case of this method is to check if a file is a regular file,
10285 // directory, or symlink.
10287 // does not exist
10288 // RETURNS: The #GFileType of the file and #G_FILE_TYPE_UNKNOWN if the file
10289 // <flags>: a set of #GFileQueryInfoFlags passed to g_file_query_info().
10290 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10291 FileType query_file_type(AT0)(FileQueryInfoFlags flags, AT0 /*Cancellable*/ cancellable=null) nothrow {
10292 return g_file_query_file_type(cast(File*)&this, flags, UpCast!(Cancellable*)(cancellable));
10295 // Similar to g_file_query_info(), but obtains information
10296 // about the filesystem the @file is on, rather than the file itself.
10297 // For instance the amount of space available and the type of
10298 // the filesystem.
10300 // The @attributes value is a string that specifies the file attributes that
10301 // should be gathered. It is not an error if it's not possible to read a particular
10302 // requested attribute from a file - it just won't be set. @attributes should
10303 // be a comma-separated list of attributes or attribute wildcards. The wildcard "*"
10304 // means all attributes, and a wildcard like "filesystem::*" means all attributes in the
10305 // filesystem namespace. The standard namespace for filesystem attributes is "filesystem".
10306 // Common attributes of interest are #G_FILE_ATTRIBUTE_FILESYSTEM_SIZE
10307 // (the total size of the filesystem in bytes), #G_FILE_ATTRIBUTE_FILESYSTEM_FREE (number of
10308 // bytes available), and #G_FILE_ATTRIBUTE_FILESYSTEM_TYPE (type of the filesystem).
10310 // If @cancellable is not %NULL, then the operation can be cancelled by
10311 // triggering the cancellable object from another thread. If the operation
10312 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10314 // If the file does not exist, the G_IO_ERROR_NOT_FOUND error will be returned.
10315 // Other errors are possible too, and depend on what kind of filesystem the file is on.
10317 // Free the returned object with g_object_unref().
10318 // RETURNS: a #GFileInfo or %NULL if there was an error.
10319 // <attributes>: an attribute query string.
10320 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10321 FileInfo* /*new*/ query_filesystem_info(AT0, AT1, AT2)(AT0 /*char*/ attributes, AT1 /*Cancellable*/ cancellable, AT2 /*GLib2.Error**/ error=null) nothrow {
10322 return g_file_query_filesystem_info(cast(File*)&this, toCString!(char*)(attributes), UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
10325 // Asynchronously gets the requested information about the filesystem
10326 // that the specified @file is on. The result is a #GFileInfo object
10327 // that contains key-value attributes (such as type or size for the
10328 // file).
10330 // For more details, see g_file_query_filesystem_info() which is the
10331 // synchronous version of this call.
10333 // When the operation is finished, @callback will be called. You can
10334 // then call g_file_query_info_finish() to get the result of the
10335 // operation.
10336 // <attributes>: an attribute query string.
10337 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
10338 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10339 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
10340 // <user_data>: the data to pass to callback function
10341 void query_filesystem_info_async(AT0, AT1, AT2)(AT0 /*char*/ attributes, int io_priority, AT1 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT2 /*void*/ user_data) nothrow {
10342 g_file_query_filesystem_info_async(cast(File*)&this, toCString!(char*)(attributes), io_priority, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
10345 // Finishes an asynchronous filesystem info query. See
10346 // g_file_query_filesystem_info_async().
10348 // Free the returned object with g_object_unref().
10349 // RETURNS: #GFileInfo for given @file or %NULL on error.
10350 // <res>: a #GAsyncResult.
10351 FileInfo* /*new*/ query_filesystem_info_finish(AT0, AT1)(AT0 /*AsyncResult*/ res, AT1 /*GLib2.Error**/ error=null) nothrow {
10352 return g_file_query_filesystem_info_finish(cast(File*)&this, UpCast!(AsyncResult*)(res), UpCast!(GLib2.Error**)(error));
10355 // Gets the requested information about specified @file. The result
10356 // is a #GFileInfo object that contains key-value attributes (such as
10357 // the type or size of the file).
10359 // The @attributes value is a string that specifies the file attributes that
10360 // should be gathered. It is not an error if it's not possible to read a particular
10361 // requested attribute from a file - it just won't be set. @attributes should
10362 // be a comma-separated list of attributes or attribute wildcards. The wildcard "*"
10363 // means all attributes, and a wildcard like "standard::*" means all attributes in the standard
10364 // namespace. An example attribute query be "standard::*,owner::user".
10365 // The standard attributes are available as defines, like #G_FILE_ATTRIBUTE_STANDARD_NAME.
10367 // If @cancellable is not %NULL, then the operation can be cancelled by
10368 // triggering the cancellable object from another thread. If the operation
10369 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10371 // For symlinks, normally the information about the target of the
10372 // symlink is returned, rather than information about the symlink itself.
10373 // However if you pass #G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS in @flags the
10374 // information about the symlink itself will be returned. Also, for symlinks
10375 // that point to non-existing files the information about the symlink itself
10376 // will be returned.
10378 // If the file does not exist, the G_IO_ERROR_NOT_FOUND error will be returned.
10379 // Other errors are possible too, and depend on what kind of filesystem the file is on.
10381 // Free the returned object with g_object_unref().
10382 // RETURNS: a #GFileInfo for the given @file, or %NULL on error.
10383 // <attributes>: an attribute query string.
10384 // <flags>: a set of #GFileQueryInfoFlags.
10385 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10386 FileInfo* /*new*/ query_info(AT0, AT1, AT2)(AT0 /*char*/ attributes, FileQueryInfoFlags flags, AT1 /*Cancellable*/ cancellable, AT2 /*GLib2.Error**/ error=null) nothrow {
10387 return g_file_query_info(cast(File*)&this, toCString!(char*)(attributes), flags, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
10390 // Asynchronously gets the requested information about specified @file. The result
10391 // is a #GFileInfo object that contains key-value attributes (such as type or size
10392 // for the file).
10394 // For more details, see g_file_query_info() which is
10395 // the synchronous version of this call.
10397 // When the operation is finished, @callback will be called. You can then call
10398 // g_file_query_info_finish() to get the result of the operation.
10399 // <attributes>: an attribute query string.
10400 // <flags>: a set of #GFileQueryInfoFlags.
10401 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
10402 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10403 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
10404 // <user_data>: the data to pass to callback function
10405 void query_info_async(AT0, AT1, AT2)(AT0 /*char*/ attributes, FileQueryInfoFlags flags, int io_priority, AT1 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT2 /*void*/ user_data) nothrow {
10406 g_file_query_info_async(cast(File*)&this, toCString!(char*)(attributes), flags, io_priority, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
10409 // Finishes an asynchronous file info query.
10410 // See g_file_query_info_async().
10412 // Free the returned object with g_object_unref().
10413 // RETURNS: #GFileInfo for given @file or %NULL on error.
10414 // <res>: a #GAsyncResult.
10415 FileInfo* /*new*/ query_info_finish(AT0, AT1)(AT0 /*AsyncResult*/ res, AT1 /*GLib2.Error**/ error=null) nothrow {
10416 return g_file_query_info_finish(cast(File*)&this, UpCast!(AsyncResult*)(res), UpCast!(GLib2.Error**)(error));
10419 // Obtain the list of settable attributes for the file.
10421 // Returns the type and full attribute name of all the attributes
10422 // that can be set on this file. This doesn't mean setting it will always
10423 // succeed though, you might get an access failure, or some specific
10424 // file may not support a specific attribute.
10426 // If @cancellable is not %NULL, then the operation can be cancelled by
10427 // triggering the cancellable object from another thread. If the operation
10428 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10430 // When you are done with it, release it with g_file_attribute_info_list_unref()
10431 // RETURNS: a #GFileAttributeInfoList describing the settable attributes.
10432 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10433 FileAttributeInfoList* /*new*/ query_settable_attributes(AT0, AT1)(AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
10434 return g_file_query_settable_attributes(cast(File*)&this, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
10437 // Obtain the list of attribute namespaces where new attributes
10438 // can be created by a user. An example of this is extended
10439 // attributes (in the "xattr" namespace).
10441 // If @cancellable is not %NULL, then the operation can be cancelled by
10442 // triggering the cancellable object from another thread. If the operation
10443 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10445 // When you are done with it, release it with g_file_attribute_info_list_unref()
10446 // RETURNS: a #GFileAttributeInfoList describing the writable namespaces.
10447 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10448 FileAttributeInfoList* /*new*/ query_writable_namespaces(AT0, AT1)(AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
10449 return g_file_query_writable_namespaces(cast(File*)&this, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
10452 // Opens a file for reading. The result is a #GFileInputStream that
10453 // can be used to read the contents of the file.
10455 // If @cancellable is not %NULL, then the operation can be cancelled by
10456 // triggering the cancellable object from another thread. If the operation
10457 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10459 // If the file does not exist, the G_IO_ERROR_NOT_FOUND error will be returned.
10460 // If the file is a directory, the G_IO_ERROR_IS_DIRECTORY error will be returned.
10461 // Other errors are possible too, and depend on what kind of filesystem the file is on.
10463 // Free the returned object with g_object_unref().
10464 // RETURNS: #GFileInputStream or %NULL on error.
10465 // <cancellable>: a #GCancellable
10466 FileInputStream* /*new*/ read(AT0, AT1)(AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
10467 return g_file_read(cast(File*)&this, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
10470 // Asynchronously opens @file for reading.
10472 // For more details, see g_file_read() which is
10473 // the synchronous version of this call.
10475 // When the operation is finished, @callback will be called. You can then call
10476 // g_file_read_finish() to get the result of the operation.
10477 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
10478 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10479 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
10480 // <user_data>: the data to pass to callback function
10481 void read_async(AT0, AT1)(int io_priority, AT0 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT1 /*void*/ user_data) nothrow {
10482 g_file_read_async(cast(File*)&this, io_priority, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
10485 // Finishes an asynchronous file read operation started with
10486 // g_file_read_async().
10488 // Free the returned object with g_object_unref().
10489 // RETURNS: a #GFileInputStream or %NULL on error.
10490 // <res>: a #GAsyncResult.
10491 FileInputStream* /*new*/ read_finish(AT0, AT1)(AT0 /*AsyncResult*/ res, AT1 /*GLib2.Error**/ error=null) nothrow {
10492 return g_file_read_finish(cast(File*)&this, UpCast!(AsyncResult*)(res), UpCast!(GLib2.Error**)(error));
10495 // Returns an output stream for overwriting the file, possibly
10496 // creating a backup copy of the file first. If the file doesn't exist,
10497 // it will be created.
10499 // This will try to replace the file in the safest way possible so
10500 // that any errors during the writing will not affect an already
10501 // existing copy of the file. For instance, for local files it
10502 // may write to a temporary file and then atomically rename over
10503 // the destination when the stream is closed.
10505 // By default files created are generally readable by everyone,
10506 // but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
10507 // will be made readable only to the current user, to the level that
10508 // is supported on the target filesystem.
10510 // If @cancellable is not %NULL, then the operation can be cancelled by
10511 // triggering the cancellable object from another thread. If the operation
10512 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10514 // If you pass in a non-#NULL @etag value, then this value is
10515 // compared to the current entity tag of the file, and if they differ
10516 // an G_IO_ERROR_WRONG_ETAG error is returned. This generally means
10517 // that the file has been changed since you last read it. You can get
10518 // the new etag from g_file_output_stream_get_etag() after you've
10519 // finished writing and closed the #GFileOutputStream. When you load
10520 // a new file you can use g_file_input_stream_query_info() to get
10521 // the etag of the file.
10523 // If @make_backup is %TRUE, this function will attempt to make a backup
10524 // of the current file before overwriting it. If this fails a G_IO_ERROR_CANT_CREATE_BACKUP
10525 // error will be returned. If you want to replace anyway, try again with
10526 // @make_backup set to %FALSE.
10528 // If the file is a directory the G_IO_ERROR_IS_DIRECTORY error will be returned,
10529 // and if the file is some other form of non-regular file then a
10530 // G_IO_ERROR_NOT_REGULAR_FILE error will be returned.
10531 // Some file systems don't allow all file names, and may
10532 // return an G_IO_ERROR_INVALID_FILENAME error, and if the name
10533 // is to long G_IO_ERROR_FILENAME_TOO_LONG will be returned.
10534 // Other errors are possible too, and depend on what kind of
10535 // filesystem the file is on.
10537 // Free the returned object with g_object_unref().
10538 // RETURNS: a #GFileOutputStream or %NULL on error.
10539 // <etag>: an optional <link linkend="gfile-etag">entity tag</link> for the current #GFile, or #NULL to ignore.
10540 // <make_backup>: %TRUE if a backup should be created.
10541 // <flags>: a set of #GFileCreateFlags.
10542 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10543 FileOutputStream* /*new*/ replace(AT0, AT1, AT2)(AT0 /*char*/ etag, int make_backup, FileCreateFlags flags, AT1 /*Cancellable*/ cancellable, AT2 /*GLib2.Error**/ error=null) nothrow {
10544 return g_file_replace(cast(File*)&this, toCString!(char*)(etag), make_backup, flags, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
10547 // Asynchronously overwrites the file, replacing the contents, possibly
10548 // creating a backup copy of the file first.
10550 // For more details, see g_file_replace() which is
10551 // the synchronous version of this call.
10553 // When the operation is finished, @callback will be called. You can then call
10554 // g_file_replace_finish() to get the result of the operation.
10555 // <etag>: an <link linkend="gfile-etag">entity tag</link> for the current #GFile, or NULL to ignore.
10556 // <make_backup>: %TRUE if a backup should be created.
10557 // <flags>: a set of #GFileCreateFlags.
10558 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
10559 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10560 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
10561 // <user_data>: the data to pass to callback function
10562 void replace_async(AT0, AT1, AT2)(AT0 /*char*/ etag, int make_backup, FileCreateFlags flags, int io_priority, AT1 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT2 /*void*/ user_data) nothrow {
10563 g_file_replace_async(cast(File*)&this, toCString!(char*)(etag), make_backup, flags, io_priority, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
10566 // Replaces the contents of @file with @contents of @length bytes.
10567 // If @etag is specified (not %NULL) any existing file must have that etag, or
10568 // the error %G_IO_ERROR_WRONG_ETAG will be returned.
10570 // If @make_backup is %TRUE, this function will attempt to make a backup of @file.
10572 // If @cancellable is not %NULL, then the operation can be cancelled by
10573 // triggering the cancellable object from another thread. If the operation
10574 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10576 // The returned @new_etag can be used to verify that the file hasn't changed the
10577 // next time it is saved over.
10579 // has occurred, this function will return %FALSE and set @error
10580 // appropriately if present.
10581 // RETURNS: %TRUE if successful. If an error
10582 // <contents>: a string containing the new contents for @file.
10583 // <length>: the length of @contents in bytes.
10584 // <etag>: the old <link linkend="gfile-etag">entity tag</link> for the document, or %NULL
10585 // <make_backup>: %TRUE if a backup should be created.
10586 // <flags>: a set of #GFileCreateFlags.
10587 // <new_etag>: a location to a new <link linkend="gfile-etag">entity tag</link> for the document. This should be freed with g_free() when no longer needed, or %NULL
10588 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10589 int replace_contents(AT0, AT1, AT2, AT3, AT4)(AT0 /*ubyte*/ contents, size_t length, AT1 /*char*/ etag, int make_backup, FileCreateFlags flags, /*out*/ AT2 /*char**/ new_etag, AT3 /*Cancellable*/ cancellable, AT4 /*GLib2.Error**/ error=null) nothrow {
10590 return g_file_replace_contents(cast(File*)&this, UpCast!(ubyte*)(contents), length, toCString!(char*)(etag), make_backup, flags, toCString!(char**)(new_etag), UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
10593 // Starts an asynchronous replacement of @file with the given
10594 // @contents of @length bytes. @etag will replace the document's
10595 // current entity tag.
10597 // When this operation has completed, @callback will be called with
10598 // @user_user data, and the operation can be finalized with
10599 // g_file_replace_contents_finish().
10601 // If @cancellable is not %NULL, then the operation can be cancelled by
10602 // triggering the cancellable object from another thread. If the operation
10603 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10605 // If @make_backup is %TRUE, this function will attempt to
10606 // make a backup of @file.
10607 // <contents>: string of contents to replace the file with.
10608 // <length>: the length of @contents in bytes.
10609 // <etag>: a new <link linkend="gfile-etag">entity tag</link> for the @file, or %NULL
10610 // <make_backup>: %TRUE if a backup should be created.
10611 // <flags>: a set of #GFileCreateFlags.
10612 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10613 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
10614 // <user_data>: the data to pass to callback function
10615 void replace_contents_async(AT0, AT1, AT2, AT3)(AT0 /*ubyte*/ contents, size_t length, AT1 /*char*/ etag, int make_backup, FileCreateFlags flags, AT2 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT3 /*void*/ user_data) nothrow {
10616 g_file_replace_contents_async(cast(File*)&this, UpCast!(ubyte*)(contents), length, toCString!(char*)(etag), make_backup, flags, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
10619 // Finishes an asynchronous replace of the given @file. See
10620 // g_file_replace_contents_async(). Sets @new_etag to the new entity
10621 // tag for the document, if present.
10622 // RETURNS: %TRUE on success, %FALSE on failure.
10623 // <res>: a #GAsyncResult.
10624 // <new_etag>: a location of a new <link linkend="gfile-etag">entity tag</link> for the document. This should be freed with g_free() when it is no longer needed, or %NULL
10625 int replace_contents_finish(AT0, AT1, AT2)(AT0 /*AsyncResult*/ res, /*out*/ AT1 /*char**/ new_etag, AT2 /*GLib2.Error**/ error=null) nothrow {
10626 return g_file_replace_contents_finish(cast(File*)&this, UpCast!(AsyncResult*)(res), toCString!(char**)(new_etag), UpCast!(GLib2.Error**)(error));
10629 // Finishes an asynchronous file replace operation started with
10630 // g_file_replace_async().
10632 // Free the returned object with g_object_unref().
10633 // RETURNS: a #GFileOutputStream, or %NULL on error.
10634 // <res>: a #GAsyncResult.
10635 FileOutputStream* /*new*/ replace_finish(AT0, AT1)(AT0 /*AsyncResult*/ res, AT1 /*GLib2.Error**/ error=null) nothrow {
10636 return g_file_replace_finish(cast(File*)&this, UpCast!(AsyncResult*)(res), UpCast!(GLib2.Error**)(error));
10639 // VERSION: 2.22
10640 // Returns an output stream for overwriting the file in readwrite mode,
10641 // possibly creating a backup copy of the file first. If the file doesn't
10642 // exist, it will be created.
10644 // For details about the behaviour, see g_file_replace() which does the same
10645 // thing but returns an output stream only.
10647 // Note that in many non-local file cases read and write streams are not
10648 // supported, so make sure you really need to do read and write streaming,
10649 // rather than just opening for reading or writing.
10651 // Free the returned object with g_object_unref().
10652 // RETURNS: a #GFileIOStream or %NULL on error.
10653 // <etag>: an optional <link linkend="gfile-etag">entity tag</link> for the current #GFile, or #NULL to ignore
10654 // <make_backup>: %TRUE if a backup should be created
10655 // <flags>: a set of #GFileCreateFlags
10656 // <cancellable>: optional #GCancellable object, %NULL to ignore
10657 FileIOStream* /*new*/ replace_readwrite(AT0, AT1, AT2)(AT0 /*char*/ etag, int make_backup, FileCreateFlags flags, AT1 /*Cancellable*/ cancellable, AT2 /*GLib2.Error**/ error=null) nothrow {
10658 return g_file_replace_readwrite(cast(File*)&this, toCString!(char*)(etag), make_backup, flags, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
10661 // VERSION: 2.22
10662 // Asynchronously overwrites the file in read-write mode, replacing the
10663 // contents, possibly creating a backup copy of the file first.
10665 // For more details, see g_file_replace_readwrite() which is
10666 // the synchronous version of this call.
10668 // When the operation is finished, @callback will be called. You can then
10669 // call g_file_replace_readwrite_finish() to get the result of the operation.
10670 // <etag>: an <link linkend="gfile-etag">entity tag</link> for the current #GFile, or NULL to ignore.
10671 // <make_backup>: %TRUE if a backup should be created.
10672 // <flags>: a set of #GFileCreateFlags.
10673 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
10674 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10675 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
10676 // <user_data>: the data to pass to callback function
10677 void replace_readwrite_async(AT0, AT1, AT2)(AT0 /*char*/ etag, int make_backup, FileCreateFlags flags, int io_priority, AT1 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT2 /*void*/ user_data) nothrow {
10678 g_file_replace_readwrite_async(cast(File*)&this, toCString!(char*)(etag), make_backup, flags, io_priority, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
10681 // VERSION: 2.22
10682 // Finishes an asynchronous file replace operation started with
10683 // g_file_replace_readwrite_async().
10685 // Free the returned object with g_object_unref().
10686 // RETURNS: a #GFileIOStream, or %NULL on error.
10687 // <res>: a #GAsyncResult.
10688 FileIOStream* /*new*/ replace_readwrite_finish(AT0, AT1)(AT0 /*AsyncResult*/ res, AT1 /*GLib2.Error**/ error=null) nothrow {
10689 return g_file_replace_readwrite_finish(cast(File*)&this, UpCast!(AsyncResult*)(res), UpCast!(GLib2.Error**)(error));
10692 // Resolves a relative path for @file to an absolute path.
10694 // This call does no blocking i/o.
10696 // is %NULL or if @file is invalid.
10697 // Free the returned object with g_object_unref().
10698 // RETURNS: #GFile to the resolved path. %NULL if @relative_path
10699 // <relative_path>: a given relative path string.
10700 File* /*new*/ resolve_relative_path(AT0)(AT0 /*char*/ relative_path) nothrow {
10701 return g_file_resolve_relative_path(cast(File*)&this, toCString!(char*)(relative_path));
10704 // Sets an attribute in the file with attribute name @attribute to @value.
10706 // Some attributes can be unset by setting @attribute to
10707 // %G_FILE_ATTRIBUTE_TYPE_INVALID and @value_p to %NULL.
10709 // If @cancellable is not %NULL, then the operation can be cancelled by
10710 // triggering the cancellable object from another thread. If the operation
10711 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10712 // RETURNS: %TRUE if the attribute was set, %FALSE otherwise.
10713 // <attribute>: a string containing the attribute's name.
10714 // <type>: The type of the attribute
10715 // <value_p>: a pointer to the value (or the pointer itself if the type is a pointer type)
10716 // <flags>: a set of #GFileQueryInfoFlags.
10717 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10718 int set_attribute(AT0, AT1, AT2, AT3)(AT0 /*char*/ attribute, FileAttributeType type, AT1 /*void*/ value_p, FileQueryInfoFlags flags, AT2 /*Cancellable*/ cancellable, AT3 /*GLib2.Error**/ error=null) nothrow {
10719 return g_file_set_attribute(cast(File*)&this, toCString!(char*)(attribute), type, UpCast!(void*)(value_p), flags, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
10722 // Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING to @value.
10723 // If @attribute is of a different type, this operation will fail,
10724 // returning %FALSE.
10726 // If @cancellable is not %NULL, then the operation can be cancelled by
10727 // triggering the cancellable object from another thread. If the operation
10728 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10730 // in the @file, %FALSE otherwise.
10731 // RETURNS: %TRUE if the @attribute was successfully set to @value
10732 // <attribute>: a string containing the attribute's name.
10733 // <value>: a string containing the attribute's new value.
10734 // <flags>: a #GFileQueryInfoFlags.
10735 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10736 int set_attribute_byte_string(AT0, AT1, AT2, AT3)(AT0 /*char*/ attribute, AT1 /*char*/ value, FileQueryInfoFlags flags, AT2 /*Cancellable*/ cancellable, AT3 /*GLib2.Error**/ error=null) nothrow {
10737 return g_file_set_attribute_byte_string(cast(File*)&this, toCString!(char*)(attribute), toCString!(char*)(value), flags, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
10740 // Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_INT32 to @value.
10741 // If @attribute is of a different type, this operation will fail.
10743 // If @cancellable is not %NULL, then the operation can be cancelled by
10744 // triggering the cancellable object from another thread. If the operation
10745 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10747 // in the @file, %FALSE otherwise.
10748 // RETURNS: %TRUE if the @attribute was successfully set to @value
10749 // <attribute>: a string containing the attribute's name.
10750 // <value>: a #gint32 containing the attribute's new value.
10751 // <flags>: a #GFileQueryInfoFlags.
10752 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10753 int set_attribute_int32(AT0, AT1, AT2)(AT0 /*char*/ attribute, int value, FileQueryInfoFlags flags, AT1 /*Cancellable*/ cancellable, AT2 /*GLib2.Error**/ error=null) nothrow {
10754 return g_file_set_attribute_int32(cast(File*)&this, toCString!(char*)(attribute), value, flags, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
10757 // Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_INT64 to @value.
10758 // If @attribute is of a different type, this operation will fail.
10760 // If @cancellable is not %NULL, then the operation can be cancelled by
10761 // triggering the cancellable object from another thread. If the operation
10762 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10763 // RETURNS: %TRUE if the @attribute was successfully set, %FALSE otherwise.
10764 // <attribute>: a string containing the attribute's name.
10765 // <value>: a #guint64 containing the attribute's new value.
10766 // <flags>: a #GFileQueryInfoFlags.
10767 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10768 int set_attribute_int64(AT0, AT1, AT2)(AT0 /*char*/ attribute, long value, FileQueryInfoFlags flags, AT1 /*Cancellable*/ cancellable, AT2 /*GLib2.Error**/ error=null) nothrow {
10769 return g_file_set_attribute_int64(cast(File*)&this, toCString!(char*)(attribute), value, flags, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
10772 // Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_STRING to @value.
10773 // If @attribute is of a different type, this operation will fail.
10775 // If @cancellable is not %NULL, then the operation can be cancelled by
10776 // triggering the cancellable object from another thread. If the operation
10777 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10778 // RETURNS: %TRUE if the @attribute was successfully set, %FALSE otherwise.
10779 // <attribute>: a string containing the attribute's name.
10780 // <value>: a string containing the attribute's value.
10781 // <flags>: #GFileQueryInfoFlags.
10782 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10783 int set_attribute_string(AT0, AT1, AT2, AT3)(AT0 /*char*/ attribute, AT1 /*char*/ value, FileQueryInfoFlags flags, AT2 /*Cancellable*/ cancellable, AT3 /*GLib2.Error**/ error=null) nothrow {
10784 return g_file_set_attribute_string(cast(File*)&this, toCString!(char*)(attribute), toCString!(char*)(value), flags, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
10787 // Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_UINT32 to @value.
10788 // If @attribute is of a different type, this operation will fail.
10790 // If @cancellable is not %NULL, then the operation can be cancelled by
10791 // triggering the cancellable object from another thread. If the operation
10792 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10794 // in the @file, %FALSE otherwise.
10795 // RETURNS: %TRUE if the @attribute was successfully set to @value
10796 // <attribute>: a string containing the attribute's name.
10797 // <value>: a #guint32 containing the attribute's new value.
10798 // <flags>: a #GFileQueryInfoFlags.
10799 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10800 int set_attribute_uint32(AT0, AT1, AT2)(AT0 /*char*/ attribute, uint value, FileQueryInfoFlags flags, AT1 /*Cancellable*/ cancellable, AT2 /*GLib2.Error**/ error=null) nothrow {
10801 return g_file_set_attribute_uint32(cast(File*)&this, toCString!(char*)(attribute), value, flags, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
10804 // Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_UINT64 to @value.
10805 // If @attribute is of a different type, this operation will fail.
10807 // If @cancellable is not %NULL, then the operation can be cancelled by
10808 // triggering the cancellable object from another thread. If the operation
10809 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10811 // in the @file, %FALSE otherwise.
10812 // RETURNS: %TRUE if the @attribute was successfully set to @value
10813 // <attribute>: a string containing the attribute's name.
10814 // <value>: a #guint64 containing the attribute's new value.
10815 // <flags>: a #GFileQueryInfoFlags.
10816 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10817 int set_attribute_uint64(AT0, AT1, AT2)(AT0 /*char*/ attribute, ulong value, FileQueryInfoFlags flags, AT1 /*Cancellable*/ cancellable, AT2 /*GLib2.Error**/ error=null) nothrow {
10818 return g_file_set_attribute_uint64(cast(File*)&this, toCString!(char*)(attribute), value, flags, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
10821 // Asynchronously sets the attributes of @file with @info.
10823 // For more details, see g_file_set_attributes_from_info() which is
10824 // the synchronous version of this call.
10826 // When the operation is finished, @callback will be called. You can then call
10827 // g_file_set_attributes_finish() to get the result of the operation.
10828 // <info>: a #GFileInfo.
10829 // <flags>: a #GFileQueryInfoFlags.
10830 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
10831 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10832 // <callback>: a #GAsyncReadyCallback.
10833 // <user_data>: a #gpointer.
10834 void set_attributes_async(AT0, AT1, AT2)(AT0 /*FileInfo*/ info, FileQueryInfoFlags flags, int io_priority, AT1 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT2 /*void*/ user_data) nothrow {
10835 g_file_set_attributes_async(cast(File*)&this, UpCast!(FileInfo*)(info), flags, io_priority, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
10838 // Finishes setting an attribute started in g_file_set_attributes_async().
10839 // RETURNS: %TRUE if the attributes were set correctly, %FALSE otherwise.
10840 // <result>: a #GAsyncResult.
10841 // <info>: a #GFileInfo.
10842 int set_attributes_finish(AT0, AT1, AT2)(AT0 /*AsyncResult*/ result, /*out*/ AT1 /*FileInfo**/ info, AT2 /*GLib2.Error**/ error=null) nothrow {
10843 return g_file_set_attributes_finish(cast(File*)&this, UpCast!(AsyncResult*)(result), UpCast!(FileInfo**)(info), UpCast!(GLib2.Error**)(error));
10846 // Tries to set all attributes in the #GFileInfo on the target values,
10847 // not stopping on the first error.
10849 // If there is any error during this operation then @error will be set to
10850 // the first error. Error on particular fields are flagged by setting
10851 // the "status" field in the attribute value to
10852 // %G_FILE_ATTRIBUTE_STATUS_ERROR_SETTING, which means you can also detect
10853 // further errors.
10855 // If @cancellable is not %NULL, then the operation can be cancelled by
10856 // triggering the cancellable object from another thread. If the operation
10857 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10858 // RETURNS: %TRUE if there was any error, %FALSE otherwise.
10859 // <info>: a #GFileInfo.
10860 // <flags>: #GFileQueryInfoFlags
10861 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10862 int set_attributes_from_info(AT0, AT1, AT2)(AT0 /*FileInfo*/ info, FileQueryInfoFlags flags, AT1 /*Cancellable*/ cancellable, AT2 /*GLib2.Error**/ error=null) nothrow {
10863 return g_file_set_attributes_from_info(cast(File*)&this, UpCast!(FileInfo*)(info), flags, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
10866 // Renames @file to the specified display name.
10868 // The display name is converted from UTF8 to the correct encoding for the target
10869 // filesystem if possible and the @file is renamed to this.
10871 // If you want to implement a rename operation in the user interface the edit name
10872 // (#G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME) should be used as the initial value in the rename
10873 // widget, and then the result after editing should be passed to g_file_set_display_name().
10875 // On success the resulting converted filename is returned.
10877 // If @cancellable is not %NULL, then the operation can be cancelled by
10878 // triggering the cancellable object from another thread. If the operation
10879 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10881 // if there was an error.
10882 // Free the returned object with g_object_unref().
10883 // RETURNS: a #GFile specifying what @file was renamed to, or %NULL
10884 // <display_name>: a string.
10885 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10886 File* /*new*/ set_display_name(AT0, AT1, AT2)(AT0 /*char*/ display_name, AT1 /*Cancellable*/ cancellable, AT2 /*GLib2.Error**/ error=null) nothrow {
10887 return g_file_set_display_name(cast(File*)&this, toCString!(char*)(display_name), UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
10890 // Asynchronously sets the display name for a given #GFile.
10892 // For more details, see g_file_set_display_name() which is
10893 // the synchronous version of this call.
10895 // When the operation is finished, @callback will be called. You can then call
10896 // g_file_set_display_name_finish() to get the result of the operation.
10897 // <display_name>: a string.
10898 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
10899 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10900 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
10901 // <user_data>: the data to pass to callback function
10902 void set_display_name_async(AT0, AT1, AT2)(AT0 /*char*/ display_name, int io_priority, AT1 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT2 /*void*/ user_data) nothrow {
10903 g_file_set_display_name_async(cast(File*)&this, toCString!(char*)(display_name), io_priority, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
10906 // Finishes setting a display name started with
10907 // g_file_set_display_name_async().
10909 // Free the returned object with g_object_unref().
10910 // RETURNS: a #GFile or %NULL on error.
10911 // <res>: a #GAsyncResult.
10912 File* /*new*/ set_display_name_finish(AT0, AT1)(AT0 /*AsyncResult*/ res, AT1 /*GLib2.Error**/ error=null) nothrow {
10913 return g_file_set_display_name_finish(cast(File*)&this, UpCast!(AsyncResult*)(res), UpCast!(GLib2.Error**)(error));
10916 // VERSION: 2.22
10917 // Starts a file of type G_FILE_TYPE_MOUNTABLE.
10918 // Using @start_operation, you can request callbacks when, for instance,
10919 // passwords are needed during authentication.
10921 // If @cancellable is not %NULL, then the operation can be cancelled by
10922 // triggering the cancellable object from another thread. If the operation
10923 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10925 // When the operation is finished, @callback will be called. You can then call
10926 // g_file_mount_mountable_finish() to get the result of the operation.
10927 // <flags>: flags affecting the operation
10928 // <start_operation>: a #GMountOperation, or %NULL to avoid user interaction.
10929 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10930 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
10931 // <user_data>: the data to pass to callback function
10932 void start_mountable(AT0, AT1, AT2)(DriveStartFlags flags, AT0 /*MountOperation*/ start_operation, AT1 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT2 /*void*/ user_data) nothrow {
10933 g_file_start_mountable(cast(File*)&this, flags, UpCast!(MountOperation*)(start_operation), UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
10936 // VERSION: 2.22
10937 // Finishes a start operation. See g_file_start_mountable() for details.
10939 // Finish an asynchronous start operation that was started
10940 // with g_file_start_mountable().
10942 // otherwise.
10943 // RETURNS: %TRUE if the operation finished successfully. %FALSE
10944 // <result>: a #GAsyncResult.
10945 int start_mountable_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
10946 return g_file_start_mountable_finish(cast(File*)&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
10949 // VERSION: 2.22
10950 // Stops a file of type G_FILE_TYPE_MOUNTABLE.
10952 // If @cancellable is not %NULL, then the operation can be cancelled by
10953 // triggering the cancellable object from another thread. If the operation
10954 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10956 // When the operation is finished, @callback will be called. You can then call
10957 // g_file_stop_mountable_finish() to get the result of the operation.
10958 // <flags>: flags affecting the operation
10959 // <mount_operation>: a #GMountOperation, or %NULL to avoid user interaction.
10960 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10961 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
10962 // <user_data>: the data to pass to callback function
10963 void stop_mountable(AT0, AT1, AT2)(MountUnmountFlags flags, AT0 /*MountOperation*/ mount_operation, AT1 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT2 /*void*/ user_data) nothrow {
10964 g_file_stop_mountable(cast(File*)&this, flags, UpCast!(MountOperation*)(mount_operation), UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
10967 // VERSION: 2.22
10968 // Finishes an stop operation, see g_file_stop_mountable() for details.
10970 // Finish an asynchronous stop operation that was started
10971 // with g_file_stop_mountable().
10973 // otherwise.
10974 // RETURNS: %TRUE if the operation finished successfully. %FALSE
10975 // <result>: a #GAsyncResult.
10976 int stop_mountable_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
10977 return g_file_stop_mountable_finish(cast(File*)&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
10980 // VERSION: 2.22
10981 // Checks if @file supports <link
10982 // linkend="g-main-context-push-thread-default-context">thread-default
10983 // contexts</link>. If this returns %FALSE, you cannot perform
10984 // asynchronous operations on @file in a thread that has a
10985 // thread-default context.
10986 // RETURNS: Whether or not @file supports thread-default contexts.
10987 int supports_thread_contexts()() nothrow {
10988 return g_file_supports_thread_contexts(cast(File*)&this);
10991 // Sends @file to the "Trashcan", if possible. This is similar to
10992 // deleting it, but the user can recover it before emptying the trashcan.
10993 // Not all file systems support trashing, so this call can return the
10994 // %G_IO_ERROR_NOT_SUPPORTED error.
10997 // If @cancellable is not %NULL, then the operation can be cancelled by
10998 // triggering the cancellable object from another thread. If the operation
10999 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
11000 // RETURNS: %TRUE on successful trash, %FALSE otherwise.
11001 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11002 int trash(AT0, AT1)(AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
11003 return g_file_trash(cast(File*)&this, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
11006 // DEPRECATED (v2.22) method: unmount_mountable - Use g_file_unmount_mountable_with_operation() instead.
11007 // Unmounts a file of type G_FILE_TYPE_MOUNTABLE.
11009 // If @cancellable is not %NULL, then the operation can be cancelled by
11010 // triggering the cancellable object from another thread. If the operation
11011 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
11013 // When the operation is finished, @callback will be called. You can then call
11014 // g_file_unmount_mountable_finish() to get the result of the operation.
11015 // <flags>: flags affecting the operation
11016 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11017 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
11018 // <user_data>: the data to pass to callback function
11019 void unmount_mountable(AT0, AT1)(MountUnmountFlags flags, AT0 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT1 /*void*/ user_data) nothrow {
11020 g_file_unmount_mountable(cast(File*)&this, flags, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
11023 // DEPRECATED (v2.22) method: unmount_mountable_finish - Use g_file_unmount_mountable_with_operation_finish() instead.
11024 // Finishes an unmount operation, see g_file_unmount_mountable() for details.
11026 // Finish an asynchronous unmount operation that was started
11027 // with g_file_unmount_mountable().
11029 // otherwise.
11030 // RETURNS: %TRUE if the operation finished successfully. %FALSE
11031 // <result>: a #GAsyncResult.
11032 int unmount_mountable_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
11033 return g_file_unmount_mountable_finish(cast(File*)&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
11036 // VERSION: 2.22
11037 // Unmounts a file of type G_FILE_TYPE_MOUNTABLE.
11039 // If @cancellable is not %NULL, then the operation can be cancelled by
11040 // triggering the cancellable object from another thread. If the operation
11041 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
11043 // When the operation is finished, @callback will be called. You can then call
11044 // g_file_unmount_mountable_finish() to get the result of the operation.
11045 // <flags>: flags affecting the operation
11046 // <mount_operation>: a #GMountOperation, or %NULL to avoid user interaction.
11047 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11048 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
11049 // <user_data>: the data to pass to callback function
11050 void unmount_mountable_with_operation(AT0, AT1, AT2)(MountUnmountFlags flags, AT0 /*MountOperation*/ mount_operation, AT1 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT2 /*void*/ user_data) nothrow {
11051 g_file_unmount_mountable_with_operation(cast(File*)&this, flags, UpCast!(MountOperation*)(mount_operation), UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
11054 // VERSION: 2.22
11055 // Finishes an unmount operation, see g_file_unmount_mountable_with_operation() for details.
11057 // Finish an asynchronous unmount operation that was started
11058 // with g_file_unmount_mountable_with_operation().
11060 // otherwise.
11061 // RETURNS: %TRUE if the operation finished successfully. %FALSE
11062 // <result>: a #GAsyncResult.
11063 int unmount_mountable_with_operation_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
11064 return g_file_unmount_mountable_with_operation_finish(cast(File*)&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
11067 mixin __interface__;
11070 // Information about a specific attribute.
11071 struct FileAttributeInfo {
11072 char* name;
11073 FileAttributeType type;
11074 FileAttributeInfoFlags flags;
11077 // Flags specifying the behaviour of an attribute.
11078 enum FileAttributeInfoFlags {
11079 NONE = 0,
11080 COPY_WITH_FILE = 1,
11081 COPY_WHEN_MOVED = 2
11084 // Acts as a lightweight registry for possible valid file attributes.
11085 // The registry stores Key-Value pair formats as #GFileAttributeInfo<!-- -->s.
11086 struct FileAttributeInfoList {
11087 FileAttributeInfo* infos;
11088 int n_infos;
11091 // Creates a new file attribute info list.
11092 // RETURNS: a #GFileAttributeInfoList.
11093 static FileAttributeInfoList* /*new*/ new_()() nothrow {
11094 return g_file_attribute_info_list_new();
11096 static auto opCall()() {
11097 return g_file_attribute_info_list_new();
11100 // Adds a new attribute with @name to the @list, setting
11101 // its @type and @flags.
11102 // <name>: the name of the attribute to add.
11103 // <type>: the #GFileAttributeType for the attribute.
11104 // <flags>: #GFileAttributeInfoFlags for the attribute.
11105 void add(AT0)(AT0 /*char*/ name, FileAttributeType type, FileAttributeInfoFlags flags) nothrow {
11106 g_file_attribute_info_list_add(&this, toCString!(char*)(name), type, flags);
11109 // Makes a duplicate of a file attribute info list.
11110 // RETURNS: a copy of the given @list.
11111 FileAttributeInfoList* /*new*/ dup()() nothrow {
11112 return g_file_attribute_info_list_dup(&this);
11115 // Gets the file attribute with the name @name from @list.
11117 // attribute isn't found.
11118 // RETURNS: a #GFileAttributeInfo for the @name, or %NULL if an
11119 // <name>: the name of the attribute to lookup.
11120 FileAttributeInfo* lookup(AT0)(AT0 /*char*/ name) nothrow {
11121 return g_file_attribute_info_list_lookup(&this, toCString!(char*)(name));
11124 // References a file attribute info list.
11125 // RETURNS: #GFileAttributeInfoList or %NULL on error.
11126 FileAttributeInfoList* /*new*/ ref_()() nothrow {
11127 return g_file_attribute_info_list_ref(&this);
11130 // Removes a reference from the given @list. If the reference count
11131 // falls to zero, the @list is deleted.
11132 void unref()() nothrow {
11133 g_file_attribute_info_list_unref(&this);
11137 // Determines if a string matches a file attribute.
11138 struct FileAttributeMatcher {
11140 // Creates a new file attribute matcher, which matches attributes
11141 // against a given string. #GFileAttributeMatcher<!-- -->s are reference
11142 // counted structures, and are created with a reference count of 1. If
11143 // the number of references falls to 0, the #GFileAttributeMatcher is
11144 // automatically destroyed.
11146 // The @attribute string should be formatted with specific keys separated
11147 // from namespaces with a double colon. Several "namespace::key" strings may be
11148 // concatenated with a single comma (e.g. "standard::type,standard::is-hidden").
11149 // The wildcard "*" may be used to match all keys and namespaces, or
11150 // "namespace::*" will match all keys in a given namespace.
11152 // Examples of strings to use:
11153 // <table>
11154 // <title>File Attribute Matcher strings and results</title>
11155 // <tgroup cols='2' align='left'><thead>
11156 // <row><entry> Matcher String </entry><entry> Matches </entry></row></thead>
11157 // <tbody>
11158 // <row><entry>"*"</entry><entry>matches all attributes.</entry></row>
11159 // <row><entry>"standard::is-hidden"</entry><entry>matches only the key is-hidden in the standard namespace.</entry></row>
11160 // <row><entry>"standard::type,unix::*"</entry><entry>matches the type key in the standard namespace and
11161 // all keys in the unix namespace.</entry></row>
11162 // </tbody></tgroup>
11163 // </table>
11164 // RETURNS: a #GFileAttributeMatcher.
11165 // <attributes>: an attribute string to match.
11166 static FileAttributeMatcher* /*new*/ new_(AT0)(AT0 /*char*/ attributes) nothrow {
11167 return g_file_attribute_matcher_new(toCString!(char*)(attributes));
11169 static auto opCall(AT0)(AT0 /*char*/ attributes) {
11170 return g_file_attribute_matcher_new(toCString!(char*)(attributes));
11173 // Checks if the matcher will match all of the keys in a given namespace.
11174 // This will always return %TRUE if a wildcard character is in use (e.g. if
11175 // matcher was created with "standard::*" and @ns is "standard", or if matcher was created
11176 // using "*" and namespace is anything.)
11178 // TODO: this is awkwardly worded.
11180 // in the given @ns, %FALSE otherwise.
11181 // RETURNS: %TRUE if the matcher matches all of the entries
11182 // <ns>: a string containing a file attribute namespace.
11183 int enumerate_namespace(AT0)(AT0 /*char*/ ns) nothrow {
11184 return g_file_attribute_matcher_enumerate_namespace(&this, toCString!(char*)(ns));
11187 // Gets the next matched attribute from a #GFileAttributeMatcher.
11189 // no more attribute exist.
11190 // RETURNS: a string containing the next attribute or %NULL if
11191 char* enumerate_next()() nothrow {
11192 return g_file_attribute_matcher_enumerate_next(&this);
11195 // Checks if an attribute will be matched by an attribute matcher. If
11196 // the matcher was created with the "*" matching string, this function
11197 // will always return %TRUE.
11198 // RETURNS: %TRUE if @attribute matches @matcher. %FALSE otherwise.
11199 // <attribute>: a file attribute key.
11200 int matches(AT0)(AT0 /*char*/ attribute) nothrow {
11201 return g_file_attribute_matcher_matches(&this, toCString!(char*)(attribute));
11204 // Checks if a attribute matcher only matches a given attribute. Always
11205 // returns %FALSE if "*" was used when creating the matcher.
11206 // RETURNS: %TRUE if the matcher only matches @attribute. %FALSE otherwise.
11207 // <attribute>: a file attribute key.
11208 int matches_only(AT0)(AT0 /*char*/ attribute) nothrow {
11209 return g_file_attribute_matcher_matches_only(&this, toCString!(char*)(attribute));
11212 // References a file attribute matcher.
11213 // RETURNS: a #GFileAttributeMatcher.
11214 FileAttributeMatcher* /*new*/ ref_()() nothrow {
11215 return g_file_attribute_matcher_ref(&this);
11218 // Subtracts all attributes of @subtract from @matcher and returns
11219 // a matcher that supports those attributes.
11221 // Note that currently it is not possible to remove a single
11222 // attribute when the @matcher matches the whole namespace - or remove
11223 // a namespace or attribute when the matcher matches everything. This
11224 // is a limitation of the current implementation, but may be fixed
11225 // in the future.
11227 // @matcher that are not matched by @subtract
11228 // RETURNS: A file attribute matcher matching all attributes of
11229 // <subtract>: The matcher to subtract
11230 FileAttributeMatcher* /*new*/ subtract(AT0)(AT0 /*FileAttributeMatcher*/ subtract) nothrow {
11231 return g_file_attribute_matcher_subtract(&this, UpCast!(FileAttributeMatcher*)(subtract));
11234 // VERSION: 2.32
11235 // Prints what the matcher is matching against. The format will be
11236 // equal to the format passed to g_file_attribute_matcher_new().
11237 // The output however, might not be identical, as the matcher may
11238 // decide to use a different order or omit needless parts.
11240 // against or %NULL if @matcher was %NULL.
11241 // RETURNS: a string describing the attributes the matcher matches
11242 char* /*new*/ to_string()() nothrow {
11243 return g_file_attribute_matcher_to_string(&this);
11246 // Unreferences @matcher. If the reference count falls below 1,
11247 // the @matcher is automatically freed.
11248 void unref()() nothrow {
11249 g_file_attribute_matcher_unref(&this);
11253 // Used by g_file_set_attributes_from_info() when setting file attributes.
11254 enum FileAttributeStatus {
11255 UNSET = 0,
11256 SET = 1,
11257 ERROR_SETTING = 2
11259 // The data types for file attributes.
11260 enum FileAttributeType {
11261 INVALID = 0,
11262 STRING = 1,
11263 BYTE_STRING = 2,
11264 BOOLEAN = 3,
11265 UINT32 = 4,
11266 INT32 = 5,
11267 UINT64 = 6,
11268 INT64 = 7,
11269 OBJECT = 8,
11270 STRINGV = 9
11272 // Flags used when copying or moving files.
11273 enum FileCopyFlags {
11274 NONE = 0,
11275 OVERWRITE = 1,
11276 BACKUP = 2,
11277 NOFOLLOW_SYMLINKS = 4,
11278 ALL_METADATA = 8,
11279 NO_FALLBACK_FOR_MOVE = 16,
11280 TARGET_DEFAULT_PERMS = 32
11282 // Flags used when an operation may create a file.
11283 enum FileCreateFlags {
11284 NONE = 0,
11285 PRIVATE = 1,
11286 REPLACE_DESTINATION = 2
11289 // #GFileDescriptorBased is implemented by streams (implementations of
11290 // #GInputStream or #GOutputStream) that are based on file descriptors.
11292 // Note that <filename>&lt;gio/gfiledescriptorbased.h&gt;</filename> belongs to
11293 // the UNIX-specific GIO interfaces, thus you have to use the
11294 // <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
11295 struct FileDescriptorBased /* Interface */ {
11296 mixin template __interface__() {
11297 // VERSION: 2.24
11298 // Gets the underlying file descriptor.
11299 // RETURNS: The file descriptor
11300 int get_fd()() nothrow {
11301 return g_file_descriptor_based_get_fd(cast(FileDescriptorBased*)&this);
11304 mixin __interface__;
11307 struct FileDescriptorBasedIface {
11308 GObject2.TypeInterface g_iface;
11309 // RETURNS: The file descriptor
11310 extern (C) int function (FileDescriptorBased* fd_based) nothrow get_fd;
11314 // #GFileEnumerator allows you to operate on a set of #GFile<!-- -->s,
11315 // returning a #GFileInfo structure for each file enumerated (e.g.
11316 // g_file_enumerate_children() will return a #GFileEnumerator for each
11317 // of the children within a directory).
11319 // To get the next file's information from a #GFileEnumerator, use
11320 // g_file_enumerator_next_file() or its asynchronous version,
11321 // g_file_enumerator_next_files_async(). Note that the asynchronous
11322 // version will return a list of #GFileInfo<!---->s, whereas the
11323 // synchronous will only return the next file in the enumerator.
11325 // To close a #GFileEnumerator, use g_file_enumerator_close(), or
11326 // its asynchronous version, g_file_enumerator_close_async(). Once
11327 // a #GFileEnumerator is closed, no further actions may be performed
11328 // on it, and it should be freed with g_object_unref().
11329 struct FileEnumerator /* : GObject.Object */ {
11330 alias parent_instance this;
11331 alias parent_instance super_;
11332 alias parent_instance object;
11333 GObject2.Object parent_instance;
11334 private FileEnumeratorPrivate* priv;
11337 // Releases all resources used by this enumerator, making the
11338 // enumerator return %G_IO_ERROR_CLOSED on all calls.
11340 // This will be automatically called when the last reference
11341 // is dropped, but you might want to call this function to make
11342 // sure resources are released as early as possible.
11343 // RETURNS: #TRUE on success or #FALSE on error.
11344 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11345 int close(AT0, AT1)(AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
11346 return g_file_enumerator_close(&this, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
11349 // Asynchronously closes the file enumerator.
11351 // If @cancellable is not %NULL, then the operation can be cancelled by
11352 // triggering the cancellable object from another thread. If the operation
11353 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned in
11354 // g_file_enumerator_close_finish().
11355 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
11356 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11357 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
11358 // <user_data>: the data to pass to callback function
11359 void close_async(AT0, AT1)(int io_priority, AT0 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT1 /*void*/ user_data) nothrow {
11360 g_file_enumerator_close_async(&this, io_priority, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
11363 // Finishes closing a file enumerator, started from g_file_enumerator_close_async().
11365 // If the file enumerator was already closed when g_file_enumerator_close_async()
11366 // was called, then this function will report %G_IO_ERROR_CLOSED in @error, and
11367 // return %FALSE. If the file enumerator had pending operation when the close
11368 // operation was started, then this function will report %G_IO_ERROR_PENDING, and
11369 // return %FALSE. If @cancellable was not %NULL, then the operation may have been
11370 // cancelled by triggering the cancellable object from another thread. If the operation
11371 // was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %FALSE will be
11372 // returned.
11373 // RETURNS: %TRUE if the close operation has finished successfully.
11374 // <result>: a #GAsyncResult.
11375 int close_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
11376 return g_file_enumerator_close_finish(&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
11379 // VERSION: 2.18
11380 // Get the #GFile container which is being enumerated.
11381 // RETURNS: the #GFile which is being enumerated.
11382 File* get_container()() nothrow {
11383 return g_file_enumerator_get_container(&this);
11386 // Checks if the file enumerator has pending operations.
11387 // RETURNS: %TRUE if the @enumerator has pending operations.
11388 int has_pending()() nothrow {
11389 return g_file_enumerator_has_pending(&this);
11392 // Checks if the file enumerator has been closed.
11393 // RETURNS: %TRUE if the @enumerator is closed.
11394 int is_closed()() nothrow {
11395 return g_file_enumerator_is_closed(&this);
11398 // Returns information for the next file in the enumerated object.
11399 // Will block until the information is available. The #GFileInfo
11400 // returned from this function will contain attributes that match the
11401 // attribute string that was passed when the #GFileEnumerator was created.
11403 // On error, returns %NULL and sets @error to the error. If the
11404 // enumerator is at the end, %NULL will be returned and @error will
11405 // be unset.
11407 // Free the returned object with g_object_unref() when no longer needed.
11408 // RETURNS: A #GFileInfo or %NULL on error or end of enumerator.
11409 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11410 FileInfo* /*new*/ next_file(AT0, AT1)(AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
11411 return g_file_enumerator_next_file(&this, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
11414 // Request information for a number of files from the enumerator asynchronously.
11415 // When all i/o for the operation is finished the @callback will be called with
11416 // the requested information.
11418 // The callback can be called with less than @num_files files in case of error
11419 // or at the end of the enumerator. In case of a partial error the callback will
11420 // be called with any succeeding items and no error, and on the next request the
11421 // error will be reported. If a request is cancelled the callback will be called
11422 // with %G_IO_ERROR_CANCELLED.
11424 // During an async request no other sync and async calls are allowed, and will
11425 // result in %G_IO_ERROR_PENDING errors.
11427 // Any outstanding i/o request with higher priority (lower numerical value) will
11428 // be executed before an outstanding request with lower priority. Default
11429 // priority is %G_PRIORITY_DEFAULT.
11430 // <num_files>: the number of file info objects to request
11431 // <io_priority>: the <link linkend="gioscheduler">io priority</link> of the request.
11432 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11433 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
11434 // <user_data>: the data to pass to callback function
11435 void next_files_async(AT0, AT1)(int num_files, int io_priority, AT0 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT1 /*void*/ user_data) nothrow {
11436 g_file_enumerator_next_files_async(&this, num_files, io_priority, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
11439 // Finishes the asynchronous operation started with g_file_enumerator_next_files_async().
11441 // g_list_free() and unref the infos with g_object_unref() when you're
11442 // done with them.
11443 // RETURNS: a #GList of #GFileInfo<!---->s. You must free the list with
11444 // <result>: a #GAsyncResult.
11445 GLib2.List* /*new*/ next_files_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
11446 return g_file_enumerator_next_files_finish(&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
11449 // Sets the file enumerator as having pending operations.
11450 // <pending>: a boolean value.
11451 void set_pending()(int pending) nothrow {
11452 g_file_enumerator_set_pending(&this, pending);
11456 struct FileEnumeratorClass {
11457 GObject2.ObjectClass parent_class;
11459 // RETURNS: A #GFileInfo or %NULL on error or end of enumerator.
11460 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11461 extern (C) FileInfo* /*new*/ function (FileEnumerator* enumerator, Cancellable* cancellable, GLib2.Error** error=null) nothrow next_file;
11462 extern (C) int function (FileEnumerator* enumerator, Cancellable* cancellable, GLib2.Error** error=null) nothrow close_fn;
11464 // <num_files>: the number of file info objects to request
11465 // <io_priority>: the <link linkend="gioscheduler">io priority</link> of the request.
11466 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11467 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
11468 // <user_data>: the data to pass to callback function
11469 extern (C) void function (FileEnumerator* enumerator, int num_files, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow next_files_async;
11471 // RETURNS: a #GList of #GFileInfo<!---->s. You must free the list with
11472 // <result>: a #GAsyncResult.
11473 extern (C) GLib2.List* /*new*/ function (FileEnumerator* enumerator, AsyncResult* result, GLib2.Error** error=null) nothrow next_files_finish;
11475 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
11476 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11477 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
11478 // <user_data>: the data to pass to callback function
11479 extern (C) void function (FileEnumerator* enumerator, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow close_async;
11481 // RETURNS: %TRUE if the close operation has finished successfully.
11482 // <result>: a #GAsyncResult.
11483 extern (C) int function (FileEnumerator* enumerator, AsyncResult* result, GLib2.Error** error=null) nothrow close_finish;
11484 extern (C) void function () nothrow _g_reserved1;
11485 extern (C) void function () nothrow _g_reserved2;
11486 extern (C) void function () nothrow _g_reserved3;
11487 extern (C) void function () nothrow _g_reserved4;
11488 extern (C) void function () nothrow _g_reserved5;
11489 extern (C) void function () nothrow _g_reserved6;
11490 extern (C) void function () nothrow _g_reserved7;
11493 struct FileEnumeratorPrivate {
11497 // GFileIOStream provides io streams that both read and write to the same
11498 // file handle.
11500 // GFileIOStream implements #GSeekable, which allows the io
11501 // stream to jump to arbitrary positions in the file and to truncate
11502 // the file, provided the filesystem of the file supports these
11503 // operations.
11505 // To find the position of a file io stream, use
11506 // g_seekable_tell().
11508 // To find out if a file io stream supports seeking, use g_seekable_can_seek().
11509 // To position a file io stream, use g_seekable_seek().
11510 // To find out if a file io stream supports truncating, use
11511 // g_seekable_can_truncate(). To truncate a file io
11512 // stream, use g_seekable_truncate().
11514 // The default implementation of all the #GFileIOStream operations
11515 // and the implementation of #GSeekable just call into the same operations
11516 // on the output stream.
11517 struct FileIOStream /* : IOStream */ {
11518 mixin Seekable.__interface__;
11519 alias parent_instance this;
11520 alias parent_instance super_;
11521 alias parent_instance iostream;
11522 IOStream parent_instance;
11523 private FileIOStreamPrivate* priv;
11526 // VERSION: 2.22
11527 // Gets the entity tag for the file when it has been written.
11528 // This must be called after the stream has been written
11529 // and closed, as the etag can change while writing.
11530 // RETURNS: the entity tag for the stream.
11531 char* /*new*/ get_etag()() nothrow {
11532 return g_file_io_stream_get_etag(&this);
11535 // VERSION: 2.22
11536 // Queries a file io stream for the given @attributes.
11537 // This function blocks while querying the stream. For the asynchronous
11538 // version of this function, see g_file_io_stream_query_info_async().
11539 // While the stream is blocked, the stream will set the pending flag
11540 // internally, and any other operations on the stream will fail with
11541 // %G_IO_ERROR_PENDING.
11543 // Can fail if the stream was already closed (with @error being set to
11544 // %G_IO_ERROR_CLOSED), the stream has pending operations (with @error being
11545 // set to %G_IO_ERROR_PENDING), or if querying info is not supported for
11546 // the stream's interface (with @error being set to %G_IO_ERROR_NOT_SUPPORTED). I
11547 // all cases of failure, %NULL will be returned.
11549 // If @cancellable is not %NULL, then the operation can be cancelled by
11550 // triggering the cancellable object from another thread. If the operation
11551 // was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %NULL will
11552 // be returned.
11553 // RETURNS: a #GFileInfo for the @stream, or %NULL on error.
11554 // <attributes>: a file attribute query string.
11555 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11556 FileInfo* /*new*/ query_info(AT0, AT1, AT2)(AT0 /*char*/ attributes, AT1 /*Cancellable*/ cancellable, AT2 /*GLib2.Error**/ error=null) nothrow {
11557 return g_file_io_stream_query_info(&this, toCString!(char*)(attributes), UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
11560 // VERSION: 2.22
11561 // Asynchronously queries the @stream for a #GFileInfo. When completed,
11562 // @callback will be called with a #GAsyncResult which can be used to
11563 // finish the operation with g_file_io_stream_query_info_finish().
11565 // For the synchronous version of this function, see
11566 // g_file_io_stream_query_info().
11567 // <attributes>: a file attribute query string.
11568 // <io_priority>: the <link linkend="gio-GIOScheduler">I/O priority</link> of the request.
11569 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11570 // <callback>: callback to call when the request is satisfied
11571 // <user_data>: the data to pass to callback function
11572 void query_info_async(AT0, AT1, AT2)(AT0 /*char*/ attributes, int io_priority, AT1 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT2 /*void*/ user_data) nothrow {
11573 g_file_io_stream_query_info_async(&this, toCString!(char*)(attributes), io_priority, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
11576 // VERSION: 2.22
11577 // Finalizes the asynchronous query started
11578 // by g_file_io_stream_query_info_async().
11579 // RETURNS: A #GFileInfo for the finished query.
11580 // <result>: a #GAsyncResult.
11581 FileInfo* /*new*/ query_info_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
11582 return g_file_io_stream_query_info_finish(&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
11586 struct FileIOStreamClass {
11587 IOStreamClass parent_class;
11588 extern (C) long function (FileIOStream* stream) nothrow tell;
11589 extern (C) int function (FileIOStream* stream) nothrow can_seek;
11590 extern (C) int function (FileIOStream* stream, long offset, GLib2.SeekType type, Cancellable* cancellable, GLib2.Error** error=null) nothrow seek;
11591 extern (C) int function (FileIOStream* stream) nothrow can_truncate;
11592 extern (C) int function (FileIOStream* stream, long size, Cancellable* cancellable, GLib2.Error** error=null) nothrow truncate_fn;
11594 // RETURNS: a #GFileInfo for the @stream, or %NULL on error.
11595 // <attributes>: a file attribute query string.
11596 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11597 extern (C) FileInfo* /*new*/ function (FileIOStream* stream, char* attributes, Cancellable* cancellable, GLib2.Error** error=null) nothrow query_info;
11599 // <attributes>: a file attribute query string.
11600 // <io_priority>: the <link linkend="gio-GIOScheduler">I/O priority</link> of the request.
11601 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11602 // <callback>: callback to call when the request is satisfied
11603 // <user_data>: the data to pass to callback function
11604 extern (C) void function (FileIOStream* stream, char* attributes, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow query_info_async;
11606 // RETURNS: A #GFileInfo for the finished query.
11607 // <result>: a #GAsyncResult.
11608 extern (C) FileInfo* /*new*/ function (FileIOStream* stream, AsyncResult* result, GLib2.Error** error=null) nothrow query_info_finish;
11609 // RETURNS: the entity tag for the stream.
11610 extern (C) char* /*new*/ function (FileIOStream* stream) nothrow get_etag;
11611 extern (C) void function () nothrow _g_reserved1;
11612 extern (C) void function () nothrow _g_reserved2;
11613 extern (C) void function () nothrow _g_reserved3;
11614 extern (C) void function () nothrow _g_reserved4;
11615 extern (C) void function () nothrow _g_reserved5;
11618 struct FileIOStreamPrivate {
11622 // #GFileIcon specifies an icon by pointing to an image file
11623 // to be used as icon.
11624 struct FileIcon /* : GObject.Object */ {
11625 mixin Icon.__interface__;
11626 mixin LoadableIcon.__interface__;
11627 alias method_parent this;
11628 alias method_parent super_;
11629 alias method_parent object;
11630 GObject2.Object method_parent;
11633 // Creates a new icon for a file.
11635 // @file, or %NULL on error.
11636 // RETURNS: a #GIcon for the given
11637 // <file>: a #GFile.
11638 static FileIcon* /*new*/ new_(AT0)(AT0 /*File*/ file) nothrow {
11639 return g_file_icon_new(UpCast!(File*)(file));
11641 static auto opCall(AT0)(AT0 /*File*/ file) {
11642 return g_file_icon_new(UpCast!(File*)(file));
11645 // Gets the #GFile associated with the given @icon.
11646 // RETURNS: a #GFile, or %NULL.
11647 File* get_file()() nothrow {
11648 return g_file_icon_get_file(&this);
11652 struct FileIconClass {
11655 // An interface for writing VFS file handles.
11656 struct FileIface {
11657 GObject2.TypeInterface g_iface;
11658 // RETURNS: a new #GFile that is a duplicate of the given #GFile.
11659 extern (C) File* /*new*/ function (File* file) nothrow dup;
11660 // RETURNS: 0 if @file is not a valid #GFile, otherwise an
11661 extern (C) uint function (File* file) nothrow hash;
11663 // RETURNS: %TRUE if @file1 and @file2 are equal.
11664 // <file2>: the second #GFile.
11665 extern (C) int function (File* file1, File* file2) nothrow equal;
11666 // RETURNS: %TRUE if file is native.
11667 extern (C) int function (File* file) nothrow is_native;
11669 // RETURNS: %TRUE if #GFile's backend supports the
11670 // <uri_scheme>: a string containing a URI scheme.
11671 extern (C) int function (File* file, char* uri_scheme) nothrow has_uri_scheme;
11672 // RETURNS: a string containing the URI scheme for the given
11673 extern (C) char* /*new*/ function (File* file) nothrow get_uri_scheme;
11674 // RETURNS: string containing the #GFile's base name, or %NULL
11675 extern (C) char* /*new*/ function (File* file) nothrow get_basename;
11676 // RETURNS: string containing the #GFile's path, or %NULL if
11677 extern (C) char* /*new*/ function (File* file) nothrow get_path;
11678 // RETURNS: a string containing the #GFile's URI.
11679 extern (C) char* /*new*/ function (File* file) nothrow get_uri;
11680 // RETURNS: a string containing the #GFile's parse name. The returned
11681 extern (C) char* /*new*/ function (File* file) nothrow get_parse_name;
11682 // RETURNS: a #GFile structure to the parent of the given
11683 extern (C) File* /*new*/ function (File* file) nothrow get_parent;
11685 // RETURNS: %TRUE if the @files's parent, grandparent, etc is @prefix.
11686 // <file>: input #GFile.
11687 extern (C) int function (File* prefix, File* file) nothrow prefix_matches;
11689 // RETURNS: string with the relative path from @descendant
11690 // <descendant>: input #GFile.
11691 extern (C) char* /*new*/ function (File* parent, File* descendant) nothrow get_relative_path;
11693 // RETURNS: #GFile to the resolved path. %NULL if @relative_path
11694 // <relative_path>: a given relative path string.
11695 extern (C) File* /*new*/ function (File* file, char* relative_path) nothrow resolve_relative_path;
11697 // RETURNS: a #GFile to the specified child, or
11698 // <display_name>: string to a possible child.
11699 extern (C) File* /*new*/ function (File* file, char* display_name, GLib2.Error** error=null) nothrow get_child_for_display_name;
11701 // RETURNS: A #GFileEnumerator if successful, %NULL on error.
11702 // <attributes>: an attribute query string.
11703 // <flags>: a set of #GFileQueryInfoFlags.
11704 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11705 extern (C) FileEnumerator* /*new*/ function (File* file, char* attributes, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error=null) nothrow enumerate_children;
11707 // <attributes>: an attribute query string.
11708 // <flags>: a set of #GFileQueryInfoFlags.
11709 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
11710 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11711 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
11712 // <user_data>: the data to pass to callback function
11713 extern (C) void function (File* file, char* attributes, FileQueryInfoFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow enumerate_children_async;
11715 // RETURNS: a #GFileEnumerator or %NULL if an error occurred.
11716 // <res>: a #GAsyncResult.
11717 extern (C) FileEnumerator* /*new*/ function (File* file, AsyncResult* res, GLib2.Error** error=null) nothrow enumerate_children_finish;
11719 // RETURNS: a #GFileInfo for the given @file, or %NULL on error.
11720 // <attributes>: an attribute query string.
11721 // <flags>: a set of #GFileQueryInfoFlags.
11722 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11723 extern (C) FileInfo* /*new*/ function (File* file, char* attributes, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error=null) nothrow query_info;
11725 // <attributes>: an attribute query string.
11726 // <flags>: a set of #GFileQueryInfoFlags.
11727 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
11728 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11729 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
11730 // <user_data>: the data to pass to callback function
11731 extern (C) void function (File* file, char* attributes, FileQueryInfoFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow query_info_async;
11733 // RETURNS: #GFileInfo for given @file or %NULL on error.
11734 // <res>: a #GAsyncResult.
11735 extern (C) FileInfo* /*new*/ function (File* file, AsyncResult* res, GLib2.Error** error=null) nothrow query_info_finish;
11737 // RETURNS: a #GFileInfo or %NULL if there was an error.
11738 // <attributes>: an attribute query string.
11739 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11740 extern (C) FileInfo* /*new*/ function (File* file, char* attributes, Cancellable* cancellable, GLib2.Error** error=null) nothrow query_filesystem_info;
11742 // <attributes>: an attribute query string.
11743 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
11744 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11745 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
11746 // <user_data>: the data to pass to callback function
11747 extern (C) void function (File* file, char* attributes, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow query_filesystem_info_async;
11749 // RETURNS: #GFileInfo for given @file or %NULL on error.
11750 // <res>: a #GAsyncResult.
11751 extern (C) FileInfo* /*new*/ function (File* file, AsyncResult* res, GLib2.Error** error=null) nothrow query_filesystem_info_finish;
11753 // RETURNS: a #GMount where the @file is located or %NULL on error.
11754 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11755 extern (C) Mount* /*new*/ function (File* file, Cancellable* cancellable, GLib2.Error** error=null) nothrow find_enclosing_mount;
11757 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
11758 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11759 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
11760 // <user_data>: the data to pass to callback function
11761 extern (C) void function (File* file, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow find_enclosing_mount_async;
11763 // RETURNS: #GMount for given @file or %NULL on error.
11764 // <res>: a #GAsyncResult
11765 extern (C) Mount* /*new*/ function (File* file, AsyncResult* res, GLib2.Error** error=null) nothrow find_enclosing_mount_finish;
11767 // RETURNS: a #GFile specifying what @file was renamed to, or %NULL
11768 // <display_name>: a string.
11769 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11770 extern (C) File* /*new*/ function (File* file, char* display_name, Cancellable* cancellable, GLib2.Error** error=null) nothrow set_display_name;
11772 // <display_name>: a string.
11773 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
11774 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11775 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
11776 // <user_data>: the data to pass to callback function
11777 extern (C) void function (File* file, char* display_name, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow set_display_name_async;
11779 // RETURNS: a #GFile or %NULL on error.
11780 // <res>: a #GAsyncResult.
11781 extern (C) File* /*new*/ function (File* file, AsyncResult* res, GLib2.Error** error=null) nothrow set_display_name_finish;
11783 // RETURNS: a #GFileAttributeInfoList describing the settable attributes.
11784 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11785 extern (C) FileAttributeInfoList* /*new*/ function (File* file, Cancellable* cancellable, GLib2.Error** error=null) nothrow query_settable_attributes;
11786 extern (C) void function () nothrow _query_settable_attributes_async;
11787 extern (C) void function () nothrow _query_settable_attributes_finish;
11789 // RETURNS: a #GFileAttributeInfoList describing the writable namespaces.
11790 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11791 extern (C) FileAttributeInfoList* /*new*/ function (File* file, Cancellable* cancellable, GLib2.Error** error=null) nothrow query_writable_namespaces;
11792 extern (C) void function () nothrow _query_writable_namespaces_async;
11793 extern (C) void function () nothrow _query_writable_namespaces_finish;
11795 // RETURNS: %TRUE if the attribute was set, %FALSE otherwise.
11796 // <attribute>: a string containing the attribute's name.
11797 // <type>: The type of the attribute
11798 // <value_p>: a pointer to the value (or the pointer itself if the type is a pointer type)
11799 // <flags>: a set of #GFileQueryInfoFlags.
11800 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11801 extern (C) int function (File* file, char* attribute, FileAttributeType type, void* value_p, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error=null) nothrow set_attribute;
11803 // RETURNS: %TRUE if there was any error, %FALSE otherwise.
11804 // <info>: a #GFileInfo.
11805 // <flags>: #GFileQueryInfoFlags
11806 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11807 extern (C) int function (File* file, FileInfo* info, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error=null) nothrow set_attributes_from_info;
11809 // <info>: a #GFileInfo.
11810 // <flags>: a #GFileQueryInfoFlags.
11811 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
11812 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11813 // <callback>: a #GAsyncReadyCallback.
11814 // <user_data>: a #gpointer.
11815 extern (C) void function (File* file, FileInfo* info, FileQueryInfoFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow set_attributes_async;
11817 // RETURNS: %TRUE if the attributes were set correctly, %FALSE otherwise.
11818 // <result>: a #GAsyncResult.
11819 // <info>: a #GFileInfo.
11820 extern (C) int function (File* file, AsyncResult* result, /*out*/ FileInfo** info, GLib2.Error** error=null) nothrow set_attributes_finish;
11822 // RETURNS: #GFileInputStream or %NULL on error.
11823 // <cancellable>: a #GCancellable
11824 extern (C) FileInputStream* /*new*/ function (File* file, Cancellable* cancellable, GLib2.Error** error=null) nothrow read_fn;
11826 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
11827 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11828 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
11829 // <user_data>: the data to pass to callback function
11830 extern (C) void function (File* file, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow read_async;
11832 // RETURNS: a #GFileInputStream or %NULL on error.
11833 // <res>: a #GAsyncResult.
11834 extern (C) FileInputStream* /*new*/ function (File* file, AsyncResult* res, GLib2.Error** error=null) nothrow read_finish;
11836 // RETURNS: a #GFileOutputStream, or %NULL on error.
11837 // <flags>: a set of #GFileCreateFlags.
11838 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11839 extern (C) FileOutputStream* /*new*/ function (File* file, FileCreateFlags flags, Cancellable* cancellable, GLib2.Error** error=null) nothrow append_to;
11841 // <flags>: a set of #GFileCreateFlags.
11842 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
11843 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11844 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
11845 // <user_data>: the data to pass to callback function
11846 extern (C) void function (File* file, FileCreateFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow append_to_async;
11848 // RETURNS: a valid #GFileOutputStream or %NULL on error.
11849 // <res>: #GAsyncResult
11850 extern (C) FileOutputStream* /*new*/ function (File* file, AsyncResult* res, GLib2.Error** error=null) nothrow append_to_finish;
11852 // RETURNS: a #GFileOutputStream for the newly created file, or
11853 // <flags>: a set of #GFileCreateFlags.
11854 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11855 extern (C) FileOutputStream* /*new*/ function (File* file, FileCreateFlags flags, Cancellable* cancellable, GLib2.Error** error=null) nothrow create;
11857 // <flags>: a set of #GFileCreateFlags.
11858 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
11859 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11860 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
11861 // <user_data>: the data to pass to callback function
11862 extern (C) void function (File* file, FileCreateFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow create_async;
11864 // RETURNS: a #GFileOutputStream or %NULL on error.
11865 // <res>: a #GAsyncResult.
11866 extern (C) FileOutputStream* /*new*/ function (File* file, AsyncResult* res, GLib2.Error** error=null) nothrow create_finish;
11868 // RETURNS: a #GFileOutputStream or %NULL on error.
11869 // <etag>: an optional <link linkend="gfile-etag">entity tag</link> for the current #GFile, or #NULL to ignore.
11870 // <make_backup>: %TRUE if a backup should be created.
11871 // <flags>: a set of #GFileCreateFlags.
11872 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11873 extern (C) FileOutputStream* /*new*/ function (File* file, char* etag, int make_backup, FileCreateFlags flags, Cancellable* cancellable, GLib2.Error** error=null) nothrow replace;
11875 // <etag>: an <link linkend="gfile-etag">entity tag</link> for the current #GFile, or NULL to ignore.
11876 // <make_backup>: %TRUE if a backup should be created.
11877 // <flags>: a set of #GFileCreateFlags.
11878 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
11879 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11880 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
11881 // <user_data>: the data to pass to callback function
11882 extern (C) void function (File* file, char* etag, int make_backup, FileCreateFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow replace_async;
11884 // RETURNS: a #GFileOutputStream, or %NULL on error.
11885 // <res>: a #GAsyncResult.
11886 extern (C) FileOutputStream* /*new*/ function (File* file, AsyncResult* res, GLib2.Error** error=null) nothrow replace_finish;
11888 // RETURNS: %TRUE if the file was deleted. %FALSE otherwise.
11889 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11890 extern (C) int function (File* file, Cancellable* cancellable, GLib2.Error** error=null) nothrow delete_file;
11891 extern (C) void function () nothrow _delete_file_async;
11892 extern (C) void function () nothrow _delete_file_finish;
11894 // RETURNS: %TRUE on successful trash, %FALSE otherwise.
11895 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11896 extern (C) int function (File* file, Cancellable* cancellable, GLib2.Error** error=null) nothrow trash;
11897 extern (C) void function () nothrow _trash_async;
11898 extern (C) void function () nothrow _trash_finish;
11900 // RETURNS: %TRUE on successful creation, %FALSE otherwise.
11901 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11902 extern (C) int function (File* file, Cancellable* cancellable, GLib2.Error** error=null) nothrow make_directory;
11903 extern (C) void function () nothrow _make_directory_async;
11904 extern (C) void function () nothrow _make_directory_finish;
11906 // RETURNS: %TRUE on the creation of a new symlink, %FALSE otherwise.
11907 // <symlink_value>: a string with the path for the target of the new symlink
11908 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11909 extern (C) int function (File* file, char* symlink_value, Cancellable* cancellable, GLib2.Error** error=null) nothrow make_symbolic_link;
11910 extern (C) void function () nothrow _make_symbolic_link_async;
11911 extern (C) void function () nothrow _make_symbolic_link_finish;
11913 // RETURNS: %TRUE on success, %FALSE otherwise.
11914 // <destination>: destination #GFile
11915 // <flags>: set of #GFileCopyFlags
11916 // <cancellable>: optional #GCancellable object, %NULL to ignore
11917 // <progress_callback>: function to callback with progress information, or %NULL if progress information is not needed
11918 // <progress_callback_data>: user data to pass to @progress_callback
11919 extern (C) int function (File* source, File* destination, FileCopyFlags flags, Cancellable* cancellable, FileProgressCallback progress_callback, void* progress_callback_data, GLib2.Error** error=null) nothrow copy;
11921 // Unintrospectable functionp: copy_async() / ()
11923 // <destination>: destination #GFile
11924 // <flags>: set of #GFileCopyFlags
11925 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request
11926 // <cancellable>: optional #GCancellable object, %NULL to ignore
11927 // <progress_callback>: function to callback with progress information, or %NULL if progress information is not needed
11928 // <progress_callback_data>: user data to pass to @progress_callback
11929 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
11930 // <user_data>: the data to pass to callback function
11931 extern (C) void function (File* source, File* destination, FileCopyFlags flags, int io_priority, Cancellable* cancellable, FileProgressCallback progress_callback, void* progress_callback_data, AsyncReadyCallback callback, void* user_data) nothrow copy_async;
11933 // RETURNS: a %TRUE on success, %FALSE on error.
11934 // <res>: a #GAsyncResult.
11935 extern (C) int function (File* file, AsyncResult* res, GLib2.Error** error=null) nothrow copy_finish;
11937 // RETURNS: %TRUE on successful move, %FALSE otherwise.
11938 // <destination>: #GFile pointing to the destination location.
11939 // <flags>: set of #GFileCopyFlags.
11940 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11941 // <progress_callback>: #GFileProgressCallback function for updates.
11942 // <progress_callback_data>: gpointer to user data for the callback function.
11943 extern (C) int function (File* source, File* destination, FileCopyFlags flags, Cancellable* cancellable, FileProgressCallback progress_callback, void* progress_callback_data, GLib2.Error** error=null) nothrow move;
11944 extern (C) void function () nothrow _move_async;
11945 extern (C) void function () nothrow _move_finish;
11947 // <flags>: flags affecting the operation
11948 // <mount_operation>: a #GMountOperation, or %NULL to avoid user interaction.
11949 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11950 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
11951 // <user_data>: the data to pass to callback function
11952 extern (C) void function (File* file, MountMountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow mount_mountable;
11954 // RETURNS: a #GFile or %NULL on error.
11955 // <result>: a #GAsyncResult.
11956 extern (C) File* /*new*/ function (File* file, AsyncResult* result, GLib2.Error** error=null) nothrow mount_mountable_finish;
11958 // <flags>: flags affecting the operation
11959 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11960 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
11961 // <user_data>: the data to pass to callback function
11962 extern (C) void function (File* file, MountUnmountFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow unmount_mountable;
11964 // RETURNS: %TRUE if the operation finished successfully. %FALSE
11965 // <result>: a #GAsyncResult.
11966 extern (C) int function (File* file, AsyncResult* result, GLib2.Error** error=null) nothrow unmount_mountable_finish;
11968 // <flags>: flags affecting the operation
11969 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11970 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
11971 // <user_data>: the data to pass to callback function
11972 extern (C) void function (File* file, MountUnmountFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow eject_mountable;
11974 // RETURNS: %TRUE if the @file was ejected successfully. %FALSE
11975 // <result>: a #GAsyncResult.
11976 extern (C) int function (File* file, AsyncResult* result, GLib2.Error** error=null) nothrow eject_mountable_finish;
11978 // <flags>: flags affecting the operation
11979 // <mount_operation>: a #GMountOperation or %NULL to avoid user interaction.
11980 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11981 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
11982 // <user_data>: the data to pass to callback function
11983 extern (C) void function (File* location, MountMountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow mount_enclosing_volume;
11985 // RETURNS: %TRUE if successful. If an error
11986 // <result>: a #GAsyncResult.
11987 extern (C) int function (File* location, AsyncResult* result, GLib2.Error** error=null) nothrow mount_enclosing_volume_finish;
11989 // RETURNS: a #GFileMonitor for the given @file, or %NULL on error.
11990 // <flags>: a set of #GFileMonitorFlags.
11991 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11992 extern (C) FileMonitor* /*new*/ function (File* file, FileMonitorFlags flags, Cancellable* cancellable, GLib2.Error** error=null) nothrow monitor_dir;
11994 // RETURNS: a #GFileMonitor for the given @file, or %NULL on error.
11995 // <flags>: a set of #GFileMonitorFlags.
11996 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11997 extern (C) FileMonitor* /*new*/ function (File* file, FileMonitorFlags flags, Cancellable* cancellable, GLib2.Error** error=null) nothrow monitor_file;
11999 // RETURNS: #GFileIOStream or %NULL on error.
12000 // <cancellable>: a #GCancellable
12001 extern (C) FileIOStream* /*new*/ function (File* file, Cancellable* cancellable, GLib2.Error** error=null) nothrow open_readwrite;
12003 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
12004 // <cancellable>: optional #GCancellable object, %NULL to ignore.
12005 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
12006 // <user_data>: the data to pass to callback function
12007 extern (C) void function (File* file, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow open_readwrite_async;
12009 // RETURNS: a #GFileIOStream or %NULL on error.
12010 // <res>: a #GAsyncResult.
12011 extern (C) FileIOStream* /*new*/ function (File* file, AsyncResult* res, GLib2.Error** error=null) nothrow open_readwrite_finish;
12013 // RETURNS: a #GFileIOStream for the newly created file, or %NULL on error.
12014 // <flags>: a set of #GFileCreateFlags
12015 // <cancellable>: optional #GCancellable object, %NULL to ignore
12016 extern (C) FileIOStream* /*new*/ function (File* file, FileCreateFlags flags, Cancellable* cancellable, GLib2.Error** error=null) nothrow create_readwrite;
12018 // <flags>: a set of #GFileCreateFlags
12019 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request
12020 // <cancellable>: optional #GCancellable object, %NULL to ignore
12021 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
12022 // <user_data>: the data to pass to callback function
12023 extern (C) void function (File* file, FileCreateFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow create_readwrite_async;
12025 // RETURNS: a #GFileIOStream or %NULL on error.
12026 // <res>: a #GAsyncResult
12027 extern (C) FileIOStream* /*new*/ function (File* file, AsyncResult* res, GLib2.Error** error=null) nothrow create_readwrite_finish;
12029 // RETURNS: a #GFileIOStream or %NULL on error.
12030 // <etag>: an optional <link linkend="gfile-etag">entity tag</link> for the current #GFile, or #NULL to ignore
12031 // <make_backup>: %TRUE if a backup should be created
12032 // <flags>: a set of #GFileCreateFlags
12033 // <cancellable>: optional #GCancellable object, %NULL to ignore
12034 extern (C) FileIOStream* /*new*/ function (File* file, char* etag, int make_backup, FileCreateFlags flags, Cancellable* cancellable, GLib2.Error** error=null) nothrow replace_readwrite;
12036 // <etag>: an <link linkend="gfile-etag">entity tag</link> for the current #GFile, or NULL to ignore.
12037 // <make_backup>: %TRUE if a backup should be created.
12038 // <flags>: a set of #GFileCreateFlags.
12039 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
12040 // <cancellable>: optional #GCancellable object, %NULL to ignore.
12041 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
12042 // <user_data>: the data to pass to callback function
12043 extern (C) void function (File* file, char* etag, int make_backup, FileCreateFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow replace_readwrite_async;
12045 // RETURNS: a #GFileIOStream, or %NULL on error.
12046 // <res>: a #GAsyncResult.
12047 extern (C) FileIOStream* /*new*/ function (File* file, AsyncResult* res, GLib2.Error** error=null) nothrow replace_readwrite_finish;
12049 // <flags>: flags affecting the operation
12050 // <start_operation>: a #GMountOperation, or %NULL to avoid user interaction.
12051 // <cancellable>: optional #GCancellable object, %NULL to ignore.
12052 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
12053 // <user_data>: the data to pass to callback function
12054 extern (C) void function (File* file, DriveStartFlags flags, MountOperation* start_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow start_mountable;
12056 // RETURNS: %TRUE if the operation finished successfully. %FALSE
12057 // <result>: a #GAsyncResult.
12058 extern (C) int function (File* file, AsyncResult* result, GLib2.Error** error=null) nothrow start_mountable_finish;
12060 // <flags>: flags affecting the operation
12061 // <mount_operation>: a #GMountOperation, or %NULL to avoid user interaction.
12062 // <cancellable>: optional #GCancellable object, %NULL to ignore.
12063 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
12064 // <user_data>: the data to pass to callback function
12065 extern (C) void function (File* file, MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow stop_mountable;
12067 // RETURNS: %TRUE if the operation finished successfully. %FALSE
12068 // <result>: a #GAsyncResult.
12069 extern (C) int function (File* file, AsyncResult* result, GLib2.Error** error=null) nothrow stop_mountable_finish;
12070 int supports_thread_contexts;
12072 // <flags>: flags affecting the operation
12073 // <mount_operation>: a #GMountOperation, or %NULL to avoid user interaction.
12074 // <cancellable>: optional #GCancellable object, %NULL to ignore.
12075 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
12076 // <user_data>: the data to pass to callback function
12077 extern (C) void function (File* file, MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow unmount_mountable_with_operation;
12079 // RETURNS: %TRUE if the operation finished successfully. %FALSE
12080 // <result>: a #GAsyncResult.
12081 extern (C) int function (File* file, AsyncResult* result, GLib2.Error** error=null) nothrow unmount_mountable_with_operation_finish;
12083 // <flags>: flags affecting the operation
12084 // <mount_operation>: a #GMountOperation, or %NULL to avoid user interaction.
12085 // <cancellable>: optional #GCancellable object, %NULL to ignore.
12086 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
12087 // <user_data>: the data to pass to callback function
12088 extern (C) void function (File* file, MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow eject_mountable_with_operation;
12090 // RETURNS: %TRUE if the @file was ejected successfully. %FALSE
12091 // <result>: a #GAsyncResult.
12092 extern (C) int function (File* file, AsyncResult* result, GLib2.Error** error=null) nothrow eject_mountable_with_operation_finish;
12094 // <cancellable>: optional #GCancellable object, %NULL to ignore.
12095 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
12096 // <user_data>: the data to pass to callback function
12097 extern (C) void function (File* file, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow poll_mountable;
12099 // RETURNS: %TRUE if the operation finished successfully. %FALSE
12100 // <result>: a #GAsyncResult.
12101 extern (C) int function (File* file, AsyncResult* result, GLib2.Error** error=null) nothrow poll_mountable_finish;
12105 // Functionality for manipulating basic metadata for files. #GFileInfo
12106 // implements methods for getting information that all files should
12107 // contain, and allows for manipulation of extended attributes.
12109 // See <link linkend="gio-GFileAttribute">GFileAttribute</link> for more
12110 // information on how GIO handles file attributes.
12112 // To obtain a #GFileInfo for a #GFile, use g_file_query_info() (or its
12113 // async variant). To obtain a #GFileInfo for a file input or output
12114 // stream, use g_file_input_stream_query_info() or
12115 // g_file_output_stream_query_info() (or their async variants).
12117 // To change the actual attributes of a file, you should then set the
12118 // attribute in the #GFileInfo and call g_file_set_attributes_from_info()
12119 // or g_file_set_attributes_async() on a GFile.
12121 // However, not all attributes can be changed in the file. For instance,
12122 // the actual size of a file cannot be changed via g_file_info_set_size().
12123 // You may call g_file_query_settable_attributes() and
12124 // g_file_query_writable_namespaces() to discover the settable attributes
12125 // of a particular file at runtime.
12127 // #GFileAttributeMatcher allows for searching through a #GFileInfo for
12128 // attributes.
12129 struct FileInfo /* : GObject.Object */ {
12130 alias method_parent this;
12131 alias method_parent super_;
12132 alias method_parent object;
12133 GObject2.Object method_parent;
12136 // Creates a new file info structure.
12137 // RETURNS: a #GFileInfo.
12138 static FileInfo* /*new*/ new_()() nothrow {
12139 return g_file_info_new();
12141 static auto opCall()() {
12142 return g_file_info_new();
12144 // Clears the status information from @info.
12145 void clear_status()() nothrow {
12146 g_file_info_clear_status(&this);
12149 // Copies all of the <link linkend="gio-GFileAttribute">GFileAttribute</link>s
12150 // from @src_info to @dest_info.
12151 // <dest_info>: destination to copy attributes to.
12152 void copy_into(AT0)(AT0 /*FileInfo*/ dest_info) nothrow {
12153 g_file_info_copy_into(&this, UpCast!(FileInfo*)(dest_info));
12156 // Duplicates a file info structure.
12157 // RETURNS: a duplicate #GFileInfo of @other.
12158 FileInfo* /*new*/ dup()() nothrow {
12159 return g_file_info_dup(&this);
12162 // Gets the value of a attribute, formated as a string.
12163 // This escapes things as needed to make the string valid
12164 // utf8.
12166 // When you're done with the string it must be freed with g_free().
12167 // RETURNS: a UTF-8 string associated with the given @attribute.
12168 // <attribute>: a file attribute key.
12169 char* /*new*/ get_attribute_as_string(AT0)(AT0 /*char*/ attribute) nothrow {
12170 return g_file_info_get_attribute_as_string(&this, toCString!(char*)(attribute));
12173 // Gets the value of a boolean attribute. If the attribute does not
12174 // contain a boolean value, %FALSE will be returned.
12175 // RETURNS: the boolean value contained within the attribute.
12176 // <attribute>: a file attribute key.
12177 int get_attribute_boolean(AT0)(AT0 /*char*/ attribute) nothrow {
12178 return g_file_info_get_attribute_boolean(&this, toCString!(char*)(attribute));
12181 // Gets the value of a byte string attribute. If the attribute does
12182 // not contain a byte string, %NULL will be returned.
12184 // %NULL otherwise.
12185 // RETURNS: the contents of the @attribute value as a byte string, or
12186 // <attribute>: a file attribute key.
12187 char* get_attribute_byte_string(AT0)(AT0 /*char*/ attribute) nothrow {
12188 return g_file_info_get_attribute_byte_string(&this, toCString!(char*)(attribute));
12191 // Gets the attribute type, value and status for an attribute key.
12193 // %FALSE otherwise.
12194 // RETURNS: %TRUE if @info has an attribute named @attribute,
12195 // <attribute>: a file attribute key
12196 // <type>: return location for the attribute type, or %NULL
12197 // <value_pp>: return location for the attribute value, or %NULL
12198 // <status>: return location for the attribute status, or %NULL
12199 int get_attribute_data(AT0, AT1, AT2, AT3)(AT0 /*char*/ attribute, /*out*/ AT1 /*FileAttributeType*/ type=null, /*out*/ AT2 /*void**/ value_pp=null, /*out*/ AT3 /*FileAttributeStatus*/ status=null) nothrow {
12200 return g_file_info_get_attribute_data(&this, toCString!(char*)(attribute), UpCast!(FileAttributeType*)(type), UpCast!(void**)(value_pp), UpCast!(FileAttributeStatus*)(status));
12203 // Gets a signed 32-bit integer contained within the attribute. If the
12204 // attribute does not contain a signed 32-bit integer, or is invalid,
12205 // 0 will be returned.
12206 // RETURNS: a signed 32-bit integer from the attribute.
12207 // <attribute>: a file attribute key.
12208 int get_attribute_int32(AT0)(AT0 /*char*/ attribute) nothrow {
12209 return g_file_info_get_attribute_int32(&this, toCString!(char*)(attribute));
12212 // Gets a signed 64-bit integer contained within the attribute. If the
12213 // attribute does not contain an signed 64-bit integer, or is invalid,
12214 // 0 will be returned.
12215 // RETURNS: a signed 64-bit integer from the attribute.
12216 // <attribute>: a file attribute key.
12217 long get_attribute_int64(AT0)(AT0 /*char*/ attribute) nothrow {
12218 return g_file_info_get_attribute_int64(&this, toCString!(char*)(attribute));
12221 // Gets the value of a #GObject attribute. If the attribute does
12222 // not contain a #GObject, %NULL will be returned.
12224 // %NULL otherwise.
12225 // RETURNS: a #GObject associated with the given @attribute, or
12226 // <attribute>: a file attribute key.
12227 GObject2.Object* get_attribute_object(AT0)(AT0 /*char*/ attribute) nothrow {
12228 return g_file_info_get_attribute_object(&this, toCString!(char*)(attribute));
12231 // Gets the attribute status for an attribute key.
12233 // %G_FILE_ATTRIBUTE_STATUS_UNSET if the key is invalid.
12234 // RETURNS: a #GFileAttributeStatus for the given @attribute, or
12235 // <attribute>: a file attribute key
12236 FileAttributeStatus get_attribute_status(AT0)(AT0 /*char*/ attribute) nothrow {
12237 return g_file_info_get_attribute_status(&this, toCString!(char*)(attribute));
12240 // Gets the value of a string attribute. If the attribute does
12241 // not contain a string, %NULL will be returned.
12243 // %NULL otherwise.
12244 // RETURNS: the contents of the @attribute value as a UTF-8 string, or
12245 // <attribute>: a file attribute key.
12246 char* get_attribute_string(AT0)(AT0 /*char*/ attribute) nothrow {
12247 return g_file_info_get_attribute_string(&this, toCString!(char*)(attribute));
12250 // VERSION: 2.22
12251 // Gets the value of a stringv attribute. If the attribute does
12252 // not contain a stringv, %NULL will be returned.
12254 // %NULL otherwise. Do not free. These returned strings are UTF-8.
12255 // RETURNS: the contents of the @attribute value as a stringv, or
12256 // <attribute>: a file attribute key.
12257 char** get_attribute_stringv(AT0)(AT0 /*char*/ attribute) nothrow {
12258 return g_file_info_get_attribute_stringv(&this, toCString!(char*)(attribute));
12261 // Gets the attribute type for an attribute key.
12263 // %G_FILE_ATTRIBUTE_TYPE_INVALID if the key is not set.
12264 // RETURNS: a #GFileAttributeType for the given @attribute, or
12265 // <attribute>: a file attribute key.
12266 FileAttributeType get_attribute_type(AT0)(AT0 /*char*/ attribute) nothrow {
12267 return g_file_info_get_attribute_type(&this, toCString!(char*)(attribute));
12270 // Gets an unsigned 32-bit integer contained within the attribute. If the
12271 // attribute does not contain an unsigned 32-bit integer, or is invalid,
12272 // 0 will be returned.
12273 // RETURNS: an unsigned 32-bit integer from the attribute.
12274 // <attribute>: a file attribute key.
12275 uint get_attribute_uint32(AT0)(AT0 /*char*/ attribute) nothrow {
12276 return g_file_info_get_attribute_uint32(&this, toCString!(char*)(attribute));
12279 // Gets a unsigned 64-bit integer contained within the attribute. If the
12280 // attribute does not contain an unsigned 64-bit integer, or is invalid,
12281 // 0 will be returned.
12282 // RETURNS: a unsigned 64-bit integer from the attribute.
12283 // <attribute>: a file attribute key.
12284 ulong get_attribute_uint64(AT0)(AT0 /*char*/ attribute) nothrow {
12285 return g_file_info_get_attribute_uint64(&this, toCString!(char*)(attribute));
12288 // Gets the file's content type.
12289 // RETURNS: a string containing the file's content type.
12290 char* get_content_type()() nothrow {
12291 return g_file_info_get_content_type(&this);
12294 // Gets a display name for a file.
12295 // RETURNS: a string containing the display name.
12296 char* get_display_name()() nothrow {
12297 return g_file_info_get_display_name(&this);
12300 // Gets the edit name for a file.
12301 // RETURNS: a string containing the edit name.
12302 char* get_edit_name()() nothrow {
12303 return g_file_info_get_edit_name(&this);
12306 // Gets the <link linkend="gfile-etag">entity tag</link> for a given
12307 // #GFileInfo. See %G_FILE_ATTRIBUTE_ETAG_VALUE.
12308 // RETURNS: a string containing the value of the "etag:value" attribute.
12309 char* get_etag()() nothrow {
12310 return g_file_info_get_etag(&this);
12313 // Gets a file's type (whether it is a regular file, symlink, etc).
12314 // This is different from the file's content type, see g_file_info_get_content_type().
12315 // RETURNS: a #GFileType for the given file.
12316 FileType get_file_type()() nothrow {
12317 return g_file_info_get_file_type(&this);
12320 // Gets the icon for a file.
12321 // RETURNS: #GIcon for the given @info.
12322 Icon* get_icon()() nothrow {
12323 return g_file_info_get_icon(&this);
12326 // Checks if a file is a backup file.
12327 // RETURNS: %TRUE if file is a backup file, %FALSE otherwise.
12328 int get_is_backup()() nothrow {
12329 return g_file_info_get_is_backup(&this);
12332 // Checks if a file is hidden.
12333 // RETURNS: %TRUE if the file is a hidden file, %FALSE otherwise.
12334 int get_is_hidden()() nothrow {
12335 return g_file_info_get_is_hidden(&this);
12338 // Checks if a file is a symlink.
12339 // RETURNS: %TRUE if the given @info is a symlink.
12340 int get_is_symlink()() nothrow {
12341 return g_file_info_get_is_symlink(&this);
12344 // Gets the modification time of the current @info and sets it
12345 // in @result.
12346 // <result>: a #GTimeVal.
12347 void get_modification_time(AT0)(/*out*/ AT0 /*GLib2.TimeVal*/ result) nothrow {
12348 g_file_info_get_modification_time(&this, UpCast!(GLib2.TimeVal*)(result));
12351 // Gets the name for a file.
12352 // RETURNS: a string containing the file name.
12353 char* get_name()() nothrow {
12354 return g_file_info_get_name(&this);
12357 // Gets the file's size.
12358 // RETURNS: a #goffset containing the file's size.
12359 long get_size()() nothrow {
12360 return g_file_info_get_size(&this);
12363 // Gets the value of the sort_order attribute from the #GFileInfo.
12364 // See %G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER.
12365 // RETURNS: a #gint32 containing the value of the "standard::sort_order" attribute.
12366 int get_sort_order()() nothrow {
12367 return g_file_info_get_sort_order(&this);
12370 // Gets the symlink target for a given #GFileInfo.
12371 // RETURNS: a string containing the symlink target.
12372 char* get_symlink_target()() nothrow {
12373 return g_file_info_get_symlink_target(&this);
12376 // Checks if a file info structure has an attribute named @attribute.
12378 // %FALSE otherwise.
12379 // RETURNS: %TRUE if @Ginfo has an attribute named @attribute,
12380 // <attribute>: a file attribute key.
12381 int has_attribute(AT0)(AT0 /*char*/ attribute) nothrow {
12382 return g_file_info_has_attribute(&this, toCString!(char*)(attribute));
12385 // VERSION: 2.22
12386 // Checks if a file info structure has an attribute in the
12387 // specified @name_space.
12389 // %FALSE otherwise.
12390 // RETURNS: %TRUE if @Ginfo has an attribute in @name_space,
12391 // <name_space>: a file attribute namespace.
12392 int has_namespace(AT0)(AT0 /*char*/ name_space) nothrow {
12393 return g_file_info_has_namespace(&this, toCString!(char*)(name_space));
12396 // Lists the file info structure's attributes.
12398 // possible attribute types for the given @name_space, or
12399 // %NULL on error.
12400 // RETURNS: a null-terminated array of strings of all of the
12401 // <name_space>: a file attribute key's namespace.
12402 char** /*new*/ list_attributes(AT0)(AT0 /*char*/ name_space) nothrow {
12403 return g_file_info_list_attributes(&this, toCString!(char*)(name_space));
12406 // Removes all cases of @attribute from @info if it exists.
12407 // <attribute>: a file attribute key.
12408 void remove_attribute(AT0)(AT0 /*char*/ attribute) nothrow {
12409 g_file_info_remove_attribute(&this, toCString!(char*)(attribute));
12412 // Sets the @attribute to contain the given value, if possible. To unset the
12413 // attribute, use %G_ATTRIBUTE_TYPE_INVALID for @type.
12414 // <attribute>: a file attribute key.
12415 // <type>: a #GFileAttributeType
12416 // <value_p>: pointer to the value
12417 void set_attribute(AT0, AT1)(AT0 /*char*/ attribute, FileAttributeType type, AT1 /*void*/ value_p) nothrow {
12418 g_file_info_set_attribute(&this, toCString!(char*)(attribute), type, UpCast!(void*)(value_p));
12421 // Sets the @attribute to contain the given @attr_value,
12422 // if possible.
12423 // <attribute>: a file attribute key.
12424 // <attr_value>: a boolean value.
12425 void set_attribute_boolean(AT0)(AT0 /*char*/ attribute, int attr_value) nothrow {
12426 g_file_info_set_attribute_boolean(&this, toCString!(char*)(attribute), attr_value);
12429 // Sets the @attribute to contain the given @attr_value,
12430 // if possible.
12431 // <attribute>: a file attribute key.
12432 // <attr_value>: a byte string.
12433 void set_attribute_byte_string(AT0, AT1)(AT0 /*char*/ attribute, AT1 /*char*/ attr_value) nothrow {
12434 g_file_info_set_attribute_byte_string(&this, toCString!(char*)(attribute), toCString!(char*)(attr_value));
12437 // Sets the @attribute to contain the given @attr_value,
12438 // if possible.
12439 // <attribute>: a file attribute key.
12440 // <attr_value>: a signed 32-bit integer
12441 void set_attribute_int32(AT0)(AT0 /*char*/ attribute, int attr_value) nothrow {
12442 g_file_info_set_attribute_int32(&this, toCString!(char*)(attribute), attr_value);
12445 // Sets the @attribute to contain the given @attr_value,
12446 // if possible.
12447 // <attribute>: attribute name to set.
12448 // <attr_value>: int64 value to set attribute to.
12449 void set_attribute_int64(AT0)(AT0 /*char*/ attribute, long attr_value) nothrow {
12450 g_file_info_set_attribute_int64(&this, toCString!(char*)(attribute), attr_value);
12453 // Sets @mask on @info to match specific attribute types.
12454 // <mask>: a #GFileAttributeMatcher.
12455 void set_attribute_mask(AT0)(AT0 /*FileAttributeMatcher*/ mask) nothrow {
12456 g_file_info_set_attribute_mask(&this, UpCast!(FileAttributeMatcher*)(mask));
12459 // Sets the @attribute to contain the given @attr_value,
12460 // if possible.
12461 // <attribute>: a file attribute key.
12462 // <attr_value>: a #GObject.
12463 void set_attribute_object(AT0, AT1)(AT0 /*char*/ attribute, AT1 /*GObject2.Object*/ attr_value) nothrow {
12464 g_file_info_set_attribute_object(&this, toCString!(char*)(attribute), UpCast!(GObject2.Object*)(attr_value));
12467 // VERSION: 2.22
12468 // Sets the attribute status for an attribute key. This is only
12469 // needed by external code that implement g_file_set_attributes_from_info()
12470 // or similar functions.
12472 // The attribute must exist in @info for this to work. Otherwise %FALSE
12473 // is returned and @info is unchanged.
12474 // RETURNS: %TRUE if the status was changed, %FALSE if the key was not set.
12475 // <attribute>: a file attribute key
12476 // <status>: a #GFileAttributeStatus
12477 int set_attribute_status(AT0)(AT0 /*char*/ attribute, FileAttributeStatus status) nothrow {
12478 return g_file_info_set_attribute_status(&this, toCString!(char*)(attribute), status);
12481 // Sets the @attribute to contain the given @attr_value,
12482 // if possible.
12483 // <attribute>: a file attribute key.
12484 // <attr_value>: a UTF-8 string.
12485 void set_attribute_string(AT0, AT1)(AT0 /*char*/ attribute, AT1 /*char*/ attr_value) nothrow {
12486 g_file_info_set_attribute_string(&this, toCString!(char*)(attribute), toCString!(char*)(attr_value));
12489 // Sets the @attribute to contain the given @attr_value,
12490 // if possible.
12492 // Sinze: 2.22
12493 // <attribute>: a file attribute key
12494 // <attr_value>: a %NULL terminated array of UTF-8 strings.
12495 void set_attribute_stringv(AT0, AT1)(AT0 /*char*/ attribute, AT1 /*char**/ attr_value) nothrow {
12496 g_file_info_set_attribute_stringv(&this, toCString!(char*)(attribute), toCString!(char**)(attr_value));
12499 // Sets the @attribute to contain the given @attr_value,
12500 // if possible.
12501 // <attribute>: a file attribute key.
12502 // <attr_value>: an unsigned 32-bit integer.
12503 void set_attribute_uint32(AT0)(AT0 /*char*/ attribute, uint attr_value) nothrow {
12504 g_file_info_set_attribute_uint32(&this, toCString!(char*)(attribute), attr_value);
12507 // Sets the @attribute to contain the given @attr_value,
12508 // if possible.
12509 // <attribute>: a file attribute key.
12510 // <attr_value>: an unsigned 64-bit integer.
12511 void set_attribute_uint64(AT0)(AT0 /*char*/ attribute, ulong attr_value) nothrow {
12512 g_file_info_set_attribute_uint64(&this, toCString!(char*)(attribute), attr_value);
12515 // Sets the content type attribute for a given #GFileInfo.
12516 // See %G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE.
12517 // <content_type>: a content type. See <link linkend="gio-GContentType">GContentType</link>.
12518 void set_content_type(AT0)(AT0 /*char*/ content_type) nothrow {
12519 g_file_info_set_content_type(&this, toCString!(char*)(content_type));
12522 // Sets the display name for the current #GFileInfo.
12523 // See %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME.
12524 // <display_name>: a string containing a display name.
12525 void set_display_name(AT0)(AT0 /*char*/ display_name) nothrow {
12526 g_file_info_set_display_name(&this, toCString!(char*)(display_name));
12529 // Sets the edit name for the current file.
12530 // See %G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME.
12531 // <edit_name>: a string containing an edit name.
12532 void set_edit_name(AT0)(AT0 /*char*/ edit_name) nothrow {
12533 g_file_info_set_edit_name(&this, toCString!(char*)(edit_name));
12536 // Sets the file type in a #GFileInfo to @type.
12537 // See %G_FILE_ATTRIBUTE_STANDARD_TYPE.
12538 // <type>: a #GFileType.
12539 void set_file_type()(FileType type) nothrow {
12540 g_file_info_set_file_type(&this, type);
12543 // Sets the icon for a given #GFileInfo.
12544 // See %G_FILE_ATTRIBUTE_STANDARD_ICON.
12545 // <icon>: a #GIcon.
12546 void set_icon(AT0)(AT0 /*Icon*/ icon) nothrow {
12547 g_file_info_set_icon(&this, UpCast!(Icon*)(icon));
12550 // Sets the "is_hidden" attribute in a #GFileInfo according to @is_symlink.
12551 // See %G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN.
12552 // <is_hidden>: a #gboolean.
12553 void set_is_hidden()(int is_hidden) nothrow {
12554 g_file_info_set_is_hidden(&this, is_hidden);
12557 // Sets the "is_symlink" attribute in a #GFileInfo according to @is_symlink.
12558 // See %G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK.
12559 // <is_symlink>: a #gboolean.
12560 void set_is_symlink()(int is_symlink) nothrow {
12561 g_file_info_set_is_symlink(&this, is_symlink);
12564 // Sets the %G_FILE_ATTRIBUTE_TIME_MODIFIED attribute in the file
12565 // info to the given time value.
12566 // <mtime>: a #GTimeVal.
12567 void set_modification_time(AT0)(AT0 /*GLib2.TimeVal*/ mtime) nothrow {
12568 g_file_info_set_modification_time(&this, UpCast!(GLib2.TimeVal*)(mtime));
12571 // Sets the name attribute for the current #GFileInfo.
12572 // See %G_FILE_ATTRIBUTE_STANDARD_NAME.
12573 // <name>: a string containing a name.
12574 void set_name(AT0)(AT0 /*char*/ name) nothrow {
12575 g_file_info_set_name(&this, toCString!(char*)(name));
12578 // Sets the %G_FILE_ATTRIBUTE_STANDARD_SIZE attribute in the file info
12579 // to the given size.
12580 // <size>: a #goffset containing the file's size.
12581 void set_size()(long size) nothrow {
12582 g_file_info_set_size(&this, size);
12585 // Sets the sort order attribute in the file info structure. See
12586 // %G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER.
12587 // <sort_order>: a sort order integer.
12588 void set_sort_order()(int sort_order) nothrow {
12589 g_file_info_set_sort_order(&this, sort_order);
12592 // Sets the %G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET attribute in the file info
12593 // to the given symlink target.
12594 // <symlink_target>: a static string containing a path to a symlink target.
12595 void set_symlink_target(AT0)(AT0 /*char*/ symlink_target) nothrow {
12596 g_file_info_set_symlink_target(&this, toCString!(char*)(symlink_target));
12599 // Unsets a mask set by g_file_info_set_attribute_mask(), if one
12600 // is set.
12601 void unset_attribute_mask()() nothrow {
12602 g_file_info_unset_attribute_mask(&this);
12606 struct FileInfoClass {
12610 // GFileInputStream provides input streams that take their
12611 // content from a file.
12613 // GFileInputStream implements #GSeekable, which allows the input
12614 // stream to jump to arbitrary positions in the file, provided the
12615 // filesystem of the file allows it. To find the position of a file
12616 // input stream, use g_seekable_tell(). To find out if a file input
12617 // stream supports seeking, use g_seekable_can_seek().
12618 // To position a file input stream, use g_seekable_seek().
12619 struct FileInputStream /* : InputStream */ {
12620 mixin Seekable.__interface__;
12621 alias parent_instance this;
12622 alias parent_instance super_;
12623 alias parent_instance inputstream;
12624 InputStream parent_instance;
12625 private FileInputStreamPrivate* priv;
12628 // Queries a file input stream the given @attributes. This function blocks
12629 // while querying the stream. For the asynchronous (non-blocking) version
12630 // of this function, see g_file_input_stream_query_info_async(). While the
12631 // stream is blocked, the stream will set the pending flag internally, and
12632 // any other operations on the stream will fail with %G_IO_ERROR_PENDING.
12633 // RETURNS: a #GFileInfo, or %NULL on error.
12634 // <attributes>: a file attribute query string.
12635 // <cancellable>: optional #GCancellable object, %NULL to ignore.
12636 FileInfo* /*new*/ query_info(AT0, AT1, AT2)(AT0 /*char*/ attributes, AT1 /*Cancellable*/ cancellable, AT2 /*GLib2.Error**/ error=null) nothrow {
12637 return g_file_input_stream_query_info(&this, toCString!(char*)(attributes), UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
12640 // Queries the stream information asynchronously.
12641 // When the operation is finished @callback will be called.
12642 // You can then call g_file_input_stream_query_info_finish()
12643 // to get the result of the operation.
12645 // For the synchronous version of this function,
12646 // see g_file_input_stream_query_info().
12648 // If @cancellable is not %NULL, then the operation can be cancelled by
12649 // triggering the cancellable object from another thread. If the operation
12650 // was cancelled, the error %G_IO_ERROR_CANCELLED will be set
12651 // <attributes>: a file attribute query string.
12652 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
12653 // <cancellable>: optional #GCancellable object, %NULL to ignore.
12654 // <callback>: callback to call when the request is satisfied
12655 // <user_data>: the data to pass to callback function
12656 void query_info_async(AT0, AT1, AT2)(AT0 /*char*/ attributes, int io_priority, AT1 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT2 /*void*/ user_data) nothrow {
12657 g_file_input_stream_query_info_async(&this, toCString!(char*)(attributes), io_priority, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
12660 // Finishes an asynchronous info query operation.
12661 // RETURNS: #GFileInfo.
12662 // <result>: a #GAsyncResult.
12663 FileInfo* /*new*/ query_info_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
12664 return g_file_input_stream_query_info_finish(&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
12668 struct FileInputStreamClass {
12669 InputStreamClass parent_class;
12670 extern (C) long function (FileInputStream* stream) nothrow tell;
12671 extern (C) int function (FileInputStream* stream) nothrow can_seek;
12672 extern (C) int function (FileInputStream* stream, long offset, GLib2.SeekType type, Cancellable* cancellable, GLib2.Error** error=null) nothrow seek;
12674 // RETURNS: a #GFileInfo, or %NULL on error.
12675 // <attributes>: a file attribute query string.
12676 // <cancellable>: optional #GCancellable object, %NULL to ignore.
12677 extern (C) FileInfo* /*new*/ function (FileInputStream* stream, char* attributes, Cancellable* cancellable, GLib2.Error** error=null) nothrow query_info;
12679 // <attributes>: a file attribute query string.
12680 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
12681 // <cancellable>: optional #GCancellable object, %NULL to ignore.
12682 // <callback>: callback to call when the request is satisfied
12683 // <user_data>: the data to pass to callback function
12684 extern (C) void function (FileInputStream* stream, char* attributes, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow query_info_async;
12686 // RETURNS: #GFileInfo.
12687 // <result>: a #GAsyncResult.
12688 extern (C) FileInfo* /*new*/ function (FileInputStream* stream, AsyncResult* result, GLib2.Error** error=null) nothrow query_info_finish;
12689 extern (C) void function () nothrow _g_reserved1;
12690 extern (C) void function () nothrow _g_reserved2;
12691 extern (C) void function () nothrow _g_reserved3;
12692 extern (C) void function () nothrow _g_reserved4;
12693 extern (C) void function () nothrow _g_reserved5;
12696 struct FileInputStreamPrivate {
12700 // Monitors a file or directory for changes.
12702 // To obtain a #GFileMonitor for a file or directory, use
12703 // g_file_monitor(), g_file_monitor_file(), or
12704 // g_file_monitor_directory().
12706 // To get informed about changes to the file or directory you are
12707 // monitoring, connect to the #GFileMonitor::changed signal. The
12708 // signal will be emitted in the <link
12709 // linkend="g-main-context-push-thread-default">thread-default main
12710 // context</link> of the thread that the monitor was created in
12711 // (though if the global default main context is blocked, this may
12712 // cause notifications to be blocked even if the thread-default
12713 // context is still running).
12714 struct FileMonitor /* : GObject.Object */ {
12715 alias parent_instance this;
12716 alias parent_instance super_;
12717 alias parent_instance object;
12718 GObject2.Object parent_instance;
12719 private FileMonitorPrivate* priv;
12722 // Cancels a file monitor.
12723 // RETURNS: %TRUE if monitor was cancelled.
12724 int cancel()() nothrow {
12725 return g_file_monitor_cancel(&this);
12728 // Emits the #GFileMonitor::changed signal if a change
12729 // has taken place. Should be called from file monitor
12730 // implementations only.
12732 // The signal will be emitted from an idle handler (in the <link
12733 // linkend="g-main-context-push-thread-default">thread-default main
12734 // context</link>).
12735 // <child>: a #GFile.
12736 // <other_file>: a #GFile.
12737 // <event_type>: a set of #GFileMonitorEvent flags.
12738 void emit_event(AT0, AT1)(AT0 /*File*/ child, AT1 /*File*/ other_file, FileMonitorEvent event_type) nothrow {
12739 g_file_monitor_emit_event(&this, UpCast!(File*)(child), UpCast!(File*)(other_file), event_type);
12742 // Returns whether the monitor is canceled.
12743 // RETURNS: %TRUE if monitor is canceled. %FALSE otherwise.
12744 int is_cancelled()() nothrow {
12745 return g_file_monitor_is_cancelled(&this);
12748 // Sets the rate limit to which the @monitor will report
12749 // consecutive change events to the same file.
12750 // <limit_msecs>: a non-negative integer with the limit in milliseconds to poll for changes
12751 void set_rate_limit()(int limit_msecs) nothrow {
12752 g_file_monitor_set_rate_limit(&this, limit_msecs);
12755 // Emitted when @file has been changed.
12757 // If using #G_FILE_MONITOR_SEND_MOVED flag and @event_type is
12758 // #G_FILE_MONITOR_SEND_MOVED, @file will be set to a #GFile containing the
12759 // old path, and @other_file will be set to a #GFile containing the new path.
12761 // In all the other cases, @other_file will be set to #NULL.
12762 // <file>: a #GFile.
12763 // <other_file>: a #GFile or #NULL.
12764 // <event_type>: a #GFileMonitorEvent.
12765 extern (C) alias static void function (FileMonitor* this_, File* file, File* other_file, FileMonitorEvent* event_type, void* user_data=null) nothrow signal_changed;
12767 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
12768 return super_.signal_connect!name(cb, data, cf);
12771 ulong signal_connect(string name:"changed", CB/*:signal_changed*/)
12772 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
12773 if (is(typeof(cb)==signal_changed)||_ttmm!(CB, signal_changed)()) {
12774 return signal_connect_data!()(&this, cast(char*)"changed",
12775 cast(GObject2.Callback)cb, data, null, cf);
12779 struct FileMonitorClass {
12780 GObject2.ObjectClass parent_class;
12781 extern (C) void function (FileMonitor* monitor, File* file, File* other_file, FileMonitorEvent event_type) nothrow changed;
12782 // RETURNS: %TRUE if monitor was cancelled.
12783 extern (C) int function (FileMonitor* monitor) nothrow cancel;
12784 extern (C) void function () nothrow _g_reserved1;
12785 extern (C) void function () nothrow _g_reserved2;
12786 extern (C) void function () nothrow _g_reserved3;
12787 extern (C) void function () nothrow _g_reserved4;
12788 extern (C) void function () nothrow _g_reserved5;
12791 // Specifies what type of event a monitor event is.
12792 enum FileMonitorEvent {
12793 CHANGED = 0,
12794 CHANGES_DONE_HINT = 1,
12795 DELETED = 2,
12796 CREATED = 3,
12797 ATTRIBUTE_CHANGED = 4,
12798 PRE_UNMOUNT = 5,
12799 UNMOUNTED = 6,
12800 MOVED = 7
12802 // Flags used to set what a #GFileMonitor will watch for.
12803 enum FileMonitorFlags {
12804 NONE = 0,
12805 WATCH_MOUNTS = 1,
12806 SEND_MOVED = 2
12808 struct FileMonitorPrivate {
12812 // GFileOutputStream provides output streams that write their
12813 // content to a file.
12815 // GFileOutputStream implements #GSeekable, which allows the output
12816 // stream to jump to arbitrary positions in the file and to truncate
12817 // the file, provided the filesystem of the file supports these
12818 // operations.
12820 // To find the position of a file output stream, use g_seekable_tell().
12821 // To find out if a file output stream supports seeking, use
12822 // g_seekable_can_seek().To position a file output stream, use
12823 // g_seekable_seek(). To find out if a file output stream supports
12824 // truncating, use g_seekable_can_truncate(). To truncate a file output
12825 // stream, use g_seekable_truncate().
12826 struct FileOutputStream /* : OutputStream */ {
12827 mixin Seekable.__interface__;
12828 alias parent_instance this;
12829 alias parent_instance super_;
12830 alias parent_instance outputstream;
12831 OutputStream parent_instance;
12832 private FileOutputStreamPrivate* priv;
12835 // Gets the entity tag for the file when it has been written.
12836 // This must be called after the stream has been written
12837 // and closed, as the etag can change while writing.
12838 // RETURNS: the entity tag for the stream.
12839 char* /*new*/ get_etag()() nothrow {
12840 return g_file_output_stream_get_etag(&this);
12843 // Queries a file output stream for the given @attributes.
12844 // This function blocks while querying the stream. For the asynchronous
12845 // version of this function, see g_file_output_stream_query_info_async().
12846 // While the stream is blocked, the stream will set the pending flag
12847 // internally, and any other operations on the stream will fail with
12848 // %G_IO_ERROR_PENDING.
12850 // Can fail if the stream was already closed (with @error being set to
12851 // %G_IO_ERROR_CLOSED), the stream has pending operations (with @error being
12852 // set to %G_IO_ERROR_PENDING), or if querying info is not supported for
12853 // the stream's interface (with @error being set to %G_IO_ERROR_NOT_SUPPORTED). In
12854 // all cases of failure, %NULL will be returned.
12856 // If @cancellable is not %NULL, then the operation can be cancelled by
12857 // triggering the cancellable object from another thread. If the operation
12858 // was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %NULL will
12859 // be returned.
12860 // RETURNS: a #GFileInfo for the @stream, or %NULL on error.
12861 // <attributes>: a file attribute query string.
12862 // <cancellable>: optional #GCancellable object, %NULL to ignore.
12863 FileInfo* /*new*/ query_info(AT0, AT1, AT2)(AT0 /*char*/ attributes, AT1 /*Cancellable*/ cancellable, AT2 /*GLib2.Error**/ error=null) nothrow {
12864 return g_file_output_stream_query_info(&this, toCString!(char*)(attributes), UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
12867 // Asynchronously queries the @stream for a #GFileInfo. When completed,
12868 // @callback will be called with a #GAsyncResult which can be used to
12869 // finish the operation with g_file_output_stream_query_info_finish().
12871 // For the synchronous version of this function, see
12872 // g_file_output_stream_query_info().
12873 // <attributes>: a file attribute query string.
12874 // <io_priority>: the <link linkend="gio-GIOScheduler">I/O priority</link> of the request.
12875 // <cancellable>: optional #GCancellable object, %NULL to ignore.
12876 // <callback>: callback to call when the request is satisfied
12877 // <user_data>: the data to pass to callback function
12878 void query_info_async(AT0, AT1, AT2)(AT0 /*char*/ attributes, int io_priority, AT1 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT2 /*void*/ user_data) nothrow {
12879 g_file_output_stream_query_info_async(&this, toCString!(char*)(attributes), io_priority, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
12882 // Finalizes the asynchronous query started
12883 // by g_file_output_stream_query_info_async().
12884 // RETURNS: A #GFileInfo for the finished query.
12885 // <result>: a #GAsyncResult.
12886 FileInfo* /*new*/ query_info_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
12887 return g_file_output_stream_query_info_finish(&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
12891 struct FileOutputStreamClass {
12892 OutputStreamClass parent_class;
12893 extern (C) long function (FileOutputStream* stream) nothrow tell;
12894 extern (C) int function (FileOutputStream* stream) nothrow can_seek;
12895 extern (C) int function (FileOutputStream* stream, long offset, GLib2.SeekType type, Cancellable* cancellable, GLib2.Error** error=null) nothrow seek;
12896 extern (C) int function (FileOutputStream* stream) nothrow can_truncate;
12897 extern (C) int function (FileOutputStream* stream, long size, Cancellable* cancellable, GLib2.Error** error=null) nothrow truncate_fn;
12899 // RETURNS: a #GFileInfo for the @stream, or %NULL on error.
12900 // <attributes>: a file attribute query string.
12901 // <cancellable>: optional #GCancellable object, %NULL to ignore.
12902 extern (C) FileInfo* /*new*/ function (FileOutputStream* stream, char* attributes, Cancellable* cancellable, GLib2.Error** error=null) nothrow query_info;
12904 // <attributes>: a file attribute query string.
12905 // <io_priority>: the <link linkend="gio-GIOScheduler">I/O priority</link> of the request.
12906 // <cancellable>: optional #GCancellable object, %NULL to ignore.
12907 // <callback>: callback to call when the request is satisfied
12908 // <user_data>: the data to pass to callback function
12909 extern (C) void function (FileOutputStream* stream, char* attributes, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow query_info_async;
12911 // RETURNS: A #GFileInfo for the finished query.
12912 // <result>: a #GAsyncResult.
12913 extern (C) FileInfo* /*new*/ function (FileOutputStream* stream, AsyncResult* result, GLib2.Error** error=null) nothrow query_info_finish;
12914 // RETURNS: the entity tag for the stream.
12915 extern (C) char* /*new*/ function (FileOutputStream* stream) nothrow get_etag;
12916 extern (C) void function () nothrow _g_reserved1;
12917 extern (C) void function () nothrow _g_reserved2;
12918 extern (C) void function () nothrow _g_reserved3;
12919 extern (C) void function () nothrow _g_reserved4;
12920 extern (C) void function () nothrow _g_reserved5;
12923 struct FileOutputStreamPrivate {
12927 // When doing file operations that may take a while, such as moving
12928 // a file or copying a file, a progress callback is used to pass how
12929 // far along that operation is to the application.
12930 // <current_num_bytes>: the current number of bytes in the operation.
12931 // <total_num_bytes>: the total number of bytes in the operation.
12932 // <user_data>: user data passed to the callback.
12933 extern (C) alias void function (long current_num_bytes, long total_num_bytes, void* user_data) nothrow FileProgressCallback;
12935 // Flags used when querying a #GFileInfo.
12936 enum FileQueryInfoFlags {
12937 NONE = 0,
12938 NOFOLLOW_SYMLINKS = 1
12941 // When loading the partial contents of a file with g_file_load_partial_contents_async(),
12942 // it may become necessary to determine if any more data from the file should be loaded.
12943 // A #GFileReadMoreCallback function facilitates this by returning %TRUE if more data
12944 // should be read, or %FALSE otherwise.
12945 // RETURNS: %TRUE if more data should be read back. %FALSE otherwise.
12946 // <file_contents>: the data as currently read.
12947 // <file_size>: the size of the data currently read.
12948 // <callback_data>: data passed to the callback.
12949 extern (C) alias int function (char* file_contents, long file_size, void* callback_data) nothrow FileReadMoreCallback;
12951 // Indicates the file's on-disk type.
12952 enum FileType {
12953 UNKNOWN = 0,
12954 REGULAR = 1,
12955 DIRECTORY = 2,
12956 SYMBOLIC_LINK = 3,
12957 SPECIAL = 4,
12958 SHORTCUT = 5,
12959 MOUNTABLE = 6
12962 // Completes partial file and directory names given a partial string by
12963 // looking in the file system for clues. Can return a list of possible
12964 // completion strings for widget implementations.
12965 struct FilenameCompleter /* : GObject.Object */ {
12966 alias method_parent this;
12967 alias method_parent super_;
12968 alias method_parent object;
12969 GObject2.Object method_parent;
12972 // Creates a new filename completer.
12973 // RETURNS: a #GFilenameCompleter.
12974 static FilenameCompleter* /*new*/ new_()() nothrow {
12975 return g_filename_completer_new();
12977 static auto opCall()() {
12978 return g_filename_completer_new();
12981 // Obtains a completion for @initial_text from @completer.
12983 // This string is not owned by GIO, so remember to g_free() it
12984 // when finished.
12985 // RETURNS: a completed string, or %NULL if no completion exists.
12986 // <initial_text>: text to be completed.
12987 char* /*new*/ get_completion_suffix(AT0)(AT0 /*char*/ initial_text) nothrow {
12988 return g_filename_completer_get_completion_suffix(&this, toCString!(char*)(initial_text));
12991 // Gets an array of completion strings for a given initial text.
12993 // This array must be freed by g_strfreev() when finished.
12994 // RETURNS: array of strings with possible completions for @initial_text.
12995 // <initial_text>: text to be completed.
12996 char** /*new*/ get_completions(AT0)(AT0 /*char*/ initial_text) nothrow {
12997 return g_filename_completer_get_completions(&this, toCString!(char*)(initial_text));
13000 // If @dirs_only is %TRUE, @completer will only
13001 // complete directory names, and not file names.
13002 // <dirs_only>: a #gboolean.
13003 void set_dirs_only()(int dirs_only) nothrow {
13004 g_filename_completer_set_dirs_only(&this, dirs_only);
13006 // Emitted when the file name completion information comes available.
13007 extern (C) alias static void function (FilenameCompleter* this_, void* user_data=null) nothrow signal_got_completion_data;
13009 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
13010 return super_.signal_connect!name(cb, data, cf);
13013 ulong signal_connect(string name:"got-completion-data", CB/*:signal_got_completion_data*/)
13014 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
13015 if (is(typeof(cb)==signal_got_completion_data)||_ttmm!(CB, signal_got_completion_data)()) {
13016 return signal_connect_data!()(&this, cast(char*)"got-completion-data",
13017 cast(GObject2.Callback)cb, data, null, cf);
13021 struct FilenameCompleterClass {
13022 GObject2.ObjectClass parent_class;
13023 extern (C) void function (FilenameCompleter* filename_completer) nothrow got_completion_data;
13024 extern (C) void function () nothrow _g_reserved1;
13025 extern (C) void function () nothrow _g_reserved2;
13026 extern (C) void function () nothrow _g_reserved3;
13030 // Indicates a hint from the file system whether files should be
13031 // previewed in a file manager. Returned as the value of the key
13032 // #G_FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW.
13033 enum FilesystemPreviewType {
13034 IF_ALWAYS = 0,
13035 IF_LOCAL = 1,
13036 NEVER = 2
13039 // Base class for input stream implementations that perform some
13040 // kind of filtering operation on a base stream. Typical examples
13041 // of filtering operations are character set conversion, compression
13042 // and byte order flipping.
13043 struct FilterInputStream /* : InputStream */ {
13044 alias parent_instance this;
13045 alias parent_instance super_;
13046 alias parent_instance inputstream;
13047 InputStream parent_instance;
13048 InputStream* base_stream;
13051 // Gets the base stream for the filter stream.
13052 // RETURNS: a #GInputStream.
13053 InputStream* get_base_stream()() nothrow {
13054 return g_filter_input_stream_get_base_stream(&this);
13057 // Returns whether the base stream will be closed when @stream is
13058 // closed.
13059 // RETURNS: %TRUE if the base stream will be closed.
13060 int get_close_base_stream()() nothrow {
13061 return g_filter_input_stream_get_close_base_stream(&this);
13064 // Sets whether the base stream will be closed when @stream is closed.
13065 // <close_base>: %TRUE to close the base stream.
13066 void set_close_base_stream()(int close_base) nothrow {
13067 g_filter_input_stream_set_close_base_stream(&this, close_base);
13071 struct FilterInputStreamClass {
13072 InputStreamClass parent_class;
13073 extern (C) void function () nothrow _g_reserved1;
13074 extern (C) void function () nothrow _g_reserved2;
13075 extern (C) void function () nothrow _g_reserved3;
13079 // Base class for output stream implementations that perform some
13080 // kind of filtering operation on a base stream. Typical examples
13081 // of filtering operations are character set conversion, compression
13082 // and byte order flipping.
13083 struct FilterOutputStream /* : OutputStream */ {
13084 alias parent_instance this;
13085 alias parent_instance super_;
13086 alias parent_instance outputstream;
13087 OutputStream parent_instance;
13088 OutputStream* base_stream;
13091 // Gets the base stream for the filter stream.
13092 // RETURNS: a #GOutputStream.
13093 OutputStream* get_base_stream()() nothrow {
13094 return g_filter_output_stream_get_base_stream(&this);
13097 // Returns whether the base stream will be closed when @stream is
13098 // closed.
13099 // RETURNS: %TRUE if the base stream will be closed.
13100 int get_close_base_stream()() nothrow {
13101 return g_filter_output_stream_get_close_base_stream(&this);
13104 // Sets whether the base stream will be closed when @stream is closed.
13105 // <close_base>: %TRUE to close the base stream.
13106 void set_close_base_stream()(int close_base) nothrow {
13107 g_filter_output_stream_set_close_base_stream(&this, close_base);
13111 struct FilterOutputStreamClass {
13112 OutputStreamClass parent_class;
13113 extern (C) void function () nothrow _g_reserved1;
13114 extern (C) void function () nothrow _g_reserved2;
13115 extern (C) void function () nothrow _g_reserved3;
13118 // Error codes returned by GIO functions.
13119 enum IOErrorEnum {
13120 FAILED = 0,
13121 NOT_FOUND = 1,
13122 EXISTS = 2,
13123 IS_DIRECTORY = 3,
13124 NOT_DIRECTORY = 4,
13125 NOT_EMPTY = 5,
13126 NOT_REGULAR_FILE = 6,
13127 NOT_SYMBOLIC_LINK = 7,
13128 NOT_MOUNTABLE_FILE = 8,
13129 FILENAME_TOO_LONG = 9,
13130 INVALID_FILENAME = 10,
13131 TOO_MANY_LINKS = 11,
13132 NO_SPACE = 12,
13133 INVALID_ARGUMENT = 13,
13134 PERMISSION_DENIED = 14,
13135 NOT_SUPPORTED = 15,
13136 NOT_MOUNTED = 16,
13137 ALREADY_MOUNTED = 17,
13138 CLOSED = 18,
13139 CANCELLED = 19,
13140 PENDING = 20,
13141 READ_ONLY = 21,
13142 CANT_CREATE_BACKUP = 22,
13143 WRONG_ETAG = 23,
13144 TIMED_OUT = 24,
13145 WOULD_RECURSE = 25,
13146 BUSY = 26,
13147 WOULD_BLOCK = 27,
13148 HOST_NOT_FOUND = 28,
13149 WOULD_MERGE = 29,
13150 FAILED_HANDLED = 30,
13151 TOO_MANY_OPEN_FILES = 31,
13152 NOT_INITIALIZED = 32,
13153 ADDRESS_IN_USE = 33,
13154 PARTIAL_INPUT = 34,
13155 INVALID_DATA = 35,
13156 DBUS_ERROR = 36,
13157 HOST_UNREACHABLE = 37,
13158 NETWORK_UNREACHABLE = 38,
13159 CONNECTION_REFUSED = 39,
13160 PROXY_FAILED = 40,
13161 PROXY_AUTH_FAILED = 41,
13162 PROXY_NEED_AUTH = 42,
13163 PROXY_NOT_ALLOWED = 43
13165 struct IOExtension {
13167 // Gets the name under which @extension was registered.
13169 // Note that the same type may be registered as extension
13170 // for multiple extension points, under different names.
13171 // RETURNS: the name of @extension.
13172 char* get_name()() nothrow {
13173 return g_io_extension_get_name(&this);
13176 // Gets the priority with which @extension was registered.
13177 // RETURNS: the priority of @extension
13178 int get_priority()() nothrow {
13179 return g_io_extension_get_priority(&this);
13182 // Gets the type associated with @extension.
13183 // RETURNS: the type of @extension
13184 Type get_type()() nothrow {
13185 return g_io_extension_get_type(&this);
13188 // Unintrospectable method: ref_class() / g_io_extension_ref_class()
13189 // Gets a reference to the class for the type that is
13190 // associated with @extension.
13191 // RETURNS: the #GTypeClass for the type of @extension
13192 GObject2.TypeClass* /*new*/ ref_class()() nothrow {
13193 return g_io_extension_ref_class(&this);
13197 struct IOExtensionPoint {
13199 // Finds a #GIOExtension for an extension point by name.
13201 // given name, or %NULL if there is no extension with that name
13202 // RETURNS: the #GIOExtension for @extension_point that has the
13203 // <name>: the name of the extension to get
13204 IOExtension* get_extension_by_name(AT0)(AT0 /*char*/ name) nothrow {
13205 return g_io_extension_point_get_extension_by_name(&this, toCString!(char*)(name));
13208 // Gets a list of all extensions that implement this extension point.
13209 // The list is sorted by priority, beginning with the highest priority.
13211 // #GIOExtension<!-- -->s. The list is owned by GIO and should not be
13212 // modified.
13213 // RETURNS: a #GList of
13214 GLib2.List* get_extensions()() nothrow {
13215 return g_io_extension_point_get_extensions(&this);
13218 // Gets the required type for @extension_point.
13220 // or #G_TYPE_INVALID if the extension point has no required type
13221 // RETURNS: the #GType that all implementations must have,
13222 Type get_required_type()() nothrow {
13223 return g_io_extension_point_get_required_type(&this);
13226 // Sets the required type for @extension_point to @type.
13227 // All implementations must henceforth have this type.
13228 // <type>: the #GType to require
13229 void set_required_type()(Type type) nothrow {
13230 g_io_extension_point_set_required_type(&this, type);
13233 // Registers @type as extension for the extension point with name
13234 // @extension_point_name.
13236 // If @type has already been registered as an extension for this
13237 // extension point, the existing #GIOExtension object is returned.
13238 // RETURNS: a #GIOExtension object for #GType
13239 // <extension_point_name>: the name of the extension point
13240 // <type>: the #GType to register as extension
13241 // <extension_name>: the name for the extension
13242 // <priority>: the priority for the extension
13243 static IOExtension* implement(AT0, AT1)(AT0 /*char*/ extension_point_name, Type type, AT1 /*char*/ extension_name, int priority) nothrow {
13244 return g_io_extension_point_implement(toCString!(char*)(extension_point_name), type, toCString!(char*)(extension_name), priority);
13247 // Looks up an existing extension point.
13249 // is no registered extension point with the given name.
13250 // RETURNS: the #GIOExtensionPoint, or %NULL if there
13251 // <name>: the name of the extension point
13252 static IOExtensionPoint* lookup(AT0)(AT0 /*char*/ name) nothrow {
13253 return g_io_extension_point_lookup(toCString!(char*)(name));
13256 // Registers an extension point.
13258 // owned by GIO and should not be freed.
13259 // RETURNS: the new #GIOExtensionPoint. This object is
13260 // <name>: The name of the extension point
13261 static IOExtensionPoint* register(AT0)(AT0 /*char*/ name) nothrow {
13262 return g_io_extension_point_register(toCString!(char*)(name));
13267 // Provides an interface and default functions for loading and unloading
13268 // modules. This is used internally to make GIO extensible, but can also
13269 // be used by others to implement module loading.
13270 struct IOModule /* : GObject.TypeModule */ {
13271 mixin GObject2.TypePlugin.__interface__;
13272 alias method_parent this;
13273 alias method_parent super_;
13274 alias method_parent typemodule;
13275 GObject2.TypeModule method_parent;
13278 // Creates a new GIOModule that will load the specific
13279 // shared library when in use.
13281 // or %NULL on error.
13282 // RETURNS: a #GIOModule from given @filename,
13283 // <filename>: filename of the shared library module.
13284 static IOModule* /*new*/ new_(AT0)(AT0 /*char*/ filename) nothrow {
13285 return g_io_module_new(toCString!(char*)(filename));
13287 static auto opCall(AT0)(AT0 /*char*/ filename) {
13288 return g_io_module_new(toCString!(char*)(filename));
13291 // VERSION: 2.24
13292 // Optional API for GIO modules to implement.
13294 // Should return a list of all the extension points that may be
13295 // implemented in this module.
13297 // This method will not be called in normal use, however it may be
13298 // called when probing existing modules and recording which extension
13299 // points that this model is used for. This means we won't have to
13300 // load and initialze this module unless its needed.
13302 // If this function is not implemented by the module the module will
13303 // always be loaded, initialized and then unloaded on application startup
13304 // so that it can register its extension points during init.
13306 // Note that a module need not actually implement all the extension points
13307 // that g_io_module_query returns, since the exact list of extension may
13308 // depend on runtime issues. However all extension points actually implemented
13309 // must be returned by g_io_module_query() (if defined).
13311 // When installing a module that implements g_io_module_query you must
13312 // run gio-querymodules in order to build the cache files required for
13313 // lazy loading.
13315 // extension points of the module. The array must be suitable for
13316 // freeing with g_strfreev().
13317 // RETURNS: A %NULL-terminated array of strings, listing the supported
13318 static char** /*new*/ query()() nothrow {
13319 return g_io_module_query();
13322 // Required API for GIO modules to implement.
13323 // This function is ran after the module has been loaded into GIO,
13324 // to initialize the module.
13325 void load()() nothrow {
13326 g_io_module_load(&this);
13329 // Required API for GIO modules to implement.
13330 // This function is ran when the module is being unloaded from GIO,
13331 // to finalize the module.
13332 void unload()() nothrow {
13333 g_io_module_unload(&this);
13337 struct IOModuleClass {
13341 // Represents a scope for loading IO modules. A scope can be used for blocking
13342 // duplicate modules, or blocking a module you don't want to load.
13344 // The scope can be used with g_io_modules_load_all_in_directory_with_scope()
13345 // or g_io_modules_scan_all_in_directory_with_scope().
13346 struct IOModuleScope /* Version 2.30 */ {
13348 // VERSION: 2.30
13349 // Block modules with the given @basename from being loaded when
13350 // this scope is used with g_io_modules_scan_all_in_directory_with_scope()
13351 // or g_io_modules_load_all_in_directory_with_scope().
13352 // <basename>: the basename to block
13353 void block(AT0)(AT0 /*char*/ basename) nothrow {
13354 g_io_module_scope_block(&this, toCString!(char*)(basename));
13357 // VERSION: 2.30
13358 // Free a module scope.
13359 void free()() nothrow {
13360 g_io_module_scope_free(&this);
13363 // Unintrospectable function: new() / g_io_module_scope_new()
13364 // VERSION: 2.30
13365 // Create a new scope for loading of IO modules. A scope can be used for
13366 // blocking duplicate modules, or blocking a module you don't want to load.
13368 // Specify the %G_IO_MODULE_SCOPE_BLOCK_DUPLICATES flag to block modules
13369 // which have the same base name as a module that has already been seen
13370 // in this scope.
13371 // RETURNS: the new module scope
13372 // <flags>: flags for the new scope
13373 static IOModuleScope* /*new*/ new_()(IOModuleScopeFlags flags) nothrow {
13374 return g_io_module_scope_new(flags);
13378 // Flags for use with g_io_module_scope_new().
13379 enum IOModuleScopeFlags /* Version 2.30 */ {
13380 NONE = 0,
13381 BLOCK_DUPLICATES = 1
13383 // Opaque class for defining and scheduling IO jobs.
13384 struct IOSchedulerJob {
13386 // Used from an I/O job to send a callback to be run in the thread
13387 // that the job was started from, waiting for the result (and thus
13388 // blocking the I/O job).
13389 // RETURNS: The return value of @func
13390 // <func>: a #GSourceFunc callback that will be called in the original thread
13391 // <user_data>: data to pass to @func
13392 // <notify>: a #GDestroyNotify for @user_data, or %NULL
13393 int send_to_mainloop(AT0)(GLib2.SourceFunc func, AT0 /*void*/ user_data, GLib2.DestroyNotify notify) nothrow {
13394 return g_io_scheduler_job_send_to_mainloop(&this, func, UpCast!(void*)(user_data), notify);
13397 // Used from an I/O job to send a callback to be run asynchronously in
13398 // the thread that the job was started from. The callback will be run
13399 // when the main loop is available, but at that time the I/O job might
13400 // have finished. The return value from the callback is ignored.
13402 // Note that if you are passing the @user_data from g_io_scheduler_push_job()
13403 // on to this function you have to ensure that it is not freed before
13404 // @func is called, either by passing %NULL as @notify to
13405 // g_io_scheduler_push_job() or by using refcounting for @user_data.
13406 // <func>: a #GSourceFunc callback that will be called in the original thread
13407 // <user_data>: data to pass to @func
13408 // <notify>: a #GDestroyNotify for @user_data, or %NULL
13409 void send_to_mainloop_async(AT0)(GLib2.SourceFunc func, AT0 /*void*/ user_data, GLib2.DestroyNotify notify) nothrow {
13410 g_io_scheduler_job_send_to_mainloop_async(&this, func, UpCast!(void*)(user_data), notify);
13415 // I/O Job function.
13417 // Long-running jobs should periodically check the @cancellable
13418 // to see if they have been cancelled.
13420 // complete the job, %FALSE if the job is complete (or cancelled)
13421 // RETURNS: %TRUE if this function should be called again to
13422 // <job>: a #GIOSchedulerJob.
13423 // <cancellable>: optional #GCancellable object, %NULL to ignore.
13424 // <user_data>: the data to pass to callback function
13425 extern (C) alias int function (IOSchedulerJob* job, Cancellable* cancellable, void* user_data) nothrow IOSchedulerJobFunc;
13428 // GIOStream represents an object that has both read and write streams.
13429 // Generally the two streams acts as separate input and output streams,
13430 // but they share some common resources and state. For instance, for
13431 // seekable streams they may use the same position in both streams.
13433 // Examples of #GIOStream objects are #GSocketConnection which represents
13434 // a two-way network connection, and #GFileIOStream which represent a
13435 // file handle opened in read-write mode.
13437 // To do the actual reading and writing you need to get the substreams
13438 // with g_io_stream_get_input_stream() and g_io_stream_get_output_stream().
13440 // The #GIOStream object owns the input and the output streams, not the other
13441 // way around, so keeping the substreams alive will not keep the #GIOStream
13442 // object alive. If the #GIOStream object is freed it will be closed, thus
13443 // closing the substream, so even if the substreams stay alive they will
13444 // always just return a %G_IO_ERROR_CLOSED for all operations.
13446 // To close a stream use g_io_stream_close() which will close the common
13447 // stream object and also the individual substreams. You can also close
13448 // the substreams themselves. In most cases this only marks the
13449 // substream as closed, so further I/O on it fails. However, some streams
13450 // may support "half-closed" states where one direction of the stream
13451 // is actually shut down.
13452 struct IOStream /* : GObject.Object */ {
13453 alias parent_instance this;
13454 alias parent_instance super_;
13455 alias parent_instance object;
13456 GObject2.Object parent_instance;
13457 private IOStreamPrivate* priv;
13460 // VERSION: 2.28
13461 // Finishes an asynchronous io stream splice operation.
13462 // RETURNS: %TRUE on success, %FALSE otherwise.
13463 // <result>: a #GAsyncResult.
13464 static int splice_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
13465 return g_io_stream_splice_finish(UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
13468 // VERSION: 2.22
13469 // Clears the pending flag on @stream.
13470 void clear_pending()() nothrow {
13471 g_io_stream_clear_pending(&this);
13474 // VERSION: 2.22
13475 // Closes the stream, releasing resources related to it. This will also
13476 // closes the individual input and output streams, if they are not already
13477 // closed.
13479 // Once the stream is closed, all other operations will return
13480 // %G_IO_ERROR_CLOSED. Closing a stream multiple times will not
13481 // return an error.
13483 // Closing a stream will automatically flush any outstanding buffers
13484 // in the stream.
13486 // Streams will be automatically closed when the last reference
13487 // is dropped, but you might want to call this function to make sure
13488 // resources are released as early as possible.
13490 // Some streams might keep the backing store of the stream (e.g. a file
13491 // descriptor) open after the stream is closed. See the documentation for
13492 // the individual stream for details.
13494 // On failure the first error that happened will be reported, but the
13495 // close operation will finish as much as possible. A stream that failed
13496 // to close will still return %G_IO_ERROR_CLOSED for all operations.
13497 // Still, it is important to check and report the error to the user,
13498 // otherwise there might be a loss of data as all data might not be written.
13500 // If @cancellable is not NULL, then the operation can be cancelled by
13501 // triggering the cancellable object from another thread. If the operation
13502 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
13503 // Cancelling a close will still leave the stream closed, but some streams
13504 // can use a faster close that doesn't block to e.g. check errors.
13506 // The default implementation of this method just calls close on the
13507 // individual input/output streams.
13508 // RETURNS: %TRUE on success, %FALSE on failure
13509 // <cancellable>: optional #GCancellable object, %NULL to ignore
13510 int close(AT0, AT1)(AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
13511 return g_io_stream_close(&this, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
13514 // VERSION: 2.22
13515 // Requests an asynchronous close of the stream, releasing resources
13516 // related to it. When the operation is finished @callback will be
13517 // called. You can then call g_io_stream_close_finish() to get
13518 // the result of the operation.
13520 // For behaviour details see g_io_stream_close().
13522 // The asynchronous methods have a default fallback that uses threads
13523 // to implement asynchronicity, so they are optional for inheriting
13524 // classes. However, if you override one you must override all.
13525 // <io_priority>: the io priority of the request
13526 // <cancellable>: optional cancellable object
13527 // <callback>: callback to call when the request is satisfied
13528 // <user_data>: the data to pass to callback function
13529 void close_async(AT0, AT1)(int io_priority, AT0 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT1 /*void*/ user_data) nothrow {
13530 g_io_stream_close_async(&this, io_priority, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
13533 // VERSION: 2.22
13534 // Closes a stream.
13535 // RETURNS: %TRUE if stream was successfully closed, %FALSE otherwise.
13536 // <result>: a #GAsyncResult
13537 int close_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
13538 return g_io_stream_close_finish(&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
13541 // VERSION: 2.22
13542 // Gets the input stream for this object. This is used
13543 // for reading.
13545 // Do not free.
13546 // RETURNS: a #GInputStream, owned by the #GIOStream.
13547 InputStream* get_input_stream()() nothrow {
13548 return g_io_stream_get_input_stream(&this);
13551 // VERSION: 2.22
13552 // Gets the output stream for this object. This is used for
13553 // writing.
13555 // Do not free.
13556 // RETURNS: a #GOutputStream, owned by the #GIOStream.
13557 OutputStream* get_output_stream()() nothrow {
13558 return g_io_stream_get_output_stream(&this);
13561 // VERSION: 2.22
13562 // Checks if a stream has pending actions.
13563 // RETURNS: %TRUE if @stream has pending actions.
13564 int has_pending()() nothrow {
13565 return g_io_stream_has_pending(&this);
13568 // VERSION: 2.22
13569 // Checks if a stream is closed.
13570 // RETURNS: %TRUE if the stream is closed.
13571 int is_closed()() nothrow {
13572 return g_io_stream_is_closed(&this);
13575 // VERSION: 2.22
13576 // Sets @stream to have actions pending. If the pending flag is
13577 // already set or @stream is closed, it will return %FALSE and set
13578 // @error.
13579 // RETURNS: %TRUE if pending was previously unset and is now set.
13580 int set_pending(AT0)(AT0 /*GLib2.Error**/ error=null) nothrow {
13581 return g_io_stream_set_pending(&this, UpCast!(GLib2.Error**)(error));
13584 // VERSION: 2.28
13585 // Asyncronously splice the output stream of @stream1 to the input stream of
13586 // @stream2, and splice the output stream of @stream2 to the input stream of
13587 // @stream1.
13589 // When the operation is finished @callback will be called.
13590 // You can then call g_io_stream_splice_finish() to get the
13591 // result of the operation.
13592 // <stream2>: a #GIOStream.
13593 // <flags>: a set of #GIOStreamSpliceFlags.
13594 // <io_priority>: the io priority of the request.
13595 // <cancellable>: optional #GCancellable object, %NULL to ignore.
13596 // <callback>: a #GAsyncReadyCallback.
13597 // <user_data>: user data passed to @callback.
13598 void splice_async(AT0, AT1, AT2)(AT0 /*IOStream*/ stream2, IOStreamSpliceFlags flags, int io_priority, AT1 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT2 /*void*/ user_data) nothrow {
13599 g_io_stream_splice_async(&this, UpCast!(IOStream*)(stream2), flags, io_priority, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
13603 struct IOStreamAdapter {
13606 struct IOStreamClass {
13607 GObject2.ObjectClass parent_class;
13608 // RETURNS: a #GInputStream, owned by the #GIOStream.
13609 extern (C) InputStream* function (IOStream* stream) nothrow get_input_stream;
13610 // RETURNS: a #GOutputStream, owned by the #GIOStream.
13611 extern (C) OutputStream* function (IOStream* stream) nothrow get_output_stream;
13612 extern (C) int function (IOStream* stream, Cancellable* cancellable, GLib2.Error** error=null) nothrow close_fn;
13614 // <io_priority>: the io priority of the request
13615 // <cancellable>: optional cancellable object
13616 // <callback>: callback to call when the request is satisfied
13617 // <user_data>: the data to pass to callback function
13618 extern (C) void function (IOStream* stream, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow close_async;
13620 // RETURNS: %TRUE if stream was successfully closed, %FALSE otherwise.
13621 // <result>: a #GAsyncResult
13622 extern (C) int function (IOStream* stream, AsyncResult* result, GLib2.Error** error=null) nothrow close_finish;
13623 extern (C) void function () nothrow _g_reserved1;
13624 extern (C) void function () nothrow _g_reserved2;
13625 extern (C) void function () nothrow _g_reserved3;
13626 extern (C) void function () nothrow _g_reserved4;
13627 extern (C) void function () nothrow _g_reserved5;
13628 extern (C) void function () nothrow _g_reserved6;
13629 extern (C) void function () nothrow _g_reserved7;
13630 extern (C) void function () nothrow _g_reserved8;
13631 extern (C) void function () nothrow _g_reserved9;
13632 extern (C) void function () nothrow _g_reserved10;
13635 struct IOStreamPrivate {
13638 // GIOStreamSpliceFlags determine how streams should be spliced.
13639 enum IOStreamSpliceFlags /* Version 2.28 */ {
13640 NONE = 0,
13641 CLOSE_STREAM1 = 1,
13642 CLOSE_STREAM2 = 2,
13643 WAIT_FOR_BOTH = 4
13646 // #GIcon is a very minimal interface for icons. It provides functions
13647 // for checking the equality of two icons, hashing of icons and
13648 // serializing an icon to and from strings.
13650 // #GIcon does not provide the actual pixmap for the icon as this is out
13651 // of GIO's scope, however implementations of #GIcon may contain the name
13652 // of an icon (see #GThemedIcon), or the path to an icon (see #GLoadableIcon).
13654 // To obtain a hash of a #GIcon, see g_icon_hash().
13656 // To check if two #GIcons are equal, see g_icon_equal().
13658 // For serializing a #GIcon, use g_icon_to_string() and
13659 // g_icon_new_for_string().
13661 // If your application or library provides one or more #GIcon
13662 // implementations you need to ensure that each #GType is registered
13663 // with the type system prior to calling g_icon_new_for_string().
13664 struct Icon /* Interface */ {
13665 mixin template __interface__() {
13666 // Gets a hash for an icon.
13668 // use in a #GHashTable or similar data structure.
13669 // RETURNS: a #guint containing a hash for the @icon, suitable for
13670 // <icon>: #gconstpointer to an icon object.
13671 static uint hash(AT0)(AT0 /*const(void)*/ icon) nothrow {
13672 return g_icon_hash(UpCast!(const(void)*)(icon));
13675 // VERSION: 2.20
13676 // Generate a #GIcon instance from @str. This function can fail if
13677 // @str is not valid - see g_icon_to_string() for discussion.
13679 // If your application or library provides one or more #GIcon
13680 // implementations you need to ensure that each #GType is registered
13681 // with the type system prior to calling g_icon_new_for_string().
13683 // interface or %NULL if @error is set.
13684 // RETURNS: An object implementing the #GIcon
13685 // <str>: A string obtained via g_icon_to_string().
13686 static Icon* /*new*/ new_for_string(AT0, AT1)(AT0 /*char*/ str, AT1 /*GLib2.Error**/ error=null) nothrow {
13687 return g_icon_new_for_string(toCString!(char*)(str), UpCast!(GLib2.Error**)(error));
13690 // Checks if two icons are equal.
13691 // RETURNS: %TRUE if @icon1 is equal to @icon2. %FALSE otherwise.
13692 // <icon2>: pointer to the second #GIcon.
13693 int equal(AT0)(AT0 /*Icon*/ icon2=null) nothrow {
13694 return g_icon_equal(cast(Icon*)&this, UpCast!(Icon*)(icon2));
13697 // VERSION: 2.20
13698 // Generates a textual representation of @icon that can be used for
13699 // serialization such as when passing @icon to a different process or
13700 // saving it to persistent storage. Use g_icon_new_for_string() to
13701 // get @icon back from the returned string.
13703 // The encoding of the returned string is proprietary to #GIcon except
13704 // in the following two cases
13706 // <itemizedlist>
13707 // <listitem><para>
13708 // If @icon is a #GFileIcon, the returned string is a native path
13709 // (such as <literal>/path/to/my icon.png</literal>) without escaping
13710 // if the #GFile for @icon is a native file. If the file is not
13711 // native, the returned string is the result of g_file_get_uri()
13712 // (such as <literal>sftp://path/to/my&percnt;20icon.png</literal>).
13713 // </para></listitem>
13714 // <listitem><para>
13715 // If @icon is a #GThemedIcon with exactly one name, the encoding is
13716 // simply the name (such as <literal>network-server</literal>).
13717 // </para></listitem>
13718 // </itemizedlist>
13720 // be serialized. Use g_free() to free.
13721 // RETURNS: An allocated NUL-terminated UTF8 string or %NULL if @icon can't
13722 char* /*new*/ to_string()() nothrow {
13723 return g_icon_to_string(cast(Icon*)&this);
13726 mixin __interface__;
13730 // GIconIface is used to implement GIcon types for various
13731 // different systems. See #GThemedIcon and #GLoadableIcon for
13732 // examples of how to implement this interface.
13733 struct IconIface {
13734 GObject2.TypeInterface g_iface;
13735 // RETURNS: a #guint containing a hash for the @icon, suitable for
13736 extern (C) uint function (Icon* icon) nothrow hash;
13738 // RETURNS: %TRUE if @icon1 is equal to @icon2. %FALSE otherwise.
13739 // <icon2>: pointer to the second #GIcon.
13740 extern (C) int function (Icon* icon1, Icon* icon2=null) nothrow equal;
13741 // RETURNS: An allocated NUL-terminated UTF8 string or %NULL if @icon can't
13742 extern (C) int function (Icon* icon, PtrArray* tokens, int* out_version) nothrow to_tokens;
13743 // Unintrospectable functionp: from_tokens() / ()
13744 extern (C) Icon* function (char** tokens, int num_tokens, int version_, GLib2.Error** error=null) nothrow from_tokens;
13748 // #GInetAddress represents an IPv4 or IPv6 internet address. Use
13749 // g_resolver_lookup_by_name() or g_resolver_lookup_by_name_async() to
13750 // look up the #GInetAddress for a hostname. Use
13751 // g_resolver_lookup_by_address() or
13752 // g_resolver_lookup_by_address_async() to look up the hostname for a
13753 // #GInetAddress.
13755 // To actually connect to a remote host, you will need a
13756 // #GInetSocketAddress (which includes a #GInetAddress as well as a
13757 // port number).
13758 struct InetAddress /* : GObject.Object */ {
13759 alias parent_instance this;
13760 alias parent_instance super_;
13761 alias parent_instance object;
13762 GObject2.Object parent_instance;
13763 private InetAddressPrivate* priv;
13766 // VERSION: 2.22
13767 // Creates a #GInetAddress for the "any" address (unassigned/"don't
13768 // care") for @family.
13770 // for @family.
13771 // RETURNS: a new #GInetAddress corresponding to the "any" address
13772 // <family>: the address family
13773 static InetAddress* /*new*/ new_any()(SocketFamily family) nothrow {
13774 return g_inet_address_new_any(family);
13776 static auto opCall()(SocketFamily family) {
13777 return g_inet_address_new_any(family);
13780 // VERSION: 2.22
13781 // Creates a new #GInetAddress from the given @family and @bytes.
13782 // @bytes should be 4 bytes for %G_SOCKET_FAMILY_IPV4 and 16 bytes for
13783 // %G_SOCKET_FAMILY_IPV6.
13784 // RETURNS: a new #GInetAddress corresponding to @family and @bytes.
13785 // <bytes>: raw address data
13786 // <family>: the address family of @bytes
13787 static InetAddress* /*new*/ new_from_bytes(AT0)(AT0 /*ubyte*/ bytes, SocketFamily family) nothrow {
13788 return g_inet_address_new_from_bytes(UpCast!(ubyte*)(bytes), family);
13790 static auto opCall(AT0)(AT0 /*ubyte*/ bytes, SocketFamily family) {
13791 return g_inet_address_new_from_bytes(UpCast!(ubyte*)(bytes), family);
13794 // VERSION: 2.22
13795 // Parses @string as an IP address and creates a new #GInetAddress.
13797 // @string could not be parsed.
13798 // RETURNS: a new #GInetAddress corresponding to @string, or %NULL if
13799 // <string>: a string representation of an IP address
13800 static InetAddress* /*new*/ new_from_string(AT0)(AT0 /*char*/ string_) nothrow {
13801 return g_inet_address_new_from_string(toCString!(char*)(string_));
13803 static auto opCall(AT0)(AT0 /*char*/ string_) {
13804 return g_inet_address_new_from_string(toCString!(char*)(string_));
13807 // VERSION: 2.22
13808 // Creates a #GInetAddress for the loopback address for @family.
13810 // for @family.
13811 // RETURNS: a new #GInetAddress corresponding to the loopback address
13812 // <family>: the address family
13813 static InetAddress* /*new*/ new_loopback()(SocketFamily family) nothrow {
13814 return g_inet_address_new_loopback(family);
13816 static auto opCall()(SocketFamily family) {
13817 return g_inet_address_new_loopback(family);
13820 // VERSION: 2.30
13821 // Checks if two #GInetAddress instances are equal, e.g. the same address.
13822 // RETURNS: %TRUE if @address and @other_address are equal, %FALSE otherwise.
13823 // <other_address>: Another #GInetAddress.
13824 int equal(AT0)(AT0 /*InetAddress*/ other_address) nothrow {
13825 return g_inet_address_equal(&this, UpCast!(InetAddress*)(other_address));
13828 // VERSION: 2.22
13829 // Gets @address's family
13830 // RETURNS: @address's family
13831 SocketFamily get_family()() nothrow {
13832 return g_inet_address_get_family(&this);
13835 // VERSION: 2.22
13836 // Tests whether @address is the "any" address for its family.
13837 // RETURNS: %TRUE if @address is the "any" address for its family.
13838 int get_is_any()() nothrow {
13839 return g_inet_address_get_is_any(&this);
13842 // VERSION: 2.22
13843 // Tests whether @address is a link-local address (that is, if it
13844 // identifies a host on a local network that is not connected to the
13845 // Internet).
13846 // RETURNS: %TRUE if @address is a link-local address.
13847 int get_is_link_local()() nothrow {
13848 return g_inet_address_get_is_link_local(&this);
13851 // VERSION: 2.22
13852 // Tests whether @address is the loopback address for its family.
13853 // RETURNS: %TRUE if @address is the loopback address for its family.
13854 int get_is_loopback()() nothrow {
13855 return g_inet_address_get_is_loopback(&this);
13858 // VERSION: 2.22
13859 // Tests whether @address is a global multicast address.
13860 // RETURNS: %TRUE if @address is a global multicast address.
13861 int get_is_mc_global()() nothrow {
13862 return g_inet_address_get_is_mc_global(&this);
13865 // VERSION: 2.22
13866 // Tests whether @address is a link-local multicast address.
13867 // RETURNS: %TRUE if @address is a link-local multicast address.
13868 int get_is_mc_link_local()() nothrow {
13869 return g_inet_address_get_is_mc_link_local(&this);
13872 // VERSION: 2.22
13873 // Tests whether @address is a node-local multicast address.
13874 // RETURNS: %TRUE if @address is a node-local multicast address.
13875 int get_is_mc_node_local()() nothrow {
13876 return g_inet_address_get_is_mc_node_local(&this);
13879 // VERSION: 2.22
13880 // Tests whether @address is an organization-local multicast address.
13881 // RETURNS: %TRUE if @address is an organization-local multicast address.
13882 int get_is_mc_org_local()() nothrow {
13883 return g_inet_address_get_is_mc_org_local(&this);
13886 // VERSION: 2.22
13887 // Tests whether @address is a site-local multicast address.
13888 // RETURNS: %TRUE if @address is a site-local multicast address.
13889 int get_is_mc_site_local()() nothrow {
13890 return g_inet_address_get_is_mc_site_local(&this);
13893 // VERSION: 2.22
13894 // Tests whether @address is a multicast address.
13895 // RETURNS: %TRUE if @address is a multicast address.
13896 int get_is_multicast()() nothrow {
13897 return g_inet_address_get_is_multicast(&this);
13900 // VERSION: 2.22
13901 // Tests whether @address is a site-local address such as 10.0.0.1
13902 // (that is, the address identifies a host on a local network that can
13903 // not be reached directly from the Internet, but which may have
13904 // outgoing Internet connectivity via a NAT or firewall).
13905 // RETURNS: %TRUE if @address is a site-local address.
13906 int get_is_site_local()() nothrow {
13907 return g_inet_address_get_is_site_local(&this);
13910 // VERSION: 2.22
13911 // Gets the size of the native raw binary address for @address. This
13912 // is the size of the data that you get from g_inet_address_to_bytes().
13913 // RETURNS: the number of bytes used for the native version of @address.
13914 size_t get_native_size()() nothrow {
13915 return g_inet_address_get_native_size(&this);
13918 // Unintrospectable method: to_bytes() / g_inet_address_to_bytes()
13919 // VERSION: 2.22
13920 // Gets the raw binary address data from @address.
13922 // which should not be modified, stored, or freed. The size of this
13923 // array can be gotten with g_inet_address_get_native_size().
13924 // RETURNS: a pointer to an internal array of the bytes in @address,
13925 ubyte* to_bytes()() nothrow {
13926 return g_inet_address_to_bytes(&this);
13929 // VERSION: 2.22
13930 // Converts @address to string form.
13932 // freed after use.
13933 // RETURNS: a representation of @address as a string, which should be
13934 char* /*new*/ to_string()() nothrow {
13935 return g_inet_address_to_string(&this);
13939 struct InetAddressClass {
13940 GObject2.ObjectClass parent_class;
13941 // RETURNS: a representation of @address as a string, which should be
13942 extern (C) char* /*new*/ function (InetAddress* address) nothrow to_string;
13943 // RETURNS: a pointer to an internal array of the bytes in @address,
13944 extern (C) ubyte* function (InetAddress* address) nothrow to_bytes;
13948 // #GInetAddressMask represents a range of IPv4 or IPv6 addresses
13949 // described by a base address and a length indicating how many bits
13950 // of the base address are relevant for matching purposes. These are
13951 // often given in string form. Eg, "10.0.0.0/8", or "fe80::/10".
13952 struct InetAddressMask /* : GObject.Object */ /* Version 2.32 */ {
13953 mixin Initable.__interface__;
13954 alias parent_instance this;
13955 alias parent_instance super_;
13956 alias parent_instance object;
13957 GObject2.Object parent_instance;
13958 private InetAddressMaskPrivate* priv;
13961 // VERSION: 2.32
13962 // Creates a new #GInetAddressMask representing all addresses whose
13963 // first @length bits match @addr.
13964 // RETURNS: a new #GInetAddressMask, or %NULL on error
13965 // <addr>: a #GInetAddress
13966 // <length>: number of bits of @addr to use
13967 static InetAddressMask* /*new*/ new_(AT0, AT1)(AT0 /*InetAddress*/ addr, uint length, AT1 /*GLib2.Error**/ error=null) nothrow {
13968 return g_inet_address_mask_new(UpCast!(InetAddress*)(addr), length, UpCast!(GLib2.Error**)(error));
13970 static auto opCall(AT0, AT1)(AT0 /*InetAddress*/ addr, uint length, AT1 /*GLib2.Error**/ error=null) {
13971 return g_inet_address_mask_new(UpCast!(InetAddress*)(addr), length, UpCast!(GLib2.Error**)(error));
13974 // VERSION: 2.32
13975 // Parses @mask_string as an IP address and (optional) length, and
13976 // creates a new #GInetAddressMask. The length, if present, is
13977 // delimited by a "/". If it is not present, then the length is
13978 // assumed to be the full length of the address.
13980 // on error.
13981 // RETURNS: a new #GInetAddressMask corresponding to @string, or %NULL
13982 // <mask_string>: an IP address or address/length string
13983 static InetAddressMask* /*new*/ new_from_string(AT0, AT1)(AT0 /*char*/ mask_string, AT1 /*GLib2.Error**/ error=null) nothrow {
13984 return g_inet_address_mask_new_from_string(toCString!(char*)(mask_string), UpCast!(GLib2.Error**)(error));
13986 static auto opCall(AT0, AT1)(AT0 /*char*/ mask_string, AT1 /*GLib2.Error**/ error=null) {
13987 return g_inet_address_mask_new_from_string(toCString!(char*)(mask_string), UpCast!(GLib2.Error**)(error));
13990 // VERSION: 2.32
13991 // Tests if @mask and @mask2 are the same mask.
13992 // RETURNS: whether @mask and @mask2 are the same mask
13993 // <mask2>: another #GInetAddressMask
13994 int equal(AT0)(AT0 /*InetAddressMask*/ mask2) nothrow {
13995 return g_inet_address_mask_equal(&this, UpCast!(InetAddressMask*)(mask2));
13998 // VERSION: 2.32
13999 // Gets @mask's base address
14000 // RETURNS: @mask's base address
14001 InetAddress* get_address()() nothrow {
14002 return g_inet_address_mask_get_address(&this);
14005 // VERSION: 2.32
14006 // Gets the #GSocketFamily of @mask's address
14007 // RETURNS: the #GSocketFamily of @mask's address
14008 SocketFamily get_family()() nothrow {
14009 return g_inet_address_mask_get_family(&this);
14012 // VERSION: 2.32
14013 // Gets @mask's length
14014 // RETURNS: @mask's length
14015 uint get_length()() nothrow {
14016 return g_inet_address_mask_get_length(&this);
14019 // VERSION: 2.32
14020 // Tests if @address falls within the range described by @mask.
14022 // @mask.
14023 // RETURNS: whether @address falls within the range described by
14024 // <address>: a #GInetAddress
14025 int matches(AT0)(AT0 /*InetAddress*/ address) nothrow {
14026 return g_inet_address_mask_matches(&this, UpCast!(InetAddress*)(address));
14029 // VERSION: 2.32
14030 // Converts @mask back to its corresponding string form.
14031 // RETURNS: a string corresponding to @mask.
14032 char* /*new*/ to_string()() nothrow {
14033 return g_inet_address_mask_to_string(&this);
14037 struct InetAddressMaskClass {
14038 GObject2.ObjectClass parent_class;
14041 struct InetAddressMaskPrivate {
14044 struct InetAddressPrivate {
14048 // An IPv4 or IPv6 socket address; that is, the combination of a
14049 // #GInetAddress and a port number.
14050 struct InetSocketAddress /* : SocketAddress */ {
14051 mixin SocketConnectable.__interface__;
14052 alias parent_instance this;
14053 alias parent_instance super_;
14054 alias parent_instance socketaddress;
14055 SocketAddress parent_instance;
14056 private InetSocketAddressPrivate* priv;
14059 // VERSION: 2.22
14060 // Creates a new #GInetSocketAddress for @address and @port.
14061 // RETURNS: a new #GInetSocketAddress
14062 // <address>: a #GInetAddress
14063 // <port>: a port number
14064 static InetSocketAddress* /*new*/ new_(AT0)(AT0 /*InetAddress*/ address, ushort port) nothrow {
14065 return g_inet_socket_address_new(UpCast!(InetAddress*)(address), port);
14067 static auto opCall(AT0)(AT0 /*InetAddress*/ address, ushort port) {
14068 return g_inet_socket_address_new(UpCast!(InetAddress*)(address), port);
14071 // VERSION: 2.22
14072 // Gets @address's #GInetAddress.
14074 // g_object_ref()'d if it will be stored
14075 // RETURNS: the #GInetAddress for @address, which must be
14076 InetAddress* get_address()() nothrow {
14077 return g_inet_socket_address_get_address(&this);
14080 // VERSION: 2.32
14081 // Gets the <literal>sin6_flowinfo</literal> field from @address,
14082 // which must be an IPv6 address.
14083 // RETURNS: the flowinfo field
14084 uint get_flowinfo()() nothrow {
14085 return g_inet_socket_address_get_flowinfo(&this);
14088 // VERSION: 2.22
14089 // Gets @address's port.
14090 // RETURNS: the port for @address
14091 ushort get_port()() nothrow {
14092 return g_inet_socket_address_get_port(&this);
14095 // VERSION: 2.32
14096 // Gets the <literal>sin6_scope_id</literal> field from @address,
14097 // which must be an IPv6 address.
14098 // RETURNS: the scope id field
14099 uint get_scope_id()() nothrow {
14100 return g_inet_socket_address_get_scope_id(&this);
14104 struct InetSocketAddressClass {
14105 SocketAddressClass parent_class;
14108 struct InetSocketAddressPrivate {
14112 // #GInitable is implemented by objects that can fail during
14113 // initialization. If an object implements this interface then
14114 // it must be initialized as the first thing after construction,
14115 // either via g_initable_init() or g_async_initable_init_async()
14116 // (the latter is only available if it also implements #GAsyncInitable).
14118 // If the object is not initialized, or initialization returns with an
14119 // error, then all operations on the object except g_object_ref() and
14120 // g_object_unref() are considered to be invalid, and have undefined
14121 // behaviour. They will often fail with g_critical() or g_warning(), but
14122 // this must not be relied on.
14124 // Users of objects implementing this are not intended to use
14125 // the interface method directly, instead it will be used automatically
14126 // in various ways. For C applications you generally just call
14127 // g_initable_new() directly, or indirectly via a foo_thing_new() wrapper.
14128 // This will call g_initable_init() under the cover, returning %NULL and
14129 // setting a #GError on failure (at which point the instance is
14130 // unreferenced).
14132 // For bindings in languages where the native constructor supports
14133 // exceptions the binding could check for objects implemention %GInitable
14134 // during normal construction and automatically initialize them, throwing
14135 // an exception on failure.
14136 struct Initable /* Interface */ /* Version 2.22 */ {
14137 mixin template __interface__() {
14138 // Unintrospectable function: new() / g_initable_new()
14139 // VERSION: 2.22
14140 // Helper function for constructing #GInitable object. This is
14141 // similar to g_object_new() but also initializes the object
14142 // and returns %NULL, setting an error on failure.
14143 // RETURNS: a newly allocated #GObject, or %NULL on error
14144 // <object_type>: a #GType supporting #GInitable.
14145 // <cancellable>: optional #GCancellable object, %NULL to ignore.
14146 // <error>: a #GError location to store the error occurring, or %NULL to ignore.
14147 // <first_property_name>: the name of the first property, or %NULL if no properties
14148 alias g_initable_new new_; // Variadic
14150 // Unintrospectable function: new_valist() / g_initable_new_valist()
14151 // VERSION: 2.22
14152 // Helper function for constructing #GInitable object. This is
14153 // similar to g_object_new_valist() but also initializes the object
14154 // and returns %NULL, setting an error on failure.
14155 // RETURNS: a newly allocated #GObject, or %NULL on error
14156 // <object_type>: a #GType supporting #GInitable.
14157 // <first_property_name>: the name of the first property, followed by the value, and other property value pairs, and ended by %NULL.
14158 // <var_args>: The var args list generated from @first_property_name.
14159 // <cancellable>: optional #GCancellable object, %NULL to ignore.
14160 static GObject2.Object* /*new*/ new_valist(AT0, AT1, AT2)(Type object_type, AT0 /*char*/ first_property_name, va_list var_args, AT1 /*Cancellable*/ cancellable, AT2 /*GLib2.Error**/ error=null) nothrow {
14161 return g_initable_new_valist(object_type, toCString!(char*)(first_property_name), var_args, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
14164 // VERSION: 2.22
14165 // Helper function for constructing #GInitable object. This is
14166 // similar to g_object_newv() but also initializes the object
14167 // and returns %NULL, setting an error on failure.
14168 // RETURNS: a newly allocated #GObject, or %NULL on error
14169 // <object_type>: a #GType supporting #GInitable.
14170 // <n_parameters>: the number of parameters in @parameters
14171 // <parameters>: the parameters to use to construct the object
14172 // <cancellable>: optional #GCancellable object, %NULL to ignore.
14173 static void* /*new*/ newv(AT0, AT1, AT2)(Type object_type, uint n_parameters, AT0 /*GObject2.Parameter*/ parameters, AT1 /*Cancellable*/ cancellable, AT2 /*GLib2.Error**/ error=null) nothrow {
14174 return g_initable_newv(object_type, n_parameters, UpCast!(GObject2.Parameter*)(parameters), UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
14177 // VERSION: 2.22
14178 // Initializes the object implementing the interface.
14180 // The object must be initialized before any real use after initial
14181 // construction, either with this function or g_async_initable_init_async().
14183 // Implementations may also support cancellation. If @cancellable is not %NULL,
14184 // then initialization can be cancelled by triggering the cancellable object
14185 // from another thread. If the operation was cancelled, the error
14186 // %G_IO_ERROR_CANCELLED will be returned. If @cancellable is not %NULL and
14187 // the object doesn't support cancellable initialization the error
14188 // %G_IO_ERROR_NOT_SUPPORTED will be returned.
14190 // If the object is not initialized, or initialization returns with an
14191 // error, then all operations on the object except g_object_ref() and
14192 // g_object_unref() are considered to be invalid, and have undefined
14193 // behaviour. See the <xref linkend="ginitable"/> section introduction
14194 // for more details.
14196 // Implementations of this method must be idempotent, i.e. multiple calls
14197 // to this function with the same argument should return the same results.
14198 // Only the first call initializes the object, further calls return the result
14199 // of the first call. This is so that it's safe to implement the singleton
14200 // pattern in the GObject constructor function.
14202 // return %FALSE and set @error appropriately if present.
14203 // RETURNS: %TRUE if successful. If an error has occurred, this function will
14204 // <cancellable>: optional #GCancellable object, %NULL to ignore.
14205 int init(AT0, AT1)(AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
14206 return g_initable_init(cast(Initable*)&this, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
14209 mixin __interface__;
14213 // Provides an interface for initializing object such that initialization
14214 // may fail.
14215 struct InitableIface /* Version 2.22 */ {
14216 GObject2.TypeInterface g_iface;
14218 // RETURNS: %TRUE if successful. If an error has occurred, this function will
14219 // <cancellable>: optional #GCancellable object, %NULL to ignore.
14220 extern (C) int function (Initable* initable, Cancellable* cancellable, GLib2.Error** error=null) nothrow init;
14224 // GInputStream has functions to read from a stream (g_input_stream_read()),
14225 // to close a stream (g_input_stream_close()) and to skip some content
14226 // (g_input_stream_skip()).
14228 // To copy the content of an input stream to an output stream without
14229 // manually handling the reads and writes, use g_output_stream_splice().
14231 // All of these functions have async variants too.
14232 struct InputStream /* : GObject.Object */ {
14233 alias parent_instance this;
14234 alias parent_instance super_;
14235 alias parent_instance object;
14236 GObject2.Object parent_instance;
14237 private InputStreamPrivate* priv;
14239 // Clears the pending flag on @stream.
14240 void clear_pending()() nothrow {
14241 g_input_stream_clear_pending(&this);
14244 // Closes the stream, releasing resources related to it.
14246 // Once the stream is closed, all other operations will return %G_IO_ERROR_CLOSED.
14247 // Closing a stream multiple times will not return an error.
14249 // Streams will be automatically closed when the last reference
14250 // is dropped, but you might want to call this function to make sure
14251 // resources are released as early as possible.
14253 // Some streams might keep the backing store of the stream (e.g. a file descriptor)
14254 // open after the stream is closed. See the documentation for the individual
14255 // stream for details.
14257 // On failure the first error that happened will be reported, but the close
14258 // operation will finish as much as possible. A stream that failed to
14259 // close will still return %G_IO_ERROR_CLOSED for all operations. Still, it
14260 // is important to check and report the error to the user.
14262 // If @cancellable is not NULL, then the operation can be cancelled by
14263 // triggering the cancellable object from another thread. If the operation
14264 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
14265 // Cancelling a close will still leave the stream closed, but some streams
14266 // can use a faster close that doesn't block to e.g. check errors.
14267 // RETURNS: %TRUE on success, %FALSE on failure
14268 // <cancellable>: optional #GCancellable object, %NULL to ignore.
14269 int close(AT0, AT1)(AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
14270 return g_input_stream_close(&this, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
14273 // Requests an asynchronous closes of the stream, releasing resources related to it.
14274 // When the operation is finished @callback will be called.
14275 // You can then call g_input_stream_close_finish() to get the result of the
14276 // operation.
14278 // For behaviour details see g_input_stream_close().
14280 // The asyncronous methods have a default fallback that uses threads to implement
14281 // asynchronicity, so they are optional for inheriting classes. However, if you
14282 // override one you must override all.
14283 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
14284 // <cancellable>: optional cancellable object
14285 // <callback>: callback to call when the request is satisfied
14286 // <user_data>: the data to pass to callback function
14287 void close_async(AT0, AT1)(int io_priority, AT0 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT1 /*void*/ user_data) nothrow {
14288 g_input_stream_close_async(&this, io_priority, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
14291 // Finishes closing a stream asynchronously, started from g_input_stream_close_async().
14292 // RETURNS: %TRUE if the stream was closed successfully.
14293 // <result>: a #GAsyncResult.
14294 int close_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
14295 return g_input_stream_close_finish(&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
14298 // Checks if an input stream has pending actions.
14299 // RETURNS: %TRUE if @stream has pending actions.
14300 int has_pending()() nothrow {
14301 return g_input_stream_has_pending(&this);
14304 // Checks if an input stream is closed.
14305 // RETURNS: %TRUE if the stream is closed.
14306 int is_closed()() nothrow {
14307 return g_input_stream_is_closed(&this);
14310 // Tries to read @count bytes from the stream into the buffer starting at
14311 // @buffer. Will block during this read.
14313 // If count is zero returns zero and does nothing. A value of @count
14314 // larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
14316 // On success, the number of bytes read into the buffer is returned.
14317 // It is not an error if this is not the same as the requested size, as it
14318 // can happen e.g. near the end of a file. Zero is returned on end of file
14319 // (or if @count is zero), but never otherwise.
14321 // If @cancellable is not NULL, then the operation can be cancelled by
14322 // triggering the cancellable object from another thread. If the operation
14323 // was cancelled, the error G_IO_ERROR_CANCELLED will be returned. If an
14324 // operation was partially finished when the operation was cancelled the
14325 // partial result will be returned, without an error.
14327 // On error -1 is returned and @error is set accordingly.
14328 // RETURNS: Number of bytes read, or -1 on error
14329 // <buffer>: a buffer to read data into (which should be at least count bytes long).
14330 // <count>: the number of bytes that will be read from the stream
14331 // <cancellable>: optional #GCancellable object, %NULL to ignore.
14332 ssize_t read(AT0, AT1, AT2)(AT0 /*void*/ buffer, size_t count, AT1 /*Cancellable*/ cancellable, AT2 /*GLib2.Error**/ error=null) nothrow {
14333 return g_input_stream_read(&this, UpCast!(void*)(buffer), count, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
14336 // Tries to read @count bytes from the stream into the buffer starting at
14337 // @buffer. Will block during this read.
14339 // This function is similar to g_input_stream_read(), except it tries to
14340 // read as many bytes as requested, only stopping on an error or end of stream.
14342 // On a successful read of @count bytes, or if we reached the end of the
14343 // stream, %TRUE is returned, and @bytes_read is set to the number of bytes
14344 // read into @buffer.
14346 // If there is an error during the operation %FALSE is returned and @error
14347 // is set to indicate the error status, @bytes_read is updated to contain
14348 // the number of bytes read into @buffer before the error occurred.
14349 // RETURNS: %TRUE on success, %FALSE if there was an error
14350 // <buffer>: a buffer to read data into (which should be at least count bytes long).
14351 // <count>: the number of bytes that will be read from the stream
14352 // <bytes_read>: location to store the number of bytes that was read from the stream
14353 // <cancellable>: optional #GCancellable object, %NULL to ignore.
14354 int read_all(AT0, AT1, AT2, AT3)(AT0 /*void*/ buffer, size_t count, /*out*/ AT1 /*size_t*/ bytes_read, AT2 /*Cancellable*/ cancellable, AT3 /*GLib2.Error**/ error=null) nothrow {
14355 return g_input_stream_read_all(&this, UpCast!(void*)(buffer), count, UpCast!(size_t*)(bytes_read), UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
14358 // Request an asynchronous read of @count bytes from the stream into the buffer
14359 // starting at @buffer. When the operation is finished @callback will be called.
14360 // You can then call g_input_stream_read_finish() to get the result of the
14361 // operation.
14363 // During an async request no other sync and async calls are allowed on @stream, and will
14364 // result in %G_IO_ERROR_PENDING errors.
14366 // A value of @count larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
14368 // On success, the number of bytes read into the buffer will be passed to the
14369 // callback. It is not an error if this is not the same as the requested size, as it
14370 // can happen e.g. near the end of a file, but generally we try to read
14371 // as many bytes as requested. Zero is returned on end of file
14372 // (or if @count is zero), but never otherwise.
14374 // Any outstanding i/o request with higher priority (lower numerical value) will
14375 // be executed before an outstanding request with lower priority. Default
14376 // priority is %G_PRIORITY_DEFAULT.
14378 // The asyncronous methods have a default fallback that uses threads to implement
14379 // asynchronicity, so they are optional for inheriting classes. However, if you
14380 // override one you must override all.
14381 // <buffer>: a buffer to read data into (which should be at least count bytes long).
14382 // <count>: the number of bytes that will be read from the stream
14383 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
14384 // <cancellable>: optional #GCancellable object, %NULL to ignore.
14385 // <callback>: callback to call when the request is satisfied
14386 // <user_data>: the data to pass to callback function
14387 void read_async(AT0, AT1, AT2)(AT0 /*void*/ buffer, size_t count, int io_priority, AT1 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT2 /*void*/ user_data) nothrow {
14388 g_input_stream_read_async(&this, UpCast!(void*)(buffer), count, io_priority, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
14391 // Finishes an asynchronous stream read operation.
14392 // RETURNS: number of bytes read in, or -1 on error.
14393 // <result>: a #GAsyncResult.
14394 ssize_t read_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
14395 return g_input_stream_read_finish(&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
14398 // Sets @stream to have actions pending. If the pending flag is
14399 // already set or @stream is closed, it will return %FALSE and set
14400 // @error.
14401 // RETURNS: %TRUE if pending was previously unset and is now set.
14402 int set_pending(AT0)(AT0 /*GLib2.Error**/ error=null) nothrow {
14403 return g_input_stream_set_pending(&this, UpCast!(GLib2.Error**)(error));
14406 // Tries to skip @count bytes from the stream. Will block during the operation.
14408 // This is identical to g_input_stream_read(), from a behaviour standpoint,
14409 // but the bytes that are skipped are not returned to the user. Some
14410 // streams have an implementation that is more efficient than reading the data.
14412 // This function is optional for inherited classes, as the default implementation
14413 // emulates it using read.
14415 // If @cancellable is not %NULL, then the operation can be cancelled by
14416 // triggering the cancellable object from another thread. If the operation
14417 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
14418 // operation was partially finished when the operation was cancelled the
14419 // partial result will be returned, without an error.
14420 // RETURNS: Number of bytes skipped, or -1 on error
14421 // <count>: the number of bytes that will be skipped from the stream
14422 // <cancellable>: optional #GCancellable object, %NULL to ignore.
14423 ssize_t skip(AT0, AT1)(size_t count, AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
14424 return g_input_stream_skip(&this, count, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
14427 // Request an asynchronous skip of @count bytes from the stream.
14428 // When the operation is finished @callback will be called.
14429 // You can then call g_input_stream_skip_finish() to get the result
14430 // of the operation.
14432 // During an async request no other sync and async calls are allowed,
14433 // and will result in %G_IO_ERROR_PENDING errors.
14435 // A value of @count larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
14437 // On success, the number of bytes skipped will be passed to the callback.
14438 // It is not an error if this is not the same as the requested size, as it
14439 // can happen e.g. near the end of a file, but generally we try to skip
14440 // as many bytes as requested. Zero is returned on end of file
14441 // (or if @count is zero), but never otherwise.
14443 // Any outstanding i/o request with higher priority (lower numerical value)
14444 // will be executed before an outstanding request with lower priority.
14445 // Default priority is %G_PRIORITY_DEFAULT.
14447 // The asynchronous methods have a default fallback that uses threads to
14448 // implement asynchronicity, so they are optional for inheriting classes.
14449 // However, if you override one, you must override all.
14450 // <count>: the number of bytes that will be skipped from the stream
14451 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
14452 // <cancellable>: optional #GCancellable object, %NULL to ignore.
14453 // <callback>: callback to call when the request is satisfied
14454 // <user_data>: the data to pass to callback function
14455 void skip_async(AT0, AT1)(size_t count, int io_priority, AT0 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT1 /*void*/ user_data) nothrow {
14456 g_input_stream_skip_async(&this, count, io_priority, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
14459 // Finishes a stream skip operation.
14460 // RETURNS: the size of the bytes skipped, or %-1 on error.
14461 // <result>: a #GAsyncResult.
14462 ssize_t skip_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
14463 return g_input_stream_skip_finish(&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
14467 struct InputStreamClass {
14468 GObject2.ObjectClass parent_class;
14469 extern (C) ssize_t function (InputStream* stream, void* buffer, size_t count, Cancellable* cancellable, GLib2.Error** error=null) nothrow read_fn;
14471 // RETURNS: Number of bytes skipped, or -1 on error
14472 // <count>: the number of bytes that will be skipped from the stream
14473 // <cancellable>: optional #GCancellable object, %NULL to ignore.
14474 extern (C) ssize_t function (InputStream* stream, size_t count, Cancellable* cancellable, GLib2.Error** error=null) nothrow skip;
14475 extern (C) int function (InputStream* stream, Cancellable* cancellable, GLib2.Error** error=null) nothrow close_fn;
14477 // <buffer>: a buffer to read data into (which should be at least count bytes long).
14478 // <count>: the number of bytes that will be read from the stream
14479 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
14480 // <cancellable>: optional #GCancellable object, %NULL to ignore.
14481 // <callback>: callback to call when the request is satisfied
14482 // <user_data>: the data to pass to callback function
14483 extern (C) void function (InputStream* stream, void* buffer, size_t count, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow read_async;
14485 // RETURNS: number of bytes read in, or -1 on error.
14486 // <result>: a #GAsyncResult.
14487 extern (C) ssize_t function (InputStream* stream, AsyncResult* result, GLib2.Error** error=null) nothrow read_finish;
14489 // <count>: the number of bytes that will be skipped from the stream
14490 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
14491 // <cancellable>: optional #GCancellable object, %NULL to ignore.
14492 // <callback>: callback to call when the request is satisfied
14493 // <user_data>: the data to pass to callback function
14494 extern (C) void function (InputStream* stream, size_t count, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow skip_async;
14496 // RETURNS: the size of the bytes skipped, or %-1 on error.
14497 // <result>: a #GAsyncResult.
14498 extern (C) ssize_t function (InputStream* stream, AsyncResult* result, GLib2.Error** error=null) nothrow skip_finish;
14500 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
14501 // <cancellable>: optional cancellable object
14502 // <callback>: callback to call when the request is satisfied
14503 // <user_data>: the data to pass to callback function
14504 extern (C) void function (InputStream* stream, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow close_async;
14506 // RETURNS: %TRUE if the stream was closed successfully.
14507 // <result>: a #GAsyncResult.
14508 extern (C) int function (InputStream* stream, AsyncResult* result, GLib2.Error** error=null) nothrow close_finish;
14509 extern (C) void function () nothrow _g_reserved1;
14510 extern (C) void function () nothrow _g_reserved2;
14511 extern (C) void function () nothrow _g_reserved3;
14512 extern (C) void function () nothrow _g_reserved4;
14513 extern (C) void function () nothrow _g_reserved5;
14516 struct InputStreamPrivate {
14520 // Structure used for scatter/gather data input.
14521 // You generally pass in an array of #GInputVector<!-- -->s
14522 // and the operation will store the read data starting in the
14523 // first buffer, switching to the next as needed.
14524 struct InputVector /* Version 2.22 */ {
14525 void* buffer;
14526 size_t size;
14530 // Extends the #GIcon interface and adds the ability to
14531 // load icons from streams.
14532 struct LoadableIcon /* Interface */ {
14533 mixin template __interface__() {
14534 // Loads a loadable icon. For the asynchronous version of this function,
14535 // see g_loadable_icon_load_async().
14536 // RETURNS: a #GInputStream to read the icon from.
14537 // <size>: an integer.
14538 // <type>: a location to store the type of the loaded icon, %NULL to ignore.
14539 // <cancellable>: optional #GCancellable object, %NULL to ignore.
14540 InputStream* /*new*/ load(AT0, AT1, AT2)(int size, /*out*/ AT0 /*char**/ type, AT1 /*Cancellable*/ cancellable, AT2 /*GLib2.Error**/ error=null) nothrow {
14541 return g_loadable_icon_load(cast(LoadableIcon*)&this, size, toCString!(char**)(type), UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
14544 // Loads an icon asynchronously. To finish this function, see
14545 // g_loadable_icon_load_finish(). For the synchronous, blocking
14546 // version of this function, see g_loadable_icon_load().
14547 // <size>: an integer.
14548 // <cancellable>: optional #GCancellable object, %NULL to ignore.
14549 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
14550 // <user_data>: the data to pass to callback function
14551 void load_async(AT0, AT1)(int size, AT0 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT1 /*void*/ user_data) nothrow {
14552 g_loadable_icon_load_async(cast(LoadableIcon*)&this, size, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
14555 // Finishes an asynchronous icon load started in g_loadable_icon_load_async().
14556 // RETURNS: a #GInputStream to read the icon from.
14557 // <res>: a #GAsyncResult.
14558 // <type>: a location to store the type of the loaded icon, %NULL to ignore.
14559 InputStream* /*new*/ load_finish(AT0, AT1, AT2)(AT0 /*AsyncResult*/ res, AT1 /*char**/ type, AT2 /*GLib2.Error**/ error=null) nothrow {
14560 return g_loadable_icon_load_finish(cast(LoadableIcon*)&this, UpCast!(AsyncResult*)(res), toCString!(char**)(type), UpCast!(GLib2.Error**)(error));
14563 mixin __interface__;
14566 // Interface for icons that can be loaded as a stream.
14567 struct LoadableIconIface {
14568 GObject2.TypeInterface g_iface;
14570 // RETURNS: a #GInputStream to read the icon from.
14571 // <size>: an integer.
14572 // <type>: a location to store the type of the loaded icon, %NULL to ignore.
14573 // <cancellable>: optional #GCancellable object, %NULL to ignore.
14574 extern (C) InputStream* /*new*/ function (LoadableIcon* icon, int size, /*out*/ char** type, Cancellable* cancellable, GLib2.Error** error=null) nothrow load;
14576 // <size>: an integer.
14577 // <cancellable>: optional #GCancellable object, %NULL to ignore.
14578 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
14579 // <user_data>: the data to pass to callback function
14580 extern (C) void function (LoadableIcon* icon, int size, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow load_async;
14582 // RETURNS: a #GInputStream to read the icon from.
14583 // <res>: a #GAsyncResult.
14584 // <type>: a location to store the type of the loaded icon, %NULL to ignore.
14585 extern (C) InputStream* /*new*/ function (LoadableIcon* icon, AsyncResult* res, char** type, GLib2.Error** error=null) nothrow load_finish;
14588 enum MENU_ATTRIBUTE_ACTION = "action";
14589 enum MENU_ATTRIBUTE_LABEL = "label";
14590 enum MENU_ATTRIBUTE_TARGET = "target";
14591 enum MENU_LINK_SECTION = "section";
14592 enum MENU_LINK_SUBMENU = "submenu";
14594 // #GMemoryInputStream is a class for using arbitrary
14595 // memory chunks as input for GIO streaming input operations.
14596 struct MemoryInputStream /* : InputStream */ {
14597 mixin Seekable.__interface__;
14598 alias parent_instance this;
14599 alias parent_instance super_;
14600 alias parent_instance inputstream;
14601 InputStream parent_instance;
14602 private MemoryInputStreamPrivate* priv;
14605 // Creates a new empty #GMemoryInputStream.
14606 // RETURNS: a new #GInputStream
14607 static MemoryInputStream* /*new*/ new_()() nothrow {
14608 return g_memory_input_stream_new();
14610 static auto opCall()() {
14611 return g_memory_input_stream_new();
14614 // Creates a new #GMemoryInputStream with data in memory of a given size.
14615 // RETURNS: new #GInputStream read from @data of @len bytes.
14616 // <data>: input data
14617 // <len>: length of the data, may be -1 if @data is a nul-terminated string
14618 // <destroy>: function that is called to free @data, or %NULL
14619 static MemoryInputStream* /*new*/ new_from_data(AT0)(AT0 /*ubyte*/ data, ssize_t len, GLib2.DestroyNotify destroy=null) nothrow {
14620 return g_memory_input_stream_new_from_data(UpCast!(ubyte*)(data), len, destroy);
14622 static auto opCall(AT0)(AT0 /*ubyte*/ data, ssize_t len, GLib2.DestroyNotify destroy=null) {
14623 return g_memory_input_stream_new_from_data(UpCast!(ubyte*)(data), len, destroy);
14626 // Appends @data to data that can be read from the input stream
14627 // <data>: input data
14628 // <len>: length of the data, may be -1 if @data is a nul-terminated string
14629 // <destroy>: function that is called to free @data, or %NULL
14630 void add_data(AT0)(AT0 /*ubyte*/ data, ssize_t len, GLib2.DestroyNotify destroy=null) nothrow {
14631 g_memory_input_stream_add_data(&this, UpCast!(ubyte*)(data), len, destroy);
14635 struct MemoryInputStreamClass {
14636 InputStreamClass parent_class;
14637 extern (C) void function () nothrow _g_reserved1;
14638 extern (C) void function () nothrow _g_reserved2;
14639 extern (C) void function () nothrow _g_reserved3;
14640 extern (C) void function () nothrow _g_reserved4;
14641 extern (C) void function () nothrow _g_reserved5;
14644 struct MemoryInputStreamPrivate {
14648 // #GMemoryOutputStream is a class for using arbitrary
14649 // memory chunks as output for GIO streaming output operations.
14650 struct MemoryOutputStream /* : OutputStream */ {
14651 mixin Seekable.__interface__;
14652 alias parent_instance this;
14653 alias parent_instance super_;
14654 alias parent_instance outputstream;
14655 OutputStream parent_instance;
14656 private MemoryOutputStreamPrivate* priv;
14659 // Unintrospectable constructor: new() / g_memory_output_stream_new()
14660 // Creates a new #GMemoryOutputStream.
14662 // If @data is non-%NULL, the stream will use that for its internal storage.
14663 // If @realloc_fn is non-%NULL, it will be used for resizing the internal
14664 // storage when necessary. To construct a fixed-size output stream,
14665 // pass %NULL as @realloc_fn.
14667 // |[
14668 // /&ast; a stream that can grow &ast;/
14669 // stream = g_memory_output_stream_new (NULL, 0, realloc, free);
14671 // /&ast; another stream that can grow &ast;/
14672 // stream2 = g_memory_output_stream_new (NULL, 0, g_realloc, g_free);
14674 // /&ast; a fixed-size stream &ast;/
14675 // data = malloc (200);
14676 // stream3 = g_memory_output_stream_new (data, 200, NULL, free);
14677 // ]|
14678 // RETURNS: A newly created #GMemoryOutputStream object.
14679 // <data>: pointer to a chunk of memory to use, or %NULL
14680 // <size>: the size of @data
14681 // <realloc_function>: a function with realloc() semantics (like g_realloc()) to be called when @data needs to be grown, or %NULL
14682 // <destroy_function>: a function to be called on @data when the stream is finalized, or %NULL
14683 static MemoryOutputStream* /*new*/ new_(AT0)(AT0 /*void*/ data, size_t size, ReallocFunc realloc_function, GLib2.DestroyNotify destroy_function) nothrow {
14684 return g_memory_output_stream_new(UpCast!(void*)(data), size, realloc_function, destroy_function);
14686 static auto opCall(AT0)(AT0 /*void*/ data, size_t size, ReallocFunc realloc_function, GLib2.DestroyNotify destroy_function) {
14687 return g_memory_output_stream_new(UpCast!(void*)(data), size, realloc_function, destroy_function);
14690 // Gets any loaded data from the @ostream.
14692 // Note that the returned pointer may become invalid on the next
14693 // write or truncate operation on the stream.
14694 // RETURNS: pointer to the stream's data
14695 void* get_data()() nothrow {
14696 return g_memory_output_stream_get_data(&this);
14699 // VERSION: 2.18
14700 // Returns the number of bytes from the start up
14701 // to including the last byte written in the stream
14702 // that has not been truncated away.
14703 // RETURNS: the number of bytes written to the stream
14704 size_t get_data_size()() nothrow {
14705 return g_memory_output_stream_get_data_size(&this);
14708 // Gets the size of the currently allocated data area (available from
14709 // g_memory_output_stream_get_data()). If the stream isn't
14710 // growable (no realloc was passed to g_memory_output_stream_new()) then
14711 // this is the maximum size of the stream and further writes
14712 // will return %G_IO_ERROR_NO_SPACE.
14714 // Note that for growable streams the returned size may become invalid on
14715 // the next write or truncate operation on the stream.
14717 // If you want the number of bytes currently written to the stream, use
14718 // g_memory_output_stream_get_data_size().
14719 // RETURNS: the number of bytes allocated for the data buffer
14720 size_t get_size()() nothrow {
14721 return g_memory_output_stream_get_size(&this);
14724 // VERSION: 2.26
14725 // Gets any loaded data from the @ostream. Ownership of the data
14726 // is transferred to the caller; when no longer needed it must be
14727 // freed using the free function set in @ostream's
14728 // #GMemoryOutputStream:destroy-function property.
14730 // @ostream must be closed before calling this function.
14731 // RETURNS: the stream's data
14732 void* /*new*/ steal_data()() nothrow {
14733 return g_memory_output_stream_steal_data(&this);
14737 struct MemoryOutputStreamClass {
14738 OutputStreamClass parent_class;
14739 extern (C) void function () nothrow _g_reserved1;
14740 extern (C) void function () nothrow _g_reserved2;
14741 extern (C) void function () nothrow _g_reserved3;
14742 extern (C) void function () nothrow _g_reserved4;
14743 extern (C) void function () nothrow _g_reserved5;
14746 struct MemoryOutputStreamPrivate {
14750 // #GMenu is a simple implementation of #GMenuModel.
14751 // You populate a #GMenu by adding #GMenuItem instances to it.
14753 // There are some convenience functions to allow you to directly
14754 // add items (avoiding #GMenuItem) for the common cases. To add
14755 // a regular item, use g_menu_insert(). To add a section, use
14756 // g_menu_insert_section(). To add a submenu, use
14757 // g_menu_insert_submenu().
14758 struct Menu /* : MenuModel */ /* Version 2.32 */ {
14759 alias method_parent this;
14760 alias method_parent super_;
14761 alias method_parent menumodel;
14762 MenuModel method_parent;
14765 // VERSION: 2.32
14766 // Creates a new #GMenu.
14768 // The new menu has no items.
14769 // RETURNS: a new #GMenu
14770 static Menu* /*new*/ new_()() nothrow {
14771 return g_menu_new();
14773 static auto opCall()() {
14774 return g_menu_new();
14777 // VERSION: 2.32
14778 // Convenience function for appending a normal menu item to the end of
14779 // @menu. Combine g_menu_new() and g_menu_insert_item() for a more
14780 // flexible alternative.
14781 // <label>: the section label, or %NULL
14782 // <detailed_action>: the detailed action string, or %NULL
14783 void append(AT0, AT1)(AT0 /*char*/ label=null, AT1 /*char*/ detailed_action=null) nothrow {
14784 g_menu_append(&this, toCString!(char*)(label), toCString!(char*)(detailed_action));
14787 // VERSION: 2.32
14788 // Appends @item to the end of @menu.
14790 // See g_menu_insert_item() for more information.
14791 // <item>: a #GMenuItem to append
14792 void append_item(AT0)(AT0 /*MenuItem*/ item) nothrow {
14793 g_menu_append_item(&this, UpCast!(MenuItem*)(item));
14796 // VERSION: 2.32
14797 // Convenience function for appending a section menu item to the end of
14798 // @menu. Combine g_menu_item_new_section() and g_menu_insert_item() for a
14799 // more flexible alternative.
14800 // <label>: the section label, or %NULL
14801 // <section>: a #GMenuModel with the items of the section
14802 void append_section(AT0, AT1)(AT0 /*char*/ label, AT1 /*MenuModel*/ section) nothrow {
14803 g_menu_append_section(&this, toCString!(char*)(label), UpCast!(MenuModel*)(section));
14806 // VERSION: 2.32
14807 // Convenience function for appending a submenu menu item to the end of
14808 // @menu. Combine g_menu_item_new_submenu() and g_menu_insert_item() for a
14809 // more flexible alternative.
14810 // <label>: the section label, or %NULL
14811 // <submenu>: a #GMenuModel with the items of the submenu
14812 void append_submenu(AT0, AT1)(AT0 /*char*/ label, AT1 /*MenuModel*/ submenu) nothrow {
14813 g_menu_append_submenu(&this, toCString!(char*)(label), UpCast!(MenuModel*)(submenu));
14816 // VERSION: 2.32
14817 // Marks @menu as frozen.
14819 // After the menu is frozen, it is an error to attempt to make any
14820 // changes to it. In effect this means that the #GMenu API must no
14821 // longer be used.
14823 // This function causes g_menu_model_is_mutable() to begin returning
14824 // %FALSE, which has some positive performance implications.
14825 void freeze()() nothrow {
14826 g_menu_freeze(&this);
14829 // VERSION: 2.32
14830 // Convenience function for inserting a normal menu item into @menu.
14831 // Combine g_menu_new() and g_menu_insert_item() for a more flexible
14832 // alternative.
14833 // <position>: the position at which to insert the item
14834 // <label>: the section label, or %NULL
14835 // <detailed_action>: the detailed action string, or %NULL
14836 void insert(AT0, AT1)(int position, AT0 /*char*/ label=null, AT1 /*char*/ detailed_action=null) nothrow {
14837 g_menu_insert(&this, position, toCString!(char*)(label), toCString!(char*)(detailed_action));
14840 // VERSION: 2.32
14841 // Inserts @item into @menu.
14843 // The "insertion" is actually done by copying all of the attribute and
14844 // link values of @item and using them to form a new item within @menu.
14845 // As such, @item itself is not really inserted, but rather, a menu item
14846 // that is exactly the same as the one presently described by @item.
14848 // This means that @item is essentially useless after the insertion
14849 // occurs. Any changes you make to it are ignored unless it is inserted
14850 // again (at which point its updated values will be copied).
14852 // You should probably just free @item once you're done.
14854 // There are many convenience functions to take care of common cases.
14855 // See g_menu_insert(), g_menu_insert_section() and
14856 // g_menu_insert_submenu() as well as "prepend" and "append" variants of
14857 // each of these functions.
14858 // <position>: the position at which to insert the item
14859 // <item>: the #GMenuItem to insert
14860 void insert_item(AT0)(int position, AT0 /*MenuItem*/ item) nothrow {
14861 g_menu_insert_item(&this, position, UpCast!(MenuItem*)(item));
14864 // VERSION: 2.32
14865 // Convenience function for inserting a section menu item into @menu.
14866 // Combine g_menu_item_new_section() and g_menu_insert_item() for a more
14867 // flexible alternative.
14868 // <position>: the position at which to insert the item
14869 // <label>: the section label, or %NULL
14870 // <section>: a #GMenuModel with the items of the section
14871 void insert_section(AT0, AT1)(int position, AT0 /*char*/ label, AT1 /*MenuModel*/ section) nothrow {
14872 g_menu_insert_section(&this, position, toCString!(char*)(label), UpCast!(MenuModel*)(section));
14875 // VERSION: 2.32
14876 // Convenience function for inserting a submenu menu item into @menu.
14877 // Combine g_menu_item_new_submenu() and g_menu_insert_item() for a more
14878 // flexible alternative.
14879 // <position>: the position at which to insert the item
14880 // <label>: the section label, or %NULL
14881 // <submenu>: a #GMenuModel with the items of the submenu
14882 void insert_submenu(AT0, AT1)(int position, AT0 /*char*/ label, AT1 /*MenuModel*/ submenu) nothrow {
14883 g_menu_insert_submenu(&this, position, toCString!(char*)(label), UpCast!(MenuModel*)(submenu));
14886 // VERSION: 2.32
14887 // Convenience function for prepending a normal menu item to the start
14888 // of @menu. Combine g_menu_new() and g_menu_insert_item() for a more
14889 // flexible alternative.
14890 // <label>: the section label, or %NULL
14891 // <detailed_action>: the detailed action string, or %NULL
14892 void prepend(AT0, AT1)(AT0 /*char*/ label=null, AT1 /*char*/ detailed_action=null) nothrow {
14893 g_menu_prepend(&this, toCString!(char*)(label), toCString!(char*)(detailed_action));
14896 // VERSION: 2.32
14897 // Prepends @item to the start of @menu.
14899 // See g_menu_insert_item() for more information.
14900 // <item>: a #GMenuItem to prepend
14901 void prepend_item(AT0)(AT0 /*MenuItem*/ item) nothrow {
14902 g_menu_prepend_item(&this, UpCast!(MenuItem*)(item));
14905 // VERSION: 2.32
14906 // Convenience function for prepending a section menu item to the start
14907 // of @menu. Combine g_menu_item_new_section() and g_menu_insert_item() for
14908 // a more flexible alternative.
14909 // <label>: the section label, or %NULL
14910 // <section>: a #GMenuModel with the items of the section
14911 void prepend_section(AT0, AT1)(AT0 /*char*/ label, AT1 /*MenuModel*/ section) nothrow {
14912 g_menu_prepend_section(&this, toCString!(char*)(label), UpCast!(MenuModel*)(section));
14915 // VERSION: 2.32
14916 // Convenience function for prepending a submenu menu item to the start
14917 // of @menu. Combine g_menu_item_new_submenu() and g_menu_insert_item() for
14918 // a more flexible alternative.
14919 // <label>: the section label, or %NULL
14920 // <submenu>: a #GMenuModel with the items of the submenu
14921 void prepend_submenu(AT0, AT1)(AT0 /*char*/ label, AT1 /*MenuModel*/ submenu) nothrow {
14922 g_menu_prepend_submenu(&this, toCString!(char*)(label), UpCast!(MenuModel*)(submenu));
14925 // VERSION: 2.32
14926 // Removes an item from the menu.
14928 // @position gives the index of the item to remove.
14930 // It is an error if position is not in range the range from 0 to one
14931 // less than the number of items in the menu.
14933 // It is not possible to remove items by identity since items are added
14934 // to the menu simply by copying their links and attributes (ie:
14935 // identity of the item itself is not preserved).
14936 // <position>: the position of the item to remove
14937 void remove()(int position) nothrow {
14938 g_menu_remove(&this, position);
14943 // #GMenuAttributeIter is an opaque structure type. You must access it
14944 // using the functions below.
14945 struct MenuAttributeIter /* : GObject.Object */ /* Version 2.32 */ {
14946 alias parent_instance this;
14947 alias parent_instance super_;
14948 alias parent_instance object;
14949 GObject2.Object parent_instance;
14950 MenuAttributeIterPrivate* priv;
14953 // VERSION: 2.32
14954 // Gets the name of the attribute at the current iterator position, as
14955 // a string.
14957 // The iterator is not advanced.
14958 // RETURNS: the name of the attribute
14959 char* get_name()() nothrow {
14960 return g_menu_attribute_iter_get_name(&this);
14963 // VERSION: 2.32
14964 // This function combines g_menu_attribute_iter_next() with
14965 // g_menu_attribute_iter_get_name() and g_menu_attribute_iter_get_value().
14967 // First the iterator is advanced to the next (possibly first) attribute.
14968 // If that fails, then %FALSE is returned and there are no other
14969 // effects.
14971 // If successful, @name and @value are set to the name and value of the
14972 // attribute that has just been advanced to. At this point,
14973 // g_menu_attribute_iter_get_name() and g_menu_attribute_iter_get_value() will
14974 // return the same values again.
14976 // The value returned in @name remains valid for as long as the iterator
14977 // remains at the current position. The value returned in @value must
14978 // be unreffed using g_variant_unref() when it is no longer in use.
14980 // attribute
14981 // RETURNS: %TRUE on success, or %FALSE if there is no additional
14982 // <out_name>: the type of the attribute
14983 // <value>: the attribute value
14984 int get_next(AT0, AT1)(/*out*/ AT0 /*char**/ out_name=null, /*out*/ AT1 /*GLib2.Variant**/ value=null) nothrow {
14985 return g_menu_attribute_iter_get_next(&this, toCString!(char**)(out_name), UpCast!(GLib2.Variant**)(value));
14988 // VERSION: 2.32
14989 // Gets the value of the attribute at the current iterator position.
14991 // The iterator is not advanced.
14992 // RETURNS: the value of the current attribute
14993 GLib2.Variant* /*new*/ get_value()() nothrow {
14994 return g_menu_attribute_iter_get_value(&this);
14997 // VERSION: 2.32
14998 // Attempts to advance the iterator to the next (possibly first)
14999 // attribute.
15001 // %TRUE is returned on success, or %FALSE if there are no more
15002 // attributes.
15004 // You must call this function when you first acquire the iterator
15005 // to advance it to the first attribute (and determine if the first
15006 // attribute exists at all).
15007 // RETURNS: %TRUE on success, or %FALSE when there are no more attributes
15008 int next()() nothrow {
15009 return g_menu_attribute_iter_next(&this);
15013 struct MenuAttributeIterClass {
15014 GObject2.ObjectClass parent_class;
15016 // RETURNS: %TRUE on success, or %FALSE if there is no additional
15017 // <value>: the attribute value
15018 extern (C) int function (MenuAttributeIter* iter, char** out_type, /*out*/ GLib2.Variant** value=null) nothrow get_next;
15021 struct MenuAttributeIterPrivate {
15025 // #GMenuItem is an opaque structure type. You must access it using the
15026 // functions below.
15027 struct MenuItem /* : GObject.Object */ /* Version 2.32 */ {
15028 alias method_parent this;
15029 alias method_parent super_;
15030 alias method_parent object;
15031 GObject2.Object method_parent;
15034 // VERSION: 2.32
15035 // Creates a new #GMenuItem.
15037 // If @label is non-%NULL it is used to set the "label" attribute of the
15038 // new item.
15040 // If @detailed_action is non-%NULL it is used to set the "action" and
15041 // possibly the "target" attribute of the new item. See
15042 // g_menu_item_set_detailed_action() for more information.
15043 // RETURNS: a new #GMenuItem
15044 // <label>: the section label, or %NULL
15045 // <detailed_action>: the detailed action string, or %NULL
15046 static MenuItem* /*new*/ new_(AT0, AT1)(AT0 /*char*/ label=null, AT1 /*char*/ detailed_action=null) nothrow {
15047 return g_menu_item_new(toCString!(char*)(label), toCString!(char*)(detailed_action));
15049 static auto opCall(AT0, AT1)(AT0 /*char*/ label=null, AT1 /*char*/ detailed_action=null) {
15050 return g_menu_item_new(toCString!(char*)(label), toCString!(char*)(detailed_action));
15053 // VERSION: 2.32
15054 // Creates a new #GMenuItem representing a section.
15056 // This is a convenience API around g_menu_item_new() and
15057 // g_menu_item_set_section().
15059 // The effect of having one menu appear as a section of another is
15060 // exactly as it sounds: the items from @section become a direct part of
15061 // the menu that @menu_item is added to.
15063 // Visual separation is typically displayed between two non-empty
15064 // sections. If @label is non-%NULL then it will be encorporated into
15065 // this visual indication. This allows for labeled subsections of a
15066 // menu.
15068 // As a simple example, consider a typical "Edit" menu from a simple
15069 // program. It probably contains an "Undo" and "Redo" item, followed by
15070 // a separator, followed by "Cut", "Copy" and "Paste".
15072 // This would be accomplished by creating three #GMenu instances. The
15073 // first would be populated with the "Undo" and "Redo" items, and the
15074 // second with the "Cut", "Copy" and "Paste" items. The first and
15075 // second menus would then be added as submenus of the third. In XML
15076 // format, this would look something like the following:
15078 // <informalexample><programlisting><![CDATA[
15079 // <menu id='edit-menu'>
15080 // <section>
15081 // <item label='Undo'/>
15082 // <item label='Redo'/>
15083 // </section>
15084 // <section>
15085 // <item label='Cut'/>
15086 // <item label='Copy'/>
15087 // <item label='Paste'/>
15088 // </section>
15089 // </menu>
15090 // ]]></programlisting></informalexample>
15092 // The following example is exactly equivalent. It is more illustrative
15093 // of the exact relationship between the menus and items (keeping in
15094 // mind that the 'link' element defines a new menu that is linked to the
15095 // containing one). The style of the second example is more verbose and
15096 // difficult to read (and therefore not recommended except for the
15097 // purpose of understanding what is really going on).
15099 // <informalexample><programlisting><![CDATA[
15100 // <menu id='edit-menu'>
15101 // <item>
15102 // <link name='section'>
15103 // <item label='Undo'/>
15104 // <item label='Redo'/>
15105 // </link>
15106 // </item>
15107 // <item>
15108 // <link name='section'>
15109 // <item label='Cut'/>
15110 // <item label='Copy'/>
15111 // <item label='Paste'/>
15112 // </link>
15113 // </item>
15114 // </menu>
15115 // ]]></programlisting></informalexample>
15116 // RETURNS: a new #GMenuItem
15117 // <label>: the section label, or %NULL
15118 // <section>: a #GMenuModel with the items of the section
15119 static MenuItem* /*new*/ new_section(AT0, AT1)(AT0 /*char*/ label, AT1 /*MenuModel*/ section) nothrow {
15120 return g_menu_item_new_section(toCString!(char*)(label), UpCast!(MenuModel*)(section));
15122 static auto opCall(AT0, AT1)(AT0 /*char*/ label, AT1 /*MenuModel*/ section) {
15123 return g_menu_item_new_section(toCString!(char*)(label), UpCast!(MenuModel*)(section));
15126 // VERSION: 2.32
15127 // Creates a new #GMenuItem representing a submenu.
15129 // This is a convenience API around g_menu_item_new() and
15130 // g_menu_item_set_submenu().
15131 // RETURNS: a new #GMenuItem
15132 // <label>: the section label, or %NULL
15133 // <submenu>: a #GMenuModel with the items of the submenu
15134 static MenuItem* /*new*/ new_submenu(AT0, AT1)(AT0 /*char*/ label, AT1 /*MenuModel*/ submenu) nothrow {
15135 return g_menu_item_new_submenu(toCString!(char*)(label), UpCast!(MenuModel*)(submenu));
15137 static auto opCall(AT0, AT1)(AT0 /*char*/ label, AT1 /*MenuModel*/ submenu) {
15138 return g_menu_item_new_submenu(toCString!(char*)(label), UpCast!(MenuModel*)(submenu));
15141 // Unintrospectable method: set_action_and_target() / g_menu_item_set_action_and_target()
15142 // VERSION: 2.32
15143 // Sets or unsets the "action" and "target" attributes of @menu_item.
15145 // If @action is %NULL then both the "action" and "target" attributes
15146 // are unset (and @format_string is ignored along with the positional
15147 // parameters).
15149 // If @action is non-%NULL then the "action" attribute is set.
15150 // @format_string is then inspected. If it is non-%NULL then the proper
15151 // position parameters are collected to create a #GVariant instance to
15152 // use as the target value. If it is %NULL then the positional
15153 // parameters are ignored and the "target" attribute is unset.
15155 // See also g_menu_item_set_action_and_target_value() for an equivalent
15156 // call that directly accepts a #GVariant. See
15157 // g_menu_item_set_detailed_action() for a more convenient version that
15158 // works with string-typed targets.
15160 // See also g_menu_item_set_action_and_target_value() for a
15161 // description of the semantics of the action and target attributes.
15162 // <action>: the name of the action for this item
15163 // <format_string>: a GVariant format string
15164 /+ Not available -- variadic methods unsupported - use the C function directly.
15165 alias g_menu_item_set_action_and_target set_action_and_target; // Variadic
15168 // VERSION: 2.32
15169 // Sets or unsets the "action" and "target" attributes of @menu_item.
15171 // If @action is %NULL then both the "action" and "target" attributes
15172 // are unset (and @target_value is ignored).
15174 // If @action is non-%NULL then the "action" attribute is set. The
15175 // "target" attribute is then set to the value of @target_value if it is
15176 // non-%NULL or unset otherwise.
15178 // Normal menu items (ie: not submenu, section or other custom item
15179 // types) are expected to have the "action" attribute set to identify
15180 // the action that they are associated with. The state type of the
15181 // action help to determine the disposition of the menu item. See
15182 // #GAction and #GActionGroup for an overview of actions.
15184 // In general, clicking on the menu item will result in activation of
15185 // the named action with the "target" attribute given as the parameter
15186 // to the action invocation. If the "target" attribute is not set then
15187 // the action is invoked with no parameter.
15189 // If the action has no state then the menu item is usually drawn as a
15190 // plain menu item (ie: with no additional decoration).
15192 // If the action has a boolean state then the menu item is usually drawn
15193 // as a toggle menu item (ie: with a checkmark or equivalent
15194 // indication). The item should be marked as 'toggled' or 'checked'
15195 // when the boolean state is %TRUE.
15197 // If the action has a string state then the menu item is usually drawn
15198 // as a radio menu item (ie: with a radio bullet or equivalent
15199 // indication). The item should be marked as 'selected' when the string
15200 // state is equal to the value of the @target property.
15202 // See g_menu_item_set_action_and_target() or
15203 // g_menu_item_set_detailed_action() for two equivalent calls that are
15204 // probably more convenient for most uses.
15205 // <action>: the name of the action for this item
15206 // <target_value>: a #GVariant to use as the action target
15207 void set_action_and_target_value(AT0, AT1)(AT0 /*char*/ action=null, AT1 /*GLib2.Variant*/ target_value=null) nothrow {
15208 g_menu_item_set_action_and_target_value(&this, toCString!(char*)(action), UpCast!(GLib2.Variant*)(target_value));
15211 // Unintrospectable method: set_attribute() / g_menu_item_set_attribute()
15212 // VERSION: 2.32
15213 // Sets or unsets an attribute on @menu_item.
15215 // The attribute to set or unset is specified by @attribute. This
15216 // can be one of the standard attribute names %G_MENU_ATTRIBUTE_LABEL,
15217 // %G_MENU_ATTRIBUTE_ACTION, %G_MENU_ATTRIBUTE_TARGET, or a custom
15218 // attribute name.
15219 // Attribute names are restricted to lowercase characters, numbers
15220 // and '-'. Furthermore, the names must begin with a lowercase character,
15221 // must not end with a '-', and must not contain consecutive dashes.
15223 // If @format_string is non-%NULL then the proper position parameters
15224 // are collected to create a #GVariant instance to use as the attribute
15225 // value. If it is %NULL then the positional parameterrs are ignored
15226 // and the named attribute is unset.
15228 // See also g_menu_item_set_attribute_value() for an equivalent call
15229 // that directly accepts a #GVariant.
15230 // <attribute>: the attribute to set
15231 // <format_string>: a #GVariant format string, or %NULL
15232 /+ Not available -- variadic methods unsupported - use the C function directly.
15233 alias g_menu_item_set_attribute set_attribute; // Variadic
15236 // VERSION: 2.32
15237 // Sets or unsets an attribute on @menu_item.
15239 // The attribute to set or unset is specified by @attribute. This
15240 // can be one of the standard attribute names %G_MENU_ATTRIBUTE_LABEL,
15241 // %G_MENU_ATTRIBUTE_ACTION, %G_MENU_ATTRIBUTE_TARGET, or a custom
15242 // attribute name.
15243 // Attribute names are restricted to lowercase characters, numbers
15244 // and '-'. Furthermore, the names must begin with a lowercase character,
15245 // must not end with a '-', and must not contain consecutive dashes.
15247 // must consist only of lowercase
15248 // ASCII characters, digits and '-'.
15250 // If @value is non-%NULL then it is used as the new value for the
15251 // attribute. If @value is %NULL then the attribute is unset. If
15252 // the @value #GVariant is floating, it is consumed.
15254 // See also g_menu_item_set_attribute() for a more convenient way to do
15255 // the same.
15256 // <attribute>: the attribute to set
15257 // <value>: a #GVariant to use as the value, or %NULL
15258 void set_attribute_value(AT0, AT1)(AT0 /*char*/ attribute, AT1 /*GLib2.Variant*/ value=null) nothrow {
15259 g_menu_item_set_attribute_value(&this, toCString!(char*)(attribute), UpCast!(GLib2.Variant*)(value));
15262 // VERSION: 2.32
15263 // Sets the "action" and possibly the "target" attribute of @menu_item.
15265 // If @detailed_action contains a double colon ("::") then it is used as
15266 // a separator between an action name and a target string. In this
15267 // case, this call is equivalent to calling
15268 // g_menu_item_set_action_and_target() with the part before the "::" and
15269 // with a string-type #GVariant containing the part following the "::".
15271 // If @detailed_action doesn't contain "::" then the action is set to
15272 // the given string (verbatim) and the target value is unset.
15274 // See g_menu_item_set_action_and_target() or
15275 // g_menu_item_set_action_and_target_value() for more flexible (but
15276 // slightly less convenient) alternatives.
15278 // See also g_menu_item_set_action_and_target_value() for a description of
15279 // the semantics of the action and target attributes.
15280 // <detailed_action>: the "detailed" action string
15281 void set_detailed_action(AT0)(AT0 /*char*/ detailed_action) nothrow {
15282 g_menu_item_set_detailed_action(&this, toCString!(char*)(detailed_action));
15285 // VERSION: 2.32
15286 // Sets or unsets the "label" attribute of @menu_item.
15288 // If @label is non-%NULL it is used as the label for the menu item. If
15289 // it is %NULL then the label attribute is unset.
15290 // <label>: the label to set, or %NULL to unset
15291 void set_label(AT0)(AT0 /*char*/ label=null) nothrow {
15292 g_menu_item_set_label(&this, toCString!(char*)(label));
15295 // VERSION: 2.32
15296 // Creates a link from @menu_item to @model if non-%NULL, or unsets it.
15298 // Links are used to establish a relationship between a particular menu
15299 // item and another menu. For example, %G_MENU_LINK_SUBMENU is used to
15300 // associate a submenu with a particular menu item, and %G_MENU_LINK_SECTION
15301 // is used to create a section. Other types of link can be used, but there
15302 // is no guarantee that clients will be able to make sense of them.
15303 // Link types are restricted to lowercase characters, numbers
15304 // and '-'. Furthermore, the names must begin with a lowercase character,
15305 // must not end with a '-', and must not contain consecutive dashes.
15306 // <link>: type of link to establish or unset
15307 // <model>: the #GMenuModel to link to (or %NULL to unset)
15308 void set_link(AT0, AT1)(AT0 /*char*/ link, AT1 /*MenuModel*/ model=null) nothrow {
15309 g_menu_item_set_link(&this, toCString!(char*)(link), UpCast!(MenuModel*)(model));
15312 // VERSION: 2.32
15313 // Sets or unsets the "section" link of @menu_item to @section.
15315 // The effect of having one menu appear as a section of another is
15316 // exactly as it sounds: the items from @section become a direct part of
15317 // the menu that @menu_item is added to. See g_menu_item_new_section()
15318 // for more information about what it means for a menu item to be a
15319 // section.
15320 // <section>: a #GMenuModel, or %NULL
15321 void set_section(AT0)(AT0 /*MenuModel*/ section=null) nothrow {
15322 g_menu_item_set_section(&this, UpCast!(MenuModel*)(section));
15325 // VERSION: 2.32
15326 // Sets or unsets the "submenu" link of @menu_item to @submenu.
15328 // If @submenu is non-%NULL, it is linked to. If it is %NULL then the
15329 // link is unset.
15331 // The effect of having one menu appear as a submenu of another is
15332 // exactly as it sounds.
15333 // <submenu>: a #GMenuModel, or %NULL
15334 void set_submenu(AT0)(AT0 /*MenuModel*/ submenu=null) nothrow {
15335 g_menu_item_set_submenu(&this, UpCast!(MenuModel*)(submenu));
15340 // #GMenuLinkIter is an opaque structure type. You must access it using
15341 // the functions below.
15342 struct MenuLinkIter /* : GObject.Object */ /* Version 2.32 */ {
15343 alias parent_instance this;
15344 alias parent_instance super_;
15345 alias parent_instance object;
15346 GObject2.Object parent_instance;
15347 MenuLinkIterPrivate* priv;
15350 // VERSION: 2.32
15351 // Gets the name of the link at the current iterator position.
15353 // The iterator is not advanced.
15354 // RETURNS: the type of the link
15355 char* get_name()() nothrow {
15356 return g_menu_link_iter_get_name(&this);
15359 // VERSION: 2.32
15360 // This function combines g_menu_link_iter_next() with
15361 // g_menu_link_iter_get_name() and g_menu_link_iter_get_value().
15363 // First the iterator is advanced to the next (possibly first) link.
15364 // If that fails, then %FALSE is returned and there are no other effects.
15366 // If successful, @out_link and @value are set to the name and #GMenuModel
15367 // of the link that has just been advanced to. At this point,
15368 // g_menu_link_iter_get_name() and g_menu_link_iter_get_value() will return the
15369 // same values again.
15371 // The value returned in @out_link remains valid for as long as the iterator
15372 // remains at the current position. The value returned in @value must
15373 // be unreffed using g_object_unref() when it is no longer in use.
15374 // RETURNS: %TRUE on success, or %FALSE if there is no additional link
15375 // <out_link>: the name of the link
15376 // <value>: the linked #GMenuModel
15377 int get_next(AT0, AT1)(/*out*/ AT0 /*char**/ out_link=null, /*out*/ AT1 /*MenuModel**/ value=null) nothrow {
15378 return g_menu_link_iter_get_next(&this, toCString!(char**)(out_link), UpCast!(MenuModel**)(value));
15381 // VERSION: 2.32
15382 // Gets the linked #GMenuModel at the current iterator position.
15384 // The iterator is not advanced.
15385 // RETURNS: the #GMenuModel that is linked to
15386 MenuModel* /*new*/ get_value()() nothrow {
15387 return g_menu_link_iter_get_value(&this);
15390 // VERSION: 2.32
15391 // Attempts to advance the iterator to the next (possibly first)
15392 // link.
15394 // %TRUE is returned on success, or %FALSE if there are no more links.
15396 // You must call this function when you first acquire the iterator to
15397 // advance it to the first link (and determine if the first link exists
15398 // at all).
15399 // RETURNS: %TRUE on success, or %FALSE when there are no more links
15400 int next()() nothrow {
15401 return g_menu_link_iter_next(&this);
15405 struct MenuLinkIterClass {
15406 GObject2.ObjectClass parent_class;
15408 // RETURNS: %TRUE on success, or %FALSE if there is no additional link
15409 // <value>: the linked #GMenuModel
15410 extern (C) int function (MenuLinkIter* iter, char** out_name, /*out*/ MenuModel** value=null) nothrow get_next;
15413 struct MenuLinkIterPrivate {
15417 // #GMenuModel represents the contents of a menu -- an ordered list of
15418 // menu items. The items are associated with actions, which can be
15419 // activated through them. Items can be grouped in sections, and may
15420 // have submenus associated with them. Both items and sections usually
15421 // have some representation data, such as labels or icons. The type of
15422 // the associated action (ie whether it is stateful, and what kind of
15423 // state it has) can influence the representation of the item.
15425 // The conceptual model of menus in #GMenuModel is hierarchical:
15426 // sections and submenus are again represented by #GMenuModels.
15427 // Menus themselves do not define their own roles. Rather, the role
15428 // of a particular #GMenuModel is defined by the item that references
15429 // it (or, in the case of the 'root' menu, is defined by the context
15430 // in which it is used).
15432 // As an example, consider the visible portions of the menu in
15433 // <xref linkend="menu-example"/>.
15435 // <figure id="menu-example">
15436 // <title>An example menu</title>
15437 // <graphic fileref="menu-example.png" format="PNG"></graphic>
15438 // </figure>
15440 // There are 8 "menus" visible in the screenshot: one menubar, two
15441 // submenus and 5 sections:
15442 // <itemizedlist>
15443 // <listitem>the toplevel menubar (containing 4 items)</listitem>
15444 // <listitem>the View submenu (containing 3 sections)</listitem>
15445 // <listitem>the first section of the View submenu (containing 2 items)</listitem>
15446 // <listitem>the second section of the View submenu (containing 1 item)</listitem>
15447 // <listitem>the final section of the View submenu (containing 1 item)</listitem>
15448 // <listitem>the Highlight Mode submenu (containing 2 sections)</listitem>
15449 // <listitem>the Sources section (containing 2 items)</listitem>
15450 // <listitem>the Markup section (containing 2 items)</listitem>
15451 // </itemizedlist>
15453 // <xref linkend="menu-model"/> illustrates the conceptual connection between
15454 // these 8 menus. Each large block in the figure represents a menu and the
15455 // smaller blocks within the large block represent items in that menu. Some
15456 // items contain references to other menus.
15458 // <figure id="menu-model">
15459 // <title>A menu model</title>
15460 // <graphic fileref="menu-model.png" format="PNG"></graphic>
15461 // </figure>
15463 // Notice that the separators visible in <xref linkend="menu-example"/>
15464 // appear nowhere in <xref linkend="menu-model"/>. This is because
15465 // separators are not explicitly represented in the menu model. Instead,
15466 // a separator is inserted between any two non-empty sections of a menu.
15467 // Section items can have labels just like any other item. In that case,
15468 // a display system may show a section header instead of a separator.
15470 // The motivation for this abstract model of application controls is
15471 // that modern user interfaces tend to make these controls available
15472 // outside the application. Examples include global menus, jumplists,
15473 // dash boards, etc. To support such uses, it is necessary to 'export'
15474 // information about actions and their representation in menus, which
15475 // is exactly what the
15476 // <link linkend="gio-GActionGroup-exporter">GActionGroup exporter</link>
15477 // and the
15478 // <link linkend="gio-GMenuModel-exporter">GMenuModel exporter</link>
15479 // do for #GActionGroup and #GMenuModel. The client-side counterparts
15480 // to make use of the exported information are #GDBusActionGroup and
15481 // #GDBusMenuModel.
15483 // The API of #GMenuModel is very generic, with iterators for the
15484 // attributes and links of an item, see g_menu_model_iterate_item_attributes()
15485 // and g_menu_model_iterate_item_links(). The 'standard' attributes and
15486 // link types have predefined names: %G_MENU_ATTRIBUTE_LABEL,
15487 // %G_MENU_ATTRIBUTE_ACTION, %G_MENU_ATTRIBUTE_TARGET, %G_MENU_LINK_SECTION
15488 // and %G_MENU_LINK_SUBMENU.
15490 // Items in a #GMenuModel represent active controls if they refer to
15491 // an action that can get activated when the user interacts with the
15492 // menu item. The reference to the action is encoded by the string id
15493 // in the %G_MENU_ATTRIBUTE_ACTION attribute. An action id uniquely
15494 // identifies an action in an action group. Which action group(s) provide
15495 // actions depends on the context in which the menu model is used.
15496 // E.g. when the model is exported as the application menu of a
15497 // #GtkApplication, actions can be application-wide or window-specific
15498 // (and thus come from two different action groups). By convention, the
15499 // application-wide actions have names that start with "app.", while the
15500 // names of window-specific actions start with "win.".
15502 // While a wide variety of stateful actions is possible, the following
15503 // is the minimum that is expected to be supported by all users of exported
15504 // menu information:
15505 // <itemizedlist>
15506 // <listitem>an action with no parameter type and no state</listitem>
15507 // <listitem>an action with no parameter type and boolean state</listitem>
15508 // <listitem>an action with string parameter type and string state</listitem>
15509 // </itemizedlist>
15511 // <formalpara><title>Stateless</title>
15512 // <para>
15513 // A stateless action typically corresponds to an ordinary menu item.
15514 // </para>
15515 // <para>
15516 // Selecting such a menu item will activate the action (with no parameter).
15517 // </para>
15518 // </formalpara>
15520 // <formalpara><title>Boolean State</title>
15521 // <para>
15522 // An action with a boolean state will most typically be used with a "toggle"
15523 // or "switch" menu item. The state can be set directly, but activating the
15524 // action (with no parameter) results in the state being toggled.
15525 // </para>
15526 // <para>
15527 // Selecting a toggle menu item will activate the action. The menu item should
15528 // be rendered as "checked" when the state is true.
15529 // </para>
15530 // </formalpara>
15532 // <formalpara><title>String Parameter and State</title>
15533 // <para>
15534 // Actions with string parameters and state will most typically be used to
15535 // represent an enumerated choice over the items available for a group of
15536 // radio menu items. Activating the action with a string parameter is
15537 // equivalent to setting that parameter as the state.
15538 // </para>
15539 // <para>
15540 // Radio menu items, in addition to being associated with the action, will
15541 // have a target value. Selecting that menu item will result in activation
15542 // of the action with the target value as the parameter. The menu item should
15543 // be rendered as "selected" when the state of the action is equal to the
15544 // target value of the menu item.
15545 // </para>
15546 // </formalpara>
15547 struct MenuModel /* : GObject.Object */ /* Version 2.32 */ {
15548 alias parent_instance this;
15549 alias parent_instance super_;
15550 alias parent_instance object;
15551 GObject2.Object parent_instance;
15552 MenuModelPrivate* priv;
15555 // Unintrospectable method: get_item_attribute() / g_menu_model_get_item_attribute()
15556 // VERSION: 2.32
15557 // Queries item at position @item_index in @model for the attribute
15558 // specified by @attribute.
15560 // If the attribute exists and matches the #GVariantType corresponding
15561 // to @format_string then @format_string is used to deconstruct the
15562 // value into the positional parameters and %TRUE is returned.
15564 // If the attribute does not exist, or it does exist but has the wrong
15565 // type, then the positional parameters are ignored and %FALSE is
15566 // returned.
15568 // type
15569 // RETURNS: %TRUE if the named attribute was found with the expected
15570 // <item_index>: the index of the item
15571 // <attribute>: the attribute to query
15572 // <format_string>: a #GVariant format string
15573 /+ Not available -- variadic methods unsupported - use the C function directly.
15574 alias g_menu_model_get_item_attribute get_item_attribute; // Variadic
15577 // VERSION: 2.32
15578 // Queries the item at position @item_index in @model for the attribute
15579 // specified by @attribute.
15581 // If @expected_type is non-%NULL then it specifies the expected type of
15582 // the attribute. If it is %NULL then any type will be accepted.
15584 // If the attribute exists and matches @expected_type (or if the
15585 // expected type is unspecified) then the value is returned.
15587 // If the attribute does not exist, or does not match the expected type
15588 // then %NULL is returned.
15589 // RETURNS: the value of the attribute
15590 // <item_index>: the index of the item
15591 // <attribute>: the attribute to query
15592 // <expected_type>: the expected type of the attribute, or %NULL
15593 GLib2.Variant* /*new*/ get_item_attribute_value(AT0, AT1)(int item_index, AT0 /*char*/ attribute, AT1 /*GLib2.VariantType*/ expected_type=null) nothrow {
15594 return g_menu_model_get_item_attribute_value(&this, item_index, toCString!(char*)(attribute), UpCast!(GLib2.VariantType*)(expected_type));
15597 // VERSION: 2.32
15598 // Queries the item at position @item_index in @model for the link
15599 // specified by @link.
15601 // If the link exists, the linked #GMenuModel is returned. If the link
15602 // does not exist, %NULL is returned.
15603 // RETURNS: the linked #GMenuModel, or %NULL
15604 // <item_index>: the index of the item
15605 // <link>: the link to query
15606 MenuModel* /*new*/ get_item_link(AT0)(int item_index, AT0 /*char*/ link) nothrow {
15607 return g_menu_model_get_item_link(&this, item_index, toCString!(char*)(link));
15610 // VERSION: 2.32
15611 // Query the number of items in @model.
15612 // RETURNS: the number of items
15613 int get_n_items()() nothrow {
15614 return g_menu_model_get_n_items(&this);
15617 // VERSION: 2.32
15618 // Queries if @model is mutable.
15620 // An immutable #GMenuModel will never emit the #GMenuModel::items-changed
15621 // signal. Consumers of the model may make optimisations accordingly.
15623 // emitted).
15624 // RETURNS: %TRUE if the model is mutable (ie: "items-changed" may be
15625 int is_mutable()() nothrow {
15626 return g_menu_model_is_mutable(&this);
15629 // VERSION: 2.32
15630 // Requests emission of the #GMenuModel::items-changed signal on @model.
15632 // This function should never be called except by #GMenuModel
15633 // subclasses. Any other calls to this function will very likely lead
15634 // to a violation of the interface of the model.
15636 // The implementation should update its internal representation of the
15637 // menu before emitting the signal. The implementation should further
15638 // expect to receive queries about the new state of the menu (and
15639 // particularly added menu items) while signal handlers are running.
15641 // The implementation must dispatch this call directly from a mainloop
15642 // entry and not in response to calls -- particularly those from the
15643 // #GMenuModel API. Said another way: the menu must not change while
15644 // user code is running without returning to the mainloop.
15645 // <position>: the position of the change
15646 // <removed>: the number of items removed
15647 // <added>: the number of items added
15648 void items_changed()(int position, int removed, int added) nothrow {
15649 g_menu_model_items_changed(&this, position, removed, added);
15652 // VERSION: 2.32
15653 // Creates a #GMenuAttributeIter to iterate over the attributes of
15654 // the item at position @item_index in @model.
15656 // You must free the iterator with g_object_unref() when you are done.
15657 // RETURNS: a new #GMenuAttributeIter
15658 // <item_index>: the index of the item
15659 MenuAttributeIter* /*new*/ iterate_item_attributes()(int item_index) nothrow {
15660 return g_menu_model_iterate_item_attributes(&this, item_index);
15663 // VERSION: 2.32
15664 // Creates a #GMenuLinkIter to iterate over the links of the item at
15665 // position @item_index in @model.
15667 // You must free the iterator with g_object_unref() when you are done.
15668 // RETURNS: a new #GMenuLinkIter
15669 // <item_index>: the index of the item
15670 MenuLinkIter* /*new*/ iterate_item_links()(int item_index) nothrow {
15671 return g_menu_model_iterate_item_links(&this, item_index);
15674 // Emitted when a change has occured to the menu.
15676 // The only changes that can occur to a menu is that items are removed
15677 // or added. Items may not change (except by being removed and added
15678 // back in the same location). This signal is capable of describing
15679 // both of those changes (at the same time).
15681 // The signal means that starting at the index @position, @removed
15682 // items were removed and @added items were added in their place. If
15683 // @removed is zero then only items were added. If @added is zero
15684 // then only items were removed.
15686 // As an example, if the menu contains items a, b, c, d (in that
15687 // order) and the signal (2, 1, 3) occurs then the new composition of
15688 // the menu will be a, b, _, _, _, d (with each _ representing some
15689 // new item).
15691 // Signal handlers may query the model (particularly the added items)
15692 // and expect to see the results of the modification that is being
15693 // reported. The signal is emitted after the modification.
15694 // <position>: the position of the change
15695 // <removed>: the number of items removed
15696 // <added>: the number of items added
15697 extern (C) alias static void function (MenuModel* this_, int position, int removed, int added, void* user_data=null) nothrow signal_items_changed;
15699 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
15700 return super_.signal_connect!name(cb, data, cf);
15703 ulong signal_connect(string name:"items-changed", CB/*:signal_items_changed*/)
15704 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
15705 if (is(typeof(cb)==signal_items_changed)||_ttmm!(CB, signal_items_changed)()) {
15706 return signal_connect_data!()(&this, cast(char*)"items-changed",
15707 cast(GObject2.Callback)cb, data, null, cf);
15711 struct MenuModelClass {
15712 GObject2.ObjectClass parent_class;
15713 // RETURNS: %TRUE if the model is mutable (ie: "items-changed" may be
15714 extern (C) int function (MenuModel* model) nothrow is_mutable;
15715 // RETURNS: the number of items
15716 extern (C) int function (MenuModel* model) nothrow get_n_items;
15717 extern (C) void function (MenuModel* model, int item_index, GLib2.HashTable** attributes) nothrow get_item_attributes;
15719 // RETURNS: a new #GMenuAttributeIter
15720 // <item_index>: the index of the item
15721 extern (C) MenuAttributeIter* /*new*/ function (MenuModel* model, int item_index) nothrow iterate_item_attributes;
15723 // RETURNS: the value of the attribute
15724 // <item_index>: the index of the item
15725 // <attribute>: the attribute to query
15726 // <expected_type>: the expected type of the attribute, or %NULL
15727 extern (C) GLib2.Variant* /*new*/ function (MenuModel* model, int item_index, char* attribute, GLib2.VariantType* expected_type=null) nothrow get_item_attribute_value;
15728 extern (C) void function (MenuModel* model, int item_index, GLib2.HashTable** links) nothrow get_item_links;
15730 // RETURNS: a new #GMenuLinkIter
15731 // <item_index>: the index of the item
15732 extern (C) MenuLinkIter* /*new*/ function (MenuModel* model, int item_index) nothrow iterate_item_links;
15734 // RETURNS: the linked #GMenuModel, or %NULL
15735 // <item_index>: the index of the item
15736 // <link>: the link to query
15737 extern (C) MenuModel* /*new*/ function (MenuModel* model, int item_index, char* link) nothrow get_item_link;
15740 struct MenuModelPrivate {
15744 // The #GMount interface represents user-visible mounts. Note, when
15745 // porting from GnomeVFS, #GMount is the moral equivalent of #GnomeVFSVolume.
15747 // #GMount is a "mounted" filesystem that you can access. Mounted is in
15748 // quotes because it's not the same as a unix mount, it might be a gvfs
15749 // mount, but you can still access the files on it if you use GIO. Might or
15750 // might not be related to a volume object.
15752 // Unmounting a #GMount instance is an asynchronous operation. For
15753 // more information about asynchronous operations, see #GAsyncResult
15754 // and #GSimpleAsyncResult. To unmount a #GMount instance, first call
15755 // g_mount_unmount_with_operation() with (at least) the #GMount instance and a
15756 // #GAsyncReadyCallback. The callback will be fired when the
15757 // operation has resolved (either with success or failure), and a
15758 // #GAsyncReady structure will be passed to the callback. That
15759 // callback should then call g_mount_unmount_with_operation_finish() with the #GMount
15760 // and the #GAsyncReady data to see if the operation was completed
15761 // successfully. If an @error is present when g_mount_unmount_with_operation_finish()
15762 // is called, then it will be filled with any error information.
15763 struct Mount /* Interface */ {
15764 mixin template __interface__() {
15765 // Checks if @mount can be eject.
15766 // RETURNS: %TRUE if the @mount can be ejected.
15767 int can_eject()() nothrow {
15768 return g_mount_can_eject(cast(Mount*)&this);
15771 // Checks if @mount can be mounted.
15772 // RETURNS: %TRUE if the @mount can be unmounted.
15773 int can_unmount()() nothrow {
15774 return g_mount_can_unmount(cast(Mount*)&this);
15777 // DEPRECATED (v2.22) method: eject - Use g_mount_eject_with_operation() instead.
15778 // Ejects a mount. This is an asynchronous operation, and is
15779 // finished by calling g_mount_eject_finish() with the @mount
15780 // and #GAsyncResult data returned in the @callback.
15781 // <flags>: flags affecting the unmount if required for eject
15782 // <cancellable>: optional #GCancellable object, %NULL to ignore.
15783 // <callback>: a #GAsyncReadyCallback, or %NULL.
15784 // <user_data>: user data passed to @callback.
15785 void eject(AT0, AT1)(MountUnmountFlags flags, AT0 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT1 /*void*/ user_data) nothrow {
15786 g_mount_eject(cast(Mount*)&this, flags, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
15789 // DEPRECATED (v2.22) method: eject_finish - Use g_mount_eject_with_operation_finish() instead.
15790 // Finishes ejecting a mount. If any errors occurred during the operation,
15791 // @error will be set to contain the errors and %FALSE will be returned.
15792 // RETURNS: %TRUE if the mount was successfully ejected. %FALSE otherwise.
15793 // <result>: a #GAsyncResult.
15794 int eject_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
15795 return g_mount_eject_finish(cast(Mount*)&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
15798 // VERSION: 2.22
15799 // Ejects a mount. This is an asynchronous operation, and is
15800 // finished by calling g_mount_eject_with_operation_finish() with the @mount
15801 // and #GAsyncResult data returned in the @callback.
15802 // <flags>: flags affecting the unmount if required for eject
15803 // <mount_operation>: a #GMountOperation or %NULL to avoid user interaction.
15804 // <cancellable>: optional #GCancellable object, %NULL to ignore.
15805 // <callback>: a #GAsyncReadyCallback, or %NULL.
15806 // <user_data>: user data passed to @callback.
15807 void eject_with_operation(AT0, AT1, AT2)(MountUnmountFlags flags, AT0 /*MountOperation*/ mount_operation, AT1 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT2 /*void*/ user_data) nothrow {
15808 g_mount_eject_with_operation(cast(Mount*)&this, flags, UpCast!(MountOperation*)(mount_operation), UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
15811 // VERSION: 2.22
15812 // Finishes ejecting a mount. If any errors occurred during the operation,
15813 // @error will be set to contain the errors and %FALSE will be returned.
15814 // RETURNS: %TRUE if the mount was successfully ejected. %FALSE otherwise.
15815 // <result>: a #GAsyncResult.
15816 int eject_with_operation_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
15817 return g_mount_eject_with_operation_finish(cast(Mount*)&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
15820 // Gets the default location of @mount. The default location of the given
15821 // @mount is a path that reflects the main entry point for the user (e.g.
15822 // the home directory, or the root of the volume).
15824 // The returned object should be unreffed with
15825 // g_object_unref() when no longer needed.
15826 // RETURNS: a #GFile.
15827 File* /*new*/ get_default_location()() nothrow {
15828 return g_mount_get_default_location(cast(Mount*)&this);
15831 // Gets the drive for the @mount.
15833 // This is a convenience method for getting the #GVolume and then
15834 // using that object to get the #GDrive.
15836 // The returned object should be unreffed with
15837 // g_object_unref() when no longer needed.
15838 // RETURNS: a #GDrive or %NULL if @mount is not associated with a volume or a drive.
15839 Drive* /*new*/ get_drive()() nothrow {
15840 return g_mount_get_drive(cast(Mount*)&this);
15843 // Gets the icon for @mount.
15845 // The returned object should be unreffed with
15846 // g_object_unref() when no longer needed.
15847 // RETURNS: a #GIcon.
15848 Icon* /*new*/ get_icon()() nothrow {
15849 return g_mount_get_icon(cast(Mount*)&this);
15852 // Gets the name of @mount.
15854 // The returned string should be freed with g_free()
15855 // when no longer needed.
15856 // RETURNS: the name for the given @mount.
15857 char* /*new*/ get_name()() nothrow {
15858 return g_mount_get_name(cast(Mount*)&this);
15861 // Gets the root directory on @mount.
15863 // The returned object should be unreffed with
15864 // g_object_unref() when no longer needed.
15865 // RETURNS: a #GFile.
15866 File* /*new*/ get_root()() nothrow {
15867 return g_mount_get_root(cast(Mount*)&this);
15870 // VERSION: 2.32
15871 // Gets the sort key for @mount, if any.
15872 // RETURNS: Sorting key for @mount or %NULL if no such key is available.
15873 char* get_sort_key()() nothrow {
15874 return g_mount_get_sort_key(cast(Mount*)&this);
15877 // Gets the UUID for the @mount. The reference is typically based on
15878 // the file system UUID for the mount in question and should be
15879 // considered an opaque string. Returns %NULL if there is no UUID
15880 // available.
15882 // The returned string should be freed with g_free()
15883 // when no longer needed.
15884 // RETURNS: the UUID for @mount or %NULL if no UUID can be computed.
15885 char* /*new*/ get_uuid()() nothrow {
15886 return g_mount_get_uuid(cast(Mount*)&this);
15889 // Gets the volume for the @mount.
15891 // The returned object should be unreffed with
15892 // g_object_unref() when no longer needed.
15893 // RETURNS: a #GVolume or %NULL if @mount is not associated with a volume.
15894 Volume* /*new*/ get_volume()() nothrow {
15895 return g_mount_get_volume(cast(Mount*)&this);
15898 // VERSION: 2.18
15899 // Tries to guess the type of content stored on @mount. Returns one or
15900 // more textual identifiers of well-known content types (typically
15901 // prefixed with "x-content/"), e.g. x-content/image-dcf for camera
15902 // memory cards. See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
15903 // specification for more on x-content types.
15905 // This is an asynchronous operation (see
15906 // g_mount_guess_content_type_sync() for the synchronous version), and
15907 // is finished by calling g_mount_guess_content_type_finish() with the
15908 // @mount and #GAsyncResult data returned in the @callback.
15909 // <force_rescan>: Whether to force a rescan of the content. Otherwise a cached result will be used if available
15910 // <cancellable>: optional #GCancellable object, %NULL to ignore
15911 // <callback>: a #GAsyncReadyCallback
15912 // <user_data>: user data passed to @callback
15913 void guess_content_type(AT0, AT1)(int force_rescan, AT0 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT1 /*void*/ user_data) nothrow {
15914 g_mount_guess_content_type(cast(Mount*)&this, force_rescan, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
15917 // VERSION: 2.18
15918 // Finishes guessing content types of @mount. If any errors occurred
15919 // during the operation, @error will be set to contain the errors and
15920 // %FALSE will be returned. In particular, you may get an
15921 // %G_IO_ERROR_NOT_SUPPORTED if the mount does not support content
15922 // guessing.
15924 // Caller should free this array with g_strfreev() when done with it.
15925 // RETURNS: a %NULL-terminated array of content types or %NULL on error.
15926 // <result>: a #GAsyncResult
15927 char** /*new*/ guess_content_type_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
15928 return g_mount_guess_content_type_finish(cast(Mount*)&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
15931 // VERSION: 2.18
15932 // Tries to guess the type of content stored on @mount. Returns one or
15933 // more textual identifiers of well-known content types (typically
15934 // prefixed with "x-content/"), e.g. x-content/image-dcf for camera
15935 // memory cards. See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
15936 // specification for more on x-content types.
15938 // This is an synchronous operation and as such may block doing IO;
15939 // see g_mount_guess_content_type() for the asynchronous version.
15941 // Caller should free this array with g_strfreev() when done with it.
15942 // RETURNS: a %NULL-terminated array of content types or %NULL on error.
15943 // <force_rescan>: Whether to force a rescan of the content. Otherwise a cached result will be used if available
15944 // <cancellable>: optional #GCancellable object, %NULL to ignore
15945 char** /*new*/ guess_content_type_sync(AT0, AT1)(int force_rescan, AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
15946 return g_mount_guess_content_type_sync(cast(Mount*)&this, force_rescan, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
15949 // VERSION: 2.20
15950 // Determines if @mount is shadowed. Applications or libraries should
15951 // avoid displaying @mount in the user interface if it is shadowed.
15953 // A mount is said to be shadowed if there exists one or more user
15954 // visible objects (currently #GMount objects) with a root that is
15955 // inside the root of @mount.
15957 // One application of shadow mounts is when exposing a single file
15958 // system that is used to address several logical volumes. In this
15959 // situation, a #GVolumeMonitor implementation would create two
15960 // #GVolume objects (for example, one for the camera functionality of
15961 // the device and one for a SD card reader on the device) with
15962 // activation URIs <literal>gphoto2://[usb:001,002]/store1/</literal>
15963 // and <literal>gphoto2://[usb:001,002]/store2/</literal>. When the
15964 // underlying mount (with root
15965 // <literal>gphoto2://[usb:001,002]/</literal>) is mounted, said
15966 // #GVolumeMonitor implementation would create two #GMount objects
15967 // (each with their root matching the corresponding volume activation
15968 // root) that would shadow the original mount.
15970 // The proxy monitor in GVfs 2.26 and later, automatically creates and
15971 // manage shadow mounts (and shadows the underlying mount) if the
15972 // activation root on a #GVolume is set.
15973 // RETURNS: %TRUE if @mount is shadowed.
15974 int is_shadowed()() nothrow {
15975 return g_mount_is_shadowed(cast(Mount*)&this);
15978 // Remounts a mount. This is an asynchronous operation, and is
15979 // finished by calling g_mount_remount_finish() with the @mount
15980 // and #GAsyncResults data returned in the @callback.
15982 // Remounting is useful when some setting affecting the operation
15983 // of the volume has been changed, as these may need a remount to
15984 // take affect. While this is semantically equivalent with unmounting
15985 // and then remounting not all backends might need to actually be
15986 // unmounted.
15987 // <flags>: flags affecting the operation
15988 // <mount_operation>: a #GMountOperation or %NULL to avoid user interaction.
15989 // <cancellable>: optional #GCancellable object, %NULL to ignore.
15990 // <callback>: a #GAsyncReadyCallback, or %NULL.
15991 // <user_data>: user data passed to @callback.
15992 void remount(AT0, AT1, AT2)(MountMountFlags flags, AT0 /*MountOperation*/ mount_operation, AT1 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT2 /*void*/ user_data) nothrow {
15993 g_mount_remount(cast(Mount*)&this, flags, UpCast!(MountOperation*)(mount_operation), UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
15996 // Finishes remounting a mount. If any errors occurred during the operation,
15997 // @error will be set to contain the errors and %FALSE will be returned.
15998 // RETURNS: %TRUE if the mount was successfully remounted. %FALSE otherwise.
15999 // <result>: a #GAsyncResult.
16000 int remount_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
16001 return g_mount_remount_finish(cast(Mount*)&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
16004 // VERSION: 2.20
16005 // Increments the shadow count on @mount. Usually used by
16006 // #GVolumeMonitor implementations when creating a shadow mount for
16007 // @mount, see g_mount_is_shadowed() for more information. The caller
16008 // will need to emit the #GMount::changed signal on @mount manually.
16009 void shadow()() nothrow {
16010 g_mount_shadow(cast(Mount*)&this);
16013 // DEPRECATED (v2.22) method: unmount - Use g_mount_unmount_with_operation() instead.
16014 // Unmounts a mount. This is an asynchronous operation, and is
16015 // finished by calling g_mount_unmount_finish() with the @mount
16016 // and #GAsyncResult data returned in the @callback.
16017 // <flags>: flags affecting the operation
16018 // <cancellable>: optional #GCancellable object, %NULL to ignore.
16019 // <callback>: a #GAsyncReadyCallback, or %NULL.
16020 // <user_data>: user data passed to @callback.
16021 void unmount(AT0, AT1)(MountUnmountFlags flags, AT0 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT1 /*void*/ user_data) nothrow {
16022 g_mount_unmount(cast(Mount*)&this, flags, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
16025 // DEPRECATED (v2.22) method: unmount_finish - Use g_mount_unmount_with_operation_finish() instead.
16026 // Finishes unmounting a mount. If any errors occurred during the operation,
16027 // @error will be set to contain the errors and %FALSE will be returned.
16028 // RETURNS: %TRUE if the mount was successfully unmounted. %FALSE otherwise.
16029 // <result>: a #GAsyncResult.
16030 int unmount_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
16031 return g_mount_unmount_finish(cast(Mount*)&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
16034 // VERSION: 2.22
16035 // Unmounts a mount. This is an asynchronous operation, and is
16036 // finished by calling g_mount_unmount_with_operation_finish() with the @mount
16037 // and #GAsyncResult data returned in the @callback.
16038 // <flags>: flags affecting the operation
16039 // <mount_operation>: a #GMountOperation or %NULL to avoid user interaction.
16040 // <cancellable>: optional #GCancellable object, %NULL to ignore.
16041 // <callback>: a #GAsyncReadyCallback, or %NULL.
16042 // <user_data>: user data passed to @callback.
16043 void unmount_with_operation(AT0, AT1, AT2)(MountUnmountFlags flags, AT0 /*MountOperation*/ mount_operation, AT1 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT2 /*void*/ user_data) nothrow {
16044 g_mount_unmount_with_operation(cast(Mount*)&this, flags, UpCast!(MountOperation*)(mount_operation), UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
16047 // VERSION: 2.22
16048 // Finishes unmounting a mount. If any errors occurred during the operation,
16049 // @error will be set to contain the errors and %FALSE will be returned.
16050 // RETURNS: %TRUE if the mount was successfully unmounted. %FALSE otherwise.
16051 // <result>: a #GAsyncResult.
16052 int unmount_with_operation_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
16053 return g_mount_unmount_with_operation_finish(cast(Mount*)&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
16056 // VERSION: 2.20
16057 // Decrements the shadow count on @mount. Usually used by
16058 // #GVolumeMonitor implementations when destroying a shadow mount for
16059 // @mount, see g_mount_is_shadowed() for more information. The caller
16060 // will need to emit the #GMount::changed signal on @mount manually.
16061 void unshadow()() nothrow {
16062 g_mount_unshadow(cast(Mount*)&this);
16064 // Emitted when the mount has been changed.
16065 extern (C) alias static void function (Mount* this_, void* user_data=null) nothrow signal_changed;
16067 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
16068 return super_.signal_connect!name(cb, data, cf);
16071 ulong signal_connect(string name:"changed", CB/*:signal_changed*/)
16072 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
16073 if (is(typeof(cb)==signal_changed)||_ttmm!(CB, signal_changed)()) {
16074 return signal_connect_data!()(&this, cast(char*)"changed",
16075 cast(GObject2.Callback)cb, data, null, cf);
16078 // VERSION: 2.22
16079 // This signal is emitted when the #GMount is about to be
16080 // unmounted.
16081 extern (C) alias static void function (Mount* this_, void* user_data=null) nothrow signal_pre_unmount;
16082 ulong signal_connect(string name:"pre-unmount", CB/*:signal_pre_unmount*/)
16083 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
16084 if (is(typeof(cb)==signal_pre_unmount)||_ttmm!(CB, signal_pre_unmount)()) {
16085 return signal_connect_data!()(&this, cast(char*)"pre-unmount",
16086 cast(GObject2.Callback)cb, data, null, cf);
16089 // This signal is emitted when the #GMount have been
16090 // unmounted. If the recipient is holding references to the
16091 // object they should release them so the object can be
16092 // finalized.
16093 extern (C) alias static void function (Mount* this_, void* user_data=null) nothrow signal_unmounted;
16094 ulong signal_connect(string name:"unmounted", CB/*:signal_unmounted*/)
16095 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
16096 if (is(typeof(cb)==signal_unmounted)||_ttmm!(CB, signal_unmounted)()) {
16097 return signal_connect_data!()(&this, cast(char*)"unmounted",
16098 cast(GObject2.Callback)cb, data, null, cf);
16101 mixin __interface__;
16104 // Interface for implementing operations for mounts.
16105 struct MountIface {
16106 GObject2.TypeInterface g_iface;
16107 extern (C) void function (Mount* mount) nothrow changed;
16108 extern (C) void function (Mount* mount) nothrow unmounted;
16109 // RETURNS: a #GFile.
16110 extern (C) File* /*new*/ function (Mount* mount) nothrow get_root;
16111 // RETURNS: the name for the given @mount.
16112 extern (C) char* /*new*/ function (Mount* mount) nothrow get_name;
16113 // RETURNS: a #GIcon.
16114 extern (C) Icon* /*new*/ function (Mount* mount) nothrow get_icon;
16115 // RETURNS: the UUID for @mount or %NULL if no UUID can be computed.
16116 extern (C) char* /*new*/ function (Mount* mount) nothrow get_uuid;
16117 // RETURNS: a #GVolume or %NULL if @mount is not associated with a volume.
16118 extern (C) Volume* /*new*/ function (Mount* mount) nothrow get_volume;
16119 // RETURNS: a #GDrive or %NULL if @mount is not associated with a volume or a drive.
16120 extern (C) Drive* /*new*/ function (Mount* mount) nothrow get_drive;
16121 // RETURNS: %TRUE if the @mount can be unmounted.
16122 extern (C) int function (Mount* mount) nothrow can_unmount;
16123 // RETURNS: %TRUE if the @mount can be ejected.
16124 extern (C) int function (Mount* mount) nothrow can_eject;
16126 // <flags>: flags affecting the operation
16127 // <cancellable>: optional #GCancellable object, %NULL to ignore.
16128 // <callback>: a #GAsyncReadyCallback, or %NULL.
16129 // <user_data>: user data passed to @callback.
16130 extern (C) void function (Mount* mount, MountUnmountFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow unmount;
16132 // RETURNS: %TRUE if the mount was successfully unmounted. %FALSE otherwise.
16133 // <result>: a #GAsyncResult.
16134 extern (C) int function (Mount* mount, AsyncResult* result, GLib2.Error** error=null) nothrow unmount_finish;
16136 // <flags>: flags affecting the unmount if required for eject
16137 // <cancellable>: optional #GCancellable object, %NULL to ignore.
16138 // <callback>: a #GAsyncReadyCallback, or %NULL.
16139 // <user_data>: user data passed to @callback.
16140 extern (C) void function (Mount* mount, MountUnmountFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow eject;
16142 // RETURNS: %TRUE if the mount was successfully ejected. %FALSE otherwise.
16143 // <result>: a #GAsyncResult.
16144 extern (C) int function (Mount* mount, AsyncResult* result, GLib2.Error** error=null) nothrow eject_finish;
16146 // <flags>: flags affecting the operation
16147 // <mount_operation>: a #GMountOperation or %NULL to avoid user interaction.
16148 // <cancellable>: optional #GCancellable object, %NULL to ignore.
16149 // <callback>: a #GAsyncReadyCallback, or %NULL.
16150 // <user_data>: user data passed to @callback.
16151 extern (C) void function (Mount* mount, MountMountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow remount;
16153 // RETURNS: %TRUE if the mount was successfully remounted. %FALSE otherwise.
16154 // <result>: a #GAsyncResult.
16155 extern (C) int function (Mount* mount, AsyncResult* result, GLib2.Error** error=null) nothrow remount_finish;
16157 // <force_rescan>: Whether to force a rescan of the content. Otherwise a cached result will be used if available
16158 // <cancellable>: optional #GCancellable object, %NULL to ignore
16159 // <callback>: a #GAsyncReadyCallback
16160 // <user_data>: user data passed to @callback
16161 extern (C) void function (Mount* mount, int force_rescan, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow guess_content_type;
16163 // RETURNS: a %NULL-terminated array of content types or %NULL on error.
16164 // <result>: a #GAsyncResult
16165 extern (C) char** /*new*/ function (Mount* mount, AsyncResult* result, GLib2.Error** error=null) nothrow guess_content_type_finish;
16167 // RETURNS: a %NULL-terminated array of content types or %NULL on error.
16168 // <force_rescan>: Whether to force a rescan of the content. Otherwise a cached result will be used if available
16169 // <cancellable>: optional #GCancellable object, %NULL to ignore
16170 extern (C) char** /*new*/ function (Mount* mount, int force_rescan, Cancellable* cancellable, GLib2.Error** error=null) nothrow guess_content_type_sync;
16171 extern (C) void function (Mount* mount) nothrow pre_unmount;
16173 // <flags>: flags affecting the operation
16174 // <mount_operation>: a #GMountOperation or %NULL to avoid user interaction.
16175 // <cancellable>: optional #GCancellable object, %NULL to ignore.
16176 // <callback>: a #GAsyncReadyCallback, or %NULL.
16177 // <user_data>: user data passed to @callback.
16178 extern (C) void function (Mount* mount, MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow unmount_with_operation;
16180 // RETURNS: %TRUE if the mount was successfully unmounted. %FALSE otherwise.
16181 // <result>: a #GAsyncResult.
16182 extern (C) int function (Mount* mount, AsyncResult* result, GLib2.Error** error=null) nothrow unmount_with_operation_finish;
16184 // <flags>: flags affecting the unmount if required for eject
16185 // <mount_operation>: a #GMountOperation or %NULL to avoid user interaction.
16186 // <cancellable>: optional #GCancellable object, %NULL to ignore.
16187 // <callback>: a #GAsyncReadyCallback, or %NULL.
16188 // <user_data>: user data passed to @callback.
16189 extern (C) void function (Mount* mount, MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow eject_with_operation;
16191 // RETURNS: %TRUE if the mount was successfully ejected. %FALSE otherwise.
16192 // <result>: a #GAsyncResult.
16193 extern (C) int function (Mount* mount, AsyncResult* result, GLib2.Error** error=null) nothrow eject_with_operation_finish;
16194 // RETURNS: a #GFile.
16195 extern (C) File* /*new*/ function (Mount* mount) nothrow get_default_location;
16196 // RETURNS: Sorting key for @mount or %NULL if no such key is available.
16197 extern (C) char* function (Mount* mount) nothrow get_sort_key;
16200 // Flags used when mounting a mount.
16201 enum MountMountFlags {
16202 NONE = 0
16205 // #GMountOperation provides a mechanism for interacting with the user.
16206 // It can be used for authenticating mountable operations, such as loop
16207 // mounting files, hard drive partitions or server locations. It can
16208 // also be used to ask the user questions or show a list of applications
16209 // preventing unmount or eject operations from completing.
16211 // Note that #GMountOperation is used for more than just #GMount
16212 // objects – for example it is also used in g_drive_start() and
16213 // g_drive_stop().
16215 // Users should instantiate a subclass of this that implements all the
16216 // various callbacks to show the required dialogs, such as
16217 // #GtkMountOperation. If no user interaction is desired (for example
16218 // when automounting filesystems at login time), usually %NULL can be
16219 // passed, see each method taking a #GMountOperation for details.
16220 struct MountOperation /* : GObject.Object */ {
16221 alias parent_instance this;
16222 alias parent_instance super_;
16223 alias parent_instance object;
16224 GObject2.Object parent_instance;
16225 MountOperationPrivate* priv;
16228 // Creates a new mount operation.
16229 // RETURNS: a #GMountOperation.
16230 static MountOperation* /*new*/ new_()() nothrow {
16231 return g_mount_operation_new();
16233 static auto opCall()() {
16234 return g_mount_operation_new();
16237 // Check to see whether the mount operation is being used
16238 // for an anonymous user.
16239 // RETURNS: %TRUE if mount operation is anonymous.
16240 int get_anonymous()() nothrow {
16241 return g_mount_operation_get_anonymous(&this);
16244 // Gets a choice from the mount operation.
16246 // the choice's list, or %0.
16247 // RETURNS: an integer containing an index of the user's choice from
16248 int get_choice()() nothrow {
16249 return g_mount_operation_get_choice(&this);
16252 // Gets the domain of the mount operation.
16253 // RETURNS: a string set to the domain.
16254 char* get_domain()() nothrow {
16255 return g_mount_operation_get_domain(&this);
16258 // Gets a password from the mount operation.
16259 // RETURNS: a string containing the password within @op.
16260 char* get_password()() nothrow {
16261 return g_mount_operation_get_password(&this);
16264 // Gets the state of saving passwords for the mount operation.
16265 // RETURNS: a #GPasswordSave flag.
16266 PasswordSave get_password_save()() nothrow {
16267 return g_mount_operation_get_password_save(&this);
16270 // Get the user name from the mount operation.
16271 // RETURNS: a string containing the user name.
16272 char* get_username()() nothrow {
16273 return g_mount_operation_get_username(&this);
16276 // Emits the #GMountOperation::reply signal.
16277 // <result>: a #GMountOperationResult
16278 void reply()(MountOperationResult result) nothrow {
16279 g_mount_operation_reply(&this, result);
16282 // Sets the mount operation to use an anonymous user if @anonymous is %TRUE.
16283 // <anonymous>: boolean value.
16284 void set_anonymous()(int anonymous) nothrow {
16285 g_mount_operation_set_anonymous(&this, anonymous);
16288 // Sets a default choice for the mount operation.
16289 // <choice>: an integer.
16290 void set_choice()(int choice) nothrow {
16291 g_mount_operation_set_choice(&this, choice);
16294 // Sets the mount operation's domain.
16295 // <domain>: the domain to set.
16296 void set_domain(AT0)(AT0 /*char*/ domain) nothrow {
16297 g_mount_operation_set_domain(&this, toCString!(char*)(domain));
16300 // Sets the mount operation's password to @password.
16301 // <password>: password to set.
16302 void set_password(AT0)(AT0 /*char*/ password) nothrow {
16303 g_mount_operation_set_password(&this, toCString!(char*)(password));
16306 // Sets the state of saving passwords for the mount operation.
16307 // <save>: a set of #GPasswordSave flags.
16308 void set_password_save()(PasswordSave save) nothrow {
16309 g_mount_operation_set_password_save(&this, save);
16312 // Sets the user name within @op to @username.
16313 // <username>: input username.
16314 void set_username(AT0)(AT0 /*char*/ username) nothrow {
16315 g_mount_operation_set_username(&this, toCString!(char*)(username));
16318 // VERSION: 2.20
16319 // Emitted by the backend when e.g. a device becomes unavailable
16320 // while a mount operation is in progress.
16322 // Implementations of GMountOperation should handle this signal
16323 // by dismissing open password dialogs.
16324 extern (C) alias static void function (MountOperation* this_, void* user_data=null) nothrow signal_aborted;
16326 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
16327 return super_.signal_connect!name(cb, data, cf);
16330 ulong signal_connect(string name:"aborted", CB/*:signal_aborted*/)
16331 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
16332 if (is(typeof(cb)==signal_aborted)||_ttmm!(CB, signal_aborted)()) {
16333 return signal_connect_data!()(&this, cast(char*)"aborted",
16334 cast(GObject2.Callback)cb, data, null, cf);
16337 // Emitted when a mount operation asks the user for a password.
16339 // If the message contains a line break, the first line should be
16340 // presented as a heading. For example, it may be used as the
16341 // primary text in a #GtkMessageDialog.
16342 // <message>: string containing a message to display to the user.
16343 // <default_user>: string containing the default user name.
16344 // <default_domain>: string containing the default domain.
16345 // <flags>: a set of #GAskPasswordFlags.
16346 extern (C) alias static void function (MountOperation* this_, char* message, char* default_user, char* default_domain, AskPasswordFlags* flags, void* user_data=null) nothrow signal_ask_password;
16347 ulong signal_connect(string name:"ask-password", CB/*:signal_ask_password*/)
16348 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
16349 if (is(typeof(cb)==signal_ask_password)||_ttmm!(CB, signal_ask_password)()) {
16350 return signal_connect_data!()(&this, cast(char*)"ask-password",
16351 cast(GObject2.Callback)cb, data, null, cf);
16354 // Emitted when asking the user a question and gives a list of
16355 // choices for the user to choose from.
16357 // If the message contains a line break, the first line should be
16358 // presented as a heading. For example, it may be used as the
16359 // primary text in a #GtkMessageDialog.
16360 // <message>: string containing a message to display to the user.
16361 // <choices>: an array of strings for each possible choice.
16362 extern (C) alias static void function (MountOperation* this_, char* message, char* choices, void* user_data=null) nothrow signal_ask_question;
16363 ulong signal_connect(string name:"ask-question", CB/*:signal_ask_question*/)
16364 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
16365 if (is(typeof(cb)==signal_ask_question)||_ttmm!(CB, signal_ask_question)()) {
16366 return signal_connect_data!()(&this, cast(char*)"ask-question",
16367 cast(GObject2.Callback)cb, data, null, cf);
16370 // Emitted when the user has replied to the mount operation.
16371 // <result>: a #GMountOperationResult indicating how the request was handled
16372 extern (C) alias static void function (MountOperation* this_, MountOperationResult* result, void* user_data=null) nothrow signal_reply;
16373 ulong signal_connect(string name:"reply", CB/*:signal_reply*/)
16374 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
16375 if (is(typeof(cb)==signal_reply)||_ttmm!(CB, signal_reply)()) {
16376 return signal_connect_data!()(&this, cast(char*)"reply",
16377 cast(GObject2.Callback)cb, data, null, cf);
16380 // VERSION: 2.22
16381 // Emitted when one or more processes are blocking an operation
16382 // e.g. unmounting/ejecting a #GMount or stopping a #GDrive.
16384 // Note that this signal may be emitted several times to update the
16385 // list of blocking processes as processes close files. The
16386 // application should only respond with g_mount_operation_reply() to
16387 // the latest signal (setting #GMountOperation:choice to the choice
16388 // the user made).
16390 // If the message contains a line break, the first line should be
16391 // presented as a heading. For example, it may be used as the
16392 // primary text in a #GtkMessageDialog.
16393 // <message>: string containing a message to display to the user.
16394 // <processes>: an array of #GPid for processes blocking the operation.
16395 // <choices>: an array of strings for each possible choice.
16396 extern (C) alias static void function (MountOperation* this_, char* message, GLib2.Pid* processes, char* choices, void* user_data=null) nothrow signal_show_processes;
16397 ulong signal_connect(string name:"show-processes", CB/*:signal_show_processes*/)
16398 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
16399 if (is(typeof(cb)==signal_show_processes)||_ttmm!(CB, signal_show_processes)()) {
16400 return signal_connect_data!()(&this, cast(char*)"show-processes",
16401 cast(GObject2.Callback)cb, data, null, cf);
16405 struct MountOperationClass {
16406 GObject2.ObjectClass parent_class;
16407 extern (C) void function (MountOperation* op, char* message, char* default_user, char* default_domain, AskPasswordFlags flags) nothrow ask_password;
16408 extern (C) void function (MountOperation* op, char* message, char* choices) nothrow ask_question;
16409 // <result>: a #GMountOperationResult
16410 extern (C) void function (MountOperation* op, MountOperationResult result) nothrow reply;
16411 extern (C) void function (MountOperation* op) nothrow aborted;
16412 extern (C) void function (MountOperation* op, char* message, Array* processes, char* choices) nothrow show_processes;
16413 extern (C) void function () nothrow _g_reserved1;
16414 extern (C) void function () nothrow _g_reserved2;
16415 extern (C) void function () nothrow _g_reserved3;
16416 extern (C) void function () nothrow _g_reserved4;
16417 extern (C) void function () nothrow _g_reserved5;
16418 extern (C) void function () nothrow _g_reserved6;
16419 extern (C) void function () nothrow _g_reserved7;
16420 extern (C) void function () nothrow _g_reserved8;
16421 extern (C) void function () nothrow _g_reserved9;
16422 extern (C) void function () nothrow _g_reserved10;
16425 struct MountOperationPrivate {
16429 // #GMountOperationResult is returned as a result when a request for
16430 // information is send by the mounting operation.
16431 enum MountOperationResult {
16432 HANDLED = 0,
16433 ABORTED = 1,
16434 UNHANDLED = 2
16436 // Flags used when an unmounting a mount.
16437 enum MountUnmountFlags {
16438 NONE = 0,
16439 FORCE = 1
16441 enum NATIVE_VOLUME_MONITOR_EXTENSION_POINT_NAME = "gio-native-volume-monitor";
16442 enum NETWORK_MONITOR_EXTENSION_POINT_NAME = "gio-network-monitor";
16443 struct NativeVolumeMonitor /* : VolumeMonitor */ {
16444 alias parent_instance this;
16445 alias parent_instance super_;
16446 alias parent_instance volumemonitor;
16447 VolumeMonitor parent_instance;
16450 struct NativeVolumeMonitorClass {
16451 VolumeMonitorClass parent_class;
16452 // Unintrospectable functionp: get_mount_for_mount_path() / ()
16453 extern (C) Mount* function (char* mount_path, Cancellable* cancellable) nothrow get_mount_for_mount_path;
16457 // #GNetworkAddress provides an easy way to resolve a hostname and
16458 // then attempt to connect to that host, handling the possibility of
16459 // multiple IP addresses and multiple address families.
16461 // See #GSocketConnectable for and example of using the connectable
16462 // interface.
16463 struct NetworkAddress /* : GObject.Object */ {
16464 mixin SocketConnectable.__interface__;
16465 alias parent_instance this;
16466 alias parent_instance super_;
16467 alias parent_instance object;
16468 GObject2.Object parent_instance;
16469 private NetworkAddressPrivate* priv;
16472 // VERSION: 2.22
16473 // Creates a new #GSocketConnectable for connecting to the given
16474 // @hostname and @port.
16475 // RETURNS: the new #GNetworkAddress
16476 // <hostname>: the hostname
16477 // <port>: the port
16478 static NetworkAddress* /*new*/ new_(AT0)(AT0 /*char*/ hostname, ushort port) nothrow {
16479 return g_network_address_new(toCString!(char*)(hostname), port);
16481 static auto opCall(AT0)(AT0 /*char*/ hostname, ushort port) {
16482 return g_network_address_new(toCString!(char*)(hostname), port);
16485 // VERSION: 2.22
16486 // Creates a new #GSocketConnectable for connecting to the given
16487 // @hostname and @port. May fail and return %NULL in case
16488 // parsing @host_and_port fails.
16490 // @host_and_port may be in any of a number of recognised formats; an IPv6
16491 // address, an IPv4 address, or a domain name (in which case a DNS
16492 // lookup is performed). Quoting with [] is supported for all address
16493 // types. A port override may be specified in the usual way with a
16494 // colon.
16496 // If no port is specified in @host_and_port then @default_port will be
16497 // used as the port number to connect to.
16499 // In general, @host_and_port is expected to be provided by the user
16500 // (allowing them to give the hostname, and a port overide if necessary)
16501 // and @default_port is expected to be provided by the application.
16503 // (The port component of @host_and_port can also be specified as a
16504 // service name rather than as a numeric port, but this functionality
16505 // is deprecated, because it depends on the contents of /etc/services,
16506 // which is generally quite sparse on platforms other than Linux.)
16507 // RETURNS: the new #GNetworkAddress, or %NULL on error
16508 // <host_and_port>: the hostname and optionally a port
16509 // <default_port>: the default port if not in @host_and_port
16510 static SocketConnectable* /*new*/ parse(AT0, AT1)(AT0 /*char*/ host_and_port, ushort default_port, AT1 /*GLib2.Error**/ error=null) nothrow {
16511 return g_network_address_parse(toCString!(char*)(host_and_port), default_port, UpCast!(GLib2.Error**)(error));
16514 // VERSION: 2.26
16515 // Creates a new #GSocketConnectable for connecting to the given
16516 // @uri. May fail and return %NULL in case parsing @uri fails.
16518 // Using this rather than g_network_address_new() or
16519 // g_network_address_parse() allows #GSocketClient to determine
16520 // when to use application-specific proxy protocols.
16521 // RETURNS: the new #GNetworkAddress, or %NULL on error
16522 // <uri>: the hostname and optionally a port
16523 // <default_port>: The default port if none is found in the URI
16524 static SocketConnectable* /*new*/ parse_uri(AT0, AT1)(AT0 /*char*/ uri, ushort default_port, AT1 /*GLib2.Error**/ error=null) nothrow {
16525 return g_network_address_parse_uri(toCString!(char*)(uri), default_port, UpCast!(GLib2.Error**)(error));
16528 // VERSION: 2.22
16529 // Gets @addr's hostname. This might be either UTF-8 or ASCII-encoded,
16530 // depending on what @addr was created with.
16531 // RETURNS: @addr's hostname
16532 char* get_hostname()() nothrow {
16533 return g_network_address_get_hostname(&this);
16536 // VERSION: 2.22
16537 // Gets @addr's port number
16538 // RETURNS: @addr's port (which may be 0)
16539 ushort get_port()() nothrow {
16540 return g_network_address_get_port(&this);
16543 // VERSION: 2.26
16544 // Gets @addr's scheme
16545 // RETURNS: @addr's scheme (%NULL if not built from URI)
16546 char* get_scheme()() nothrow {
16547 return g_network_address_get_scheme(&this);
16551 struct NetworkAddressClass {
16552 GObject2.ObjectClass parent_class;
16555 struct NetworkAddressPrivate {
16559 // #GNetworkMonitor provides an easy-to-use cross-platform API
16560 // for monitoring network connectivity. On Linux, the implementation
16561 // is based on the kernels netlink interface.
16562 struct NetworkMonitor /* Interface */ /* Version 2.32 */ {
16563 mixin template __interface__() {
16564 // VERSION: 2.32
16565 // Gets the default #GNetworkMonitor for the system.
16566 // RETURNS: a #GNetworkMonitor
16567 static NetworkMonitor* get_default()() nothrow {
16568 return g_network_monitor_get_default();
16571 // VERSION: 2.32
16572 // Attempts to determine whether or not the host pointed to by
16573 // @connectable can be reached, without actually trying to connect to
16574 // it.
16576 // This may return %TRUE even when #GNetworkMonitor:network-available
16577 // is %FALSE, if, for example, @monitor can determine that
16578 // @connectable refers to a host on a local network.
16580 // If @monitor believes that an attempt to connect to @connectable
16581 // will succeed, it will return %TRUE. Otherwise, it will return
16582 // %FALSE and set @error to an appropriate error (such as
16583 // %G_IO_ERROR_HOST_UNREACHABLE).
16585 // Note that although this does not attempt to connect to
16586 // @connectable, it may still block for a brief period of time (eg,
16587 // trying to do multicast DNS on the local network), so if you do not
16588 // want to block, you should use g_network_monitor_can_reach_async().
16589 // RETURNS: %TRUE if @connectable is reachable, %FALSE if not.
16590 // <connectable>: a #GSocketConnectable
16591 // <cancellable>: a #GCancellable, or %NULL
16592 int can_reach(AT0, AT1, AT2)(AT0 /*SocketConnectable*/ connectable, AT1 /*Cancellable*/ cancellable, AT2 /*GLib2.Error**/ error=null) nothrow {
16593 return g_network_monitor_can_reach(cast(NetworkMonitor*)&this, UpCast!(SocketConnectable*)(connectable), UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
16596 // Asynchronously attempts to determine whether or not the host
16597 // pointed to by @connectable can be reached, without actually
16598 // trying to connect to it.
16600 // For more details, see g_network_monitor_can_reach().
16602 // When the operation is finished, @callback will be called.
16603 // You can then call g_network_monitor_can_reach_finish()
16604 // to get the result of the operation.
16605 // <connectable>: a #GSocketConnectable
16606 // <cancellable>: a #GCancellable, or %NULL
16607 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
16608 // <user_data>: the data to pass to callback function
16609 void can_reach_async(AT0, AT1, AT2)(AT0 /*SocketConnectable*/ connectable, AT1 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT2 /*void*/ user_data) nothrow {
16610 g_network_monitor_can_reach_async(cast(NetworkMonitor*)&this, UpCast!(SocketConnectable*)(connectable), UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
16613 // Finishes an async network connectivity test.
16614 // See g_network_monitor_can_reach_async().
16615 // RETURNS: %TRUE if network is reachable, %FALSE if not.
16616 // <result>: a #GAsyncResult
16617 int can_reach_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
16618 return g_network_monitor_can_reach_finish(cast(NetworkMonitor*)&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
16621 // VERSION: 2.32
16622 // Checks if the network is available. "Available" here means that the
16623 // system has a default route available for at least one of IPv4 or
16624 // IPv6. It does not necessarily imply that the public Internet is
16625 // reachable. See #GNetworkMonitor:network-available for more details.
16626 // RETURNS: whether the network is available
16627 int get_network_available()() nothrow {
16628 return g_network_monitor_get_network_available(cast(NetworkMonitor*)&this);
16631 // VERSION: 2.32
16632 // Emitted when the network configuration changes. If @available is
16633 // %TRUE, then some hosts may be reachable that were not reachable
16634 // before, while others that were reachable before may no longer be
16635 // reachable. If @available is %FALSE, then no remote hosts are
16636 // reachable.
16637 // <available>: the current value of #GNetworkMonitor:network-available
16638 extern (C) alias static void function (NetworkMonitor* this_, c_int available, void* user_data=null) nothrow signal_network_changed;
16640 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
16641 return super_.signal_connect!name(cb, data, cf);
16644 ulong signal_connect(string name:"network-changed", CB/*:signal_network_changed*/)
16645 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
16646 if (is(typeof(cb)==signal_network_changed)||_ttmm!(CB, signal_network_changed)()) {
16647 return signal_connect_data!()(&this, cast(char*)"network-changed",
16648 cast(GObject2.Callback)cb, data, null, cf);
16651 mixin __interface__;
16654 struct NetworkMonitorInterface {
16655 GObject2.TypeInterface g_iface;
16656 extern (C) void function (NetworkMonitor* monitor, int available) nothrow network_changed;
16658 // RETURNS: %TRUE if @connectable is reachable, %FALSE if not.
16659 // <connectable>: a #GSocketConnectable
16660 // <cancellable>: a #GCancellable, or %NULL
16661 extern (C) int function (NetworkMonitor* monitor, SocketConnectable* connectable, Cancellable* cancellable, GLib2.Error** error=null) nothrow can_reach;
16663 // <connectable>: a #GSocketConnectable
16664 // <cancellable>: a #GCancellable, or %NULL
16665 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
16666 // <user_data>: the data to pass to callback function
16667 extern (C) void function (NetworkMonitor* monitor, SocketConnectable* connectable, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow can_reach_async;
16669 // RETURNS: %TRUE if network is reachable, %FALSE if not.
16670 // <result>: a #GAsyncResult
16671 extern (C) int function (NetworkMonitor* monitor, AsyncResult* result, GLib2.Error** error=null) nothrow can_reach_finish;
16675 // Like #GNetworkAddress does with hostnames, #GNetworkService
16676 // provides an easy way to resolve a SRV record, and then attempt to
16677 // connect to one of the hosts that implements that service, handling
16678 // service priority/weighting, multiple IP addresses, and multiple
16679 // address families.
16681 // See #GSrvTarget for more information about SRV records, and see
16682 // #GSocketConnectable for and example of using the connectable
16683 // interface.
16684 struct NetworkService /* : GObject.Object */ {
16685 mixin SocketConnectable.__interface__;
16686 alias parent_instance this;
16687 alias parent_instance super_;
16688 alias parent_instance object;
16689 GObject2.Object parent_instance;
16690 private NetworkServicePrivate* priv;
16693 // VERSION: 2.22
16694 // Creates a new #GNetworkService representing the given @service,
16695 // @protocol, and @domain. This will initially be unresolved; use the
16696 // #GSocketConnectable interface to resolve it.
16697 // RETURNS: a new #GNetworkService
16698 // <service>: the service type to look up (eg, "ldap")
16699 // <protocol>: the networking protocol to use for @service (eg, "tcp")
16700 // <domain>: the DNS domain to look up the service in
16701 static NetworkService* /*new*/ new_(AT0, AT1, AT2)(AT0 /*char*/ service, AT1 /*char*/ protocol, AT2 /*char*/ domain) nothrow {
16702 return g_network_service_new(toCString!(char*)(service), toCString!(char*)(protocol), toCString!(char*)(domain));
16704 static auto opCall(AT0, AT1, AT2)(AT0 /*char*/ service, AT1 /*char*/ protocol, AT2 /*char*/ domain) {
16705 return g_network_service_new(toCString!(char*)(service), toCString!(char*)(protocol), toCString!(char*)(domain));
16708 // VERSION: 2.22
16709 // Gets the domain that @srv serves. This might be either UTF-8 or
16710 // ASCII-encoded, depending on what @srv was created with.
16711 // RETURNS: @srv's domain name
16712 char* get_domain()() nothrow {
16713 return g_network_service_get_domain(&this);
16716 // VERSION: 2.22
16717 // Gets @srv's protocol name (eg, "tcp").
16718 // RETURNS: @srv's protocol name
16719 char* get_protocol()() nothrow {
16720 return g_network_service_get_protocol(&this);
16723 // VERSION: 2.26
16724 // Get's the URI scheme used to resolve proxies. By default, the service name
16725 // is used as scheme.
16726 // RETURNS: @srv's scheme name
16727 char* get_scheme()() nothrow {
16728 return g_network_service_get_scheme(&this);
16731 // VERSION: 2.22
16732 // Gets @srv's service name (eg, "ldap").
16733 // RETURNS: @srv's service name
16734 char* get_service()() nothrow {
16735 return g_network_service_get_service(&this);
16738 // VERSION: 2.26
16739 // Set's the URI scheme used to resolve proxies. By default, the service name
16740 // is used as scheme.
16741 // <scheme>: a URI scheme
16742 void set_scheme(AT0)(AT0 /*char*/ scheme) nothrow {
16743 g_network_service_set_scheme(&this, toCString!(char*)(scheme));
16747 struct NetworkServiceClass {
16748 GObject2.ObjectClass parent_class;
16751 struct NetworkServicePrivate {
16755 // GOutputStream has functions to write to a stream (g_output_stream_write()),
16756 // to close a stream (g_output_stream_close()) and to flush pending writes
16757 // (g_output_stream_flush()).
16759 // To copy the content of an input stream to an output stream without
16760 // manually handling the reads and writes, use g_output_stream_splice().
16762 // All of these functions have async variants too.
16763 struct OutputStream /* : GObject.Object */ {
16764 alias parent_instance this;
16765 alias parent_instance super_;
16766 alias parent_instance object;
16767 GObject2.Object parent_instance;
16768 private OutputStreamPrivate* priv;
16770 // Clears the pending flag on @stream.
16771 void clear_pending()() nothrow {
16772 g_output_stream_clear_pending(&this);
16775 // Closes the stream, releasing resources related to it.
16777 // Once the stream is closed, all other operations will return %G_IO_ERROR_CLOSED.
16778 // Closing a stream multiple times will not return an error.
16780 // Closing a stream will automatically flush any outstanding buffers in the
16781 // stream.
16783 // Streams will be automatically closed when the last reference
16784 // is dropped, but you might want to call this function to make sure
16785 // resources are released as early as possible.
16787 // Some streams might keep the backing store of the stream (e.g. a file descriptor)
16788 // open after the stream is closed. See the documentation for the individual
16789 // stream for details.
16791 // On failure the first error that happened will be reported, but the close
16792 // operation will finish as much as possible. A stream that failed to
16793 // close will still return %G_IO_ERROR_CLOSED for all operations. Still, it
16794 // is important to check and report the error to the user, otherwise
16795 // there might be a loss of data as all data might not be written.
16797 // If @cancellable is not NULL, then the operation can be cancelled by
16798 // triggering the cancellable object from another thread. If the operation
16799 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
16800 // Cancelling a close will still leave the stream closed, but there some streams
16801 // can use a faster close that doesn't block to e.g. check errors. On
16802 // cancellation (as with any error) there is no guarantee that all written
16803 // data will reach the target.
16804 // RETURNS: %TRUE on success, %FALSE on failure
16805 // <cancellable>: optional cancellable object
16806 int close(AT0, AT1)(AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
16807 return g_output_stream_close(&this, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
16810 // Requests an asynchronous close of the stream, releasing resources
16811 // related to it. When the operation is finished @callback will be
16812 // called. You can then call g_output_stream_close_finish() to get
16813 // the result of the operation.
16815 // For behaviour details see g_output_stream_close().
16817 // The asyncronous methods have a default fallback that uses threads
16818 // to implement asynchronicity, so they are optional for inheriting
16819 // classes. However, if you override one you must override all.
16820 // <io_priority>: the io priority of the request.
16821 // <cancellable>: optional cancellable object
16822 // <callback>: callback to call when the request is satisfied
16823 // <user_data>: the data to pass to callback function
16824 void close_async(AT0, AT1)(int io_priority, AT0 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT1 /*void*/ user_data) nothrow {
16825 g_output_stream_close_async(&this, io_priority, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
16828 // Closes an output stream.
16829 // RETURNS: %TRUE if stream was successfully closed, %FALSE otherwise.
16830 // <result>: a #GAsyncResult.
16831 int close_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
16832 return g_output_stream_close_finish(&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
16835 // Forces a write of all user-space buffered data for the given
16836 // @stream. Will block during the operation. Closing the stream will
16837 // implicitly cause a flush.
16839 // This function is optional for inherited classes.
16841 // If @cancellable is not %NULL, then the operation can be cancelled by
16842 // triggering the cancellable object from another thread. If the operation
16843 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
16844 // RETURNS: %TRUE on success, %FALSE on error
16845 // <cancellable>: optional cancellable object
16846 int flush(AT0, AT1)(AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
16847 return g_output_stream_flush(&this, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
16850 // Forces an asynchronous write of all user-space buffered data for
16851 // the given @stream.
16852 // For behaviour details see g_output_stream_flush().
16854 // When the operation is finished @callback will be
16855 // called. You can then call g_output_stream_flush_finish() to get the
16856 // result of the operation.
16857 // <io_priority>: the io priority of the request.
16858 // <cancellable>: optional #GCancellable object, %NULL to ignore.
16859 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
16860 // <user_data>: the data to pass to callback function
16861 void flush_async(AT0, AT1)(int io_priority, AT0 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT1 /*void*/ user_data) nothrow {
16862 g_output_stream_flush_async(&this, io_priority, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
16865 // Finishes flushing an output stream.
16866 // RETURNS: %TRUE if flush operation succeeded, %FALSE otherwise.
16867 // <result>: a GAsyncResult.
16868 int flush_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
16869 return g_output_stream_flush_finish(&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
16872 // Checks if an ouput stream has pending actions.
16873 // RETURNS: %TRUE if @stream has pending actions.
16874 int has_pending()() nothrow {
16875 return g_output_stream_has_pending(&this);
16878 // Checks if an output stream has already been closed.
16879 // RETURNS: %TRUE if @stream is closed. %FALSE otherwise.
16880 int is_closed()() nothrow {
16881 return g_output_stream_is_closed(&this);
16884 // VERSION: 2.24
16885 // Checks if an output stream is being closed. This can be
16886 // used inside e.g. a flush implementation to see if the
16887 // flush (or other i/o operation) is called from within
16888 // the closing operation.
16889 // RETURNS: %TRUE if @stream is being closed. %FALSE otherwise.
16890 int is_closing()() nothrow {
16891 return g_output_stream_is_closing(&this);
16894 // Sets @stream to have actions pending. If the pending flag is
16895 // already set or @stream is closed, it will return %FALSE and set
16896 // @error.
16897 // RETURNS: %TRUE if pending was previously unset and is now set.
16898 int set_pending(AT0)(AT0 /*GLib2.Error**/ error=null) nothrow {
16899 return g_output_stream_set_pending(&this, UpCast!(GLib2.Error**)(error));
16902 // Splices an input stream into an output stream.
16904 // -1 if an error occurred. Note that if the number of bytes
16905 // spliced is greater than %G_MAXSSIZE, then that will be
16906 // returned, and there is no way to determine the actual number
16907 // of bytes spliced.
16908 // RETURNS: a #gssize containing the size of the data spliced, or
16909 // <source>: a #GInputStream.
16910 // <flags>: a set of #GOutputStreamSpliceFlags.
16911 // <cancellable>: optional #GCancellable object, %NULL to ignore.
16912 ssize_t splice(AT0, AT1, AT2)(AT0 /*InputStream*/ source, OutputStreamSpliceFlags flags, AT1 /*Cancellable*/ cancellable, AT2 /*GLib2.Error**/ error=null) nothrow {
16913 return g_output_stream_splice(&this, UpCast!(InputStream*)(source), flags, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
16916 // Splices a stream asynchronously.
16917 // When the operation is finished @callback will be called.
16918 // You can then call g_output_stream_splice_finish() to get the
16919 // result of the operation.
16921 // For the synchronous, blocking version of this function, see
16922 // g_output_stream_splice().
16923 // <source>: a #GInputStream.
16924 // <flags>: a set of #GOutputStreamSpliceFlags.
16925 // <io_priority>: the io priority of the request.
16926 // <cancellable>: optional #GCancellable object, %NULL to ignore.
16927 // <callback>: a #GAsyncReadyCallback.
16928 // <user_data>: user data passed to @callback.
16929 void splice_async(AT0, AT1, AT2)(AT0 /*InputStream*/ source, OutputStreamSpliceFlags flags, int io_priority, AT1 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT2 /*void*/ user_data) nothrow {
16930 g_output_stream_splice_async(&this, UpCast!(InputStream*)(source), flags, io_priority, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
16933 // Finishes an asynchronous stream splice operation.
16935 // number of bytes spliced is greater than %G_MAXSSIZE, then that
16936 // will be returned, and there is no way to determine the actual
16937 // number of bytes spliced.
16938 // RETURNS: a #gssize of the number of bytes spliced. Note that if the
16939 // <result>: a #GAsyncResult.
16940 ssize_t splice_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
16941 return g_output_stream_splice_finish(&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
16944 // Tries to write @count bytes from @buffer into the stream. Will block
16945 // during the operation.
16947 // If count is 0, returns 0 and does nothing. A value of @count
16948 // larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
16950 // On success, the number of bytes written to the stream is returned.
16951 // It is not an error if this is not the same as the requested size, as it
16952 // can happen e.g. on a partial I/O error, or if there is not enough
16953 // storage in the stream. All writes block until at least one byte
16954 // is written or an error occurs; 0 is never returned (unless
16955 // @count is 0).
16957 // If @cancellable is not NULL, then the operation can be cancelled by
16958 // triggering the cancellable object from another thread. If the operation
16959 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
16960 // operation was partially finished when the operation was cancelled the
16961 // partial result will be returned, without an error.
16963 // On error -1 is returned and @error is set accordingly.
16964 // RETURNS: Number of bytes written, or -1 on error
16965 // <buffer>: the buffer containing the data to write.
16966 // <count>: the number of bytes to write
16967 // <cancellable>: optional cancellable object
16968 ssize_t write(AT0, AT1, AT2)(AT0 /*ubyte*/ buffer, size_t count, AT1 /*Cancellable*/ cancellable, AT2 /*GLib2.Error**/ error=null) nothrow {
16969 return g_output_stream_write(&this, UpCast!(ubyte*)(buffer), count, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
16972 // Tries to write @count bytes from @buffer into the stream. Will block
16973 // during the operation.
16975 // This function is similar to g_output_stream_write(), except it tries to
16976 // write as many bytes as requested, only stopping on an error.
16978 // On a successful write of @count bytes, %TRUE is returned, and @bytes_written
16979 // is set to @count.
16981 // If there is an error during the operation FALSE is returned and @error
16982 // is set to indicate the error status, @bytes_written is updated to contain
16983 // the number of bytes written into the stream before the error occurred.
16984 // RETURNS: %TRUE on success, %FALSE if there was an error
16985 // <buffer>: the buffer containing the data to write.
16986 // <count>: the number of bytes to write
16987 // <bytes_written>: location to store the number of bytes that was written to the stream
16988 // <cancellable>: optional #GCancellable object, %NULL to ignore.
16989 int write_all(AT0, AT1, AT2, AT3)(AT0 /*ubyte*/ buffer, size_t count, /*out*/ AT1 /*size_t*/ bytes_written, AT2 /*Cancellable*/ cancellable, AT3 /*GLib2.Error**/ error=null) nothrow {
16990 return g_output_stream_write_all(&this, UpCast!(ubyte*)(buffer), count, UpCast!(size_t*)(bytes_written), UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
16993 // Request an asynchronous write of @count bytes from @buffer into
16994 // the stream. When the operation is finished @callback will be called.
16995 // You can then call g_output_stream_write_finish() to get the result of the
16996 // operation.
16998 // During an async request no other sync and async calls are allowed,
16999 // and will result in %G_IO_ERROR_PENDING errors.
17001 // A value of @count larger than %G_MAXSSIZE will cause a
17002 // %G_IO_ERROR_INVALID_ARGUMENT error.
17004 // On success, the number of bytes written will be passed to the
17005 // @callback. It is not an error if this is not the same as the
17006 // requested size, as it can happen e.g. on a partial I/O error,
17007 // but generally we try to write as many bytes as requested.
17009 // You are guaranteed that this method will never fail with
17010 // %G_IO_ERROR_WOULD_BLOCK - if @stream can't accept more data, the
17011 // method will just wait until this changes.
17013 // Any outstanding I/O request with higher priority (lower numerical
17014 // value) will be executed before an outstanding request with lower
17015 // priority. Default priority is %G_PRIORITY_DEFAULT.
17017 // The asyncronous methods have a default fallback that uses threads
17018 // to implement asynchronicity, so they are optional for inheriting
17019 // classes. However, if you override one you must override all.
17021 // For the synchronous, blocking version of this function, see
17022 // g_output_stream_write().
17023 // <buffer>: the buffer containing the data to write.
17024 // <count>: the number of bytes to write
17025 // <io_priority>: the io priority of the request.
17026 // <cancellable>: optional #GCancellable object, %NULL to ignore.
17027 // <callback>: callback to call when the request is satisfied
17028 // <user_data>: the data to pass to callback function
17029 void write_async(AT0, AT1, AT2)(AT0 /*ubyte*/ buffer, size_t count, int io_priority, AT1 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT2 /*void*/ user_data) nothrow {
17030 g_output_stream_write_async(&this, UpCast!(ubyte*)(buffer), count, io_priority, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
17033 // Finishes a stream write operation.
17034 // RETURNS: a #gssize containing the number of bytes written to the stream.
17035 // <result>: a #GAsyncResult.
17036 ssize_t write_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
17037 return g_output_stream_write_finish(&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
17041 struct OutputStreamClass {
17042 GObject2.ObjectClass parent_class;
17044 // RETURNS: Number of bytes written, or -1 on error
17045 // <buffer>: the buffer containing the data to write.
17046 // <count>: the number of bytes to write
17047 // <cancellable>: optional cancellable object
17048 extern (C) ssize_t function (OutputStream* stream, ubyte* buffer, size_t count, Cancellable* cancellable, GLib2.Error** error=null) nothrow write_fn;
17050 // RETURNS: a #gssize containing the size of the data spliced, or
17051 // <source>: a #GInputStream.
17052 // <flags>: a set of #GOutputStreamSpliceFlags.
17053 // <cancellable>: optional #GCancellable object, %NULL to ignore.
17054 extern (C) ssize_t function (OutputStream* stream, InputStream* source, OutputStreamSpliceFlags flags, Cancellable* cancellable, GLib2.Error** error=null) nothrow splice;
17056 // RETURNS: %TRUE on success, %FALSE on error
17057 // <cancellable>: optional cancellable object
17058 extern (C) int function (OutputStream* stream, Cancellable* cancellable, GLib2.Error** error=null) nothrow flush;
17059 extern (C) int function (OutputStream* stream, Cancellable* cancellable, GLib2.Error** error=null) nothrow close_fn;
17061 // <buffer>: the buffer containing the data to write.
17062 // <count>: the number of bytes to write
17063 // <io_priority>: the io priority of the request.
17064 // <cancellable>: optional #GCancellable object, %NULL to ignore.
17065 // <callback>: callback to call when the request is satisfied
17066 // <user_data>: the data to pass to callback function
17067 extern (C) void function (OutputStream* stream, ubyte* buffer, size_t count, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow write_async;
17069 // RETURNS: a #gssize containing the number of bytes written to the stream.
17070 // <result>: a #GAsyncResult.
17071 extern (C) ssize_t function (OutputStream* stream, AsyncResult* result, GLib2.Error** error=null) nothrow write_finish;
17073 // <source>: a #GInputStream.
17074 // <flags>: a set of #GOutputStreamSpliceFlags.
17075 // <io_priority>: the io priority of the request.
17076 // <cancellable>: optional #GCancellable object, %NULL to ignore.
17077 // <callback>: a #GAsyncReadyCallback.
17078 // <user_data>: user data passed to @callback.
17079 extern (C) void function (OutputStream* stream, InputStream* source, OutputStreamSpliceFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow splice_async;
17081 // RETURNS: a #gssize of the number of bytes spliced. Note that if the
17082 // <result>: a #GAsyncResult.
17083 extern (C) ssize_t function (OutputStream* stream, AsyncResult* result, GLib2.Error** error=null) nothrow splice_finish;
17085 // <io_priority>: the io priority of the request.
17086 // <cancellable>: optional #GCancellable object, %NULL to ignore.
17087 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
17088 // <user_data>: the data to pass to callback function
17089 extern (C) void function (OutputStream* stream, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow flush_async;
17091 // RETURNS: %TRUE if flush operation succeeded, %FALSE otherwise.
17092 // <result>: a GAsyncResult.
17093 extern (C) int function (OutputStream* stream, AsyncResult* result, GLib2.Error** error=null) nothrow flush_finish;
17095 // <io_priority>: the io priority of the request.
17096 // <cancellable>: optional cancellable object
17097 // <callback>: callback to call when the request is satisfied
17098 // <user_data>: the data to pass to callback function
17099 extern (C) void function (OutputStream* stream, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow close_async;
17101 // RETURNS: %TRUE if stream was successfully closed, %FALSE otherwise.
17102 // <result>: a #GAsyncResult.
17103 extern (C) int function (OutputStream* stream, AsyncResult* result, GLib2.Error** error=null) nothrow close_finish;
17104 extern (C) void function () nothrow _g_reserved1;
17105 extern (C) void function () nothrow _g_reserved2;
17106 extern (C) void function () nothrow _g_reserved3;
17107 extern (C) void function () nothrow _g_reserved4;
17108 extern (C) void function () nothrow _g_reserved5;
17109 extern (C) void function () nothrow _g_reserved6;
17110 extern (C) void function () nothrow _g_reserved7;
17111 extern (C) void function () nothrow _g_reserved8;
17114 struct OutputStreamPrivate {
17117 // GOutputStreamSpliceFlags determine how streams should be spliced.
17118 enum OutputStreamSpliceFlags {
17119 NONE = 0,
17120 CLOSE_SOURCE = 1,
17121 CLOSE_TARGET = 2
17124 // Structure used for scatter/gather data output.
17125 // You generally pass in an array of #GOutputVector<!-- -->s
17126 // and the operation will use all the buffers as if they were
17127 // one buffer.
17128 struct OutputVector /* Version 2.22 */ {
17129 const(void)* buffer;
17130 size_t size;
17133 enum PROXY_EXTENSION_POINT_NAME = "gio-proxy";
17134 enum PROXY_RESOLVER_EXTENSION_POINT_NAME = "gio-proxy-resolver";
17136 // #GPasswordSave is used to indicate the lifespan of a saved password.
17138 // #Gvfs stores passwords in the Gnome keyring when this flag allows it
17139 // to, and later retrieves it again from there.
17140 enum PasswordSave {
17141 NEVER = 0,
17142 FOR_SESSION = 1,
17143 PERMANENTLY = 2
17146 // A #GPermission represents the status of the caller's permission to
17147 // perform a certain action.
17149 // You can query if the action is currently allowed and if it is
17150 // possible to acquire the permission so that the action will be allowed
17151 // in the future.
17153 // There is also an API to actually acquire the permission and one to
17154 // release it.
17156 // As an example, a #GPermission might represent the ability for the
17157 // user to write to a #GSettings object. This #GPermission object could
17158 // then be used to decide if it is appropriate to show a "Click here to
17159 // unlock" button in a dialog and to provide the mechanism to invoke
17160 // when that button is clicked.
17161 struct Permission /* : GObject.Object */ {
17162 alias parent_instance this;
17163 alias parent_instance super_;
17164 alias parent_instance object;
17165 GObject2.Object parent_instance;
17166 private PermissionPrivate* priv;
17169 // VERSION: 2.26
17170 // Attempts to acquire the permission represented by @permission.
17172 // The precise method by which this happens depends on the permission
17173 // and the underlying authentication mechanism. A simple example is
17174 // that a dialog may appear asking the user to enter their password.
17176 // You should check with g_permission_get_can_acquire() before calling
17177 // this function.
17179 // If the permission is acquired then %TRUE is returned. Otherwise,
17180 // %FALSE is returned and @error is set appropriately.
17182 // This call is blocking, likely for a very long time (in the case that
17183 // user interaction is required). See g_permission_acquire_async() for
17184 // the non-blocking version.
17185 // RETURNS: %TRUE if the permission was successfully acquired
17186 // <cancellable>: a #GCancellable, or %NULL
17187 int acquire(AT0, AT1)(AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
17188 return g_permission_acquire(&this, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
17191 // VERSION: 2.26
17192 // Attempts to acquire the permission represented by @permission.
17194 // This is the first half of the asynchronous version of
17195 // g_permission_acquire().
17196 // <cancellable>: a #GCancellable, or %NULL
17197 // <callback>: the #GAsyncReadyCallback to call when done
17198 // <user_data>: the user data to pass to @callback
17199 void acquire_async(AT0, AT1)(AT0 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT1 /*void*/ user_data) nothrow {
17200 g_permission_acquire_async(&this, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
17203 // VERSION: 2.26
17204 // Collects the result of attempting to acquire the permission
17205 // represented by @permission.
17207 // This is the second half of the asynchronous version of
17208 // g_permission_acquire().
17209 // RETURNS: %TRUE if the permission was successfully acquired
17210 // <result>: the #GAsyncResult given to the #GAsyncReadyCallback
17211 int acquire_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
17212 return g_permission_acquire_finish(&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
17215 // VERSION: 2.26
17216 // Gets the value of the 'allowed' property. This property is %TRUE if
17217 // the caller currently has permission to perform the action that
17218 // @permission represents the permission to perform.
17219 // RETURNS: the value of the 'allowed' property
17220 int get_allowed()() nothrow {
17221 return g_permission_get_allowed(&this);
17224 // VERSION: 2.26
17225 // Gets the value of the 'can-acquire' property. This property is %TRUE
17226 // if it is generally possible to acquire the permission by calling
17227 // g_permission_acquire().
17228 // RETURNS: the value of the 'can-acquire' property
17229 int get_can_acquire()() nothrow {
17230 return g_permission_get_can_acquire(&this);
17233 // VERSION: 2.26
17234 // Gets the value of the 'can-release' property. This property is %TRUE
17235 // if it is generally possible to release the permission by calling
17236 // g_permission_release().
17237 // RETURNS: the value of the 'can-release' property
17238 int get_can_release()() nothrow {
17239 return g_permission_get_can_release(&this);
17242 // VERSION: 2.26
17243 // This function is called by the #GPermission implementation to update
17244 // the properties of the permission. You should never call this
17245 // function except from a #GPermission implementation.
17247 // GObject notify signals are generated, as appropriate.
17248 // <allowed>: the new value for the 'allowed' property
17249 // <can_acquire>: the new value for the 'can-acquire' property
17250 // <can_release>: the new value for the 'can-release' property
17251 void impl_update()(int allowed, int can_acquire, int can_release) nothrow {
17252 g_permission_impl_update(&this, allowed, can_acquire, can_release);
17255 // VERSION: 2.26
17256 // Attempts to release the permission represented by @permission.
17258 // The precise method by which this happens depends on the permission
17259 // and the underlying authentication mechanism. In most cases the
17260 // permission will be dropped immediately without further action.
17262 // You should check with g_permission_get_can_release() before calling
17263 // this function.
17265 // If the permission is released then %TRUE is returned. Otherwise,
17266 // %FALSE is returned and @error is set appropriately.
17268 // This call is blocking, likely for a very long time (in the case that
17269 // user interaction is required). See g_permission_release_async() for
17270 // the non-blocking version.
17271 // RETURNS: %TRUE if the permission was successfully released
17272 // <cancellable>: a #GCancellable, or %NULL
17273 int release(AT0, AT1)(AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
17274 return g_permission_release(&this, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
17277 // VERSION: 2.26
17278 // Attempts to release the permission represented by @permission.
17280 // This is the first half of the asynchronous version of
17281 // g_permission_release().
17282 // <cancellable>: a #GCancellable, or %NULL
17283 // <callback>: the #GAsyncReadyCallback to call when done
17284 // <user_data>: the user data to pass to @callback
17285 void release_async(AT0, AT1)(AT0 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT1 /*void*/ user_data) nothrow {
17286 g_permission_release_async(&this, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
17289 // VERSION: 2.26
17290 // Collects the result of attempting to release the permission
17291 // represented by @permission.
17293 // This is the second half of the asynchronous version of
17294 // g_permission_release().
17295 // RETURNS: %TRUE if the permission was successfully released
17296 // <result>: the #GAsyncResult given to the #GAsyncReadyCallback
17297 int release_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
17298 return g_permission_release_finish(&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
17302 struct PermissionClass {
17303 GObject2.ObjectClass parent_class;
17305 // RETURNS: %TRUE if the permission was successfully acquired
17306 // <cancellable>: a #GCancellable, or %NULL
17307 extern (C) int function (Permission* permission, Cancellable* cancellable, GLib2.Error** error=null) nothrow acquire;
17309 // <cancellable>: a #GCancellable, or %NULL
17310 // <callback>: the #GAsyncReadyCallback to call when done
17311 // <user_data>: the user data to pass to @callback
17312 extern (C) void function (Permission* permission, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow acquire_async;
17314 // RETURNS: %TRUE if the permission was successfully acquired
17315 // <result>: the #GAsyncResult given to the #GAsyncReadyCallback
17316 extern (C) int function (Permission* permission, AsyncResult* result, GLib2.Error** error=null) nothrow acquire_finish;
17318 // RETURNS: %TRUE if the permission was successfully released
17319 // <cancellable>: a #GCancellable, or %NULL
17320 extern (C) int function (Permission* permission, Cancellable* cancellable, GLib2.Error** error=null) nothrow release;
17322 // <cancellable>: a #GCancellable, or %NULL
17323 // <callback>: the #GAsyncReadyCallback to call when done
17324 // <user_data>: the user data to pass to @callback
17325 extern (C) void function (Permission* permission, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow release_async;
17327 // RETURNS: %TRUE if the permission was successfully released
17328 // <result>: the #GAsyncResult given to the #GAsyncReadyCallback
17329 extern (C) int function (Permission* permission, AsyncResult* result, GLib2.Error** error=null) nothrow release_finish;
17330 void*[16] reserved;
17333 struct PermissionPrivate {
17337 // #GPollableInputStream is implemented by #GInputStream<!-- -->s that
17338 // can be polled for readiness to read. This can be used when
17339 // interfacing with a non-GIO API that expects
17340 // UNIX-file-descriptor-style asynchronous I/O rather than GIO-style.
17341 struct PollableInputStream /* Interface */ /* Version 2.28 */ {
17342 mixin template __interface__() {
17343 // VERSION: 2.28
17344 // Checks if @stream is actually pollable. Some classes may implement
17345 // #GPollableInputStream but have only certain instances of that class
17346 // be pollable. If this method returns %FALSE, then the behavior of
17347 // other #GPollableInputStream methods is undefined.
17349 // For any given stream, the value returned by this method is constant;
17350 // a stream cannot switch from pollable to non-pollable or vice versa.
17351 // RETURNS: %TRUE if @stream is pollable, %FALSE if not.
17352 int can_poll()() nothrow {
17353 return g_pollable_input_stream_can_poll(cast(PollableInputStream*)&this);
17356 // VERSION: 2.28
17357 // Creates a #GSource that triggers when @stream can be read, or
17358 // @cancellable is triggered or an error occurs. The callback on the
17359 // source is of the #GPollableSourceFunc type.
17361 // As with g_pollable_input_stream_is_readable(), it is possible that
17362 // the stream may not actually be readable even after the source
17363 // triggers, so you should use g_pollable_input_stream_read_nonblocking()
17364 // rather than g_input_stream_read() from the callback.
17365 // RETURNS: a new #GSource
17366 // <cancellable>: a #GCancellable, or %NULL
17367 GLib2.Source* /*new*/ create_source(AT0)(AT0 /*Cancellable*/ cancellable=null) nothrow {
17368 return g_pollable_input_stream_create_source(cast(PollableInputStream*)&this, UpCast!(Cancellable*)(cancellable));
17371 // VERSION: 2.28
17372 // Checks if @stream can be read.
17374 // Note that some stream types may not be able to implement this 100%
17375 // reliably, and it is possible that a call to g_input_stream_read()
17376 // after this returns %TRUE would still block. To guarantee
17377 // non-blocking behavior, you should always use
17378 // g_pollable_input_stream_read_nonblocking(), which will return a
17379 // %G_IO_ERROR_WOULD_BLOCK error rather than blocking.
17381 // has occurred on @stream, this will result in
17382 // g_pollable_input_stream_is_readable() returning %TRUE, and the
17383 // next attempt to read will return the error.
17384 // RETURNS: %TRUE if @stream is readable, %FALSE if not. If an error
17385 int is_readable()() nothrow {
17386 return g_pollable_input_stream_is_readable(cast(PollableInputStream*)&this);
17389 // Attempts to read up to @size bytes from @stream into @buffer, as
17390 // with g_input_stream_read(). If @stream is not currently readable,
17391 // this will immediately return %G_IO_ERROR_WOULD_BLOCK, and you can
17392 // use g_pollable_input_stream_create_source() to create a #GSource
17393 // that will be triggered when @stream is readable.
17395 // Note that since this method never blocks, you cannot actually
17396 // use @cancellable to cancel it. However, it will return an error
17397 // if @cancellable has already been cancelled when you call, which
17398 // may happen if you call this method after a source triggers due
17399 // to having been cancelled.
17401 // %G_IO_ERROR_WOULD_BLOCK).
17402 // RETURNS: the number of bytes read, or -1 on error (including
17403 // <buffer>: a buffer to read data into (which should be at least @size bytes long).
17404 // <size>: the number of bytes you want to read
17405 // <cancellable>: a #GCancellable, or %NULL
17406 ssize_t read_nonblocking(AT0, AT1, AT2)(AT0 /*void*/ buffer, size_t size, AT1 /*Cancellable*/ cancellable, AT2 /*GLib2.Error**/ error=null) nothrow {
17407 return g_pollable_input_stream_read_nonblocking(cast(PollableInputStream*)&this, UpCast!(void*)(buffer), size, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
17410 mixin __interface__;
17414 // The interface for pollable input streams.
17416 // The default implementation of @can_poll always returns %TRUE.
17418 // The default implementation of @read_nonblocking calls
17419 // g_pollable_input_stream_is_readable(), and then calls
17420 // g_input_stream_read() if it returns %TRUE. This means you only need
17421 // to override it if it is possible that your @is_readable
17422 // implementation may return %TRUE when the stream is not actually
17423 // readable.
17424 struct PollableInputStreamInterface /* Version 2.28 */ {
17425 GObject2.TypeInterface g_iface;
17426 // RETURNS: %TRUE if @stream is pollable, %FALSE if not.
17427 extern (C) int function (PollableInputStream* stream) nothrow can_poll;
17428 // RETURNS: %TRUE if @stream is readable, %FALSE if not. If an error
17429 extern (C) int function (PollableInputStream* stream) nothrow is_readable;
17431 // RETURNS: a new #GSource
17432 // <cancellable>: a #GCancellable, or %NULL
17433 extern (C) GLib2.Source* /*new*/ function (PollableInputStream* stream, Cancellable* cancellable=null) nothrow create_source;
17435 // RETURNS: the number of bytes read, or -1 on error (including
17436 // <buffer>: a buffer to read data into (which should be at least @size bytes long).
17437 // <size>: the number of bytes you want to read
17438 extern (C) ssize_t function (PollableInputStream* stream, void* buffer, size_t size, GLib2.Error** error=null) nothrow read_nonblocking;
17442 // #GPollableOutputStream is implemented by #GOutputStream<!-- -->s that
17443 // can be polled for readiness to write. This can be used when
17444 // interfacing with a non-GIO API that expects
17445 // UNIX-file-descriptor-style asynchronous I/O rather than GIO-style.
17446 struct PollableOutputStream /* Interface */ /* Version 2.28 */ {
17447 mixin template __interface__() {
17448 // VERSION: 2.28
17449 // Checks if @stream is actually pollable. Some classes may implement
17450 // #GPollableOutputStream but have only certain instances of that
17451 // class be pollable. If this method returns %FALSE, then the behavior
17452 // of other #GPollableOutputStream methods is undefined.
17454 // For any given stream, the value returned by this method is constant;
17455 // a stream cannot switch from pollable to non-pollable or vice versa.
17456 // RETURNS: %TRUE if @stream is pollable, %FALSE if not.
17457 int can_poll()() nothrow {
17458 return g_pollable_output_stream_can_poll(cast(PollableOutputStream*)&this);
17461 // VERSION: 2.28
17462 // Creates a #GSource that triggers when @stream can be written, or
17463 // @cancellable is triggered or an error occurs. The callback on the
17464 // source is of the #GPollableSourceFunc type.
17466 // As with g_pollable_output_stream_is_writable(), it is possible that
17467 // the stream may not actually be writable even after the source
17468 // triggers, so you should use g_pollable_output_stream_write_nonblocking()
17469 // rather than g_output_stream_write() from the callback.
17470 // RETURNS: a new #GSource
17471 // <cancellable>: a #GCancellable, or %NULL
17472 GLib2.Source* /*new*/ create_source(AT0)(AT0 /*Cancellable*/ cancellable=null) nothrow {
17473 return g_pollable_output_stream_create_source(cast(PollableOutputStream*)&this, UpCast!(Cancellable*)(cancellable));
17476 // VERSION: 2.28
17477 // Checks if @stream can be written.
17479 // Note that some stream types may not be able to implement this 100%
17480 // reliably, and it is possible that a call to g_output_stream_write()
17481 // after this returns %TRUE would still block. To guarantee
17482 // non-blocking behavior, you should always use
17483 // g_pollable_output_stream_write_nonblocking(), which will return a
17484 // %G_IO_ERROR_WOULD_BLOCK error rather than blocking.
17486 // has occurred on @stream, this will result in
17487 // g_pollable_output_stream_is_writable() returning %TRUE, and the
17488 // next attempt to write will return the error.
17489 // RETURNS: %TRUE if @stream is writable, %FALSE if not. If an error
17490 int is_writable()() nothrow {
17491 return g_pollable_output_stream_is_writable(cast(PollableOutputStream*)&this);
17494 // Attempts to write up to @size bytes from @buffer to @stream, as
17495 // with g_output_stream_write(). If @stream is not currently writable,
17496 // this will immediately return %G_IO_ERROR_WOULD_BLOCK, and you can
17497 // use g_pollable_output_stream_create_source() to create a #GSource
17498 // that will be triggered when @stream is writable.
17500 // Note that since this method never blocks, you cannot actually
17501 // use @cancellable to cancel it. However, it will return an error
17502 // if @cancellable has already been cancelled when you call, which
17503 // may happen if you call this method after a source triggers due
17504 // to having been cancelled.
17506 // %G_IO_ERROR_WOULD_BLOCK).
17507 // RETURNS: the number of bytes written, or -1 on error (including
17508 // <buffer>: a buffer to write data from
17509 // <size>: the number of bytes you want to write
17510 // <cancellable>: a #GCancellable, or %NULL
17511 ssize_t write_nonblocking(AT0, AT1, AT2)(AT0 /*ubyte*/ buffer, size_t size, AT1 /*Cancellable*/ cancellable, AT2 /*GLib2.Error**/ error=null) nothrow {
17512 return g_pollable_output_stream_write_nonblocking(cast(PollableOutputStream*)&this, UpCast!(ubyte*)(buffer), size, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
17515 mixin __interface__;
17519 // The interface for pollable output streams.
17521 // The default implementation of @can_poll always returns %TRUE.
17523 // The default implementation of @write_nonblocking calls
17524 // g_pollable_output_stream_is_writable(), and then calls
17525 // g_output_stream_write() if it returns %TRUE. This means you only
17526 // need to override it if it is possible that your @is_writable
17527 // implementation may return %TRUE when the stream is not actually
17528 // writable.
17529 struct PollableOutputStreamInterface /* Version 2.28 */ {
17530 GObject2.TypeInterface g_iface;
17531 // RETURNS: %TRUE if @stream is pollable, %FALSE if not.
17532 extern (C) int function (PollableOutputStream* stream) nothrow can_poll;
17533 // RETURNS: %TRUE if @stream is writable, %FALSE if not. If an error
17534 extern (C) int function (PollableOutputStream* stream) nothrow is_writable;
17536 // RETURNS: a new #GSource
17537 // <cancellable>: a #GCancellable, or %NULL
17538 extern (C) GLib2.Source* /*new*/ function (PollableOutputStream* stream, Cancellable* cancellable=null) nothrow create_source;
17540 // RETURNS: the number of bytes written, or -1 on error (including
17541 // <buffer>: a buffer to write data from
17542 // <size>: the number of bytes you want to write
17543 extern (C) ssize_t function (PollableOutputStream* stream, ubyte* buffer, size_t size, GLib2.Error** error=null) nothrow write_nonblocking;
17547 // VERSION: 2.28
17548 // This is the function type of the callback used for the #GSource
17549 // returned by g_pollable_input_stream_create_source() and
17550 // g_pollable_output_stream_create_source().
17551 // RETURNS: it should return %FALSE if the source should be removed.
17552 // <pollable_stream>: the #GPollableInputStream or #GPollableOutputStream
17553 // <user_data>: data passed in by the user.
17554 extern (C) alias int function (GObject2.Object* pollable_stream, void* user_data) nothrow PollableSourceFunc;
17557 // A #GProxy handles connecting to a remote host via a given type of
17558 // proxy server. It is implemented by the 'gio-proxy' extension point.
17559 // The extensions are named after their proxy protocol name. As an
17560 // example, a SOCKS5 proxy implementation can be retrieved with the
17561 // name 'socks5' using the function
17562 // g_io_extension_point_get_extension_by_name().
17563 struct Proxy /* Interface */ /* Version 2.26 */ {
17564 mixin template __interface__() {
17565 // VERSION: 2.26
17566 // Lookup "gio-proxy" extension point for a proxy implementation that supports
17567 // specified protocol.
17569 // is not supported.
17570 // RETURNS: return a #GProxy or NULL if protocol
17571 // <protocol>: the proxy protocol name (e.g. http, socks, etc)
17572 static Proxy* /*new*/ get_default_for_protocol(AT0)(AT0 /*char*/ protocol) nothrow {
17573 return g_proxy_get_default_for_protocol(toCString!(char*)(protocol));
17576 // VERSION: 2.26
17577 // Given @connection to communicate with a proxy (eg, a
17578 // #GSocketConnection that is connected to the proxy server), this
17579 // does the necessary handshake to connect to @proxy_address, and if
17580 // required, wraps the #GIOStream to handle proxy payload.
17582 // be the same as @connection, in which case a reference
17583 // will be added.
17584 // RETURNS: a #GIOStream that will replace @connection. This might
17585 // <connection>: a #GIOStream
17586 // <proxy_address>: a #GProxyAddress
17587 // <cancellable>: a #GCancellable
17588 IOStream* /*new*/ connect(AT0, AT1, AT2, AT3)(AT0 /*IOStream*/ connection, AT1 /*ProxyAddress*/ proxy_address, AT2 /*Cancellable*/ cancellable, AT3 /*GLib2.Error**/ error=null) nothrow {
17589 return g_proxy_connect(cast(Proxy*)&this, UpCast!(IOStream*)(connection), UpCast!(ProxyAddress*)(proxy_address), UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
17592 // VERSION: 2.26
17593 // Asynchronous version of g_proxy_connect().
17594 // <connection>: a #GIOStream
17595 // <proxy_address>: a #GProxyAddress
17596 // <cancellable>: a #GCancellable
17597 // <callback>: a #GAsyncReadyCallback
17598 // <user_data>: callback data
17599 void connect_async(AT0, AT1, AT2, AT3)(AT0 /*IOStream*/ connection, AT1 /*ProxyAddress*/ proxy_address, AT2 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT3 /*void*/ user_data) nothrow {
17600 g_proxy_connect_async(cast(Proxy*)&this, UpCast!(IOStream*)(connection), UpCast!(ProxyAddress*)(proxy_address), UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
17603 // VERSION: 2.26
17604 // See g_proxy_connect().
17605 // RETURNS: a #GIOStream.
17606 // <result>: a #GAsyncResult
17607 IOStream* /*new*/ connect_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
17608 return g_proxy_connect_finish(cast(Proxy*)&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
17611 // VERSION: 2.26
17612 // Some proxy protocols expect to be passed a hostname, which they
17613 // will resolve to an IP address themselves. Others, like SOCKS4, do
17614 // not allow this. This function will return %FALSE if @proxy is
17615 // implementing such a protocol. When %FALSE is returned, the caller
17616 // should resolve the destination hostname first, and then pass a
17617 // #GProxyAddress containing the stringified IP address to
17618 // g_proxy_connect() or g_proxy_connect_async().
17619 // RETURNS: %TRUE if hostname resolution is supported.
17620 int supports_hostname()() nothrow {
17621 return g_proxy_supports_hostname(cast(Proxy*)&this);
17624 mixin __interface__;
17627 // Support for proxied #GInetSocketAddress.
17628 struct ProxyAddress /* : InetSocketAddress */ /* Version 2.26 */ {
17629 mixin SocketConnectable.__interface__;
17630 alias parent_instance this;
17631 alias parent_instance super_;
17632 alias parent_instance inetsocketaddress;
17633 InetSocketAddress parent_instance;
17634 private ProxyAddressPrivate* priv;
17637 // VERSION: 2.26
17638 // Creates a new #GProxyAddress for @inetaddr with @protocol that should
17639 // tunnel through @dest_hostname and @dest_port.
17640 // RETURNS: a new #GProxyAddress
17641 // <inetaddr>: The proxy server #GInetAddress.
17642 // <port>: The proxy server port.
17643 // <protocol>: The proxy protocol to support, in lower case (e.g. socks, http).
17644 // <dest_hostname>: The destination hostname the the proxy should tunnel to.
17645 // <dest_port>: The destination port to tunnel to.
17646 // <username>: The username to authenticate to the proxy server (or %NULL).
17647 // <password>: The password to authenticate to the proxy server (or %NULL).
17648 static ProxyAddress* /*new*/ new_(AT0, AT1, AT2, AT3, AT4)(AT0 /*InetAddress*/ inetaddr, ushort port, AT1 /*char*/ protocol, AT2 /*char*/ dest_hostname, ushort dest_port, AT3 /*char*/ username=null, AT4 /*char*/ password=null) nothrow {
17649 return g_proxy_address_new(UpCast!(InetAddress*)(inetaddr), port, toCString!(char*)(protocol), toCString!(char*)(dest_hostname), dest_port, toCString!(char*)(username), toCString!(char*)(password));
17651 static auto opCall(AT0, AT1, AT2, AT3, AT4)(AT0 /*InetAddress*/ inetaddr, ushort port, AT1 /*char*/ protocol, AT2 /*char*/ dest_hostname, ushort dest_port, AT3 /*char*/ username=null, AT4 /*char*/ password=null) {
17652 return g_proxy_address_new(UpCast!(InetAddress*)(inetaddr), port, toCString!(char*)(protocol), toCString!(char*)(dest_hostname), dest_port, toCString!(char*)(username), toCString!(char*)(password));
17655 // VERSION: 2.26
17656 // Gets @proxy's destination hostname.
17657 // RETURNS: the @proxy's destination hostname
17658 char* get_destination_hostname()() nothrow {
17659 return g_proxy_address_get_destination_hostname(&this);
17662 // VERSION: 2.26
17663 // Gets @proxy's destination port.
17664 // RETURNS: the @proxy's destination port
17665 ushort get_destination_port()() nothrow {
17666 return g_proxy_address_get_destination_port(&this);
17669 // VERSION: 2.26
17670 // Gets @proxy's password.
17671 // RETURNS: the @proxy's password
17672 char* get_password()() nothrow {
17673 return g_proxy_address_get_password(&this);
17676 // VERSION: 2.26
17677 // Gets @proxy's protocol.
17678 // RETURNS: the @proxy's protocol
17679 char* get_protocol()() nothrow {
17680 return g_proxy_address_get_protocol(&this);
17683 // VERSION: 2.26
17684 // Gets @proxy's username.
17685 // RETURNS: the @proxy's username
17686 char* get_username()() nothrow {
17687 return g_proxy_address_get_username(&this);
17691 struct ProxyAddressClass {
17692 InetSocketAddressClass parent_class;
17696 // A subclass of #GSocketAddressEnumerator that takes another address
17697 // enumerator and wraps its results in #GProxyAddress<!-- -->es as
17698 // directed by the default #GProxyResolver.
17699 struct ProxyAddressEnumerator /* : SocketAddressEnumerator */ {
17700 alias parent_instance this;
17701 alias parent_instance super_;
17702 alias parent_instance socketaddressenumerator;
17703 SocketAddressEnumerator parent_instance;
17704 ProxyAddressEnumeratorPrivate* priv;
17707 struct ProxyAddressEnumeratorClass {
17708 SocketAddressEnumeratorClass parent_class;
17709 extern (C) void function () nothrow _g_reserved1;
17710 extern (C) void function () nothrow _g_reserved2;
17711 extern (C) void function () nothrow _g_reserved3;
17712 extern (C) void function () nothrow _g_reserved4;
17713 extern (C) void function () nothrow _g_reserved5;
17714 extern (C) void function () nothrow _g_reserved6;
17715 extern (C) void function () nothrow _g_reserved7;
17718 struct ProxyAddressEnumeratorPrivate {
17721 struct ProxyAddressPrivate {
17724 // Provides an interface for handling proxy connection and payload.
17725 struct ProxyInterface /* Version 2.26 */ {
17726 GObject2.TypeInterface g_iface;
17728 // RETURNS: a #GIOStream that will replace @connection. This might
17729 // <connection>: a #GIOStream
17730 // <proxy_address>: a #GProxyAddress
17731 // <cancellable>: a #GCancellable
17732 extern (C) IOStream* /*new*/ function (Proxy* proxy, IOStream* connection, ProxyAddress* proxy_address, Cancellable* cancellable, GLib2.Error** error=null) nothrow connect;
17734 // <connection>: a #GIOStream
17735 // <proxy_address>: a #GProxyAddress
17736 // <cancellable>: a #GCancellable
17737 // <callback>: a #GAsyncReadyCallback
17738 // <user_data>: callback data
17739 extern (C) void function (Proxy* proxy, IOStream* connection, ProxyAddress* proxy_address, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow connect_async;
17741 // RETURNS: a #GIOStream.
17742 // <result>: a #GAsyncResult
17743 extern (C) IOStream* /*new*/ function (Proxy* proxy, AsyncResult* result, GLib2.Error** error=null) nothrow connect_finish;
17744 // RETURNS: %TRUE if hostname resolution is supported.
17745 extern (C) int function (Proxy* proxy) nothrow supports_hostname;
17749 // #GProxyResolver provides synchronous and asynchronous network proxy
17750 // resolution. #GProxyResolver is used within #GSocketClient through
17751 // the method g_socket_connectable_proxy_enumerate().
17752 struct ProxyResolver /* Interface */ {
17753 mixin template __interface__() {
17754 // VERSION: 2.26
17755 // Gets the default #GProxyResolver for the system.
17756 // RETURNS: the default #GProxyResolver.
17757 static ProxyResolver* get_default()() nothrow {
17758 return g_proxy_resolver_get_default();
17761 // VERSION: 2.26
17762 // Checks if @resolver can be used on this system. (This is used
17763 // internally; g_proxy_resolver_get_default() will only return a proxy
17764 // resolver that returns %TRUE for this method.)
17765 // RETURNS: %TRUE if @resolver is supported.
17766 int is_supported()() nothrow {
17767 return g_proxy_resolver_is_supported(cast(ProxyResolver*)&this);
17770 // VERSION: 2.26
17771 // Looks into the system proxy configuration to determine what proxy,
17772 // if any, to use to connect to @uri. The returned proxy URIs are of the
17773 // form <literal>&lt;protocol&gt;://[user[:password]@]host:port</literal>
17774 // or <literal>direct://</literal>, where &lt;protocol&gt; could be
17775 // http, rtsp, socks or other proxying protocol.
17777 // If you don't know what network protocol is being used on the
17778 // socket, you should use <literal>none</literal> as the URI protocol.
17779 // In this case, the resolver might still return a generic proxy type
17780 // (such as SOCKS), but would not return protocol-specific proxy types
17781 // (such as http).
17783 // <literal>direct://</literal> is used when no proxy is needed.
17784 // Direct connection should not be attempted unless it is part of the
17785 // returned array of proxies.
17787 // NULL-terminated array of proxy URIs. Must be freed
17788 // with g_strfreev().
17789 // RETURNS: A
17790 // <uri>: a URI representing the destination to connect to
17791 // <cancellable>: a #GCancellable, or %NULL
17792 char** /*new*/ lookup(AT0, AT1, AT2)(AT0 /*char*/ uri, AT1 /*Cancellable*/ cancellable, AT2 /*GLib2.Error**/ error=null) nothrow {
17793 return g_proxy_resolver_lookup(cast(ProxyResolver*)&this, toCString!(char*)(uri), UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
17796 // VERSION: 2.26
17797 // Asynchronous lookup of proxy. See g_proxy_resolver_lookup() for more
17798 // details.
17799 // <uri>: a URI representing the destination to connect to
17800 // <cancellable>: a #GCancellable, or %NULL
17801 // <callback>: callback to call after resolution completes
17802 // <user_data>: data for @callback
17803 void lookup_async(AT0, AT1, AT2)(AT0 /*char*/ uri, AT1 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT2 /*void*/ user_data) nothrow {
17804 g_proxy_resolver_lookup_async(cast(ProxyResolver*)&this, toCString!(char*)(uri), UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
17807 // VERSION: 2.26
17808 // Call this function to obtain the array of proxy URIs when
17809 // g_proxy_resolver_lookup_async() is complete. See
17810 // g_proxy_resolver_lookup() for more details.
17812 // NULL-terminated array of proxy URIs. Must be freed
17813 // with g_strfreev().
17814 // RETURNS: A
17815 // <result>: the result passed to your #GAsyncReadyCallback
17816 char** /*new*/ lookup_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
17817 return g_proxy_resolver_lookup_finish(cast(ProxyResolver*)&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
17820 mixin __interface__;
17823 struct ProxyResolverInterface {
17824 GObject2.TypeInterface g_iface;
17825 // RETURNS: %TRUE if @resolver is supported.
17826 extern (C) int function (ProxyResolver* resolver) nothrow is_supported;
17828 // RETURNS: A
17829 // <uri>: a URI representing the destination to connect to
17830 // <cancellable>: a #GCancellable, or %NULL
17831 extern (C) char** /*new*/ function (ProxyResolver* resolver, char* uri, Cancellable* cancellable, GLib2.Error** error=null) nothrow lookup;
17833 // <uri>: a URI representing the destination to connect to
17834 // <cancellable>: a #GCancellable, or %NULL
17835 // <callback>: callback to call after resolution completes
17836 // <user_data>: data for @callback
17837 extern (C) void function (ProxyResolver* resolver, char* uri, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow lookup_async;
17839 // RETURNS: A
17840 // <result>: the result passed to your #GAsyncReadyCallback
17841 extern (C) char** /*new*/ function (ProxyResolver* resolver, AsyncResult* result, GLib2.Error** error=null) nothrow lookup_finish;
17845 // Unintrospectable callback: ReallocFunc() / ()
17846 // Changes the size of the memory block pointed to by @data to
17847 // @size bytes.
17849 // The function should have the same semantics as realloc().
17850 // RETURNS: a pointer to the reallocated memory
17851 // <data>: memory block to reallocate
17852 // <size>: size to reallocate @data to
17853 extern (C) alias void* function (void* data, size_t size) nothrow ReallocFunc;
17856 // The GRemoteActionGroup interface is implemented by #GActionGroup
17857 // instances that either transmit action invocations to other processes
17858 // or receive action invocations in the local process from other
17859 // processes.
17861 // The interface has <literal>_full</literal> variants of the two
17862 // methods on #GActionGroup used to activate actions:
17863 // g_action_group_activate_action() and
17864 // g_action_group_change_action_state(). These variants allow a
17865 // "platform data" #GVariant to be specified: a dictionary providing
17866 // context for the action invocation (for example: timestamps, startup
17867 // notification IDs, etc).
17869 // #GDBusActionGroup implements #GRemoteActionGroup. This provides a
17870 // mechanism to send platform data for action invocations over D-Bus.
17872 // Additionally, g_dbus_connection_export_action_group() will check if
17873 // the exported #GActionGroup implements #GRemoteActionGroup and use the
17874 // <literal>_full</literal> variants of the calls if available. This
17875 // provides a mechanism by which to receive platform data for action
17876 // invocations that arrive by way of D-Bus.
17877 struct RemoteActionGroup /* Interface */ {
17878 mixin template __interface__() {
17879 // VERSION: 2.32
17880 // Activates the remote action.
17882 // This is the same as g_action_group_activate_action() except that it
17883 // allows for provision of "platform data" to be sent along with the
17884 // activation request. This typically contains details such as the user
17885 // interaction timestamp or startup notification information.
17887 // @platform_data must be non-%NULL and must have the type
17888 // %G_VARIANT_TYPE_VARDICT. If it is floating, it will be consumed.
17889 // <action_name>: the name of the action to activate
17890 // <parameter>: the optional parameter to the activation
17891 // <platform_data>: the platform data to send
17892 void activate_action_full(AT0, AT1, AT2)(AT0 /*char*/ action_name, AT1 /*GLib2.Variant*/ parameter, AT2 /*GLib2.Variant*/ platform_data) nothrow {
17893 g_remote_action_group_activate_action_full(cast(RemoteActionGroup*)&this, toCString!(char*)(action_name), UpCast!(GLib2.Variant*)(parameter), UpCast!(GLib2.Variant*)(platform_data));
17896 // VERSION: 2.32
17897 // Changes the state of a remote action.
17899 // This is the same as g_action_group_change_action_state() except that
17900 // it allows for provision of "platform data" to be sent along with the
17901 // state change request. This typically contains details such as the
17902 // user interaction timestamp or startup notification information.
17904 // @platform_data must be non-%NULL and must have the type
17905 // %G_VARIANT_TYPE_VARDICT. If it is floating, it will be consumed.
17906 // <action_name>: the name of the action to change the state of
17907 // <value>: the new requested value for the state
17908 // <platform_data>: the platform data to send
17909 void change_action_state_full(AT0, AT1, AT2)(AT0 /*char*/ action_name, AT1 /*GLib2.Variant*/ value, AT2 /*GLib2.Variant*/ platform_data) nothrow {
17910 g_remote_action_group_change_action_state_full(cast(RemoteActionGroup*)&this, toCString!(char*)(action_name), UpCast!(GLib2.Variant*)(value), UpCast!(GLib2.Variant*)(platform_data));
17913 mixin __interface__;
17916 // The virtual function table for #GRemoteActionGroup.
17917 struct RemoteActionGroupInterface /* Version 2.32 */ {
17918 GObject2.TypeInterface g_iface;
17920 // <action_name>: the name of the action to activate
17921 // <parameter>: the optional parameter to the activation
17922 // <platform_data>: the platform data to send
17923 extern (C) void function (RemoteActionGroup* remote, char* action_name, GLib2.Variant* parameter, GLib2.Variant* platform_data) nothrow activate_action_full;
17925 // <action_name>: the name of the action to change the state of
17926 // <value>: the new requested value for the state
17927 // <platform_data>: the platform data to send
17928 extern (C) void function (RemoteActionGroup* remote, char* action_name, GLib2.Variant* value, GLib2.Variant* platform_data) nothrow change_action_state_full;
17932 // #GResolver provides cancellable synchronous and asynchronous DNS
17933 // resolution, for hostnames (g_resolver_lookup_by_address(),
17934 // g_resolver_lookup_by_name() and their async variants) and SRV
17935 // (service) records (g_resolver_lookup_service()).
17937 // #GNetworkAddress and #GNetworkService provide wrappers around
17938 // #GResolver functionality that also implement #GSocketConnectable,
17939 // making it easy to connect to a remote host/service.
17940 struct Resolver /* : GObject.Object */ {
17941 alias parent_instance this;
17942 alias parent_instance super_;
17943 alias parent_instance object;
17944 GObject2.Object parent_instance;
17945 ResolverPrivate* priv;
17948 // Unintrospectable function: free_addresses() / g_resolver_free_addresses()
17949 // VERSION: 2.22
17950 // Frees @addresses (which should be the return value from
17951 // g_resolver_lookup_by_name() or g_resolver_lookup_by_name_finish()).
17952 // (This is a convenience method; you can also simply free the results
17953 // by hand.)
17954 // <addresses>: a #GList of #GInetAddress
17955 static void free_addresses(AT0)(AT0 /*GLib2.List*/ addresses) nothrow {
17956 g_resolver_free_addresses(UpCast!(GLib2.List*)(addresses));
17959 // Unintrospectable function: free_targets() / g_resolver_free_targets()
17960 // VERSION: 2.22
17961 // Frees @targets (which should be the return value from
17962 // g_resolver_lookup_service() or g_resolver_lookup_service_finish()).
17963 // (This is a convenience method; you can also simply free the
17964 // results by hand.)
17965 // <targets>: a #GList of #GSrvTarget
17966 static void free_targets(AT0)(AT0 /*GLib2.List*/ targets) nothrow {
17967 g_resolver_free_targets(UpCast!(GLib2.List*)(targets));
17970 // VERSION: 2.22
17971 // Gets the default #GResolver. You should unref it when you are done
17972 // with it. #GResolver may use its reference count as a hint about how
17973 // many threads it should allocate for concurrent DNS resolutions.
17974 // RETURNS: the default #GResolver.
17975 static Resolver* /*new*/ get_default()() nothrow {
17976 return g_resolver_get_default();
17979 // VERSION: 2.22
17980 // Synchronously reverse-resolves @address to determine its
17981 // associated hostname.
17983 // If the DNS resolution fails, @error (if non-%NULL) will be set to
17984 // a value from #GResolverError.
17986 // If @cancellable is non-%NULL, it can be used to cancel the
17987 // operation, in which case @error (if non-%NULL) will be set to
17988 // %G_IO_ERROR_CANCELLED.
17990 // form), or %NULL on error.
17991 // RETURNS: a hostname (either ASCII-only, or in ASCII-encoded
17992 // <address>: the address to reverse-resolve
17993 // <cancellable>: a #GCancellable, or %NULL
17994 char* /*new*/ lookup_by_address(AT0, AT1, AT2)(AT0 /*InetAddress*/ address, AT1 /*Cancellable*/ cancellable, AT2 /*GLib2.Error**/ error=null) nothrow {
17995 return g_resolver_lookup_by_address(&this, UpCast!(InetAddress*)(address), UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
17998 // VERSION: 2.22
17999 // Begins asynchronously reverse-resolving @address to determine its
18000 // associated hostname, and eventually calls @callback, which must
18001 // call g_resolver_lookup_by_address_finish() to get the final result.
18002 // <address>: the address to reverse-resolve
18003 // <cancellable>: a #GCancellable, or %NULL
18004 // <callback>: callback to call after resolution completes
18005 // <user_data>: data for @callback
18006 void lookup_by_address_async(AT0, AT1, AT2)(AT0 /*InetAddress*/ address, AT1 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT2 /*void*/ user_data) nothrow {
18007 g_resolver_lookup_by_address_async(&this, UpCast!(InetAddress*)(address), UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
18010 // VERSION: 2.22
18011 // Retrieves the result of a previous call to
18012 // g_resolver_lookup_by_address_async().
18014 // If the DNS resolution failed, @error (if non-%NULL) will be set to
18015 // a value from #GResolverError. If the operation was cancelled,
18016 // @error will be set to %G_IO_ERROR_CANCELLED.
18018 // form), or %NULL on error.
18019 // RETURNS: a hostname (either ASCII-only, or in ASCII-encoded
18020 // <result>: the result passed to your #GAsyncReadyCallback
18021 char* /*new*/ lookup_by_address_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
18022 return g_resolver_lookup_by_address_finish(&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
18025 // VERSION: 2.22
18026 // Synchronously resolves @hostname to determine its associated IP
18027 // address(es). @hostname may be an ASCII-only or UTF-8 hostname, or
18028 // the textual form of an IP address (in which case this just becomes
18029 // a wrapper around g_inet_address_new_from_string()).
18031 // On success, g_resolver_lookup_by_name() will return a #GList of
18032 // #GInetAddress, sorted in order of preference and guaranteed to not
18033 // contain duplicates. That is, if using the result to connect to
18034 // @hostname, you should attempt to connect to the first address
18035 // first, then the second if the first fails, etc. If you are using
18036 // the result to listen on a socket, it is appropriate to add each
18037 // result using e.g. g_socket_listener_add_address().
18039 // If the DNS resolution fails, @error (if non-%NULL) will be set to a
18040 // value from #GResolverError.
18042 // If @cancellable is non-%NULL, it can be used to cancel the
18043 // operation, in which case @error (if non-%NULL) will be set to
18044 // %G_IO_ERROR_CANCELLED.
18046 // If you are planning to connect to a socket on the resolved IP
18047 // address, it may be easier to create a #GNetworkAddress and use its
18048 // #GSocketConnectable interface.
18050 // of #GInetAddress, or %NULL on error. You
18051 // must unref each of the addresses and free the list when you are
18052 // done with it. (You can use g_resolver_free_addresses() to do this.)
18053 // RETURNS: a #GList
18054 // <hostname>: the hostname to look up
18055 // <cancellable>: a #GCancellable, or %NULL
18056 GLib2.List* /*new*/ lookup_by_name(AT0, AT1, AT2)(AT0 /*char*/ hostname, AT1 /*Cancellable*/ cancellable, AT2 /*GLib2.Error**/ error=null) nothrow {
18057 return g_resolver_lookup_by_name(&this, toCString!(char*)(hostname), UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
18060 // VERSION: 2.22
18061 // Begins asynchronously resolving @hostname to determine its
18062 // associated IP address(es), and eventually calls @callback, which
18063 // must call g_resolver_lookup_by_name_finish() to get the result.
18064 // See g_resolver_lookup_by_name() for more details.
18065 // <hostname>: the hostname to look up the address of
18066 // <cancellable>: a #GCancellable, or %NULL
18067 // <callback>: callback to call after resolution completes
18068 // <user_data>: data for @callback
18069 void lookup_by_name_async(AT0, AT1, AT2)(AT0 /*char*/ hostname, AT1 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT2 /*void*/ user_data) nothrow {
18070 g_resolver_lookup_by_name_async(&this, toCString!(char*)(hostname), UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
18073 // VERSION: 2.22
18074 // Retrieves the result of a call to
18075 // g_resolver_lookup_by_name_async().
18077 // If the DNS resolution failed, @error (if non-%NULL) will be set to
18078 // a value from #GResolverError. If the operation was cancelled,
18079 // @error will be set to %G_IO_ERROR_CANCELLED.
18081 // of #GInetAddress, or %NULL on error. See g_resolver_lookup_by_name()
18082 // for more details.
18083 // RETURNS: a #GList
18084 // <result>: the result passed to your #GAsyncReadyCallback
18085 GLib2.List* /*new*/ lookup_by_name_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
18086 return g_resolver_lookup_by_name_finish(&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
18089 // VERSION: 2.22
18090 // Synchronously performs a DNS SRV lookup for the given @service and
18091 // @protocol in the given @domain and returns an array of #GSrvTarget.
18092 // @domain may be an ASCII-only or UTF-8 hostname. Note also that the
18093 // @service and @protocol arguments <emphasis>do not</emphasis>
18094 // include the leading underscore that appears in the actual DNS
18095 // entry.
18097 // On success, g_resolver_lookup_service() will return a #GList of
18098 // #GSrvTarget, sorted in order of preference. (That is, you should
18099 // attempt to connect to the first target first, then the second if
18100 // the first fails, etc.)
18102 // If the DNS resolution fails, @error (if non-%NULL) will be set to
18103 // a value from #GResolverError.
18105 // If @cancellable is non-%NULL, it can be used to cancel the
18106 // operation, in which case @error (if non-%NULL) will be set to
18107 // %G_IO_ERROR_CANCELLED.
18109 // If you are planning to connect to the service, it is usually easier
18110 // to create a #GNetworkService and use its #GSocketConnectable
18111 // interface.
18113 // or %NULL on error. You must free each of the targets and the list when you are
18114 // done with it. (You can use g_resolver_free_targets() to do this.)
18115 // RETURNS: a #GList of #GSrvTarget,
18116 // <service>: the service type to look up (eg, "ldap")
18117 // <protocol>: the networking protocol to use for @service (eg, "tcp")
18118 // <domain>: the DNS domain to look up the service in
18119 // <cancellable>: a #GCancellable, or %NULL
18120 GLib2.List* /*new*/ lookup_service(AT0, AT1, AT2, AT3, AT4)(AT0 /*char*/ service, AT1 /*char*/ protocol, AT2 /*char*/ domain, AT3 /*Cancellable*/ cancellable, AT4 /*GLib2.Error**/ error=null) nothrow {
18121 return g_resolver_lookup_service(&this, toCString!(char*)(service), toCString!(char*)(protocol), toCString!(char*)(domain), UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
18124 // VERSION: 2.22
18125 // Begins asynchronously performing a DNS SRV lookup for the given
18126 // @service and @protocol in the given @domain, and eventually calls
18127 // @callback, which must call g_resolver_lookup_service_finish() to
18128 // get the final result. See g_resolver_lookup_service() for more
18129 // details.
18130 // <service>: the service type to look up (eg, "ldap")
18131 // <protocol>: the networking protocol to use for @service (eg, "tcp")
18132 // <domain>: the DNS domain to look up the service in
18133 // <cancellable>: a #GCancellable, or %NULL
18134 // <callback>: callback to call after resolution completes
18135 // <user_data>: data for @callback
18136 void lookup_service_async(AT0, AT1, AT2, AT3, AT4)(AT0 /*char*/ service, AT1 /*char*/ protocol, AT2 /*char*/ domain, AT3 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT4 /*void*/ user_data) nothrow {
18137 g_resolver_lookup_service_async(&this, toCString!(char*)(service), toCString!(char*)(protocol), toCString!(char*)(domain), UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
18140 // VERSION: 2.22
18141 // Retrieves the result of a previous call to
18142 // g_resolver_lookup_service_async().
18144 // If the DNS resolution failed, @error (if non-%NULL) will be set to
18145 // a value from #GResolverError. If the operation was cancelled,
18146 // @error will be set to %G_IO_ERROR_CANCELLED.
18148 // or %NULL on error. See g_resolver_lookup_service() for more details.
18149 // RETURNS: a #GList of #GSrvTarget,
18150 // <result>: the result passed to your #GAsyncReadyCallback
18151 GLib2.List* /*new*/ lookup_service_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
18152 return g_resolver_lookup_service_finish(&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
18155 // VERSION: 2.22
18156 // Sets @resolver to be the application's default resolver (reffing
18157 // @resolver, and unreffing the previous default resolver, if any).
18158 // Future calls to g_resolver_get_default() will return this resolver.
18160 // This can be used if an application wants to perform any sort of DNS
18161 // caching or "pinning"; it can implement its own #GResolver that
18162 // calls the original default resolver for DNS operations, and
18163 // implements its own cache policies on top of that, and then set
18164 // itself as the default resolver for all later code to use.
18165 void set_default()() nothrow {
18166 g_resolver_set_default(&this);
18169 // Emitted when the resolver notices that the system resolver
18170 // configuration has changed.
18171 extern (C) alias static void function (Resolver* this_, void* user_data=null) nothrow signal_reload;
18173 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
18174 return super_.signal_connect!name(cb, data, cf);
18177 ulong signal_connect(string name:"reload", CB/*:signal_reload*/)
18178 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
18179 if (is(typeof(cb)==signal_reload)||_ttmm!(CB, signal_reload)()) {
18180 return signal_connect_data!()(&this, cast(char*)"reload",
18181 cast(GObject2.Callback)cb, data, null, cf);
18185 struct ResolverClass {
18186 GObject2.ObjectClass parent_class;
18187 extern (C) void function (Resolver* resolver) nothrow reload;
18189 // RETURNS: a #GList
18190 // <hostname>: the hostname to look up
18191 // <cancellable>: a #GCancellable, or %NULL
18192 extern (C) GLib2.List* /*new*/ function (Resolver* resolver, char* hostname, Cancellable* cancellable, GLib2.Error** error=null) nothrow lookup_by_name;
18194 // <hostname>: the hostname to look up the address of
18195 // <cancellable>: a #GCancellable, or %NULL
18196 // <callback>: callback to call after resolution completes
18197 // <user_data>: data for @callback
18198 extern (C) void function (Resolver* resolver, char* hostname, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow lookup_by_name_async;
18200 // RETURNS: a #GList
18201 // <result>: the result passed to your #GAsyncReadyCallback
18202 extern (C) GLib2.List* /*new*/ function (Resolver* resolver, AsyncResult* result, GLib2.Error** error=null) nothrow lookup_by_name_finish;
18204 // RETURNS: a hostname (either ASCII-only, or in ASCII-encoded
18205 // <address>: the address to reverse-resolve
18206 // <cancellable>: a #GCancellable, or %NULL
18207 extern (C) char* /*new*/ function (Resolver* resolver, InetAddress* address, Cancellable* cancellable, GLib2.Error** error=null) nothrow lookup_by_address;
18209 // <address>: the address to reverse-resolve
18210 // <cancellable>: a #GCancellable, or %NULL
18211 // <callback>: callback to call after resolution completes
18212 // <user_data>: data for @callback
18213 extern (C) void function (Resolver* resolver, InetAddress* address, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow lookup_by_address_async;
18215 // RETURNS: a hostname (either ASCII-only, or in ASCII-encoded
18216 // <result>: the result passed to your #GAsyncReadyCallback
18217 extern (C) char* /*new*/ function (Resolver* resolver, AsyncResult* result, GLib2.Error** error=null) nothrow lookup_by_address_finish;
18218 // Unintrospectable functionp: lookup_service() / ()
18219 extern (C) GLib2.List* function (Resolver* resolver, char* rrname, Cancellable* cancellable, GLib2.Error** error=null) nothrow lookup_service;
18220 extern (C) void function (Resolver* resolver, char* rrname, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow lookup_service_async;
18222 // RETURNS: a #GList of #GSrvTarget,
18223 // <result>: the result passed to your #GAsyncReadyCallback
18224 extern (C) GLib2.List* /*new*/ function (Resolver* resolver, AsyncResult* result, GLib2.Error** error=null) nothrow lookup_service_finish;
18225 extern (C) void function () nothrow _g_reserved1;
18226 extern (C) void function () nothrow _g_reserved2;
18227 extern (C) void function () nothrow _g_reserved3;
18228 extern (C) void function () nothrow _g_reserved4;
18229 extern (C) void function () nothrow _g_reserved5;
18230 extern (C) void function () nothrow _g_reserved6;
18234 // An error code used with %G_RESOLVER_ERROR in a #GError returned
18235 // from a #GResolver routine.
18236 enum ResolverError /* Version 2.22 */ {
18237 NOT_FOUND = 0,
18238 TEMPORARY_FAILURE = 1,
18239 INTERNAL = 2
18241 struct ResolverPrivate {
18245 // Applications and libraries often contain binary or textual data that is really part of the
18246 // application, rather than user data. For instance #GtkBuilder .ui files, splashscreen images,
18247 // GMenu markup xml, CSS files, icons, etc. These are often shipped as files in <filename>$datadir/appname</filename>, or
18248 // manually included as literal strings in the code.
18250 // The #GResource API and the <link linkend="glib-compile-resources">glib-compile-resources</link> program
18251 // provide a convenient and efficient alternative to this which has some nice properties. You
18252 // maintain the files as normal files, so its easy to edit them, but during the build the files
18253 // are combined into a binary bundle that is linked into the executable. This means that loading
18254 // the resource files are efficient (as they are already in memory, shared with other instances) and
18255 // simple (no need to check for things like I/O errors or locate the files in the filesystem). It
18256 // also makes it easier to create relocatable applications.
18258 // Resource files can also be marked as compresses. Such files will be included in the resource bundle
18259 // in a compressed form, but will be automatically uncompressed when the resource is used. This
18260 // is very useful e.g. for larger text files that are parsed once (or rarely) and then thrown away.
18262 // Resource files can also be marked to be preprocessed, by setting the value of the
18263 // <literal>preprocess</literal> attribute to a comma-separated list of preprocessing options.
18264 // The only options currently supported are:
18266 // <literal>xml-stripblanks</literal> which will use <command>xmllint</command> to strip
18267 // ignorable whitespace from the xml file. For this to work, the <envar>XMLLINT</envar>
18268 // environment variable must be set to the full path to the xmllint executable, or xmllint
18269 // must be in the PATH; otherwise the preprocessing step is skipped.
18271 // <literal>to-pixdata</literal> which will use <command>gdk-pixbuf-pixdata</command> to convert
18272 // images to the GdkPixdata format, which allows you to create pixbufs directly using the data inside
18273 // the resource file, rather than an (uncompressed) copy if it. For this, the gdk-pixbuf-pixdata
18274 // program must be in the PATH, or the <envar>GDK_PIXBUF_PIXDATA</envar> environment variable must be
18275 // set to the full path to the gdk-pixbuf-pixdata executable; otherwise the resource compiler will
18276 // abort.
18278 // Resource bundles are created by the <link linkend="glib-compile-resources">glib-compile-resources</link> program
18279 // which takes an xml file that describes the bundle, and a set of files that the xml references. These
18280 // are combined into a binary resource bundle.
18282 // <example id="resource-example"><title>Example resource description</title>
18283 // <programlisting><![CDATA[
18284 // <?xml version="1.0" encoding="UTF-8"?>
18285 // <gresources>
18286 // <gresource prefix="/org/gtk/Example">
18287 // <file>data/splashscreen.png</file>
18288 // <file compressed="true">dialog.ui</file>
18289 // <file preprocess="xml-stripblanks">menumarkup.xml</file>
18290 // </gresource>
18291 // </gresources>
18292 // ]]></programlisting></example>
18294 // This will create a resource bundle with the following files:
18295 // <programlisting><![CDATA[
18296 // /org/gtk/Example/data/splashscreen.png
18297 // /org/gtk/Example/dialog.ui
18298 // /org/gtk/Example/menumarkup.xml
18299 // ]]></programlisting>
18301 // Note that all resources in the process share the same namespace, so use java-style
18302 // path prefixes (like in the above example) to avoid conflicts.
18304 // You can then use <link linkend="glib-compile-resources">glib-compile-resources</link> to compile the xml to a
18305 // binary bundle that you can load with g_resource_load(). However, its more common to use the --generate-source and
18306 // --generate-header arguments to create a source file and header to link directly into your application.
18308 // Once a #GResource has been created and registered all the data in it can be accessed globally in the process by
18309 // using API calls like g_resources_open_stream() to stream the data or g_resources_lookup_data() to get a direct pointer
18310 // to the data. You can also use uris like "resource:///org/gtk/Example/data/splashscreen.png" with #GFile to access
18311 // the resource data.
18313 // There are two forms of the generated source, the default version uses the compiler support for constructor
18314 // and destructor functions (where availible) to automatically create and register the #GResource on startup
18315 // or library load time. If you pass --manual-register two functions to register/unregister the resource is instead
18316 // created. This requires an explicit initialization call in your application/library, but it works on all platforms,
18317 // even on the minor ones where this is not availible. (Constructor support is availible for at least Win32, MacOS and Linux.)
18319 // Note that resource data can point directly into the data segment of e.g. a library, so if you are unloading libraries
18320 // during runtime you need to be very careful with keeping around pointers to data from a resource, as this goes away
18321 // when the library is unloaded. However, in practice this is not generally a problem, since most resource accesses
18322 // is for your own resources, and resource data is often used once, during parsing, and then released.
18323 struct Resource /* Version 2.32 */ {
18325 // VERSION: 2.32
18326 // Creates a GResource from a reference to the binary resource bundle.
18327 // This will keep a reference to @data while the resource lives, so
18328 // the data should not be modified or freed.
18330 // If you want to use this resource in the global resource namespace you need
18331 // to register it with g_resources_register().
18332 // RETURNS: a new #GResource, or %NULL on error.
18333 // <data>: A #GBytes.
18334 static Resource* /*new*/ new_from_data(AT0, AT1)(AT0 /*GLib2.Bytes*/ data, AT1 /*GLib2.Error**/ error=null) nothrow {
18335 return g_resource_new_from_data(UpCast!(GLib2.Bytes*)(data), UpCast!(GLib2.Error**)(error));
18337 static auto opCall(AT0, AT1)(AT0 /*GLib2.Bytes*/ data, AT1 /*GLib2.Error**/ error=null) {
18338 return g_resource_new_from_data(UpCast!(GLib2.Bytes*)(data), UpCast!(GLib2.Error**)(error));
18341 // VERSION: 2.32
18342 // Registers the resource with the process-global set of resources.
18343 // Once a resource is registered the files in it can be accessed
18344 // with the global resource lookup functions like g_resources_lookup_data().
18345 void _register()() nothrow {
18346 g_resources_register(&this);
18349 // VERSION: 2.32
18350 // Unregisters the resource from the process-global set of resources.
18351 void _unregister()() nothrow {
18352 g_resources_unregister(&this);
18355 // VERSION: 2.32
18356 // Returns all the names of children at the specified @path in the resource.
18357 // The return result is a %NULL terminated list of strings which should
18358 // be released with g_strfreev().
18360 // @lookup_flags controls the behaviour of the lookup.
18361 // RETURNS: an array of constant strings
18362 // <path>: A pathname inside the resource.
18363 // <lookup_flags>: A #GResourceLookupFlags.
18364 char** /*new*/ enumerate_children(AT0, AT1)(AT0 /*char*/ path, ResourceLookupFlags lookup_flags, AT1 /*GLib2.Error**/ error=null) nothrow {
18365 return g_resource_enumerate_children(&this, toCString!(char*)(path), lookup_flags, UpCast!(GLib2.Error**)(error));
18368 // VERSION: 2.32
18369 // Looks for a file at the specified @path in the resource and
18370 // if found returns information about it.
18372 // @lookup_flags controls the behaviour of the lookup.
18373 // RETURNS: %TRUE if the file was found. %FALSE if there were errors.
18374 // <path>: A pathname inside the resource.
18375 // <lookup_flags>: A #GResourceLookupFlags.
18376 // <size>: a location to place the length of the contents of the file, or %NULL if the length is not needed
18377 // <flags>: a location to place the flags about the file, or %NULL if the length is not needed
18378 int get_info(AT0, AT1, AT2, AT3)(AT0 /*char*/ path, ResourceLookupFlags lookup_flags, /*out*/ AT1 /*size_t*/ size, /*out*/ AT2 /*uint*/ flags, AT3 /*GLib2.Error**/ error=null) nothrow {
18379 return g_resource_get_info(&this, toCString!(char*)(path), lookup_flags, UpCast!(size_t*)(size), UpCast!(uint*)(flags), UpCast!(GLib2.Error**)(error));
18382 // VERSION: 2.32
18383 // Looks for a file at the specified @path in the resource and
18384 // returns a #GBytes that lets you directly access the data in
18385 // memory.
18387 // The data is always followed by a zero byte, so you
18388 // can safely use the data as a C string. However, that byte
18389 // is not included in the size of the GBytes.
18391 // For uncompressed resource files this is a pointer directly into
18392 // the resource bundle, which is typically in some readonly data section
18393 // in the program binary. For compressed files we allocate memory on
18394 // the heap and automatically uncompress the data.
18396 // @lookup_flags controls the behaviour of the lookup.
18398 // Free the returned object with g_bytes_unref().
18399 // RETURNS: #GBytes or %NULL on error.
18400 // <path>: A pathname inside the resource.
18401 // <lookup_flags>: A #GResourceLookupFlags.
18402 GLib2.Bytes* /*new*/ lookup_data(AT0, AT1)(AT0 /*char*/ path, ResourceLookupFlags lookup_flags, AT1 /*GLib2.Error**/ error=null) nothrow {
18403 return g_resource_lookup_data(&this, toCString!(char*)(path), lookup_flags, UpCast!(GLib2.Error**)(error));
18406 // VERSION: 2.32
18407 // Looks for a file at the specified @path in the resource and
18408 // returns a #GInputStream that lets you read the data.
18410 // @lookup_flags controls the behaviour of the lookup.
18412 // Free the returned object with g_object_unref().
18413 // RETURNS: #GInputStream or %NULL on error.
18414 // <path>: A pathname inside the resource.
18415 // <lookup_flags>: A #GResourceLookupFlags.
18416 InputStream* /*new*/ open_stream(AT0, AT1)(AT0 /*char*/ path, ResourceLookupFlags lookup_flags, AT1 /*GLib2.Error**/ error=null) nothrow {
18417 return g_resource_open_stream(&this, toCString!(char*)(path), lookup_flags, UpCast!(GLib2.Error**)(error));
18420 // VERSION: 2.32
18421 // Atomically increments the reference count of @array by one. This
18422 // function is MT-safe and may be called from any thread.
18423 // RETURNS: The passed in #GResource.
18424 Resource* /*new*/ ref_()() nothrow {
18425 return g_resource_ref(&this);
18428 // VERSION: 2.32
18429 // Atomically decrements the reference count of @resource by one. If the
18430 // reference count drops to 0, all memory allocated by the array is
18431 // released. This function is MT-safe and may be called from any
18432 // thread.
18433 void unref()() nothrow {
18434 g_resource_unref(&this);
18437 // VERSION: 2.32
18438 // Loads a binary resource bundle and creates a #GResource representation of it, allowing
18439 // you to query it for data.
18441 // If you want to use this resource in the global resource namespace you need
18442 // to register it with g_resources_register().
18443 // RETURNS: a new #GResource, or %NULL on error.
18444 // <filename>: the path of a filename to load, in the GLib filename encoding.
18445 static Resource* /*new*/ load(AT0, AT1)(AT0 /*char*/ filename, AT1 /*GLib2.Error**/ error=null) nothrow {
18446 return g_resource_load(toCString!(char*)(filename), UpCast!(GLib2.Error**)(error));
18451 // An error code used with %G_RESOURCE_ERROR in a #GError returned
18452 // from a #GResource routine.
18453 enum ResourceError /* Version 2.32 */ {
18454 NOT_FOUND = 0,
18455 INTERNAL = 1
18458 // GResourceFlags give information about a particular file inside a resource
18459 // bundle.
18460 enum ResourceFlags /* Version 2.32 */ {
18461 NONE = 0,
18462 COMPRESSED = 1
18464 // GResourceLookupFlags determine how resource path lookups are handled.
18465 enum ResourceLookupFlags /* Version 2.32 */ {
18466 NONE = 0
18469 // #GSeekable is implemented by streams (implementations of
18470 // #GInputStream or #GOutputStream) that support seeking.
18471 struct Seekable /* Interface */ {
18472 mixin template __interface__() {
18473 // Tests if the stream supports the #GSeekableIface.
18474 // RETURNS: %TRUE if @seekable can be seeked. %FALSE otherwise.
18475 int can_seek()() nothrow {
18476 return g_seekable_can_seek(cast(Seekable*)&this);
18479 // Tests if the stream can be truncated.
18480 // RETURNS: %TRUE if the stream can be truncated, %FALSE otherwise.
18481 int can_truncate()() nothrow {
18482 return g_seekable_can_truncate(cast(Seekable*)&this);
18485 // Seeks in the stream by the given @offset, modified by @type.
18487 // If @cancellable is not %NULL, then the operation can be cancelled by
18488 // triggering the cancellable object from another thread. If the operation
18489 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18491 // has occurred, this function will return %FALSE and set @error
18492 // appropriately if present.
18493 // RETURNS: %TRUE if successful. If an error
18494 // <offset>: a #goffset.
18495 // <type>: a #GSeekType.
18496 // <cancellable>: optional #GCancellable object, %NULL to ignore.
18497 int seek(AT0, AT1)(long offset, GLib2.SeekType type, AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
18498 return g_seekable_seek(cast(Seekable*)&this, offset, type, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
18501 // Tells the current position within the stream.
18502 // RETURNS: the offset from the beginning of the buffer.
18503 long tell()() nothrow {
18504 return g_seekable_tell(cast(Seekable*)&this);
18507 // Truncates a stream with a given #offset.
18509 // If @cancellable is not %NULL, then the operation can be cancelled by
18510 // triggering the cancellable object from another thread. If the operation
18511 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
18512 // operation was partially finished when the operation was cancelled the
18513 // partial result will be returned, without an error.
18515 // has occurred, this function will return %FALSE and set @error
18516 // appropriately if present.
18517 // RETURNS: %TRUE if successful. If an error
18518 // <offset>: a #goffset.
18519 // <cancellable>: optional #GCancellable object, %NULL to ignore.
18520 int truncate(AT0, AT1)(long offset, AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
18521 return g_seekable_truncate(cast(Seekable*)&this, offset, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
18524 mixin __interface__;
18527 // Provides an interface for implementing seekable functionality on I/O Streams.
18528 struct SeekableIface {
18529 GObject2.TypeInterface g_iface;
18530 // RETURNS: the offset from the beginning of the buffer.
18531 extern (C) long function (Seekable* seekable) nothrow tell;
18532 // RETURNS: %TRUE if @seekable can be seeked. %FALSE otherwise.
18533 extern (C) int function (Seekable* seekable) nothrow can_seek;
18535 // RETURNS: %TRUE if successful. If an error
18536 // <offset>: a #goffset.
18537 // <type>: a #GSeekType.
18538 // <cancellable>: optional #GCancellable object, %NULL to ignore.
18539 extern (C) int function (Seekable* seekable, long offset, GLib2.SeekType type, Cancellable* cancellable, GLib2.Error** error=null) nothrow seek;
18540 // RETURNS: %TRUE if the stream can be truncated, %FALSE otherwise.
18541 extern (C) int function (Seekable* seekable) nothrow can_truncate;
18543 // RETURNS: %TRUE if successful. If an error
18544 // <offset>: a #goffset.
18545 // <cancellable>: optional #GCancellable object, %NULL to ignore.
18546 extern (C) int function (Seekable* seekable, long offset, Cancellable* cancellable, GLib2.Error** error=null) nothrow truncate_fn;
18550 // The #GSettings class provides a convenient API for storing and retrieving
18551 // application settings.
18553 // Reads and writes can be considered to be non-blocking. Reading
18554 // settings with #GSettings is typically extremely fast: on
18555 // approximately the same order of magnitude (but slower than) a
18556 // #GHashTable lookup. Writing settings is also extremely fast in terms
18557 // of time to return to your application, but can be extremely expensive
18558 // for other threads and other processes. Many settings backends
18559 // (including dconf) have lazy initialisation which means in the common
18560 // case of the user using their computer without modifying any settings
18561 // a lot of work can be avoided. For dconf, the D-Bus service doesn't
18562 // even need to be started in this case. For this reason, you should
18563 // only ever modify #GSettings keys in response to explicit user action.
18564 // Particular care should be paid to ensure that modifications are not
18565 // made during startup -- for example, when setting the initial value
18566 // of preferences widgets. The built-in g_settings_bind() functionality
18567 // is careful not to write settings in response to notify signals as a
18568 // result of modifications that it makes to widgets.
18570 // When creating a GSettings instance, you have to specify a schema
18571 // that describes the keys in your settings and their types and default
18572 // values, as well as some other information.
18574 // Normally, a schema has as fixed path that determines where the settings
18575 // are stored in the conceptual global tree of settings. However, schemas
18576 // can also be 'relocatable', i.e. not equipped with a fixed path. This is
18577 // useful e.g. when the schema describes an 'account', and you want to be
18578 // able to store a arbitrary number of accounts.
18580 // Unlike other configuration systems (like GConf), GSettings does not
18581 // restrict keys to basic types like strings and numbers. GSettings stores
18582 // values as #GVariant, and allows any #GVariantType for keys. Key names
18583 // are restricted to lowercase characters, numbers and '-'. Furthermore,
18584 // the names must begin with a lowercase character, must not end
18585 // with a '-', and must not contain consecutive dashes.
18587 // Similar to GConf, the default values in GSettings schemas can be
18588 // localized, but the localized values are stored in gettext catalogs
18589 // and looked up with the domain that is specified in the
18590 // <tag class="attribute">gettext-domain</tag> attribute of the
18591 // <tag class="starttag">schemalist</tag> or <tag class="starttag">schema</tag>
18592 // elements and the category that is specified in the l10n attribute of the
18593 // <tag class="starttag">key</tag> element.
18595 // GSettings uses schemas in a compact binary form that is created
18596 // by the <link linkend="glib-compile-schemas">glib-compile-schemas</link>
18597 // utility. The input is a schema description in an XML format that can be
18598 // described by the following DTD:
18599 // |[<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/gschema.dtd"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include>]|
18601 // glib-compile-schemas expects schema files to have the extension <filename>.gschema.xml</filename>
18603 // At runtime, schemas are identified by their id (as specified
18604 // in the <tag class="attribute">id</tag> attribute of the
18605 // <tag class="starttag">schema</tag> element). The
18606 // convention for schema ids is to use a dotted name, similar in
18607 // style to a D-Bus bus name, e.g. "org.gnome.SessionManager". In particular,
18608 // if the settings are for a specific service that owns a D-Bus bus name,
18609 // the D-Bus bus name and schema id should match. For schemas which deal
18610 // with settings not associated with one named application, the id should
18611 // not use StudlyCaps, e.g. "org.gnome.font-rendering".
18613 // In addition to #GVariant types, keys can have types that have enumerated
18614 // types. These can be described by a <tag class="starttag">choice</tag>,
18615 // <tag class="starttag">enum</tag> or <tag class="starttag">flags</tag> element, see
18616 // <xref linkend="schema-enumerated"/>. The underlying type of
18617 // such a key is string, but you can use g_settings_get_enum(),
18618 // g_settings_set_enum(), g_settings_get_flags(), g_settings_set_flags()
18619 // access the numeric values corresponding to the string value of enum
18620 // and flags keys.
18622 // <example id="schema-default-values"><title>Default values</title>
18623 // <programlisting><![CDATA[
18624 // <schemalist>
18625 // <schema id="org.gtk.Test" path="/tests/" gettext-domain="test">
18627 // <key name="greeting" type="s">
18628 // <default l10n="messages">"Hello, earthlings"</default>
18629 // <summary>A greeting</summary>
18630 // <description>
18631 // Greeting of the invading martians
18632 // </description>
18633 // </key>
18635 // <key name="box" type="(ii)">
18636 // <default>(20,30)</default>
18637 // </key>
18639 // </schema>
18640 // </schemalist>
18641 // ]]></programlisting></example>
18643 // <example id="schema-enumerated"><title>Ranges, choices and enumerated types</title>
18644 // <programlisting><![CDATA[
18645 // <schemalist>
18647 // <enum id="org.gtk.Test.myenum">
18648 // <value nick="first" value="1"/>
18649 // <value nick="second" value="2"/>
18650 // </enum>
18652 // <flags id="org.gtk.Test.myflags">
18653 // <value nick="flag1" value="1"/>
18654 // <value nick="flag2" value="2"/>
18655 // <value nick="flag3" value="4"/>
18656 // </flags>
18658 // <schema id="org.gtk.Test">
18660 // <key name="key-with-range" type="i">
18661 // <range min="1" max="100"/>
18662 // <default>10</default>
18663 // </key>
18665 // <key name="key-with-choices" type="s">
18666 // <choices>
18667 // <choice value='Elisabeth'/>
18668 // <choice value='Annabeth'/>
18669 // <choice value='Joe'/>
18670 // </choices>
18671 // <aliases>
18672 // <alias value='Anna' target='Annabeth'/>
18673 // <alias value='Beth' target='Elisabeth'/>
18674 // </aliases>
18675 // <default>'Joe'</default>
18676 // </key>
18678 // <key name='enumerated-key' enum='org.gtk.Test.myenum'>
18679 // <default>'first'</default>
18680 // </key>
18682 // <key name='flags-key' flags='org.gtk.Test.myflags'>
18683 // <default>["flag1",flag2"]</default>
18684 // </key>
18685 // </schema>
18686 // </schemalist>
18687 // ]]></programlisting></example>
18689 // <refsect2>
18690 // <title>Vendor overrides</title>
18691 // <para>
18692 // Default values are defined in the schemas that get installed by
18693 // an application. Sometimes, it is necessary for a vendor or distributor
18694 // to adjust these defaults. Since patching the XML source for the schema
18695 // is inconvenient and error-prone,
18696 // <link linkend="glib-compile-schemas">glib-compile-schemas</link> reads
18697 // so-called 'vendor override' files. These are keyfiles in the same
18698 // directory as the XML schema sources which can override default values.
18699 // The schema id serves as the group name in the key file, and the values
18700 // are expected in serialized GVariant form, as in the following example:
18701 // <informalexample><programlisting>
18702 // [org.gtk.Example]
18703 // key1='string'
18704 // key2=1.5
18705 // </programlisting></informalexample>
18706 // </para>
18707 // <para>
18708 // glib-compile-schemas expects schema files to have the extension
18709 // <filename>.gschema.override</filename>
18710 // </para>
18711 // </refsect2>
18713 // <refsect2>
18714 // <title>Binding</title>
18715 // <para>
18716 // A very convenient feature of GSettings lets you bind #GObject properties
18717 // directly to settings, using g_settings_bind(). Once a GObject property
18718 // has been bound to a setting, changes on either side are automatically
18719 // propagated to the other side. GSettings handles details like
18720 // mapping between GObject and GVariant types, and preventing infinite
18721 // cycles.
18722 // </para>
18723 // <para>
18724 // This makes it very easy to hook up a preferences dialog to the
18725 // underlying settings. To make this even more convenient, GSettings
18726 // looks for a boolean property with the name "sensitivity" and
18727 // automatically binds it to the writability of the bound setting.
18728 // If this 'magic' gets in the way, it can be suppressed with the
18729 // #G_SETTINGS_BIND_NO_SENSITIVITY flag.
18730 // </para>
18731 // </refsect2>
18732 struct Settings /* : GObject.Object */ {
18733 alias parent_instance this;
18734 alias parent_instance super_;
18735 alias parent_instance object;
18736 GObject2.Object parent_instance;
18737 SettingsPrivate* priv;
18740 // VERSION: 2.26
18741 // Creates a new #GSettings object with the schema specified by
18742 // @schema_id.
18744 // Signals on the newly created #GSettings object will be dispatched
18745 // via the thread-default #GMainContext in effect at the time of the
18746 // call to g_settings_new(). The new #GSettings will hold a reference
18747 // on the context. See g_main_context_push_thread_default().
18748 // RETURNS: a new #GSettings object
18749 // <schema_id>: the id of the schema
18750 static Settings* /*new*/ new_(AT0)(AT0 /*char*/ schema_id) nothrow {
18751 return g_settings_new(toCString!(char*)(schema_id));
18753 static auto opCall(AT0)(AT0 /*char*/ schema_id) {
18754 return g_settings_new(toCString!(char*)(schema_id));
18757 // VERSION: 2.32
18758 // Creates a new #GSettings object with a given schema, backend and
18759 // path.
18761 // It should be extremely rare that you ever want to use this function.
18762 // It is made available for advanced use-cases (such as plugin systems
18763 // that want to provide access to schemas loaded from custom locations,
18764 // etc).
18766 // At the most basic level, a #GSettings object is a pure composition of
18767 // 4 things: a #GSettingsSchema, a #GSettingsBackend, a path within that
18768 // backend, and a #GMainContext to which signals are dispatched.
18770 // This constructor therefore gives you full control over constructing
18771 // #GSettings instances. The first 4 parameters are given directly as
18772 // @schema, @backend and @path, and the main context is taken from the
18773 // thread-default (as per g_settings_new()).
18775 // If @backend is %NULL then the default backend is used.
18777 // If @path is %NULL then the path from the schema is used. It is an
18778 // error f @path is %NULL and the schema has no path of its own or if
18779 // @path is non-%NULL and not equal to the path that the schema does
18780 // have.
18781 // RETURNS: a new #GSettings object
18782 // <schema>: a #GSettingsSchema
18783 // <backend>: a #GSettingsBackend
18784 // <path>: the path to use
18785 static Settings* /*new*/ new_full(AT0, AT1, AT2)(AT0 /*SettingsSchema*/ schema, AT1 /*SettingsBackend*/ backend=null, AT2 /*char*/ path=null) nothrow {
18786 return g_settings_new_full(UpCast!(SettingsSchema*)(schema), UpCast!(SettingsBackend*)(backend), toCString!(char*)(path));
18788 static auto opCall(AT0, AT1, AT2)(AT0 /*SettingsSchema*/ schema, AT1 /*SettingsBackend*/ backend=null, AT2 /*char*/ path=null) {
18789 return g_settings_new_full(UpCast!(SettingsSchema*)(schema), UpCast!(SettingsBackend*)(backend), toCString!(char*)(path));
18792 // VERSION: 2.26
18793 // Creates a new #GSettings object with the schema specified by
18794 // @schema_id and a given #GSettingsBackend.
18796 // Creating a #GSettings object with a different backend allows accessing
18797 // settings from a database other than the usual one. For example, it may make
18798 // sense to pass a backend corresponding to the "defaults" settings database on
18799 // the system to get a settings object that modifies the system default
18800 // settings instead of the settings for this user.
18801 // RETURNS: a new #GSettings object
18802 // <schema_id>: the id of the schema
18803 // <backend>: the #GSettingsBackend to use
18804 static Settings* /*new*/ new_with_backend(AT0, AT1)(AT0 /*char*/ schema_id, AT1 /*SettingsBackend*/ backend) nothrow {
18805 return g_settings_new_with_backend(toCString!(char*)(schema_id), UpCast!(SettingsBackend*)(backend));
18807 static auto opCall(AT0, AT1)(AT0 /*char*/ schema_id, AT1 /*SettingsBackend*/ backend) {
18808 return g_settings_new_with_backend(toCString!(char*)(schema_id), UpCast!(SettingsBackend*)(backend));
18811 // VERSION: 2.26
18812 // Creates a new #GSettings object with the schema specified by
18813 // @schema_id and a given #GSettingsBackend and path.
18815 // This is a mix of g_settings_new_with_backend() and
18816 // g_settings_new_with_path().
18817 // RETURNS: a new #GSettings object
18818 // <schema_id>: the id of the schema
18819 // <backend>: the #GSettingsBackend to use
18820 // <path>: the path to use
18821 static Settings* /*new*/ new_with_backend_and_path(AT0, AT1, AT2)(AT0 /*char*/ schema_id, AT1 /*SettingsBackend*/ backend, AT2 /*char*/ path) nothrow {
18822 return g_settings_new_with_backend_and_path(toCString!(char*)(schema_id), UpCast!(SettingsBackend*)(backend), toCString!(char*)(path));
18824 static auto opCall(AT0, AT1, AT2)(AT0 /*char*/ schema_id, AT1 /*SettingsBackend*/ backend, AT2 /*char*/ path) {
18825 return g_settings_new_with_backend_and_path(toCString!(char*)(schema_id), UpCast!(SettingsBackend*)(backend), toCString!(char*)(path));
18828 // VERSION: 2.26
18829 // Creates a new #GSettings object with the relocatable schema specified
18830 // by @schema_id and a given path.
18832 // You only need to do this if you want to directly create a settings
18833 // object with a schema that doesn't have a specified path of its own.
18834 // That's quite rare.
18836 // It is a programmer error to call this function for a schema that
18837 // has an explicitly specified path.
18838 // RETURNS: a new #GSettings object
18839 // <schema_id>: the id of the schema
18840 // <path>: the path to use
18841 static Settings* /*new*/ new_with_path(AT0, AT1)(AT0 /*char*/ schema_id, AT1 /*char*/ path) nothrow {
18842 return g_settings_new_with_path(toCString!(char*)(schema_id), toCString!(char*)(path));
18844 static auto opCall(AT0, AT1)(AT0 /*char*/ schema_id, AT1 /*char*/ path) {
18845 return g_settings_new_with_path(toCString!(char*)(schema_id), toCString!(char*)(path));
18848 // VERSION: 2.28
18849 // Gets a list of the relocatable #GSettings schemas installed on the
18850 // system. These are schemas that do not provide their own path. It is
18851 // usual to instantiate these schemas directly, but if you want to you
18852 // can use g_settings_new_with_path() to specify the path.
18854 // The output of this function, taken together with the output of
18855 // g_settings_list_schemas() represents the complete list of all
18856 // installed schemas.
18858 // #GSettings schemas that are available. The list must not be
18859 // modified or freed.
18860 // RETURNS: a list of relocatable
18861 static char** list_relocatable_schemas()() nothrow {
18862 return g_settings_list_relocatable_schemas();
18865 // VERSION: 2.26
18866 // Gets a list of the #GSettings schemas installed on the system. The
18867 // returned list is exactly the list of schemas for which you may call
18868 // g_settings_new() without adverse effects.
18870 // This function does not list the schemas that do not provide their own
18871 // paths (ie: schemas for which you must use
18872 // g_settings_new_with_path()). See
18873 // g_settings_list_relocatable_schemas() for that.
18875 // schemas that are available. The list must not be modified or
18876 // freed.
18877 // RETURNS: a list of #GSettings
18878 static char** list_schemas()() nothrow {
18879 return g_settings_list_schemas();
18882 // Ensures that all pending operations for the given are complete for
18883 // the default backend.
18885 // Writes made to a #GSettings are handled asynchronously. For this
18886 // reason, it is very unlikely that the changes have it to disk by the
18887 // time g_settings_set() returns.
18889 // This call will block until all of the writes have made it to the
18890 // backend. Since the mainloop is not running, no change notifications
18891 // will be dispatched during this call (but some may be queued by the
18892 // time the call is done).
18893 static void sync()() nothrow {
18894 g_settings_sync();
18897 // VERSION: 2.26
18898 // Removes an existing binding for @property on @object.
18900 // Note that bindings are automatically removed when the
18901 // object is finalized, so it is rarely necessary to call this
18902 // function.
18903 // <object>: the object
18904 // <property>: the property whose binding is removed
18905 static void unbind(AT0, AT1)(AT0 /*void*/ object, AT1 /*char*/ property) nothrow {
18906 g_settings_unbind(UpCast!(void*)(object), toCString!(char*)(property));
18909 // Applies any changes that have been made to the settings. This
18910 // function does nothing unless @settings is in 'delay-apply' mode;
18911 // see g_settings_delay(). In the normal case settings are always
18912 // applied immediately.
18913 void apply()() nothrow {
18914 g_settings_apply(&this);
18917 // VERSION: 2.26
18918 // Create a binding between the @key in the @settings object
18919 // and the property @property of @object.
18921 // The binding uses the default GIO mapping functions to map
18922 // between the settings and property values. These functions
18923 // handle booleans, numeric types and string types in a
18924 // straightforward way. Use g_settings_bind_with_mapping() if
18925 // you need a custom mapping, or map between types that are not
18926 // supported by the default mapping functions.
18928 // Unless the @flags include %G_SETTINGS_BIND_NO_SENSITIVITY, this
18929 // function also establishes a binding between the writability of
18930 // @key and the "sensitive" property of @object (if @object has
18931 // a boolean property by that name). See g_settings_bind_writable()
18932 // for more details about writable bindings.
18934 // Note that the lifecycle of the binding is tied to the object,
18935 // and that you can have only one binding per object property.
18936 // If you bind the same property twice on the same object, the second
18937 // binding overrides the first one.
18938 // <key>: the key to bind
18939 // <object>: a #GObject
18940 // <property>: the name of the property to bind
18941 // <flags>: flags for the binding
18942 void bind(AT0, AT1, AT2)(AT0 /*char*/ key, AT1 /*GObject2.Object*/ object, AT2 /*char*/ property, SettingsBindFlags flags) nothrow {
18943 g_settings_bind(&this, toCString!(char*)(key), UpCast!(GObject2.Object*)(object), toCString!(char*)(property), flags);
18946 // Unintrospectable method: bind_with_mapping() / g_settings_bind_with_mapping()
18947 // VERSION: 2.26
18948 // Create a binding between the @key in the @settings object
18949 // and the property @property of @object.
18951 // The binding uses the provided mapping functions to map between
18952 // settings and property values.
18954 // Note that the lifecycle of the binding is tied to the object,
18955 // and that you can have only one binding per object property.
18956 // If you bind the same property twice on the same object, the second
18957 // binding overrides the first one.
18958 // <key>: the key to bind
18959 // <object>: a #GObject
18960 // <property>: the name of the property to bind
18961 // <flags>: flags for the binding
18962 // <get_mapping>: a function that gets called to convert values from @settings to @object, or %NULL to use the default GIO mapping
18963 // <set_mapping>: a function that gets called to convert values from @object to @settings, or %NULL to use the default GIO mapping
18964 // <user_data>: data that gets passed to @get_mapping and @set_mapping
18965 // <destroy>: #GDestroyNotify function for @user_data
18966 void bind_with_mapping(AT0, AT1, AT2, AT3)(AT0 /*char*/ key, AT1 /*GObject2.Object*/ object, AT2 /*char*/ property, SettingsBindFlags flags, SettingsBindGetMapping get_mapping, SettingsBindSetMapping set_mapping, AT3 /*void*/ user_data, GLib2.DestroyNotify destroy) nothrow {
18967 g_settings_bind_with_mapping(&this, toCString!(char*)(key), UpCast!(GObject2.Object*)(object), toCString!(char*)(property), flags, get_mapping, set_mapping, UpCast!(void*)(user_data), destroy);
18970 // VERSION: 2.26
18971 // Create a binding between the writability of @key in the
18972 // @settings object and the property @property of @object.
18973 // The property must be boolean; "sensitive" or "visible"
18974 // properties of widgets are the most likely candidates.
18976 // Writable bindings are always uni-directional; changes of the
18977 // writability of the setting will be propagated to the object
18978 // property, not the other way.
18980 // When the @inverted argument is %TRUE, the binding inverts the
18981 // value as it passes from the setting to the object, i.e. @property
18982 // will be set to %TRUE if the key is <emphasis>not</emphasis>
18983 // writable.
18985 // Note that the lifecycle of the binding is tied to the object,
18986 // and that you can have only one binding per object property.
18987 // If you bind the same property twice on the same object, the second
18988 // binding overrides the first one.
18989 // <key>: the key to bind
18990 // <object>: a #GObject
18991 // <property>: the name of a boolean property to bind
18992 // <inverted>: whether to 'invert' the value
18993 void bind_writable(AT0, AT1, AT2)(AT0 /*char*/ key, AT1 /*GObject2.Object*/ object, AT2 /*char*/ property, int inverted) nothrow {
18994 g_settings_bind_writable(&this, toCString!(char*)(key), UpCast!(GObject2.Object*)(object), toCString!(char*)(property), inverted);
18997 // VERSION: 2.32
18998 // Creates a #GAction corresponding to a given #GSettings key.
19000 // The action has the same name as the key.
19002 // The value of the key becomes the state of the action and the action
19003 // is enabled when the key is writable. Changing the state of the
19004 // action results in the key being written to. Changes to the value or
19005 // writability of the key cause appropriate change notifications to be
19006 // emitted for the action.
19008 // For boolean-valued keys, action activations take no parameter and
19009 // result in the toggling of the value. For all other types,
19010 // activations take the new value for the key (which must have the
19011 // correct type).
19012 // RETURNS: a new #GAction
19013 // <key>: the name of a key in @settings
19014 Action* /*new*/ create_action(AT0)(AT0 /*char*/ key) nothrow {
19015 return g_settings_create_action(&this, toCString!(char*)(key));
19018 // VERSION: 2.26
19019 // Changes the #GSettings object into 'delay-apply' mode. In this
19020 // mode, changes to @settings are not immediately propagated to the
19021 // backend, but kept locally until g_settings_apply() is called.
19022 void delay()() nothrow {
19023 g_settings_delay(&this);
19026 // Unintrospectable method: get() / g_settings_get()
19027 // VERSION: 2.26
19028 // Gets the value that is stored at @key in @settings.
19030 // A convenience function that combines g_settings_get_value() with
19031 // g_variant_get().
19033 // It is a programmer error to give a @key that isn't contained in the
19034 // schema for @settings or for the #GVariantType of @format to mismatch
19035 // the type given in the schema.
19036 // <key>: the key to get the value for
19037 // <format>: a #GVariant format string
19038 /+ Not available -- variadic methods unsupported - use the C function directly.
19039 alias g_settings_get get; // Variadic
19042 // VERSION: 2.26
19043 // Gets the value that is stored at @key in @settings.
19045 // A convenience variant of g_settings_get() for booleans.
19047 // It is a programmer error to give a @key that isn't specified as
19048 // having a boolean type in the schema for @settings.
19049 // RETURNS: a boolean
19050 // <key>: the key to get the value for
19051 int get_boolean(AT0)(AT0 /*char*/ key) nothrow {
19052 return g_settings_get_boolean(&this, toCString!(char*)(key));
19055 // VERSION: 2.26
19056 // Creates a 'child' settings object which has a base path of
19057 // <replaceable>base-path</replaceable>/@name, where
19058 // <replaceable>base-path</replaceable> is the base path of @settings.
19060 // The schema for the child settings object must have been declared
19061 // in the schema of @settings using a <tag class="starttag">child</tag> element.
19062 // RETURNS: a 'child' settings object
19063 // <name>: the name of the 'child' schema
19064 Settings* /*new*/ get_child(AT0)(AT0 /*char*/ name) nothrow {
19065 return g_settings_get_child(&this, toCString!(char*)(name));
19068 // VERSION: 2.26
19069 // Gets the value that is stored at @key in @settings.
19071 // A convenience variant of g_settings_get() for doubles.
19073 // It is a programmer error to give a @key that isn't specified as
19074 // having a 'double' type in the schema for @settings.
19075 // RETURNS: a double
19076 // <key>: the key to get the value for
19077 double get_double(AT0)(AT0 /*char*/ key) nothrow {
19078 return g_settings_get_double(&this, toCString!(char*)(key));
19081 // VERSION: 2.26
19082 // Gets the value that is stored in @settings for @key and converts it
19083 // to the enum value that it represents.
19085 // In order to use this function the type of the value must be a string
19086 // and it must be marked in the schema file as an enumerated type.
19088 // It is a programmer error to give a @key that isn't contained in the
19089 // schema for @settings or is not marked as an enumerated type.
19091 // If the value stored in the configuration database is not a valid
19092 // value for the enumerated type then this function will return the
19093 // default value.
19094 // RETURNS: the enum value
19095 // <key>: the key to get the value for
19096 int get_enum(AT0)(AT0 /*char*/ key) nothrow {
19097 return g_settings_get_enum(&this, toCString!(char*)(key));
19100 // VERSION: 2.26
19101 // Gets the value that is stored in @settings for @key and converts it
19102 // to the flags value that it represents.
19104 // In order to use this function the type of the value must be an array
19105 // of strings and it must be marked in the schema file as an flags type.
19107 // It is a programmer error to give a @key that isn't contained in the
19108 // schema for @settings or is not marked as a flags type.
19110 // If the value stored in the configuration database is not a valid
19111 // value for the flags type then this function will return the default
19112 // value.
19113 // RETURNS: the flags value
19114 // <key>: the key to get the value for
19115 uint get_flags(AT0)(AT0 /*char*/ key) nothrow {
19116 return g_settings_get_flags(&this, toCString!(char*)(key));
19119 // VERSION: 2.26
19120 // Returns whether the #GSettings object has any unapplied
19121 // changes. This can only be the case if it is in 'delayed-apply' mode.
19122 // RETURNS: %TRUE if @settings has unapplied changes
19123 int get_has_unapplied()() nothrow {
19124 return g_settings_get_has_unapplied(&this);
19127 // VERSION: 2.26
19128 // Gets the value that is stored at @key in @settings.
19130 // A convenience variant of g_settings_get() for 32-bit integers.
19132 // It is a programmer error to give a @key that isn't specified as
19133 // having a int32 type in the schema for @settings.
19134 // RETURNS: an integer
19135 // <key>: the key to get the value for
19136 int get_int(AT0)(AT0 /*char*/ key) nothrow {
19137 return g_settings_get_int(&this, toCString!(char*)(key));
19140 // Gets the value that is stored at @key in @settings, subject to
19141 // application-level validation/mapping.
19143 // You should use this function when the application needs to perform
19144 // some processing on the value of the key (for example, parsing). The
19145 // @mapping function performs that processing. If the function
19146 // indicates that the processing was unsuccessful (due to a parse error,
19147 // for example) then the mapping is tried again with another value.
19149 // This allows a robust 'fall back to defaults' behaviour to be
19150 // implemented somewhat automatically.
19152 // The first value that is tried is the user's setting for the key. If
19153 // the mapping function fails to map this value, other values may be
19154 // tried in an unspecified order (system or site defaults, translated
19155 // schema default values, untranslated schema default values, etc).
19157 // If the mapping function fails for all possible values, one additional
19158 // attempt is made: the mapping function is called with a %NULL value.
19159 // If the mapping function still indicates failure at this point then
19160 // the application will be aborted.
19162 // The result parameter for the @mapping function is pointed to a
19163 // #gpointer which is initially set to %NULL. The same pointer is given
19164 // to each invocation of @mapping. The final value of that #gpointer is
19165 // what is returned by this function. %NULL is valid; it is returned
19166 // just as any other value would be.
19167 // RETURNS: the result, which may be %NULL
19168 // <key>: the key to get the value for
19169 // <mapping>: the function to map the value in the settings database to the value used by the application
19170 // <user_data>: user data for @mapping
19171 void* /*new*/ get_mapped(AT0, AT1)(AT0 /*char*/ key, SettingsGetMapping mapping, AT1 /*void*/ user_data) nothrow {
19172 return g_settings_get_mapped(&this, toCString!(char*)(key), mapping, UpCast!(void*)(user_data));
19175 // VERSION: 2.28
19176 // Queries the range of a key.
19178 // This function will return a #GVariant that fully describes the range
19179 // of values that are valid for @key.
19181 // The type of #GVariant returned is <literal>(sv)</literal>. The
19182 // string describes the type of range restriction in effect. The type
19183 // and meaning of the value contained in the variant depends on the
19184 // string.
19186 // If the string is <literal>'type'</literal> then the variant contains
19187 // an empty array. The element type of that empty array is the expected
19188 // type of value and all values of that type are valid.
19190 // If the string is <literal>'enum'</literal> then the variant contains
19191 // an array enumerating the possible values. Each item in the array is
19192 // a possible valid value and no other values are valid.
19194 // If the string is <literal>'flags'</literal> then the variant contains
19195 // an array. Each item in the array is a value that may appear zero or
19196 // one times in an array to be used as the value for this key. For
19197 // example, if the variant contained the array <literal>['x',
19198 // 'y']</literal> then the valid values for the key would be
19199 // <literal>[]</literal>, <literal>['x']</literal>,
19200 // <literal>['y']</literal>, <literal>['x', 'y']</literal> and
19201 // <literal>['y', 'x']</literal>.
19203 // Finally, if the string is <literal>'range'</literal> then the variant
19204 // contains a pair of like-typed values -- the minimum and maximum
19205 // permissible values for this key.
19207 // This information should not be used by normal programs. It is
19208 // considered to be a hint for introspection purposes. Normal programs
19209 // should already know what is permitted by their own schema. The
19210 // format may change in any way in the future -- but particularly, new
19211 // forms may be added to the possibilities described above.
19213 // It is a programmer error to give a @key that isn't contained in the
19214 // schema for @settings.
19216 // You should free the returned value with g_variant_unref() when it is
19217 // no longer needed.
19218 // RETURNS: a #GVariant describing the range
19219 // <key>: the key to query the range of
19220 GLib2.Variant* /*new*/ get_range(AT0)(AT0 /*char*/ key) nothrow {
19221 return g_settings_get_range(&this, toCString!(char*)(key));
19224 // VERSION: 2.26
19225 // Gets the value that is stored at @key in @settings.
19227 // A convenience variant of g_settings_get() for strings.
19229 // It is a programmer error to give a @key that isn't specified as
19230 // having a string type in the schema for @settings.
19231 // RETURNS: a newly-allocated string
19232 // <key>: the key to get the value for
19233 char* /*new*/ get_string(AT0)(AT0 /*char*/ key) nothrow {
19234 return g_settings_get_string(&this, toCString!(char*)(key));
19237 // VERSION: 2.26
19238 // A convenience variant of g_settings_get() for string arrays.
19240 // It is a programmer error to give a @key that isn't specified as
19241 // having an array of strings type in the schema for @settings.
19243 // newly-allocated, %NULL-terminated array of strings, the value that
19244 // is stored at @key in @settings.
19245 // RETURNS: a
19246 // <key>: the key to get the value for
19247 char** /*new*/ get_strv(AT0)(AT0 /*char*/ key) nothrow {
19248 return g_settings_get_strv(&this, toCString!(char*)(key));
19251 // VERSION: 2.30
19252 // Gets the value that is stored at @key in @settings.
19254 // A convenience variant of g_settings_get() for 32-bit unsigned
19255 // integers.
19257 // It is a programmer error to give a @key that isn't specified as
19258 // having a uint32 type in the schema for @settings.
19259 // RETURNS: an unsigned integer
19260 // <key>: the key to get the value for
19261 uint get_uint(AT0)(AT0 /*char*/ key) nothrow {
19262 return g_settings_get_uint(&this, toCString!(char*)(key));
19265 // VERSION: 2.26
19266 // Gets the value that is stored in @settings for @key.
19268 // It is a programmer error to give a @key that isn't contained in the
19269 // schema for @settings.
19270 // RETURNS: a new #GVariant
19271 // <key>: the key to get the value for
19272 GLib2.Variant* /*new*/ get_value(AT0)(AT0 /*char*/ key) nothrow {
19273 return g_settings_get_value(&this, toCString!(char*)(key));
19276 // VERSION: 2.26
19277 // Finds out if a key can be written or not
19278 // RETURNS: %TRUE if the key @name is writable
19279 // <name>: the name of a key
19280 int is_writable(AT0)(AT0 /*char*/ name) nothrow {
19281 return g_settings_is_writable(&this, toCString!(char*)(name));
19284 // Gets the list of children on @settings.
19286 // The list is exactly the list of strings for which it is not an error
19287 // to call g_settings_get_child().
19289 // For GSettings objects that are lists, this value can change at any
19290 // time and you should connect to the "children-changed" signal to watch
19291 // for those changes. Note that there is a race condition here: you may
19292 // request a child after listing it only for it to have been destroyed
19293 // in the meantime. For this reason, g_settings_get_child() may return
19294 // %NULL even for a child that was listed by this function.
19296 // For GSettings objects that are not lists, you should probably not be
19297 // calling this function from "normal" code (since you should already
19298 // know what children are in your schema). This function may still be
19299 // useful there for introspection reasons, however.
19301 // You should free the return value with g_strfreev() when you are done
19302 // with it.
19303 // RETURNS: a list of the children on @settings
19304 char** /*new*/ list_children()() nothrow {
19305 return g_settings_list_children(&this);
19308 // Introspects the list of keys on @settings.
19310 // You should probably not be calling this function from "normal" code
19311 // (since you should already know what keys are in your schema). This
19312 // function is intended for introspection reasons.
19314 // You should free the return value with g_strfreev() when you are done
19315 // with it.
19316 // RETURNS: a list of the keys on @settings
19317 char** /*new*/ list_keys()() nothrow {
19318 return g_settings_list_keys(&this);
19321 // VERSION: 2.28
19322 // Checks if the given @value is of the correct type and within the
19323 // permitted range for @key.
19325 // This API is not intended to be used by normal programs -- they should
19326 // already know what is permitted by their own schemas. This API is
19327 // meant to be used by programs such as editors or commandline tools.
19329 // It is a programmer error to give a @key that isn't contained in the
19330 // schema for @settings.
19331 // RETURNS: %TRUE if @value is valid for @key
19332 // <key>: the key to check
19333 // <value>: the value to check
19334 int range_check(AT0, AT1)(AT0 /*char*/ key, AT1 /*GLib2.Variant*/ value) nothrow {
19335 return g_settings_range_check(&this, toCString!(char*)(key), UpCast!(GLib2.Variant*)(value));
19338 // Resets @key to its default value.
19340 // This call resets the key, as much as possible, to its default value.
19341 // That might the value specified in the schema or the one set by the
19342 // administrator.
19343 // <key>: the name of a key
19344 void reset(AT0)(AT0 /*char*/ key) nothrow {
19345 g_settings_reset(&this, toCString!(char*)(key));
19348 // Reverts all non-applied changes to the settings. This function
19349 // does nothing unless @settings is in 'delay-apply' mode; see
19350 // g_settings_delay(). In the normal case settings are always applied
19351 // immediately.
19353 // Change notifications will be emitted for affected keys.
19354 void revert()() nothrow {
19355 g_settings_revert(&this);
19358 // Unintrospectable method: set() / g_settings_set()
19359 // VERSION: 2.26
19360 // Sets @key in @settings to @value.
19362 // A convenience function that combines g_settings_set_value() with
19363 // g_variant_new().
19365 // It is a programmer error to give a @key that isn't contained in the
19366 // schema for @settings or for the #GVariantType of @format to mismatch
19367 // the type given in the schema.
19369 // %FALSE if the key was not writable
19370 // RETURNS: %TRUE if setting the key succeeded,
19371 // <key>: the name of the key to set
19372 // <format>: a #GVariant format string
19373 /+ Not available -- variadic methods unsupported - use the C function directly.
19374 alias g_settings_set set; // Variadic
19377 // VERSION: 2.26
19378 // Sets @key in @settings to @value.
19380 // A convenience variant of g_settings_set() for booleans.
19382 // It is a programmer error to give a @key that isn't specified as
19383 // having a boolean type in the schema for @settings.
19385 // %FALSE if the key was not writable
19386 // RETURNS: %TRUE if setting the key succeeded,
19387 // <key>: the name of the key to set
19388 // <value>: the value to set it to
19389 int set_boolean(AT0)(AT0 /*char*/ key, int value) nothrow {
19390 return g_settings_set_boolean(&this, toCString!(char*)(key), value);
19393 // VERSION: 2.26
19394 // Sets @key in @settings to @value.
19396 // A convenience variant of g_settings_set() for doubles.
19398 // It is a programmer error to give a @key that isn't specified as
19399 // having a 'double' type in the schema for @settings.
19401 // %FALSE if the key was not writable
19402 // RETURNS: %TRUE if setting the key succeeded,
19403 // <key>: the name of the key to set
19404 // <value>: the value to set it to
19405 int set_double(AT0)(AT0 /*char*/ key, double value) nothrow {
19406 return g_settings_set_double(&this, toCString!(char*)(key), value);
19409 // Looks up the enumerated type nick for @value and writes it to @key,
19410 // within @settings.
19412 // It is a programmer error to give a @key that isn't contained in the
19413 // schema for @settings or is not marked as an enumerated type, or for
19414 // @value not to be a valid value for the named type.
19416 // After performing the write, accessing @key directly with
19417 // g_settings_get_string() will return the 'nick' associated with
19418 // @value.
19419 // RETURNS: %TRUE, if the set succeeds
19420 // <key>: a key, within @settings
19421 // <value>: an enumerated value
19422 int set_enum(AT0)(AT0 /*char*/ key, int value) nothrow {
19423 return g_settings_set_enum(&this, toCString!(char*)(key), value);
19426 // Looks up the flags type nicks for the bits specified by @value, puts
19427 // them in an array of strings and writes the array to @key, within
19428 // @settings.
19430 // It is a programmer error to give a @key that isn't contained in the
19431 // schema for @settings or is not marked as a flags type, or for @value
19432 // to contain any bits that are not value for the named type.
19434 // After performing the write, accessing @key directly with
19435 // g_settings_get_strv() will return an array of 'nicks'; one for each
19436 // bit in @value.
19437 // RETURNS: %TRUE, if the set succeeds
19438 // <key>: a key, within @settings
19439 // <value>: a flags value
19440 int set_flags(AT0)(AT0 /*char*/ key, uint value) nothrow {
19441 return g_settings_set_flags(&this, toCString!(char*)(key), value);
19444 // VERSION: 2.26
19445 // Sets @key in @settings to @value.
19447 // A convenience variant of g_settings_set() for 32-bit integers.
19449 // It is a programmer error to give a @key that isn't specified as
19450 // having a int32 type in the schema for @settings.
19452 // %FALSE if the key was not writable
19453 // RETURNS: %TRUE if setting the key succeeded,
19454 // <key>: the name of the key to set
19455 // <value>: the value to set it to
19456 int set_int(AT0)(AT0 /*char*/ key, int value) nothrow {
19457 return g_settings_set_int(&this, toCString!(char*)(key), value);
19460 // VERSION: 2.26
19461 // Sets @key in @settings to @value.
19463 // A convenience variant of g_settings_set() for strings.
19465 // It is a programmer error to give a @key that isn't specified as
19466 // having a string type in the schema for @settings.
19468 // %FALSE if the key was not writable
19469 // RETURNS: %TRUE if setting the key succeeded,
19470 // <key>: the name of the key to set
19471 // <value>: the value to set it to
19472 int set_string(AT0, AT1)(AT0 /*char*/ key, AT1 /*char*/ value) nothrow {
19473 return g_settings_set_string(&this, toCString!(char*)(key), toCString!(char*)(value));
19476 // VERSION: 2.26
19477 // Sets @key in @settings to @value.
19479 // A convenience variant of g_settings_set() for string arrays. If
19480 // @value is %NULL, then @key is set to be the empty array.
19482 // It is a programmer error to give a @key that isn't specified as
19483 // having an array of strings type in the schema for @settings.
19485 // %FALSE if the key was not writable
19486 // RETURNS: %TRUE if setting the key succeeded,
19487 // <key>: the name of the key to set
19488 // <value>: the value to set it to, or %NULL
19489 int set_strv(AT0, AT1)(AT0 /*char*/ key, AT1 /*char**/ value=null) nothrow {
19490 return g_settings_set_strv(&this, toCString!(char*)(key), toCString!(char**)(value));
19493 // VERSION: 2.30
19494 // Sets @key in @settings to @value.
19496 // A convenience variant of g_settings_set() for 32-bit unsigned
19497 // integers.
19499 // It is a programmer error to give a @key that isn't specified as
19500 // having a uint32 type in the schema for @settings.
19502 // %FALSE if the key was not writable
19503 // RETURNS: %TRUE if setting the key succeeded,
19504 // <key>: the name of the key to set
19505 // <value>: the value to set it to
19506 int set_uint(AT0)(AT0 /*char*/ key, uint value) nothrow {
19507 return g_settings_set_uint(&this, toCString!(char*)(key), value);
19510 // VERSION: 2.26
19511 // Sets @key in @settings to @value.
19513 // It is a programmer error to give a @key that isn't contained in the
19514 // schema for @settings or for @value to have the incorrect type, per
19515 // the schema.
19517 // If @value is floating then this function consumes the reference.
19519 // %FALSE if the key was not writable
19520 // RETURNS: %TRUE if setting the key succeeded,
19521 // <key>: the name of the key to set
19522 // <value>: a #GVariant of the correct type
19523 int set_value(AT0, AT1)(AT0 /*char*/ key, AT1 /*GLib2.Variant*/ value) nothrow {
19524 return g_settings_set_value(&this, toCString!(char*)(key), UpCast!(GLib2.Variant*)(value));
19527 // The "change-event" signal is emitted once per change event that
19528 // affects this settings object. You should connect to this signal
19529 // only if you are interested in viewing groups of changes before they
19530 // are split out into multiple emissions of the "changed" signal.
19531 // For most use cases it is more appropriate to use the "changed" signal.
19533 // In the event that the change event applies to one or more specified
19534 // keys, @keys will be an array of #GQuark of length @n_keys. In the
19535 // event that the change event applies to the #GSettings object as a
19536 // whole (ie: potentially every key has been changed) then @keys will
19537 // be %NULL and @n_keys will be 0.
19539 // The default handler for this signal invokes the "changed" signal
19540 // for each affected key. If any other connected handler returns
19541 // %TRUE then this default functionality will be suppressed.
19543 // event. FALSE to propagate the event further.
19544 // RETURNS: %TRUE to stop other handlers from being invoked for the
19545 // <keys>: an array of #GQuark<!-- -->s for the changed keys, or %NULL
19546 // <n_keys>: the length of the @keys array, or 0
19547 extern (C) alias static c_int function (Settings* this_, GLib2.Quark* keys, int n_keys, void* user_data=null) nothrow signal_change_event;
19549 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
19550 return super_.signal_connect!name(cb, data, cf);
19553 ulong signal_connect(string name:"change-event", CB/*:signal_change_event*/)
19554 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
19555 if (is(typeof(cb)==signal_change_event)||_ttmm!(CB, signal_change_event)()) {
19556 return signal_connect_data!()(&this, cast(char*)"change-event",
19557 cast(GObject2.Callback)cb, data, null, cf);
19560 // The "changed" signal is emitted when a key has potentially changed.
19561 // You should call one of the g_settings_get() calls to check the new
19562 // value.
19564 // This signal supports detailed connections. You can connect to the
19565 // detailed signal "changed::x" in order to only receive callbacks
19566 // when key "x" changes.
19567 // <key>: the name of the key that changed
19568 extern (C) alias static void function (Settings* this_, char* key, void* user_data=null) nothrow signal_changed;
19569 ulong signal_connect(string name:"changed", CB/*:signal_changed*/)
19570 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
19571 if (is(typeof(cb)==signal_changed)||_ttmm!(CB, signal_changed)()) {
19572 return signal_connect_data!()(&this, cast(char*)"changed",
19573 cast(GObject2.Callback)cb, data, null, cf);
19576 // The "writable-change-event" signal is emitted once per writability
19577 // change event that affects this settings object. You should connect
19578 // to this signal if you are interested in viewing groups of changes
19579 // before they are split out into multiple emissions of the
19580 // "writable-changed" signal. For most use cases it is more
19581 // appropriate to use the "writable-changed" signal.
19583 // In the event that the writability change applies only to a single
19584 // key, @key will be set to the #GQuark for that key. In the event
19585 // that the writability change affects the entire settings object,
19586 // @key will be 0.
19588 // The default handler for this signal invokes the "writable-changed"
19589 // and "changed" signals for each affected key. This is done because
19590 // changes in writability might also imply changes in value (if for
19591 // example, a new mandatory setting is introduced). If any other
19592 // connected handler returns %TRUE then this default functionality
19593 // will be suppressed.
19595 // event. FALSE to propagate the event further.
19596 // RETURNS: %TRUE to stop other handlers from being invoked for the
19597 // <key>: the quark of the key, or 0
19598 extern (C) alias static c_int function (Settings* this_, c_uint key, void* user_data=null) nothrow signal_writable_change_event;
19599 ulong signal_connect(string name:"writable-change-event", CB/*:signal_writable_change_event*/)
19600 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
19601 if (is(typeof(cb)==signal_writable_change_event)||_ttmm!(CB, signal_writable_change_event)()) {
19602 return signal_connect_data!()(&this, cast(char*)"writable-change-event",
19603 cast(GObject2.Callback)cb, data, null, cf);
19606 // The "writable-changed" signal is emitted when the writability of a
19607 // key has potentially changed. You should call
19608 // g_settings_is_writable() in order to determine the new status.
19610 // This signal supports detailed connections. You can connect to the
19611 // detailed signal "writable-changed::x" in order to only receive
19612 // callbacks when the writability of "x" changes.
19613 // <key>: the key
19614 extern (C) alias static void function (Settings* this_, char* key, void* user_data=null) nothrow signal_writable_changed;
19615 ulong signal_connect(string name:"writable-changed", CB/*:signal_writable_changed*/)
19616 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
19617 if (is(typeof(cb)==signal_writable_changed)||_ttmm!(CB, signal_writable_changed)()) {
19618 return signal_connect_data!()(&this, cast(char*)"writable-changed",
19619 cast(GObject2.Callback)cb, data, null, cf);
19624 // The #GSettingsBackend interface defines a generic interface for
19625 // non-strictly-typed data that is stored in a hierarchy. To implement
19626 // an alternative storage backend for #GSettings, you need to implement
19627 // the #GSettingsBackend interface and then make it implement the
19628 // extension point #G_SETTINGS_BACKEND_EXTENSION_POINT_NAME.
19630 // The interface defines methods for reading and writing values, a
19631 // method for determining if writing of certain values will fail
19632 // (lockdown) and a change notification mechanism.
19634 // The semantics of the interface are very precisely defined and
19635 // implementations must carefully adhere to the expectations of
19636 // callers that are documented on each of the interface methods.
19638 // Some of the GSettingsBackend functions accept or return a #GTree.
19639 // These trees always have strings as keys and #GVariant as values.
19640 // g_settings_backend_create_tree() is a convenience function to create
19641 // suitable trees.
19643 // <note><para>
19644 // The #GSettingsBackend API is exported to allow third-party
19645 // implementations, but does not carry the same stability guarantees
19646 // as the public GIO API. For this reason, you have to define the
19647 // C preprocessor symbol #G_SETTINGS_ENABLE_BACKEND before including
19648 // <filename>gio/gsettingsbackend.h</filename>
19649 // </para></note>
19650 struct SettingsBackend {
19654 // Flags used when creating a binding. These flags determine in which
19655 // direction the binding works. The default is to synchronize in both
19656 // directions.
19657 enum SettingsBindFlags {
19658 DEFAULT = 0,
19659 GET = 1,
19660 SET = 2,
19661 NO_SENSITIVITY = 4,
19662 GET_NO_CHANGES = 8,
19663 INVERT_BOOLEAN = 16
19666 // The type for the function that is used to convert from #GSettings to
19667 // an object property. The @value is already initialized to hold values
19668 // of the appropriate type.
19669 // RETURNS: %TRUE if the conversion succeeded, %FALSE in case of an error
19670 // <value>: return location for the property value
19671 // <variant>: the #GVariant
19672 // <user_data>: user data that was specified when the binding was created
19673 extern (C) alias int function (GObject2.Value* value, GLib2.Variant* variant, void* user_data) nothrow SettingsBindGetMapping;
19676 // The type for the function that is used to convert an object property
19677 // value to a #GVariant for storing it in #GSettings.
19679 // or %NULL in case of an error
19680 // RETURNS: a new #GVariant holding the data from @value,
19681 // <value>: a #GValue containing the property value to map
19682 // <expected_type>: the #GVariantType to create
19683 // <user_data>: user data that was specified when the binding was created
19684 extern (C) alias GLib2.Variant* /*new*/ function (GObject2.Value* value, GLib2.VariantType* expected_type, void* user_data) nothrow SettingsBindSetMapping;
19686 struct SettingsClass {
19687 GObject2.ObjectClass parent_class;
19688 extern (C) void function (Settings* settings, char* key) nothrow writable_changed;
19689 extern (C) void function (Settings* settings, char* key) nothrow changed;
19690 extern (C) int function (Settings* settings, GLib2.Quark key) nothrow writable_change_event;
19691 extern (C) int function (Settings* settings, GLib2.Quark* keys, int n_keys) nothrow change_event;
19692 void*[20] padding;
19696 // The type of the function that is used to convert from a value stored
19697 // in a #GSettings to a value that is useful to the application.
19699 // If the value is successfully mapped, the result should be stored at
19700 // @result and %TRUE returned. If mapping fails (for example, if @value
19701 // is not in the right format) then %FALSE should be returned.
19703 // If @value is %NULL then it means that the mapping function is being
19704 // given a "last chance" to successfully return a valid value. %TRUE
19705 // must be returned in this case.
19706 // RETURNS: %TRUE if the conversion succeeded, %FALSE in case of an error
19707 // <value>: the #GVariant to map, or %NULL
19708 // <result>: the result of the mapping
19709 // <user_data>: the user data that was passed to g_settings_get_mapped()
19710 extern (C) alias int function (GLib2.Variant* value, /*out*/ void** result, void* user_data) nothrow SettingsGetMapping;
19712 struct SettingsPrivate {
19716 // The #GSettingsSchemaSource and #GSettingsSchema APIs provide a
19717 // mechanism for advanced control over the loading of schemas and a
19718 // mechanism for introspecting their content.
19720 // Plugin loading systems that wish to provide plugins a way to access
19721 // settings face the problem of how to make the schemas for these
19722 // settings visible to GSettings. Typically, a plugin will want to ship
19723 // the schema along with itself and it won't be installed into the
19724 // standard system directories for schemas.
19726 // #GSettingsSchemaSource provides a mechanism for dealing with this by
19727 // allowing the creation of a new 'schema source' from which schemas can
19728 // be acquired. This schema source can then become part of the metadata
19729 // associated with the plugin and queried whenever the plugin requires
19730 // access to some settings.
19732 // Consider the following example:
19734 // |[
19735 // typedef struct
19736 // {
19737 // ...
19738 // GSettingsSchemaSource *schema_source;
19739 // ...
19740 // } Plugin;
19742 // Plugin *
19743 // initialise_plugin (const gchar *dir)
19744 // {
19745 // Plugin *plugin;
19747 // ...
19749 // plugin->schema_source =
19750 // g_settings_new_schema_source_from_directory (dir,
19751 // g_settings_schema_source_get_default (), FALSE, NULL);
19753 // ...
19755 // return plugin;
19756 // }
19758 // ...
19760 // GSettings *
19761 // plugin_get_settings (Plugin *plugin,
19762 // const gchar *schema_id)
19763 // {
19764 // GSettingsSchema *schema;
19766 // if (schema_id == NULL)
19767 // schema_id = plugin->identifier;
19769 // schema = g_settings_schema_source_lookup (plugin->schema_source,
19770 // schema_id, FALSE);
19772 // if (schema == NULL)
19773 // {
19774 // ... disable the plugin or abort, etc ...
19775 // }
19777 // return g_settings_new_full (schema, NULL, NULL);
19778 // }
19779 // ]|
19781 // The code above shows how hooks should be added to the code that
19782 // initialises (or enables) the plugin to create the schema source and
19783 // how an API can be added to the plugin system to provide a convenient
19784 // way for the plugin to access its settings, using the schemas that it
19785 // ships.
19787 // From the standpoint of the plugin, it would need to ensure that it
19788 // ships a gschemas.compiled file as part of itself, and then simply do
19789 // the following:
19791 // |[
19792 // {
19793 // GSettings *settings;
19794 // gint some_value;
19796 // settings = plugin_get_settings (self, NULL);
19797 // some_value = g_settings_get_int (settings, "some-value");
19798 // ...
19799 // }
19800 // ]|
19802 // It's also possible that the plugin system expects the schema source
19803 // files (ie: .gschema.xml files) instead of a gschemas.compiled file.
19804 // In that case, the plugin loading system must compile the schemas for
19805 // itself before attempting to create the settings source.
19806 struct SettingsSchema /* Version 2.32 */ {
19808 // Get the ID of @schema.
19809 // RETURNS: the ID
19810 char* get_id()() nothrow {
19811 return g_settings_schema_get_id(&this);
19814 // VERSION: 2.32
19815 // Gets the path associated with @schema, or %NULL.
19817 // Schemas may be single-instance or relocatable. Single-instance
19818 // schemas correspond to exactly one set of keys in the backend
19819 // database: those located at the path returned by this function.
19821 // Relocatable schemas can be referenced by other schemas and can
19822 // threfore describe multiple sets of keys at different locations. For
19823 // relocatable schemas, this function will return %NULL.
19824 // RETURNS: the path of the schema, or %NULL
19825 char* get_path()() nothrow {
19826 return g_settings_schema_get_path(&this);
19829 // VERSION: 2.32
19830 // Increase the reference count of @schema, returning a new reference.
19831 // RETURNS: a new reference to @schema
19832 SettingsSchema* /*new*/ ref_()() nothrow {
19833 return g_settings_schema_ref(&this);
19836 // VERSION: 2.32
19837 // Decrease the reference count of @schema, possibly freeing it.
19838 void unref()() nothrow {
19839 g_settings_schema_unref(&this);
19843 // This is an opaque structure type. You may not access it directly.
19844 struct SettingsSchemaSource /* Version 2.32 */ {
19846 // VERSION: 2.32
19847 // Attempts to create a new schema source corresponding to the contents
19848 // of the given directory.
19850 // This function is not required for normal uses of #GSettings but it
19851 // may be useful to authors of plugin management systems.
19853 // The directory should contain a file called
19854 // <filename>gschemas.compiled</filename> as produced by
19855 // <command>glib-compile-schemas</command>.
19857 // If @trusted is %TRUE then <filename>gschemas.compiled</filename> is
19858 // trusted not to be corrupted. This assumption has a performance
19859 // advantage, but can result in crashes or inconsistent behaviour in the
19860 // case of a corrupted file. Generally, you should set @trusted to
19861 // %TRUE for files installed by the system and to %FALSE for files in
19862 // the home directory.
19864 // If @parent is non-%NULL then there are two effects.
19866 // First, if g_settings_schema_source_lookup() is called with the
19867 // @recursive flag set to %TRUE and the schema can not be found in the
19868 // source, the lookup will recurse to the parent.
19870 // Second, any references to other schemas specified within this
19871 // source (ie: <literal>child</literal> or <literal>extents</literal>)
19872 // references may be resolved from the @parent.
19874 // For this second reason, except in very unusual situations, the
19875 // @parent should probably be given as the default schema source, as
19876 // returned by g_settings_schema_source_get_default().
19877 // <directory>: the filename of a directory
19878 // <parent>: a #GSettingsSchemaSource, or %NULL
19879 // <trusted>: %TRUE, if the directory is trusted
19880 static SettingsSchemaSource* /*new*/ new_from_directory(AT0, AT1, AT2)(AT0 /*char*/ directory, AT1 /*SettingsSchemaSource*/ parent, int trusted, AT2 /*GLib2.Error**/ error=null) nothrow {
19881 return g_settings_schema_source_new_from_directory(toCString!(char*)(directory), UpCast!(SettingsSchemaSource*)(parent), trusted, UpCast!(GLib2.Error**)(error));
19883 static auto opCall(AT0, AT1, AT2)(AT0 /*char*/ directory, AT1 /*SettingsSchemaSource*/ parent, int trusted, AT2 /*GLib2.Error**/ error=null) {
19884 return g_settings_schema_source_new_from_directory(toCString!(char*)(directory), UpCast!(SettingsSchemaSource*)(parent), trusted, UpCast!(GLib2.Error**)(error));
19887 // VERSION: 2.32
19888 // Looks up a schema with the identifier @schema_id in @source.
19890 // This function is not required for normal uses of #GSettings but it
19891 // may be useful to authors of plugin management systems or to those who
19892 // want to introspect the content of schemas.
19894 // If the schema isn't found directly in @source and @recursive is %TRUE
19895 // then the parent sources will also be checked.
19897 // If the schema isn't found, %NULL is returned.
19898 // RETURNS: a new #GSettingsSchema
19899 // <schema_id>: a schema ID
19900 // <recursive>: %TRUE if the lookup should be recursive
19901 SettingsSchema* /*new*/ lookup(AT0)(AT0 /*char*/ schema_id, int recursive) nothrow {
19902 return g_settings_schema_source_lookup(&this, toCString!(char*)(schema_id), recursive);
19905 // VERSION: 2.32
19906 // Increase the reference count of @source, returning a new reference.
19907 // RETURNS: a new reference to @source
19908 SettingsSchemaSource* /*new*/ ref_()() nothrow {
19909 return g_settings_schema_source_ref(&this);
19912 // VERSION: 2.32
19913 // Decrease the reference count of @source, possibly freeing it.
19914 void unref()() nothrow {
19915 g_settings_schema_source_unref(&this);
19918 // VERSION: 2.32
19919 // Gets the default system schema source.
19921 // This function is not required for normal uses of #GSettings but it
19922 // may be useful to authors of plugin management systems or to those who
19923 // want to introspect the content of schemas.
19925 // If no schemas are installed, %NULL will be returned.
19927 // The returned source may actually consist of multiple schema sources
19928 // from different directories, depending on which directories were given
19929 // in <envar>XDG_DATA_DIRS</envar> and
19930 // <envar>GSETTINGS_SCHEMA_DIR</envar>. For this reason, all lookups
19931 // performed against the default source should probably be done
19932 // recursively.
19933 // RETURNS: the default schema source
19934 static SettingsSchemaSource* get_default()() nothrow {
19935 return g_settings_schema_source_get_default();
19940 // A #GSimpleAction is the obvious simple implementation of the #GAction
19941 // interface. This is the easiest way to create an action for purposes of
19942 // adding it to a #GSimpleActionGroup.
19944 // See also #GtkAction.
19945 struct SimpleAction /* : GObject.Object */ {
19946 mixin Action.__interface__;
19947 alias method_parent this;
19948 alias method_parent super_;
19949 alias method_parent object;
19950 GObject2.Object method_parent;
19953 // VERSION: 2.28
19954 // Creates a new action.
19956 // The created action is stateless. See g_simple_action_new_stateful().
19957 // RETURNS: a new #GSimpleAction
19958 // <name>: the name of the action
19959 // <parameter_type>: the type of parameter to the activate function
19960 static SimpleAction* /*new*/ new_(AT0, AT1)(AT0 /*char*/ name, AT1 /*GLib2.VariantType*/ parameter_type=null) nothrow {
19961 return g_simple_action_new(toCString!(char*)(name), UpCast!(GLib2.VariantType*)(parameter_type));
19963 static auto opCall(AT0, AT1)(AT0 /*char*/ name, AT1 /*GLib2.VariantType*/ parameter_type=null) {
19964 return g_simple_action_new(toCString!(char*)(name), UpCast!(GLib2.VariantType*)(parameter_type));
19967 // VERSION: 2.28
19968 // Creates a new stateful action.
19970 // @state is the initial state of the action. All future state values
19971 // must have the same #GVariantType as the initial state.
19973 // If the @state GVariant is floating, it is consumed.
19974 // RETURNS: a new #GSimpleAction
19975 // <name>: the name of the action
19976 // <parameter_type>: the type of the parameter to the activate function
19977 // <state>: the initial state of the action
19978 static SimpleAction* /*new*/ new_stateful(AT0, AT1, AT2)(AT0 /*char*/ name, AT1 /*GLib2.VariantType*/ parameter_type, AT2 /*GLib2.Variant*/ state) nothrow {
19979 return g_simple_action_new_stateful(toCString!(char*)(name), UpCast!(GLib2.VariantType*)(parameter_type), UpCast!(GLib2.Variant*)(state));
19981 static auto opCall(AT0, AT1, AT2)(AT0 /*char*/ name, AT1 /*GLib2.VariantType*/ parameter_type, AT2 /*GLib2.Variant*/ state) {
19982 return g_simple_action_new_stateful(toCString!(char*)(name), UpCast!(GLib2.VariantType*)(parameter_type), UpCast!(GLib2.Variant*)(state));
19985 // VERSION: 2.28
19986 // Sets the action as enabled or not.
19988 // An action must be enabled in order to be activated or in order to
19989 // have its state changed from outside callers.
19991 // This should only be called by the implementor of the action. Users
19992 // of the action should not attempt to modify its enabled flag.
19993 // <enabled>: whether the action is enabled
19994 void set_enabled()(int enabled) nothrow {
19995 g_simple_action_set_enabled(&this, enabled);
19998 // VERSION: 2.30
19999 // Sets the state of the action.
20001 // This directly updates the 'state' property to the given value.
20003 // This should only be called by the implementor of the action. Users
20004 // of the action should not attempt to directly modify the 'state'
20005 // property. Instead, they should call g_action_change_state() to
20006 // request the change.
20007 // <value>: the new #GVariant for the state
20008 void set_state(AT0)(AT0 /*GLib2.Variant*/ value) nothrow {
20009 g_simple_action_set_state(&this, UpCast!(GLib2.Variant*)(value));
20012 // VERSION: 2.28
20013 // Indicates that the action was just activated.
20015 // @parameter will always be of the expected type. In the event that
20016 // an incorrect type was given, no signal will be emitted.
20017 // <parameter>: the parameter to the activation
20018 extern (C) alias static void function (SimpleAction* this_, GLib2.Variant* parameter=null, void* user_data=null) nothrow signal_activate;
20020 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
20021 return super_.signal_connect!name(cb, data, cf);
20024 ulong signal_connect(string name:"activate", CB/*:signal_activate*/)
20025 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
20026 if (is(typeof(cb)==signal_activate)||_ttmm!(CB, signal_activate)()) {
20027 return signal_connect_data!()(&this, cast(char*)"activate",
20028 cast(GObject2.Callback)cb, data, null, cf);
20031 // VERSION: 2.30
20032 // Indicates that the action just received a request to change its
20033 // state.
20035 // @value will always be of the correct state type. In the event that
20036 // an incorrect type was given, no signal will be emitted.
20038 // If no handler is connected to this signal then the default
20039 // behaviour is to call g_simple_action_set_state() to set the state
20040 // to the requested value. If you connect a signal handler then no
20041 // default action is taken. If the state should change then you must
20042 // call g_simple_action_set_state() from the handler.
20044 // <example>
20045 // <title>Example 'change-state' handler</title>
20046 // <programlisting>
20047 // static void
20048 // change_volume_state (GSimpleAction *action,
20049 // GVariant *value,
20050 // gpointer user_data)
20051 // {
20052 // gint requested;
20054 // requested = g_variant_get_int32 (value);
20056 // // Volume only goes from 0 to 10
20057 // if (0 <= requested && requested <= 10)
20058 // g_simple_action_set_state (action, value);
20059 // }
20060 // </programlisting>
20061 // </example>
20063 // The handler need not set the state to the requested value. It
20064 // could set it to any value at all, or take some other action.
20065 // <value>: the requested value for the state
20066 extern (C) alias static void function (SimpleAction* this_, GLib2.Variant* value=null, void* user_data=null) nothrow signal_change_state;
20067 ulong signal_connect(string name:"change-state", CB/*:signal_change_state*/)
20068 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
20069 if (is(typeof(cb)==signal_change_state)||_ttmm!(CB, signal_change_state)()) {
20070 return signal_connect_data!()(&this, cast(char*)"change-state",
20071 cast(GObject2.Callback)cb, data, null, cf);
20076 // #GSimpleActionGroup is a hash table filled with #GAction objects,
20077 // implementing the #GActionGroup and #GActionMap interfaces.
20078 struct SimpleActionGroup /* : GObject.Object */ /* Version 2.28 */ {
20079 mixin ActionGroup.__interface__;
20080 mixin ActionMap.__interface__;
20081 alias parent_instance this;
20082 alias parent_instance super_;
20083 alias parent_instance object;
20084 GObject2.Object parent_instance;
20085 private SimpleActionGroupPrivate* priv;
20088 // VERSION: 2.28
20089 // Creates a new, empty, #GSimpleActionGroup.
20090 // RETURNS: a new #GSimpleActionGroup
20091 static SimpleActionGroup* /*new*/ new_()() nothrow {
20092 return g_simple_action_group_new();
20094 static auto opCall()() {
20095 return g_simple_action_group_new();
20098 // VERSION: 2.30
20099 // A convenience function for creating multiple #GSimpleAction instances
20100 // and adding them to the action group.
20101 // <entries>: a pointer to the first item in an array of #GActionEntry structs
20102 // <n_entries>: the length of @entries, or -1
20103 // <user_data>: the user data for signal connections
20104 void add_entries(AT0, AT1)(AT0 /*ActionEntry*/ entries, int n_entries, AT1 /*void*/ user_data) nothrow {
20105 g_simple_action_group_add_entries(&this, UpCast!(ActionEntry*)(entries), n_entries, UpCast!(void*)(user_data));
20108 // VERSION: 2.28
20109 // Adds an action to the action group.
20111 // If the action group already contains an action with the same name as
20112 // @action then the old action is dropped from the group.
20114 // The action group takes its own reference on @action.
20115 // <action>: a #GAction
20116 void insert(AT0)(AT0 /*Action*/ action) nothrow {
20117 g_simple_action_group_insert(&this, UpCast!(Action*)(action));
20120 // VERSION: 2.28
20121 // Looks up the action with the name @action_name in the group.
20123 // If no such action exists, returns %NULL.
20124 // RETURNS: a #GAction, or %NULL
20125 // <action_name>: the name of an action
20126 Action* lookup(AT0)(AT0 /*char*/ action_name) nothrow {
20127 return g_simple_action_group_lookup(&this, toCString!(char*)(action_name));
20130 // VERSION: 2.28
20131 // Removes the named action from the action group.
20133 // If no action of this name is in the group then nothing happens.
20134 // <action_name>: the name of the action
20135 void remove(AT0)(AT0 /*char*/ action_name) nothrow {
20136 g_simple_action_group_remove(&this, toCString!(char*)(action_name));
20140 struct SimpleActionGroupClass {
20141 private GObject2.ObjectClass parent_class;
20142 private void*[12] padding;
20145 struct SimpleActionGroupPrivate {
20149 // Implements #GAsyncResult for simple cases. Most of the time, this
20150 // will be all an application needs, and will be used transparently.
20151 // Because of this, #GSimpleAsyncResult is used throughout GIO for
20152 // handling asynchronous functions.
20154 // GSimpleAsyncResult handles #GAsyncReadyCallback<!-- -->s, error
20155 // reporting, operation cancellation and the final state of an operation,
20156 // completely transparent to the application. Results can be returned
20157 // as a pointer e.g. for functions that return data that is collected
20158 // asynchronously, a boolean value for checking the success or failure
20159 // of an operation, or a #gssize for operations which return the number
20160 // of bytes modified by the operation; all of the simple return cases
20161 // are covered.
20163 // Most of the time, an application will not need to know of the details
20164 // of this API; it is handled transparently, and any necessary operations
20165 // are handled by #GAsyncResult's interface. However, if implementing a
20166 // new GIO module, for writing language bindings, or for complex
20167 // applications that need better control of how asynchronous operations
20168 // are completed, it is important to understand this functionality.
20170 // GSimpleAsyncResults are tagged with the calling function to ensure
20171 // that asynchronous functions and their finishing functions are used
20172 // together correctly.
20174 // To create a new #GSimpleAsyncResult, call g_simple_async_result_new().
20175 // If the result needs to be created for a #GError, use
20176 // g_simple_async_result_new_from_error() or
20177 // g_simple_async_result_new_take_error(). If a #GError is not available
20178 // (e.g. the asynchronous operation's doesn't take a #GError argument),
20179 // but the result still needs to be created for an error condition, use
20180 // g_simple_async_result_new_error() (or g_simple_async_result_set_error_va()
20181 // if your application or binding requires passing a variable argument list
20182 // directly), and the error can then be propagated through the use of
20183 // g_simple_async_result_propagate_error().
20185 // An asynchronous operation can be made to ignore a cancellation event by
20186 // calling g_simple_async_result_set_handle_cancellation() with a
20187 // #GSimpleAsyncResult for the operation and %FALSE. This is useful for
20188 // operations that are dangerous to cancel, such as close (which would
20189 // cause a leak if cancelled before being run).
20191 // GSimpleAsyncResult can integrate into GLib's event loop, #GMainLoop,
20192 // or it can use #GThread<!-- -->s.
20193 // g_simple_async_result_complete() will finish an I/O task directly
20194 // from the point where it is called. g_simple_async_result_complete_in_idle()
20195 // will finish it from an idle handler in the <link
20196 // linkend="g-main-context-push-thread-default">thread-default main
20197 // context</link>. g_simple_async_result_run_in_thread() will run the
20198 // job in a separate thread and then deliver the result to the
20199 // thread-default main context.
20201 // To set the results of an asynchronous function,
20202 // g_simple_async_result_set_op_res_gpointer(),
20203 // g_simple_async_result_set_op_res_gboolean(), and
20204 // g_simple_async_result_set_op_res_gssize()
20205 // are provided, setting the operation's result to a gpointer, gboolean, or
20206 // gssize, respectively.
20208 // Likewise, to get the result of an asynchronous function,
20209 // g_simple_async_result_get_op_res_gpointer(),
20210 // g_simple_async_result_get_op_res_gboolean(), and
20211 // g_simple_async_result_get_op_res_gssize() are
20212 // provided, getting the operation's result as a gpointer, gboolean, and
20213 // gssize, respectively.
20215 // For the details of the requirements implementations must respect, see
20216 // #GAsyncResult. A typical implementation of an asynchronous operation
20217 // using GSimpleAsyncResult looks something like this:
20219 // |[
20220 // static void
20221 // baked_cb (Cake *cake,
20222 // gpointer user_data)
20223 // {
20224 // /&ast; In this example, this callback is not given a reference to the cake, so
20225 // &ast; the GSimpleAsyncResult has to take a reference to it.
20226 // &ast;/
20227 // GSimpleAsyncResult *result = user_data;
20229 // if (cake == NULL)
20230 // g_simple_async_result_set_error (result,
20231 // BAKER_ERRORS,
20232 // BAKER_ERROR_NO_FLOUR,
20233 // "Go to the supermarket");
20234 // else
20235 // g_simple_async_result_set_op_res_gpointer (result,
20236 // g_object_ref (cake),
20237 // g_object_unref);
20240 // /&ast; In this example, we assume that baked_cb is called as a callback from
20241 // &ast; the mainloop, so it's safe to complete the operation synchronously here.
20242 // &ast; If, however, _baker_prepare_cake () might call its callback without
20243 // &ast; first returning to the mainloop — inadvisable, but some APIs do so —
20244 // &ast; we would need to use g_simple_async_result_complete_in_idle().
20245 // &ast;/
20246 // g_simple_async_result_complete (result);
20247 // g_object_unref (result);
20248 // }
20250 // void
20251 // baker_bake_cake_async (Baker *self,
20252 // guint radius,
20253 // GAsyncReadyCallback callback,
20254 // gpointer user_data)
20255 // {
20256 // GSimpleAsyncResult *simple;
20257 // Cake *cake;
20259 // if (radius < 3)
20260 // {
20261 // g_simple_async_report_error_in_idle (G_OBJECT (self),
20262 // callback,
20263 // user_data,
20264 // BAKER_ERRORS,
20265 // BAKER_ERROR_TOO_SMALL,
20266 // "%ucm radius cakes are silly",
20267 // radius);
20268 // return;
20269 // }
20271 // simple = g_simple_async_result_new (G_OBJECT (self),
20272 // callback,
20273 // user_data,
20274 // baker_bake_cake_async);
20275 // cake = _baker_get_cached_cake (self, radius);
20277 // if (cake != NULL)
20278 // {
20279 // g_simple_async_result_set_op_res_gpointer (simple,
20280 // g_object_ref (cake),
20281 // g_object_unref);
20282 // g_simple_async_result_complete_in_idle (simple);
20283 // g_object_unref (simple);
20284 // /&ast; Drop the reference returned by _baker_get_cached_cake(); the
20285 // &ast; GSimpleAsyncResult has taken its own reference.
20286 // &ast;/
20287 // g_object_unref (cake);
20288 // return;
20289 // }
20291 // _baker_prepare_cake (self, radius, baked_cb, simple);
20292 // }
20294 // Cake *
20295 // baker_bake_cake_finish (Baker *self,
20296 // GAsyncResult *result,
20297 // GError **error)
20298 // {
20299 // GSimpleAsyncResult *simple;
20300 // Cake *cake;
20302 // g_return_val_if_fail (g_simple_async_result_is_valid (result,
20303 // G_OBJECT (self),
20304 // baker_bake_cake_async),
20305 // NULL);
20307 // simple = (GSimpleAsyncResult *) result;
20309 // if (g_simple_async_result_propagate_error (simple, error))
20310 // return NULL;
20312 // cake = CAKE (g_simple_async_result_get_op_res_gpointer (simple));
20313 // return g_object_ref (cake);
20314 // }
20315 // ]|
20316 struct SimpleAsyncResult /* : GObject.Object */ {
20317 mixin AsyncResult.__interface__;
20318 alias method_parent this;
20319 alias method_parent super_;
20320 alias method_parent object;
20321 GObject2.Object method_parent;
20324 // Creates a #GSimpleAsyncResult.
20326 // The common convention is to create the #GSimpleAsyncResult in the
20327 // function that starts the asynchronous operation and use that same
20328 // function as the @source_tag.
20330 // If your operation supports cancellation with #GCancellable (which it
20331 // probably should) then you should provide the user's cancellable to
20332 // g_simple_async_result_set_check_cancellable() immediately after
20333 // this function returns.
20334 // RETURNS: a #GSimpleAsyncResult.
20335 // <source_object>: a #GObject, or %NULL.
20336 // <callback>: a #GAsyncReadyCallback.
20337 // <user_data>: user data passed to @callback.
20338 // <source_tag>: the asynchronous function.
20339 static SimpleAsyncResult* /*new*/ new_(AT0, AT1, AT2)(AT0 /*GObject2.Object*/ source_object, AsyncReadyCallback callback, AT1 /*void*/ user_data, AT2 /*void*/ source_tag) nothrow {
20340 return g_simple_async_result_new(UpCast!(GObject2.Object*)(source_object), callback, UpCast!(void*)(user_data), UpCast!(void*)(source_tag));
20342 static auto opCall(AT0, AT1, AT2)(AT0 /*GObject2.Object*/ source_object, AsyncReadyCallback callback, AT1 /*void*/ user_data, AT2 /*void*/ source_tag) {
20343 return g_simple_async_result_new(UpCast!(GObject2.Object*)(source_object), callback, UpCast!(void*)(user_data), UpCast!(void*)(source_tag));
20346 // Unintrospectable constructor: new_error() / g_simple_async_result_new_error()
20347 // Creates a new #GSimpleAsyncResult with a set error.
20348 // RETURNS: a #GSimpleAsyncResult.
20349 // <source_object>: a #GObject, or %NULL.
20350 // <callback>: a #GAsyncReadyCallback.
20351 // <user_data>: user data passed to @callback.
20352 // <domain>: a #GQuark.
20353 // <code>: an error code.
20354 // <format>: a string with format characters.
20355 alias g_simple_async_result_new_error new_error; // Variadic
20357 // Creates a #GSimpleAsyncResult from an error condition.
20358 // RETURNS: a #GSimpleAsyncResult.
20359 // <source_object>: a #GObject, or %NULL.
20360 // <callback>: a #GAsyncReadyCallback.
20361 // <user_data>: user data passed to @callback.
20362 // <error>: a #GError
20363 static SimpleAsyncResult* /*new*/ new_from_error(AT0, AT1, AT2)(AT0 /*GObject2.Object*/ source_object, AsyncReadyCallback callback, AT1 /*void*/ user_data, AT2 /*GLib2.Error*/ error) nothrow {
20364 return g_simple_async_result_new_from_error(UpCast!(GObject2.Object*)(source_object), callback, UpCast!(void*)(user_data), UpCast!(GLib2.Error*)(error));
20366 static auto opCall(AT0, AT1, AT2)(AT0 /*GObject2.Object*/ source_object, AsyncReadyCallback callback, AT1 /*void*/ user_data, AT2 /*GLib2.Error*/ error) {
20367 return g_simple_async_result_new_from_error(UpCast!(GObject2.Object*)(source_object), callback, UpCast!(void*)(user_data), UpCast!(GLib2.Error*)(error));
20370 // Unintrospectable constructor: new_take_error() / g_simple_async_result_new_take_error()
20371 // VERSION: 2.28
20372 // Creates a #GSimpleAsyncResult from an error condition, and takes over the
20373 // caller's ownership of @error, so the caller does not need to free it anymore.
20374 // RETURNS: a #GSimpleAsyncResult
20375 // <source_object>: a #GObject, or %NULL
20376 // <callback>: a #GAsyncReadyCallback
20377 // <user_data>: user data passed to @callback
20378 // <error>: a #GError
20379 static SimpleAsyncResult* /*new*/ new_take_error(AT0, AT1, AT2)(AT0 /*GObject2.Object*/ source_object, AsyncReadyCallback callback, AT1 /*void*/ user_data, AT2 /*GLib2.Error*/ error) nothrow {
20380 return g_simple_async_result_new_take_error(UpCast!(GObject2.Object*)(source_object), callback, UpCast!(void*)(user_data), UpCast!(GLib2.Error*)(error));
20382 static auto opCall(AT0, AT1, AT2)(AT0 /*GObject2.Object*/ source_object, AsyncReadyCallback callback, AT1 /*void*/ user_data, AT2 /*GLib2.Error*/ error) {
20383 return g_simple_async_result_new_take_error(UpCast!(GObject2.Object*)(source_object), callback, UpCast!(void*)(user_data), UpCast!(GLib2.Error*)(error));
20386 // VERSION: 2.20
20387 // Ensures that the data passed to the _finish function of an async
20388 // operation is consistent. Three checks are performed.
20390 // First, @result is checked to ensure that it is really a
20391 // #GSimpleAsyncResult. Second, @source is checked to ensure that it
20392 // matches the source object of @result. Third, @source_tag is
20393 // checked to ensure that it is either %NULL (as it is when the result was
20394 // created by g_simple_async_report_error_in_idle() or
20395 // g_simple_async_report_gerror_in_idle()) or equal to the
20396 // @source_tag argument given to g_simple_async_result_new() (which, by
20397 // convention, is a pointer to the _async function corresponding to the
20398 // _finish function from which this function is called).
20399 // RETURNS: #TRUE if all checks passed or #FALSE if any failed.
20400 // <result>: the #GAsyncResult passed to the _finish function.
20401 // <source>: the #GObject passed to the _finish function.
20402 // <source_tag>: the asynchronous function.
20403 static int is_valid(AT0, AT1, AT2)(AT0 /*AsyncResult*/ result, AT1 /*GObject2.Object*/ source, AT2 /*void*/ source_tag) nothrow {
20404 return g_simple_async_result_is_valid(UpCast!(AsyncResult*)(result), UpCast!(GObject2.Object*)(source), UpCast!(void*)(source_tag));
20407 // Completes an asynchronous I/O job immediately. Must be called in
20408 // the thread where the asynchronous result was to be delivered, as it
20409 // invokes the callback directly. If you are in a different thread use
20410 // g_simple_async_result_complete_in_idle().
20412 // Calling this function takes a reference to @simple for as long as
20413 // is needed to complete the call.
20414 void complete()() nothrow {
20415 g_simple_async_result_complete(&this);
20418 // Completes an asynchronous function in an idle handler in the <link
20419 // linkend="g-main-context-push-thread-default">thread-default main
20420 // loop</link> of the thread that @simple was initially created in
20421 // (and re-pushes that context around the invocation of the callback).
20423 // Calling this function takes a reference to @simple for as long as
20424 // is needed to complete the call.
20425 void complete_in_idle()() nothrow {
20426 g_simple_async_result_complete_in_idle(&this);
20429 // Gets the operation result boolean from within the asynchronous result.
20431 // if the operation's result was %FALSE.
20432 // RETURNS: %TRUE if the operation's result was %TRUE, %FALSE
20433 int get_op_res_gboolean()() nothrow {
20434 return g_simple_async_result_get_op_res_gboolean(&this);
20437 // Unintrospectable method: get_op_res_gpointer() / g_simple_async_result_get_op_res_gpointer()
20438 // Gets a pointer result as returned by the asynchronous function.
20439 // RETURNS: a pointer from the result.
20440 void* get_op_res_gpointer()() nothrow {
20441 return g_simple_async_result_get_op_res_gpointer(&this);
20444 // Gets a gssize from the asynchronous result.
20445 // RETURNS: a gssize returned from the asynchronous function.
20446 ssize_t get_op_res_gssize()() nothrow {
20447 return g_simple_async_result_get_op_res_gssize(&this);
20450 // Unintrospectable method: get_source_tag() / g_simple_async_result_get_source_tag()
20451 // Gets the source tag for the #GSimpleAsyncResult.
20452 // RETURNS: a #gpointer to the source object for the #GSimpleAsyncResult.
20453 void* get_source_tag()() nothrow {
20454 return g_simple_async_result_get_source_tag(&this);
20457 // Propagates an error from within the simple asynchronous result to
20458 // a given destination.
20460 // If the #GCancellable given to a prior call to
20461 // g_simple_async_result_set_check_cancellable() is cancelled then this
20462 // function will return %TRUE with @dest set appropriately.
20463 // RETURNS: %TRUE if the error was propagated to @dest. %FALSE otherwise.
20464 int propagate_error(AT0)(AT0 /*GLib2.Error**/ error=null) nothrow {
20465 return g_simple_async_result_propagate_error(&this, UpCast!(GLib2.Error**)(error));
20468 // Unintrospectable method: run_in_thread() / g_simple_async_result_run_in_thread()
20469 // Runs the asynchronous job in a separate thread and then calls
20470 // g_simple_async_result_complete_in_idle() on @simple to return
20471 // the result to the appropriate main loop.
20473 // Calling this function takes a reference to @simple for as long as
20474 // is needed to run the job and report its completion.
20475 // <func>: a #GSimpleAsyncThreadFunc.
20476 // <io_priority>: the io priority of the request.
20477 // <cancellable>: optional #GCancellable object, %NULL to ignore.
20478 void run_in_thread(AT0)(SimpleAsyncThreadFunc func, int io_priority, AT0 /*Cancellable*/ cancellable=null) nothrow {
20479 g_simple_async_result_run_in_thread(&this, func, io_priority, UpCast!(Cancellable*)(cancellable));
20482 // VERSION: 2.32
20483 // Sets a #GCancellable to check before dispatching results.
20485 // This function has one very specific purpose: the provided cancellable
20486 // is checked at the time of g_simple_async_result_propagate_error() If
20487 // it is cancelled, these functions will return an "Operation was
20488 // cancelled" error (%G_IO_ERROR_CANCELLED).
20490 // Implementors of cancellable asynchronous functions should use this in
20491 // order to provide a guarantee to their callers that cancelling an
20492 // async operation will reliably result in an error being returned for
20493 // that operation (even if a positive result for the operation has
20494 // already been sent as an idle to the main context to be dispatched).
20496 // The checking described above is done regardless of any call to the
20497 // unrelated g_simple_async_result_set_handle_cancellation() function.
20498 // <check_cancellable>: a #GCancellable to check, or %NULL to unset
20499 void set_check_cancellable(AT0)(AT0 /*Cancellable*/ check_cancellable=null) nothrow {
20500 g_simple_async_result_set_check_cancellable(&this, UpCast!(Cancellable*)(check_cancellable));
20503 // Unintrospectable method: set_error() / g_simple_async_result_set_error()
20504 // Sets an error within the asynchronous result without a #GError.
20505 // <domain>: a #GQuark (usually #G_IO_ERROR).
20506 // <code>: an error code.
20507 // <format>: a formatted error reporting string.
20508 /+ Not available -- variadic methods unsupported - use the C function directly.
20509 alias g_simple_async_result_set_error set_error; // Variadic
20512 // Unintrospectable method: set_error_va() / g_simple_async_result_set_error_va()
20513 // Sets an error within the asynchronous result without a #GError.
20514 // Unless writing a binding, see g_simple_async_result_set_error().
20515 // <domain>: a #GQuark (usually #G_IO_ERROR).
20516 // <code>: an error code.
20517 // <format>: a formatted error reporting string.
20518 // <args>: va_list of arguments.
20519 void set_error_va(AT0)(GLib2.Quark domain, int code, AT0 /*char*/ format, va_list args) nothrow {
20520 g_simple_async_result_set_error_va(&this, domain, code, toCString!(char*)(format), args);
20523 // Sets the result from a #GError.
20524 // <error>: #GError.
20525 void set_from_error(AT0)(AT0 /*GLib2.Error*/ error) nothrow {
20526 g_simple_async_result_set_from_error(&this, UpCast!(GLib2.Error*)(error));
20529 // Sets whether to handle cancellation within the asynchronous operation.
20531 // This function has nothing to do with
20532 // g_simple_async_result_set_check_cancellable(). It only refers to the
20533 // #GCancellable passed to g_simple_async_result_run_in_thread().
20534 // <handle_cancellation>: a #gboolean.
20535 void set_handle_cancellation()(int handle_cancellation) nothrow {
20536 g_simple_async_result_set_handle_cancellation(&this, handle_cancellation);
20539 // Sets the operation result to a boolean within the asynchronous result.
20540 // <op_res>: a #gboolean.
20541 void set_op_res_gboolean()(int op_res) nothrow {
20542 g_simple_async_result_set_op_res_gboolean(&this, op_res);
20545 // Unintrospectable method: set_op_res_gpointer() / g_simple_async_result_set_op_res_gpointer()
20546 // Sets the operation result within the asynchronous result to a pointer.
20547 // <op_res>: a pointer result from an asynchronous function.
20548 // <destroy_op_res>: a #GDestroyNotify function.
20549 void set_op_res_gpointer(AT0)(AT0 /*void*/ op_res, GLib2.DestroyNotify destroy_op_res) nothrow {
20550 g_simple_async_result_set_op_res_gpointer(&this, UpCast!(void*)(op_res), destroy_op_res);
20553 // Sets the operation result within the asynchronous result to
20554 // the given @op_res.
20555 // <op_res>: a #gssize.
20556 void set_op_res_gssize()(ssize_t op_res) nothrow {
20557 g_simple_async_result_set_op_res_gssize(&this, op_res);
20560 // Unintrospectable method: take_error() / g_simple_async_result_take_error()
20561 // VERSION: 2.28
20562 // Sets the result from @error, and takes over the caller's ownership
20563 // of @error, so the caller does not need to free it any more.
20564 // <error>: a #GError
20565 void take_error(AT0)(AT0 /*GLib2.Error*/ error) nothrow {
20566 g_simple_async_result_take_error(&this, UpCast!(GLib2.Error*)(error));
20570 struct SimpleAsyncResultClass {
20574 // Simple thread function that runs an asynchronous operation and
20575 // checks for cancellation.
20576 // <res>: a #GSimpleAsyncResult.
20577 // <object>: a #GObject.
20578 // <cancellable>: optional #GCancellable object, %NULL to ignore.
20579 extern (C) alias void function (SimpleAsyncResult* res, GObject2.Object* object, Cancellable* cancellable=null) nothrow SimpleAsyncThreadFunc;
20582 // #GSimplePermission is a trivial implementation of #GPermission that
20583 // represents a permission that is either always or never allowed. The
20584 // value is given at construction and doesn't change.
20586 // Calling request or release will result in errors.
20587 struct SimplePermission /* : Permission */ {
20588 alias method_parent this;
20589 alias method_parent super_;
20590 alias method_parent permission;
20591 Permission method_parent;
20594 // VERSION: 2.26
20595 // Creates a new #GPermission instance that represents an action that is
20596 // either always or never allowed.
20597 // RETURNS: the #GSimplePermission, as a #GPermission
20598 // <allowed>: %TRUE if the action is allowed
20599 static SimplePermission* /*new*/ new_()(int allowed) nothrow {
20600 return g_simple_permission_new(allowed);
20602 static auto opCall()(int allowed) {
20603 return g_simple_permission_new(allowed);
20608 // A #GSocket is a low-level networking primitive. It is a more or less
20609 // direct mapping of the BSD socket API in a portable GObject based API.
20610 // It supports both the UNIX socket implementations and winsock2 on Windows.
20612 // #GSocket is the platform independent base upon which the higher level
20613 // network primitives are based. Applications are not typically meant to
20614 // use it directly, but rather through classes like #GSocketClient,
20615 // #GSocketService and #GSocketConnection. However there may be cases where
20616 // direct use of #GSocket is useful.
20618 // #GSocket implements the #GInitable interface, so if it is manually constructed
20619 // by e.g. g_object_new() you must call g_initable_init() and check the
20620 // results before using the object. This is done automatically in
20621 // g_socket_new() and g_socket_new_from_fd(), so these functions can return
20622 // %NULL.
20624 // Sockets operate in two general modes, blocking or non-blocking. When
20625 // in blocking mode all operations block until the requested operation
20626 // is finished or there is an error. In non-blocking mode all calls that
20627 // would block return immediately with a %G_IO_ERROR_WOULD_BLOCK error.
20628 // To know when a call would successfully run you can call g_socket_condition_check(),
20629 // or g_socket_condition_wait(). You can also use g_socket_create_source() and
20630 // attach it to a #GMainContext to get callbacks when I/O is possible.
20631 // Note that all sockets are always set to non blocking mode in the system, and
20632 // blocking mode is emulated in GSocket.
20634 // When working in non-blocking mode applications should always be able to
20635 // handle getting a %G_IO_ERROR_WOULD_BLOCK error even when some other
20636 // function said that I/O was possible. This can easily happen in case
20637 // of a race condition in the application, but it can also happen for other
20638 // reasons. For instance, on Windows a socket is always seen as writable
20639 // until a write returns %G_IO_ERROR_WOULD_BLOCK.
20641 // #GSocket<!-- -->s can be either connection oriented or datagram based.
20642 // For connection oriented types you must first establish a connection by
20643 // either connecting to an address or accepting a connection from another
20644 // address. For connectionless socket types the target/source address is
20645 // specified or received in each I/O operation.
20647 // All socket file descriptors are set to be close-on-exec.
20649 // Note that creating a #GSocket causes the signal %SIGPIPE to be
20650 // ignored for the remainder of the program. If you are writing a
20651 // command-line utility that uses #GSocket, you may need to take into
20652 // account the fact that your program will not automatically be killed
20653 // if it tries to write to %stdout after it has been closed.
20654 struct Socket /* : GObject.Object */ /* Version 2.22 */ {
20655 mixin Initable.__interface__;
20656 alias parent_instance this;
20657 alias parent_instance super_;
20658 alias parent_instance object;
20659 GObject2.Object parent_instance;
20660 SocketPrivate* priv;
20663 // VERSION: 2.22
20664 // Creates a new #GSocket with the defined family, type and protocol.
20665 // If @protocol is 0 (%G_SOCKET_PROTOCOL_DEFAULT) the default protocol type
20666 // for the family and type is used.
20668 // The @protocol is a family and type specific int that specifies what
20669 // kind of protocol to use. #GSocketProtocol lists several common ones.
20670 // Many families only support one protocol, and use 0 for this, others
20671 // support several and using 0 means to use the default protocol for
20672 // the family and type.
20674 // The protocol id is passed directly to the operating
20675 // system, so you can use protocols not listed in #GSocketProtocol if you
20676 // know the protocol number used for it.
20678 // Free the returned object with g_object_unref().
20679 // RETURNS: a #GSocket or %NULL on error.
20680 // <family>: the socket family to use, e.g. %G_SOCKET_FAMILY_IPV4.
20681 // <type>: the socket type to use.
20682 // <protocol>: the id of the protocol to use, or 0 for default.
20683 static Socket* /*new*/ new_(AT0)(SocketFamily family, SocketType type, SocketProtocol protocol, AT0 /*GLib2.Error**/ error=null) nothrow {
20684 return g_socket_new(family, type, protocol, UpCast!(GLib2.Error**)(error));
20686 static auto opCall(AT0)(SocketFamily family, SocketType type, SocketProtocol protocol, AT0 /*GLib2.Error**/ error=null) {
20687 return g_socket_new(family, type, protocol, UpCast!(GLib2.Error**)(error));
20690 // VERSION: 2.22
20691 // Creates a new #GSocket from a native file descriptor
20692 // or winsock SOCKET handle.
20694 // This reads all the settings from the file descriptor so that
20695 // all properties should work. Note that the file descriptor
20696 // will be set to non-blocking mode, independent on the blocking
20697 // mode of the #GSocket.
20699 // Free the returned object with g_object_unref().
20700 // RETURNS: a #GSocket or %NULL on error.
20701 // <fd>: a native socket file descriptor.
20702 static Socket* /*new*/ new_from_fd(AT0)(int fd, AT0 /*GLib2.Error**/ error=null) nothrow {
20703 return g_socket_new_from_fd(fd, UpCast!(GLib2.Error**)(error));
20705 static auto opCall(AT0)(int fd, AT0 /*GLib2.Error**/ error=null) {
20706 return g_socket_new_from_fd(fd, UpCast!(GLib2.Error**)(error));
20709 // VERSION: 2.22
20710 // Accept incoming connections on a connection-based socket. This removes
20711 // the first outstanding connection request from the listening socket and
20712 // creates a #GSocket object for it.
20714 // The @socket must be bound to a local address with g_socket_bind() and
20715 // must be listening for incoming connections (g_socket_listen()).
20717 // If there are no outstanding connections then the operation will block
20718 // or return %G_IO_ERROR_WOULD_BLOCK if non-blocking I/O is enabled.
20719 // To be notified of an incoming connection, wait for the %G_IO_IN condition.
20721 // Free the returned object with g_object_unref().
20722 // RETURNS: a new #GSocket, or %NULL on error.
20723 // <cancellable>: a %GCancellable or %NULL
20724 Socket* /*new*/ accept(AT0, AT1)(AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
20725 return g_socket_accept(&this, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
20728 // VERSION: 2.22
20729 // When a socket is created it is attached to an address family, but it
20730 // doesn't have an address in this family. g_socket_bind() assigns the
20731 // address (sometimes called name) of the socket.
20733 // It is generally required to bind to a local address before you can
20734 // receive connections. (See g_socket_listen() and g_socket_accept() ).
20735 // In certain situations, you may also want to bind a socket that will be
20736 // used to initiate connections, though this is not normally required.
20738 // @allow_reuse should be %TRUE for server sockets (sockets that you will
20739 // eventually call g_socket_accept() on), and %FALSE for client sockets.
20740 // (Specifically, if it is %TRUE, then g_socket_bind() will set the
20741 // %SO_REUSEADDR flag on the socket, allowing it to bind @address even if
20742 // that address was previously used by another socket that has not yet been
20743 // fully cleaned-up by the kernel. Failing to set this flag on a server
20744 // socket may cause the bind call to return %G_IO_ERROR_ADDRESS_IN_USE if
20745 // the server program is stopped and then immediately restarted.)
20746 // RETURNS: %TRUE on success, %FALSE on error.
20747 // <address>: a #GSocketAddress specifying the local address.
20748 // <allow_reuse>: whether to allow reusing this address
20749 int bind(AT0, AT1)(AT0 /*SocketAddress*/ address, int allow_reuse, AT1 /*GLib2.Error**/ error=null) nothrow {
20750 return g_socket_bind(&this, UpCast!(SocketAddress*)(address), allow_reuse, UpCast!(GLib2.Error**)(error));
20753 // VERSION: 2.22
20754 // Checks and resets the pending connect error for the socket.
20755 // This is used to check for errors when g_socket_connect() is
20756 // used in non-blocking mode.
20757 // RETURNS: %TRUE if no error, %FALSE otherwise, setting @error to the error
20758 int check_connect_result(AT0)(AT0 /*GLib2.Error**/ error=null) nothrow {
20759 return g_socket_check_connect_result(&this, UpCast!(GLib2.Error**)(error));
20762 // VERSION: 2.22
20763 // Closes the socket, shutting down any active connection.
20765 // Closing a socket does not wait for all outstanding I/O operations
20766 // to finish, so the caller should not rely on them to be guaranteed
20767 // to complete even if the close returns with no error.
20769 // Once the socket is closed, all other operations will return
20770 // %G_IO_ERROR_CLOSED. Closing a socket multiple times will not
20771 // return an error.
20773 // Sockets will be automatically closed when the last reference
20774 // is dropped, but you might want to call this function to make sure
20775 // resources are released as early as possible.
20777 // Beware that due to the way that TCP works, it is possible for
20778 // recently-sent data to be lost if either you close a socket while the
20779 // %G_IO_IN condition is set, or else if the remote connection tries to
20780 // send something to you after you close the socket but before it has
20781 // finished reading all of the data you sent. There is no easy generic
20782 // way to avoid this problem; the easiest fix is to design the network
20783 // protocol such that the client will never send data "out of turn".
20784 // Another solution is for the server to half-close the connection by
20785 // calling g_socket_shutdown() with only the @shutdown_write flag set,
20786 // and then wait for the client to notice this and close its side of the
20787 // connection, after which the server can safely call g_socket_close().
20788 // (This is what #GTcpConnection does if you call
20789 // g_tcp_connection_set_graceful_disconnect(). But of course, this
20790 // only works if the client will close its connection after the server
20791 // does.)
20792 // RETURNS: %TRUE on success, %FALSE on error
20793 int close(AT0)(AT0 /*GLib2.Error**/ error=null) nothrow {
20794 return g_socket_close(&this, UpCast!(GLib2.Error**)(error));
20797 // VERSION: 2.22
20798 // Checks on the readiness of @socket to perform operations.
20799 // The operations specified in @condition are checked for and masked
20800 // against the currently-satisfied conditions on @socket. The result
20801 // is returned.
20803 // Note that on Windows, it is possible for an operation to return
20804 // %G_IO_ERROR_WOULD_BLOCK even immediately after
20805 // g_socket_condition_check() has claimed that the socket is ready for
20806 // writing. Rather than calling g_socket_condition_check() and then
20807 // writing to the socket if it succeeds, it is generally better to
20808 // simply try writing to the socket right away, and try again later if
20809 // the initial attempt returns %G_IO_ERROR_WOULD_BLOCK.
20811 // It is meaningless to specify %G_IO_ERR or %G_IO_HUP in condition;
20812 // these conditions will always be set in the output if they are true.
20814 // This call never blocks.
20815 // RETURNS: the @GIOCondition mask of the current state
20816 // <condition>: a #GIOCondition mask to check
20817 GLib2.IOCondition condition_check()(GLib2.IOCondition condition) nothrow {
20818 return g_socket_condition_check(&this, condition);
20821 // VERSION: 2.32
20822 // Waits for up to @timeout microseconds for @condition to become true
20823 // on @socket. If the condition is met, %TRUE is returned.
20825 // If @cancellable is cancelled before the condition is met, or if
20826 // @timeout (or the socket's #GSocket:timeout) is reached before the
20827 // condition is met, then %FALSE is returned and @error, if non-%NULL,
20828 // is set to the appropriate value (%G_IO_ERROR_CANCELLED or
20829 // %G_IO_ERROR_TIMED_OUT).
20831 // If you don't want a timeout, use g_socket_condition_wait().
20832 // (Alternatively, you can pass -1 for @timeout.)
20834 // Note that although @timeout is in microseconds for consistency with
20835 // other GLib APIs, this function actually only has millisecond
20836 // resolution, and the behavior is undefined if @timeout is not an
20837 // exact number of milliseconds.
20838 // RETURNS: %TRUE if the condition was met, %FALSE otherwise
20839 // <condition>: a #GIOCondition mask to wait for
20840 // <timeout>: the maximum time (in microseconds) to wait, or -1
20841 // <cancellable>: a #GCancellable, or %NULL
20842 int condition_timed_wait(AT0, AT1)(GLib2.IOCondition condition, long timeout, AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
20843 return g_socket_condition_timed_wait(&this, condition, timeout, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
20846 // VERSION: 2.22
20847 // Waits for @condition to become true on @socket. When the condition
20848 // is met, %TRUE is returned.
20850 // If @cancellable is cancelled before the condition is met, or if the
20851 // socket has a timeout set and it is reached before the condition is
20852 // met, then %FALSE is returned and @error, if non-%NULL, is set to
20853 // the appropriate value (%G_IO_ERROR_CANCELLED or
20854 // %G_IO_ERROR_TIMED_OUT).
20856 // See also g_socket_condition_timed_wait().
20857 // RETURNS: %TRUE if the condition was met, %FALSE otherwise
20858 // <condition>: a #GIOCondition mask to wait for
20859 // <cancellable>: a #GCancellable, or %NULL
20860 int condition_wait(AT0, AT1)(GLib2.IOCondition condition, AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
20861 return g_socket_condition_wait(&this, condition, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
20864 // VERSION: 2.22
20865 // Connect the socket to the specified remote address.
20867 // For connection oriented socket this generally means we attempt to make
20868 // a connection to the @address. For a connection-less socket it sets
20869 // the default address for g_socket_send() and discards all incoming datagrams
20870 // from other sources.
20872 // Generally connection oriented sockets can only connect once, but
20873 // connection-less sockets can connect multiple times to change the
20874 // default address.
20876 // If the connect call needs to do network I/O it will block, unless
20877 // non-blocking I/O is enabled. Then %G_IO_ERROR_PENDING is returned
20878 // and the user can be notified of the connection finishing by waiting
20879 // for the G_IO_OUT condition. The result of the connection must then be
20880 // checked with g_socket_check_connect_result().
20881 // RETURNS: %TRUE if connected, %FALSE on error.
20882 // <address>: a #GSocketAddress specifying the remote address.
20883 // <cancellable>: a %GCancellable or %NULL
20884 int connect(AT0, AT1, AT2)(AT0 /*SocketAddress*/ address, AT1 /*Cancellable*/ cancellable, AT2 /*GLib2.Error**/ error=null) nothrow {
20885 return g_socket_connect(&this, UpCast!(SocketAddress*)(address), UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
20888 // VERSION: 2.22
20889 // Creates a #GSocketConnection subclass of the right type for
20890 // @socket.
20891 // RETURNS: a #GSocketConnection
20892 SocketConnection* /*new*/ connection_factory_create_connection()() nothrow {
20893 return g_socket_connection_factory_create_connection(&this);
20896 // Unintrospectable method: create_source() / g_socket_create_source()
20897 // VERSION: 2.22
20898 // Creates a %GSource that can be attached to a %GMainContext to monitor
20899 // for the availibility of the specified @condition on the socket.
20901 // The callback on the source is of the #GSocketSourceFunc type.
20903 // It is meaningless to specify %G_IO_ERR or %G_IO_HUP in @condition;
20904 // these conditions will always be reported output if they are true.
20906 // @cancellable if not %NULL can be used to cancel the source, which will
20907 // cause the source to trigger, reporting the current condition (which
20908 // is likely 0 unless cancellation happened at the same time as a
20909 // condition change). You can check for this in the callback using
20910 // g_cancellable_is_cancelled().
20912 // If @socket has a timeout set, and it is reached before @condition
20913 // occurs, the source will then trigger anyway, reporting %G_IO_IN or
20914 // %G_IO_OUT depending on @condition. However, @socket will have been
20915 // marked as having had a timeout, and so the next #GSocket I/O method
20916 // you call will then fail with a %G_IO_ERROR_TIMED_OUT.
20917 // RETURNS: a newly allocated %GSource, free with g_source_unref().
20918 // <condition>: a #GIOCondition mask to monitor
20919 // <cancellable>: a %GCancellable or %NULL
20920 GLib2.Source* /*new*/ create_source(AT0)(GLib2.IOCondition condition, AT0 /*Cancellable*/ cancellable=null) nothrow {
20921 return g_socket_create_source(&this, condition, UpCast!(Cancellable*)(cancellable));
20924 // VERSION: 2.32
20925 // Get the amount of data pending in the OS input buffer.
20927 // without blocking or -1 on error.
20928 // RETURNS: the number of bytes that can be read from the socket
20929 ssize_t get_available_bytes()() nothrow {
20930 return g_socket_get_available_bytes(&this);
20933 // VERSION: 2.22
20934 // Gets the blocking mode of the socket. For details on blocking I/O,
20935 // see g_socket_set_blocking().
20936 // RETURNS: %TRUE if blocking I/O is used, %FALSE otherwise.
20937 int get_blocking()() nothrow {
20938 return g_socket_get_blocking(&this);
20941 // VERSION: 2.32
20942 // Gets the broadcast setting on @socket; if %TRUE,
20943 // it is possible to send packets to broadcast
20944 // addresses or receive from broadcast addresses.
20945 // RETURNS: the broadcast setting on @socket
20946 int get_broadcast()() nothrow {
20947 return g_socket_get_broadcast(&this);
20950 // VERSION: 2.26
20951 // Returns the credentials of the foreign process connected to this
20952 // socket, if any (e.g. it is only supported for %G_SOCKET_FAMILY_UNIX
20953 // sockets).
20955 // If this operation isn't supported on the OS, the method fails with
20956 // the %G_IO_ERROR_NOT_SUPPORTED error. On Linux this is implemented
20957 // by reading the %SO_PEERCRED option on the underlying socket.
20959 // Other ways to obtain credentials from a foreign peer includes the
20960 // #GUnixCredentialsMessage type and
20961 // g_unix_connection_send_credentials() /
20962 // g_unix_connection_receive_credentials() functions.
20964 // that must be freed with g_object_unref().
20965 // RETURNS: %NULL if @error is set, otherwise a #GCredentials object
20966 Credentials* /*new*/ get_credentials(AT0)(AT0 /*GLib2.Error**/ error=null) nothrow {
20967 return g_socket_get_credentials(&this, UpCast!(GLib2.Error**)(error));
20970 // VERSION: 2.22
20971 // Gets the socket family of the socket.
20972 // RETURNS: a #GSocketFamily
20973 SocketFamily get_family()() nothrow {
20974 return g_socket_get_family(&this);
20977 // VERSION: 2.22
20978 // Returns the underlying OS socket object. On unix this
20979 // is a socket file descriptor, and on windows this is
20980 // a Winsock2 SOCKET handle. This may be useful for
20981 // doing platform specific or otherwise unusual operations
20982 // on the socket.
20983 // RETURNS: the file descriptor of the socket.
20984 int get_fd()() nothrow {
20985 return g_socket_get_fd(&this);
20988 // VERSION: 2.22
20989 // Gets the keepalive mode of the socket. For details on this,
20990 // see g_socket_set_keepalive().
20991 // RETURNS: %TRUE if keepalive is active, %FALSE otherwise.
20992 int get_keepalive()() nothrow {
20993 return g_socket_get_keepalive(&this);
20996 // VERSION: 2.22
20997 // Gets the listen backlog setting of the socket. For details on this,
20998 // see g_socket_set_listen_backlog().
20999 // RETURNS: the maximum number of pending connections.
21000 int get_listen_backlog()() nothrow {
21001 return g_socket_get_listen_backlog(&this);
21004 // VERSION: 2.22
21005 // Try to get the local address of a bound socket. This is only
21006 // useful if the socket has been bound to a local address,
21007 // either explicitly or implicitly when connecting.
21009 // Free the returned object with g_object_unref().
21010 // RETURNS: a #GSocketAddress or %NULL on error.
21011 SocketAddress* /*new*/ get_local_address(AT0)(AT0 /*GLib2.Error**/ error=null) nothrow {
21012 return g_socket_get_local_address(&this, UpCast!(GLib2.Error**)(error));
21015 // VERSION: 2.32
21016 // Gets the multicast loopback setting on @socket; if %TRUE (the
21017 // default), outgoing multicast packets will be looped back to
21018 // multicast listeners on the same host.
21019 // RETURNS: the multicast loopback setting on @socket
21020 int get_multicast_loopback()() nothrow {
21021 return g_socket_get_multicast_loopback(&this);
21024 // VERSION: 2.32
21025 // Gets the multicast time-to-live setting on @socket; see
21026 // g_socket_set_multicast_ttl() for more details.
21027 // RETURNS: the multicast time-to-live setting on @socket
21028 uint get_multicast_ttl()() nothrow {
21029 return g_socket_get_multicast_ttl(&this);
21032 // VERSION: 2.22
21033 // Gets the socket protocol id the socket was created with.
21034 // In case the protocol is unknown, -1 is returned.
21035 // RETURNS: a protocol id, or -1 if unknown
21036 SocketProtocol get_protocol()() nothrow {
21037 return g_socket_get_protocol(&this);
21040 // VERSION: 2.22
21041 // Try to get the remove address of a connected socket. This is only
21042 // useful for connection oriented sockets that have been connected.
21044 // Free the returned object with g_object_unref().
21045 // RETURNS: a #GSocketAddress or %NULL on error.
21046 SocketAddress* /*new*/ get_remote_address(AT0)(AT0 /*GLib2.Error**/ error=null) nothrow {
21047 return g_socket_get_remote_address(&this, UpCast!(GLib2.Error**)(error));
21050 // VERSION: 2.22
21051 // Gets the socket type of the socket.
21052 // RETURNS: a #GSocketType
21053 SocketType get_socket_type()() nothrow {
21054 return g_socket_get_socket_type(&this);
21057 // VERSION: 2.26
21058 // Gets the timeout setting of the socket. For details on this, see
21059 // g_socket_set_timeout().
21060 // RETURNS: the timeout in seconds
21061 uint get_timeout()() nothrow {
21062 return g_socket_get_timeout(&this);
21065 // VERSION: 2.32
21066 // Gets the unicast time-to-live setting on @socket; see
21067 // g_socket_set_ttl() for more details.
21068 // RETURNS: the time-to-live setting on @socket
21069 uint get_ttl()() nothrow {
21070 return g_socket_get_ttl(&this);
21073 // VERSION: 2.22
21074 // Checks whether a socket is closed.
21075 // RETURNS: %TRUE if socket is closed, %FALSE otherwise
21076 int is_closed()() nothrow {
21077 return g_socket_is_closed(&this);
21080 // VERSION: 2.22
21081 // Check whether the socket is connected. This is only useful for
21082 // connection-oriented sockets.
21083 // RETURNS: %TRUE if socket is connected, %FALSE otherwise.
21084 int is_connected()() nothrow {
21085 return g_socket_is_connected(&this);
21088 // VERSION: 2.32
21089 // Registers @socket to receive multicast messages sent to @group.
21090 // @socket must be a %G_SOCKET_TYPE_DATAGRAM socket, and must have
21091 // been bound to an appropriate interface and port with
21092 // g_socket_bind().
21094 // If @iface is %NULL, the system will automatically pick an interface
21095 // to bind to based on @group.
21097 // If @source_specific is %TRUE, source-specific multicast as defined
21098 // in RFC 4604 is used. Note that on older platforms this may fail
21099 // with a %G_IO_ERROR_NOT_SUPPORTED error.
21100 // RETURNS: %TRUE on success, %FALSE on error.
21101 // <group>: a #GInetAddress specifying the group address to join.
21102 // <source_specific>: %TRUE if source-specific multicast should be used
21103 // <iface>: Name of the interface to use, or %NULL
21104 int join_multicast_group(AT0, AT1, AT2)(AT0 /*InetAddress*/ group, int source_specific, AT1 /*char*/ iface, AT2 /*GLib2.Error**/ error=null) nothrow {
21105 return g_socket_join_multicast_group(&this, UpCast!(InetAddress*)(group), source_specific, toCString!(char*)(iface), UpCast!(GLib2.Error**)(error));
21108 // VERSION: 2.32
21109 // Removes @socket from the multicast group defined by @group, @iface,
21110 // and @source_specific (which must all have the same values they had
21111 // when you joined the group).
21113 // @socket remains bound to its address and port, and can still receive
21114 // unicast messages after calling this.
21115 // RETURNS: %TRUE on success, %FALSE on error.
21116 // <group>: a #GInetAddress specifying the group address to leave.
21117 // <source_specific>: %TRUE if source-specific multicast was used
21118 // <iface>: Interface used
21119 int leave_multicast_group(AT0, AT1, AT2)(AT0 /*InetAddress*/ group, int source_specific, AT1 /*char*/ iface, AT2 /*GLib2.Error**/ error=null) nothrow {
21120 return g_socket_leave_multicast_group(&this, UpCast!(InetAddress*)(group), source_specific, toCString!(char*)(iface), UpCast!(GLib2.Error**)(error));
21123 // VERSION: 2.22
21124 // Marks the socket as a server socket, i.e. a socket that is used
21125 // to accept incoming requests using g_socket_accept().
21127 // Before calling this the socket must be bound to a local address using
21128 // g_socket_bind().
21130 // To set the maximum amount of outstanding clients, use
21131 // g_socket_set_listen_backlog().
21132 // RETURNS: %TRUE on success, %FALSE on error.
21133 int listen(AT0)(AT0 /*GLib2.Error**/ error=null) nothrow {
21134 return g_socket_listen(&this, UpCast!(GLib2.Error**)(error));
21137 // VERSION: 2.22
21138 // Receive data (up to @size bytes) from a socket. This is mainly used by
21139 // connection-oriented sockets; it is identical to g_socket_receive_from()
21140 // with @address set to %NULL.
21142 // For %G_SOCKET_TYPE_DATAGRAM and %G_SOCKET_TYPE_SEQPACKET sockets,
21143 // g_socket_receive() will always read either 0 or 1 complete messages from
21144 // the socket. If the received message is too large to fit in @buffer, then
21145 // the data beyond @size bytes will be discarded, without any explicit
21146 // indication that this has occurred.
21148 // For %G_SOCKET_TYPE_STREAM sockets, g_socket_receive() can return any
21149 // number of bytes, up to @size. If more than @size bytes have been
21150 // received, the additional data will be returned in future calls to
21151 // g_socket_receive().
21153 // If the socket is in blocking mode the call will block until there
21154 // is some data to receive, the connection is closed, or there is an
21155 // error. If there is no data available and the socket is in
21156 // non-blocking mode, a %G_IO_ERROR_WOULD_BLOCK error will be
21157 // returned. To be notified when data is available, wait for the
21158 // %G_IO_IN condition.
21160 // On error -1 is returned and @error is set accordingly.
21162 // the peer, or -1 on error
21163 // RETURNS: Number of bytes read, or 0 if the connection was closed by
21164 // <buffer>: a buffer to read data into (which should be at least @size bytes long).
21165 // <size>: the number of bytes you want to read from the socket
21166 // <cancellable>: a %GCancellable or %NULL
21167 ssize_t receive(AT0, AT1, AT2)(AT0 /*char*/ buffer, size_t size, AT1 /*Cancellable*/ cancellable, AT2 /*GLib2.Error**/ error=null) nothrow {
21168 return g_socket_receive(&this, toCString!(char*)(buffer), size, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
21171 // VERSION: 2.22
21172 // Receive data (up to @size bytes) from a socket.
21174 // If @address is non-%NULL then @address will be set equal to the
21175 // source address of the received packet.
21176 // @address is owned by the caller.
21178 // See g_socket_receive() for additional information.
21180 // the peer, or -1 on error
21181 // RETURNS: Number of bytes read, or 0 if the connection was closed by
21182 // <address>: a pointer to a #GSocketAddress pointer, or %NULL
21183 // <buffer>: a buffer to read data into (which should be at least @size bytes long).
21184 // <size>: the number of bytes you want to read from the socket
21185 // <cancellable>: a %GCancellable or %NULL
21186 ssize_t receive_from(AT0, AT1, AT2, AT3)(/*out*/ AT0 /*SocketAddress**/ address, AT1 /*ubyte*/ buffer, size_t size, AT2 /*Cancellable*/ cancellable, AT3 /*GLib2.Error**/ error=null) nothrow {
21187 return g_socket_receive_from(&this, UpCast!(SocketAddress**)(address), UpCast!(ubyte*)(buffer), size, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
21190 // VERSION: 2.22
21191 // Receive data from a socket. This is the most complicated and
21192 // fully-featured version of this call. For easier use, see
21193 // g_socket_receive() and g_socket_receive_from().
21195 // If @address is non-%NULL then @address will be set equal to the
21196 // source address of the received packet.
21197 // @address is owned by the caller.
21199 // @vector must point to an array of #GInputVector structs and
21200 // @num_vectors must be the length of this array. These structs
21201 // describe the buffers that received data will be scattered into.
21202 // If @num_vectors is -1, then @vectors is assumed to be terminated
21203 // by a #GInputVector with a %NULL buffer pointer.
21205 // As a special case, if @num_vectors is 0 (in which case, @vectors
21206 // may of course be %NULL), then a single byte is received and
21207 // discarded. This is to facilitate the common practice of sending a
21208 // single '\0' byte for the purposes of transferring ancillary data.
21210 // @messages, if non-%NULL, will be set to point to a newly-allocated
21211 // array of #GSocketControlMessage instances or %NULL if no such
21212 // messages was received. These correspond to the control messages
21213 // received from the kernel, one #GSocketControlMessage per message
21214 // from the kernel. This array is %NULL-terminated and must be freed
21215 // by the caller using g_free() after calling g_object_unref() on each
21216 // element. If @messages is %NULL, any control messages received will
21217 // be discarded.
21219 // @num_messages, if non-%NULL, will be set to the number of control
21220 // messages received.
21222 // If both @messages and @num_messages are non-%NULL, then
21223 // @num_messages gives the number of #GSocketControlMessage instances
21224 // in @messages (ie: not including the %NULL terminator).
21226 // @flags is an in/out parameter. The commonly available arguments
21227 // for this are available in the #GSocketMsgFlags enum, but the
21228 // values there are the same as the system values, and the flags
21229 // are passed in as-is, so you can pass in system-specific flags too
21230 // (and g_socket_receive_message() may pass system-specific flags out).
21232 // As with g_socket_receive(), data may be discarded if @socket is
21233 // %G_SOCKET_TYPE_DATAGRAM or %G_SOCKET_TYPE_SEQPACKET and you do not
21234 // provide enough buffer space to read a complete message. You can pass
21235 // %G_SOCKET_MSG_PEEK in @flags to peek at the current message without
21236 // removing it from the receive queue, but there is no portable way to find
21237 // out the length of the message other than by reading it into a
21238 // sufficiently-large buffer.
21240 // If the socket is in blocking mode the call will block until there
21241 // is some data to receive, the connection is closed, or there is an
21242 // error. If there is no data available and the socket is in
21243 // non-blocking mode, a %G_IO_ERROR_WOULD_BLOCK error will be
21244 // returned. To be notified when data is available, wait for the
21245 // %G_IO_IN condition.
21247 // On error -1 is returned and @error is set accordingly.
21249 // the peer, or -1 on error
21250 // RETURNS: Number of bytes read, or 0 if the connection was closed by
21251 // <address>: a pointer to a #GSocketAddress pointer, or %NULL
21252 // <vectors>: an array of #GInputVector structs
21253 // <num_vectors>: the number of elements in @vectors, or -1
21254 // <messages>: a pointer which may be filled with an array of #GSocketControlMessages, or %NULL
21255 // <num_messages>: a pointer which will be filled with the number of elements in @messages, or %NULL
21256 // <flags>: a pointer to an int containing #GSocketMsgFlags flags
21257 // <cancellable>: a %GCancellable or %NULL
21258 ssize_t receive_message(AT0, AT1, AT2, AT3, AT4)(/*out*/ AT0 /*SocketAddress**/ address, AT1 /*InputVector*/ vectors, int num_vectors, AT2 /*SocketControlMessage***/ messages, int* num_messages, int* flags, AT3 /*Cancellable*/ cancellable, AT4 /*GLib2.Error**/ error=null) nothrow {
21259 return g_socket_receive_message(&this, UpCast!(SocketAddress**)(address), UpCast!(InputVector*)(vectors), num_vectors, UpCast!(SocketControlMessage***)(messages), num_messages, flags, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
21262 // VERSION: 2.26
21263 // This behaves exactly the same as g_socket_receive(), except that
21264 // the choice of blocking or non-blocking behavior is determined by
21265 // the @blocking argument rather than by @socket's properties.
21267 // the peer, or -1 on error
21268 // RETURNS: Number of bytes read, or 0 if the connection was closed by
21269 // <buffer>: a buffer to read data into (which should be at least @size bytes long).
21270 // <size>: the number of bytes you want to read from the socket
21271 // <blocking>: whether to do blocking or non-blocking I/O
21272 // <cancellable>: a %GCancellable or %NULL
21273 ssize_t receive_with_blocking(AT0, AT1, AT2)(AT0 /*char*/ buffer, size_t size, int blocking, AT1 /*Cancellable*/ cancellable, AT2 /*GLib2.Error**/ error=null) nothrow {
21274 return g_socket_receive_with_blocking(&this, toCString!(char*)(buffer), size, blocking, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
21277 // VERSION: 2.22
21278 // Tries to send @size bytes from @buffer on the socket. This is
21279 // mainly used by connection-oriented sockets; it is identical to
21280 // g_socket_send_to() with @address set to %NULL.
21282 // If the socket is in blocking mode the call will block until there is
21283 // space for the data in the socket queue. If there is no space available
21284 // and the socket is in non-blocking mode a %G_IO_ERROR_WOULD_BLOCK error
21285 // will be returned. To be notified when space is available, wait for the
21286 // %G_IO_OUT condition. Note though that you may still receive
21287 // %G_IO_ERROR_WOULD_BLOCK from g_socket_send() even if you were previously
21288 // notified of a %G_IO_OUT condition. (On Windows in particular, this is
21289 // very common due to the way the underlying APIs work.)
21291 // On error -1 is returned and @error is set accordingly.
21293 // on error
21294 // RETURNS: Number of bytes written (which may be less than @size), or -1
21295 // <buffer>: the buffer containing the data to send.
21296 // <size>: the number of bytes to send
21297 // <cancellable>: a %GCancellable or %NULL
21298 ssize_t send(AT0, AT1, AT2)(AT0 /*ubyte*/ buffer, size_t size, AT1 /*Cancellable*/ cancellable, AT2 /*GLib2.Error**/ error=null) nothrow {
21299 return g_socket_send(&this, UpCast!(ubyte*)(buffer), size, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
21302 // VERSION: 2.22
21303 // Send data to @address on @socket. This is the most complicated and
21304 // fully-featured version of this call. For easier use, see
21305 // g_socket_send() and g_socket_send_to().
21307 // If @address is %NULL then the message is sent to the default receiver
21308 // (set by g_socket_connect()).
21310 // @vectors must point to an array of #GOutputVector structs and
21311 // @num_vectors must be the length of this array. (If @num_vectors is -1,
21312 // then @vectors is assumed to be terminated by a #GOutputVector with a
21313 // %NULL buffer pointer.) The #GOutputVector structs describe the buffers
21314 // that the sent data will be gathered from. Using multiple
21315 // #GOutputVector<!-- -->s is more memory-efficient than manually copying
21316 // data from multiple sources into a single buffer, and more
21317 // network-efficient than making multiple calls to g_socket_send().
21319 // @messages, if non-%NULL, is taken to point to an array of @num_messages
21320 // #GSocketControlMessage instances. These correspond to the control
21321 // messages to be sent on the socket.
21322 // If @num_messages is -1 then @messages is treated as a %NULL-terminated
21323 // array.
21325 // @flags modify how the message is sent. The commonly available arguments
21326 // for this are available in the #GSocketMsgFlags enum, but the
21327 // values there are the same as the system values, and the flags
21328 // are passed in as-is, so you can pass in system-specific flags too.
21330 // If the socket is in blocking mode the call will block until there is
21331 // space for the data in the socket queue. If there is no space available
21332 // and the socket is in non-blocking mode a %G_IO_ERROR_WOULD_BLOCK error
21333 // will be returned. To be notified when space is available, wait for the
21334 // %G_IO_OUT condition. Note though that you may still receive
21335 // %G_IO_ERROR_WOULD_BLOCK from g_socket_send() even if you were previously
21336 // notified of a %G_IO_OUT condition. (On Windows in particular, this is
21337 // very common due to the way the underlying APIs work.)
21339 // On error -1 is returned and @error is set accordingly.
21341 // on error
21342 // RETURNS: Number of bytes written (which may be less than @size), or -1
21343 // <address>: a #GSocketAddress, or %NULL
21344 // <vectors>: an array of #GOutputVector structs
21345 // <num_vectors>: the number of elements in @vectors, or -1
21346 // <messages>: a pointer to an array of #GSocketControlMessages, or %NULL.
21347 // <num_messages>: number of elements in @messages, or -1.
21348 // <flags>: an int containing #GSocketMsgFlags flags
21349 // <cancellable>: a %GCancellable or %NULL
21350 ssize_t send_message(AT0, AT1, AT2, AT3, AT4)(AT0 /*SocketAddress*/ address, AT1 /*OutputVector*/ vectors, int num_vectors, AT2 /*SocketControlMessage**/ messages, int num_messages, int flags, AT3 /*Cancellable*/ cancellable, AT4 /*GLib2.Error**/ error=null) nothrow {
21351 return g_socket_send_message(&this, UpCast!(SocketAddress*)(address), UpCast!(OutputVector*)(vectors), num_vectors, UpCast!(SocketControlMessage**)(messages), num_messages, flags, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
21354 // VERSION: 2.22
21355 // Tries to send @size bytes from @buffer to @address. If @address is
21356 // %NULL then the message is sent to the default receiver (set by
21357 // g_socket_connect()).
21359 // See g_socket_send() for additional information.
21361 // on error
21362 // RETURNS: Number of bytes written (which may be less than @size), or -1
21363 // <address>: a #GSocketAddress, or %NULL
21364 // <buffer>: the buffer containing the data to send.
21365 // <size>: the number of bytes to send
21366 // <cancellable>: a %GCancellable or %NULL
21367 ssize_t send_to(AT0, AT1, AT2, AT3)(AT0 /*SocketAddress*/ address, AT1 /*ubyte*/ buffer, size_t size, AT2 /*Cancellable*/ cancellable, AT3 /*GLib2.Error**/ error=null) nothrow {
21368 return g_socket_send_to(&this, UpCast!(SocketAddress*)(address), UpCast!(ubyte*)(buffer), size, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
21371 // VERSION: 2.26
21372 // This behaves exactly the same as g_socket_send(), except that
21373 // the choice of blocking or non-blocking behavior is determined by
21374 // the @blocking argument rather than by @socket's properties.
21376 // on error
21377 // RETURNS: Number of bytes written (which may be less than @size), or -1
21378 // <buffer>: the buffer containing the data to send.
21379 // <size>: the number of bytes to send
21380 // <blocking>: whether to do blocking or non-blocking I/O
21381 // <cancellable>: a %GCancellable or %NULL
21382 ssize_t send_with_blocking(AT0, AT1, AT2)(AT0 /*ubyte*/ buffer, size_t size, int blocking, AT1 /*Cancellable*/ cancellable, AT2 /*GLib2.Error**/ error=null) nothrow {
21383 return g_socket_send_with_blocking(&this, UpCast!(ubyte*)(buffer), size, blocking, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
21386 // VERSION: 2.22
21387 // Sets the blocking mode of the socket. In blocking mode
21388 // all operations block until they succeed or there is an error. In
21389 // non-blocking mode all functions return results immediately or
21390 // with a %G_IO_ERROR_WOULD_BLOCK error.
21392 // All sockets are created in blocking mode. However, note that the
21393 // platform level socket is always non-blocking, and blocking mode
21394 // is a GSocket level feature.
21395 // <blocking>: Whether to use blocking I/O or not.
21396 void set_blocking()(int blocking) nothrow {
21397 g_socket_set_blocking(&this, blocking);
21400 // VERSION: 2.32
21401 // Sets whether @socket should allow sending to and receiving from
21402 // broadcast addresses. This is %FALSE by default.
21403 // <broadcast>: whether @socket should allow sending to and receiving from broadcast addresses
21404 void set_broadcast()(int broadcast) nothrow {
21405 g_socket_set_broadcast(&this, broadcast);
21408 // VERSION: 2.22
21409 // Sets or unsets the %SO_KEEPALIVE flag on the underlying socket. When
21410 // this flag is set on a socket, the system will attempt to verify that the
21411 // remote socket endpoint is still present if a sufficiently long period of
21412 // time passes with no data being exchanged. If the system is unable to
21413 // verify the presence of the remote endpoint, it will automatically close
21414 // the connection.
21416 // This option is only functional on certain kinds of sockets. (Notably,
21417 // %G_SOCKET_PROTOCOL_TCP sockets.)
21419 // The exact time between pings is system- and protocol-dependent, but will
21420 // normally be at least two hours. Most commonly, you would set this flag
21421 // on a server socket if you want to allow clients to remain idle for long
21422 // periods of time, but also want to ensure that connections are eventually
21423 // garbage-collected if clients crash or become unreachable.
21424 // <keepalive>: Value for the keepalive flag
21425 void set_keepalive()(int keepalive) nothrow {
21426 g_socket_set_keepalive(&this, keepalive);
21429 // VERSION: 2.22
21430 // Sets the maximum number of outstanding connections allowed
21431 // when listening on this socket. If more clients than this are
21432 // connecting to the socket and the application is not handling them
21433 // on time then the new connections will be refused.
21435 // Note that this must be called before g_socket_listen() and has no
21436 // effect if called after that.
21437 // <backlog>: the maximum number of pending connections.
21438 void set_listen_backlog()(int backlog) nothrow {
21439 g_socket_set_listen_backlog(&this, backlog);
21442 // VERSION: 2.32
21443 // Sets whether outgoing multicast packets will be received by sockets
21444 // listening on that multicast address on the same host. This is %TRUE
21445 // by default.
21446 // <loopback>: whether @socket should receive messages sent to its multicast groups from the local host
21447 void set_multicast_loopback()(int loopback) nothrow {
21448 g_socket_set_multicast_loopback(&this, loopback);
21451 // VERSION: 2.32
21452 // Sets the time-to-live for outgoing multicast datagrams on @socket.
21453 // By default, this is 1, meaning that multicast packets will not leave
21454 // the local network.
21455 // <ttl>: the time-to-live value for all multicast datagrams on @socket
21456 void set_multicast_ttl()(uint ttl) nothrow {
21457 g_socket_set_multicast_ttl(&this, ttl);
21460 // VERSION: 2.26
21461 // Sets the time in seconds after which I/O operations on @socket will
21462 // time out if they have not yet completed.
21464 // On a blocking socket, this means that any blocking #GSocket
21465 // operation will time out after @timeout seconds of inactivity,
21466 // returning %G_IO_ERROR_TIMED_OUT.
21468 // On a non-blocking socket, calls to g_socket_condition_wait() will
21469 // also fail with %G_IO_ERROR_TIMED_OUT after the given time. Sources
21470 // created with g_socket_create_source() will trigger after
21471 // @timeout seconds of inactivity, with the requested condition
21472 // set, at which point calling g_socket_receive(), g_socket_send(),
21473 // g_socket_check_connect_result(), etc, will fail with
21474 // %G_IO_ERROR_TIMED_OUT.
21476 // If @timeout is 0 (the default), operations will never time out
21477 // on their own.
21479 // Note that if an I/O operation is interrupted by a signal, this may
21480 // cause the timeout to be reset.
21481 // <timeout>: the timeout for @socket, in seconds, or 0 for none
21482 void set_timeout()(uint timeout) nothrow {
21483 g_socket_set_timeout(&this, timeout);
21486 // VERSION: 2.32
21487 // Sets the time-to-live for outgoing unicast packets on @socket.
21488 // By default the platform-specific default value is used.
21489 // <ttl>: the time-to-live value for all unicast packets on @socket
21490 void set_ttl()(uint ttl) nothrow {
21491 g_socket_set_ttl(&this, ttl);
21494 // VERSION: 2.22
21495 // Shut down part of a full-duplex connection.
21497 // If @shutdown_read is %TRUE then the receiving side of the connection
21498 // is shut down, and further reading is disallowed.
21500 // If @shutdown_write is %TRUE then the sending side of the connection
21501 // is shut down, and further writing is disallowed.
21503 // It is allowed for both @shutdown_read and @shutdown_write to be %TRUE.
21505 // One example where this is used is graceful disconnect for TCP connections
21506 // where you close the sending side, then wait for the other side to close
21507 // the connection, thus ensuring that the other side saw all sent data.
21508 // RETURNS: %TRUE on success, %FALSE on error
21509 // <shutdown_read>: whether to shut down the read side
21510 // <shutdown_write>: whether to shut down the write side
21511 int shutdown(AT0)(int shutdown_read, int shutdown_write, AT0 /*GLib2.Error**/ error=null) nothrow {
21512 return g_socket_shutdown(&this, shutdown_read, shutdown_write, UpCast!(GLib2.Error**)(error));
21515 // VERSION: 2.22
21516 // Checks if a socket is capable of speaking IPv4.
21518 // IPv4 sockets are capable of speaking IPv4. On some operating systems
21519 // and under some combinations of circumstances IPv6 sockets are also
21520 // capable of speaking IPv4. See RFC 3493 section 3.7 for more
21521 // information.
21523 // No other types of sockets are currently considered as being capable
21524 // of speaking IPv4.
21525 // RETURNS: %TRUE if this socket can be used with IPv4.
21526 int speaks_ipv4()() nothrow {
21527 return g_socket_speaks_ipv4(&this);
21532 // #GSocketAddress is the equivalent of <type>struct sockaddr</type>
21533 // in the BSD sockets API. This is an abstract class; use
21534 // #GInetSocketAddress for internet sockets, or #GUnixSocketAddress
21535 // for UNIX domain sockets.
21536 struct SocketAddress /* : GObject.Object */ {
21537 mixin SocketConnectable.__interface__;
21538 alias parent_instance this;
21539 alias parent_instance super_;
21540 alias parent_instance object;
21541 GObject2.Object parent_instance;
21544 // VERSION: 2.22
21545 // Creates a #GSocketAddress subclass corresponding to the native
21546 // <type>struct sockaddr</type> @native.
21548 // otherwise %NULL.
21549 // RETURNS: a new #GSocketAddress if @native could successfully be converted,
21550 // <native>: a pointer to a <type>struct sockaddr</type>
21551 // <len>: the size of the memory location pointed to by @native
21552 static SocketAddress* /*new*/ new_from_native(AT0)(AT0 /*void*/ native, size_t len) nothrow {
21553 return g_socket_address_new_from_native(UpCast!(void*)(native), len);
21555 static auto opCall(AT0)(AT0 /*void*/ native, size_t len) {
21556 return g_socket_address_new_from_native(UpCast!(void*)(native), len);
21559 // VERSION: 2.22
21560 // Gets the socket family type of @address.
21561 // RETURNS: the socket family type of @address.
21562 SocketFamily get_family()() nothrow {
21563 return g_socket_address_get_family(&this);
21566 // VERSION: 2.22
21567 // Gets the size of @address's native <type>struct sockaddr</type>.
21568 // You can use this to allocate memory to pass to
21569 // g_socket_address_to_native().
21571 // @address represents
21572 // RETURNS: the size of the native <type>struct sockaddr</type> that
21573 ssize_t get_native_size()() nothrow {
21574 return g_socket_address_get_native_size(&this);
21577 // VERSION: 2.22
21578 // Converts a #GSocketAddress to a native <type>struct
21579 // sockaddr</type>, which can be passed to low-level functions like
21580 // connect() or bind().
21582 // If not enough space is available, a %G_IO_ERROR_NO_SPACE error is
21583 // returned. If the address type is not known on the system
21584 // then a %G_IO_ERROR_NOT_SUPPORTED error is returned.
21585 // RETURNS: %TRUE if @dest was filled in, %FALSE on error
21586 // <dest>: a pointer to a memory location that will contain the native <type>struct sockaddr</type>.
21587 // <destlen>: the size of @dest. Must be at least as large as g_socket_address_get_native_size().
21588 int to_native(AT0, AT1)(AT0 /*void*/ dest, size_t destlen, AT1 /*GLib2.Error**/ error=null) nothrow {
21589 return g_socket_address_to_native(&this, UpCast!(void*)(dest), destlen, UpCast!(GLib2.Error**)(error));
21593 struct SocketAddressClass {
21594 GObject2.ObjectClass parent_class;
21595 // RETURNS: the socket family type of @address.
21596 extern (C) SocketFamily function (SocketAddress* address) nothrow get_family;
21597 // RETURNS: the size of the native <type>struct sockaddr</type> that
21598 extern (C) ssize_t function (SocketAddress* address) nothrow get_native_size;
21600 // RETURNS: %TRUE if @dest was filled in, %FALSE on error
21601 // <dest>: a pointer to a memory location that will contain the native <type>struct sockaddr</type>.
21602 // <destlen>: the size of @dest. Must be at least as large as g_socket_address_get_native_size().
21603 extern (C) int function (SocketAddress* address, void* dest, size_t destlen, GLib2.Error** error=null) nothrow to_native;
21607 // Enumerator type for objects that contain or generate
21608 // #GSocketAddress<!-- -->es.
21609 struct SocketAddressEnumerator /* : GObject.Object */ {
21610 alias parent_instance this;
21611 alias parent_instance super_;
21612 alias parent_instance object;
21613 GObject2.Object parent_instance;
21616 // Retrieves the next #GSocketAddress from @enumerator. Note that this
21617 // may block for some amount of time. (Eg, a #GNetworkAddress may need
21618 // to do a DNS lookup before it can return an address.) Use
21619 // g_socket_address_enumerator_next_async() if you need to avoid
21620 // blocking.
21622 // If @enumerator is expected to yield addresses, but for some reason
21623 // is unable to (eg, because of a DNS error), then the first call to
21624 // g_socket_address_enumerator_next() will return an appropriate error
21625 // in *@error. However, if the first call to
21626 // g_socket_address_enumerator_next() succeeds, then any further
21627 // internal errors (other than @cancellable being triggered) will be
21628 // ignored.
21630 // error (in which case *@error will be set) or if there are no
21631 // more addresses.
21632 // RETURNS: a #GSocketAddress (owned by the caller), or %NULL on
21633 // <cancellable>: optional #GCancellable object, %NULL to ignore.
21634 SocketAddress* /*new*/ next(AT0, AT1)(AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
21635 return g_socket_address_enumerator_next(&this, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
21638 // Asynchronously retrieves the next #GSocketAddress from @enumerator
21639 // and then calls @callback, which must call
21640 // g_socket_address_enumerator_next_finish() to get the result.
21641 // <cancellable>: optional #GCancellable object, %NULL to ignore.
21642 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
21643 // <user_data>: the data to pass to callback function
21644 void next_async(AT0, AT1)(AT0 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT1 /*void*/ user_data) nothrow {
21645 g_socket_address_enumerator_next_async(&this, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
21648 // Retrieves the result of a completed call to
21649 // g_socket_address_enumerator_next_async(). See
21650 // g_socket_address_enumerator_next() for more information about
21651 // error handling.
21653 // error (in which case *@error will be set) or if there are no
21654 // more addresses.
21655 // RETURNS: a #GSocketAddress (owned by the caller), or %NULL on
21656 // <result>: a #GAsyncResult
21657 SocketAddress* /*new*/ next_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
21658 return g_socket_address_enumerator_next_finish(&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
21662 struct SocketAddressEnumeratorClass {
21663 GObject2.ObjectClass parent_class;
21665 // RETURNS: a #GSocketAddress (owned by the caller), or %NULL on
21666 // <cancellable>: optional #GCancellable object, %NULL to ignore.
21667 extern (C) SocketAddress* /*new*/ function (SocketAddressEnumerator* enumerator, Cancellable* cancellable, GLib2.Error** error=null) nothrow next;
21669 // <cancellable>: optional #GCancellable object, %NULL to ignore.
21670 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
21671 // <user_data>: the data to pass to callback function
21672 extern (C) void function (SocketAddressEnumerator* enumerator, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow next_async;
21674 // RETURNS: a #GSocketAddress (owned by the caller), or %NULL on
21675 // <result>: a #GAsyncResult
21676 extern (C) SocketAddress* /*new*/ function (SocketAddressEnumerator* enumerator, AsyncResult* result, GLib2.Error** error=null) nothrow next_finish;
21679 struct SocketClass {
21680 GObject2.ObjectClass parent_class;
21681 extern (C) void function () nothrow _g_reserved1;
21682 extern (C) void function () nothrow _g_reserved2;
21683 extern (C) void function () nothrow _g_reserved3;
21684 extern (C) void function () nothrow _g_reserved4;
21685 extern (C) void function () nothrow _g_reserved5;
21686 extern (C) void function () nothrow _g_reserved6;
21687 extern (C) void function () nothrow _g_reserved7;
21688 extern (C) void function () nothrow _g_reserved8;
21689 extern (C) void function () nothrow _g_reserved9;
21690 extern (C) void function () nothrow _g_reserved10;
21694 // #GSocketClient is a lightweight high-level utility class for connecting to
21695 // a network host using a connection oriented socket type.
21697 // You create a #GSocketClient object, set any options you want, and then
21698 // call a sync or async connect operation, which returns a #GSocketConnection
21699 // subclass on success.
21701 // The type of the #GSocketConnection object returned depends on the type of
21702 // the underlying socket that is in use. For instance, for a TCP/IP connection
21703 // it will be a #GTcpConnection.
21705 // As #GSocketClient is a lightweight object, you don't need to cache it. You
21706 // can just create a new one any time you need one.
21707 struct SocketClient /* : GObject.Object */ /* Version 2.22 */ {
21708 alias parent_instance this;
21709 alias parent_instance super_;
21710 alias parent_instance object;
21711 GObject2.Object parent_instance;
21712 SocketClientPrivate* priv;
21715 // VERSION: 2.22
21716 // Creates a new #GSocketClient with the default options.
21718 // Free the returned object with g_object_unref().
21719 // RETURNS: a #GSocketClient.
21720 static SocketClient* /*new*/ new_()() nothrow {
21721 return g_socket_client_new();
21723 static auto opCall()() {
21724 return g_socket_client_new();
21727 // Enable proxy protocols to be handled by the application. When the
21728 // indicated proxy protocol is returned by the #GProxyResolver,
21729 // #GSocketClient will consider this protocol as supported but will
21730 // not try to find a #GProxy instance to handle handshaking. The
21731 // application must check for this case by calling
21732 // g_socket_connection_get_remote_address() on the returned
21733 // #GSocketConnection, and seeing if it's a #GProxyAddress of the
21734 // appropriate type, to determine whether or not it needs to handle
21735 // the proxy handshaking itself.
21737 // This should be used for proxy protocols that are dialects of
21738 // another protocol such as HTTP proxy. It also allows cohabitation of
21739 // proxy protocols that are reused between protocols. A good example
21740 // is HTTP. It can be used to proxy HTTP, FTP and Gopher and can also
21741 // be use as generic socket proxy through the HTTP CONNECT method.
21743 // When the proxy is detected as being an application proxy, TLS handshake
21744 // will be skipped. This is required to let the application do the proxy
21745 // specific handshake.
21746 // <protocol>: The proxy protocol
21747 void add_application_proxy(AT0)(AT0 /*char*/ protocol) nothrow {
21748 g_socket_client_add_application_proxy(&this, toCString!(char*)(protocol));
21751 // VERSION: 2.22
21752 // Tries to resolve the @connectable and make a network connection to it.
21754 // Upon a successful connection, a new #GSocketConnection is constructed
21755 // and returned. The caller owns this new object and must drop their
21756 // reference to it when finished with it.
21758 // The type of the #GSocketConnection object returned depends on the type of
21759 // the underlying socket that is used. For instance, for a TCP/IP connection
21760 // it will be a #GTcpConnection.
21762 // The socket created will be the same family as the address that the
21763 // @connectable resolves to, unless family is set with g_socket_client_set_family()
21764 // or indirectly via g_socket_client_set_local_address(). The socket type
21765 // defaults to %G_SOCKET_TYPE_STREAM but can be set with
21766 // g_socket_client_set_socket_type().
21768 // If a local address is specified with g_socket_client_set_local_address() the
21769 // socket will be bound to this address before connecting.
21770 // RETURNS: a #GSocketConnection on success, %NULL on error.
21771 // <connectable>: a #GSocketConnectable specifying the remote address.
21772 // <cancellable>: optional #GCancellable object, %NULL to ignore.
21773 SocketConnection* /*new*/ connect(AT0, AT1, AT2)(AT0 /*SocketConnectable*/ connectable, AT1 /*Cancellable*/ cancellable, AT2 /*GLib2.Error**/ error=null) nothrow {
21774 return g_socket_client_connect(&this, UpCast!(SocketConnectable*)(connectable), UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
21777 // VERSION: 2.22
21778 // This is the asynchronous version of g_socket_client_connect().
21780 // When the operation is finished @callback will be
21781 // called. You can then call g_socket_client_connect_finish() to get
21782 // the result of the operation.
21783 // <connectable>: a #GSocketConnectable specifying the remote address.
21784 // <cancellable>: a #GCancellable, or %NULL
21785 // <callback>: a #GAsyncReadyCallback
21786 // <user_data>: user data for the callback
21787 void connect_async(AT0, AT1, AT2)(AT0 /*SocketConnectable*/ connectable, AT1 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT2 /*void*/ user_data) nothrow {
21788 g_socket_client_connect_async(&this, UpCast!(SocketConnectable*)(connectable), UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
21791 // VERSION: 2.22
21792 // Finishes an async connect operation. See g_socket_client_connect_async()
21793 // RETURNS: a #GSocketConnection on success, %NULL on error.
21794 // <result>: a #GAsyncResult.
21795 SocketConnection* /*new*/ connect_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
21796 return g_socket_client_connect_finish(&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
21799 // VERSION: 2.22
21800 // This is a helper function for g_socket_client_connect().
21802 // Attempts to create a TCP connection to the named host.
21804 // @host_and_port may be in any of a number of recognized formats; an IPv6
21805 // address, an IPv4 address, or a domain name (in which case a DNS
21806 // lookup is performed). Quoting with [] is supported for all address
21807 // types. A port override may be specified in the usual way with a
21808 // colon. Ports may be given as decimal numbers or symbolic names (in
21809 // which case an /etc/services lookup is performed).
21811 // If no port override is given in @host_and_port then @default_port will be
21812 // used as the port number to connect to.
21814 // In general, @host_and_port is expected to be provided by the user (allowing
21815 // them to give the hostname, and a port override if necessary) and
21816 // @default_port is expected to be provided by the application.
21818 // In the case that an IP address is given, a single connection
21819 // attempt is made. In the case that a name is given, multiple
21820 // connection attempts may be made, in turn and according to the
21821 // number of address records in DNS, until a connection succeeds.
21823 // Upon a successful connection, a new #GSocketConnection is constructed
21824 // and returned. The caller owns this new object and must drop their
21825 // reference to it when finished with it.
21827 // In the event of any failure (DNS error, service not found, no hosts
21828 // connectable) %NULL is returned and @error (if non-%NULL) is set
21829 // accordingly.
21830 // RETURNS: a #GSocketConnection on success, %NULL on error.
21831 // <host_and_port>: the name and optionally port of the host to connect to
21832 // <default_port>: the default port to connect to
21833 // <cancellable>: a #GCancellable, or %NULL
21834 SocketConnection* /*new*/ connect_to_host(AT0, AT1, AT2)(AT0 /*char*/ host_and_port, ushort default_port, AT1 /*Cancellable*/ cancellable, AT2 /*GLib2.Error**/ error=null) nothrow {
21835 return g_socket_client_connect_to_host(&this, toCString!(char*)(host_and_port), default_port, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
21838 // VERSION: 2.22
21839 // This is the asynchronous version of g_socket_client_connect_to_host().
21841 // When the operation is finished @callback will be
21842 // called. You can then call g_socket_client_connect_to_host_finish() to get
21843 // the result of the operation.
21844 // <host_and_port>: the name and optionally the port of the host to connect to
21845 // <default_port>: the default port to connect to
21846 // <cancellable>: a #GCancellable, or %NULL
21847 // <callback>: a #GAsyncReadyCallback
21848 // <user_data>: user data for the callback
21849 void connect_to_host_async(AT0, AT1, AT2)(AT0 /*char*/ host_and_port, ushort default_port, AT1 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT2 /*void*/ user_data) nothrow {
21850 g_socket_client_connect_to_host_async(&this, toCString!(char*)(host_and_port), default_port, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
21853 // VERSION: 2.22
21854 // Finishes an async connect operation. See g_socket_client_connect_to_host_async()
21855 // RETURNS: a #GSocketConnection on success, %NULL on error.
21856 // <result>: a #GAsyncResult.
21857 SocketConnection* /*new*/ connect_to_host_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
21858 return g_socket_client_connect_to_host_finish(&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
21861 // Attempts to create a TCP connection to a service.
21863 // This call looks up the SRV record for @service at @domain for the
21864 // "tcp" protocol. It then attempts to connect, in turn, to each of
21865 // the hosts providing the service until either a connection succeeds
21866 // or there are no hosts remaining.
21868 // Upon a successful connection, a new #GSocketConnection is constructed
21869 // and returned. The caller owns this new object and must drop their
21870 // reference to it when finished with it.
21872 // In the event of any failure (DNS error, service not found, no hosts
21873 // connectable) %NULL is returned and @error (if non-%NULL) is set
21874 // accordingly.
21875 // RETURNS: a #GSocketConnection if successful, or %NULL on error
21876 // <domain>: a domain name
21877 // <service>: the name of the service to connect to
21878 // <cancellable>: a #GCancellable, or %NULL
21879 SocketConnection* /*new*/ connect_to_service(AT0, AT1, AT2, AT3)(AT0 /*char*/ domain, AT1 /*char*/ service, AT2 /*Cancellable*/ cancellable, AT3 /*GLib2.Error**/ error=null) nothrow {
21880 return g_socket_client_connect_to_service(&this, toCString!(char*)(domain), toCString!(char*)(service), UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
21883 // VERSION: 2.22
21884 // This is the asynchronous version of
21885 // g_socket_client_connect_to_service().
21886 // <domain>: a domain name
21887 // <service>: the name of the service to connect to
21888 // <cancellable>: a #GCancellable, or %NULL
21889 // <callback>: a #GAsyncReadyCallback
21890 // <user_data>: user data for the callback
21891 void connect_to_service_async(AT0, AT1, AT2, AT3)(AT0 /*char*/ domain, AT1 /*char*/ service, AT2 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT3 /*void*/ user_data) nothrow {
21892 g_socket_client_connect_to_service_async(&this, toCString!(char*)(domain), toCString!(char*)(service), UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
21895 // VERSION: 2.22
21896 // Finishes an async connect operation. See g_socket_client_connect_to_service_async()
21897 // RETURNS: a #GSocketConnection on success, %NULL on error.
21898 // <result>: a #GAsyncResult.
21899 SocketConnection* /*new*/ connect_to_service_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
21900 return g_socket_client_connect_to_service_finish(&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
21903 // VERSION: 2.26
21904 // This is a helper function for g_socket_client_connect().
21906 // Attempts to create a TCP connection with a network URI.
21908 // @uri may be any valid URI containing an "authority" (hostname/port)
21909 // component. If a port is not specified in the URI, @default_port
21910 // will be used. TLS will be negotiated if #GSocketClient:tls is %TRUE.
21911 // (#GSocketClient does not know to automatically assume TLS for
21912 // certain URI schemes.)
21914 // Using this rather than g_socket_client_connect() or
21915 // g_socket_client_connect_to_host() allows #GSocketClient to
21916 // determine when to use application-specific proxy protocols.
21918 // Upon a successful connection, a new #GSocketConnection is constructed
21919 // and returned. The caller owns this new object and must drop their
21920 // reference to it when finished with it.
21922 // In the event of any failure (DNS error, service not found, no hosts
21923 // connectable) %NULL is returned and @error (if non-%NULL) is set
21924 // accordingly.
21925 // RETURNS: a #GSocketConnection on success, %NULL on error.
21926 // <uri>: A network URI
21927 // <default_port>: the default port to connect to
21928 // <cancellable>: a #GCancellable, or %NULL
21929 SocketConnection* /*new*/ connect_to_uri(AT0, AT1, AT2)(AT0 /*char*/ uri, ushort default_port, AT1 /*Cancellable*/ cancellable, AT2 /*GLib2.Error**/ error=null) nothrow {
21930 return g_socket_client_connect_to_uri(&this, toCString!(char*)(uri), default_port, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
21933 // VERSION: 2.26
21934 // This is the asynchronous version of g_socket_client_connect_to_uri().
21936 // When the operation is finished @callback will be
21937 // called. You can then call g_socket_client_connect_to_uri_finish() to get
21938 // the result of the operation.
21939 // <uri>: a network uri
21940 // <default_port>: the default port to connect to
21941 // <cancellable>: a #GCancellable, or %NULL
21942 // <callback>: a #GAsyncReadyCallback
21943 // <user_data>: user data for the callback
21944 void connect_to_uri_async(AT0, AT1, AT2)(AT0 /*char*/ uri, ushort default_port, AT1 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT2 /*void*/ user_data) nothrow {
21945 g_socket_client_connect_to_uri_async(&this, toCString!(char*)(uri), default_port, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
21948 // VERSION: 2.26
21949 // Finishes an async connect operation. See g_socket_client_connect_to_uri_async()
21950 // RETURNS: a #GSocketConnection on success, %NULL on error.
21951 // <result>: a #GAsyncResult.
21952 SocketConnection* /*new*/ connect_to_uri_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
21953 return g_socket_client_connect_to_uri_finish(&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
21956 // VERSION: 2.26
21957 // Gets the proxy enable state; see g_socket_client_set_enable_proxy()
21958 // RETURNS: whether proxying is enabled
21959 int get_enable_proxy()() nothrow {
21960 return g_socket_client_get_enable_proxy(&this);
21963 // VERSION: 2.22
21964 // Gets the socket family of the socket client.
21966 // See g_socket_client_set_family() for details.
21967 // RETURNS: a #GSocketFamily
21968 SocketFamily get_family()() nothrow {
21969 return g_socket_client_get_family(&this);
21972 // VERSION: 2.22
21973 // Gets the local address of the socket client.
21975 // See g_socket_client_set_local_address() for details.
21976 // RETURNS: a #GSocketAddress or %NULL. Do not free.
21977 SocketAddress* get_local_address()() nothrow {
21978 return g_socket_client_get_local_address(&this);
21981 // VERSION: 2.22
21982 // Gets the protocol name type of the socket client.
21984 // See g_socket_client_set_protocol() for details.
21985 // RETURNS: a #GSocketProtocol
21986 SocketProtocol get_protocol()() nothrow {
21987 return g_socket_client_get_protocol(&this);
21990 // VERSION: 2.22
21991 // Gets the socket type of the socket client.
21993 // See g_socket_client_set_socket_type() for details.
21994 // RETURNS: a #GSocketFamily
21995 SocketType get_socket_type()() nothrow {
21996 return g_socket_client_get_socket_type(&this);
21999 // VERSION: 2.26
22000 // Gets the I/O timeout time for sockets created by @client.
22002 // See g_socket_client_set_timeout() for details.
22003 // RETURNS: the timeout in seconds
22004 uint get_timeout()() nothrow {
22005 return g_socket_client_get_timeout(&this);
22008 // VERSION: 2.28
22009 // Gets whether @client creates TLS connections. See
22010 // g_socket_client_set_tls() for details.
22011 // RETURNS: whether @client uses TLS
22012 int get_tls()() nothrow {
22013 return g_socket_client_get_tls(&this);
22016 // VERSION: 2.28
22017 // Gets the TLS validation flags used creating TLS connections via
22018 // @client.
22019 // RETURNS: the TLS validation flags
22020 TlsCertificateFlags get_tls_validation_flags()() nothrow {
22021 return g_socket_client_get_tls_validation_flags(&this);
22024 // VERSION: 2.26
22025 // Sets whether or not @client attempts to make connections via a
22026 // proxy server. When enabled (the default), #GSocketClient will use a
22027 // #GProxyResolver to determine if a proxy protocol such as SOCKS is
22028 // needed, and automatically do the necessary proxy negotiation.
22029 // <enable>: whether to enable proxies
22030 void set_enable_proxy()(int enable) nothrow {
22031 g_socket_client_set_enable_proxy(&this, enable);
22034 // VERSION: 2.22
22035 // Sets the socket family of the socket client.
22036 // If this is set to something other than %G_SOCKET_FAMILY_INVALID
22037 // then the sockets created by this object will be of the specified
22038 // family.
22040 // This might be useful for instance if you want to force the local
22041 // connection to be an ipv4 socket, even though the address might
22042 // be an ipv6 mapped to ipv4 address.
22043 // <family>: a #GSocketFamily
22044 void set_family()(SocketFamily family) nothrow {
22045 g_socket_client_set_family(&this, family);
22048 // VERSION: 2.22
22049 // Sets the local address of the socket client.
22050 // The sockets created by this object will bound to the
22051 // specified address (if not %NULL) before connecting.
22053 // This is useful if you want to ensure that the local
22054 // side of the connection is on a specific port, or on
22055 // a specific interface.
22056 // <address>: a #GSocketAddress, or %NULL
22057 void set_local_address(AT0)(AT0 /*SocketAddress*/ address) nothrow {
22058 g_socket_client_set_local_address(&this, UpCast!(SocketAddress*)(address));
22061 // VERSION: 2.22
22062 // Sets the protocol of the socket client.
22063 // The sockets created by this object will use of the specified
22064 // protocol.
22066 // If @protocol is %0 that means to use the default
22067 // protocol for the socket family and type.
22068 // <protocol>: a #GSocketProtocol
22069 void set_protocol()(SocketProtocol protocol) nothrow {
22070 g_socket_client_set_protocol(&this, protocol);
22073 // VERSION: 2.22
22074 // Sets the socket type of the socket client.
22075 // The sockets created by this object will be of the specified
22076 // type.
22078 // It doesn't make sense to specify a type of %G_SOCKET_TYPE_DATAGRAM,
22079 // as GSocketClient is used for connection oriented services.
22080 // <type>: a #GSocketType
22081 void set_socket_type()(SocketType type) nothrow {
22082 g_socket_client_set_socket_type(&this, type);
22085 // VERSION: 2.26
22086 // Sets the I/O timeout for sockets created by @client. @timeout is a
22087 // time in seconds, or 0 for no timeout (the default).
22089 // The timeout value affects the initial connection attempt as well,
22090 // so setting this may cause calls to g_socket_client_connect(), etc,
22091 // to fail with %G_IO_ERROR_TIMED_OUT.
22092 // <timeout>: the timeout
22093 void set_timeout()(uint timeout) nothrow {
22094 g_socket_client_set_timeout(&this, timeout);
22097 // VERSION: 2.28
22098 // Sets whether @client creates TLS (aka SSL) connections. If @tls is
22099 // %TRUE, @client will wrap its connections in a #GTlsClientConnection
22100 // and perform a TLS handshake when connecting.
22102 // Note that since #GSocketClient must return a #GSocketConnection,
22103 // but #GTlsClientConnection is not a #GSocketConnection, this
22104 // actually wraps the resulting #GTlsClientConnection in a
22105 // #GTcpWrapperConnection when returning it. You can use
22106 // g_tcp_wrapper_connection_get_base_io_stream() on the return value
22107 // to extract the #GTlsClientConnection.
22109 // If you need to modify the behavior of the TLS handshake (eg, by
22110 // setting a client-side certificate to use, or connecting to the
22111 // #GTlsConnection::accept-certificate signal), you can connect to
22112 // @client's #GSocketClient::event signal and wait for it to be
22113 // emitted with %G_SOCKET_CLIENT_TLS_HANDSHAKING, which will give you
22114 // a chance to see the #GTlsClientConnection before the handshake
22115 // starts.
22116 // <tls>: whether to use TLS
22117 void set_tls()(int tls) nothrow {
22118 g_socket_client_set_tls(&this, tls);
22121 // VERSION: 2.28
22122 // Sets the TLS validation flags used when creating TLS connections
22123 // via @client. The default value is %G_TLS_CERTIFICATE_VALIDATE_ALL.
22124 // <flags>: the validation flags
22125 void set_tls_validation_flags()(TlsCertificateFlags flags) nothrow {
22126 g_socket_client_set_tls_validation_flags(&this, flags);
22129 // VERSION: 2.32
22130 // Emitted when @client's activity on @connectable changes state.
22131 // Among other things, this can be used to provide progress
22132 // information about a network connection in the UI. The meanings of
22133 // the different @event values are as follows:
22135 // <variablelist>
22136 // <varlistentry>
22137 // <term>%G_SOCKET_CLIENT_RESOLVING:</term>
22138 // <listitem><para>
22139 // @client is about to look up @connectable in DNS.
22140 // @connection will be %NULL.
22141 // </para></listitem>
22142 // </varlistentry>
22143 // <varlistentry>
22144 // <term>%G_SOCKET_CLIENT_RESOLVED:</term>
22145 // <listitem><para>
22146 // @client has successfully resolved @connectable in DNS.
22147 // @connection will be %NULL.
22148 // </para></listitem>
22149 // </varlistentry>
22150 // <varlistentry>
22151 // <term>%G_SOCKET_CLIENT_CONNECTING:</term>
22152 // <listitem><para>
22153 // @client is about to make a connection to a remote host;
22154 // either a proxy server or the destination server itself.
22155 // @connection is the #GSocketConnection, which is not yet
22156 // connected.
22157 // </para></listitem>
22158 // </varlistentry>
22159 // <varlistentry>
22160 // <term>%G_SOCKET_CLIENT_CONNECTED:</term>
22161 // <listitem><para>
22162 // @client has successfully connected to a remote host.
22163 // @connection is the connected #GSocketConnection.
22164 // </para></listitem>
22165 // </varlistentry>
22166 // <varlistentry>
22167 // <term>%G_SOCKET_CLIENT_PROXY_NEGOTIATING:</term>
22168 // <listitem><para>
22169 // @client is about to negotiate with a proxy to get it to
22170 // connect to @connectable. @connection is the
22171 // #GSocketConnection to the proxy server.
22172 // </para></listitem>
22173 // </varlistentry>
22174 // <varlistentry>
22175 // <term>%G_SOCKET_CLIENT_PROXY_NEGOTIATED:</term>
22176 // <listitem><para>
22177 // @client has negotiated a connection to @connectable through
22178 // a proxy server. @connection is the stream returned from
22179 // g_proxy_connect(), which may or may not be a
22180 // #GSocketConnection.
22181 // </para></listitem>
22182 // </varlistentry>
22183 // <varlistentry>
22184 // <term>%G_SOCKET_CLIENT_TLS_HANDSHAKING:</term>
22185 // <listitem><para>
22186 // @client is about to begin a TLS handshake. @connection is a
22187 // #GTlsClientConnection.
22188 // </para></listitem>
22189 // </varlistentry>
22190 // <varlistentry>
22191 // <term>%G_SOCKET_CLIENT_TLS_HANDSHAKED:</term>
22192 // <listitem><para>
22193 // @client has successfully completed the TLS handshake.
22194 // @connection is a #GTlsClientConnection.
22195 // </para></listitem>
22196 // </varlistentry>
22197 // <varlistentry>
22198 // <term>%G_SOCKET_CLIENT_COMPLETE:</term>
22199 // <listitem><para>
22200 // @client has either successfully connected to @connectable
22201 // (in which case @connection is the #GSocketConnection that
22202 // it will be returning to the caller) or has failed (in which
22203 // case @connection is %NULL and the client is about to return
22204 // an error).
22205 // </para></listitem>
22206 // </varlistentry>
22207 // </variablelist>
22209 // Each event except %G_SOCKET_CLIENT_COMPLETE may be emitted
22210 // multiple times (or not at all) for a given connectable (in
22211 // particular, if @client ends up attempting to connect to more than
22212 // one address). However, if @client emits the #GSocketClient::event
22213 // signal at all for a given connectable, that it will always emit
22214 // it with %G_SOCKET_CLIENT_COMPLETE when it is done.
22216 // Note that there may be additional #GSocketClientEvent values in
22217 // the future; unrecognized @event values should be ignored.
22218 // <event>: the event that is occurring
22219 // <connectable>: the #GSocketConnectable that @event is occurring on
22220 // <connection>: the current representation of the connection
22221 extern (C) alias static void function (SocketClient* this_, SocketClientEvent* event, SocketConnectable* connectable, IOStream* connection, void* user_data=null) nothrow signal_event;
22223 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
22224 return super_.signal_connect!name(cb, data, cf);
22227 ulong signal_connect(string name:"event", CB/*:signal_event*/)
22228 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
22229 if (is(typeof(cb)==signal_event)||_ttmm!(CB, signal_event)()) {
22230 return signal_connect_data!()(&this, cast(char*)"event",
22231 cast(GObject2.Callback)cb, data, null, cf);
22235 struct SocketClientClass {
22236 GObject2.ObjectClass parent_class;
22237 extern (C) void function (SocketClient* client, SocketClientEvent event, SocketConnectable* connectable, IOStream* connection) nothrow event;
22238 extern (C) void function () nothrow _g_reserved1;
22239 extern (C) void function () nothrow _g_reserved2;
22240 extern (C) void function () nothrow _g_reserved3;
22241 extern (C) void function () nothrow _g_reserved4;
22245 // Describes an event occurring on a #GSocketClient. See the
22246 // #GSocketClient::event signal for more details.
22248 // Additional values may be added to this type in the future.
22249 enum SocketClientEvent /* Version 2.32 */ {
22250 RESOLVING = 0,
22251 RESOLVED = 1,
22252 CONNECTING = 2,
22253 CONNECTED = 3,
22254 PROXY_NEGOTIATING = 4,
22255 PROXY_NEGOTIATED = 5,
22256 TLS_HANDSHAKING = 6,
22257 TLS_HANDSHAKED = 7,
22258 COMPLETE = 8
22260 struct SocketClientPrivate {
22264 // Objects that describe one or more potential socket endpoints
22265 // implement #GSocketConnectable. Callers can then use
22266 // g_socket_connectable_enumerate() to get a #GSocketAddressEnumerator
22267 // to try out each socket address in turn until one succeeds, as shown
22268 // in the sample code below.
22270 // |[
22271 // MyConnectionType *
22272 // connect_to_host (const char *hostname,
22273 // guint16 port,
22274 // GCancellable *cancellable,
22275 // GError **error)
22276 // {
22277 // MyConnection *conn = NULL;
22278 // GSocketConnectable *addr;
22279 // GSocketAddressEnumerator *enumerator;
22280 // GSocketAddress *sockaddr;
22281 // GError *conn_error = NULL;
22283 // addr = g_network_address_new ("www.gnome.org", 80);
22284 // enumerator = g_socket_connectable_enumerate (addr);
22285 // g_object_unref (addr);
22287 // /<!-- -->* Try each sockaddr until we succeed. Record the first
22288 // * connection error, but not any further ones (since they'll probably
22289 // * be basically the same as the first).
22290 // *<!-- -->/
22291 // while (!conn && (sockaddr = g_socket_address_enumerator_next (enumerator, cancellable, error))
22292 // {
22293 // conn = connect_to_sockaddr (sockaddr, conn_error ? NULL : &conn_error);
22294 // g_object_unref (sockaddr);
22295 // }
22296 // g_object_unref (enumerator);
22298 // if (conn)
22299 // {
22300 // if (conn_error)
22301 // {
22302 // /<!-- -->* We couldn't connect to the first address, but we succeeded
22303 // * in connecting to a later address.
22304 // *<!-- -->/
22305 // g_error_free (conn_error);
22306 // }
22307 // return conn;
22308 // }
22309 // else if (error)
22310 // {
22311 // /<!-- -->* Either the initial lookup failed, or else the caller
22312 // * cancelled us.
22313 // *<!-- -->/
22314 // if (conn_error)
22315 // g_error_free (conn_error);
22316 // return NULL;
22317 // }
22318 // else
22319 // {
22320 // g_error_propagate (error, conn_error);
22321 // return NULL;
22322 // }
22323 // }
22324 // ]|
22325 struct SocketConnectable /* Interface */ {
22326 mixin template __interface__() {
22327 // VERSION: 2.22
22328 // Creates a #GSocketAddressEnumerator for @connectable.
22329 // RETURNS: a new #GSocketAddressEnumerator.
22330 SocketAddressEnumerator* /*new*/ enumerate()() nothrow {
22331 return g_socket_connectable_enumerate(cast(SocketConnectable*)&this);
22334 // VERSION: 2.26
22335 // Creates a #GSocketAddressEnumerator for @connectable that will
22336 // return #GProxyAddress<!-- -->es for addresses that you must connect
22337 // to via a proxy.
22339 // If @connectable does not implement
22340 // g_socket_connectable_proxy_enumerate(), this will fall back to
22341 // calling g_socket_connectable_enumerate().
22342 // RETURNS: a new #GSocketAddressEnumerator.
22343 SocketAddressEnumerator* /*new*/ proxy_enumerate()() nothrow {
22344 return g_socket_connectable_proxy_enumerate(cast(SocketConnectable*)&this);
22347 mixin __interface__;
22351 // Provides an interface for returning a #GSocketAddressEnumerator
22352 // and #GProxyAddressEnumerator
22353 struct SocketConnectableIface {
22354 GObject2.TypeInterface g_iface;
22355 // RETURNS: a new #GSocketAddressEnumerator.
22356 extern (C) SocketAddressEnumerator* /*new*/ function (SocketConnectable* connectable) nothrow enumerate;
22357 // RETURNS: a new #GSocketAddressEnumerator.
22358 extern (C) SocketAddressEnumerator* /*new*/ function (SocketConnectable* connectable) nothrow proxy_enumerate;
22362 // #GSocketConnection is a #GIOStream for a connected socket. They
22363 // can be created either by #GSocketClient when connecting to a host,
22364 // or by #GSocketListener when accepting a new client.
22366 // The type of the #GSocketConnection object returned from these calls
22367 // depends on the type of the underlying socket that is in use. For
22368 // instance, for a TCP/IP connection it will be a #GTcpConnection.
22370 // Choosing what type of object to construct is done with the socket
22371 // connection factory, and it is possible for 3rd parties to register
22372 // custom socket connection types for specific combination of socket
22373 // family/type/protocol using g_socket_connection_factory_register_type().
22374 struct SocketConnection /* : IOStream */ /* Version 2.22 */ {
22375 alias parent_instance this;
22376 alias parent_instance super_;
22377 alias parent_instance iostream;
22378 IOStream parent_instance;
22379 SocketConnectionPrivate* priv;
22382 // VERSION: 2.22
22383 // Looks up the #GType to be used when creating socket connections on
22384 // sockets with the specified @family, @type and @protocol_id.
22386 // If no type is registered, the #GSocketConnection base type is returned.
22387 // RETURNS: a #GType
22388 // <family>: a #GSocketFamily
22389 // <type>: a #GSocketType
22390 // <protocol_id>: a protocol id
22391 static Type factory_lookup_type()(SocketFamily family, SocketType type, int protocol_id) nothrow {
22392 return g_socket_connection_factory_lookup_type(family, type, protocol_id);
22395 // VERSION: 2.22
22396 // Looks up the #GType to be used when creating socket connections on
22397 // sockets with the specified @family, @type and @protocol.
22399 // If no type is registered, the #GSocketConnection base type is returned.
22400 // <g_type>: a #GType, inheriting from %G_TYPE_SOCKET_CONNECTION
22401 // <family>: a #GSocketFamily
22402 // <type>: a #GSocketType
22403 // <protocol>: a protocol id
22404 static void factory_register_type()(Type g_type, SocketFamily family, SocketType type, int protocol) nothrow {
22405 g_socket_connection_factory_register_type(g_type, family, type, protocol);
22408 // VERSION: 2.32
22409 // Connect @connection to the specified remote address.
22410 // RETURNS: %TRUE if the connection succeeded, %FALSE on error
22411 // <address>: a #GSocketAddress specifying the remote address.
22412 // <cancellable>: a %GCancellable or %NULL
22413 int connect(AT0, AT1, AT2)(AT0 /*SocketAddress*/ address, AT1 /*Cancellable*/ cancellable, AT2 /*GLib2.Error**/ error=null) nothrow {
22414 return g_socket_connection_connect(&this, UpCast!(SocketAddress*)(address), UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
22417 // VERSION: 2.32
22418 // Asynchronously connect @connection to the specified remote address.
22420 // This clears the #GSocket:blocking flag on @connection's underlying
22421 // socket if it is currently set.
22423 // Use g_socket_connection_connect_finish() to retrieve the result.
22424 // <address>: a #GSocketAddress specifying the remote address.
22425 // <cancellable>: a %GCancellable or %NULL
22426 // <callback>: a #GAsyncReadyCallback
22427 // <user_data>: user data for the callback
22428 void connect_async(AT0, AT1, AT2)(AT0 /*SocketAddress*/ address, AT1 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT2 /*void*/ user_data) nothrow {
22429 g_socket_connection_connect_async(&this, UpCast!(SocketAddress*)(address), UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
22432 // VERSION: 2.32
22433 // Gets the result of a g_socket_connection_connect_async() call.
22434 // RETURNS: %TRUE if the connection succeeded, %FALSE on error
22435 // <result>: the #GAsyncResult
22436 int connect_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
22437 return g_socket_connection_connect_finish(&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
22440 // VERSION: 2.22
22441 // Try to get the local address of a socket connection.
22443 // Free the returned object with g_object_unref().
22444 // RETURNS: a #GSocketAddress or %NULL on error.
22445 SocketAddress* /*new*/ get_local_address(AT0)(AT0 /*GLib2.Error**/ error=null) nothrow {
22446 return g_socket_connection_get_local_address(&this, UpCast!(GLib2.Error**)(error));
22449 // VERSION: 2.22
22450 // Try to get the remote address of a socket connection.
22452 // Free the returned object with g_object_unref().
22453 // RETURNS: a #GSocketAddress or %NULL on error.
22454 SocketAddress* /*new*/ get_remote_address(AT0)(AT0 /*GLib2.Error**/ error=null) nothrow {
22455 return g_socket_connection_get_remote_address(&this, UpCast!(GLib2.Error**)(error));
22458 // VERSION: 2.22
22459 // Gets the underlying #GSocket object of the connection.
22460 // This can be useful if you want to do something unusual on it
22461 // not supported by the #GSocketConnection APIs.
22462 // RETURNS: a #GSocketAddress or %NULL on error.
22463 Socket* get_socket()() nothrow {
22464 return g_socket_connection_get_socket(&this);
22467 // VERSION: 2.32
22468 // Checks if @connection is connected. This is equivalent to calling
22469 // g_socket_is_connected() on @connection's underlying #GSocket.
22470 // RETURNS: whether @connection is connected
22471 int is_connected()() nothrow {
22472 return g_socket_connection_is_connected(&this);
22476 struct SocketConnectionClass {
22477 IOStreamClass parent_class;
22478 extern (C) void function () nothrow _g_reserved1;
22479 extern (C) void function () nothrow _g_reserved2;
22480 extern (C) void function () nothrow _g_reserved3;
22481 extern (C) void function () nothrow _g_reserved4;
22482 extern (C) void function () nothrow _g_reserved5;
22483 extern (C) void function () nothrow _g_reserved6;
22486 struct SocketConnectionPrivate {
22490 // A #GSocketControlMessage is a special-purpose utility message that
22491 // can be sent to or received from a #GSocket. These types of
22492 // messages are often called "ancillary data".
22494 // The message can represent some sort of special instruction to or
22495 // information from the socket or can represent a special kind of
22496 // transfer to the peer (for example, sending a file description over
22497 // a UNIX socket).
22499 // These messages are sent with g_socket_send_message() and received
22500 // with g_socket_receive_message().
22502 // To extend the set of control message that can be sent, subclass this
22503 // class and override the get_size, get_level, get_type and serialize
22504 // methods.
22506 // To extend the set of control messages that can be received, subclass
22507 // this class and implement the deserialize method. Also, make sure your
22508 // class is registered with the GType typesystem before calling
22509 // g_socket_receive_message() to read such a message.
22510 struct SocketControlMessage /* : GObject.Object */ {
22511 alias parent_instance this;
22512 alias parent_instance super_;
22513 alias parent_instance object;
22514 GObject2.Object parent_instance;
22515 SocketControlMessagePrivate* priv;
22518 // VERSION: 2.22
22519 // Tries to deserialize a socket control message of a given
22520 // @level and @type. This will ask all known (to GType) subclasses
22521 // of #GSocketControlMessage if they can understand this kind
22522 // of message and if so deserialize it into a #GSocketControlMessage.
22524 // If there is no implementation for this kind of control message, %NULL
22525 // will be returned.
22526 // RETURNS: the deserialized message or %NULL
22527 // <level>: a socket level
22528 // <type>: a socket control message type for the given @level
22529 // <size>: the size of the data in bytes
22530 // <data>: pointer to the message data
22531 static SocketControlMessage* /*new*/ deserialize(AT0)(int level, int type, size_t size, AT0 /*void*/ data) nothrow {
22532 return g_socket_control_message_deserialize(level, type, size, UpCast!(void*)(data));
22535 // VERSION: 2.22
22536 // Returns the "level" (i.e. the originating protocol) of the control message.
22537 // This is often SOL_SOCKET.
22538 // RETURNS: an integer describing the level
22539 int get_level()() nothrow {
22540 return g_socket_control_message_get_level(&this);
22543 // VERSION: 2.22
22544 // Returns the protocol specific type of the control message.
22545 // For instance, for UNIX fd passing this would be SCM_RIGHTS.
22546 // RETURNS: an integer describing the type of control message
22547 int get_msg_type()() nothrow {
22548 return g_socket_control_message_get_msg_type(&this);
22551 // VERSION: 2.22
22552 // Returns the space required for the control message, not including
22553 // headers or alignment.
22554 // RETURNS: The number of bytes required.
22555 size_t get_size()() nothrow {
22556 return g_socket_control_message_get_size(&this);
22559 // VERSION: 2.22
22560 // Converts the data in the message to bytes placed in the
22561 // message.
22563 // @data is guaranteed to have enough space to fit the size
22564 // returned by g_socket_control_message_get_size() on this
22565 // object.
22566 // <data>: A buffer to write data to
22567 void serialize(AT0)(AT0 /*void*/ data) nothrow {
22568 g_socket_control_message_serialize(&this, UpCast!(void*)(data));
22572 struct SocketControlMessageClass {
22573 GObject2.ObjectClass parent_class;
22574 // RETURNS: The number of bytes required.
22575 extern (C) size_t function (SocketControlMessage* message) nothrow get_size;
22576 // RETURNS: an integer describing the level
22577 extern (C) int function (SocketControlMessage* message) nothrow get_level;
22578 extern (C) int function (SocketControlMessage* message) nothrow get_type;
22579 // <data>: A buffer to write data to
22580 extern (C) void function (SocketControlMessage* message, void* data) nothrow serialize;
22581 // Unintrospectable functionp: deserialize() / ()
22582 extern (C) SocketControlMessage* function (int level, int type, size_t size, void* data) nothrow deserialize;
22583 extern (C) void function () nothrow _g_reserved1;
22584 extern (C) void function () nothrow _g_reserved2;
22585 extern (C) void function () nothrow _g_reserved3;
22586 extern (C) void function () nothrow _g_reserved4;
22587 extern (C) void function () nothrow _g_reserved5;
22590 struct SocketControlMessagePrivate {
22594 // The protocol family of a #GSocketAddress. (These values are
22595 // identical to the system defines %AF_INET, %AF_INET6 and %AF_UNIX,
22596 // if available.)
22597 enum SocketFamily /* Version 2.22 */ {
22598 INVALID = 0,
22599 UNIX = 1,
22600 IPV4 = 2,
22601 IPV6 = 10
22604 // A #GSocketListener is an object that keeps track of a set
22605 // of server sockets and helps you accept sockets from any of the
22606 // socket, either sync or async.
22608 // If you want to implement a network server, also look at #GSocketService
22609 // and #GThreadedSocketService which are subclass of #GSocketListener
22610 // that makes this even easier.
22611 struct SocketListener /* : GObject.Object */ {
22612 alias parent_instance this;
22613 alias parent_instance super_;
22614 alias parent_instance object;
22615 GObject2.Object parent_instance;
22616 SocketListenerPrivate* priv;
22619 // VERSION: 2.22
22620 // Creates a new #GSocketListener with no sockets to listen for.
22621 // New listeners can be added with e.g. g_socket_listener_add_address()
22622 // or g_socket_listener_add_inet_port().
22623 // RETURNS: a new #GSocketListener.
22624 static SocketListener* /*new*/ new_()() nothrow {
22625 return g_socket_listener_new();
22627 static auto opCall()() {
22628 return g_socket_listener_new();
22631 // VERSION: 2.22
22632 // Blocks waiting for a client to connect to any of the sockets added
22633 // to the listener. Returns a #GSocketConnection for the socket that was
22634 // accepted.
22636 // If @source_object is not %NULL it will be filled out with the source
22637 // object specified when the corresponding socket or address was added
22638 // to the listener.
22640 // If @cancellable is not %NULL, then the operation can be cancelled by
22641 // triggering the cancellable object from another thread. If the operation
22642 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
22643 // RETURNS: a #GSocketConnection on success, %NULL on error.
22644 // <source_object>: location where #GObject pointer will be stored, or %NULL
22645 // <cancellable>: optional #GCancellable object, %NULL to ignore.
22646 SocketConnection* /*new*/ accept(AT0, AT1, AT2)(/*out*/ AT0 /*GObject2.Object**/ source_object, AT1 /*Cancellable*/ cancellable, AT2 /*GLib2.Error**/ error=null) nothrow {
22647 return g_socket_listener_accept(&this, UpCast!(GObject2.Object**)(source_object), UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
22650 // VERSION: 2.22
22651 // This is the asynchronous version of g_socket_listener_accept().
22653 // When the operation is finished @callback will be
22654 // called. You can then call g_socket_listener_accept_socket()
22655 // to get the result of the operation.
22656 // <cancellable>: a #GCancellable, or %NULL
22657 // <callback>: a #GAsyncReadyCallback
22658 // <user_data>: user data for the callback
22659 void accept_async(AT0, AT1)(AT0 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT1 /*void*/ user_data) nothrow {
22660 g_socket_listener_accept_async(&this, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
22663 // VERSION: 2.22
22664 // Finishes an async accept operation. See g_socket_listener_accept_async()
22665 // RETURNS: a #GSocketConnection on success, %NULL on error.
22666 // <result>: a #GAsyncResult.
22667 // <source_object>: Optional #GObject identifying this source
22668 SocketConnection* /*new*/ accept_finish(AT0, AT1, AT2)(AT0 /*AsyncResult*/ result, /*out*/ AT1 /*GObject2.Object**/ source_object, AT2 /*GLib2.Error**/ error=null) nothrow {
22669 return g_socket_listener_accept_finish(&this, UpCast!(AsyncResult*)(result), UpCast!(GObject2.Object**)(source_object), UpCast!(GLib2.Error**)(error));
22672 // VERSION: 2.22
22673 // Blocks waiting for a client to connect to any of the sockets added
22674 // to the listener. Returns the #GSocket that was accepted.
22676 // If you want to accept the high-level #GSocketConnection, not a #GSocket,
22677 // which is often the case, then you should use g_socket_listener_accept()
22678 // instead.
22680 // If @source_object is not %NULL it will be filled out with the source
22681 // object specified when the corresponding socket or address was added
22682 // to the listener.
22684 // If @cancellable is not %NULL, then the operation can be cancelled by
22685 // triggering the cancellable object from another thread. If the operation
22686 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
22687 // RETURNS: a #GSocket on success, %NULL on error.
22688 // <source_object>: location where #GObject pointer will be stored, or %NULL.
22689 // <cancellable>: optional #GCancellable object, %NULL to ignore.
22690 Socket* /*new*/ accept_socket(AT0, AT1, AT2)(/*out*/ AT0 /*GObject2.Object**/ source_object, AT1 /*Cancellable*/ cancellable, AT2 /*GLib2.Error**/ error=null) nothrow {
22691 return g_socket_listener_accept_socket(&this, UpCast!(GObject2.Object**)(source_object), UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
22694 // VERSION: 2.22
22695 // This is the asynchronous version of g_socket_listener_accept_socket().
22697 // When the operation is finished @callback will be
22698 // called. You can then call g_socket_listener_accept_socket_finish()
22699 // to get the result of the operation.
22700 // <cancellable>: a #GCancellable, or %NULL
22701 // <callback>: a #GAsyncReadyCallback
22702 // <user_data>: user data for the callback
22703 void accept_socket_async(AT0, AT1)(AT0 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT1 /*void*/ user_data) nothrow {
22704 g_socket_listener_accept_socket_async(&this, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
22707 // VERSION: 2.22
22708 // Finishes an async accept operation. See g_socket_listener_accept_socket_async()
22709 // RETURNS: a #GSocket on success, %NULL on error.
22710 // <result>: a #GAsyncResult.
22711 // <source_object>: Optional #GObject identifying this source
22712 Socket* /*new*/ accept_socket_finish(AT0, AT1, AT2)(AT0 /*AsyncResult*/ result, /*out*/ AT1 /*GObject2.Object**/ source_object, AT2 /*GLib2.Error**/ error=null) nothrow {
22713 return g_socket_listener_accept_socket_finish(&this, UpCast!(AsyncResult*)(result), UpCast!(GObject2.Object**)(source_object), UpCast!(GLib2.Error**)(error));
22716 // VERSION: 2.22
22717 // Creates a socket of type @type and protocol @protocol, binds
22718 // it to @address and adds it to the set of sockets we're accepting
22719 // sockets from.
22721 // Note that adding an IPv6 address, depending on the platform,
22722 // may or may not result in a listener that also accepts IPv4
22723 // connections. For more deterministic behavior, see
22724 // g_socket_listener_add_inet_port().
22726 // @source_object will be passed out in the various calls
22727 // to accept to identify this particular source, which is
22728 // useful if you're listening on multiple addresses and do
22729 // different things depending on what address is connected to.
22731 // If successful and @effective_address is non-%NULL then it will
22732 // be set to the address that the binding actually occurred at. This
22733 // is helpful for determining the port number that was used for when
22734 // requesting a binding to port 0 (ie: "any port"). This address, if
22735 // requested, belongs to the caller and must be freed.
22736 // RETURNS: %TRUE on success, %FALSE on error.
22737 // <address>: a #GSocketAddress
22738 // <type>: a #GSocketType
22739 // <protocol>: a #GSocketProtocol
22740 // <source_object>: Optional #GObject identifying this source
22741 // <effective_address>: location to store the address that was bound to, or %NULL.
22742 int add_address(AT0, AT1, AT2, AT3)(AT0 /*SocketAddress*/ address, SocketType type, SocketProtocol protocol, AT1 /*GObject2.Object*/ source_object, /*out*/ AT2 /*SocketAddress**/ effective_address, AT3 /*GLib2.Error**/ error=null) nothrow {
22743 return g_socket_listener_add_address(&this, UpCast!(SocketAddress*)(address), type, protocol, UpCast!(GObject2.Object*)(source_object), UpCast!(SocketAddress**)(effective_address), UpCast!(GLib2.Error**)(error));
22746 // VERSION: 2.24
22747 // Listens for TCP connections on any available port number for both
22748 // IPv6 and IPv4 (if each is available).
22750 // This is useful if you need to have a socket for incoming connections
22751 // but don't care about the specific port number.
22753 // @source_object will be passed out in the various calls
22754 // to accept to identify this particular source, which is
22755 // useful if you're listening on multiple addresses and do
22756 // different things depending on what address is connected to.
22757 // RETURNS: the port number, or 0 in case of failure.
22758 // <source_object>: Optional #GObject identifying this source
22759 ushort add_any_inet_port(AT0, AT1)(AT0 /*GObject2.Object*/ source_object, AT1 /*GLib2.Error**/ error=null) nothrow {
22760 return g_socket_listener_add_any_inet_port(&this, UpCast!(GObject2.Object*)(source_object), UpCast!(GLib2.Error**)(error));
22763 // VERSION: 2.22
22764 // Helper function for g_socket_listener_add_address() that
22765 // creates a TCP/IP socket listening on IPv4 and IPv6 (if
22766 // supported) on the specified port on all interfaces.
22768 // @source_object will be passed out in the various calls
22769 // to accept to identify this particular source, which is
22770 // useful if you're listening on multiple addresses and do
22771 // different things depending on what address is connected to.
22772 // RETURNS: %TRUE on success, %FALSE on error.
22773 // <port>: an IP port number (non-zero)
22774 // <source_object>: Optional #GObject identifying this source
22775 int add_inet_port(AT0, AT1)(ushort port, AT0 /*GObject2.Object*/ source_object, AT1 /*GLib2.Error**/ error=null) nothrow {
22776 return g_socket_listener_add_inet_port(&this, port, UpCast!(GObject2.Object*)(source_object), UpCast!(GLib2.Error**)(error));
22779 // VERSION: 2.22
22780 // Adds @socket to the set of sockets that we try to accept
22781 // new clients from. The socket must be bound to a local
22782 // address and listened to.
22784 // @source_object will be passed out in the various calls
22785 // to accept to identify this particular source, which is
22786 // useful if you're listening on multiple addresses and do
22787 // different things depending on what address is connected to.
22788 // RETURNS: %TRUE on success, %FALSE on error.
22789 // <socket>: a listening #GSocket
22790 // <source_object>: Optional #GObject identifying this source
22791 int add_socket(AT0, AT1, AT2)(AT0 /*Socket*/ socket, AT1 /*GObject2.Object*/ source_object, AT2 /*GLib2.Error**/ error=null) nothrow {
22792 return g_socket_listener_add_socket(&this, UpCast!(Socket*)(socket), UpCast!(GObject2.Object*)(source_object), UpCast!(GLib2.Error**)(error));
22795 // VERSION: 2.22
22796 // Closes all the sockets in the listener.
22797 void close()() nothrow {
22798 g_socket_listener_close(&this);
22801 // VERSION: 2.22
22802 // Sets the listen backlog on the sockets in the listener.
22804 // See g_socket_set_listen_backlog() for details
22805 // <listen_backlog>: an integer
22806 void set_backlog()(int listen_backlog) nothrow {
22807 g_socket_listener_set_backlog(&this, listen_backlog);
22811 struct SocketListenerClass {
22812 GObject2.ObjectClass parent_class;
22813 extern (C) void function (SocketListener* listener) nothrow changed;
22814 extern (C) void function () nothrow _g_reserved1;
22815 extern (C) void function () nothrow _g_reserved2;
22816 extern (C) void function () nothrow _g_reserved3;
22817 extern (C) void function () nothrow _g_reserved4;
22818 extern (C) void function () nothrow _g_reserved5;
22819 extern (C) void function () nothrow _g_reserved6;
22822 struct SocketListenerPrivate {
22826 // Flags used in g_socket_receive_message() and g_socket_send_message().
22827 // The flags listed in the enum are some commonly available flags, but the
22828 // values used for them are the same as on the platform, and any other flags
22829 // are passed in/out as is. So to use a platform specific flag, just include
22830 // the right system header and pass in the flag.
22831 enum SocketMsgFlags /* Version 2.22 */ {
22832 NONE = 0,
22833 OOB = 1,
22834 PEEK = 2,
22835 DONTROUTE = 4
22837 struct SocketPrivate {
22841 // A protocol identifier is specified when creating a #GSocket, which is a
22842 // family/type specific identifier, where 0 means the default protocol for
22843 // the particular family/type.
22845 // This enum contains a set of commonly available and used protocols. You
22846 // can also pass any other identifiers handled by the platform in order to
22847 // use protocols not listed here.
22848 enum SocketProtocol /* Version 2.22 */ {
22849 UNKNOWN = -1,
22850 DEFAULT = 0,
22851 TCP = 6,
22852 UDP = 17,
22853 SCTP = 132
22856 // A #GSocketService is an object that represents a service that
22857 // is provided to the network or over local sockets. When a new
22858 // connection is made to the service the #GSocketService::incoming
22859 // signal is emitted.
22861 // A #GSocketService is a subclass of #GSocketListener and you need
22862 // to add the addresses you want to accept connections on with the
22863 // #GSocketListener APIs.
22865 // There are two options for implementing a network service based on
22866 // #GSocketService. The first is to create the service using
22867 // g_socket_service_new() and to connect to the #GSocketService::incoming
22868 // signal. The second is to subclass #GSocketService and override the
22869 // default signal handler implementation.
22871 // In either case, the handler must immediately return, or else it
22872 // will block additional incoming connections from being serviced.
22873 // If you are interested in writing connection handlers that contain
22874 // blocking code then see #GThreadedSocketService.
22876 // The socket service runs on the main loop of the <link
22877 // linkend="g-main-context-push-thread-default-context">thread-default
22878 // context</link> of the thread it is created in, and is not
22879 // threadsafe in general. However, the calls to start and stop the
22880 // service are thread-safe so these can be used from threads that
22881 // handle incoming clients.
22882 struct SocketService /* : SocketListener */ /* Version 2.22 */ {
22883 alias parent_instance this;
22884 alias parent_instance super_;
22885 alias parent_instance socketlistener;
22886 SocketListener parent_instance;
22887 SocketServicePrivate* priv;
22890 // VERSION: 2.22
22891 // Creates a new #GSocketService with no sockets to listen for.
22892 // New listeners can be added with e.g. g_socket_listener_add_address()
22893 // or g_socket_listener_add_inet_port().
22894 // RETURNS: a new #GSocketService.
22895 static SocketService* /*new*/ new_()() nothrow {
22896 return g_socket_service_new();
22898 static auto opCall()() {
22899 return g_socket_service_new();
22902 // VERSION: 2.22
22903 // Check whether the service is active or not. An active
22904 // service will accept new clients that connect, while
22905 // a non-active service will let connecting clients queue
22906 // up until the service is started.
22907 // RETURNS: %TRUE if the service is active, %FALSE otherwise
22908 int is_active()() nothrow {
22909 return g_socket_service_is_active(&this);
22912 // VERSION: 2.22
22913 // Starts the service, i.e. start accepting connections
22914 // from the added sockets when the mainloop runs.
22916 // This call is thread-safe, so it may be called from a thread
22917 // handling an incoming client request.
22918 void start()() nothrow {
22919 g_socket_service_start(&this);
22922 // VERSION: 2.22
22923 // Stops the service, i.e. stops accepting connections
22924 // from the added sockets when the mainloop runs.
22926 // This call is thread-safe, so it may be called from a thread
22927 // handling an incoming client request.
22928 void stop()() nothrow {
22929 g_socket_service_stop(&this);
22932 // VERSION: 2.22
22933 // The ::incoming signal is emitted when a new incoming connection
22934 // to @service needs to be handled. The handler must initiate the
22935 // handling of @connection, but may not block; in essence,
22936 // asynchronous operations must be used.
22938 // @connection will be unreffed once the signal handler returns,
22939 // so you need to ref it yourself if you are planning to use it.
22940 // RETURNS: %TRUE to stop other handlers from being called
22941 // <connection>: a new #GSocketConnection object
22942 // <source_object>: the source_object passed to g_socket_listener_add_address()
22943 extern (C) alias static c_int function (SocketService* this_, SocketConnection* connection, GObject2.Object* source_object=null, void* user_data=null) nothrow signal_incoming;
22945 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
22946 return super_.signal_connect!name(cb, data, cf);
22949 ulong signal_connect(string name:"incoming", CB/*:signal_incoming*/)
22950 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
22951 if (is(typeof(cb)==signal_incoming)||_ttmm!(CB, signal_incoming)()) {
22952 return signal_connect_data!()(&this, cast(char*)"incoming",
22953 cast(GObject2.Callback)cb, data, null, cf);
22957 struct SocketServiceClass {
22958 SocketListenerClass parent_class;
22959 extern (C) int function (SocketService* service, SocketConnection* connection, GObject2.Object* source_object) nothrow incoming;
22960 extern (C) void function () nothrow _g_reserved1;
22961 extern (C) void function () nothrow _g_reserved2;
22962 extern (C) void function () nothrow _g_reserved3;
22963 extern (C) void function () nothrow _g_reserved4;
22964 extern (C) void function () nothrow _g_reserved5;
22965 extern (C) void function () nothrow _g_reserved6;
22968 struct SocketServicePrivate {
22972 // VERSION: 2.22
22973 // This is the function type of the callback used for the #GSource
22974 // returned by g_socket_create_source().
22975 // RETURNS: it should return %FALSE if the source should be removed.
22976 // <socket>: the #GSocket
22977 // <condition>: the current condition at the source fired.
22978 // <user_data>: data passed in by the user.
22979 extern (C) alias int function (Socket* socket, GLib2.IOCondition condition, void* user_data) nothrow SocketSourceFunc;
22982 // Flags used when creating a #GSocket. Some protocols may not implement
22983 // all the socket types.
22984 enum SocketType /* Version 2.22 */ {
22985 INVALID = 0,
22986 STREAM = 1,
22987 DATAGRAM = 2,
22988 SEQPACKET = 3
22991 // SRV (service) records are used by some network protocols to provide
22992 // service-specific aliasing and load-balancing. For example, XMPP
22993 // (Jabber) uses SRV records to locate the XMPP server for a domain;
22994 // rather than connecting directly to "example.com" or assuming a
22995 // specific server hostname like "xmpp.example.com", an XMPP client
22996 // would look up the "xmpp-client" SRV record for "example.com", and
22997 // then connect to whatever host was pointed to by that record.
22999 // You can use g_resolver_lookup_service() or
23000 // g_resolver_lookup_service_async() to find the #GSrvTarget<!-- -->s
23001 // for a given service. However, if you are simply planning to connect
23002 // to the remote service, you can use #GNetworkService's
23003 // #GSocketConnectable interface and not need to worry about
23004 // #GSrvTarget at all.
23005 struct SrvTarget {
23007 // VERSION: 2.22
23008 // Creates a new #GSrvTarget with the given parameters.
23010 // You should not need to use this; normally #GSrvTarget<!-- -->s are
23011 // created by #GResolver.
23012 // RETURNS: a new #GSrvTarget.
23013 // <hostname>: the host that the service is running on
23014 // <port>: the port that the service is running on
23015 // <priority>: the target's priority
23016 // <weight>: the target's weight
23017 static SrvTarget* /*new*/ new_(AT0)(AT0 /*char*/ hostname, ushort port, ushort priority, ushort weight) nothrow {
23018 return g_srv_target_new(toCString!(char*)(hostname), port, priority, weight);
23020 static auto opCall(AT0)(AT0 /*char*/ hostname, ushort port, ushort priority, ushort weight) {
23021 return g_srv_target_new(toCString!(char*)(hostname), port, priority, weight);
23024 // VERSION: 2.22
23025 // Copies @target
23026 // RETURNS: a copy of @target
23027 SrvTarget* /*new*/ copy()() nothrow {
23028 return g_srv_target_copy(&this);
23031 // VERSION: 2.22
23032 // Frees @target
23033 void free()() nothrow {
23034 g_srv_target_free(&this);
23037 // VERSION: 2.22
23038 // Gets @target's hostname (in ASCII form; if you are going to present
23039 // this to the user, you should use g_hostname_is_ascii_encoded() to
23040 // check if it contains encoded Unicode segments, and use
23041 // g_hostname_to_unicode() to convert it if it does.)
23042 // RETURNS: @target's hostname
23043 char* get_hostname()() nothrow {
23044 return g_srv_target_get_hostname(&this);
23047 // VERSION: 2.22
23048 // Gets @target's port
23049 // RETURNS: @target's port
23050 ushort get_port()() nothrow {
23051 return g_srv_target_get_port(&this);
23054 // VERSION: 2.22
23055 // Gets @target's priority. You should not need to look at this;
23056 // #GResolver already sorts the targets according to the algorithm in
23057 // RFC 2782.
23058 // RETURNS: @target's priority
23059 ushort get_priority()() nothrow {
23060 return g_srv_target_get_priority(&this);
23063 // VERSION: 2.22
23064 // Gets @target's weight. You should not need to look at this;
23065 // #GResolver already sorts the targets according to the algorithm in
23066 // RFC 2782.
23067 // RETURNS: @target's weight
23068 ushort get_weight()() nothrow {
23069 return g_srv_target_get_weight(&this);
23072 // Unintrospectable function: list_sort() / g_srv_target_list_sort()
23073 // VERSION: 2.22
23074 // Sorts @targets in place according to the algorithm in RFC 2782.
23075 // RETURNS: the head of the sorted list.
23076 // <targets>: a #GList of #GSrvTarget
23077 static GLib2.List* /*new*/ list_sort(AT0)(AT0 /*GLib2.List*/ targets) nothrow {
23078 return g_srv_target_list_sort(UpCast!(GLib2.List*)(targets));
23082 struct StaticResource {
23083 ubyte* data;
23084 size_t data_len;
23085 Resource* resource;
23086 StaticResource* next;
23087 void* padding;
23090 // VERSION: 2.32
23091 // Finalized a GResource initialized by g_static_resource_init ().
23093 // This is normally used by code generated by
23094 // <link linkend="glib-compile-resources">glib-compile-resources</link> and is
23095 // not typically used by other code.
23096 void fini()() nothrow {
23097 g_static_resource_fini(&this);
23100 // VERSION: 2.32
23101 // Gets the GResource that was registred by a call to g_static_resource_init ().
23103 // This is normally used by code generated by
23104 // <link linkend="glib-compile-resources">glib-compile-resources</link> and is
23105 // not typically used by other code.
23106 // RETURNS: a #GResource.
23107 Resource* get_resource()() nothrow {
23108 return g_static_resource_get_resource(&this);
23111 // VERSION: 2.32
23112 // Initializes a GResource from static data using a
23113 // GStaticResource.
23115 // This is normally used by code generated by
23116 // <link linkend="glib-compile-resources">glib-compile-resources</link> and is
23117 // not typically used by other code.
23118 void init()() nothrow {
23119 g_static_resource_init(&this);
23123 enum TLS_BACKEND_EXTENSION_POINT_NAME = "gio-tls-backend";
23124 enum TLS_DATABASE_PURPOSE_AUTHENTICATE_CLIENT = "1.3.6.1.5.5.7.3.2";
23125 enum TLS_DATABASE_PURPOSE_AUTHENTICATE_SERVER = "1.3.6.1.5.5.7.3.1";
23127 // This is the subclass of #GSocketConnection that is created
23128 // for TCP/IP sockets.
23129 struct TcpConnection /* : SocketConnection */ /* Version 2.22 */ {
23130 alias parent_instance this;
23131 alias parent_instance super_;
23132 alias parent_instance socketconnection;
23133 SocketConnection parent_instance;
23134 TcpConnectionPrivate* priv;
23137 // VERSION: 2.22
23138 // Checks if graceful disconnects are used. See
23139 // g_tcp_connection_set_graceful_disconnect().
23140 // RETURNS: %TRUE if graceful disconnect is used on close, %FALSE otherwise
23141 int get_graceful_disconnect()() nothrow {
23142 return g_tcp_connection_get_graceful_disconnect(&this);
23145 // VERSION: 2.22
23146 // This enabled graceful disconnects on close. A graceful disconnect
23147 // means that we signal the receiving end that the connection is terminated
23148 // and wait for it to close the connection before closing the connection.
23150 // A graceful disconnect means that we can be sure that we successfully sent
23151 // all the outstanding data to the other end, or get an error reported.
23152 // However, it also means we have to wait for all the data to reach the
23153 // other side and for it to acknowledge this by closing the socket, which may
23154 // take a while. For this reason it is disabled by default.
23155 // <graceful_disconnect>: Whether to do graceful disconnects or not
23156 void set_graceful_disconnect()(int graceful_disconnect) nothrow {
23157 g_tcp_connection_set_graceful_disconnect(&this, graceful_disconnect);
23161 struct TcpConnectionClass {
23162 SocketConnectionClass parent_class;
23165 struct TcpConnectionPrivate {
23169 // A #GTcpWrapperConnection can be used to wrap a #GIOStream that is
23170 // based on a #GSocket, but which is not actually a
23171 // #GSocketConnection. This is used by #GSocketClient so that it can
23172 // always return a #GSocketConnection, even when the connection it has
23173 // actually created is not directly a #GSocketConnection.
23174 struct TcpWrapperConnection /* : TcpConnection */ {
23175 alias parent_instance this;
23176 alias parent_instance super_;
23177 alias parent_instance tcpconnection;
23178 TcpConnection parent_instance;
23179 TcpWrapperConnectionPrivate* priv;
23182 // VERSION: 2.28
23183 // Wraps @base_io_stream and @socket together as a #GSocketConnection.
23184 // RETURNS: the new #GSocketConnection.
23185 // <base_io_stream>: the #GIOStream to wrap
23186 // <socket>: the #GSocket associated with @base_io_stream
23187 static TcpWrapperConnection* /*new*/ new_(AT0, AT1)(AT0 /*IOStream*/ base_io_stream, AT1 /*Socket*/ socket) nothrow {
23188 return g_tcp_wrapper_connection_new(UpCast!(IOStream*)(base_io_stream), UpCast!(Socket*)(socket));
23190 static auto opCall(AT0, AT1)(AT0 /*IOStream*/ base_io_stream, AT1 /*Socket*/ socket) {
23191 return g_tcp_wrapper_connection_new(UpCast!(IOStream*)(base_io_stream), UpCast!(Socket*)(socket));
23194 // Get's @conn's base #GIOStream
23195 // RETURNS: @conn's base #GIOStream
23196 IOStream* get_base_io_stream()() nothrow {
23197 return g_tcp_wrapper_connection_get_base_io_stream(&this);
23201 struct TcpWrapperConnectionClass {
23202 TcpConnectionClass parent_class;
23205 struct TcpWrapperConnectionPrivate {
23209 // #GThemedIcon is an implementation of #GIcon that supports icon themes.
23210 // #GThemedIcon contains a list of all of the icons present in an icon
23211 // theme, so that icons can be looked up quickly. #GThemedIcon does
23212 // not provide actual pixmaps for icons, just the icon names.
23213 // Ideally something like gtk_icon_theme_choose_icon() should be used to
23214 // resolve the list of names so that fallback icons work nicely with
23215 // themes that inherit other themes.
23216 struct ThemedIcon /* : GObject.Object */ {
23217 mixin Icon.__interface__;
23218 alias method_parent this;
23219 alias method_parent super_;
23220 alias method_parent object;
23221 GObject2.Object method_parent;
23224 // Creates a new themed icon for @iconname.
23225 // RETURNS: a new #GThemedIcon.
23226 // <iconname>: a string containing an icon name.
23227 static ThemedIcon* /*new*/ new_(AT0)(AT0 /*char*/ iconname) nothrow {
23228 return g_themed_icon_new(toCString!(char*)(iconname));
23230 static auto opCall(AT0)(AT0 /*char*/ iconname) {
23231 return g_themed_icon_new(toCString!(char*)(iconname));
23234 // Creates a new themed icon for @iconnames.
23235 // RETURNS: a new #GThemedIcon
23236 // <iconnames>: an array of strings containing icon names.
23237 // <len>: the length of the @iconnames array, or -1 if @iconnames is %NULL-terminated
23238 static ThemedIcon* /*new*/ new_from_names(AT0)(AT0 /*char**/ iconnames, int len) nothrow {
23239 return g_themed_icon_new_from_names(toCString!(char**)(iconnames), len);
23241 static auto opCall(AT0)(AT0 /*char**/ iconnames, int len) {
23242 return g_themed_icon_new_from_names(toCString!(char**)(iconnames), len);
23245 // Creates a new themed icon for @iconname, and all the names
23246 // that can be created by shortening @iconname at '-' characters.
23248 // In the following example, @icon1 and @icon2 are equivalent:
23249 // |[
23250 // const char *names[] = {
23251 // "gnome-dev-cdrom-audio",
23252 // "gnome-dev-cdrom",
23253 // "gnome-dev",
23254 // "gnome"
23255 // };
23257 // icon1 = g_themed_icon_new_from_names (names, 4);
23258 // icon2 = g_themed_icon_new_with_default_fallbacks ("gnome-dev-cdrom-audio");
23259 // ]|
23260 // RETURNS: a new #GThemedIcon.
23261 // <iconname>: a string containing an icon name
23262 static ThemedIcon* /*new*/ new_with_default_fallbacks(AT0)(AT0 /*char*/ iconname) nothrow {
23263 return g_themed_icon_new_with_default_fallbacks(toCString!(char*)(iconname));
23265 static auto opCall(AT0)(AT0 /*char*/ iconname) {
23266 return g_themed_icon_new_with_default_fallbacks(toCString!(char*)(iconname));
23269 // Append a name to the list of icons from within @icon.
23271 // <note><para>
23272 // Note that doing so invalidates the hash computed by prior calls
23273 // to g_icon_hash().
23274 // </para></note>
23275 // <iconname>: name of icon to append to list of icons from within @icon.
23276 void append_name(AT0)(AT0 /*char*/ iconname) nothrow {
23277 g_themed_icon_append_name(&this, toCString!(char*)(iconname));
23280 // Gets the names of icons from within @icon.
23281 // RETURNS: a list of icon names.
23282 char** get_names()() nothrow {
23283 return g_themed_icon_get_names(&this);
23286 // VERSION: 2.18
23287 // Prepend a name to the list of icons from within @icon.
23289 // <note><para>
23290 // Note that doing so invalidates the hash computed by prior calls
23291 // to g_icon_hash().
23292 // </para></note>
23293 // <iconname>: name of icon to prepend to list of icons from within @icon.
23294 void prepend_name(AT0)(AT0 /*char*/ iconname) nothrow {
23295 g_themed_icon_prepend_name(&this, toCString!(char*)(iconname));
23299 struct ThemedIconClass {
23303 // A #GThreadedSocketService is a simple subclass of #GSocketService
23304 // that handles incoming connections by creating a worker thread and
23305 // dispatching the connection to it by emitting the
23306 // #GThreadedSocketService::run signal in the new thread.
23308 // The signal handler may perform blocking IO and need not return
23309 // until the connection is closed.
23311 // The service is implemented using a thread pool, so there is a
23312 // limited amount of threads available to serve incoming requests.
23313 // The service automatically stops the #GSocketService from accepting
23314 // new connections when all threads are busy.
23316 // As with #GSocketService, you may connect to #GThreadedSocketService::run,
23317 // or subclass and override the default handler.
23318 struct ThreadedSocketService /* : SocketService */ /* Version 2.22 */ {
23319 alias parent_instance this;
23320 alias parent_instance super_;
23321 alias parent_instance socketservice;
23322 SocketService parent_instance;
23323 ThreadedSocketServicePrivate* priv;
23326 // VERSION: 2.22
23327 // Creates a new #GThreadedSocketService with no listeners. Listeners
23328 // must be added with one of the #GSocketListener "add" methods.
23329 // RETURNS: a new #GSocketService.
23330 // <max_threads>: the maximal number of threads to execute concurrently handling incoming clients, -1 means no limit
23331 static ThreadedSocketService* /*new*/ new_()(int max_threads) nothrow {
23332 return g_threaded_socket_service_new(max_threads);
23334 static auto opCall()(int max_threads) {
23335 return g_threaded_socket_service_new(max_threads);
23338 // The ::run signal is emitted in a worker thread in response to an
23339 // incoming connection. This thread is dedicated to handling
23340 // @connection and may perform blocking IO. The signal handler need
23341 // not return until the connection is closed.
23342 // RETURNS: %TRUE to stop further signal handlers from being called
23343 // <connection>: a new #GSocketConnection object.
23344 // <source_object>: the source_object passed to g_socket_listener_add_address().
23345 extern (C) alias static c_int function (ThreadedSocketService* this_, SocketConnection* connection, GObject2.Object* source_object, void* user_data=null) nothrow signal_run;
23347 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
23348 return super_.signal_connect!name(cb, data, cf);
23351 ulong signal_connect(string name:"run", CB/*:signal_run*/)
23352 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
23353 if (is(typeof(cb)==signal_run)||_ttmm!(CB, signal_run)()) {
23354 return signal_connect_data!()(&this, cast(char*)"run",
23355 cast(GObject2.Callback)cb, data, null, cf);
23359 struct ThreadedSocketServiceClass {
23360 SocketServiceClass parent_class;
23361 extern (C) int function (ThreadedSocketService* service, SocketConnection* connection, GObject2.Object* source_object) nothrow run;
23362 extern (C) void function () nothrow _g_reserved1;
23363 extern (C) void function () nothrow _g_reserved2;
23364 extern (C) void function () nothrow _g_reserved3;
23365 extern (C) void function () nothrow _g_reserved4;
23366 extern (C) void function () nothrow _g_reserved5;
23369 struct ThreadedSocketServicePrivate {
23372 // The client authentication mode for a #GTlsServerConnection.
23373 enum TlsAuthenticationMode /* Version 2.28 */ {
23374 NONE = 0,
23375 REQUESTED = 1,
23376 REQUIRED = 2
23378 struct TlsBackend /* Interface */ /* Version 2.28 */ {
23379 mixin template __interface__() {
23380 // VERSION: 2.28
23381 // Gets the default #GTlsBackend for the system.
23382 // RETURNS: a #GTlsBackend
23383 static TlsBackend* get_default()() nothrow {
23384 return g_tls_backend_get_default();
23387 // VERSION: 2.28
23388 // Gets the #GType of @backend's #GTlsCertificate implementation.
23390 // implementation.
23391 // RETURNS: the #GType of @backend's #GTlsCertificate
23392 Type get_certificate_type()() nothrow {
23393 return g_tls_backend_get_certificate_type(cast(TlsBackend*)&this);
23396 // VERSION: 2.28
23397 // Gets the #GType of @backend's #GTlsClientConnection implementation.
23399 // implementation.
23400 // RETURNS: the #GType of @backend's #GTlsClientConnection
23401 Type get_client_connection_type()() nothrow {
23402 return g_tls_backend_get_client_connection_type(cast(TlsBackend*)&this);
23405 // VERSION: 2.30
23406 // Gets the default #GTlsDatabase used to verify TLS connections.
23408 // unreffed when done.
23409 // RETURNS: the default database, which should be
23410 TlsDatabase* /*new*/ get_default_database()() nothrow {
23411 return g_tls_backend_get_default_database(cast(TlsBackend*)&this);
23414 // VERSION: 2.30
23415 // Gets the #GType of @backend's #GTlsFileDatabase implementation.
23416 // RETURNS: the #GType of backend's #GTlsFileDatabase implementation.
23417 Type get_file_database_type()() nothrow {
23418 return g_tls_backend_get_file_database_type(cast(TlsBackend*)&this);
23421 // VERSION: 2.28
23422 // Gets the #GType of @backend's #GTlsServerConnection implementation.
23424 // implementation.
23425 // RETURNS: the #GType of @backend's #GTlsServerConnection
23426 Type get_server_connection_type()() nothrow {
23427 return g_tls_backend_get_server_connection_type(cast(TlsBackend*)&this);
23430 // VERSION: 2.28
23431 // Checks if TLS is supported; if this returns %FALSE for the default
23432 // #GTlsBackend, it means no "real" TLS backend is available.
23433 // RETURNS: whether or not TLS is supported
23434 int supports_tls()() nothrow {
23435 return g_tls_backend_supports_tls(cast(TlsBackend*)&this);
23438 mixin __interface__;
23441 // Provides an interface for describing TLS-related types.
23442 struct TlsBackendInterface /* Version 2.28 */ {
23443 GObject2.TypeInterface g_iface;
23444 // RETURNS: whether or not TLS is supported
23445 extern (C) int function (TlsBackend* backend) nothrow supports_tls;
23446 extern (C) Type function () nothrow get_certificate_type;
23447 extern (C) Type function () nothrow get_client_connection_type;
23448 extern (C) Type function () nothrow get_server_connection_type;
23449 extern (C) Type function () nothrow get_file_database_type;
23450 // RETURNS: the default database, which should be
23451 extern (C) TlsDatabase* /*new*/ function (TlsBackend* backend) nothrow get_default_database;
23455 // A certificate used for TLS authentication and encryption.
23456 // This can represent either a public key only (eg, the certificate
23457 // received by a client from a server), or the combination of
23458 // a public key and a private key (which is needed when acting as a
23459 // #GTlsServerConnection).
23460 struct TlsCertificate /* : GObject.Object */ /* Version 2.28 */ {
23461 alias parent_instance this;
23462 alias parent_instance super_;
23463 alias parent_instance object;
23464 GObject2.Object parent_instance;
23465 TlsCertificatePrivate* priv;
23468 // VERSION: 2.28
23469 // Creates a #GTlsCertificate from the PEM-encoded data in @file. If
23470 // @file cannot be read or parsed, the function will return %NULL and
23471 // set @error. Otherwise, this behaves like
23472 // g_tls_certificate_new_from_pem().
23473 // RETURNS: the new certificate, or %NULL on error
23474 // <file>: file containing a PEM-encoded certificate to import
23475 static TlsCertificate* /*new*/ new_from_file(AT0, AT1)(AT0 /*char*/ file, AT1 /*GLib2.Error**/ error=null) nothrow {
23476 return g_tls_certificate_new_from_file(toCString!(char*)(file), UpCast!(GLib2.Error**)(error));
23478 static auto opCall(AT0, AT1)(AT0 /*char*/ file, AT1 /*GLib2.Error**/ error=null) {
23479 return g_tls_certificate_new_from_file(toCString!(char*)(file), UpCast!(GLib2.Error**)(error));
23482 // VERSION: 2.28
23483 // Creates a #GTlsCertificate from the PEM-encoded data in @cert_file
23484 // and @key_file. If either file cannot be read or parsed, the
23485 // function will return %NULL and set @error. Otherwise, this behaves
23486 // like g_tls_certificate_new_from_pem().
23487 // RETURNS: the new certificate, or %NULL on error
23488 // <cert_file>: file containing a PEM-encoded certificate to import
23489 // <key_file>: file containing a PEM-encoded private key to import
23490 static TlsCertificate* /*new*/ new_from_files(AT0, AT1, AT2)(AT0 /*char*/ cert_file, AT1 /*char*/ key_file, AT2 /*GLib2.Error**/ error=null) nothrow {
23491 return g_tls_certificate_new_from_files(toCString!(char*)(cert_file), toCString!(char*)(key_file), UpCast!(GLib2.Error**)(error));
23493 static auto opCall(AT0, AT1, AT2)(AT0 /*char*/ cert_file, AT1 /*char*/ key_file, AT2 /*GLib2.Error**/ error=null) {
23494 return g_tls_certificate_new_from_files(toCString!(char*)(cert_file), toCString!(char*)(key_file), UpCast!(GLib2.Error**)(error));
23497 // VERSION: 2.28
23498 // Creates a new #GTlsCertificate from the PEM-encoded data in @data.
23499 // If @data includes both a certificate and a private key, then the
23500 // returned certificate will include the private key data as well. (See
23501 // the #GTlsCertificate:private-key-pem property for information about
23502 // supported formats.)
23504 // If @data includes multiple certificates, only the first one will be
23505 // parsed.
23506 // RETURNS: the new certificate, or %NULL if @data is invalid
23507 // <data>: PEM-encoded certificate data
23508 // <length>: the length of @data, or -1 if it's 0-terminated.
23509 static TlsCertificate* /*new*/ new_from_pem(AT0, AT1)(AT0 /*char*/ data, ssize_t length, AT1 /*GLib2.Error**/ error=null) nothrow {
23510 return g_tls_certificate_new_from_pem(toCString!(char*)(data), length, UpCast!(GLib2.Error**)(error));
23512 static auto opCall(AT0, AT1)(AT0 /*char*/ data, ssize_t length, AT1 /*GLib2.Error**/ error=null) {
23513 return g_tls_certificate_new_from_pem(toCString!(char*)(data), length, UpCast!(GLib2.Error**)(error));
23516 // VERSION: 2.28
23517 // Creates one or more #GTlsCertificate<!-- -->s from the PEM-encoded
23518 // data in @file. If @file cannot be read or parsed, the function will
23519 // return %NULL and set @error. If @file does not contain any
23520 // PEM-encoded certificates, this will return an empty list and not
23521 // set @error.
23523 // #GList containing #GTlsCertificate objects. You must free the list
23524 // and its contents when you are done with it.
23525 // RETURNS: a
23526 // <file>: file containing PEM-encoded certificates to import
23527 static GLib2.List* /*new*/ list_new_from_file(AT0, AT1)(AT0 /*char*/ file, AT1 /*GLib2.Error**/ error=null) nothrow {
23528 return g_tls_certificate_list_new_from_file(toCString!(char*)(file), UpCast!(GLib2.Error**)(error));
23531 // VERSION: 2.28
23532 // Gets the #GTlsCertificate representing @cert's issuer, if known
23534 // or %NULL if @cert is self-signed or signed with an unknown
23535 // certificate.
23536 // RETURNS: The certificate of @cert's issuer,
23537 TlsCertificate* get_issuer()() nothrow {
23538 return g_tls_certificate_get_issuer(&this);
23541 // VERSION: 2.28
23542 // This verifies @cert and returns a set of #GTlsCertificateFlags
23543 // indicating any problems found with it. This can be used to verify a
23544 // certificate outside the context of making a connection, or to
23545 // check a certificate against a CA that is not part of the system
23546 // CA database.
23548 // If @identity is not %NULL, @cert's name(s) will be compared against
23549 // it, and %G_TLS_CERTIFICATE_BAD_IDENTITY will be set in the return
23550 // value if it does not match. If @identity is %NULL, that bit will
23551 // never be set in the return value.
23553 // If @trusted_ca is not %NULL, then @cert (or one of the certificates
23554 // in its chain) must be signed by it, or else
23555 // %G_TLS_CERTIFICATE_UNKNOWN_CA will be set in the return value. If
23556 // @trusted_ca is %NULL, that bit will never be set in the return
23557 // value.
23559 // (All other #GTlsCertificateFlags values will always be set or unset
23560 // as appropriate.)
23561 // RETURNS: the appropriate #GTlsCertificateFlags
23562 // <identity>: the expected peer identity
23563 // <trusted_ca>: the certificate of a trusted authority
23564 TlsCertificateFlags verify(AT0, AT1)(AT0 /*SocketConnectable*/ identity=null, AT1 /*TlsCertificate*/ trusted_ca=null) nothrow {
23565 return g_tls_certificate_verify(&this, UpCast!(SocketConnectable*)(identity), UpCast!(TlsCertificate*)(trusted_ca));
23569 struct TlsCertificateClass {
23570 GObject2.ObjectClass parent_class;
23572 // RETURNS: the appropriate #GTlsCertificateFlags
23573 // <identity>: the expected peer identity
23574 // <trusted_ca>: the certificate of a trusted authority
23575 extern (C) TlsCertificateFlags function (TlsCertificate* cert, SocketConnectable* identity=null, TlsCertificate* trusted_ca=null) nothrow verify;
23576 private void*[8] padding;
23580 // A set of flags describing TLS certification validation. This can be
23581 // used to set which validation steps to perform (eg, with
23582 // g_tls_client_connection_set_validation_flags()), or to describe why
23583 // a particular certificate was rejected (eg, in
23584 // #GTlsConnection::accept-certificate).
23585 enum TlsCertificateFlags /* Version 2.28 */ {
23586 UNKNOWN_CA = 1,
23587 BAD_IDENTITY = 2,
23588 NOT_ACTIVATED = 4,
23589 EXPIRED = 8,
23590 REVOKED = 16,
23591 INSECURE = 32,
23592 GENERIC_ERROR = 64,
23593 VALIDATE_ALL = 127
23595 struct TlsCertificatePrivate {
23599 // #GTlsClientConnection is the client-side subclass of
23600 // #GTlsConnection, representing a client-side TLS connection.
23601 struct TlsClientConnection /* Interface */ /* Version 2.28 */ {
23602 mixin template __interface__() {
23603 // VERSION: 2.28
23604 // Creates a new #GTlsClientConnection wrapping @base_io_stream (which
23605 // must have pollable input and output streams) which is assumed to
23606 // communicate with the server identified by @server_identity.
23608 // #GTlsClientConnection, or %NULL on error
23609 // RETURNS: the new
23610 // <base_io_stream>: the #GIOStream to wrap
23611 // <server_identity>: the expected identity of the server
23612 static TlsClientConnection* /*new*/ new_(AT0, AT1, AT2)(AT0 /*IOStream*/ base_io_stream, AT1 /*SocketConnectable*/ server_identity, AT2 /*GLib2.Error**/ error=null) nothrow {
23613 return g_tls_client_connection_new(UpCast!(IOStream*)(base_io_stream), UpCast!(SocketConnectable*)(server_identity), UpCast!(GLib2.Error**)(error));
23616 // VERSION: 2.28
23617 // Gets the list of distinguished names of the Certificate Authorities
23618 // that the server will accept certificates from. This will be set
23619 // during the TLS handshake if the server requests a certificate.
23620 // Otherwise, it will be %NULL.
23622 // Each item in the list is a #GByteArray which contains the complete
23623 // subject DN of the certificate authority.
23625 // CA DNs. You should unref each element with g_byte_array_unref() and then
23626 // the free the list with g_list_free().
23627 // RETURNS: the list of
23628 GLib2.List* /*new*/ get_accepted_cas()() nothrow {
23629 return g_tls_client_connection_get_accepted_cas(cast(TlsClientConnection*)&this);
23632 // VERSION: 2.28
23633 // Gets @conn's expected server identity
23635 // expected server identity, or %NULL if the expected identity is not
23636 // known.
23637 // RETURNS: a #GSocketConnectable describing the
23638 SocketConnectable* get_server_identity()() nothrow {
23639 return g_tls_client_connection_get_server_identity(cast(TlsClientConnection*)&this);
23642 // VERSION: 2.28
23643 // Gets whether @conn will use SSL 3.0 rather than the
23644 // highest-supported version of TLS; see
23645 // g_tls_client_connection_set_use_ssl3().
23646 // RETURNS: whether @conn will use SSL 3.0
23647 int get_use_ssl3()() nothrow {
23648 return g_tls_client_connection_get_use_ssl3(cast(TlsClientConnection*)&this);
23651 // VERSION: 2.28
23652 // Gets @conn's validation flags
23653 // RETURNS: the validation flags
23654 TlsCertificateFlags get_validation_flags()() nothrow {
23655 return g_tls_client_connection_get_validation_flags(cast(TlsClientConnection*)&this);
23658 // VERSION: 2.28
23659 // Sets @conn's expected server identity, which is used both to tell
23660 // servers on virtual hosts which certificate to present, and also
23661 // to let @conn know what name to look for in the certificate when
23662 // performing %G_TLS_CERTIFICATE_BAD_IDENTITY validation, if enabled.
23663 // <identity>: a #GSocketConnectable describing the expected server identity
23664 void set_server_identity(AT0)(AT0 /*SocketConnectable*/ identity) nothrow {
23665 g_tls_client_connection_set_server_identity(cast(TlsClientConnection*)&this, UpCast!(SocketConnectable*)(identity));
23668 // VERSION: 2.28
23669 // If @use_ssl3 is %TRUE, this forces @conn to use SSL 3.0 rather than
23670 // trying to properly negotiate the right version of TLS or SSL to use.
23671 // This can be used when talking to servers that do not implement the
23672 // fallbacks correctly and which will therefore fail to handshake with
23673 // a "modern" TLS handshake attempt.
23674 // <use_ssl3>: whether to use SSL 3.0
23675 void set_use_ssl3()(int use_ssl3) nothrow {
23676 g_tls_client_connection_set_use_ssl3(cast(TlsClientConnection*)&this, use_ssl3);
23679 // VERSION: 2.28
23680 // Sets @conn's validation flags, to override the default set of
23681 // checks performed when validating a server certificate. By default,
23682 // %G_TLS_CERTIFICATE_VALIDATE_ALL is used.
23683 // <flags>: the #GTlsCertificateFlags to use
23684 void set_validation_flags()(TlsCertificateFlags flags) nothrow {
23685 g_tls_client_connection_set_validation_flags(cast(TlsClientConnection*)&this, flags);
23688 mixin __interface__;
23691 struct TlsClientConnectionInterface {
23692 GObject2.TypeInterface g_iface;
23696 // #GTlsConnection is the base TLS connection class type, which wraps
23697 // a #GIOStream and provides TLS encryption on top of it. Its
23698 // subclasses, #GTlsClientConnection and #GTlsServerConnection,
23699 // implement client-side and server-side TLS, respectively.
23700 struct TlsConnection /* : IOStream */ /* Version 2.28 */ {
23701 alias parent_instance this;
23702 alias parent_instance super_;
23703 alias parent_instance iostream;
23704 IOStream parent_instance;
23705 TlsConnectionPrivate* priv;
23708 // VERSION: 2.28
23709 // Used by #GTlsConnection implementations to emit the
23710 // #GTlsConnection::accept-certificate signal.
23712 // %TRUE to accept @peer_cert
23713 // RETURNS: %TRUE if one of the signal handlers has returned
23714 // <peer_cert>: the peer's #GTlsCertificate
23715 // <errors>: the problems with @peer_cert
23716 int emit_accept_certificate(AT0)(AT0 /*TlsCertificate*/ peer_cert, TlsCertificateFlags errors) nothrow {
23717 return g_tls_connection_emit_accept_certificate(&this, UpCast!(TlsCertificate*)(peer_cert), errors);
23720 // VERSION: 2.28
23721 // Gets @conn's certificate, as set by
23722 // g_tls_connection_set_certificate().
23723 // RETURNS: @conn's certificate, or %NULL
23724 TlsCertificate* get_certificate()() nothrow {
23725 return g_tls_connection_get_certificate(&this);
23728 // VERSION: 2.30
23729 // Gets the certificate database that @conn uses to verify
23730 // peer certificates. See g_tls_connection_set_database().
23731 // RETURNS: the certificate database that @conn uses or %NULL
23732 TlsDatabase* get_database()() nothrow {
23733 return g_tls_connection_get_database(&this);
23736 // VERSION: 2.30
23737 // Get the object that will be used to interact with the user. It will be used
23738 // for things like prompting the user for passwords. If %NULL is returned, then
23739 // no user interaction will occur for this connection.
23740 // RETURNS: The interaction object.
23741 TlsInteraction* get_interaction()() nothrow {
23742 return g_tls_connection_get_interaction(&this);
23745 // VERSION: 2.28
23746 // Gets @conn's peer's certificate after the handshake has completed.
23747 // (It is not set during the emission of
23748 // #GTlsConnection::accept-certificate.)
23749 // RETURNS: @conn's peer's certificate, or %NULL
23750 TlsCertificate* get_peer_certificate()() nothrow {
23751 return g_tls_connection_get_peer_certificate(&this);
23754 // VERSION: 2.28
23755 // Gets the errors associated with validating @conn's peer's
23756 // certificate, after the handshake has completed. (It is not set
23757 // during the emission of #GTlsConnection::accept-certificate.)
23758 // RETURNS: @conn's peer's certificate errors
23759 TlsCertificateFlags get_peer_certificate_errors()() nothrow {
23760 return g_tls_connection_get_peer_certificate_errors(&this);
23763 // VERSION: 2.28
23764 // Gets @conn rehandshaking mode. See
23765 // g_tls_connection_set_rehandshake_mode() for details.
23766 // RETURNS: @conn's rehandshaking mode
23767 TlsRehandshakeMode get_rehandshake_mode()() nothrow {
23768 return g_tls_connection_get_rehandshake_mode(&this);
23771 // VERSION: 2.28
23772 // Tests whether or not @conn expects a proper TLS close notification
23773 // when the connection is closed. See
23774 // g_tls_connection_set_require_close_notify() for details.
23776 // notification.
23777 // RETURNS: %TRUE if @conn requires a proper TLS close
23778 int get_require_close_notify()() nothrow {
23779 return g_tls_connection_get_require_close_notify(&this);
23782 // DEPRECATED (v2.30) method: get_use_system_certdb - Use g_tls_connection_get_database() instead
23783 // Gets whether @conn uses the system certificate database to verify
23784 // peer certificates. See g_tls_connection_set_use_system_certdb().
23785 // RETURNS: whether @conn uses the system certificate database
23786 int get_use_system_certdb()() nothrow {
23787 return g_tls_connection_get_use_system_certdb(&this);
23790 // VERSION: 2.28
23791 // Attempts a TLS handshake on @conn.
23793 // On the client side, it is never necessary to call this method;
23794 // although the connection needs to perform a handshake after
23795 // connecting (or after sending a "STARTTLS"-type command) and may
23796 // need to rehandshake later if the server requests it,
23797 // #GTlsConnection will handle this for you automatically when you try
23798 // to send or receive data on the connection. However, you can call
23799 // g_tls_connection_handshake() manually if you want to know for sure
23800 // whether the initial handshake succeeded or failed (as opposed to
23801 // just immediately trying to write to @conn's output stream, in which
23802 // case if it fails, it may not be possible to tell if it failed
23803 // before or after completing the handshake).
23805 // Likewise, on the server side, although a handshake is necessary at
23806 // the beginning of the communication, you do not need to call this
23807 // function explicitly unless you want clearer error reporting.
23808 // However, you may call g_tls_connection_handshake() later on to
23809 // renegotiate parameters (encryption methods, etc) with the client.
23811 // #GTlsConnection::accept_certificate may be emitted during the
23812 // handshake.
23813 // RETURNS: success or failure
23814 // <cancellable>: a #GCancellable, or %NULL
23815 int handshake(AT0, AT1)(AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
23816 return g_tls_connection_handshake(&this, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
23819 // VERSION: 2.28
23820 // Asynchronously performs a TLS handshake on @conn. See
23821 // g_tls_connection_handshake() for more information.
23822 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
23823 // <cancellable>: a #GCancellable, or %NULL
23824 // <callback>: callback to call when the handshake is complete
23825 // <user_data>: the data to pass to the callback function
23826 void handshake_async(AT0, AT1)(int io_priority, AT0 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT1 /*void*/ user_data) nothrow {
23827 g_tls_connection_handshake_async(&this, io_priority, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
23830 // VERSION: 2.28
23831 // Finish an asynchronous TLS handshake operation. See
23832 // g_tls_connection_handshake() for more information.
23834 // case @error will be set.
23835 // RETURNS: %TRUE on success, %FALSE on failure, in which
23836 // <result>: a #GAsyncResult.
23837 int handshake_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
23838 return g_tls_connection_handshake_finish(&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
23841 // VERSION: 2.28
23842 // This sets the certificate that @conn will present to its peer
23843 // during the TLS handshake. For a #GTlsServerConnection, it is
23844 // mandatory to set this, and that will normally be done at construct
23845 // time.
23847 // For a #GTlsClientConnection, this is optional. If a handshake fails
23848 // with %G_TLS_ERROR_CERTIFICATE_REQUIRED, that means that the server
23849 // requires a certificate, and if you try connecting again, you should
23850 // call this method first. You can call
23851 // g_tls_client_connection_get_accepted_cas() on the failed connection
23852 // to get a list of Certificate Authorities that the server will
23853 // accept certificates from.
23855 // (It is also possible that a server will allow the connection with
23856 // or without a certificate; in that case, if you don't provide a
23857 // certificate, you can tell that the server requested one by the fact
23858 // that g_tls_client_connection_get_accepted_cas() will return
23859 // non-%NULL.)
23860 // <certificate>: the certificate to use for @conn
23861 void set_certificate(AT0)(AT0 /*TlsCertificate*/ certificate) nothrow {
23862 g_tls_connection_set_certificate(&this, UpCast!(TlsCertificate*)(certificate));
23865 // VERSION: 2.30
23866 // Sets the certificate database that is used to verify peer certificates.
23867 // This is set to the default database by default. See
23868 // g_tls_backend_get_default_database(). If set to %NULL, then
23869 // peer certificate validation will always set the
23870 // %G_TLS_CERTIFICATE_UNKNOWN_CA error (meaning
23871 // #GTlsConnection::accept-certificate will always be emitted on
23872 // client-side connections, unless that bit is not set in
23873 // #GTlsClientConnection:validation-flags).
23874 // <database>: a #GTlsDatabase
23875 void set_database(AT0)(AT0 /*TlsDatabase*/ database) nothrow {
23876 g_tls_connection_set_database(&this, UpCast!(TlsDatabase*)(database));
23879 // VERSION: 2.30
23880 // Set the object that will be used to interact with the user. It will be used
23881 // for things like prompting the user for passwords.
23883 // The @interaction argument will normally be a derived subclass of
23884 // #GTlsInteraction. %NULL can also be provided if no user interaction
23885 // should occur for this connection.
23886 // <interaction>: an interaction object, or %NULL
23887 void set_interaction(AT0)(AT0 /*TlsInteraction*/ interaction=null) nothrow {
23888 g_tls_connection_set_interaction(&this, UpCast!(TlsInteraction*)(interaction));
23891 // VERSION: 2.28
23892 // Sets how @conn behaves with respect to rehandshaking requests.
23894 // %G_TLS_REHANDSHAKE_NEVER means that it will never agree to
23895 // rehandshake after the initial handshake is complete. (For a client,
23896 // this means it will refuse rehandshake requests from the server, and
23897 // for a server, this means it will close the connection with an error
23898 // if the client attempts to rehandshake.)
23900 // %G_TLS_REHANDSHAKE_SAFELY means that the connection will allow a
23901 // rehandshake only if the other end of the connection supports the
23902 // TLS <literal>renegotiation_info</literal> extension. This is the
23903 // default behavior, but means that rehandshaking will not work
23904 // against older implementations that do not support that extension.
23906 // %G_TLS_REHANDSHAKE_UNSAFELY means that the connection will allow
23907 // rehandshaking even without the
23908 // <literal>renegotiation_info</literal> extension. On the server side
23909 // in particular, this is not recommended, since it leaves the server
23910 // open to certain attacks. However, this mode is necessary if you
23911 // need to allow renegotiation with older client software.
23912 // <mode>: the rehandshaking mode
23913 void set_rehandshake_mode()(TlsRehandshakeMode mode) nothrow {
23914 g_tls_connection_set_rehandshake_mode(&this, mode);
23917 // VERSION: 2.28
23918 // Sets whether or not @conn expects a proper TLS close notification
23919 // before the connection is closed. If this is %TRUE (the default),
23920 // then @conn will expect to receive a TLS close notification from its
23921 // peer before the connection is closed, and will return a
23922 // %G_TLS_ERROR_EOF error if the connection is closed without proper
23923 // notification (since this may indicate a network error, or
23924 // man-in-the-middle attack).
23926 // In some protocols, the application will know whether or not the
23927 // connection was closed cleanly based on application-level data
23928 // (because the application-level data includes a length field, or is
23929 // somehow self-delimiting); in this case, the close notify is
23930 // redundant and sometimes omitted. (TLS 1.1 explicitly allows this;
23931 // in TLS 1.0 it is technically an error, but often done anyway.) You
23932 // can use g_tls_connection_set_require_close_notify() to tell @conn
23933 // to allow an "unannounced" connection close, in which case the close
23934 // will show up as a 0-length read, as in a non-TLS
23935 // #GSocketConnection, and it is up to the application to check that
23936 // the data has been fully received.
23938 // Note that this only affects the behavior when the peer closes the
23939 // connection; when the application calls g_io_stream_close() itself
23940 // on @conn, this will send a close notification regardless of the
23941 // setting of this property. If you explicitly want to do an unclean
23942 // close, you can close @conn's #GTlsConnection:base-io-stream rather
23943 // than closing @conn itself.
23944 // <require_close_notify>: whether or not to require close notification
23945 void set_require_close_notify()(int require_close_notify) nothrow {
23946 g_tls_connection_set_require_close_notify(&this, require_close_notify);
23949 // DEPRECATED (v2.30) method: set_use_system_certdb - Use g_tls_connection_set_database() instead
23950 // Sets whether @conn uses the system certificate database to verify
23951 // peer certificates. This is %TRUE by default. If set to %FALSE, then
23952 // peer certificate validation will always set the
23953 // %G_TLS_CERTIFICATE_UNKNOWN_CA error (meaning
23954 // #GTlsConnection::accept-certificate will always be emitted on
23955 // client-side connections, unless that bit is not set in
23956 // #GTlsClientConnection:validation-flags).
23957 // <use_system_certdb>: whether to use the system certificate database
23958 void set_use_system_certdb()(int use_system_certdb) nothrow {
23959 g_tls_connection_set_use_system_certdb(&this, use_system_certdb);
23962 // VERSION: 2.28
23963 // Emitted during the TLS handshake after the peer certificate has
23964 // been received. You can examine @peer_cert's certification path by
23965 // calling g_tls_certificate_get_issuer() on it.
23967 // For a client-side connection, @peer_cert is the server's
23968 // certificate, and the signal will only be emitted if the
23969 // certificate was not acceptable according to @conn's
23970 // #GTlsClientConnection:validation_flags. If you would like the
23971 // certificate to be accepted despite @errors, return %TRUE from the
23972 // signal handler. Otherwise, if no handler accepts the certificate,
23973 // the handshake will fail with %G_TLS_ERROR_BAD_CERTIFICATE.
23975 // For a server-side connection, @peer_cert is the certificate
23976 // presented by the client, if this was requested via the server's
23977 // #GTlsServerConnection:authentication_mode. On the server side,
23978 // the signal is always emitted when the client presents a
23979 // certificate, and the certificate will only be accepted if a
23980 // handler returns %TRUE.
23982 // Note that if this signal is emitted as part of asynchronous I/O
23983 // in the main thread, then you should not attempt to interact with
23984 // the user before returning from the signal handler. If you want to
23985 // let the user decide whether or not to accept the certificate, you
23986 // would have to return %FALSE from the signal handler on the first
23987 // attempt, and then after the connection attempt returns a
23988 // %G_TLS_ERROR_HANDSHAKE, you can interact with the user, and if
23989 // the user decides to accept the certificate, remember that fact,
23990 // create a new connection, and return %TRUE from the signal handler
23991 // the next time.
23993 // If you are doing I/O in another thread, you do not
23994 // need to worry about this, and can simply block in the signal
23995 // handler until the UI thread returns an answer.
23997 // immediately end the signal emission). %FALSE to allow the signal
23998 // emission to continue, which will cause the handshake to fail if
23999 // no one else overrides it.
24000 // RETURNS: %TRUE to accept @peer_cert (which will also
24001 // <peer_cert>: the peer's #GTlsCertificate
24002 // <errors>: the problems with @peer_cert.
24003 extern (C) alias static c_int function (TlsConnection* this_, TlsCertificate* peer_cert, TlsCertificateFlags* errors, void* user_data=null) nothrow signal_accept_certificate;
24005 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
24006 return super_.signal_connect!name(cb, data, cf);
24009 ulong signal_connect(string name:"accept-certificate", CB/*:signal_accept_certificate*/)
24010 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
24011 if (is(typeof(cb)==signal_accept_certificate)||_ttmm!(CB, signal_accept_certificate)()) {
24012 return signal_connect_data!()(&this, cast(char*)"accept-certificate",
24013 cast(GObject2.Callback)cb, data, null, cf);
24017 struct TlsConnectionClass {
24018 IOStreamClass parent_class;
24019 extern (C) int function (TlsConnection* connection, TlsCertificate* peer_cert, TlsCertificateFlags errors) nothrow accept_certificate;
24021 // RETURNS: success or failure
24022 // <cancellable>: a #GCancellable, or %NULL
24023 extern (C) int function (TlsConnection* conn, Cancellable* cancellable, GLib2.Error** error=null) nothrow handshake;
24025 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
24026 // <cancellable>: a #GCancellable, or %NULL
24027 // <callback>: callback to call when the handshake is complete
24028 // <user_data>: the data to pass to the callback function
24029 extern (C) void function (TlsConnection* conn, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow handshake_async;
24031 // RETURNS: %TRUE on success, %FALSE on failure, in which
24032 // <result>: a #GAsyncResult.
24033 extern (C) int function (TlsConnection* conn, AsyncResult* result, GLib2.Error** error=null) nothrow handshake_finish;
24034 private void*[8] padding;
24037 struct TlsConnectionPrivate {
24041 // #GTlsDatabase is used to lookup certificates and other information
24042 // from a certificate or key store. It is an abstract base class which
24043 // TLS library specific subtypes override.
24045 // Most common client applications will not directly interact with
24046 // #GTlsDatabase. It is used internally by #GTlsConnection.
24047 struct TlsDatabase /* : GObject.Object */ /* Version 2.30 */ {
24048 alias parent_instance this;
24049 alias parent_instance super_;
24050 alias parent_instance object;
24051 GObject2.Object parent_instance;
24052 TlsDatabasePrivate* priv;
24055 // VERSION: 2.30
24056 // Create a handle string for the certificate. The database will only be able
24057 // to create a handle for certificates that originate from the database. In
24058 // cases where the database cannot create a handle for a certificate, %NULL
24059 // will be returned.
24061 // This handle should be stable across various instances of the application,
24062 // and between applications. If a certificate is modified in the database,
24063 // then it is not guaranteed that this handle will continue to point to it.
24064 // RETURNS: a newly allocated string containing the handle.
24065 // <certificate>: certificate for which to create a handle.
24066 char* /*new*/ create_certificate_handle(AT0)(AT0 /*TlsCertificate*/ certificate) nothrow {
24067 return g_tls_database_create_certificate_handle(&this, UpCast!(TlsCertificate*)(certificate));
24070 // VERSION: 2.30
24071 // Lookup a certificate by its handle.
24073 // The handle should have been created by calling
24074 // g_tls_database_create_certificate_handle() on a #GTlsDatabase object of
24075 // the same TLS backend. The handle is designed to remain valid across
24076 // instantiations of the database.
24078 // If the handle is no longer valid, or does not point to a certificate in
24079 // this database, then %NULL will be returned.
24081 // This function can block, use g_tls_database_lookup_certificate_for_handle_async() to perform
24082 // the lookup operation asynchronously.
24084 // #GTlsCertificate, or %NULL. Use g_object_unref() to release the certificate.
24085 // RETURNS: a newly allocated
24086 // <handle>: a certificate handle
24087 // <interaction>: used to interact with the user if necessary
24088 // <flags>: Flags which affect the lookup.
24089 // <cancellable>: a #GCancellable, or %NULL
24090 TlsCertificate* /*new*/ lookup_certificate_for_handle(AT0, AT1, AT2, AT3)(AT0 /*char*/ handle, AT1 /*TlsInteraction*/ interaction, TlsDatabaseLookupFlags flags, AT2 /*Cancellable*/ cancellable, AT3 /*GLib2.Error**/ error=null) nothrow {
24091 return g_tls_database_lookup_certificate_for_handle(&this, toCString!(char*)(handle), UpCast!(TlsInteraction*)(interaction), flags, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
24094 // VERSION: 2.30
24095 // Asynchronously lookup a certificate by its handle in the database. See
24096 // g_tls_database_lookup_certificate_for_handle() for more information.
24097 // <handle>: a certificate handle
24098 // <interaction>: used to interact with the user if necessary
24099 // <flags>: Flags which affect the lookup.
24100 // <cancellable>: a #GCancellable, or %NULL
24101 // <callback>: callback to call when the operation completes
24102 // <user_data>: the data to pass to the callback function
24103 void lookup_certificate_for_handle_async(AT0, AT1, AT2, AT3)(AT0 /*char*/ handle, AT1 /*TlsInteraction*/ interaction, TlsDatabaseLookupFlags flags, AT2 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT3 /*void*/ user_data) nothrow {
24104 g_tls_database_lookup_certificate_for_handle_async(&this, toCString!(char*)(handle), UpCast!(TlsInteraction*)(interaction), flags, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
24107 // VERSION: 2.30
24108 // Finish an asynchronous lookup of a certificate by its handle. See
24109 // g_tls_database_lookup_certificate_handle() for more information.
24111 // If the handle is no longer valid, or does not point to a certificate in
24112 // this database, then %NULL will be returned.
24114 // Use g_object_unref() to release the certificate.
24115 // RETURNS: a newly allocated #GTlsCertificate object.
24116 // <result>: a #GAsyncResult.
24117 TlsCertificate* /*new*/ lookup_certificate_for_handle_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
24118 return g_tls_database_lookup_certificate_for_handle_finish(&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
24121 // VERSION: 2.30
24122 // Lookup the issuer of @certificate in the database.
24124 // The %issuer property
24125 // of @certificate is not modified, and the two certificates are not hooked
24126 // into a chain.
24128 // This function can block, use g_tls_database_lookup_certificate_issuer_async() to perform
24129 // the lookup operation asynchronously.
24131 // or %NULL. Use g_object_unref() to release the certificate.
24132 // RETURNS: a newly allocated issuer #GTlsCertificate,
24133 // <certificate>: a #GTlsCertificate
24134 // <interaction>: used to interact with the user if necessary
24135 // <flags>: flags which affect the lookup operation
24136 // <cancellable>: a #GCancellable, or %NULL
24137 TlsCertificate* /*new*/ lookup_certificate_issuer(AT0, AT1, AT2, AT3)(AT0 /*TlsCertificate*/ certificate, AT1 /*TlsInteraction*/ interaction, TlsDatabaseLookupFlags flags, AT2 /*Cancellable*/ cancellable, AT3 /*GLib2.Error**/ error=null) nothrow {
24138 return g_tls_database_lookup_certificate_issuer(&this, UpCast!(TlsCertificate*)(certificate), UpCast!(TlsInteraction*)(interaction), flags, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
24141 // VERSION: 2.30
24142 // Asynchronously lookup the issuer of @certificate in the database. See
24143 // g_tls_database_lookup_certificate_issuer() for more information.
24144 // <certificate>: a #GTlsCertificate
24145 // <interaction>: used to interact with the user if necessary
24146 // <flags>: flags which affect the lookup operation
24147 // <cancellable>: a #GCancellable, or %NULL
24148 // <callback>: callback to call when the operation completes
24149 // <user_data>: the data to pass to the callback function
24150 void lookup_certificate_issuer_async(AT0, AT1, AT2, AT3)(AT0 /*TlsCertificate*/ certificate, AT1 /*TlsInteraction*/ interaction, TlsDatabaseLookupFlags flags, AT2 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT3 /*void*/ user_data) nothrow {
24151 g_tls_database_lookup_certificate_issuer_async(&this, UpCast!(TlsCertificate*)(certificate), UpCast!(TlsInteraction*)(interaction), flags, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
24154 // VERSION: 2.30
24155 // Finish an asynchronous lookup issuer operation. See
24156 // g_tls_database_lookup_certificate_issuer() for more information.
24158 // or %NULL. Use g_object_unref() to release the certificate.
24159 // RETURNS: a newly allocated issuer #GTlsCertificate,
24160 // <result>: a #GAsyncResult.
24161 TlsCertificate* /*new*/ lookup_certificate_issuer_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
24162 return g_tls_database_lookup_certificate_issuer_finish(&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
24165 // VERSION: 2.30
24166 // Lookup certificates issued by this issuer in the database.
24168 // This function can block, use g_tls_database_lookup_certificates_issued_by_async() to perform
24169 // the lookup operation asynchronously.
24171 // objects. Use g_object_unref() on each certificate, and g_list_free() on the release the list.
24172 // RETURNS: a newly allocated list of #GTlsCertificate
24173 // <issuer_raw_dn>: a #GByteArray which holds the DER encoded issuer DN.
24174 // <interaction>: used to interact with the user if necessary
24175 // <flags>: Flags which affect the lookup operation.
24176 // <cancellable>: a #GCancellable, or %NULL
24177 GLib2.List* /*new*/ lookup_certificates_issued_by(AT0, AT1, AT2, AT3)(AT0 /*ByteArray*/ issuer_raw_dn, AT1 /*TlsInteraction*/ interaction, TlsDatabaseLookupFlags flags, AT2 /*Cancellable*/ cancellable, AT3 /*GLib2.Error**/ error=null) nothrow {
24178 return g_tls_database_lookup_certificates_issued_by(&this, UpCast!(ByteArray*)(issuer_raw_dn), UpCast!(TlsInteraction*)(interaction), flags, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
24181 // VERSION: 2.30
24182 // Asynchronously lookup certificates issued by this issuer in the database. See
24183 // g_tls_database_lookup_certificates_issued_by() for more information.
24185 // The database may choose to hold a reference to the issuer byte array for the duration
24186 // of of this asynchronous operation. The byte array should not be modified during
24187 // this time.
24188 // <issuer_raw_dn>: a #GByteArray which holds the DER encoded issuer DN.
24189 // <interaction>: used to interact with the user if necessary
24190 // <flags>: Flags which affect the lookup operation.
24191 // <cancellable>: a #GCancellable, or %NULL
24192 // <callback>: callback to call when the operation completes
24193 // <user_data>: the data to pass to the callback function
24194 void lookup_certificates_issued_by_async(AT0, AT1, AT2, AT3)(AT0 /*ByteArray*/ issuer_raw_dn, AT1 /*TlsInteraction*/ interaction, TlsDatabaseLookupFlags flags, AT2 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT3 /*void*/ user_data) nothrow {
24195 g_tls_database_lookup_certificates_issued_by_async(&this, UpCast!(ByteArray*)(issuer_raw_dn), UpCast!(TlsInteraction*)(interaction), flags, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
24198 // Unintrospectable method: lookup_certificates_issued_by_finish() / g_tls_database_lookup_certificates_issued_by_finish()
24199 // VERSION: 2.30
24200 // Finish an asynchronous lookup of certificates. See
24201 // g_tls_database_lookup_certificates_issued_by() for more information.
24203 // Use g_object_unref() on each certificate, and g_list_free() on the release the list.
24204 // RETURNS: a newly allocated list of #GTlsCertificate objects.
24205 // <result>: a #GAsyncResult.
24206 GLib2.List* /*new*/ lookup_certificates_issued_by_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
24207 return g_tls_database_lookup_certificates_issued_by_finish(&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
24210 // VERSION: 2.30
24211 // Verify's a certificate chain after looking up and adding any missing
24212 // certificates to the chain.
24214 // @chain is a chain of #GTlsCertificate objects each pointing to the next
24215 // certificate in the chain by its %issuer property. The chain may initially
24216 // consist of one or more certificates. After the verification process is
24217 // complete, @chain may be modified by adding missing certificates, or removing
24218 // extra certificates. If a certificate anchor was found, then it is added to
24219 // the @chain.
24221 // @purpose describes the purpose (or usage) for which the certificate
24222 // is being used. Typically @purpose will be set to #G_TLS_DATABASE_PURPOSE_AUTHENTICATE_SERVER
24223 // which means that the certificate is being used to authenticate a server
24224 // (and we are acting as the client).
24226 // The @identity is used to check for pinned certificates (trust exceptions)
24227 // in the database. These will override the normal verification process on a
24228 // host by host basis.
24230 // Currently there are no @flags, and %G_TLS_DATABASE_VERIFY_NONE should be
24231 // used.
24233 // This function can block, use g_tls_database_verify_chain_async() to perform
24234 // the verification operation asynchronously.
24236 // result of verification.
24237 // RETURNS: the appropriate #GTlsCertificateFlags which represents the
24238 // <chain>: a #GTlsCertificate chain
24239 // <purpose>: the purpose that this certificate chain will be used for.
24240 // <identity>: the expected peer identity
24241 // <interaction>: used to interact with the user if necessary
24242 // <flags>: additional verify flags
24243 // <cancellable>: a #GCancellable, or %NULL
24244 TlsCertificateFlags verify_chain(AT0, AT1, AT2, AT3, AT4, AT5)(AT0 /*TlsCertificate*/ chain, AT1 /*char*/ purpose, AT2 /*SocketConnectable*/ identity, AT3 /*TlsInteraction*/ interaction, TlsDatabaseVerifyFlags flags, AT4 /*Cancellable*/ cancellable, AT5 /*GLib2.Error**/ error=null) nothrow {
24245 return g_tls_database_verify_chain(&this, UpCast!(TlsCertificate*)(chain), toCString!(char*)(purpose), UpCast!(SocketConnectable*)(identity), UpCast!(TlsInteraction*)(interaction), flags, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
24248 // VERSION: 2.30
24249 // Asynchronously verify's a certificate chain after looking up and adding
24250 // any missing certificates to the chain. See g_tls_database_verify_chain()
24251 // for more information.
24252 // <chain>: a #GTlsCertificate chain
24253 // <purpose>: the purpose that this certificate chain will be used for.
24254 // <identity>: the expected peer identity
24255 // <interaction>: used to interact with the user if necessary
24256 // <flags>: additional verify flags
24257 // <cancellable>: a #GCancellable, or %NULL
24258 // <callback>: callback to call when the operation completes
24259 // <user_data>: the data to pass to the callback function
24260 void verify_chain_async(AT0, AT1, AT2, AT3, AT4, AT5)(AT0 /*TlsCertificate*/ chain, AT1 /*char*/ purpose, AT2 /*SocketConnectable*/ identity, AT3 /*TlsInteraction*/ interaction, TlsDatabaseVerifyFlags flags, AT4 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT5 /*void*/ user_data) nothrow {
24261 g_tls_database_verify_chain_async(&this, UpCast!(TlsCertificate*)(chain), toCString!(char*)(purpose), UpCast!(SocketConnectable*)(identity), UpCast!(TlsInteraction*)(interaction), flags, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
24264 // VERSION: 2.30
24265 // Finish an asynchronous verify chain operation. See
24266 // g_tls_database_verify_chain() for more information. *
24267 // result of verification.
24268 // RETURNS: the appropriate #GTlsCertificateFlags which represents the
24269 // <result>: a #GAsyncResult.
24270 TlsCertificateFlags verify_chain_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
24271 return g_tls_database_verify_chain_finish(&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
24275 struct TlsDatabaseClass {
24276 GObject2.ObjectClass parent_class;
24278 // RETURNS: the appropriate #GTlsCertificateFlags which represents the
24279 // <chain>: a #GTlsCertificate chain
24280 // <purpose>: the purpose that this certificate chain will be used for.
24281 // <identity>: the expected peer identity
24282 // <interaction>: used to interact with the user if necessary
24283 // <flags>: additional verify flags
24284 // <cancellable>: a #GCancellable, or %NULL
24285 extern (C) TlsCertificateFlags function (TlsDatabase* self, TlsCertificate* chain, char* purpose, SocketConnectable* identity, TlsInteraction* interaction, TlsDatabaseVerifyFlags flags, Cancellable* cancellable, GLib2.Error** error=null) nothrow verify_chain;
24287 // <chain>: a #GTlsCertificate chain
24288 // <purpose>: the purpose that this certificate chain will be used for.
24289 // <identity>: the expected peer identity
24290 // <interaction>: used to interact with the user if necessary
24291 // <flags>: additional verify flags
24292 // <cancellable>: a #GCancellable, or %NULL
24293 // <callback>: callback to call when the operation completes
24294 // <user_data>: the data to pass to the callback function
24295 extern (C) void function (TlsDatabase* self, TlsCertificate* chain, char* purpose, SocketConnectable* identity, TlsInteraction* interaction, TlsDatabaseVerifyFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow verify_chain_async;
24297 // RETURNS: the appropriate #GTlsCertificateFlags which represents the
24298 // <result>: a #GAsyncResult.
24299 extern (C) TlsCertificateFlags function (TlsDatabase* self, AsyncResult* result, GLib2.Error** error=null) nothrow verify_chain_finish;
24301 // RETURNS: a newly allocated string containing the handle.
24302 // <certificate>: certificate for which to create a handle.
24303 extern (C) char* /*new*/ function (TlsDatabase* self, TlsCertificate* certificate) nothrow create_certificate_handle;
24305 // RETURNS: a newly allocated
24306 // <handle>: a certificate handle
24307 // <interaction>: used to interact with the user if necessary
24308 // <flags>: Flags which affect the lookup.
24309 // <cancellable>: a #GCancellable, or %NULL
24310 extern (C) TlsCertificate* /*new*/ function (TlsDatabase* self, char* handle, TlsInteraction* interaction, TlsDatabaseLookupFlags flags, Cancellable* cancellable, GLib2.Error** error=null) nothrow lookup_certificate_for_handle;
24312 // <handle>: a certificate handle
24313 // <interaction>: used to interact with the user if necessary
24314 // <flags>: Flags which affect the lookup.
24315 // <cancellable>: a #GCancellable, or %NULL
24316 // <callback>: callback to call when the operation completes
24317 // <user_data>: the data to pass to the callback function
24318 extern (C) void function (TlsDatabase* self, char* handle, TlsInteraction* interaction, TlsDatabaseLookupFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow lookup_certificate_for_handle_async;
24320 // RETURNS: a newly allocated #GTlsCertificate object.
24321 // <result>: a #GAsyncResult.
24322 extern (C) TlsCertificate* /*new*/ function (TlsDatabase* self, AsyncResult* result, GLib2.Error** error=null) nothrow lookup_certificate_for_handle_finish;
24324 // RETURNS: a newly allocated issuer #GTlsCertificate,
24325 // <certificate>: a #GTlsCertificate
24326 // <interaction>: used to interact with the user if necessary
24327 // <flags>: flags which affect the lookup operation
24328 // <cancellable>: a #GCancellable, or %NULL
24329 extern (C) TlsCertificate* /*new*/ function (TlsDatabase* self, TlsCertificate* certificate, TlsInteraction* interaction, TlsDatabaseLookupFlags flags, Cancellable* cancellable, GLib2.Error** error=null) nothrow lookup_certificate_issuer;
24331 // <certificate>: a #GTlsCertificate
24332 // <interaction>: used to interact with the user if necessary
24333 // <flags>: flags which affect the lookup operation
24334 // <cancellable>: a #GCancellable, or %NULL
24335 // <callback>: callback to call when the operation completes
24336 // <user_data>: the data to pass to the callback function
24337 extern (C) void function (TlsDatabase* self, TlsCertificate* certificate, TlsInteraction* interaction, TlsDatabaseLookupFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow lookup_certificate_issuer_async;
24339 // RETURNS: a newly allocated issuer #GTlsCertificate,
24340 // <result>: a #GAsyncResult.
24341 extern (C) TlsCertificate* /*new*/ function (TlsDatabase* self, AsyncResult* result, GLib2.Error** error=null) nothrow lookup_certificate_issuer_finish;
24343 // RETURNS: a newly allocated list of #GTlsCertificate
24344 // <issuer_raw_dn>: a #GByteArray which holds the DER encoded issuer DN.
24345 // <interaction>: used to interact with the user if necessary
24346 // <flags>: Flags which affect the lookup operation.
24347 // <cancellable>: a #GCancellable, or %NULL
24348 extern (C) GLib2.List* /*new*/ function (TlsDatabase* self, ByteArray* issuer_raw_dn, TlsInteraction* interaction, TlsDatabaseLookupFlags flags, Cancellable* cancellable, GLib2.Error** error=null) nothrow lookup_certificates_issued_by;
24350 // <issuer_raw_dn>: a #GByteArray which holds the DER encoded issuer DN.
24351 // <interaction>: used to interact with the user if necessary
24352 // <flags>: Flags which affect the lookup operation.
24353 // <cancellable>: a #GCancellable, or %NULL
24354 // <callback>: callback to call when the operation completes
24355 // <user_data>: the data to pass to the callback function
24356 extern (C) void function (TlsDatabase* self, ByteArray* issuer_raw_dn, TlsInteraction* interaction, TlsDatabaseLookupFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow lookup_certificates_issued_by_async;
24358 // Unintrospectable functionp: lookup_certificates_issued_by_finish() / ()
24360 // RETURNS: a newly allocated list of #GTlsCertificate objects.
24361 // <result>: a #GAsyncResult.
24362 extern (C) GLib2.List* /*new*/ function (TlsDatabase* self, AsyncResult* result, GLib2.Error** error=null) nothrow lookup_certificates_issued_by_finish;
24363 private void*[16] padding;
24367 // Flags for g_tls_database_lookup_certificate_handle(),
24368 // g_tls_database_lookup_certificate_issuer(),
24369 // and g_tls_database_lookup_certificates_issued_by().
24370 enum TlsDatabaseLookupFlags /* Version 2.30 */ {
24371 NONE = 0,
24372 KEYPAIR = 1
24374 struct TlsDatabasePrivate {
24377 // Flags for g_tls_database_verify_chain().
24378 enum TlsDatabaseVerifyFlags /* Version 2.30 */ {
24379 NONE = 0
24382 // An error code used with %G_TLS_ERROR in a #GError returned from a
24383 // TLS-related routine.
24384 enum TlsError /* Version 2.28 */ {
24385 UNAVAILABLE = 0,
24386 MISC = 1,
24387 BAD_CERTIFICATE = 2,
24388 NOT_TLS = 3,
24389 HANDSHAKE = 4,
24390 CERTIFICATE_REQUIRED = 5,
24391 EOF = 6
24394 // #GTlsFileDatabase is implemented by #GTlsDatabase objects which load
24395 // their certificate information from a file. It is in interface which
24396 // TLS library specific subtypes implement.
24397 struct TlsFileDatabase /* Interface */ /* Version 2.30 */ {
24398 mixin template __interface__() {
24399 // VERSION: 2.30
24400 // Creates a new #GTlsFileDatabase which uses anchor certificate authorities
24401 // in @anchors to verify certificate chains.
24403 // The certificates in @anchors must be PEM encoded.
24405 // #GTlsFileDatabase, or %NULL on error
24406 // RETURNS: the new
24407 // <anchors>: filename of anchor certificate authorities.
24408 static TlsFileDatabase* /*new*/ new_(AT0, AT1)(AT0 /*char*/ anchors, AT1 /*GLib2.Error**/ error=null) nothrow {
24409 return g_tls_file_database_new(toCString!(char*)(anchors), UpCast!(GLib2.Error**)(error));
24412 mixin __interface__;
24415 // Provides an interface for #GTlsFileDatabase implementations.
24416 struct TlsFileDatabaseInterface {
24417 GObject2.TypeInterface g_iface;
24418 private void*[8] padding;
24422 // #GTlsInteraction provides a mechanism for the TLS connection and database
24423 // code to interact with the user. It can be used to ask the user for passwords.
24425 // To use a #GTlsInteraction with a TLS connection use
24426 // g_tls_connection_set_interaction().
24428 // Callers should instantiate a derived class that implements the various
24429 // interaction methods to show the required dialogs.
24431 // Callers should use the 'invoke' functions like
24432 // g_tls_interaction_invoke_ask_password() to run interaction methods. These
24433 // functions make sure that the interaction is invoked in the main loop
24434 // and not in the current thread, if the current thread is not running the
24435 // main loop.
24437 // Derived classes can choose to implement whichever interactions methods they'd
24438 // like to support by overriding those virtual methods in their class
24439 // initialization function. Any interactions not implemented will return
24440 // %G_TLS_INTERACTION_UNHANDLED. If a derived class implements an async method,
24441 // it must also implement the corresponding finish method.
24442 struct TlsInteraction /* : GObject.Object */ /* Version 2.30 */ {
24443 alias parent_instance this;
24444 alias parent_instance super_;
24445 alias parent_instance object;
24446 GObject2.Object parent_instance;
24447 private TlsInteractionPrivate* priv;
24450 // VERSION: 2.30
24451 // Run synchronous interaction to ask the user for a password. In general,
24452 // g_tls_interaction_invoke_ask_password() should be used instead of this
24453 // function.
24455 // Derived subclasses usually implement a password prompt, although they may
24456 // also choose to provide a password from elsewhere. The @password value will
24457 // be filled in and then @callback will be called. Alternatively the user may
24458 // abort this password request, which will usually abort the TLS connection.
24460 // If the interaction is cancelled by the cancellation object, or by the
24461 // user then %G_TLS_INTERACTION_FAILED will be returned with an error that
24462 // contains a %G_IO_ERROR_CANCELLED error code. Certain implementations may
24463 // not support immediate cancellation.
24464 // RETURNS: The status of the ask password interaction.
24465 // <password>: a #GTlsPassword object
24466 // <cancellable>: an optional #GCancellable cancellation object
24467 TlsInteractionResult ask_password(AT0, AT1, AT2)(AT0 /*TlsPassword*/ password, AT1 /*Cancellable*/ cancellable, AT2 /*GLib2.Error**/ error=null) nothrow {
24468 return g_tls_interaction_ask_password(&this, UpCast!(TlsPassword*)(password), UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
24471 // VERSION: 2.30
24472 // Run asynchronous interaction to ask the user for a password. In general,
24473 // g_tls_interaction_invoke_ask_password() should be used instead of this
24474 // function.
24476 // Derived subclasses usually implement a password prompt, although they may
24477 // also choose to provide a password from elsewhere. The @password value will
24478 // be filled in and then @callback will be called. Alternatively the user may
24479 // abort this password request, which will usually abort the TLS connection.
24481 // If the interaction is cancelled by the cancellation object, or by the
24482 // user then %G_TLS_INTERACTION_FAILED will be returned with an error that
24483 // contains a %G_IO_ERROR_CANCELLED error code. Certain implementations may
24484 // not support immediate cancellation.
24486 // Certain implementations may not support immediate cancellation.
24487 // <password>: a #GTlsPassword object
24488 // <cancellable>: an optional #GCancellable cancellation object
24489 // <callback>: will be called when the interaction completes
24490 // <user_data>: data to pass to the @callback
24491 void ask_password_async(AT0, AT1, AT2)(AT0 /*TlsPassword*/ password, AT1 /*Cancellable*/ cancellable=null, AsyncReadyCallback callback=null, AT2 /*void*/ user_data=null) nothrow {
24492 g_tls_interaction_ask_password_async(&this, UpCast!(TlsPassword*)(password), UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
24495 // VERSION: 2.30
24496 // Complete an ask password user interaction request. This should be once
24497 // the g_tls_interaction_ask_password_async() completion callback is called.
24499 // If %G_TLS_INTERACTION_HANDLED is returned, then the #GTlsPassword passed
24500 // to g_tls_interaction_ask_password() will have its password filled in.
24502 // If the interaction is cancelled by the cancellation object, or by the
24503 // user then %G_TLS_INTERACTION_FAILED will be returned with an error that
24504 // contains a %G_IO_ERROR_CANCELLED error code.
24505 // RETURNS: The status of the ask password interaction.
24506 // <result>: the result passed to the callback
24507 TlsInteractionResult ask_password_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
24508 return g_tls_interaction_ask_password_finish(&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
24511 // VERSION: 2.30
24512 // Invoke the interaction to ask the user for a password. It invokes this
24513 // interaction in the main loop, specifically the #GMainContext returned by
24514 // g_main_context_get_thread_default() when the interaction is created. This
24515 // is called by called by #GTlsConnection or #GTlsDatabase to ask the user
24516 // for a password.
24518 // Derived subclasses usually implement a password prompt, although they may
24519 // also choose to provide a password from elsewhere. The @password value will
24520 // be filled in and then @callback will be called. Alternatively the user may
24521 // abort this password request, which will usually abort the TLS connection.
24523 // The implementation can either be a synchronous (eg: modal dialog) or an
24524 // asynchronous one (eg: modeless dialog). This function will take care of
24525 // calling which ever one correctly.
24527 // If the interaction is cancelled by the cancellation object, or by the
24528 // user then %G_TLS_INTERACTION_FAILED will be returned with an error that
24529 // contains a %G_IO_ERROR_CANCELLED error code. Certain implementations may
24530 // not support immediate cancellation.
24531 // RETURNS: The status of the ask password interaction.
24532 // <password>: a #GTlsPassword object
24533 // <cancellable>: an optional #GCancellable cancellation object
24534 TlsInteractionResult invoke_ask_password(AT0, AT1, AT2)(AT0 /*TlsPassword*/ password, AT1 /*Cancellable*/ cancellable, AT2 /*GLib2.Error**/ error=null) nothrow {
24535 return g_tls_interaction_invoke_ask_password(&this, UpCast!(TlsPassword*)(password), UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
24540 // The class for #GTlsInteraction. Derived classes implement the various
24541 // virtual interaction methods to handle TLS interactions.
24543 // Derived classes can choose to implement whichever interactions methods they'd
24544 // like to support by overriding those virtual methods in their class
24545 // initialization function. If a derived class implements an async method,
24546 // it must also implement the corresponding finish method.
24548 // The synchronous interaction methods should implement to display modal dialogs,
24549 // and the asynchronous methods to display modeless dialogs.
24551 // If the user cancels an interaction, then the result should be
24552 // %G_TLS_INTERACTION_FAILED and the error should be set with a domain of
24553 // %G_IO_ERROR and code of %G_IO_ERROR_CANCELLED.
24554 struct TlsInteractionClass /* Version 2.30 */ {
24555 private GObject2.ObjectClass parent_class;
24557 // RETURNS: The status of the ask password interaction.
24558 // <password>: a #GTlsPassword object
24559 // <cancellable>: an optional #GCancellable cancellation object
24560 extern (C) TlsInteractionResult function (TlsInteraction* interaction, TlsPassword* password, Cancellable* cancellable, GLib2.Error** error=null) nothrow ask_password;
24562 // <password>: a #GTlsPassword object
24563 // <cancellable>: an optional #GCancellable cancellation object
24564 // <callback>: will be called when the interaction completes
24565 // <user_data>: data to pass to the @callback
24566 extern (C) void function (TlsInteraction* interaction, TlsPassword* password, Cancellable* cancellable=null, AsyncReadyCallback callback=null, void* user_data=null) nothrow ask_password_async;
24568 // RETURNS: The status of the ask password interaction.
24569 // <result>: the result passed to the callback
24570 extern (C) TlsInteractionResult function (TlsInteraction* interaction, AsyncResult* result, GLib2.Error** error=null) nothrow ask_password_finish;
24571 private void*[24] padding;
24574 struct TlsInteractionPrivate {
24578 // #GTlsInteractionResult is returned by various functions in #GTlsInteraction
24579 // when finishing an interaction request.
24580 enum TlsInteractionResult /* Version 2.30 */ {
24581 UNHANDLED = 0,
24582 HANDLED = 1,
24583 FAILED = 2
24585 // Holds a password used in TLS.
24586 struct TlsPassword /* : GObject.Object */ /* Version 2.30 */ {
24587 alias parent_instance this;
24588 alias parent_instance super_;
24589 alias parent_instance object;
24590 GObject2.Object parent_instance;
24591 TlsPasswordPrivate* priv;
24594 // Create a new #GTlsPassword object.
24595 // RETURNS: The newly allocated password object
24596 // <flags>: the password flags
24597 // <description>: description of what the password is for
24598 static TlsPassword* /*new*/ new_(AT0)(TlsPasswordFlags flags, AT0 /*char*/ description) nothrow {
24599 return g_tls_password_new(flags, toCString!(char*)(description));
24601 static auto opCall(AT0)(TlsPasswordFlags flags, AT0 /*char*/ description) {
24602 return g_tls_password_new(flags, toCString!(char*)(description));
24605 // VERSION: 2.30
24606 // Get a description string about what the password will be used for.
24607 // RETURNS: The description of the password.
24608 char* get_description()() nothrow {
24609 return g_tls_password_get_description(&this);
24612 // VERSION: 2.30
24613 // Get flags about the password.
24614 // RETURNS: The flags about the password.
24615 TlsPasswordFlags get_flags()() nothrow {
24616 return g_tls_password_get_flags(&this);
24619 // VERSION: 2.30
24620 // Get the password value. If @length is not %NULL then it will be
24621 // filled in with the length of the password value. (Note that the
24622 // password value is not nul-terminated, so you can only pass %NULL
24623 // for @length in contexts where you know the password will have a
24624 // certain fixed length.)
24625 // RETURNS: The password value (owned by the password object).
24626 // <length>: location to place the length of the password.
24627 ubyte* get_value(AT0)(AT0 /*size_t*/ length=null) nothrow {
24628 return g_tls_password_get_value(&this, UpCast!(size_t*)(length));
24631 // VERSION: 2.30
24632 // Get a user readable translated warning. Usually this warning is a
24633 // representation of the password flags returned from
24634 // g_tls_password_get_flags().
24635 // RETURNS: The warning.
24636 char* get_warning()() nothrow {
24637 return g_tls_password_get_warning(&this);
24640 // VERSION: 2.30
24641 // Set a description string about what the password will be used for.
24642 // <description>: The description of the password
24643 void set_description(AT0)(AT0 /*char*/ description) nothrow {
24644 g_tls_password_set_description(&this, toCString!(char*)(description));
24647 // VERSION: 2.30
24648 // Set flags about the password.
24649 // <flags>: The flags about the password
24650 void set_flags()(TlsPasswordFlags flags) nothrow {
24651 g_tls_password_set_flags(&this, flags);
24654 // VERSION: 2.30
24655 // Set the value for this password. The @value will be copied by the password
24656 // object.
24658 // Specify the @length, for a non-nul-terminated password. Pass -1 as
24659 // @length if using a nul-terminated password, and @length will be
24660 // calculated automatically. (Note that the terminating nul is not
24661 // considered part of the password in this case.)
24662 // <value>: the new password value
24663 // <length>: the length of the password, or -1
24664 void set_value(AT0)(AT0 /*ubyte*/ value, ssize_t length) nothrow {
24665 g_tls_password_set_value(&this, UpCast!(ubyte*)(value), length);
24668 // VERSION: 2.30
24669 // Provide the value for this password.
24671 // The @value will be owned by the password object, and later freed using
24672 // the @destroy function callback.
24674 // Specify the @length, for a non-nul-terminated password. Pass -1 as
24675 // @length if using a nul-terminated password, and @length will be
24676 // calculated automatically. (Note that the terminating nul is not
24677 // considered part of the password in this case.)
24678 // <value>: the value for the password
24679 // <length>: the length of the password, or -1
24680 // <destroy>: a function to use to free the password.
24681 void set_value_full(AT0)(AT0 /*ubyte*/ value, ssize_t length, GLib2.DestroyNotify destroy=null) nothrow {
24682 g_tls_password_set_value_full(&this, UpCast!(ubyte*)(value), length, destroy);
24685 // VERSION: 2.30
24686 // Set a user readable translated warning. Usually this warning is a
24687 // representation of the password flags returned from
24688 // g_tls_password_get_flags().
24689 // <warning>: The user readable warning
24690 void set_warning(AT0)(AT0 /*char*/ warning) nothrow {
24691 g_tls_password_set_warning(&this, toCString!(char*)(warning));
24695 struct TlsPasswordClass {
24696 GObject2.ObjectClass parent_class;
24698 // RETURNS: The password value (owned by the password object).
24699 // <length>: location to place the length of the password.
24700 extern (C) ubyte* function (TlsPassword* password, size_t* length=null) nothrow get_value;
24702 // <value>: the value for the password
24703 // <length>: the length of the password, or -1
24704 // <destroy>: a function to use to free the password.
24705 extern (C) void function (TlsPassword* password, ubyte* value, ssize_t length, GLib2.DestroyNotify destroy=null) nothrow set_value;
24706 extern (C) char* function (TlsPassword* password) nothrow get_default_warning;
24707 private void*[4] padding;
24710 // Various flags for the password.
24711 enum TlsPasswordFlags /* Version 2.30 */ {
24712 NONE = 0,
24713 RETRY = 2,
24714 MANY_TRIES = 4,
24715 FINAL_TRY = 8
24717 struct TlsPasswordPrivate {
24721 // When to allow rehandshaking. See
24722 // g_tls_connection_set_rehandshake_mode().
24723 enum TlsRehandshakeMode /* Version 2.28 */ {
24724 NEVER = 0,
24725 SAFELY = 1,
24726 UNSAFELY = 2
24729 // #GTlsServerConnection is the server-side subclass of #GTlsConnection,
24730 // representing a server-side TLS connection.
24731 struct TlsServerConnection /* Interface */ /* Version 2.28 */ {
24732 mixin template __interface__() {
24733 // VERSION: 2.28
24734 // Creates a new #GTlsServerConnection wrapping @base_io_stream (which
24735 // must have pollable input and output streams).
24737 // #GTlsServerConnection, or %NULL on error
24738 // RETURNS: the new
24739 // <base_io_stream>: the #GIOStream to wrap
24740 // <certificate>: the default server certificate, or %NULL
24741 static TlsServerConnection* /*new*/ new_(AT0, AT1, AT2)(AT0 /*IOStream*/ base_io_stream, AT1 /*TlsCertificate*/ certificate, AT2 /*GLib2.Error**/ error=null) nothrow {
24742 return g_tls_server_connection_new(UpCast!(IOStream*)(base_io_stream), UpCast!(TlsCertificate*)(certificate), UpCast!(GLib2.Error**)(error));
24745 mixin __interface__;
24748 struct TlsServerConnectionInterface {
24749 GObject2.TypeInterface g_iface;
24753 // This is the subclass of #GSocketConnection that is created
24754 // for UNIX domain sockets.
24756 // It contains functions to do some of the UNIX socket specific
24757 // functionality like passing file descriptors.
24759 // Note that <filename>&lt;gio/gunixconnection.h&gt;</filename> belongs to
24760 // the UNIX-specific GIO interfaces, thus you have to use the
24761 // <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
24762 struct UnixConnection /* : SocketConnection */ {
24763 alias parent_instance this;
24764 alias parent_instance super_;
24765 alias parent_instance socketconnection;
24766 SocketConnection parent_instance;
24767 UnixConnectionPrivate* priv;
24770 // VERSION: 2.26
24771 // Receives credentials from the sending end of the connection. The
24772 // sending end has to call g_unix_connection_send_credentials() (or
24773 // similar) for this to work.
24775 // As well as reading the credentials this also reads (and discards) a
24776 // single byte from the stream, as this is required for credentials
24777 // passing to work on some implementations.
24779 // Other ways to exchange credentials with a foreign peer includes the
24780 // #GUnixCredentialsMessage type and g_socket_get_credentials() function.
24782 // g_object_unref()), %NULL if @error is set.
24783 // RETURNS: Received credentials on success (free with
24784 // <cancellable>: A #GCancellable or %NULL.
24785 Credentials* /*new*/ receive_credentials(AT0, AT1)(AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
24786 return g_unix_connection_receive_credentials(&this, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
24789 // VERSION: 2.32
24790 // Asynchronously receive credentials.
24792 // For more details, see g_unix_connection_receive_credentials() which is
24793 // the synchronous version of this call.
24795 // When the operation is finished, @callback will be called. You can then call
24796 // g_unix_connection_receive_credentials_finish() to get the result of the operation.
24797 // <cancellable>: optional #GCancellable object, %NULL to ignore.
24798 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
24799 // <user_data>: the data to pass to callback function
24800 void receive_credentials_async(AT0, AT1)(AT0 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT1 /*void*/ user_data) nothrow {
24801 g_unix_connection_receive_credentials_async(&this, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
24804 // VERSION: 2.32
24805 // Finishes an asynchronous receive credentials operation started with
24806 // g_unix_connection_receive_credentials_async().
24808 // Free the returned object with g_object_unref().
24809 // RETURNS: a #GCredentials, or %NULL on error.
24810 // <result>: a #GAsyncResult.
24811 Credentials* /*new*/ receive_credentials_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
24812 return g_unix_connection_receive_credentials_finish(&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
24815 // VERSION: 2.22
24816 // Receives a file descriptor from the sending end of the connection.
24817 // The sending end has to call g_unix_connection_send_fd() for this
24818 // to work.
24820 // As well as reading the fd this also reads a single byte from the
24821 // stream, as this is required for fd passing to work on some
24822 // implementations.
24823 // RETURNS: a file descriptor on success, -1 on error.
24824 // <cancellable>: optional #GCancellable object, %NULL to ignore
24825 int receive_fd(AT0, AT1)(AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
24826 return g_unix_connection_receive_fd(&this, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
24829 // VERSION: 2.26
24830 // Passes the credentials of the current user the receiving side
24831 // of the connection. The receiving end has to call
24832 // g_unix_connection_receive_credentials() (or similar) to accept the
24833 // credentials.
24835 // As well as sending the credentials this also writes a single NUL
24836 // byte to the stream, as this is required for credentials passing to
24837 // work on some implementations.
24839 // Other ways to exchange credentials with a foreign peer includes the
24840 // #GUnixCredentialsMessage type and g_socket_get_credentials() function.
24841 // RETURNS: %TRUE on success, %FALSE if @error is set.
24842 // <cancellable>: A #GCancellable or %NULL.
24843 int send_credentials(AT0, AT1)(AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
24844 return g_unix_connection_send_credentials(&this, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
24847 // VERSION: 2.32
24848 // Asynchronously send credentials.
24850 // For more details, see g_unix_connection_send_credentials() which is
24851 // the synchronous version of this call.
24853 // When the operation is finished, @callback will be called. You can then call
24854 // g_unix_connection_send_credentials_finish() to get the result of the operation.
24855 // <cancellable>: optional #GCancellable object, %NULL to ignore.
24856 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
24857 // <user_data>: the data to pass to callback function
24858 void send_credentials_async(AT0, AT1)(AT0 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT1 /*void*/ user_data) nothrow {
24859 g_unix_connection_send_credentials_async(&this, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
24862 // VERSION: 2.32
24863 // Finishes an asynchronous send credentials operation started with
24864 // g_unix_connection_send_credentials_async().
24865 // RETURNS: %TRUE if the operation was successful, otherwise %FALSE.
24866 // <result>: a #GAsyncResult.
24867 int send_credentials_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
24868 return g_unix_connection_send_credentials_finish(&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
24871 // VERSION: 2.22
24872 // Passes a file descriptor to the receiving side of the
24873 // connection. The receiving end has to call g_unix_connection_receive_fd()
24874 // to accept the file descriptor.
24876 // As well as sending the fd this also writes a single byte to the
24877 // stream, as this is required for fd passing to work on some
24878 // implementations.
24879 // RETURNS: a %TRUE on success, %NULL on error.
24880 // <fd>: a file descriptor
24881 // <cancellable>: optional #GCancellable object, %NULL to ignore.
24882 int send_fd(AT0, AT1)(int fd, AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
24883 return g_unix_connection_send_fd(&this, fd, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
24887 struct UnixConnectionClass {
24888 SocketConnectionClass parent_class;
24891 struct UnixConnectionPrivate {
24895 // This #GSocketControlMessage contains a #GCredentials instance. It
24896 // may be sent using g_socket_send_message() and received using
24897 // g_socket_receive_message() over UNIX sockets (ie: sockets in the
24898 // %G_SOCKET_FAMILY_UNIX family).
24900 // For an easier way to send and receive credentials over
24901 // stream-oriented UNIX sockets, see
24902 // g_unix_connection_send_credentials() and
24903 // g_unix_connection_receive_credentials(). To receive credentials of
24904 // a foreign process connected to a socket, use
24905 // g_socket_get_credentials().
24906 struct UnixCredentialsMessage /* : SocketControlMessage */ /* Version 2.26 */ {
24907 alias parent_instance this;
24908 alias parent_instance super_;
24909 alias parent_instance socketcontrolmessage;
24910 SocketControlMessage parent_instance;
24911 UnixCredentialsMessagePrivate* priv;
24914 // VERSION: 2.26
24915 // Creates a new #GUnixCredentialsMessage with credentials matching the current processes.
24916 // RETURNS: a new #GUnixCredentialsMessage
24917 static UnixCredentialsMessage* /*new*/ new_()() nothrow {
24918 return g_unix_credentials_message_new();
24920 static auto opCall()() {
24921 return g_unix_credentials_message_new();
24924 // VERSION: 2.26
24925 // Creates a new #GUnixCredentialsMessage holding @credentials.
24926 // RETURNS: a new #GUnixCredentialsMessage
24927 // <credentials>: A #GCredentials object.
24928 static UnixCredentialsMessage* /*new*/ new_with_credentials(AT0)(AT0 /*Credentials*/ credentials) nothrow {
24929 return g_unix_credentials_message_new_with_credentials(UpCast!(Credentials*)(credentials));
24931 static auto opCall(AT0)(AT0 /*Credentials*/ credentials) {
24932 return g_unix_credentials_message_new_with_credentials(UpCast!(Credentials*)(credentials));
24935 // VERSION: 2.26
24936 // Checks if passing #GCredentials on a #GSocket is supported on this platform.
24937 // RETURNS: %TRUE if supported, %FALSE otherwise
24938 static int is_supported()() nothrow {
24939 return g_unix_credentials_message_is_supported();
24942 // VERSION: 2.26
24943 // Gets the credentials stored in @message.
24944 // RETURNS: A #GCredentials instance. Do not free, it is owned by @message.
24945 Credentials* get_credentials()() nothrow {
24946 return g_unix_credentials_message_get_credentials(&this);
24950 // Class structure for #GUnixCredentialsMessage.
24951 struct UnixCredentialsMessageClass /* Version 2.26 */ {
24952 SocketControlMessageClass parent_class;
24953 extern (C) void function () nothrow _g_reserved1;
24954 extern (C) void function () nothrow _g_reserved2;
24957 struct UnixCredentialsMessagePrivate {
24961 // A #GUnixFDList contains a list of file descriptors. It owns the file
24962 // descriptors that it contains, closing them when finalized.
24964 // It may be wrapped in a #GUnixFDMessage and sent over a #GSocket in
24965 // the %G_SOCKET_ADDRESS_UNIX family by using g_socket_send_message()
24966 // and received using g_socket_receive_message().
24968 // Note that <filename>&lt;gio/gunixfdlist.h&gt;</filename> belongs to
24969 // the UNIX-specific GIO interfaces, thus you have to use the
24970 // <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
24971 struct UnixFDList /* : GObject.Object */ {
24972 alias parent_instance this;
24973 alias parent_instance super_;
24974 alias parent_instance object;
24975 GObject2.Object parent_instance;
24976 UnixFDListPrivate* priv;
24979 // VERSION: 2.24
24980 // Creates a new #GUnixFDList containing no file descriptors.
24981 // RETURNS: a new #GUnixFDList
24982 static UnixFDList* /*new*/ new_()() nothrow {
24983 return g_unix_fd_list_new();
24985 static auto opCall()() {
24986 return g_unix_fd_list_new();
24989 // VERSION: 2.24
24990 // Creates a new #GUnixFDList containing the file descriptors given in
24991 // @fds. The file descriptors become the property of the new list and
24992 // may no longer be used by the caller. The array itself is owned by
24993 // the caller.
24995 // Each file descriptor in the array should be set to close-on-exec.
24997 // If @n_fds is -1 then @fds must be terminated with -1.
24998 // RETURNS: a new #GUnixFDList
24999 // <fds>: the initial list of file descriptors
25000 // <n_fds>: the length of #fds, or -1
25001 static UnixFDList* /*new*/ new_from_array()(int* fds, int n_fds) nothrow {
25002 return g_unix_fd_list_new_from_array(fds, n_fds);
25004 static auto opCall()(int* fds, int n_fds) {
25005 return g_unix_fd_list_new_from_array(fds, n_fds);
25008 // VERSION: 2.24
25009 // Adds a file descriptor to @list.
25011 // The file descriptor is duplicated using dup(). You keep your copy
25012 // of the descriptor and the copy contained in @list will be closed
25013 // when @list is finalized.
25015 // A possible cause of failure is exceeding the per-process or
25016 // system-wide file descriptor limit.
25018 // The index of the file descriptor in the list is returned. If you use
25019 // this index with g_unix_fd_list_get() then you will receive back a
25020 // duplicated copy of the same file descriptor.
25022 // (and @error is set)
25023 // RETURNS: the index of the appended fd in case of success, else -1
25024 // <fd>: a valid open file descriptor
25025 int append(AT0)(int fd, AT0 /*GLib2.Error**/ error=null) nothrow {
25026 return g_unix_fd_list_append(&this, fd, UpCast!(GLib2.Error**)(error));
25029 // VERSION: 2.24
25030 // Gets a file descriptor out of @list.
25032 // @index_ specifies the index of the file descriptor to get. It is a
25033 // programmer error for @index_ to be out of range; see
25034 // g_unix_fd_list_get_length().
25036 // The file descriptor is duplicated using dup() and set as
25037 // close-on-exec before being returned. You must call close() on it
25038 // when you are done.
25040 // A possible cause of failure is exceeding the per-process or
25041 // system-wide file descriptor limit.
25042 // RETURNS: the file descriptor, or -1 in case of error
25043 // <index_>: the index into the list
25044 int get(AT0)(int index_, AT0 /*GLib2.Error**/ error=null) nothrow {
25045 return g_unix_fd_list_get(&this, index_, UpCast!(GLib2.Error**)(error));
25048 // VERSION: 2.24
25049 // Gets the length of @list (ie: the number of file descriptors
25050 // contained within).
25051 // RETURNS: the length of @list
25052 int get_length()() nothrow {
25053 return g_unix_fd_list_get_length(&this);
25056 // VERSION: 2.24
25057 // Returns the array of file descriptors that is contained in this
25058 // object.
25060 // After this call, the descriptors remain the property of @list. The
25061 // caller must not close them and must not free the array. The array is
25062 // valid only until @list is changed in any way.
25064 // If @length is non-%NULL then it is set to the number of file
25065 // descriptors in the returned array. The returned array is also
25066 // terminated with -1.
25068 // This function never returns %NULL. In case there are no file
25069 // descriptors contained in @list, an empty array is returned.
25071 // descriptors
25072 // RETURNS: an array of file
25073 // <length>: pointer to the length of the returned array, or %NULL
25074 int* peek_fds()(/*out*/ int* length=null) nothrow {
25075 return g_unix_fd_list_peek_fds(&this, length);
25078 // VERSION: 2.24
25079 // Returns the array of file descriptors that is contained in this
25080 // object.
25082 // After this call, the descriptors are no longer contained in
25083 // @list. Further calls will return an empty list (unless more
25084 // descriptors have been added).
25086 // The return result of this function must be freed with g_free().
25087 // The caller is also responsible for closing all of the file
25088 // descriptors. The file descriptors in the array are set to
25089 // close-on-exec.
25091 // If @length is non-%NULL then it is set to the number of file
25092 // descriptors in the returned array. The returned array is also
25093 // terminated with -1.
25095 // This function never returns %NULL. In case there are no file
25096 // descriptors contained in @list, an empty array is returned.
25098 // descriptors
25099 // RETURNS: an array of file
25100 // <length>: pointer to the length of the returned array, or %NULL
25101 int* /*new*/ steal_fds()(/*out*/ int* length=null) nothrow {
25102 return g_unix_fd_list_steal_fds(&this, length);
25106 struct UnixFDListClass {
25107 GObject2.ObjectClass parent_class;
25108 extern (C) void function () nothrow _g_reserved1;
25109 extern (C) void function () nothrow _g_reserved2;
25110 extern (C) void function () nothrow _g_reserved3;
25111 extern (C) void function () nothrow _g_reserved4;
25112 extern (C) void function () nothrow _g_reserved5;
25115 struct UnixFDListPrivate {
25119 // This #GSocketControlMessage contains a #GUnixFDList.
25120 // It may be sent using g_socket_send_message() and received using
25121 // g_socket_receive_message() over UNIX sockets (ie: sockets in the
25122 // %G_SOCKET_ADDRESS_UNIX family). The file descriptors are copied
25123 // between processes by the kernel.
25125 // For an easier way to send and receive file descriptors over
25126 // stream-oriented UNIX sockets, see g_unix_connection_send_fd() and
25127 // g_unix_connection_receive_fd().
25129 // Note that <filename>&lt;gio/gunixfdmessage.h&gt;</filename> belongs to
25130 // the UNIX-specific GIO interfaces, thus you have to use the
25131 // <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
25132 struct UnixFDMessage /* : SocketControlMessage */ {
25133 alias parent_instance this;
25134 alias parent_instance super_;
25135 alias parent_instance socketcontrolmessage;
25136 SocketControlMessage parent_instance;
25137 UnixFDMessagePrivate* priv;
25140 // VERSION: 2.22
25141 // Creates a new #GUnixFDMessage containing an empty file descriptor
25142 // list.
25143 // RETURNS: a new #GUnixFDMessage
25144 static UnixFDMessage* /*new*/ new_()() nothrow {
25145 return g_unix_fd_message_new();
25147 static auto opCall()() {
25148 return g_unix_fd_message_new();
25151 // VERSION: 2.24
25152 // Creates a new #GUnixFDMessage containing @list.
25153 // RETURNS: a new #GUnixFDMessage
25154 // <fd_list>: a #GUnixFDList
25155 static UnixFDMessage* /*new*/ new_with_fd_list(AT0)(AT0 /*UnixFDList*/ fd_list) nothrow {
25156 return g_unix_fd_message_new_with_fd_list(UpCast!(UnixFDList*)(fd_list));
25158 static auto opCall(AT0)(AT0 /*UnixFDList*/ fd_list) {
25159 return g_unix_fd_message_new_with_fd_list(UpCast!(UnixFDList*)(fd_list));
25162 // VERSION: 2.22
25163 // Adds a file descriptor to @message.
25165 // The file descriptor is duplicated using dup(). You keep your copy
25166 // of the descriptor and the copy contained in @message will be closed
25167 // when @message is finalized.
25169 // A possible cause of failure is exceeding the per-process or
25170 // system-wide file descriptor limit.
25171 // RETURNS: %TRUE in case of success, else %FALSE (and @error is set)
25172 // <fd>: a valid open file descriptor
25173 int append_fd(AT0)(int fd, AT0 /*GLib2.Error**/ error=null) nothrow {
25174 return g_unix_fd_message_append_fd(&this, fd, UpCast!(GLib2.Error**)(error));
25177 // VERSION: 2.24
25178 // Gets the #GUnixFDList contained in @message. This function does not
25179 // return a reference to the caller, but the returned list is valid for
25180 // the lifetime of @message.
25181 // RETURNS: the #GUnixFDList from @message
25182 UnixFDList* get_fd_list()() nothrow {
25183 return g_unix_fd_message_get_fd_list(&this);
25186 // VERSION: 2.22
25187 // Returns the array of file descriptors that is contained in this
25188 // object.
25190 // After this call, the descriptors are no longer contained in
25191 // @message. Further calls will return an empty list (unless more
25192 // descriptors have been added).
25194 // The return result of this function must be freed with g_free().
25195 // The caller is also responsible for closing all of the file
25196 // descriptors.
25198 // If @length is non-%NULL then it is set to the number of file
25199 // descriptors in the returned array. The returned array is also
25200 // terminated with -1.
25202 // This function never returns %NULL. In case there are no file
25203 // descriptors contained in @message, an empty array is returned.
25205 // descriptors
25206 // RETURNS: an array of file
25207 // <length>: pointer to the length of the returned array, or %NULL
25208 int* /*new*/ steal_fds()(/*out*/ int* length=null) nothrow {
25209 return g_unix_fd_message_steal_fds(&this, length);
25213 struct UnixFDMessageClass {
25214 SocketControlMessageClass parent_class;
25215 extern (C) void function () nothrow _g_reserved1;
25216 extern (C) void function () nothrow _g_reserved2;
25219 struct UnixFDMessagePrivate {
25223 // #GUnixInputStream implements #GInputStream for reading from a UNIX
25224 // file descriptor, including asynchronous operations. (If the file
25225 // descriptor refers to a socket or pipe, this will use poll() to do
25226 // asynchronous I/O. If it refers to a regular file, it will fall back
25227 // to doing asynchronous I/O in another thread.)
25229 // Note that <filename>&lt;gio/gunixinputstream.h&gt;</filename> belongs
25230 // to the UNIX-specific GIO interfaces, thus you have to use the
25231 // <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
25232 struct UnixInputStream /* : InputStream */ {
25233 mixin FileDescriptorBased.__interface__;
25234 mixin PollableInputStream.__interface__;
25235 alias parent_instance this;
25236 alias parent_instance super_;
25237 alias parent_instance inputstream;
25238 InputStream parent_instance;
25239 private UnixInputStreamPrivate* priv;
25242 // Creates a new #GUnixInputStream for the given @fd.
25244 // If @close_fd is %TRUE, the file descriptor will be closed
25245 // when the stream is closed.
25246 // RETURNS: a new #GUnixInputStream
25247 // <fd>: a UNIX file descriptor
25248 // <close_fd>: %TRUE to close the file descriptor when done
25249 static UnixInputStream* /*new*/ new_()(int fd, int close_fd) nothrow {
25250 return g_unix_input_stream_new(fd, close_fd);
25252 static auto opCall()(int fd, int close_fd) {
25253 return g_unix_input_stream_new(fd, close_fd);
25256 // VERSION: 2.20
25257 // Returns whether the file descriptor of @stream will be
25258 // closed when the stream is closed.
25259 // RETURNS: %TRUE if the file descriptor is closed when done
25260 int get_close_fd()() nothrow {
25261 return g_unix_input_stream_get_close_fd(&this);
25264 // VERSION: 2.20
25265 // Return the UNIX file descriptor that the stream reads from.
25266 // RETURNS: The file descriptor of @stream
25267 int get_fd()() nothrow {
25268 return g_unix_input_stream_get_fd(&this);
25271 // VERSION: 2.20
25272 // Sets whether the file descriptor of @stream shall be closed
25273 // when the stream is closed.
25274 // <close_fd>: %TRUE to close the file descriptor when done
25275 void set_close_fd()(int close_fd) nothrow {
25276 g_unix_input_stream_set_close_fd(&this, close_fd);
25280 struct UnixInputStreamClass {
25281 InputStreamClass parent_class;
25282 extern (C) void function () nothrow _g_reserved1;
25283 extern (C) void function () nothrow _g_reserved2;
25284 extern (C) void function () nothrow _g_reserved3;
25285 extern (C) void function () nothrow _g_reserved4;
25286 extern (C) void function () nothrow _g_reserved5;
25289 struct UnixInputStreamPrivate {
25293 // Defines a Unix mount entry (e.g. <filename>/media/cdrom</filename>).
25294 // This corresponds roughly to a mtab entry.
25295 struct UnixMountEntry {
25298 // Watches #GUnixMount<!-- -->s for changes.
25299 struct UnixMountMonitor /* : GObject.Object */ {
25300 alias method_parent this;
25301 alias method_parent super_;
25302 alias method_parent object;
25303 GObject2.Object method_parent;
25306 // Gets a new #GUnixMountMonitor. The default rate limit for which the
25307 // monitor will report consecutive changes for the mount and mount
25308 // point entry files is the default for a #GFileMonitor. Use
25309 // g_unix_mount_monitor_set_rate_limit() to change this.
25310 // RETURNS: a #GUnixMountMonitor.
25311 static UnixMountMonitor* /*new*/ new_()() nothrow {
25312 return g_unix_mount_monitor_new();
25314 static auto opCall()() {
25315 return g_unix_mount_monitor_new();
25318 // VERSION: 2.18
25319 // Sets the rate limit to which the @mount_monitor will report
25320 // consecutive change events to the mount and mount point entry files.
25321 // <limit_msec>: a integer with the limit in milliseconds to poll for changes.
25322 void set_rate_limit()(int limit_msec) nothrow {
25323 g_unix_mount_monitor_set_rate_limit(&this, limit_msec);
25325 // Emitted when the unix mount points have changed.
25326 extern (C) alias static void function (UnixMountMonitor* this_, void* user_data=null) nothrow signal_mountpoints_changed;
25328 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
25329 return super_.signal_connect!name(cb, data, cf);
25332 ulong signal_connect(string name:"mountpoints-changed", CB/*:signal_mountpoints_changed*/)
25333 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
25334 if (is(typeof(cb)==signal_mountpoints_changed)||_ttmm!(CB, signal_mountpoints_changed)()) {
25335 return signal_connect_data!()(&this, cast(char*)"mountpoints-changed",
25336 cast(GObject2.Callback)cb, data, null, cf);
25338 // Emitted when the unix mounts have changed.
25339 extern (C) alias static void function (UnixMountMonitor* this_, void* user_data=null) nothrow signal_mounts_changed;
25340 ulong signal_connect(string name:"mounts-changed", CB/*:signal_mounts_changed*/)
25341 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
25342 if (is(typeof(cb)==signal_mounts_changed)||_ttmm!(CB, signal_mounts_changed)()) {
25343 return signal_connect_data!()(&this, cast(char*)"mounts-changed",
25344 cast(GObject2.Callback)cb, data, null, cf);
25348 struct UnixMountMonitorClass {
25352 // Defines a Unix mount point (e.g. <filename>/dev</filename>).
25353 // This corresponds roughly to a fstab entry.
25354 struct UnixMountPoint {
25356 // Compares two unix mount points.
25358 // or less than @mount2, respectively.
25359 // RETURNS: 1, 0 or -1 if @mount1 is greater than, equal to,
25360 // <mount2>: a #GUnixMount.
25361 int compare(AT0)(AT0 /*UnixMountPoint*/ mount2) nothrow {
25362 return g_unix_mount_point_compare(&this, UpCast!(UnixMountPoint*)(mount2));
25364 // Frees a unix mount point.
25365 void free()() nothrow {
25366 g_unix_mount_point_free(&this);
25369 // Gets the device path for a unix mount point.
25370 // RETURNS: a string containing the device path.
25371 char* get_device_path()() nothrow {
25372 return g_unix_mount_point_get_device_path(&this);
25375 // Gets the file system type for the mount point.
25376 // RETURNS: a string containing the file system type.
25377 char* get_fs_type()() nothrow {
25378 return g_unix_mount_point_get_fs_type(&this);
25381 // Gets the mount path for a unix mount point.
25382 // RETURNS: a string containing the mount path.
25383 char* get_mount_path()() nothrow {
25384 return g_unix_mount_point_get_mount_path(&this);
25387 // VERSION: 2.32
25388 // Gets the options for the mount point.
25389 // RETURNS: a string containing the options.
25390 char* get_options()() nothrow {
25391 return g_unix_mount_point_get_options(&this);
25394 // Guesses whether a Unix mount point can be ejected.
25395 // RETURNS: %TRUE if @mount_point is deemed to be ejectable.
25396 int guess_can_eject()() nothrow {
25397 return g_unix_mount_point_guess_can_eject(&this);
25400 // Guesses the icon of a Unix mount point.
25401 // RETURNS: a #GIcon
25402 Icon* /*new*/ guess_icon()() nothrow {
25403 return g_unix_mount_point_guess_icon(&this);
25406 // Guesses the name of a Unix mount point.
25407 // The result is a translated string.
25409 // be freed with g_free()
25410 // RETURNS: A newly allocated string that must
25411 char* /*new*/ guess_name()() nothrow {
25412 return g_unix_mount_point_guess_name(&this);
25415 // Checks if a unix mount point is a loopback device.
25416 // RETURNS: %TRUE if the mount point is a loopback. %FALSE otherwise.
25417 int is_loopback()() nothrow {
25418 return g_unix_mount_point_is_loopback(&this);
25421 // Checks if a unix mount point is read only.
25422 // RETURNS: %TRUE if a mount point is read only.
25423 int is_readonly()() nothrow {
25424 return g_unix_mount_point_is_readonly(&this);
25427 // Checks if a unix mount point is mountable by the user.
25428 // RETURNS: %TRUE if the mount point is user mountable.
25429 int is_user_mountable()() nothrow {
25430 return g_unix_mount_point_is_user_mountable(&this);
25435 // #GUnixOutputStream implements #GOutputStream for writing to a UNIX
25436 // file descriptor, including asynchronous operations. (If the file
25437 // descriptor refers to a socket or pipe, this will use poll() to do
25438 // asynchronous I/O. If it refers to a regular file, it will fall back
25439 // to doing asynchronous I/O in another thread.)
25441 // Note that <filename>&lt;gio/gunixoutputstream.h&gt;</filename> belongs
25442 // to the UNIX-specific GIO interfaces, thus you have to use the
25443 // <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
25444 struct UnixOutputStream /* : OutputStream */ {
25445 mixin FileDescriptorBased.__interface__;
25446 mixin PollableOutputStream.__interface__;
25447 alias parent_instance this;
25448 alias parent_instance super_;
25449 alias parent_instance outputstream;
25450 OutputStream parent_instance;
25451 private UnixOutputStreamPrivate* priv;
25454 // Creates a new #GUnixOutputStream for the given @fd.
25456 // If @close_fd, is %TRUE, the file descriptor will be closed when
25457 // the output stream is destroyed.
25458 // RETURNS: a new #GOutputStream
25459 // <fd>: a UNIX file descriptor
25460 // <close_fd>: %TRUE to close the file descriptor when done
25461 static UnixOutputStream* /*new*/ new_()(int fd, int close_fd) nothrow {
25462 return g_unix_output_stream_new(fd, close_fd);
25464 static auto opCall()(int fd, int close_fd) {
25465 return g_unix_output_stream_new(fd, close_fd);
25468 // VERSION: 2.20
25469 // Returns whether the file descriptor of @stream will be
25470 // closed when the stream is closed.
25471 // RETURNS: %TRUE if the file descriptor is closed when done
25472 int get_close_fd()() nothrow {
25473 return g_unix_output_stream_get_close_fd(&this);
25476 // VERSION: 2.20
25477 // Return the UNIX file descriptor that the stream writes to.
25478 // RETURNS: The file descriptor of @stream
25479 int get_fd()() nothrow {
25480 return g_unix_output_stream_get_fd(&this);
25483 // VERSION: 2.20
25484 // Sets whether the file descriptor of @stream shall be closed
25485 // when the stream is closed.
25486 // <close_fd>: %TRUE to close the file descriptor when done
25487 void set_close_fd()(int close_fd) nothrow {
25488 g_unix_output_stream_set_close_fd(&this, close_fd);
25492 struct UnixOutputStreamClass {
25493 OutputStreamClass parent_class;
25494 extern (C) void function () nothrow _g_reserved1;
25495 extern (C) void function () nothrow _g_reserved2;
25496 extern (C) void function () nothrow _g_reserved3;
25497 extern (C) void function () nothrow _g_reserved4;
25498 extern (C) void function () nothrow _g_reserved5;
25501 struct UnixOutputStreamPrivate {
25505 // Support for UNIX-domain (also known as local) sockets.
25507 // UNIX domain sockets are generally visible in the filesystem.
25508 // However, some systems support abstract socket names which are not
25509 // visible in the filesystem and not affected by the filesystem
25510 // permissions, visibility, etc. Currently this is only supported
25511 // under Linux. If you attempt to use abstract sockets on other
25512 // systems, function calls may return %G_IO_ERROR_NOT_SUPPORTED
25513 // errors. You can use g_unix_socket_address_abstract_names_supported()
25514 // to see if abstract names are supported.
25516 // Note that <filename>&lt;gio/gunixsocketaddress.h&gt;</filename> belongs to
25517 // the UNIX-specific GIO interfaces, thus you have to use the
25518 // <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
25519 struct UnixSocketAddress /* : SocketAddress */ {
25520 mixin SocketConnectable.__interface__;
25521 alias parent_instance this;
25522 alias parent_instance super_;
25523 alias parent_instance socketaddress;
25524 SocketAddress parent_instance;
25525 private UnixSocketAddressPrivate* priv;
25528 // VERSION: 2.22
25529 // Creates a new #GUnixSocketAddress for @path.
25531 // To create abstract socket addresses, on systems that support that,
25532 // use g_unix_socket_address_new_abstract().
25533 // RETURNS: a new #GUnixSocketAddress
25534 // <path>: the socket path
25535 static UnixSocketAddress* /*new*/ new_(AT0)(AT0 /*char*/ path) nothrow {
25536 return g_unix_socket_address_new(toCString!(char*)(path));
25538 static auto opCall(AT0)(AT0 /*char*/ path) {
25539 return g_unix_socket_address_new(toCString!(char*)(path));
25542 // DEPRECATED constructor: new_abstract - Use g_unix_socket_address_new_with_type().
25543 // Creates a new %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED
25544 // #GUnixSocketAddress for @path.
25545 // RETURNS: a new #GUnixSocketAddress
25546 // <path>: the abstract name
25547 // <path_len>: the length of @path, or -1
25548 static UnixSocketAddress* /*new*/ new_abstract(AT0)(AT0 /*char*/ path, int path_len) nothrow {
25549 return g_unix_socket_address_new_abstract(toCString!(char*)(path), path_len);
25551 static auto opCall(AT0)(AT0 /*char*/ path, int path_len) {
25552 return g_unix_socket_address_new_abstract(toCString!(char*)(path), path_len);
25555 // VERSION: 2.26
25556 // Creates a new #GUnixSocketAddress of type @type with name @path.
25558 // If @type is %G_UNIX_SOCKET_ADDRESS_PATH, this is equivalent to
25559 // calling g_unix_socket_address_new().
25561 // If @path_type is %G_UNIX_SOCKET_ADDRESS_ABSTRACT, then @path_len
25562 // bytes of @path will be copied to the socket's path, and only those
25563 // bytes will be considered part of the name. (If @path_len is -1,
25564 // then @path is assumed to be NUL-terminated.) For example, if @path
25565 // was "test", then calling g_socket_address_get_native_size() on the
25566 // returned socket would return 7 (2 bytes of overhead, 1 byte for the
25567 // abstract-socket indicator byte, and 4 bytes for the name "test").
25569 // If @path_type is %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED, then
25570 // @path_len bytes of @path will be copied to the socket's path, the
25571 // rest of the path will be padded with 0 bytes, and the entire
25572 // zero-padded buffer will be considered the name. (As above, if
25573 // @path_len is -1, then @path is assumed to be NUL-terminated.) In
25574 // this case, g_socket_address_get_native_size() will always return
25575 // the full size of a <literal>struct sockaddr_un</literal>, although
25576 // g_unix_socket_address_get_path_len() will still return just the
25577 // length of @path.
25579 // %G_UNIX_SOCKET_ADDRESS_ABSTRACT is preferred over
25580 // %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED for new programs. Of course,
25581 // when connecting to a server created by another process, you must
25582 // use the appropriate type corresponding to how that process created
25583 // its listening socket.
25584 // RETURNS: a new #GUnixSocketAddress
25585 // <path>: the name
25586 // <path_len>: the length of @path, or -1
25587 // <type>: a #GUnixSocketAddressType
25588 static UnixSocketAddress* /*new*/ new_with_type(AT0)(AT0 /*char*/ path, int path_len, UnixSocketAddressType type) nothrow {
25589 return g_unix_socket_address_new_with_type(toCString!(char*)(path), path_len, type);
25591 static auto opCall(AT0)(AT0 /*char*/ path, int path_len, UnixSocketAddressType type) {
25592 return g_unix_socket_address_new_with_type(toCString!(char*)(path), path_len, type);
25595 // VERSION: 2.22
25596 // Checks if abstract unix domain socket names are supported.
25597 // RETURNS: %TRUE if supported, %FALSE otherwise
25598 static int abstract_names_supported()() nothrow {
25599 return g_unix_socket_address_abstract_names_supported();
25602 // VERSION: 2.26
25603 // Gets @address's type.
25604 // RETURNS: a #GUnixSocketAddressType
25605 UnixSocketAddressType get_address_type()() nothrow {
25606 return g_unix_socket_address_get_address_type(&this);
25609 // VERSION: 2.22
25610 // DEPRECATED method: get_is_abstract - Use g_unix_socket_address_get_address_type()
25611 // Tests if @address is abstract.
25612 // RETURNS: %TRUE if the address is abstract, %FALSE otherwise
25613 int get_is_abstract()() nothrow {
25614 return g_unix_socket_address_get_is_abstract(&this);
25617 // VERSION: 2.22
25618 // Gets @address's path, or for abstract sockets the "name".
25620 // Guaranteed to be zero-terminated, but an abstract socket
25621 // may contain embedded zeros, and thus you should use
25622 // g_unix_socket_address_get_path_len() to get the true length
25623 // of this string.
25624 // RETURNS: the path for @address
25625 char* get_path()() nothrow {
25626 return g_unix_socket_address_get_path(&this);
25629 // VERSION: 2.22
25630 // Gets the length of @address's path.
25632 // For details, see g_unix_socket_address_get_path().
25633 // RETURNS: the length of the path
25634 size_t get_path_len()() nothrow {
25635 return g_unix_socket_address_get_path_len(&this);
25639 struct UnixSocketAddressClass {
25640 SocketAddressClass parent_class;
25643 struct UnixSocketAddressPrivate {
25647 // The type of name used by a #GUnixSocketAddress.
25648 // %G_UNIX_SOCKET_ADDRESS_PATH indicates a traditional unix domain
25649 // socket bound to a filesystem path. %G_UNIX_SOCKET_ADDRESS_ANONYMOUS
25650 // indicates a socket not bound to any name (eg, a client-side socket,
25651 // or a socket created with socketpair()).
25653 // For abstract sockets, there are two incompatible ways of naming
25654 // them; the man pages suggest using the entire <literal>struct
25655 // sockaddr_un</literal> as the name, padding the unused parts of the
25656 // %sun_path field with zeroes; this corresponds to
25657 // %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED. However, many programs
25658 // instead just use a portion of %sun_path, and pass an appropriate
25659 // smaller length to bind() or connect(). This is
25660 // %G_UNIX_SOCKET_ADDRESS_ABSTRACT.
25661 enum UnixSocketAddressType /* Version 2.26 */ {
25662 INVALID = 0,
25663 ANONYMOUS = 1,
25664 PATH = 2,
25665 ABSTRACT = 3,
25666 ABSTRACT_PADDED = 4
25668 enum VFS_EXTENSION_POINT_NAME = "gio-vfs";
25669 enum VOLUME_IDENTIFIER_KIND_CLASS = "class";
25670 enum VOLUME_IDENTIFIER_KIND_HAL_UDI = "hal-udi";
25671 enum VOLUME_IDENTIFIER_KIND_LABEL = "label";
25672 enum VOLUME_IDENTIFIER_KIND_NFS_MOUNT = "nfs-mount";
25673 enum VOLUME_IDENTIFIER_KIND_UNIX_DEVICE = "unix-device";
25674 enum VOLUME_IDENTIFIER_KIND_UUID = "uuid";
25675 enum VOLUME_MONITOR_EXTENSION_POINT_NAME = "gio-volume-monitor";
25676 // Entry point for using GIO functionality.
25677 struct Vfs /* : GObject.Object */ {
25678 alias parent_instance this;
25679 alias parent_instance super_;
25680 alias parent_instance object;
25681 GObject2.Object parent_instance;
25684 // Gets the default #GVfs for the system.
25685 // RETURNS: a #GVfs.
25686 static Vfs* get_default()() nothrow {
25687 return g_vfs_get_default();
25690 // Gets the local #GVfs for the system.
25691 // RETURNS: a #GVfs.
25692 static Vfs* get_local()() nothrow {
25693 return g_vfs_get_local();
25696 // Gets a #GFile for @path.
25698 // Free the returned object with g_object_unref().
25699 // RETURNS: a #GFile.
25700 // <path>: a string containing a VFS path.
25701 File* /*new*/ get_file_for_path(AT0)(AT0 /*char*/ path) nothrow {
25702 return g_vfs_get_file_for_path(&this, toCString!(char*)(path));
25705 // Gets a #GFile for @uri.
25707 // This operation never fails, but the returned object
25708 // might not support any I/O operation if the URI
25709 // is malformed or if the URI scheme is not supported.
25711 // Free the returned object with g_object_unref().
25712 // RETURNS: a #GFile.
25713 // <uri>: a string containing a URI
25714 File* /*new*/ get_file_for_uri(AT0)(AT0 /*char*/ uri) nothrow {
25715 return g_vfs_get_file_for_uri(&this, toCString!(char*)(uri));
25718 // Gets a list of URI schemes supported by @vfs.
25720 // The returned array belongs to GIO and must
25721 // not be freed or modified.
25722 // RETURNS: a %NULL-terminated array of strings.
25723 char** get_supported_uri_schemes()() nothrow {
25724 return g_vfs_get_supported_uri_schemes(&this);
25727 // Checks if the VFS is active.
25728 // RETURNS: %TRUE if construction of the @vfs was successful and it is now active.
25729 int is_active()() nothrow {
25730 return g_vfs_is_active(&this);
25733 // This operation never fails, but the returned object might
25734 // not support any I/O operations if the @parse_name cannot
25735 // be parsed by the #GVfs module.
25737 // Free the returned object with g_object_unref().
25738 // RETURNS: a #GFile for the given @parse_name.
25739 // <parse_name>: a string to be parsed by the VFS module.
25740 File* /*new*/ parse_name(AT0)(AT0 /*char*/ parse_name) nothrow {
25741 return g_vfs_parse_name(&this, toCString!(char*)(parse_name));
25745 struct VfsClass {
25746 GObject2.ObjectClass parent_class;
25747 // RETURNS: %TRUE if construction of the @vfs was successful and it is now active.
25748 extern (C) int function (Vfs* vfs) nothrow is_active;
25750 // RETURNS: a #GFile.
25751 // <path>: a string containing a VFS path.
25752 extern (C) File* /*new*/ function (Vfs* vfs, char* path) nothrow get_file_for_path;
25754 // RETURNS: a #GFile.
25755 // <uri>: a string containing a URI
25756 extern (C) File* /*new*/ function (Vfs* vfs, char* uri) nothrow get_file_for_uri;
25757 // RETURNS: a %NULL-terminated array of strings.
25758 extern (C) char** function (Vfs* vfs) nothrow get_supported_uri_schemes;
25760 // RETURNS: a #GFile for the given @parse_name.
25761 // <parse_name>: a string to be parsed by the VFS module.
25762 extern (C) File* /*new*/ function (Vfs* vfs, char* parse_name) nothrow parse_name;
25763 extern (C) void function (Vfs* vfs, char* filename, ulong device, FileAttributeMatcher* attribute_matcher, FileInfo* info, Cancellable* cancellable, void** extra_data, GLib2.DestroyNotify* free_extra_data) nothrow local_file_add_info;
25764 extern (C) void function (Vfs* vfs, FileAttributeInfoList* list) nothrow add_writable_namespaces;
25765 extern (C) int function (Vfs* vfs, char* filename, FileInfo* info, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error=null) nothrow local_file_set_attributes;
25766 extern (C) void function (Vfs* vfs, char* filename) nothrow local_file_removed;
25767 extern (C) void function (Vfs* vfs, char* source, char* dest) nothrow local_file_moved;
25768 extern (C) void function () nothrow _g_reserved1;
25769 extern (C) void function () nothrow _g_reserved2;
25770 extern (C) void function () nothrow _g_reserved3;
25771 extern (C) void function () nothrow _g_reserved4;
25772 extern (C) void function () nothrow _g_reserved5;
25773 extern (C) void function () nothrow _g_reserved6;
25774 extern (C) void function () nothrow _g_reserved7;
25778 // The #GVolume interface represents user-visible objects that can be
25779 // mounted. Note, when porting from GnomeVFS, #GVolume is the moral
25780 // equivalent of #GnomeVFSDrive.
25782 // Mounting a #GVolume instance is an asynchronous operation. For more
25783 // information about asynchronous operations, see #GAsyncResult and
25784 // #GSimpleAsyncResult. To mount a #GVolume, first call
25785 // g_volume_mount() with (at least) the #GVolume instance, optionally
25786 // a #GMountOperation object and a #GAsyncReadyCallback.
25788 // Typically, one will only want to pass %NULL for the
25789 // #GMountOperation if automounting all volumes when a desktop session
25790 // starts since it's not desirable to put up a lot of dialogs asking
25791 // for credentials.
25793 // The callback will be fired when the operation has resolved (either
25794 // with success or failure), and a #GAsyncReady structure will be
25795 // passed to the callback. That callback should then call
25796 // g_volume_mount_finish() with the #GVolume instance and the
25797 // #GAsyncReady data to see if the operation was completed
25798 // successfully. If an @error is present when g_volume_mount_finish()
25799 // is called, then it will be filled with any error information.
25801 // <para id="volume-identifier">
25802 // It is sometimes necessary to directly access the underlying
25803 // operating system object behind a volume (e.g. for passing a volume
25804 // to an application via the commandline). For this purpose, GIO
25805 // allows to obtain an 'identifier' for the volume. There can be
25806 // different kinds of identifiers, such as Hal UDIs, filesystem labels,
25807 // traditional Unix devices (e.g. <filename>/dev/sda2</filename>),
25808 // uuids. GIO uses predefind strings as names for the different kinds
25809 // of identifiers: #G_VOLUME_IDENTIFIER_KIND_HAL_UDI,
25810 // #G_VOLUME_IDENTIFIER_KIND_LABEL, etc. Use g_volume_get_identifier()
25811 // to obtain an identifier for a volume.
25812 // </para>
25814 // Note that #G_VOLUME_IDENTIFIER_KIND_HAL_UDI will only be available
25815 // when the gvfs hal volume monitor is in use. Other volume monitors
25816 // will generally be able to provide the #G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE
25817 // identifier, which can be used to obtain a hal device by means of
25818 // libhal_manager_find_device_string_match().
25819 struct Volume /* Interface */ {
25820 mixin template __interface__() {
25821 // Checks if a volume can be ejected.
25822 // RETURNS: %TRUE if the @volume can be ejected. %FALSE otherwise.
25823 int can_eject()() nothrow {
25824 return g_volume_can_eject(cast(Volume*)&this);
25827 // Checks if a volume can be mounted.
25828 // RETURNS: %TRUE if the @volume can be mounted. %FALSE otherwise.
25829 int can_mount()() nothrow {
25830 return g_volume_can_mount(cast(Volume*)&this);
25833 // DEPRECATED (v2.22) method: eject - Use g_volume_eject_with_operation() instead.
25834 // Ejects a volume. This is an asynchronous operation, and is
25835 // finished by calling g_volume_eject_finish() with the @volume
25836 // and #GAsyncResult returned in the @callback.
25837 // <flags>: flags affecting the unmount if required for eject
25838 // <cancellable>: optional #GCancellable object, %NULL to ignore.
25839 // <callback>: a #GAsyncReadyCallback, or %NULL.
25840 // <user_data>: user data that gets passed to @callback
25841 void eject(AT0, AT1)(MountUnmountFlags flags, AT0 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT1 /*void*/ user_data) nothrow {
25842 g_volume_eject(cast(Volume*)&this, flags, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
25845 // DEPRECATED (v2.22) method: eject_finish - Use g_volume_eject_with_operation_finish() instead.
25846 // Finishes ejecting a volume. If any errors occurred during the operation,
25847 // @error will be set to contain the errors and %FALSE will be returned.
25848 // RETURNS: %TRUE, %FALSE if operation failed.
25849 // <result>: a #GAsyncResult.
25850 int eject_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
25851 return g_volume_eject_finish(cast(Volume*)&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
25854 // VERSION: 2.22
25855 // Ejects a volume. This is an asynchronous operation, and is
25856 // finished by calling g_volume_eject_with_operation_finish() with the @volume
25857 // and #GAsyncResult data returned in the @callback.
25858 // <flags>: flags affecting the unmount if required for eject
25859 // <mount_operation>: a #GMountOperation or %NULL to avoid user interaction.
25860 // <cancellable>: optional #GCancellable object, %NULL to ignore.
25861 // <callback>: a #GAsyncReadyCallback, or %NULL.
25862 // <user_data>: user data passed to @callback.
25863 void eject_with_operation(AT0, AT1, AT2)(MountUnmountFlags flags, AT0 /*MountOperation*/ mount_operation, AT1 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT2 /*void*/ user_data) nothrow {
25864 g_volume_eject_with_operation(cast(Volume*)&this, flags, UpCast!(MountOperation*)(mount_operation), UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
25867 // VERSION: 2.22
25868 // Finishes ejecting a volume. If any errors occurred during the operation,
25869 // @error will be set to contain the errors and %FALSE will be returned.
25870 // RETURNS: %TRUE if the volume was successfully ejected. %FALSE otherwise.
25871 // <result>: a #GAsyncResult.
25872 int eject_with_operation_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
25873 return g_volume_eject_with_operation_finish(cast(Volume*)&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
25876 // Gets the kinds of <link linkend="volume-identifier">identifiers</link>
25877 // that @volume has. Use g_volume_get_identifier() to obtain
25878 // the identifiers themselves.
25880 // of strings containing kinds of identifiers. Use g_strfreev() to free.
25881 // RETURNS: a %NULL-terminated array
25882 char** /*new*/ enumerate_identifiers()() nothrow {
25883 return g_volume_enumerate_identifiers(cast(Volume*)&this);
25886 // VERSION: 2.18
25887 // Gets the activation root for a #GVolume if it is known ahead of
25888 // mount time. Returns %NULL otherwise. If not %NULL and if @volume
25889 // is mounted, then the result of g_mount_get_root() on the
25890 // #GMount object obtained from g_volume_get_mount() will always
25891 // either be equal or a prefix of what this function returns. In
25892 // other words, in code
25894 // <programlisting>
25895 // GMount *mount;
25896 // GFile *mount_root
25897 // GFile *volume_activation_root;
25899 // mount = g_volume_get_mount (volume); /&ast; mounted, so never NULL &ast;/
25900 // mount_root = g_mount_get_root (mount);
25901 // volume_activation_root = g_volume_get_activation_root(volume); /&ast; assume not NULL &ast;/
25902 // </programlisting>
25904 // then the expression
25906 // <programlisting>
25907 // (g_file_has_prefix (volume_activation_root, mount_root) ||
25908 // </programlisting>
25910 // will always be %TRUE.
25912 // Activation roots are typically used in #GVolumeMonitor
25913 // implementations to find the underlying mount to shadow, see
25914 // g_mount_is_shadowed() for more details.
25916 // g_object_unref() to free.
25917 // RETURNS: the activation root of @volume or %NULL. Use
25918 File* /*new*/ get_activation_root()() nothrow {
25919 return g_volume_get_activation_root(cast(Volume*)&this);
25922 // Gets the drive for the @volume.
25924 // The returned object should be unreffed with g_object_unref()
25925 // when no longer needed.
25926 // RETURNS: a #GDrive or %NULL if @volume is not associated with a drive.
25927 Drive* /*new*/ get_drive()() nothrow {
25928 return g_volume_get_drive(cast(Volume*)&this);
25931 // Gets the icon for @volume.
25933 // The returned object should be unreffed with g_object_unref()
25934 // when no longer needed.
25935 // RETURNS: a #GIcon.
25936 Icon* /*new*/ get_icon()() nothrow {
25937 return g_volume_get_icon(cast(Volume*)&this);
25940 // Gets the identifier of the given kind for @volume.
25941 // See the <link linkend="volume-identifier">introduction</link>
25942 // for more information about volume identifiers.
25944 // requested identfier, or %NULL if the #GVolume
25945 // doesn't have this kind of identifier
25946 // RETURNS: a newly allocated string containing the
25947 // <kind>: the kind of identifier to return
25948 char* /*new*/ get_identifier(AT0)(AT0 /*char*/ kind) nothrow {
25949 return g_volume_get_identifier(cast(Volume*)&this, toCString!(char*)(kind));
25952 // Gets the mount for the @volume.
25954 // The returned object should be unreffed with g_object_unref()
25955 // when no longer needed.
25956 // RETURNS: a #GMount or %NULL if @volume isn't mounted.
25957 Mount* /*new*/ get_mount()() nothrow {
25958 return g_volume_get_mount(cast(Volume*)&this);
25961 // Gets the name of @volume.
25963 // be freed with g_free() when no longer needed.
25964 // RETURNS: the name for the given @volume. The returned string should
25965 char* /*new*/ get_name()() nothrow {
25966 return g_volume_get_name(cast(Volume*)&this);
25969 // VERSION: 2.32
25970 // Gets the sort key for @volume, if any.
25971 // RETURNS: Sorting key for @volume or %NULL if no such key is available.
25972 char* get_sort_key()() nothrow {
25973 return g_volume_get_sort_key(cast(Volume*)&this);
25976 // Gets the UUID for the @volume. The reference is typically based on
25977 // the file system UUID for the volume in question and should be
25978 // considered an opaque string. Returns %NULL if there is no UUID
25979 // available.
25981 // The returned string should be freed with g_free()
25982 // when no longer needed.
25983 // RETURNS: the UUID for @volume or %NULL if no UUID can be computed.
25984 char* /*new*/ get_uuid()() nothrow {
25985 return g_volume_get_uuid(cast(Volume*)&this);
25988 // Mounts a volume. This is an asynchronous operation, and is
25989 // finished by calling g_volume_mount_finish() with the @volume
25990 // and #GAsyncResult returned in the @callback.
25991 // <flags>: flags affecting the operation
25992 // <mount_operation>: a #GMountOperation or %NULL to avoid user interaction.
25993 // <cancellable>: optional #GCancellable object, %NULL to ignore.
25994 // <callback>: a #GAsyncReadyCallback, or %NULL.
25995 // <user_data>: user data that gets passed to @callback
25996 void mount(AT0, AT1, AT2)(MountMountFlags flags, AT0 /*MountOperation*/ mount_operation, AT1 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT2 /*void*/ user_data) nothrow {
25997 g_volume_mount(cast(Volume*)&this, flags, UpCast!(MountOperation*)(mount_operation), UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
26000 // Finishes mounting a volume. If any errors occurred during the operation,
26001 // @error will be set to contain the errors and %FALSE will be returned.
26003 // If the mount operation succeeded, g_volume_get_mount() on @volume
26004 // is guaranteed to return the mount right after calling this
26005 // function; there's no need to listen for the 'mount-added' signal on
26006 // #GVolumeMonitor.
26007 // RETURNS: %TRUE, %FALSE if operation failed.
26008 // <result>: a #GAsyncResult
26009 int mount_finish(AT0, AT1)(AT0 /*AsyncResult*/ result, AT1 /*GLib2.Error**/ error=null) nothrow {
26010 return g_volume_mount_finish(cast(Volume*)&this, UpCast!(AsyncResult*)(result), UpCast!(GLib2.Error**)(error));
26013 // Returns whether the volume should be automatically mounted.
26014 // RETURNS: %TRUE if the volume should be automatically mounted.
26015 int should_automount()() nothrow {
26016 return g_volume_should_automount(cast(Volume*)&this);
26018 // Emitted when the volume has been changed.
26019 extern (C) alias static void function (Volume* this_, void* user_data=null) nothrow signal_changed;
26021 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
26022 return super_.signal_connect!name(cb, data, cf);
26025 ulong signal_connect(string name:"changed", CB/*:signal_changed*/)
26026 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
26027 if (is(typeof(cb)==signal_changed)||_ttmm!(CB, signal_changed)()) {
26028 return signal_connect_data!()(&this, cast(char*)"changed",
26029 cast(GObject2.Callback)cb, data, null, cf);
26032 // This signal is emitted when the #GVolume have been removed. If
26033 // the recipient is holding references to the object they should
26034 // release them so the object can be finalized.
26035 extern (C) alias static void function (Volume* this_, void* user_data=null) nothrow signal_removed;
26036 ulong signal_connect(string name:"removed", CB/*:signal_removed*/)
26037 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
26038 if (is(typeof(cb)==signal_removed)||_ttmm!(CB, signal_removed)()) {
26039 return signal_connect_data!()(&this, cast(char*)"removed",
26040 cast(GObject2.Callback)cb, data, null, cf);
26043 mixin __interface__;
26046 // Interface for implementing operations for mountable volumes.
26047 struct VolumeIface {
26048 GObject2.TypeInterface g_iface;
26049 extern (C) void function (Volume* volume) nothrow changed;
26050 extern (C) void function (Volume* volume) nothrow removed;
26051 // RETURNS: the name for the given @volume. The returned string should
26052 extern (C) char* /*new*/ function (Volume* volume) nothrow get_name;
26053 // RETURNS: a #GIcon.
26054 extern (C) Icon* /*new*/ function (Volume* volume) nothrow get_icon;
26055 // RETURNS: the UUID for @volume or %NULL if no UUID can be computed.
26056 extern (C) char* /*new*/ function (Volume* volume) nothrow get_uuid;
26057 // RETURNS: a #GDrive or %NULL if @volume is not associated with a drive.
26058 extern (C) Drive* /*new*/ function (Volume* volume) nothrow get_drive;
26059 // RETURNS: a #GMount or %NULL if @volume isn't mounted.
26060 extern (C) Mount* /*new*/ function (Volume* volume) nothrow get_mount;
26061 // RETURNS: %TRUE if the @volume can be mounted. %FALSE otherwise.
26062 extern (C) int function (Volume* volume) nothrow can_mount;
26063 // RETURNS: %TRUE if the @volume can be ejected. %FALSE otherwise.
26064 extern (C) int function (Volume* volume) nothrow can_eject;
26066 // <flags>: flags affecting the operation
26067 // <mount_operation>: a #GMountOperation or %NULL to avoid user interaction.
26068 // <cancellable>: optional #GCancellable object, %NULL to ignore.
26069 // <callback>: a #GAsyncReadyCallback, or %NULL.
26070 // <user_data>: user data that gets passed to @callback
26071 extern (C) void function (Volume* volume, MountMountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow mount_fn;
26073 // RETURNS: %TRUE, %FALSE if operation failed.
26074 // <result>: a #GAsyncResult
26075 extern (C) int function (Volume* volume, AsyncResult* result, GLib2.Error** error=null) nothrow mount_finish;
26077 // <flags>: flags affecting the unmount if required for eject
26078 // <cancellable>: optional #GCancellable object, %NULL to ignore.
26079 // <callback>: a #GAsyncReadyCallback, or %NULL.
26080 // <user_data>: user data that gets passed to @callback
26081 extern (C) void function (Volume* volume, MountUnmountFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow eject;
26083 // RETURNS: %TRUE, %FALSE if operation failed.
26084 // <result>: a #GAsyncResult.
26085 extern (C) int function (Volume* volume, AsyncResult* result, GLib2.Error** error=null) nothrow eject_finish;
26087 // RETURNS: a newly allocated string containing the
26088 // <kind>: the kind of identifier to return
26089 extern (C) char* /*new*/ function (Volume* volume, char* kind) nothrow get_identifier;
26090 // RETURNS: a %NULL-terminated array
26091 extern (C) char** /*new*/ function (Volume* volume) nothrow enumerate_identifiers;
26092 // RETURNS: %TRUE if the volume should be automatically mounted.
26093 extern (C) int function (Volume* volume) nothrow should_automount;
26094 // RETURNS: the activation root of @volume or %NULL. Use
26095 extern (C) File* /*new*/ function (Volume* volume) nothrow get_activation_root;
26097 // <flags>: flags affecting the unmount if required for eject
26098 // <mount_operation>: a #GMountOperation or %NULL to avoid user interaction.
26099 // <cancellable>: optional #GCancellable object, %NULL to ignore.
26100 // <callback>: a #GAsyncReadyCallback, or %NULL.
26101 // <user_data>: user data passed to @callback.
26102 extern (C) void function (Volume* volume, MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow eject_with_operation;
26104 // RETURNS: %TRUE if the volume was successfully ejected. %FALSE otherwise.
26105 // <result>: a #GAsyncResult.
26106 extern (C) int function (Volume* volume, AsyncResult* result, GLib2.Error** error=null) nothrow eject_with_operation_finish;
26107 // RETURNS: Sorting key for @volume or %NULL if no such key is available.
26108 extern (C) char* function (Volume* volume) nothrow get_sort_key;
26112 // #GVolumeMonitor is for listing the user interesting devices and volumes
26113 // on the computer. In other words, what a file selector or file manager
26114 // would show in a sidebar.
26116 // #GVolumeMonitor is not <link
26117 // linkend="g-main-context-push-thread-default">thread-default-context
26118 // aware</link>, and so should not be used other than from the main
26119 // thread, with no thread-default-context active.
26120 struct VolumeMonitor /* : GObject.Object */ {
26121 alias parent_instance this;
26122 alias parent_instance super_;
26123 alias parent_instance object;
26124 GObject2.Object parent_instance;
26125 private void* priv;
26128 // DEPRECATED (v2.20) function: adopt_orphan_mount - Instead of using this function, #GVolumeMonitor
26129 // This function should be called by any #GVolumeMonitor
26130 // implementation when a new #GMount object is created that is not
26131 // associated with a #GVolume object. It must be called just before
26132 // emitting the @mount_added signal.
26134 // If the return value is not %NULL, the caller must associate the
26135 // returned #GVolume object with the #GMount. This involves returning
26136 // it in its g_mount_get_volume() implementation. The caller must
26137 // also listen for the "removed" signal on the returned object
26138 // and give up its reference when handling that signal
26140 // Similary, if implementing g_volume_monitor_adopt_orphan_mount(),
26141 // the implementor must take a reference to @mount and return it in
26142 // its g_volume_get_mount() implemented. Also, the implementor must
26143 // listen for the "unmounted" signal on @mount and give up its
26144 // reference upon handling that signal.
26146 // There are two main use cases for this function.
26148 // One is when implementing a user space file system driver that reads
26149 // blocks of a block device that is already represented by the native
26150 // volume monitor (for example a CD Audio file system driver). Such
26151 // a driver will generate its own #GMount object that needs to be
26152 // associated with the #GVolume object that represents the volume.
26154 // The other is for implementing a #GVolumeMonitor whose sole purpose
26155 // is to return #GVolume objects representing entries in the users
26156 // "favorite servers" list or similar.
26158 // if no wants to adopt the #GMount.
26160 // implementations should instead create shadow mounts with the URI of
26161 // the mount they intend to adopt. See the proxy volume monitor in
26162 // gvfs for an example of this. Also see g_mount_is_shadowed(),
26163 // g_mount_shadow() and g_mount_unshadow() functions.
26164 // RETURNS: the #GVolume object that is the parent for @mount or %NULL
26165 // <mount>: a #GMount object to find a parent for
26166 static Volume* /*new*/ adopt_orphan_mount(AT0)(AT0 /*Mount*/ mount) nothrow {
26167 return g_volume_monitor_adopt_orphan_mount(UpCast!(Mount*)(mount));
26170 // Gets the volume monitor used by gio.
26172 // g_object_unref() when done with it.
26173 // RETURNS: a reference to the #GVolumeMonitor used by gio. Call
26174 static VolumeMonitor* /*new*/ get()() nothrow {
26175 return g_volume_monitor_get();
26178 // Gets a list of drives connected to the system.
26180 // The returned list should be freed with g_list_free(), after
26181 // its elements have been unreffed with g_object_unref().
26182 // RETURNS: a #GList of connected #GDrive objects.
26183 GLib2.List* /*new*/ get_connected_drives()() nothrow {
26184 return g_volume_monitor_get_connected_drives(&this);
26187 // Finds a #GMount object by its UUID (see g_mount_get_uuid())
26189 // Free the returned object with g_object_unref().
26190 // RETURNS: a #GMount or %NULL if no such mount is available.
26191 // <uuid>: the UUID to look for
26192 Mount* /*new*/ get_mount_for_uuid(AT0)(AT0 /*char*/ uuid) nothrow {
26193 return g_volume_monitor_get_mount_for_uuid(&this, toCString!(char*)(uuid));
26196 // Gets a list of the mounts on the system.
26198 // The returned list should be freed with g_list_free(), after
26199 // its elements have been unreffed with g_object_unref().
26200 // RETURNS: a #GList of #GMount objects.
26201 GLib2.List* /*new*/ get_mounts()() nothrow {
26202 return g_volume_monitor_get_mounts(&this);
26205 // Finds a #GVolume object by its UUID (see g_volume_get_uuid())
26207 // Free the returned object with g_object_unref().
26208 // RETURNS: a #GVolume or %NULL if no such volume is available.
26209 // <uuid>: the UUID to look for
26210 Volume* /*new*/ get_volume_for_uuid(AT0)(AT0 /*char*/ uuid) nothrow {
26211 return g_volume_monitor_get_volume_for_uuid(&this, toCString!(char*)(uuid));
26214 // Gets a list of the volumes on the system.
26216 // The returned list should be freed with g_list_free(), after
26217 // its elements have been unreffed with g_object_unref().
26218 // RETURNS: a #GList of #GVolume objects.
26219 GLib2.List* /*new*/ get_volumes()() nothrow {
26220 return g_volume_monitor_get_volumes(&this);
26223 // Emitted when a drive changes.
26224 // <drive>: the drive that changed
26225 extern (C) alias static void function (VolumeMonitor* this_, Drive* drive, void* user_data=null) nothrow signal_drive_changed;
26227 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
26228 return super_.signal_connect!name(cb, data, cf);
26231 ulong signal_connect(string name:"drive-changed", CB/*:signal_drive_changed*/)
26232 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
26233 if (is(typeof(cb)==signal_drive_changed)||_ttmm!(CB, signal_drive_changed)()) {
26234 return signal_connect_data!()(&this, cast(char*)"drive-changed",
26235 cast(GObject2.Callback)cb, data, null, cf);
26238 // Emitted when a drive is connected to the system.
26239 // <drive>: a #GDrive that was connected.
26240 extern (C) alias static void function (VolumeMonitor* this_, Drive* drive, void* user_data=null) nothrow signal_drive_connected;
26241 ulong signal_connect(string name:"drive-connected", CB/*:signal_drive_connected*/)
26242 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
26243 if (is(typeof(cb)==signal_drive_connected)||_ttmm!(CB, signal_drive_connected)()) {
26244 return signal_connect_data!()(&this, cast(char*)"drive-connected",
26245 cast(GObject2.Callback)cb, data, null, cf);
26248 // Emitted when a drive is disconnected from the system.
26249 // <drive>: a #GDrive that was disconnected.
26250 extern (C) alias static void function (VolumeMonitor* this_, Drive* drive, void* user_data=null) nothrow signal_drive_disconnected;
26251 ulong signal_connect(string name:"drive-disconnected", CB/*:signal_drive_disconnected*/)
26252 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
26253 if (is(typeof(cb)==signal_drive_disconnected)||_ttmm!(CB, signal_drive_disconnected)()) {
26254 return signal_connect_data!()(&this, cast(char*)"drive-disconnected",
26255 cast(GObject2.Callback)cb, data, null, cf);
26258 // VERSION: 2.18
26259 // Emitted when the eject button is pressed on @drive.
26260 // <drive>: the drive where the eject button was pressed
26261 extern (C) alias static void function (VolumeMonitor* this_, Drive* drive, void* user_data=null) nothrow signal_drive_eject_button;
26262 ulong signal_connect(string name:"drive-eject-button", CB/*:signal_drive_eject_button*/)
26263 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
26264 if (is(typeof(cb)==signal_drive_eject_button)||_ttmm!(CB, signal_drive_eject_button)()) {
26265 return signal_connect_data!()(&this, cast(char*)"drive-eject-button",
26266 cast(GObject2.Callback)cb, data, null, cf);
26269 // VERSION: 2.22
26270 // Emitted when the stop button is pressed on @drive.
26271 // <drive>: the drive where the stop button was pressed
26272 extern (C) alias static void function (VolumeMonitor* this_, Drive* drive, void* user_data=null) nothrow signal_drive_stop_button;
26273 ulong signal_connect(string name:"drive-stop-button", CB/*:signal_drive_stop_button*/)
26274 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
26275 if (is(typeof(cb)==signal_drive_stop_button)||_ttmm!(CB, signal_drive_stop_button)()) {
26276 return signal_connect_data!()(&this, cast(char*)"drive-stop-button",
26277 cast(GObject2.Callback)cb, data, null, cf);
26280 // Emitted when a mount is added.
26281 // <mount>: a #GMount that was added.
26282 extern (C) alias static void function (VolumeMonitor* this_, Mount* mount, void* user_data=null) nothrow signal_mount_added;
26283 ulong signal_connect(string name:"mount-added", CB/*:signal_mount_added*/)
26284 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
26285 if (is(typeof(cb)==signal_mount_added)||_ttmm!(CB, signal_mount_added)()) {
26286 return signal_connect_data!()(&this, cast(char*)"mount-added",
26287 cast(GObject2.Callback)cb, data, null, cf);
26290 // Emitted when a mount changes.
26291 // <mount>: a #GMount that changed.
26292 extern (C) alias static void function (VolumeMonitor* this_, Mount* mount, void* user_data=null) nothrow signal_mount_changed;
26293 ulong signal_connect(string name:"mount-changed", CB/*:signal_mount_changed*/)
26294 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
26295 if (is(typeof(cb)==signal_mount_changed)||_ttmm!(CB, signal_mount_changed)()) {
26296 return signal_connect_data!()(&this, cast(char*)"mount-changed",
26297 cast(GObject2.Callback)cb, data, null, cf);
26300 // Emitted when a mount is about to be removed.
26301 // <mount>: a #GMount that is being unmounted.
26302 extern (C) alias static void function (VolumeMonitor* this_, Mount* mount, void* user_data=null) nothrow signal_mount_pre_unmount;
26303 ulong signal_connect(string name:"mount-pre-unmount", CB/*:signal_mount_pre_unmount*/)
26304 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
26305 if (is(typeof(cb)==signal_mount_pre_unmount)||_ttmm!(CB, signal_mount_pre_unmount)()) {
26306 return signal_connect_data!()(&this, cast(char*)"mount-pre-unmount",
26307 cast(GObject2.Callback)cb, data, null, cf);
26310 // Emitted when a mount is removed.
26311 // <mount>: a #GMount that was removed.
26312 extern (C) alias static void function (VolumeMonitor* this_, Mount* mount, void* user_data=null) nothrow signal_mount_removed;
26313 ulong signal_connect(string name:"mount-removed", CB/*:signal_mount_removed*/)
26314 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
26315 if (is(typeof(cb)==signal_mount_removed)||_ttmm!(CB, signal_mount_removed)()) {
26316 return signal_connect_data!()(&this, cast(char*)"mount-removed",
26317 cast(GObject2.Callback)cb, data, null, cf);
26320 // Emitted when a mountable volume is added to the system.
26321 // <volume>: a #GVolume that was added.
26322 extern (C) alias static void function (VolumeMonitor* this_, Volume* volume, void* user_data=null) nothrow signal_volume_added;
26323 ulong signal_connect(string name:"volume-added", CB/*:signal_volume_added*/)
26324 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
26325 if (is(typeof(cb)==signal_volume_added)||_ttmm!(CB, signal_volume_added)()) {
26326 return signal_connect_data!()(&this, cast(char*)"volume-added",
26327 cast(GObject2.Callback)cb, data, null, cf);
26330 // Emitted when mountable volume is changed.
26331 // <volume>: a #GVolume that changed.
26332 extern (C) alias static void function (VolumeMonitor* this_, Volume* volume, void* user_data=null) nothrow signal_volume_changed;
26333 ulong signal_connect(string name:"volume-changed", CB/*:signal_volume_changed*/)
26334 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
26335 if (is(typeof(cb)==signal_volume_changed)||_ttmm!(CB, signal_volume_changed)()) {
26336 return signal_connect_data!()(&this, cast(char*)"volume-changed",
26337 cast(GObject2.Callback)cb, data, null, cf);
26340 // Emitted when a mountable volume is removed from the system.
26341 // <volume>: a #GVolume that was removed.
26342 extern (C) alias static void function (VolumeMonitor* this_, Volume* volume, void* user_data=null) nothrow signal_volume_removed;
26343 ulong signal_connect(string name:"volume-removed", CB/*:signal_volume_removed*/)
26344 (CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0)
26345 if (is(typeof(cb)==signal_volume_removed)||_ttmm!(CB, signal_volume_removed)()) {
26346 return signal_connect_data!()(&this, cast(char*)"volume-removed",
26347 cast(GObject2.Callback)cb, data, null, cf);
26351 struct VolumeMonitorClass {
26352 GObject2.ObjectClass parent_class;
26353 extern (C) void function (VolumeMonitor* volume_monitor, Volume* volume) nothrow volume_added;
26354 extern (C) void function (VolumeMonitor* volume_monitor, Volume* volume) nothrow volume_removed;
26355 extern (C) void function (VolumeMonitor* volume_monitor, Volume* volume) nothrow volume_changed;
26356 extern (C) void function (VolumeMonitor* volume_monitor, Mount* mount) nothrow mount_added;
26357 extern (C) void function (VolumeMonitor* volume_monitor, Mount* mount) nothrow mount_removed;
26358 extern (C) void function (VolumeMonitor* volume_monitor, Mount* mount) nothrow mount_pre_unmount;
26359 extern (C) void function (VolumeMonitor* volume_monitor, Mount* mount) nothrow mount_changed;
26360 extern (C) void function (VolumeMonitor* volume_monitor, Drive* drive) nothrow drive_connected;
26361 extern (C) void function (VolumeMonitor* volume_monitor, Drive* drive) nothrow drive_disconnected;
26362 extern (C) void function (VolumeMonitor* volume_monitor, Drive* drive) nothrow drive_changed;
26363 extern (C) int function () nothrow is_supported;
26364 // RETURNS: a #GList of connected #GDrive objects.
26365 extern (C) GLib2.List* /*new*/ function (VolumeMonitor* volume_monitor) nothrow get_connected_drives;
26366 // RETURNS: a #GList of #GVolume objects.
26367 extern (C) GLib2.List* /*new*/ function (VolumeMonitor* volume_monitor) nothrow get_volumes;
26368 // RETURNS: a #GList of #GMount objects.
26369 extern (C) GLib2.List* /*new*/ function (VolumeMonitor* volume_monitor) nothrow get_mounts;
26371 // RETURNS: a #GVolume or %NULL if no such volume is available.
26372 // <uuid>: the UUID to look for
26373 extern (C) Volume* /*new*/ function (VolumeMonitor* volume_monitor, char* uuid) nothrow get_volume_for_uuid;
26375 // RETURNS: a #GMount or %NULL if no such mount is available.
26376 // <uuid>: the UUID to look for
26377 extern (C) Mount* /*new*/ function (VolumeMonitor* volume_monitor, char* uuid) nothrow get_mount_for_uuid;
26378 // Unintrospectable functionp: adopt_orphan_mount() / ()
26379 extern (C) Volume* function (Mount* mount, VolumeMonitor* volume_monitor) nothrow adopt_orphan_mount;
26380 extern (C) void function (VolumeMonitor* volume_monitor, Drive* drive) nothrow drive_eject_button;
26381 extern (C) void function (VolumeMonitor* volume_monitor, Drive* drive) nothrow drive_stop_button;
26382 extern (C) void function () nothrow _g_reserved1;
26383 extern (C) void function () nothrow _g_reserved2;
26384 extern (C) void function () nothrow _g_reserved3;
26385 extern (C) void function () nothrow _g_reserved4;
26386 extern (C) void function () nothrow _g_reserved5;
26387 extern (C) void function () nothrow _g_reserved6;
26390 // Zlib decompression
26391 struct ZlibCompressor /* : GObject.Object */ {
26392 mixin Converter.__interface__;
26393 alias method_parent this;
26394 alias method_parent super_;
26395 alias method_parent object;
26396 GObject2.Object method_parent;
26399 // VERSION: 2.24
26400 // Creates a new #GZlibCompressor.
26401 // RETURNS: a new #GZlibCompressor
26402 // <format>: The format to use for the compressed data
26403 // <level>: compression level (0-9), -1 for default
26404 static ZlibCompressor* /*new*/ new_()(ZlibCompressorFormat format, int level) nothrow {
26405 return g_zlib_compressor_new(format, level);
26407 static auto opCall()(ZlibCompressorFormat format, int level) {
26408 return g_zlib_compressor_new(format, level);
26411 // VERSION: 2.26
26412 // Returns the #GZlibCompressor:file-info property.
26413 // RETURNS: a #GFileInfo, or %NULL
26414 FileInfo* get_file_info()() nothrow {
26415 return g_zlib_compressor_get_file_info(&this);
26418 // VERSION: 2.26
26419 // Sets @file_info in @compressor. If non-%NULL, and @compressor's
26420 // #GZlibCompressor:format property is %G_ZLIB_COMPRESSOR_FORMAT_GZIP,
26421 // it will be used to set the file name and modification time in
26422 // the GZIP header of the compressed data.
26424 // Note: it is an error to call this function while a compression is in
26425 // progress; it may only be called immediately after creation of @compressor,
26426 // or after resetting it with g_converter_reset().
26427 // <file_info>: a #GFileInfo
26428 void set_file_info(AT0)(AT0 /*FileInfo*/ file_info=null) nothrow {
26429 g_zlib_compressor_set_file_info(&this, UpCast!(FileInfo*)(file_info));
26433 struct ZlibCompressorClass {
26434 GObject2.ObjectClass parent_class;
26438 // Used to select the type of data format to use for #GZlibDecompressor
26439 // and #GZlibCompressor.
26440 enum ZlibCompressorFormat /* Version 2.24 */ {
26441 ZLIB = 0,
26442 GZIP = 1,
26443 RAW = 2
26445 // Zlib decompression
26446 struct ZlibDecompressor /* : GObject.Object */ {
26447 mixin Converter.__interface__;
26448 alias method_parent this;
26449 alias method_parent super_;
26450 alias method_parent object;
26451 GObject2.Object method_parent;
26454 // VERSION: 2.24
26455 // Creates a new #GZlibDecompressor.
26456 // RETURNS: a new #GZlibDecompressor
26457 // <format>: The format to use for the compressed data
26458 static ZlibDecompressor* /*new*/ new_()(ZlibCompressorFormat format) nothrow {
26459 return g_zlib_decompressor_new(format);
26461 static auto opCall()(ZlibCompressorFormat format) {
26462 return g_zlib_decompressor_new(format);
26465 // VERSION: 2.26
26466 // Retrieves the #GFileInfo constructed from the GZIP header data
26467 // of compressed data processed by @compressor, or %NULL if @decompressor's
26468 // #GZlibDecompressor:format property is not %G_ZLIB_COMPRESSOR_FORMAT_GZIP,
26469 // or the header data was not fully processed yet, or it not present in the
26470 // data stream at all.
26471 // RETURNS: a #GFileInfo, or %NULL
26472 FileInfo* get_file_info()() nothrow {
26473 return g_zlib_decompressor_get_file_info(&this);
26477 struct ZlibDecompressorClass {
26478 GObject2.ObjectClass parent_class;
26482 // MOVED TO: AppInfo.create_from_commandline
26483 // Creates a new #GAppInfo from the given information.
26484 // RETURNS: new #GAppInfo for given command.
26485 // <commandline>: the commandline to use
26486 // <application_name>: the application name, or %NULL to use @commandline
26487 // <flags>: flags that can specify details of the created #GAppInfo
26488 static AppInfo* /*new*/ app_info_create_from_commandline(AT0, AT1, AT2)(AT0 /*char*/ commandline, AT1 /*char*/ application_name, AppInfoCreateFlags flags, AT2 /*GLib2.Error**/ error=null) nothrow {
26489 return g_app_info_create_from_commandline(toCString!(char*)(commandline), toCString!(char*)(application_name), flags, UpCast!(GLib2.Error**)(error));
26493 // MOVED TO: AppInfo.get_all
26494 // Gets a list of all of the applications currently registered
26495 // on this system.
26497 // For desktop files, this includes applications that have
26498 // <literal>NoDisplay=true</literal> set or are excluded from
26499 // display by means of <literal>OnlyShowIn</literal> or
26500 // <literal>NotShowIn</literal>. See g_app_info_should_show().
26501 // The returned list does not include applications which have
26502 // the <literal>Hidden</literal> key set.
26503 // RETURNS: a newly allocated #GList of references to #GAppInfo<!---->s.
26504 static GLib2.List* /*new*/ app_info_get_all()() nothrow {
26505 return g_app_info_get_all();
26509 // MOVED TO: AppInfo.get_all_for_type
26510 // Gets a list of all #GAppInfos for a given content type,
26511 // including the recommended and fallback #GAppInfos. See
26512 // g_app_info_get_recommended_for_type() and
26513 // g_app_info_get_fallback_for_type().
26515 // for given @content_type or %NULL on error.
26516 // RETURNS: #GList of #GAppInfos
26517 // <content_type>: the content type to find a #GAppInfo for
26518 static GLib2.List* /*new*/ app_info_get_all_for_type(AT0)(AT0 /*char*/ content_type) nothrow {
26519 return g_app_info_get_all_for_type(toCString!(char*)(content_type));
26523 // MOVED TO: AppInfo.get_default_for_type
26524 // Gets the default #GAppInfo for a given content type.
26526 // %NULL on error.
26527 // RETURNS: #GAppInfo for given @content_type or
26528 // <content_type>: the content type to find a #GAppInfo for
26529 // <must_support_uris>: if %TRUE, the #GAppInfo is expected to support URIs
26530 static AppInfo* /*new*/ app_info_get_default_for_type(AT0)(AT0 /*char*/ content_type, int must_support_uris) nothrow {
26531 return g_app_info_get_default_for_type(toCString!(char*)(content_type), must_support_uris);
26535 // MOVED TO: AppInfo.get_default_for_uri_scheme
26536 // Gets the default application for handling URIs with
26537 // the given URI scheme. A URI scheme is the initial part
26538 // of the URI, up to but not including the ':', e.g. "http",
26539 // "ftp" or "sip".
26540 // RETURNS: #GAppInfo for given @uri_scheme or %NULL on error.
26541 // <uri_scheme>: a string containing a URI scheme.
26542 static AppInfo* /*new*/ app_info_get_default_for_uri_scheme(AT0)(AT0 /*char*/ uri_scheme) nothrow {
26543 return g_app_info_get_default_for_uri_scheme(toCString!(char*)(uri_scheme));
26547 // VERSION: 2.28
26548 // MOVED TO: AppInfo.get_fallback_for_type
26549 // Gets a list of fallback #GAppInfos for a given content type, i.e.
26550 // those applications which claim to support the given content type
26551 // by MIME type subclassing and not directly.
26553 // for given @content_type or %NULL on error.
26554 // RETURNS: #GList of #GAppInfos
26555 // <content_type>: the content type to find a #GAppInfo for
26556 static GLib2.List* /*new*/ app_info_get_fallback_for_type(AT0)(AT0 /*char*/ content_type) nothrow {
26557 return g_app_info_get_fallback_for_type(toCString!(char*)(content_type));
26561 // VERSION: 2.28
26562 // MOVED TO: AppInfo.get_recommended_for_type
26563 // Gets a list of recommended #GAppInfos for a given content type, i.e.
26564 // those applications which claim to support the given content type exactly,
26565 // and not by MIME type subclassing.
26566 // Note that the first application of the list is the last used one, i.e.
26567 // the last one for which g_app_info_set_as_last_used_for_type() has been
26568 // called.
26570 // for given @content_type or %NULL on error.
26571 // RETURNS: #GList of #GAppInfos
26572 // <content_type>: the content type to find a #GAppInfo for
26573 static GLib2.List* /*new*/ app_info_get_recommended_for_type(AT0)(AT0 /*char*/ content_type) nothrow {
26574 return g_app_info_get_recommended_for_type(toCString!(char*)(content_type));
26578 // MOVED TO: AppInfo.launch_default_for_uri
26579 // Utility function that launches the default application
26580 // registered to handle the specified uri. Synchronous I/O
26581 // is done on the uri to detect the type of the file if
26582 // required.
26583 // RETURNS: %TRUE on success, %FALSE on error.
26584 // <uri>: the uri to show
26585 // <launch_context>: an optional #GAppLaunchContext.
26586 static int app_info_launch_default_for_uri(AT0, AT1, AT2)(AT0 /*char*/ uri, AT1 /*AppLaunchContext*/ launch_context, AT2 /*GLib2.Error**/ error=null) nothrow {
26587 return g_app_info_launch_default_for_uri(toCString!(char*)(uri), UpCast!(AppLaunchContext*)(launch_context), UpCast!(GLib2.Error**)(error));
26591 // VERSION: 2.20
26592 // MOVED TO: AppInfo.reset_type_associations
26593 // Removes all changes to the type associations done by
26594 // g_app_info_set_as_default_for_type(),
26595 // g_app_info_set_as_default_for_extension(),
26596 // g_app_info_add_supports_type() or
26597 // g_app_info_remove_supports_type().
26598 // <content_type>: a content type
26599 static void app_info_reset_type_associations(AT0)(AT0 /*char*/ content_type) nothrow {
26600 g_app_info_reset_type_associations(toCString!(char*)(content_type));
26604 // VERSION: 2.22
26605 // MOVED TO: AsyncInitable.newv_async
26606 // Helper function for constructing #GAsyncInitable object. This is
26607 // similar to g_object_newv() but also initializes the object asynchronously.
26609 // When the initialization is finished, @callback will be called. You can
26610 // then call g_async_initable_new_finish() to get the new object and check
26611 // for any errors.
26612 // <object_type>: a #GType supporting #GAsyncInitable.
26613 // <n_parameters>: the number of parameters in @parameters
26614 // <parameters>: the parameters to use to construct the object
26615 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the operation.
26616 // <cancellable>: optional #GCancellable object, %NULL to ignore.
26617 // <callback>: a #GAsyncReadyCallback to call when the initialization is finished
26618 // <user_data>: the data to pass to callback function
26619 static void async_initable_newv_async(AT0, AT1, AT2)(Type object_type, uint n_parameters, AT0 /*GObject2.Parameter*/ parameters, int io_priority, AT1 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT2 /*void*/ user_data) nothrow {
26620 g_async_initable_newv_async(object_type, n_parameters, UpCast!(GObject2.Parameter*)(parameters), io_priority, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
26624 // VERSION: 2.26
26625 // Asynchronously connects to the message bus specified by @bus_type.
26627 // When the operation is finished, @callback will be invoked. You can
26628 // then call g_bus_get_finish() to get the result of the operation.
26630 // This is a asynchronous failable function. See g_bus_get_sync() for
26631 // the synchronous version.
26632 // <bus_type>: A #GBusType.
26633 // <cancellable>: A #GCancellable or %NULL.
26634 // <callback>: A #GAsyncReadyCallback to call when the request is satisfied.
26635 // <user_data>: The data to pass to @callback.
26636 static void bus_get(AT0, AT1)(BusType bus_type, AT0 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT1 /*void*/ user_data) nothrow {
26637 g_bus_get(bus_type, UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
26641 // VERSION: 2.26
26642 // Finishes an operation started with g_bus_get().
26644 // The returned object is a singleton, that is, shared with other
26645 // callers of g_bus_get() and g_bus_get_sync() for @bus_type. In the
26646 // event that you need a private message bus connection, use
26647 // g_dbus_address_get_for_bus_sync() and
26648 // g_dbus_connection_new_for_address().
26650 // Note that the returned #GDBusConnection object will (usually) have
26651 // the #GDBusConnection:exit-on-close property set to %TRUE.
26652 // RETURNS: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
26653 // <res>: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_bus_get().
26654 static DBusConnection* /*new*/ bus_get_finish(AT0, AT1)(AT0 /*AsyncResult*/ res, AT1 /*GLib2.Error**/ error=null) nothrow {
26655 return g_bus_get_finish(UpCast!(AsyncResult*)(res), UpCast!(GLib2.Error**)(error));
26659 // VERSION: 2.26
26660 // Synchronously connects to the message bus specified by @bus_type.
26661 // Note that the returned object may shared with other callers,
26662 // e.g. if two separate parts of a process calls this function with
26663 // the same @bus_type, they will share the same object.
26665 // This is a synchronous failable function. See g_bus_get() and
26666 // g_bus_get_finish() for the asynchronous version.
26668 // The returned object is a singleton, that is, shared with other
26669 // callers of g_bus_get() and g_bus_get_sync() for @bus_type. In the
26670 // event that you need a private message bus connection, use
26671 // g_dbus_address_get_for_bus_sync() and
26672 // g_dbus_connection_new_for_address().
26674 // Note that the returned #GDBusConnection object will (usually) have
26675 // the #GDBusConnection:exit-on-close property set to %TRUE.
26676 // RETURNS: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
26677 // <bus_type>: A #GBusType.
26678 // <cancellable>: A #GCancellable or %NULL.
26679 static DBusConnection* /*new*/ bus_get_sync(AT0, AT1)(BusType bus_type, AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
26680 return g_bus_get_sync(bus_type, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
26684 // Unintrospectable function: bus_own_name() / g_bus_own_name()
26685 // VERSION: 2.26
26686 // Starts acquiring @name on the bus specified by @bus_type and calls
26687 // @name_acquired_handler and @name_lost_handler when the name is
26688 // acquired respectively lost. Callbacks will be invoked in the <link
26689 // linkend="g-main-context-push-thread-default">thread-default main
26690 // loop</link> of the thread you are calling this function from.
26692 // You are guaranteed that one of the @name_acquired_handler and @name_lost_handler
26693 // callbacks will be invoked after calling this function - there are three
26694 // possible cases:
26695 // <itemizedlist>
26696 // <listitem><para>
26697 // @name_lost_handler with a %NULL connection (if a connection to the bus can't be made).
26698 // </para></listitem>
26699 // <listitem><para>
26700 // @bus_acquired_handler then @name_lost_handler (if the name can't be obtained)
26701 // </para></listitem>
26702 // <listitem><para>
26703 // @bus_acquired_handler then @name_acquired_handler (if the name was obtained).
26704 // </para></listitem>
26705 // </itemizedlist>
26706 // When you are done owning the name, just call g_bus_unown_name()
26707 // with the owner id this function returns.
26709 // If the name is acquired or lost (for example another application
26710 // could acquire the name if you allow replacement or the application
26711 // currently owning the name exits), the handlers are also invoked. If the
26712 // #GDBusConnection that is used for attempting to own the name
26713 // closes, then @name_lost_handler is invoked since it is no
26714 // longer possible for other processes to access the process.
26716 // You cannot use g_bus_own_name() several times for the same name (unless
26717 // interleaved with calls to g_bus_unown_name()) - only the first call
26718 // will work.
26720 // Another guarantee is that invocations of @name_acquired_handler
26721 // and @name_lost_handler are guaranteed to alternate; that
26722 // is, if @name_acquired_handler is invoked then you are
26723 // guaranteed that the next time one of the handlers is invoked, it
26724 // will be @name_lost_handler. The reverse is also true.
26726 // If you plan on exporting objects (using e.g.
26727 // g_dbus_connection_register_object()), note that it is generally too late
26728 // to export the objects in @name_acquired_handler. Instead, you can do this
26729 // in @bus_acquired_handler since you are guaranteed that this will run
26730 // before @name is requested from the bus.
26732 // This behavior makes it very simple to write applications that wants
26733 // to own names and export objects, see <xref linkend="gdbus-owning-names"/>.
26734 // Simply register objects to be exported in @bus_acquired_handler and
26735 // unregister the objects (if any) in @name_lost_handler.
26737 // g_bus_unown_name() to stop owning the name.
26738 // RETURNS: An identifier (never 0) that an be used with
26739 // <bus_type>: The type of bus to own a name on.
26740 // <name>: The well-known name to own.
26741 // <flags>: A set of flags from the #GBusNameOwnerFlags enumeration.
26742 // <bus_acquired_handler>: Handler to invoke when connected to the bus of type @bus_type or %NULL.
26743 // <name_acquired_handler>: Handler to invoke when @name is acquired or %NULL.
26744 // <name_lost_handler>: Handler to invoke when @name is lost or %NULL.
26745 // <user_data>: User data to pass to handlers.
26746 // <user_data_free_func>: Function for freeing @user_data or %NULL.
26747 static uint bus_own_name(AT0, AT1)(BusType bus_type, AT0 /*char*/ name, BusNameOwnerFlags flags, BusAcquiredCallback bus_acquired_handler, BusNameAcquiredCallback name_acquired_handler, BusNameLostCallback name_lost_handler, AT1 /*void*/ user_data, GLib2.DestroyNotify user_data_free_func) nothrow {
26748 return g_bus_own_name(bus_type, toCString!(char*)(name), flags, bus_acquired_handler, name_acquired_handler, name_lost_handler, UpCast!(void*)(user_data), user_data_free_func);
26752 // Unintrospectable function: bus_own_name_on_connection() / g_bus_own_name_on_connection()
26753 // VERSION: 2.26
26754 // Like g_bus_own_name() but takes a #GDBusConnection instead of a
26755 // #GBusType.
26757 // g_bus_unown_name() to stop owning the name.
26758 // RETURNS: An identifier (never 0) that an be used with
26759 // <connection>: A #GDBusConnection.
26760 // <name>: The well-known name to own.
26761 // <flags>: A set of flags from the #GBusNameOwnerFlags enumeration.
26762 // <name_acquired_handler>: Handler to invoke when @name is acquired or %NULL.
26763 // <name_lost_handler>: Handler to invoke when @name is lost or %NULL.
26764 // <user_data>: User data to pass to handlers.
26765 // <user_data_free_func>: Function for freeing @user_data or %NULL.
26766 static uint bus_own_name_on_connection(AT0, AT1, AT2)(AT0 /*DBusConnection*/ connection, AT1 /*char*/ name, BusNameOwnerFlags flags, BusNameAcquiredCallback name_acquired_handler, BusNameLostCallback name_lost_handler, AT2 /*void*/ user_data, GLib2.DestroyNotify user_data_free_func) nothrow {
26767 return g_bus_own_name_on_connection(UpCast!(DBusConnection*)(connection), toCString!(char*)(name), flags, name_acquired_handler, name_lost_handler, UpCast!(void*)(user_data), user_data_free_func);
26771 // VERSION: 2.26
26772 // Version of g_bus_own_name_on_connection() using closures instead of callbacks for
26773 // easier binding in other languages.
26775 // g_bus_unown_name() to stop owning the name.
26776 // RETURNS: An identifier (never 0) that an be used with
26777 // <connection>: A #GDBusConnection.
26778 // <name>: The well-known name to own.
26779 // <flags>: A set of flags from the #GBusNameOwnerFlags enumeration.
26780 // <name_acquired_closure>: #GClosure to invoke when @name is acquired or %NULL.
26781 // <name_lost_closure>: #GClosure to invoke when @name is lost or %NULL.
26782 static uint bus_own_name_on_connection_with_closures(AT0, AT1, AT2, AT3)(AT0 /*DBusConnection*/ connection, AT1 /*char*/ name, BusNameOwnerFlags flags, AT2 /*GObject2.Closure*/ name_acquired_closure=null, AT3 /*GObject2.Closure*/ name_lost_closure=null) nothrow {
26783 return g_bus_own_name_on_connection_with_closures(UpCast!(DBusConnection*)(connection), toCString!(char*)(name), flags, UpCast!(GObject2.Closure*)(name_acquired_closure), UpCast!(GObject2.Closure*)(name_lost_closure));
26787 // VERSION: 2.26
26788 // Version of g_bus_own_name() using closures instead of callbacks for
26789 // easier binding in other languages.
26791 // g_bus_unown_name() to stop owning the name.
26792 // RETURNS: An identifier (never 0) that an be used with
26793 // <bus_type>: The type of bus to own a name on.
26794 // <name>: The well-known name to own.
26795 // <flags>: A set of flags from the #GBusNameOwnerFlags enumeration.
26796 // <bus_acquired_closure>: #GClosure to invoke when connected to the bus of type @bus_type or %NULL.
26797 // <name_acquired_closure>: #GClosure to invoke when @name is acquired or %NULL.
26798 // <name_lost_closure>: #GClosure to invoke when @name is lost or %NULL.
26799 static uint bus_own_name_with_closures(AT0, AT1, AT2, AT3)(BusType bus_type, AT0 /*char*/ name, BusNameOwnerFlags flags, AT1 /*GObject2.Closure*/ bus_acquired_closure=null, AT2 /*GObject2.Closure*/ name_acquired_closure=null, AT3 /*GObject2.Closure*/ name_lost_closure=null) nothrow {
26800 return g_bus_own_name_with_closures(bus_type, toCString!(char*)(name), flags, UpCast!(GObject2.Closure*)(bus_acquired_closure), UpCast!(GObject2.Closure*)(name_acquired_closure), UpCast!(GObject2.Closure*)(name_lost_closure));
26804 // VERSION: 2.26
26805 // Stops owning a name.
26806 // <owner_id>: An identifier obtained from g_bus_own_name()
26807 static void bus_unown_name()(uint owner_id) nothrow {
26808 g_bus_unown_name(owner_id);
26812 // VERSION: 2.26
26813 // Stops watching a name.
26814 // <watcher_id>: An identifier obtained from g_bus_watch_name()
26815 static void bus_unwatch_name()(uint watcher_id) nothrow {
26816 g_bus_unwatch_name(watcher_id);
26820 // Unintrospectable function: bus_watch_name() / g_bus_watch_name()
26821 // VERSION: 2.26
26822 // Starts watching @name on the bus specified by @bus_type and calls
26823 // @name_appeared_handler and @name_vanished_handler when the name is
26824 // known to have a owner respectively known to lose its
26825 // owner. Callbacks will be invoked in the <link
26826 // linkend="g-main-context-push-thread-default">thread-default main
26827 // loop</link> of the thread you are calling this function from.
26829 // You are guaranteed that one of the handlers will be invoked after
26830 // calling this function. When you are done watching the name, just
26831 // call g_bus_unwatch_name() with the watcher id this function
26832 // returns.
26834 // If the name vanishes or appears (for example the application owning
26835 // the name could restart), the handlers are also invoked. If the
26836 // #GDBusConnection that is used for watching the name disconnects, then
26837 // @name_vanished_handler is invoked since it is no longer
26838 // possible to access the name.
26840 // Another guarantee is that invocations of @name_appeared_handler
26841 // and @name_vanished_handler are guaranteed to alternate; that
26842 // is, if @name_appeared_handler is invoked then you are
26843 // guaranteed that the next time one of the handlers is invoked, it
26844 // will be @name_vanished_handler. The reverse is also true.
26846 // This behavior makes it very simple to write applications that wants
26847 // to take action when a certain name exists, see <xref
26848 // linkend="gdbus-watching-names"/>. Basically, the application
26849 // should create object proxies in @name_appeared_handler and destroy
26850 // them again (if any) in @name_vanished_handler.
26852 // g_bus_unwatch_name() to stop watching the name.
26853 // RETURNS: An identifier (never 0) that an be used with
26854 // <bus_type>: The type of bus to watch a name on.
26855 // <name>: The name (well-known or unique) to watch.
26856 // <flags>: Flags from the #GBusNameWatcherFlags enumeration.
26857 // <name_appeared_handler>: Handler to invoke when @name is known to exist or %NULL.
26858 // <name_vanished_handler>: Handler to invoke when @name is known to not exist or %NULL.
26859 // <user_data>: User data to pass to handlers.
26860 // <user_data_free_func>: Function for freeing @user_data or %NULL.
26861 static uint bus_watch_name(AT0, AT1)(BusType bus_type, AT0 /*char*/ name, BusNameWatcherFlags flags, BusNameAppearedCallback name_appeared_handler, BusNameVanishedCallback name_vanished_handler, AT1 /*void*/ user_data, GLib2.DestroyNotify user_data_free_func) nothrow {
26862 return g_bus_watch_name(bus_type, toCString!(char*)(name), flags, name_appeared_handler, name_vanished_handler, UpCast!(void*)(user_data), user_data_free_func);
26866 // Unintrospectable function: bus_watch_name_on_connection() / g_bus_watch_name_on_connection()
26867 // VERSION: 2.26
26868 // Like g_bus_watch_name() but takes a #GDBusConnection instead of a
26869 // #GBusType.
26871 // g_bus_unwatch_name() to stop watching the name.
26872 // RETURNS: An identifier (never 0) that an be used with
26873 // <connection>: A #GDBusConnection.
26874 // <name>: The name (well-known or unique) to watch.
26875 // <flags>: Flags from the #GBusNameWatcherFlags enumeration.
26876 // <name_appeared_handler>: Handler to invoke when @name is known to exist or %NULL.
26877 // <name_vanished_handler>: Handler to invoke when @name is known to not exist or %NULL.
26878 // <user_data>: User data to pass to handlers.
26879 // <user_data_free_func>: Function for freeing @user_data or %NULL.
26880 static uint bus_watch_name_on_connection(AT0, AT1, AT2)(AT0 /*DBusConnection*/ connection, AT1 /*char*/ name, BusNameWatcherFlags flags, BusNameAppearedCallback name_appeared_handler, BusNameVanishedCallback name_vanished_handler, AT2 /*void*/ user_data, GLib2.DestroyNotify user_data_free_func) nothrow {
26881 return g_bus_watch_name_on_connection(UpCast!(DBusConnection*)(connection), toCString!(char*)(name), flags, name_appeared_handler, name_vanished_handler, UpCast!(void*)(user_data), user_data_free_func);
26885 // VERSION: 2.26
26886 // Version of g_bus_watch_name_on_connection() using closures instead of callbacks for
26887 // easier binding in other languages.
26889 // g_bus_unwatch_name() to stop watching the name.
26890 // RETURNS: An identifier (never 0) that an be used with
26891 // <connection>: A #GDBusConnection.
26892 // <name>: The name (well-known or unique) to watch.
26893 // <flags>: Flags from the #GBusNameWatcherFlags enumeration.
26894 // <name_appeared_closure>: #GClosure to invoke when @name is known to exist or %NULL.
26895 // <name_vanished_closure>: #GClosure to invoke when @name is known to not exist or %NULL.
26896 static uint bus_watch_name_on_connection_with_closures(AT0, AT1, AT2, AT3)(AT0 /*DBusConnection*/ connection, AT1 /*char*/ name, BusNameWatcherFlags flags, AT2 /*GObject2.Closure*/ name_appeared_closure=null, AT3 /*GObject2.Closure*/ name_vanished_closure=null) nothrow {
26897 return g_bus_watch_name_on_connection_with_closures(UpCast!(DBusConnection*)(connection), toCString!(char*)(name), flags, UpCast!(GObject2.Closure*)(name_appeared_closure), UpCast!(GObject2.Closure*)(name_vanished_closure));
26901 // VERSION: 2.26
26902 // Version of g_bus_watch_name() using closures instead of callbacks for
26903 // easier binding in other languages.
26905 // g_bus_unwatch_name() to stop watching the name.
26906 // RETURNS: An identifier (never 0) that an be used with
26907 // <bus_type>: The type of bus to watch a name on.
26908 // <name>: The name (well-known or unique) to watch.
26909 // <flags>: Flags from the #GBusNameWatcherFlags enumeration.
26910 // <name_appeared_closure>: #GClosure to invoke when @name is known to exist or %NULL.
26911 // <name_vanished_closure>: #GClosure to invoke when @name is known to not exist or %NULL.
26912 static uint bus_watch_name_with_closures(AT0, AT1, AT2)(BusType bus_type, AT0 /*char*/ name, BusNameWatcherFlags flags, AT1 /*GObject2.Closure*/ name_appeared_closure=null, AT2 /*GObject2.Closure*/ name_vanished_closure=null) nothrow {
26913 return g_bus_watch_name_with_closures(bus_type, toCString!(char*)(name), flags, UpCast!(GObject2.Closure*)(name_appeared_closure), UpCast!(GObject2.Closure*)(name_vanished_closure));
26917 // Checks if a content type can be executable. Note that for instance
26918 // things like text files can be executables (i.e. scripts and batch files).
26920 // can be executable, %FALSE otherwise.
26921 // RETURNS: %TRUE if the file type corresponds to a type that
26922 // <type>: a content type string
26923 static int content_type_can_be_executable(AT0)(AT0 /*char*/ type) nothrow {
26924 return g_content_type_can_be_executable(toCString!(char*)(type));
26928 // Compares two content types for equality.
26930 // %FALSE otherwise.
26931 // RETURNS: %TRUE if the two strings are identical or equivalent,
26932 // <type1>: a content type string
26933 // <type2>: a content type string
26934 static int content_type_equals(AT0, AT1)(AT0 /*char*/ type1, AT1 /*char*/ type2) nothrow {
26935 return g_content_type_equals(toCString!(char*)(type1), toCString!(char*)(type2));
26939 // VERSION: 2.18
26940 // Tries to find a content type based on the mime type name.
26942 // or %NULL. Free with g_free()
26943 // RETURNS: Newly allocated string with content type
26944 // <mime_type>: a mime type string
26945 static char* /*new*/ content_type_from_mime_type(AT0)(AT0 /*char*/ mime_type) nothrow {
26946 return g_content_type_from_mime_type(toCString!(char*)(mime_type));
26950 // Gets the human readable description of the content type.
26952 // returned string with g_free()
26953 // RETURNS: a short description of the content type @type. Free the
26954 // <type>: a content type string
26955 static char* /*new*/ content_type_get_description(AT0)(AT0 /*char*/ type) nothrow {
26956 return g_content_type_get_description(toCString!(char*)(type));
26960 // Gets the icon for a content type.
26962 // object with g_object_unref()
26963 // RETURNS: #GIcon corresponding to the content type. Free the returned
26964 // <type>: a content type string
26965 static Icon* /*new*/ content_type_get_icon(AT0)(AT0 /*char*/ type) nothrow {
26966 return g_content_type_get_icon(toCString!(char*)(type));
26970 // Gets the mime type for the content type, if one is registered.
26972 // or %NULL if unknown.
26973 // RETURNS: the registered mime type for the given @type,
26974 // <type>: a content type string
26975 static char* /*new*/ content_type_get_mime_type(AT0)(AT0 /*char*/ type) nothrow {
26976 return g_content_type_get_mime_type(toCString!(char*)(type));
26980 // Guesses the content type based on example data. If the function is
26981 // uncertain, @result_uncertain will be set to %TRUE. Either @filename
26982 // or @data may be %NULL, in which case the guess will be based solely
26983 // on the other argument.
26985 // given data. Free with g_free()
26986 // RETURNS: a string indicating a guessed content type for the
26987 // <filename>: a string, or %NULL
26988 // <data>: a stream of data, or %NULL
26989 // <data_size>: the size of @data
26990 // <result_uncertain>: return location for the certainty of the result, or %NULL
26991 static char* /*new*/ content_type_guess(AT0, AT1)(AT0 /*char*/ filename, AT1 /*ubyte*/ data, size_t data_size, /*out*/ int* result_uncertain=null) nothrow {
26992 return g_content_type_guess(toCString!(char*)(filename), UpCast!(ubyte*)(data), data_size, result_uncertain);
26996 // VERSION: 2.18
26997 // Tries to guess the type of the tree with root @root, by
26998 // looking at the files it contains. The result is an array
26999 // of content types, with the best guess coming first.
27001 // The types returned all have the form x-content/foo, e.g.
27002 // x-content/audio-cdda (for audio CDs) or x-content/image-dcf
27003 // (for a camera memory card). See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
27004 // specification for more on x-content types.
27006 // This function is useful in the implementation of
27007 // g_mount_guess_content_type().
27009 // array of zero or more content types. Free with g_strfreev()
27010 // RETURNS: an %NULL-terminated
27011 // <root>: the root of the tree to guess a type for
27012 static char** /*new*/ content_type_guess_for_tree(AT0)(AT0 /*File*/ root) nothrow {
27013 return g_content_type_guess_for_tree(UpCast!(File*)(root));
27017 // Determines if @type is a subset of @supertype.
27019 // %FALSE otherwise.
27020 // RETURNS: %TRUE if @type is a kind of @supertype,
27021 // <type>: a content type string
27022 // <supertype>: a content type string
27023 static int content_type_is_a(AT0, AT1)(AT0 /*char*/ type, AT1 /*char*/ supertype) nothrow {
27024 return g_content_type_is_a(toCString!(char*)(type), toCString!(char*)(supertype));
27028 // Checks if the content type is the generic "unknown" type.
27029 // On UNIX this is the "application/octet-stream" mimetype,
27030 // while on win32 it is "*".
27031 // RETURNS: %TRUE if the type is the unknown type.
27032 // <type>: a content type string
27033 static int content_type_is_unknown(AT0)(AT0 /*char*/ type) nothrow {
27034 return g_content_type_is_unknown(toCString!(char*)(type));
27038 // Gets a list of strings containing all the registered content types
27039 // known to the system. The list and its data should be freed using
27040 // <programlisting>
27041 // g_list_free_full (list, g_free);
27042 // </programlisting>
27043 // RETURNS: #GList of the registered content types
27044 static GLib2.List* /*new*/ content_types_get_registered()() nothrow {
27045 return g_content_types_get_registered();
27049 // VERSION: 2.26
27050 // Synchronously looks up the D-Bus address for the well-known message
27051 // bus instance specified by @bus_type. This may involve using various
27052 // platform specific mechanisms.
27053 // RETURNS: A valid D-Bus address string for @bus_type or %NULL if @error is set.
27054 // <bus_type>: A #GBusType.
27055 // <cancellable>: A #GCancellable or %NULL.
27056 static char* /*new*/ dbus_address_get_for_bus_sync(AT0, AT1)(BusType bus_type, AT0 /*Cancellable*/ cancellable, AT1 /*GLib2.Error**/ error=null) nothrow {
27057 return g_dbus_address_get_for_bus_sync(bus_type, UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
27061 // VERSION: 2.26
27062 // Asynchronously connects to an endpoint specified by @address and
27063 // sets up the connection so it is in a state to run the client-side
27064 // of the D-Bus authentication conversation.
27066 // When the operation is finished, @callback will be invoked. You can
27067 // then call g_dbus_address_get_stream_finish() to get the result of
27068 // the operation.
27070 // This is an asynchronous failable function. See
27071 // g_dbus_address_get_stream_sync() for the synchronous version.
27072 // <address>: A valid D-Bus address.
27073 // <cancellable>: A #GCancellable or %NULL.
27074 // <callback>: A #GAsyncReadyCallback to call when the request is satisfied.
27075 // <user_data>: Data to pass to @callback.
27076 static void dbus_address_get_stream(AT0, AT1, AT2)(AT0 /*char*/ address, AT1 /*Cancellable*/ cancellable, AsyncReadyCallback callback, AT2 /*void*/ user_data) nothrow {
27077 g_dbus_address_get_stream(toCString!(char*)(address), UpCast!(Cancellable*)(cancellable), callback, UpCast!(void*)(user_data));
27081 // VERSION: 2.26
27082 // Finishes an operation started with g_dbus_address_get_stream().
27083 // RETURNS: A #GIOStream or %NULL if @error is set.
27084 // <res>: A #GAsyncResult obtained from the GAsyncReadyCallback passed to g_dbus_address_get_stream().
27085 // <out_guid>: %NULL or return location to store the GUID extracted from @address, if any.
27086 static IOStream* /*new*/ dbus_address_get_stream_finish(AT0, AT1, AT2)(AT0 /*AsyncResult*/ res, AT1 /*char**/ out_guid, AT2 /*GLib2.Error**/ error=null) nothrow {
27087 return g_dbus_address_get_stream_finish(UpCast!(AsyncResult*)(res), toCString!(char**)(out_guid), UpCast!(GLib2.Error**)(error));
27091 // VERSION: 2.26
27092 // Synchronously connects to an endpoint specified by @address and
27093 // sets up the connection so it is in a state to run the client-side
27094 // of the D-Bus authentication conversation.
27096 // This is a synchronous failable function. See
27097 // g_dbus_address_get_stream() for the asynchronous version.
27098 // RETURNS: A #GIOStream or %NULL if @error is set.
27099 // <address>: A valid D-Bus address.
27100 // <out_guid>: %NULL or return location to store the GUID extracted from @address, if any.
27101 // <cancellable>: A #GCancellable or %NULL.
27102 static IOStream* /*new*/ dbus_address_get_stream_sync(AT0, AT1, AT2, AT3)(AT0 /*char*/ address, AT1 /*char**/ out_guid, AT2 /*Cancellable*/ cancellable, AT3 /*GLib2.Error**/ error=null) nothrow {
27103 return g_dbus_address_get_stream_sync(toCString!(char*)(address), toCString!(char**)(out_guid), UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
27107 // VERSION: 2.26
27108 // MOVED TO: DBusAnnotationInfo.lookup
27109 // Looks up the value of an annotation.
27111 // This cost of this function is O(n) in number of annotations.
27112 // RETURNS: The value or %NULL if not found. Do not free, it is owned by @annotations.
27113 // <annotations>: A %NULL-terminated array of annotations or %NULL.
27114 // <name>: The name of the annotation to look up.
27115 static char* dbus_annotation_info_lookup(AT0, AT1)(AT0 /*DBusAnnotationInfo**/ annotations, AT1 /*char*/ name) nothrow {
27116 return g_dbus_annotation_info_lookup(UpCast!(DBusAnnotationInfo**)(annotations), toCString!(char*)(name));
27120 // VERSION: 2.26
27121 // MOVED TO: DBusError.encode_gerror
27122 // Creates a D-Bus error name to use for @error. If @error matches
27123 // a registered error (cf. g_dbus_error_register_error()), the corresponding
27124 // D-Bus error name will be returned.
27126 // Otherwise the a name of the form
27127 // <literal>org.gtk.GDBus.UnmappedGError.Quark._ESCAPED_QUARK_NAME.Code_ERROR_CODE</literal>
27128 // will be used. This allows other GDBus applications to map the error
27129 // on the wire back to a #GError using g_dbus_error_new_for_dbus_error().
27131 // This function is typically only used in object mappings to put a
27132 // #GError on the wire. Regular applications should not use it.
27133 // RETURNS: A D-Bus error name (never %NULL). Free with g_free().
27134 // <error>: A #GError.
27135 static char* /*new*/ dbus_error_encode_gerror(AT0)(AT0 /*GLib2.Error*/ error) nothrow {
27136 return g_dbus_error_encode_gerror(UpCast!(GLib2.Error*)(error));
27140 // VERSION: 2.26
27141 // MOVED TO: DBusError.get_remote_error
27142 // Gets the D-Bus error name used for @error, if any.
27144 // This function is guaranteed to return a D-Bus error name for all
27145 // #GError<!-- -->s returned from functions handling remote method
27146 // calls (e.g. g_dbus_connection_call_finish()) unless
27147 // g_dbus_error_strip_remote_error() has been used on @error.
27148 // RETURNS: An allocated string or %NULL if the D-Bus error name could not be found. Free with g_free().
27149 // <error>: A #GError.
27150 static char* /*new*/ dbus_error_get_remote_error(AT0)(AT0 /*GLib2.Error*/ error) nothrow {
27151 return g_dbus_error_get_remote_error(UpCast!(GLib2.Error*)(error));
27155 // VERSION: 2.26
27156 // MOVED TO: DBusError.is_remote_error
27157 // Checks if @error represents an error received via D-Bus from a remote peer. If so,
27158 // use g_dbus_error_get_remote_error() to get the name of the error.
27160 // %FALSE otherwise.
27161 // RETURNS: %TRUE if @error represents an error from a remote peer,
27162 // <error>: A #GError.
27163 static int dbus_error_is_remote_error(AT0)(AT0 /*GLib2.Error*/ error) nothrow {
27164 return g_dbus_error_is_remote_error(UpCast!(GLib2.Error*)(error));
27168 // VERSION: 2.26
27169 // MOVED TO: DBusError.new_for_dbus_error
27170 // Creates a #GError based on the contents of @dbus_error_name and
27171 // @dbus_error_message.
27173 // Errors registered with g_dbus_error_register_error() will be looked
27174 // up using @dbus_error_name and if a match is found, the error domain
27175 // and code is used. Applications can use g_dbus_error_get_remote_error()
27176 // to recover @dbus_error_name.
27178 // If a match against a registered error is not found and the D-Bus
27179 // error name is in a form as returned by g_dbus_error_encode_gerror()
27180 // the error domain and code encoded in the name is used to
27181 // create the #GError. Also, @dbus_error_name is added to the error message
27182 // such that it can be recovered with g_dbus_error_get_remote_error().
27184 // Otherwise, a #GError with the error code %G_IO_ERROR_DBUS_ERROR
27185 // in the #G_IO_ERROR error domain is returned. Also, @dbus_error_name is
27186 // added to the error message such that it can be recovered with
27187 // g_dbus_error_get_remote_error().
27189 // In all three cases, @dbus_error_name can always be recovered from the
27190 // returned #GError using the g_dbus_error_get_remote_error() function
27191 // (unless g_dbus_error_strip_remote_error() hasn't been used on the returned error).
27193 // This function is typically only used in object mappings to prepare
27194 // #GError instances for applications. Regular applications should not use
27195 // it.
27196 // RETURNS: An allocated #GError. Free with g_error_free().
27197 // <dbus_error_name>: D-Bus error name.
27198 // <dbus_error_message>: D-Bus error message.
27199 static GLib2.Error* /*new*/ dbus_error_new_for_dbus_error(AT0, AT1)(AT0 /*char*/ dbus_error_name, AT1 /*char*/ dbus_error_message) nothrow {
27200 return g_dbus_error_new_for_dbus_error(toCString!(char*)(dbus_error_name), toCString!(char*)(dbus_error_message));
27203 // MOVED TO: DBusError.quark
27204 static GLib2.Quark dbus_error_quark()() nothrow {
27205 return g_dbus_error_quark();
27209 // VERSION: 2.26
27210 // MOVED TO: DBusError.register_error
27211 // Creates an association to map between @dbus_error_name and
27212 // #GError<!-- -->s specified by @error_domain and @error_code.
27214 // This is typically done in the routine that returns the #GQuark for
27215 // an error domain.
27217 // exists.
27218 // RETURNS: %TRUE if the association was created, %FALSE if it already
27219 // <error_domain>: A #GQuark for a error domain.
27220 // <error_code>: An error code.
27221 // <dbus_error_name>: A D-Bus error name.
27222 static int dbus_error_register_error(AT0)(GLib2.Quark error_domain, int error_code, AT0 /*char*/ dbus_error_name) nothrow {
27223 return g_dbus_error_register_error(error_domain, error_code, toCString!(char*)(dbus_error_name));
27227 // VERSION: 2.26
27228 // MOVED TO: DBusError.register_error_domain
27229 // Helper function for associating a #GError error domain with D-Bus error names.
27230 // <error_domain_quark_name>: The error domain name.
27231 // <quark_volatile>: A pointer where to store the #GQuark.
27232 // <entries>: A pointer to @num_entries #GDBusErrorEntry struct items.
27233 // <num_entries>: Number of items to register.
27234 static void dbus_error_register_error_domain(AT0, AT1, AT2)(AT0 /*char*/ error_domain_quark_name, AT1 /*size_t*/ quark_volatile, AT2 /*DBusErrorEntry*/ entries, uint num_entries) nothrow {
27235 g_dbus_error_register_error_domain(toCString!(char*)(error_domain_quark_name), UpCast!(size_t*)(quark_volatile), UpCast!(DBusErrorEntry*)(entries), num_entries);
27239 // VERSION: 2.26
27240 // MOVED TO: DBusError.strip_remote_error
27241 // Looks for extra information in the error message used to recover
27242 // the D-Bus error name and strips it if found. If stripped, the
27243 // message field in @error will correspond exactly to what was
27244 // received on the wire.
27246 // This is typically used when presenting errors to the end user.
27247 // RETURNS: %TRUE if information was stripped, %FALSE otherwise.
27248 // <error>: A #GError.
27249 static int dbus_error_strip_remote_error(AT0)(AT0 /*GLib2.Error*/ error) nothrow {
27250 return g_dbus_error_strip_remote_error(UpCast!(GLib2.Error*)(error));
27254 // VERSION: 2.26
27255 // MOVED TO: DBusError.unregister_error
27256 // Destroys an association previously set up with g_dbus_error_register_error().
27257 // RETURNS: %TRUE if the association was destroyed, %FALSE if it wasn't found.
27258 // <error_domain>: A #GQuark for a error domain.
27259 // <error_code>: An error code.
27260 // <dbus_error_name>: A D-Bus error name.
27261 static int dbus_error_unregister_error(AT0)(GLib2.Quark error_domain, int error_code, AT0 /*char*/ dbus_error_name) nothrow {
27262 return g_dbus_error_unregister_error(error_domain, error_code, toCString!(char*)(dbus_error_name));
27266 // VERSION: 2.26
27267 // Generate a D-Bus GUID that can be used with
27268 // e.g. g_dbus_connection_new().
27270 // See the D-Bus specification regarding what strings are valid D-Bus
27271 // GUID (for example, D-Bus GUIDs are not RFC-4122 compliant).
27272 // RETURNS: A valid D-Bus GUID. Free with g_free().
27273 static char* /*new*/ dbus_generate_guid()() nothrow {
27274 return g_dbus_generate_guid();
27278 // VERSION: 2.30
27279 // Converts a #GValue to a #GVariant of the type indicated by the @type parameter.
27281 // The conversion is using the following rules:
27282 // <table frame='all'>
27283 // <title>#GValue / #GVariant conversion rules</title>
27284 // <tgroup cols='2' align='left' colsep='1' rowsep='1'>
27285 // <thead>
27286 // <row>
27287 // <entry>If the #GType for @gvalue is...</entry>
27288 // <entry>... then @type must be</entry>
27289 // </row>
27290 // </thead>
27291 // <tbody>
27292 // <row>
27293 // <entry>#G_TYPE_STRING</entry>
27294 // <entry><link linkend="G-VARIANT-TYPE-STRING:CAPS">'s'</link>, <link linkend="G-VARIANT-TYPE-OBJECT-PATH:CAPS">'o'</link>, <link linkend="G-VARIANT-TYPE-SIGNATURE:CAPS">'g'</link> or <link linkend="G-VARIANT-TYPE-BYTESTRING:CAPS">'ay'</link></entry>
27295 // </row>
27296 // <row>
27297 // <entry>#G_TYPE_STRV</entry>
27298 // <entry><link linkend="G-VARIANT-TYPE-STRING-ARRAY:CAPS">'as'</link>, <link linkend="G-VARIANT-TYPE-OBJECT-PATH-ARRAY:CAPS">'ao'</link> or <link linkend="G-VARIANT-TYPE-BYTESTRING-ARRAY:CAPS">'aay'</link></entry>
27299 // </row>
27300 // <row>
27301 // <entry>#G_TYPE_BOOLEAN</entry>
27302 // <entry><link linkend="G-VARIANT-TYPE-BOOLEAN:CAPS">'b'</link></entry>
27303 // </row>
27304 // <row>
27305 // <entry>#G_TYPE_UCHAR</entry>
27306 // <entry><link linkend="G-VARIANT-TYPE-BYTE:CAPS">'y'</link></entry>
27307 // </row>
27308 // <row>
27309 // <entry>#G_TYPE_INT</entry>
27310 // <entry><link linkend="G-VARIANT-TYPE-INT32:CAPS">'i'</link> or <link linkend="G-VARIANT-TYPE-INT16:CAPS">'n'</link></entry>
27311 // </row>
27312 // <row>
27313 // <entry>#G_TYPE_UINT</entry>
27314 // <entry><link linkend="G-VARIANT-TYPE-UINT32:CAPS">'u'</link> or <link linkend="G-VARIANT-TYPE-UINT16:CAPS">'q'</link></entry>
27315 // </row>
27316 // <row>
27317 // <entry>#G_TYPE_INT64</entry>
27318 // <entry><link linkend="G-VARIANT-TYPE-INT64:CAPS">'x'</link></entry>
27319 // </row>
27320 // <row>
27321 // <entry>#G_TYPE_UINT64</entry>
27322 // <entry><link linkend="G-VARIANT-TYPE-UINT64:CAPS">'t'</link></entry>
27323 // </row>
27324 // <row>
27325 // <entry>#G_TYPE_DOUBLE</entry>
27326 // <entry><link linkend="G-VARIANT-TYPE-DOUBLE:CAPS">'d'</link></entry>
27327 // </row>
27328 // <row>
27329 // <entry>#G_TYPE_VARIANT</entry>
27330 // <entry>Any #GVariantType</entry>
27331 // </row>
27332 // </tbody>
27333 // </tgroup>
27334 // </table>
27335 // This can fail if e.g. @gvalue is of type #G_TYPE_STRING and @type
27336 // is <link linkend="G-VARIANT-TYPE-INT32:CAPS">'i'</link>. It will
27337 // also fail for any #GType (including e.g. #G_TYPE_OBJECT and
27338 // #G_TYPE_BOXED derived-types) not in the table above.
27340 // Note that if @gvalue is of type #G_TYPE_VARIANT and its value is
27341 // %NULL, the <emphasis>empty</emphasis> #GVariant instance (never
27342 // %NULL) for @type is returned (e.g. 0 for scalar types, the empty
27343 // string for string types, <literal>'/'</literal> for object path
27344 // types, the empty array for any array type and so on).
27346 // See the g_dbus_gvariant_to_gvalue() function for how to convert a
27347 // #GVariant to a #GValue.
27349 // @type holding the data from @gvalue or %NULL in case of
27350 // failure. Free with g_variant_unref().
27351 // RETURNS: A #GVariant (never floating) of #GVariantType
27352 // <gvalue>: A #GValue to convert to a #GVariant.
27353 // <type>: A #GVariantType.
27354 static GLib2.Variant* /*new*/ dbus_gvalue_to_gvariant(AT0, AT1)(AT0 /*GObject2.Value*/ gvalue, AT1 /*GLib2.VariantType*/ type) nothrow {
27355 return g_dbus_gvalue_to_gvariant(UpCast!(GObject2.Value*)(gvalue), UpCast!(GLib2.VariantType*)(type));
27359 // VERSION: 2.30
27360 // Converts a #GVariant to a #GValue. If @value is floating, it is consumed.
27362 // The rules specified in the g_dbus_gvalue_to_gvariant() function are
27363 // used - this function is essentially its reverse form.
27365 // The conversion never fails - a valid #GValue is always returned in
27366 // @out_gvalue.
27367 // <value>: A #GVariant.
27368 // <out_gvalue>: Return location pointing to a zero-filled (uninitialized) #GValue.
27369 static void dbus_gvariant_to_gvalue(AT0, AT1)(AT0 /*GLib2.Variant*/ value, AT1 /*GObject2.Value*/ out_gvalue) nothrow {
27370 g_dbus_gvariant_to_gvalue(UpCast!(GLib2.Variant*)(value), UpCast!(GObject2.Value*)(out_gvalue));
27374 // VERSION: 2.26
27375 // Checks if @string is a D-Bus address.
27377 // This doesn't check if @string is actually supported by #GDBusServer
27378 // or #GDBusConnection - use g_dbus_is_supported_address() to do more
27379 // checks.
27380 // RETURNS: %TRUE if @string is a valid D-Bus address, %FALSE otherwise.
27381 // <string>: A string.
27382 static int dbus_is_address(AT0)(AT0 /*char*/ string_) nothrow {
27383 return g_dbus_is_address(toCString!(char*)(string_));
27387 // VERSION: 2.26
27388 // Checks if @string is a D-Bus GUID.
27390 // See the D-Bus specification regarding what strings are valid D-Bus
27391 // GUID (for example, D-Bus GUIDs are not RFC-4122 compliant).
27392 // RETURNS: %TRUE if @string is a guid, %FALSE otherwise.
27393 // <string>: The string to check.
27394 static int dbus_is_guid(AT0)(AT0 /*char*/ string_) nothrow {
27395 return g_dbus_is_guid(toCString!(char*)(string_));
27399 // VERSION: 2.26
27400 // Checks if @string is a valid D-Bus interface name.
27401 // RETURNS: %TRUE if valid, %FALSE otherwise.
27402 // <string>: The string to check.
27403 static int dbus_is_interface_name(AT0)(AT0 /*char*/ string_) nothrow {
27404 return g_dbus_is_interface_name(toCString!(char*)(string_));
27408 // VERSION: 2.26
27409 // Checks if @string is a valid D-Bus member (e.g. signal or method) name.
27410 // RETURNS: %TRUE if valid, %FALSE otherwise.
27411 // <string>: The string to check.
27412 static int dbus_is_member_name(AT0)(AT0 /*char*/ string_) nothrow {
27413 return g_dbus_is_member_name(toCString!(char*)(string_));
27417 // VERSION: 2.26
27418 // Checks if @string is a valid D-Bus bus name (either unique or well-known).
27419 // RETURNS: %TRUE if valid, %FALSE otherwise.
27420 // <string>: The string to check.
27421 static int dbus_is_name(AT0)(AT0 /*char*/ string_) nothrow {
27422 return g_dbus_is_name(toCString!(char*)(string_));
27426 // VERSION: 2.26
27427 // Like g_dbus_is_address() but also checks if the library suppors the
27428 // transports in @string and that key/value pairs for each transport
27429 // are valid.
27431 // supported by this library, %FALSE if @error is set.
27432 // RETURNS: %TRUE if @string is a valid D-Bus address that is
27433 // <string>: A string.
27434 static int dbus_is_supported_address(AT0, AT1)(AT0 /*char*/ string_, AT1 /*GLib2.Error**/ error=null) nothrow {
27435 return g_dbus_is_supported_address(toCString!(char*)(string_), UpCast!(GLib2.Error**)(error));
27439 // VERSION: 2.26
27440 // Checks if @string is a valid D-Bus unique bus name.
27441 // RETURNS: %TRUE if valid, %FALSE otherwise.
27442 // <string>: The string to check.
27443 static int dbus_is_unique_name(AT0)(AT0 /*char*/ string_) nothrow {
27444 return g_dbus_is_unique_name(toCString!(char*)(string_));
27448 // MOVED TO: File.new_for_commandline_arg
27449 // Creates a #GFile with the given argument from the command line. The value of
27450 // @arg can be either a URI, an absolute path or a relative path resolved
27451 // relative to the current working directory.
27452 // This operation never fails, but the returned object might not support any
27453 // I/O operation if @arg points to a malformed path.
27455 // Free the returned object with g_object_unref().
27456 // RETURNS: a new #GFile.
27457 // <arg>: a command line string.
27458 static File* /*new*/ file_new_for_commandline_arg(AT0)(AT0 /*char*/ arg) nothrow {
27459 return g_file_new_for_commandline_arg(toCString!(char*)(arg));
27463 // MOVED TO: File.new_for_path
27464 // Constructs a #GFile for a given path. This operation never
27465 // fails, but the returned object might not support any I/O
27466 // operation if @path is malformed.
27468 // Free the returned object with g_object_unref().
27469 // RETURNS: a new #GFile for the given @path.
27470 // <path>: a string containing a relative or absolute path. The string must be encoded in the glib filename encoding.
27471 static File* /*new*/ file_new_for_path(AT0)(AT0 /*char*/ path) nothrow {
27472 return g_file_new_for_path(toCString!(char*)(path));
27476 // MOVED TO: File.new_for_uri
27477 // Constructs a #GFile for a given URI. This operation never
27478 // fails, but the returned object might not support any I/O
27479 // operation if @uri is malformed or if the uri type is
27480 // not supported.
27482 // Free the returned object with g_object_unref().
27483 // RETURNS: a new #GFile for the given @uri.
27484 // <uri>: a UTF8 string containing a URI.
27485 static File* /*new*/ file_new_for_uri(AT0)(AT0 /*char*/ uri) nothrow {
27486 return g_file_new_for_uri(toCString!(char*)(uri));
27490 // VERSION: 2.32
27491 // MOVED TO: File.new_tmp
27492 // Opens a file in the preferred directory for temporary files (as
27493 // returned by g_get_tmp_dir()) and returns a #GFile and
27494 // #GFileIOStream pointing to it.
27496 // @tmpl should be a string in the GLib file name encoding
27497 // containing a sequence of six 'X' characters, and containing no
27498 // directory components. If it is %NULL, a default template is used.
27500 // Unlike the other #GFile constructors, this will return %NULL if
27501 // a temporary file could not be created.
27503 // Free the returned object with g_object_unref().
27504 // RETURNS: a new #GFile.
27505 // <tmpl>: Template for the file name, as in g_file_open_tmp(), or %NULL for a default template.
27506 // <iostream>: on return, a #GFileIOStream for the created file.
27507 static File* /*new*/ file_new_tmp(AT0, AT1, AT2)(AT0 /*char*/ tmpl, /*out*/ AT1 /*FileIOStream**/ iostream, AT2 /*GLib2.Error**/ error=null) nothrow {
27508 return g_file_new_tmp(toCString!(char*)(tmpl), UpCast!(FileIOStream**)(iostream), UpCast!(GLib2.Error**)(error));
27512 // MOVED TO: File.parse_name
27513 // Constructs a #GFile with the given @parse_name (i.e. something given by g_file_get_parse_name()).
27514 // This operation never fails, but the returned object might not support any I/O
27515 // operation if the @parse_name cannot be parsed.
27516 // RETURNS: a new #GFile.
27517 // <parse_name>: a file name or path to be parsed.
27518 static File* /*new*/ file_parse_name(AT0)(AT0 /*char*/ parse_name) nothrow {
27519 return g_file_parse_name(toCString!(char*)(parse_name));
27523 // MOVED TO: Icon.hash
27524 // Gets a hash for an icon.
27526 // use in a #GHashTable or similar data structure.
27527 // RETURNS: a #guint containing a hash for the @icon, suitable for
27528 // <icon>: #gconstpointer to an icon object.
27529 static uint icon_hash(AT0)(AT0 /*const(void)*/ icon) nothrow {
27530 return g_icon_hash(UpCast!(const(void)*)(icon));
27534 // VERSION: 2.20
27535 // MOVED TO: Icon.new_for_string
27536 // Generate a #GIcon instance from @str. This function can fail if
27537 // @str is not valid - see g_icon_to_string() for discussion.
27539 // If your application or library provides one or more #GIcon
27540 // implementations you need to ensure that each #GType is registered
27541 // with the type system prior to calling g_icon_new_for_string().
27543 // interface or %NULL if @error is set.
27544 // RETURNS: An object implementing the #GIcon
27545 // <str>: A string obtained via g_icon_to_string().
27546 static Icon* /*new*/ icon_new_for_string(AT0, AT1)(AT0 /*char*/ str, AT1 /*GLib2.Error**/ error=null) nothrow {
27547 return g_icon_new_for_string(toCString!(char*)(str), UpCast!(GLib2.Error**)(error));
27551 // VERSION: 2.22
27552 // MOVED TO: Initable.newv
27553 // Helper function for constructing #GInitable object. This is
27554 // similar to g_object_newv() but also initializes the object
27555 // and returns %NULL, setting an error on failure.
27556 // RETURNS: a newly allocated #GObject, or %NULL on error
27557 // <object_type>: a #GType supporting #GInitable.
27558 // <n_parameters>: the number of parameters in @parameters
27559 // <parameters>: the parameters to use to construct the object
27560 // <cancellable>: optional #GCancellable object, %NULL to ignore.
27561 static void* /*new*/ initable_newv(AT0, AT1, AT2)(Type object_type, uint n_parameters, AT0 /*GObject2.Parameter*/ parameters, AT1 /*Cancellable*/ cancellable, AT2 /*GLib2.Error**/ error=null) nothrow {
27562 return g_initable_newv(object_type, n_parameters, UpCast!(GObject2.Parameter*)(parameters), UpCast!(Cancellable*)(cancellable), UpCast!(GLib2.Error**)(error));
27566 // Converts errno.h error codes into GIO error codes.
27567 // RETURNS: #GIOErrorEnum value for the given errno.h error number.
27568 // <err_no>: Error number as defined in errno.h.
27569 static IOErrorEnum io_error_from_errno()(int err_no) nothrow {
27570 return g_io_error_from_errno(err_no);
27574 // Gets the GIO Error Quark.
27575 // RETURNS: a #GQuark.
27576 static GLib2.Quark io_error_quark()() nothrow {
27577 return g_io_error_quark();
27581 // MOVED TO: IOExtensionPoint.implement
27582 // Registers @type as extension for the extension point with name
27583 // @extension_point_name.
27585 // If @type has already been registered as an extension for this
27586 // extension point, the existing #GIOExtension object is returned.
27587 // RETURNS: a #GIOExtension object for #GType
27588 // <extension_point_name>: the name of the extension point
27589 // <type>: the #GType to register as extension
27590 // <extension_name>: the name for the extension
27591 // <priority>: the priority for the extension
27592 static IOExtension* io_extension_point_implement(AT0, AT1)(AT0 /*char*/ extension_point_name, Type type, AT1 /*char*/ extension_name, int priority) nothrow {
27593 return g_io_extension_point_implement(toCString!(char*)(extension_point_name), type, toCString!(char*)(extension_name), priority);
27597 // MOVED TO: IOExtensionPoint.lookup
27598 // Looks up an existing extension point.
27600 // is no registered extension point with the given name.
27601 // RETURNS: the #GIOExtensionPoint, or %NULL if there
27602 // <name>: the name of the extension point
27603 static IOExtensionPoint* io_extension_point_lookup(AT0)(AT0 /*char*/ name) nothrow {
27604 return g_io_extension_point_lookup(toCString!(char*)(name));
27608 // MOVED TO: IOExtensionPoint.register
27609 // Registers an extension point.
27611 // owned by GIO and should not be freed.
27612 // RETURNS: the new #GIOExtensionPoint. This object is
27613 // <name>: The name of the extension point
27614 static IOExtensionPoint* io_extension_point_register(AT0)(AT0 /*char*/ name) nothrow {
27615 return g_io_extension_point_register(toCString!(char*)(name));
27619 // Loads all the modules in the specified directory.
27621 // If don't require all modules to be initialized (and thus registering
27622 // all gtypes) then you can use g_io_modules_scan_all_in_directory()
27623 // which allows delayed/lazy loading of modules.
27625 // from the directory,
27626 // All the modules are loaded into memory, if you want to
27627 // unload them (enabling on-demand loading) you must call
27628 // g_type_module_unuse() on all the modules. Free the list
27629 // with g_list_free().
27630 // RETURNS: a list of #GIOModules loaded
27631 // <dirname>: pathname for a directory containing modules to load.
27632 static GLib2.List* /*new*/ io_modules_load_all_in_directory(AT0)(AT0 /*char*/ dirname) nothrow {
27633 return g_io_modules_load_all_in_directory(toCString!(char*)(dirname));
27637 // VERSION: 2.30
27638 // Loads all the modules in the specified directory.
27640 // If don't require all modules to be initialized (and thus registering
27641 // all gtypes) then you can use g_io_modules_scan_all_in_directory()
27642 // which allows delayed/lazy loading of modules.
27644 // from the directory,
27645 // All the modules are loaded into memory, if you want to
27646 // unload them (enabling on-demand loading) you must call
27647 // g_type_module_unuse() on all the modules. Free the list
27648 // with g_list_free().
27649 // RETURNS: a list of #GIOModules loaded
27650 // <dirname>: pathname for a directory containing modules to load.
27651 // <scope>: a scope to use when scanning the modules.
27652 static GLib2.List* /*new*/ io_modules_load_all_in_directory_with_scope(AT0, AT1)(AT0 /*char*/ dirname, AT1 /*IOModuleScope*/ scope_) nothrow {
27653 return g_io_modules_load_all_in_directory_with_scope(toCString!(char*)(dirname), UpCast!(IOModuleScope*)(scope_));
27657 // VERSION: 2.24
27658 // Scans all the modules in the specified directory, ensuring that
27659 // any extension point implemented by a module is registered.
27661 // This may not actually load and initialize all the types in each
27662 // module, some modules may be lazily loaded and initialized when
27663 // an extension point it implementes is used with e.g.
27664 // g_io_extension_point_get_extensions() or
27665 // g_io_extension_point_get_extension_by_name().
27667 // If you need to guarantee that all types are loaded in all the modules,
27668 // use g_io_modules_load_all_in_directory().
27669 // <dirname>: pathname for a directory containing modules to scan.
27670 static void io_modules_scan_all_in_directory(AT0)(AT0 /*char*/ dirname) nothrow {
27671 g_io_modules_scan_all_in_directory(toCString!(char*)(dirname));
27675 // VERSION: 2.30
27676 // Scans all the modules in the specified directory, ensuring that
27677 // any extension point implemented by a module is registered.
27679 // This may not actually load and initialize all the types in each
27680 // module, some modules may be lazily loaded and initialized when
27681 // an extension point it implementes is used with e.g.
27682 // g_io_extension_point_get_extensions() or
27683 // g_io_extension_point_get_extension_by_name().
27685 // If you need to guarantee that all types are loaded in all the modules,
27686 // use g_io_modules_load_all_in_directory().
27687 // <dirname>: pathname for a directory containing modules to scan.
27688 // <scope>: a scope to use when scanning the modules
27689 static void io_modules_scan_all_in_directory_with_scope(AT0, AT1)(AT0 /*char*/ dirname, AT1 /*IOModuleScope*/ scope_) nothrow {
27690 g_io_modules_scan_all_in_directory_with_scope(toCString!(char*)(dirname), UpCast!(IOModuleScope*)(scope_));
27694 // Cancels all cancellable I/O jobs.
27696 // A job is cancellable if a #GCancellable was passed into
27697 // g_io_scheduler_push_job().
27698 static void io_scheduler_cancel_all_jobs()() nothrow {
27699 g_io_scheduler_cancel_all_jobs();
27703 // Schedules the I/O job to run in another thread.
27705 // @notify will be called on @user_data after @job_func has returned,
27706 // regardless whether the job was cancelled or has run to completion.
27708 // If @cancellable is not %NULL, it can be used to cancel the I/O job
27709 // by calling g_cancellable_cancel() or by calling
27710 // g_io_scheduler_cancel_all_jobs().
27711 // <job_func>: a #GIOSchedulerJobFunc.
27712 // <user_data>: data to pass to @job_func
27713 // <notify>: a #GDestroyNotify for @user_data, or %NULL
27714 // <io_priority>: the <link linkend="gioscheduler">I/O priority</link> of the request.
27715 // <cancellable>: optional #GCancellable object, %NULL to ignore.
27716 static void io_scheduler_push_job(AT0, AT1)(IOSchedulerJobFunc job_func, AT0 /*void*/ user_data, GLib2.DestroyNotify notify, int io_priority, AT1 /*Cancellable*/ cancellable=null) nothrow {
27717 g_io_scheduler_push_job(job_func, UpCast!(void*)(user_data), notify, io_priority, UpCast!(Cancellable*)(cancellable));
27721 // VERSION: 2.32
27722 // MOVED TO: NetworkMonitor.get_default
27723 // Gets the default #GNetworkMonitor for the system.
27724 // RETURNS: a #GNetworkMonitor
27725 static NetworkMonitor* network_monitor_get_default()() nothrow {
27726 return g_network_monitor_get_default();
27730 // VERSION: 2.28
27731 // Utility method for #GPollableInputStream and #GPollableOutputStream
27732 // implementations. Creates a new #GSource that expects a callback of
27733 // type #GPollableSourceFunc. The new source does not actually do
27734 // anything on its own; use g_source_add_child_source() to add other
27735 // sources to it to cause it to trigger.
27736 // RETURNS: the new #GSource.
27737 // <pollable_stream>: the stream associated with the new source
27738 static GLib2.Source* /*new*/ pollable_source_new(AT0)(AT0 /*GObject2.Object*/ pollable_stream) nothrow {
27739 return g_pollable_source_new(UpCast!(GObject2.Object*)(pollable_stream));
27743 // VERSION: 2.26
27744 // MOVED TO: Proxy.get_default_for_protocol
27745 // Lookup "gio-proxy" extension point for a proxy implementation that supports
27746 // specified protocol.
27748 // is not supported.
27749 // RETURNS: return a #GProxy or NULL if protocol
27750 // <protocol>: the proxy protocol name (e.g. http, socks, etc)
27751 static Proxy* /*new*/ proxy_get_default_for_protocol(AT0)(AT0 /*char*/ protocol) nothrow {
27752 return g_proxy_get_default_for_protocol(toCString!(char*)(protocol));
27756 // VERSION: 2.26
27757 // MOVED TO: ProxyResolver.get_default
27758 // Gets the default #GProxyResolver for the system.
27759 // RETURNS: the default #GProxyResolver.
27760 static ProxyResolver* proxy_resolver_get_default()() nothrow {
27761 return g_proxy_resolver_get_default();
27765 // VERSION: 2.22
27766 // MOVED TO: ResolverError.quark
27767 // Gets the #GResolver Error Quark.
27768 // RETURNS: a #GQuark.
27769 static GLib2.Quark resolver_error_quark()() nothrow {
27770 return g_resolver_error_quark();
27774 // VERSION: 2.32
27775 // MOVED TO: ResourceError.quark
27776 // Gets the #GResource Error Quark.
27777 // RETURNS: a #GQuark.
27778 static GLib2.Quark resource_error_quark()() nothrow {
27779 return g_resource_error_quark();
27783 // VERSION: 2.32
27784 // MOVED TO: Resource.load
27785 // Loads a binary resource bundle and creates a #GResource representation of it, allowing
27786 // you to query it for data.
27788 // If you want to use this resource in the global resource namespace you need
27789 // to register it with g_resources_register().
27790 // RETURNS: a new #GResource, or %NULL on error.
27791 // <filename>: the path of a filename to load, in the GLib filename encoding.
27792 static Resource* /*new*/ resource_load(AT0, AT1)(AT0 /*char*/ filename, AT1 /*GLib2.Error**/ error=null) nothrow {
27793 return g_resource_load(toCString!(char*)(filename), UpCast!(GLib2.Error**)(error));
27797 // VERSION: 2.32
27798 // Returns all the names of children at the specified @path in the set of
27799 // globally registred resources.
27800 // The return result is a %NULL terminated list of strings which should
27801 // be released with g_strfreev().
27803 // @lookup_flags controls the behaviour of the lookup.
27804 // RETURNS: an array of constant strings
27805 // <path>: A pathname inside the resource.
27806 // <lookup_flags>: A #GResourceLookupFlags.
27807 static char** /*new*/ resources_enumerate_children(AT0, AT1)(AT0 /*char*/ path, ResourceLookupFlags lookup_flags, AT1 /*GLib2.Error**/ error=null) nothrow {
27808 return g_resources_enumerate_children(toCString!(char*)(path), lookup_flags, UpCast!(GLib2.Error**)(error));
27812 // VERSION: 2.32
27813 // Looks for a file at the specified @path in the set of
27814 // globally registred resources and if found returns information about it.
27816 // @lookup_flags controls the behaviour of the lookup.
27817 // RETURNS: %TRUE if the file was found. %FALSE if there were errors.
27818 // <path>: A pathname inside the resource.
27819 // <lookup_flags>: A #GResourceLookupFlags.
27820 // <size>: a location to place the length of the contents of the file, or %NULL if the length is not needed
27821 // <flags>: a location to place the flags about the file, or %NULL if the length is not needed
27822 static int resources_get_info(AT0, AT1, AT2, AT3)(AT0 /*char*/ path, ResourceLookupFlags lookup_flags, /*out*/ AT1 /*size_t*/ size, /*out*/ AT2 /*uint*/ flags, AT3 /*GLib2.Error**/ error=null) nothrow {
27823 return g_resources_get_info(toCString!(char*)(path), lookup_flags, UpCast!(size_t*)(size), UpCast!(uint*)(flags), UpCast!(GLib2.Error**)(error));
27827 // VERSION: 2.32
27828 // Looks for a file at the specified @path in the set of
27829 // globally registred resources and returns a #GBytes that
27830 // lets you directly access the data in memory.
27832 // The data is always followed by a zero byte, so you
27833 // can safely use the data as a C string. However, that byte
27834 // is not included in the size of the GBytes.
27836 // For uncompressed resource files this is a pointer directly into
27837 // the resource bundle, which is typically in some readonly data section
27838 // in the program binary. For compressed files we allocate memory on
27839 // the heap and automatically uncompress the data.
27841 // @lookup_flags controls the behaviour of the lookup.
27843 // Free the returned object with g_bytes_unref().
27844 // RETURNS: #GBytes or %NULL on error.
27845 // <path>: A pathname inside the resource.
27846 // <lookup_flags>: A #GResourceLookupFlags.
27847 static GLib2.Bytes* /*new*/ resources_lookup_data(AT0, AT1)(AT0 /*char*/ path, ResourceLookupFlags lookup_flags, AT1 /*GLib2.Error**/ error=null) nothrow {
27848 return g_resources_lookup_data(toCString!(char*)(path), lookup_flags, UpCast!(GLib2.Error**)(error));
27852 // VERSION: 2.32
27853 // Looks for a file at the specified @path in the set of
27854 // globally registred resources and returns a #GInputStream
27855 // that lets you read the data.
27857 // @lookup_flags controls the behaviour of the lookup.
27859 // Free the returned object with g_object_unref().
27860 // RETURNS: #GInputStream or %NULL on error.
27861 // <path>: A pathname inside the resource.
27862 // <lookup_flags>: A #GResourceLookupFlags.
27863 static InputStream* /*new*/ resources_open_stream(AT0, AT1)(AT0 /*char*/ path, ResourceLookupFlags lookup_flags, AT1 /*GLib2.Error**/ error=null) nothrow {
27864 return g_resources_open_stream(toCString!(char*)(path), lookup_flags, UpCast!(GLib2.Error**)(error));
27868 // VERSION: 2.32
27869 // MOVED TO: SettingsSchemaSource.get_default
27870 // Gets the default system schema source.
27872 // This function is not required for normal uses of #GSettings but it
27873 // may be useful to authors of plugin management systems or to those who
27874 // want to introspect the content of schemas.
27876 // If no schemas are installed, %NULL will be returned.
27878 // The returned source may actually consist of multiple schema sources
27879 // from different directories, depending on which directories were given
27880 // in <envar>XDG_DATA_DIRS</envar> and
27881 // <envar>GSETTINGS_SCHEMA_DIR</envar>. For this reason, all lookups
27882 // performed against the default source should probably be done
27883 // recursively.
27884 // RETURNS: the default schema source
27885 static SettingsSchemaSource* settings_schema_source_get_default()() nothrow {
27886 return g_settings_schema_source_get_default();
27890 // Unintrospectable function: simple_async_report_error_in_idle() / g_simple_async_report_error_in_idle()
27891 // Reports an error in an asynchronous function in an idle function by
27892 // directly setting the contents of the #GAsyncResult with the given error
27893 // information.
27894 // <object>: a #GObject, or %NULL.
27895 // <callback>: a #GAsyncReadyCallback.
27896 // <user_data>: user data passed to @callback.
27897 // <domain>: a #GQuark containing the error domain (usually #G_IO_ERROR).
27898 // <code>: a specific error code.
27899 // <format>: a formatted error reporting string.
27900 alias g_simple_async_report_error_in_idle simple_async_report_error_in_idle; // Variadic
27903 // Reports an error in an idle function. Similar to
27904 // g_simple_async_report_error_in_idle(), but takes a #GError rather
27905 // than building a new one.
27906 // <object>: a #GObject, or %NULL
27907 // <callback>: a #GAsyncReadyCallback.
27908 // <user_data>: user data passed to @callback.
27909 // <error>: the #GError to report
27910 static void simple_async_report_gerror_in_idle(AT0, AT1, AT2)(AT0 /*GObject2.Object*/ object, AsyncReadyCallback callback, AT1 /*void*/ user_data, AT2 /*GLib2.Error*/ error) nothrow {
27911 g_simple_async_report_gerror_in_idle(UpCast!(GObject2.Object*)(object), callback, UpCast!(void*)(user_data), UpCast!(GLib2.Error*)(error));
27915 // Unintrospectable function: simple_async_report_take_gerror_in_idle() / g_simple_async_report_take_gerror_in_idle()
27916 // VERSION: 2.28
27917 // Reports an error in an idle function. Similar to
27918 // g_simple_async_report_gerror_in_idle(), but takes over the caller's
27919 // ownership of @error, so the caller does not have to free it any more.
27920 // <object>: a #GObject, or %NULL
27921 // <callback>: a #GAsyncReadyCallback.
27922 // <user_data>: user data passed to @callback.
27923 // <error>: the #GError to report
27924 static void simple_async_report_take_gerror_in_idle(AT0, AT1, AT2)(AT0 /*GObject2.Object*/ object, AsyncReadyCallback callback, AT1 /*void*/ user_data, AT2 /*GLib2.Error*/ error) nothrow {
27925 g_simple_async_report_take_gerror_in_idle(UpCast!(GObject2.Object*)(object), callback, UpCast!(void*)(user_data), UpCast!(GLib2.Error*)(error));
27929 // Unintrospectable function: srv_target_list_sort() / g_srv_target_list_sort()
27930 // VERSION: 2.22
27931 // MOVED TO: SrvTarget.list_sort
27932 // Sorts @targets in place according to the algorithm in RFC 2782.
27933 // RETURNS: the head of the sorted list.
27934 // <targets>: a #GList of #GSrvTarget
27935 static GLib2.List* /*new*/ srv_target_list_sort(AT0)(AT0 /*GLib2.List*/ targets) nothrow {
27936 return g_srv_target_list_sort(UpCast!(GLib2.List*)(targets));
27940 // VERSION: 2.28
27941 // MOVED TO: TlsBackend.get_default
27942 // Gets the default #GTlsBackend for the system.
27943 // RETURNS: a #GTlsBackend
27944 static TlsBackend* tls_backend_get_default()() nothrow {
27945 return g_tls_backend_get_default();
27949 // VERSION: 2.28
27950 // MOVED TO: TlsClientConnection.new
27951 // Creates a new #GTlsClientConnection wrapping @base_io_stream (which
27952 // must have pollable input and output streams) which is assumed to
27953 // communicate with the server identified by @server_identity.
27955 // #GTlsClientConnection, or %NULL on error
27956 // RETURNS: the new
27957 // <base_io_stream>: the #GIOStream to wrap
27958 // <server_identity>: the expected identity of the server
27959 static TlsClientConnection* /*new*/ tls_client_connection_new(AT0, AT1, AT2)(AT0 /*IOStream*/ base_io_stream, AT1 /*SocketConnectable*/ server_identity, AT2 /*GLib2.Error**/ error=null) nothrow {
27960 return g_tls_client_connection_new(UpCast!(IOStream*)(base_io_stream), UpCast!(SocketConnectable*)(server_identity), UpCast!(GLib2.Error**)(error));
27964 // VERSION: 2.28
27965 // MOVED TO: TlsError.quark
27966 // Gets the TLS error quark.
27967 // RETURNS: a #GQuark.
27968 static GLib2.Quark tls_error_quark()() nothrow {
27969 return g_tls_error_quark();
27973 // VERSION: 2.30
27974 // MOVED TO: TlsFileDatabase.new
27975 // Creates a new #GTlsFileDatabase which uses anchor certificate authorities
27976 // in @anchors to verify certificate chains.
27978 // The certificates in @anchors must be PEM encoded.
27980 // #GTlsFileDatabase, or %NULL on error
27981 // RETURNS: the new
27982 // <anchors>: filename of anchor certificate authorities.
27983 static TlsFileDatabase* /*new*/ tls_file_database_new(AT0, AT1)(AT0 /*char*/ anchors, AT1 /*GLib2.Error**/ error=null) nothrow {
27984 return g_tls_file_database_new(toCString!(char*)(anchors), UpCast!(GLib2.Error**)(error));
27988 // VERSION: 2.28
27989 // MOVED TO: TlsServerConnection.new
27990 // Creates a new #GTlsServerConnection wrapping @base_io_stream (which
27991 // must have pollable input and output streams).
27993 // #GTlsServerConnection, or %NULL on error
27994 // RETURNS: the new
27995 // <base_io_stream>: the #GIOStream to wrap
27996 // <certificate>: the default server certificate, or %NULL
27997 static TlsServerConnection* /*new*/ tls_server_connection_new(AT0, AT1, AT2)(AT0 /*IOStream*/ base_io_stream, AT1 /*TlsCertificate*/ certificate, AT2 /*GLib2.Error**/ error=null) nothrow {
27998 return g_tls_server_connection_new(UpCast!(IOStream*)(base_io_stream), UpCast!(TlsCertificate*)(certificate), UpCast!(GLib2.Error**)(error));
28002 // Determines if @mount_path is considered an implementation of the
28003 // OS. This is primarily used for hiding mountable and mounted volumes
28004 // that only are used in the OS and has little to no relevance to the
28005 // casual user.
28007 // of the OS.
28008 // RETURNS: %TRUE if @mount_path is considered an implementation detail
28009 // <mount_path>: a mount path, e.g. <filename>/media/disk</filename> or <filename>/usr</filename>
28010 static int unix_is_mount_path_system_internal(AT0)(AT0 /*char*/ mount_path) nothrow {
28011 return g_unix_is_mount_path_system_internal(toCString!(char*)(mount_path));
28015 // Unintrospectable function: unix_mount_at() / g_unix_mount_at()
28016 // Gets a #GUnixMountEntry for a given mount path. If @time_read
28017 // is set, it will be filled with a unix timestamp for checking
28018 // if the mounts have changed since with g_unix_mounts_changed_since().
28019 // RETURNS: a #GUnixMountEntry.
28020 // <mount_path>: path for a possible unix mount.
28021 // <time_read>: guint64 to contain a timestamp.
28022 static UnixMountEntry* /*new*/ unix_mount_at(AT0, AT1)(AT0 /*char*/ mount_path, /*out*/ AT1 /*ulong*/ time_read=null) nothrow {
28023 return g_unix_mount_at(toCString!(char*)(mount_path), UpCast!(ulong*)(time_read));
28027 // Compares two unix mounts.
28029 // or less than @mount2, respectively.
28030 // RETURNS: 1, 0 or -1 if @mount1 is greater than, equal to,
28031 // <mount1>: first #GUnixMountEntry to compare.
28032 // <mount2>: second #GUnixMountEntry to compare.
28033 static int unix_mount_compare(AT0, AT1)(AT0 /*UnixMountEntry*/ mount1, AT1 /*UnixMountEntry*/ mount2) nothrow {
28034 return g_unix_mount_compare(UpCast!(UnixMountEntry*)(mount1), UpCast!(UnixMountEntry*)(mount2));
28038 // Frees a unix mount.
28039 // <mount_entry>: a #GUnixMountEntry.
28040 static void unix_mount_free(AT0)(AT0 /*UnixMountEntry*/ mount_entry) nothrow {
28041 g_unix_mount_free(UpCast!(UnixMountEntry*)(mount_entry));
28045 // Gets the device path for a unix mount.
28046 // RETURNS: a string containing the device path.
28047 // <mount_entry>: a #GUnixMount.
28048 static char* unix_mount_get_device_path(AT0)(AT0 /*UnixMountEntry*/ mount_entry) nothrow {
28049 return g_unix_mount_get_device_path(UpCast!(UnixMountEntry*)(mount_entry));
28053 // Gets the filesystem type for the unix mount.
28054 // RETURNS: a string containing the file system type.
28055 // <mount_entry>: a #GUnixMount.
28056 static char* unix_mount_get_fs_type(AT0)(AT0 /*UnixMountEntry*/ mount_entry) nothrow {
28057 return g_unix_mount_get_fs_type(UpCast!(UnixMountEntry*)(mount_entry));
28061 // Gets the mount path for a unix mount.
28062 // RETURNS: the mount path for @mount_entry.
28063 // <mount_entry>: input #GUnixMountEntry to get the mount path for.
28064 static char* unix_mount_get_mount_path(AT0)(AT0 /*UnixMountEntry*/ mount_entry) nothrow {
28065 return g_unix_mount_get_mount_path(UpCast!(UnixMountEntry*)(mount_entry));
28069 // Guesses whether a Unix mount can be ejected.
28070 // RETURNS: %TRUE if @mount_entry is deemed to be ejectable.
28071 // <mount_entry>: a #GUnixMountEntry
28072 static int unix_mount_guess_can_eject(AT0)(AT0 /*UnixMountEntry*/ mount_entry) nothrow {
28073 return g_unix_mount_guess_can_eject(UpCast!(UnixMountEntry*)(mount_entry));
28077 // Guesses the icon of a Unix mount.
28078 // RETURNS: a #GIcon
28079 // <mount_entry>: a #GUnixMountEntry
28080 static Icon* /*new*/ unix_mount_guess_icon(AT0)(AT0 /*UnixMountEntry*/ mount_entry) nothrow {
28081 return g_unix_mount_guess_icon(UpCast!(UnixMountEntry*)(mount_entry));
28085 // Guesses the name of a Unix mount.
28086 // The result is a translated string.
28088 // be freed with g_free()
28089 // RETURNS: A newly allocated string that must
28090 // <mount_entry>: a #GUnixMountEntry
28091 static char* /*new*/ unix_mount_guess_name(AT0)(AT0 /*UnixMountEntry*/ mount_entry) nothrow {
28092 return g_unix_mount_guess_name(UpCast!(UnixMountEntry*)(mount_entry));
28096 // Guesses whether a Unix mount should be displayed in the UI.
28097 // RETURNS: %TRUE if @mount_entry is deemed to be displayable.
28098 // <mount_entry>: a #GUnixMountEntry
28099 static int unix_mount_guess_should_display(AT0)(AT0 /*UnixMountEntry*/ mount_entry) nothrow {
28100 return g_unix_mount_guess_should_display(UpCast!(UnixMountEntry*)(mount_entry));
28104 // Checks if a unix mount is mounted read only.
28105 // RETURNS: %TRUE if @mount_entry is read only.
28106 // <mount_entry>: a #GUnixMount.
28107 static int unix_mount_is_readonly(AT0)(AT0 /*UnixMountEntry*/ mount_entry) nothrow {
28108 return g_unix_mount_is_readonly(UpCast!(UnixMountEntry*)(mount_entry));
28112 // Checks if a unix mount is a system path.
28113 // RETURNS: %TRUE if the unix mount is for a system path.
28114 // <mount_entry>: a #GUnixMount.
28115 static int unix_mount_is_system_internal(AT0)(AT0 /*UnixMountEntry*/ mount_entry) nothrow {
28116 return g_unix_mount_is_system_internal(UpCast!(UnixMountEntry*)(mount_entry));
28120 // Checks if the unix mount points have changed since a given unix time.
28121 // RETURNS: %TRUE if the mount points have changed since @time.
28122 // <time>: guint64 to contain a timestamp.
28123 static int unix_mount_points_changed_since()(ulong time) nothrow {
28124 return g_unix_mount_points_changed_since(time);
28128 // Unintrospectable function: unix_mount_points_get() / g_unix_mount_points_get()
28129 // Gets a #GList of #GUnixMountPoint containing the unix mount points.
28130 // If @time_read is set, it will be filled with the mount timestamp,
28131 // allowing for checking if the mounts have changed with
28132 // g_unix_mount_points_changed_since().
28134 // a #GList of the UNIX mountpoints.
28135 // <time_read>: guint64 to contain a timestamp.
28136 static GLib2.List* /*new*/ unix_mount_points_get(AT0)(/*out*/ AT0 /*ulong*/ time_read=null) nothrow {
28137 return g_unix_mount_points_get(UpCast!(ulong*)(time_read));
28141 // Checks if the unix mounts have changed since a given unix time.
28142 // RETURNS: %TRUE if the mounts have changed since @time.
28143 // <time>: guint64 to contain a timestamp.
28144 static int unix_mounts_changed_since()(ulong time) nothrow {
28145 return g_unix_mounts_changed_since(time);
28149 // Unintrospectable function: unix_mounts_get() / g_unix_mounts_get()
28150 // Gets a #GList of #GUnixMountEntry containing the unix mounts.
28151 // If @time_read is set, it will be filled with the mount
28152 // timestamp, allowing for checking if the mounts have changed
28153 // with g_unix_mounts_changed_since().
28155 // a #GList of the UNIX mounts.
28156 // <time_read>: guint64 to contain a timestamp, or %NULL
28157 static GLib2.List* /*new*/ unix_mounts_get(AT0)(/*out*/ AT0 /*ulong*/ time_read=null) nothrow {
28158 return g_unix_mounts_get(UpCast!(ulong*)(time_read));
28162 // C prototypes:
28164 extern (C) {
28165 void g_action_activate(Action* this_, GLib2.Variant* parameter=null) nothrow;
28166 void g_action_change_state(Action* this_, GLib2.Variant* value) nothrow;
28167 int g_action_get_enabled(Action* this_) nothrow;
28168 char* g_action_get_name(Action* this_) nothrow;
28169 GLib2.VariantType* g_action_get_parameter_type(Action* this_) nothrow;
28170 GLib2.Variant* /*new*/ g_action_get_state(Action* this_) nothrow;
28171 GLib2.Variant* /*new*/ g_action_get_state_hint(Action* this_) nothrow;
28172 GLib2.VariantType* g_action_get_state_type(Action* this_) nothrow;
28173 void g_action_group_action_added(ActionGroup* this_, char* action_name) nothrow;
28174 void g_action_group_action_enabled_changed(ActionGroup* this_, char* action_name, int enabled) nothrow;
28175 void g_action_group_action_removed(ActionGroup* this_, char* action_name) nothrow;
28176 void g_action_group_action_state_changed(ActionGroup* this_, char* action_name, GLib2.Variant* state) nothrow;
28177 void g_action_group_activate_action(ActionGroup* this_, char* action_name, GLib2.Variant* parameter=null) nothrow;
28178 void g_action_group_change_action_state(ActionGroup* this_, char* action_name, GLib2.Variant* value) nothrow;
28179 int g_action_group_get_action_enabled(ActionGroup* this_, char* action_name) nothrow;
28180 GLib2.VariantType* g_action_group_get_action_parameter_type(ActionGroup* this_, char* action_name) nothrow;
28181 GLib2.Variant* /*new*/ g_action_group_get_action_state(ActionGroup* this_, char* action_name) nothrow;
28182 GLib2.Variant* /*new*/ g_action_group_get_action_state_hint(ActionGroup* this_, char* action_name) nothrow;
28183 GLib2.VariantType* /*new*/ g_action_group_get_action_state_type(ActionGroup* this_, char* action_name) nothrow;
28184 int g_action_group_has_action(ActionGroup* this_, char* action_name) nothrow;
28185 char** /*new*/ g_action_group_list_actions(ActionGroup* this_) nothrow;
28186 int g_action_group_query_action(ActionGroup* this_, char* action_name, /*out*/ int* enabled, /*out*/ GLib2.VariantType** parameter_type, /*out*/ GLib2.VariantType** state_type, /*out*/ GLib2.Variant** state_hint, /*out*/ GLib2.Variant** state) nothrow;
28187 void g_action_map_add_action(ActionMap* this_, Action* action) nothrow;
28188 void g_action_map_add_action_entries(ActionMap* this_, ActionEntry* entries, int n_entries, void* user_data) nothrow;
28189 Action* g_action_map_lookup_action(ActionMap* this_, char* action_name) nothrow;
28190 void g_action_map_remove_action(ActionMap* this_, char* action_name) nothrow;
28191 AppInfo* /*new*/ g_app_info_create_from_commandline(char* commandline, char* application_name, AppInfoCreateFlags flags, GLib2.Error** error) nothrow;
28192 GLib2.List* /*new*/ g_app_info_get_all() nothrow;
28193 GLib2.List* /*new*/ g_app_info_get_all_for_type(char* content_type) nothrow;
28194 AppInfo* /*new*/ g_app_info_get_default_for_type(char* content_type, int must_support_uris) nothrow;
28195 AppInfo* /*new*/ g_app_info_get_default_for_uri_scheme(char* uri_scheme) nothrow;
28196 GLib2.List* /*new*/ g_app_info_get_fallback_for_type(char* content_type) nothrow;
28197 GLib2.List* /*new*/ g_app_info_get_recommended_for_type(char* content_type) nothrow;
28198 int g_app_info_launch_default_for_uri(char* uri, AppLaunchContext* launch_context, GLib2.Error** error) nothrow;
28199 void g_app_info_reset_type_associations(char* content_type) nothrow;
28200 int g_app_info_add_supports_type(AppInfo* this_, char* content_type, GLib2.Error** error) nothrow;
28201 int g_app_info_can_delete(AppInfo* this_) nothrow;
28202 int g_app_info_can_remove_supports_type(AppInfo* this_) nothrow;
28203 int g_app_info_delete(AppInfo* this_) nothrow;
28204 AppInfo* /*new*/ g_app_info_dup(AppInfo* this_) nothrow;
28205 int g_app_info_equal(AppInfo* this_, AppInfo* appinfo2) nothrow;
28206 char* g_app_info_get_commandline(AppInfo* this_) nothrow;
28207 char* g_app_info_get_description(AppInfo* this_) nothrow;
28208 char* g_app_info_get_display_name(AppInfo* this_) nothrow;
28209 char* g_app_info_get_executable(AppInfo* this_) nothrow;
28210 Icon* g_app_info_get_icon(AppInfo* this_) nothrow;
28211 char* g_app_info_get_id(AppInfo* this_) nothrow;
28212 char* g_app_info_get_name(AppInfo* this_) nothrow;
28213 int g_app_info_launch(AppInfo* this_, GLib2.List* files, AppLaunchContext* launch_context, GLib2.Error** error) nothrow;
28214 int g_app_info_launch_uris(AppInfo* this_, GLib2.List* uris, AppLaunchContext* launch_context, GLib2.Error** error) nothrow;
28215 int g_app_info_remove_supports_type(AppInfo* this_, char* content_type, GLib2.Error** error) nothrow;
28216 int g_app_info_set_as_default_for_extension(AppInfo* this_, char* extension, GLib2.Error** error) nothrow;
28217 int g_app_info_set_as_default_for_type(AppInfo* this_, char* content_type, GLib2.Error** error) nothrow;
28218 int g_app_info_set_as_last_used_for_type(AppInfo* this_, char* content_type, GLib2.Error** error) nothrow;
28219 int g_app_info_should_show(AppInfo* this_) nothrow;
28220 int g_app_info_supports_files(AppInfo* this_) nothrow;
28221 int g_app_info_supports_uris(AppInfo* this_) nothrow;
28222 AppLaunchContext* /*new*/ g_app_launch_context_new() nothrow;
28223 char* /*new*/ g_app_launch_context_get_display(AppLaunchContext* this_, AppInfo* info, GLib2.List* files) nothrow;
28224 char** /*new*/ g_app_launch_context_get_environment(AppLaunchContext* this_) nothrow;
28225 char* /*new*/ g_app_launch_context_get_startup_notify_id(AppLaunchContext* this_, AppInfo* info, GLib2.List* files) nothrow;
28226 void g_app_launch_context_launch_failed(AppLaunchContext* this_, char* startup_notify_id) nothrow;
28227 void g_app_launch_context_setenv(AppLaunchContext* this_, char* variable, char* value) nothrow;
28228 void g_app_launch_context_unsetenv(AppLaunchContext* this_, char* variable) nothrow;
28229 Application* /*new*/ g_application_new(char* application_id, ApplicationFlags flags) nothrow;
28230 Application* g_application_get_default() nothrow;
28231 int g_application_id_is_valid(char* application_id) nothrow;
28232 void g_application_activate(Application* this_) nothrow;
28233 char* g_application_get_application_id(Application* this_) nothrow;
28234 ApplicationFlags g_application_get_flags(Application* this_) nothrow;
28235 uint g_application_get_inactivity_timeout(Application* this_) nothrow;
28236 int g_application_get_is_registered(Application* this_) nothrow;
28237 int g_application_get_is_remote(Application* this_) nothrow;
28238 void g_application_hold(Application* this_) nothrow;
28239 void g_application_open(Application* this_, File** files, int n_files, char* hint) nothrow;
28240 void g_application_quit(Application* this_) nothrow;
28241 int g_application_register(Application* this_, Cancellable* cancellable, GLib2.Error** error) nothrow;
28242 void g_application_release(Application* this_) nothrow;
28243 int g_application_run(Application* this_, int argc, char** argv=null) nothrow;
28244 void g_application_set_action_group(Application* this_, ActionGroup* action_group=null) nothrow;
28245 void g_application_set_application_id(Application* this_, char* application_id) nothrow;
28246 void g_application_set_default(Application* this_) nothrow;
28247 void g_application_set_flags(Application* this_, ApplicationFlags flags) nothrow;
28248 void g_application_set_inactivity_timeout(Application* this_, uint inactivity_timeout) nothrow;
28249 char** /*new*/ g_application_command_line_get_arguments(ApplicationCommandLine* this_, /*out*/ int* argc) nothrow;
28250 char* g_application_command_line_get_cwd(ApplicationCommandLine* this_) nothrow;
28251 char** g_application_command_line_get_environ(ApplicationCommandLine* this_) nothrow;
28252 int g_application_command_line_get_exit_status(ApplicationCommandLine* this_) nothrow;
28253 int g_application_command_line_get_is_remote(ApplicationCommandLine* this_) nothrow;
28254 GLib2.Variant* /*new*/ g_application_command_line_get_platform_data(ApplicationCommandLine* this_) nothrow;
28255 char* g_application_command_line_getenv(ApplicationCommandLine* this_, char* name) nothrow;
28256 void g_application_command_line_print(ApplicationCommandLine* this_, char* format, ...) nothrow;
28257 void g_application_command_line_printerr(ApplicationCommandLine* this_, char* format, ...) nothrow;
28258 void g_application_command_line_set_exit_status(ApplicationCommandLine* this_, int exit_status) nothrow;
28259 void g_async_initable_new_async(Type object_type, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data, char* first_property_name, ...) nothrow;
28260 void g_async_initable_new_valist_async(Type object_type, char* first_property_name, va_list var_args, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28261 void g_async_initable_newv_async(Type object_type, uint n_parameters, GObject2.Parameter* parameters, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28262 void g_async_initable_init_async(AsyncInitable* this_, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28263 int g_async_initable_init_finish(AsyncInitable* this_, AsyncResult* res, GLib2.Error** error) nothrow;
28264 GObject2.Object* /*new*/ g_async_initable_new_finish(AsyncInitable* this_, AsyncResult* res, GLib2.Error** error) nothrow;
28265 GObject2.Object* /*new*/ g_async_result_get_source_object(AsyncResult* this_) nothrow;
28266 void* /*new*/ g_async_result_get_user_data(AsyncResult* this_) nothrow;
28267 BufferedInputStream* /*new*/ g_buffered_input_stream_new(InputStream* base_stream) nothrow;
28268 BufferedInputStream* /*new*/ g_buffered_input_stream_new_sized(InputStream* base_stream, size_t size) nothrow;
28269 ssize_t g_buffered_input_stream_fill(BufferedInputStream* this_, ssize_t count, Cancellable* cancellable, GLib2.Error** error) nothrow;
28270 void g_buffered_input_stream_fill_async(BufferedInputStream* this_, ssize_t count, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28271 ssize_t g_buffered_input_stream_fill_finish(BufferedInputStream* this_, AsyncResult* result, GLib2.Error** error) nothrow;
28272 size_t g_buffered_input_stream_get_available(BufferedInputStream* this_) nothrow;
28273 size_t g_buffered_input_stream_get_buffer_size(BufferedInputStream* this_) nothrow;
28274 size_t g_buffered_input_stream_peek(BufferedInputStream* this_, ubyte* buffer, size_t offset, size_t count) nothrow;
28275 ubyte* g_buffered_input_stream_peek_buffer(BufferedInputStream* this_, /*out*/ size_t* count) nothrow;
28276 int g_buffered_input_stream_read_byte(BufferedInputStream* this_, Cancellable* cancellable, GLib2.Error** error) nothrow;
28277 void g_buffered_input_stream_set_buffer_size(BufferedInputStream* this_, size_t size) nothrow;
28278 BufferedOutputStream* /*new*/ g_buffered_output_stream_new(OutputStream* base_stream) nothrow;
28279 BufferedOutputStream* /*new*/ g_buffered_output_stream_new_sized(OutputStream* base_stream, size_t size) nothrow;
28280 int g_buffered_output_stream_get_auto_grow(BufferedOutputStream* this_) nothrow;
28281 size_t g_buffered_output_stream_get_buffer_size(BufferedOutputStream* this_) nothrow;
28282 void g_buffered_output_stream_set_auto_grow(BufferedOutputStream* this_, int auto_grow) nothrow;
28283 void g_buffered_output_stream_set_buffer_size(BufferedOutputStream* this_, size_t size) nothrow;
28284 Cancellable* /*new*/ g_cancellable_new() nothrow;
28285 Cancellable* g_cancellable_get_current() nothrow;
28286 void g_cancellable_cancel(Cancellable* this_) nothrow;
28287 c_ulong g_cancellable_connect(Cancellable* this_, GObject2.Callback callback, void* data, GLib2.DestroyNotify data_destroy_func) nothrow;
28288 void g_cancellable_disconnect(Cancellable* this_, c_ulong handler_id) nothrow;
28289 int g_cancellable_get_fd(Cancellable* this_) nothrow;
28290 int g_cancellable_is_cancelled(Cancellable* this_) nothrow;
28291 int g_cancellable_make_pollfd(Cancellable* this_, GLib2.PollFD* pollfd) nothrow;
28292 void g_cancellable_pop_current(Cancellable* this_) nothrow;
28293 void g_cancellable_push_current(Cancellable* this_) nothrow;
28294 void g_cancellable_release_fd(Cancellable* this_) nothrow;
28295 void g_cancellable_reset(Cancellable* this_) nothrow;
28296 int g_cancellable_set_error_if_cancelled(Cancellable* this_, GLib2.Error** error) nothrow;
28297 GLib2.Source* /*new*/ g_cancellable_source_new(Cancellable* this_) nothrow;
28298 CharsetConverter* /*new*/ g_charset_converter_new(char* to_charset, char* from_charset, GLib2.Error** error) nothrow;
28299 uint g_charset_converter_get_num_fallbacks(CharsetConverter* this_) nothrow;
28300 int g_charset_converter_get_use_fallback(CharsetConverter* this_) nothrow;
28301 void g_charset_converter_set_use_fallback(CharsetConverter* this_, int use_fallback) nothrow;
28302 ConverterResult g_converter_convert(Converter* this_, ubyte* inbuf, size_t inbuf_size, void* outbuf, size_t outbuf_size, ConverterFlags flags, /*out*/ size_t* bytes_read, /*out*/ size_t* bytes_written, GLib2.Error** error) nothrow;
28303 void g_converter_reset(Converter* this_) nothrow;
28304 ConverterInputStream* /*new*/ g_converter_input_stream_new(InputStream* base_stream, Converter* converter) nothrow;
28305 Converter* g_converter_input_stream_get_converter(ConverterInputStream* this_) nothrow;
28306 ConverterOutputStream* /*new*/ g_converter_output_stream_new(OutputStream* base_stream, Converter* converter) nothrow;
28307 Converter* g_converter_output_stream_get_converter(ConverterOutputStream* this_) nothrow;
28308 Credentials* /*new*/ g_credentials_new() nothrow;
28309 void* g_credentials_get_native(Credentials* this_, CredentialsType native_type) nothrow;
28310 uint g_credentials_get_unix_user(Credentials* this_, GLib2.Error** error) nothrow;
28311 int g_credentials_is_same_user(Credentials* this_, Credentials* other_credentials, GLib2.Error** error) nothrow;
28312 void g_credentials_set_native(Credentials* this_, CredentialsType native_type, void* native) nothrow;
28313 int g_credentials_set_unix_user(Credentials* this_, uint uid, GLib2.Error** error) nothrow;
28314 char* /*new*/ g_credentials_to_string(Credentials* this_) nothrow;
28315 DBusActionGroup* /*new*/ g_dbus_action_group_get(DBusConnection* connection, char* bus_name, char* object_path) nothrow;
28316 DBusAnnotationInfo* /*new*/ g_dbus_annotation_info_ref(DBusAnnotationInfo* this_) nothrow;
28317 void g_dbus_annotation_info_unref(DBusAnnotationInfo* this_) nothrow;
28318 char* g_dbus_annotation_info_lookup(DBusAnnotationInfo** annotations, char* name) nothrow;
28319 DBusArgInfo* /*new*/ g_dbus_arg_info_ref(DBusArgInfo* this_) nothrow;
28320 void g_dbus_arg_info_unref(DBusArgInfo* this_) nothrow;
28321 DBusAuthObserver* /*new*/ g_dbus_auth_observer_new() nothrow;
28322 int g_dbus_auth_observer_authorize_authenticated_peer(DBusAuthObserver* this_, IOStream* stream, Credentials* credentials) nothrow;
28323 DBusConnection* /*new*/ g_dbus_connection_new_finish(AsyncResult* res, GLib2.Error** error) nothrow;
28324 DBusConnection* /*new*/ g_dbus_connection_new_for_address_finish(AsyncResult* res, GLib2.Error** error) nothrow;
28325 DBusConnection* /*new*/ g_dbus_connection_new_for_address_sync(char* address, DBusConnectionFlags flags, DBusAuthObserver* observer, Cancellable* cancellable, GLib2.Error** error) nothrow;
28326 DBusConnection* /*new*/ g_dbus_connection_new_sync(IOStream* stream, char* guid, DBusConnectionFlags flags, DBusAuthObserver* observer, Cancellable* cancellable, GLib2.Error** error) nothrow;
28327 void g_dbus_connection_new(IOStream* stream, char* guid, DBusConnectionFlags flags, DBusAuthObserver* observer, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28328 void g_dbus_connection_new_for_address(char* address, DBusConnectionFlags flags, DBusAuthObserver* observer, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28329 uint g_dbus_connection_add_filter(DBusConnection* this_, DBusMessageFilterFunction filter_function, void* user_data, GLib2.DestroyNotify user_data_free_func) nothrow;
28330 void g_dbus_connection_call(DBusConnection* this_, char* bus_name, char* object_path, char* interface_name, char* method_name, GLib2.Variant* parameters, GLib2.VariantType* reply_type, DBusCallFlags flags, int timeout_msec, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28331 GLib2.Variant* /*new*/ g_dbus_connection_call_finish(DBusConnection* this_, AsyncResult* res, GLib2.Error** error) nothrow;
28332 GLib2.Variant* /*new*/ g_dbus_connection_call_sync(DBusConnection* this_, char* bus_name, char* object_path, char* interface_name, char* method_name, GLib2.Variant* parameters, GLib2.VariantType* reply_type, DBusCallFlags flags, int timeout_msec, Cancellable* cancellable, GLib2.Error** error) nothrow;
28333 void g_dbus_connection_call_with_unix_fd_list(DBusConnection* this_, char* bus_name, char* object_path, char* interface_name, char* method_name, GLib2.Variant* parameters, GLib2.VariantType* reply_type, DBusCallFlags flags, int timeout_msec, UnixFDList* fd_list, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28334 GLib2.Variant* /*new*/ g_dbus_connection_call_with_unix_fd_list_finish(DBusConnection* this_, /*out*/ UnixFDList** out_fd_list, AsyncResult* res, GLib2.Error** error) nothrow;
28335 GLib2.Variant* /*new*/ g_dbus_connection_call_with_unix_fd_list_sync(DBusConnection* this_, char* bus_name, char* object_path, char* interface_name, char* method_name, GLib2.Variant* parameters, GLib2.VariantType* reply_type, DBusCallFlags flags, int timeout_msec, UnixFDList* fd_list, /*out*/ UnixFDList** out_fd_list, Cancellable* cancellable, GLib2.Error** error) nothrow;
28336 void g_dbus_connection_close(DBusConnection* this_, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28337 int g_dbus_connection_close_finish(DBusConnection* this_, AsyncResult* res, GLib2.Error** error) nothrow;
28338 int g_dbus_connection_close_sync(DBusConnection* this_, Cancellable* cancellable, GLib2.Error** error) nothrow;
28339 int g_dbus_connection_emit_signal(DBusConnection* this_, char* destination_bus_name, char* object_path, char* interface_name, char* signal_name, GLib2.Variant* parameters, GLib2.Error** error) nothrow;
28340 uint g_dbus_connection_export_action_group(DBusConnection* this_, char* object_path, ActionGroup* action_group, GLib2.Error** error) nothrow;
28341 uint g_dbus_connection_export_menu_model(DBusConnection* this_, char* object_path, MenuModel* menu, GLib2.Error** error) nothrow;
28342 void g_dbus_connection_flush(DBusConnection* this_, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28343 int g_dbus_connection_flush_finish(DBusConnection* this_, AsyncResult* res, GLib2.Error** error) nothrow;
28344 int g_dbus_connection_flush_sync(DBusConnection* this_, Cancellable* cancellable, GLib2.Error** error) nothrow;
28345 DBusCapabilityFlags g_dbus_connection_get_capabilities(DBusConnection* this_) nothrow;
28346 int g_dbus_connection_get_exit_on_close(DBusConnection* this_) nothrow;
28347 char* g_dbus_connection_get_guid(DBusConnection* this_) nothrow;
28348 Credentials* g_dbus_connection_get_peer_credentials(DBusConnection* this_) nothrow;
28349 IOStream* g_dbus_connection_get_stream(DBusConnection* this_) nothrow;
28350 char* g_dbus_connection_get_unique_name(DBusConnection* this_) nothrow;
28351 int g_dbus_connection_is_closed(DBusConnection* this_) nothrow;
28352 uint g_dbus_connection_register_object(DBusConnection* this_, char* object_path, DBusInterfaceInfo* interface_info, DBusInterfaceVTable* vtable, void* user_data, GLib2.DestroyNotify user_data_free_func, GLib2.Error** error) nothrow;
28353 uint g_dbus_connection_register_subtree(DBusConnection* this_, char* object_path, DBusSubtreeVTable* vtable, DBusSubtreeFlags flags, void* user_data, GLib2.DestroyNotify user_data_free_func, GLib2.Error** error) nothrow;
28354 void g_dbus_connection_remove_filter(DBusConnection* this_, uint filter_id) nothrow;
28355 int g_dbus_connection_send_message(DBusConnection* this_, DBusMessage* message, DBusSendMessageFlags flags, /*out*/ uint* out_serial, GLib2.Error** error) nothrow;
28356 void g_dbus_connection_send_message_with_reply(DBusConnection* this_, DBusMessage* message, DBusSendMessageFlags flags, int timeout_msec, /*out*/ uint* out_serial, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28357 DBusMessage* /*new*/ g_dbus_connection_send_message_with_reply_finish(DBusConnection* this_, AsyncResult* res, GLib2.Error** error) nothrow;
28358 DBusMessage* /*new*/ g_dbus_connection_send_message_with_reply_sync(DBusConnection* this_, DBusMessage* message, DBusSendMessageFlags flags, int timeout_msec, /*out*/ uint* out_serial, Cancellable* cancellable, GLib2.Error** error) nothrow;
28359 void g_dbus_connection_set_exit_on_close(DBusConnection* this_, int exit_on_close) nothrow;
28360 uint g_dbus_connection_signal_subscribe(DBusConnection* this_, char* sender, char* interface_name, char* member, char* object_path, char* arg0, DBusSignalFlags flags, DBusSignalCallback callback, void* user_data, GLib2.DestroyNotify user_data_free_func=null) nothrow;
28361 void g_dbus_connection_signal_unsubscribe(DBusConnection* this_, uint subscription_id) nothrow;
28362 void g_dbus_connection_start_message_processing(DBusConnection* this_) nothrow;
28363 void g_dbus_connection_unexport_action_group(DBusConnection* this_, uint export_id) nothrow;
28364 void g_dbus_connection_unexport_menu_model(DBusConnection* this_, uint export_id) nothrow;
28365 int g_dbus_connection_unregister_object(DBusConnection* this_, uint registration_id) nothrow;
28366 int g_dbus_connection_unregister_subtree(DBusConnection* this_, uint registration_id) nothrow;
28367 DBusObject* /*new*/ g_dbus_interface_dup_object(DBusInterface* this_) nothrow;
28368 DBusInterfaceInfo* g_dbus_interface_get_info(DBusInterface* this_) nothrow;
28369 DBusObject* g_dbus_interface_get_object(DBusInterface* this_) nothrow;
28370 void g_dbus_interface_set_object(DBusInterface* this_, DBusObject* object) nothrow;
28371 void g_dbus_interface_info_cache_build(DBusInterfaceInfo* this_) nothrow;
28372 void g_dbus_interface_info_cache_release(DBusInterfaceInfo* this_) nothrow;
28373 void g_dbus_interface_info_generate_xml(DBusInterfaceInfo* this_, uint indent, /*out*/ GLib2.String* string_builder) nothrow;
28374 DBusMethodInfo* g_dbus_interface_info_lookup_method(DBusInterfaceInfo* this_, char* name) nothrow;
28375 DBusPropertyInfo* g_dbus_interface_info_lookup_property(DBusInterfaceInfo* this_, char* name) nothrow;
28376 DBusSignalInfo* g_dbus_interface_info_lookup_signal(DBusInterfaceInfo* this_, char* name) nothrow;
28377 DBusInterfaceInfo* /*new*/ g_dbus_interface_info_ref(DBusInterfaceInfo* this_) nothrow;
28378 void g_dbus_interface_info_unref(DBusInterfaceInfo* this_) nothrow;
28379 int g_dbus_interface_skeleton_export(DBusInterfaceSkeleton* this_, DBusConnection* connection, char* object_path, GLib2.Error** error) nothrow;
28380 void g_dbus_interface_skeleton_flush(DBusInterfaceSkeleton* this_) nothrow;
28381 DBusConnection* g_dbus_interface_skeleton_get_connection(DBusInterfaceSkeleton* this_) nothrow;
28382 GLib2.List* /*new*/ g_dbus_interface_skeleton_get_connections(DBusInterfaceSkeleton* this_) nothrow;
28383 DBusInterfaceSkeletonFlags g_dbus_interface_skeleton_get_flags(DBusInterfaceSkeleton* this_) nothrow;
28384 DBusInterfaceInfo* g_dbus_interface_skeleton_get_info(DBusInterfaceSkeleton* this_) nothrow;
28385 char* g_dbus_interface_skeleton_get_object_path(DBusInterfaceSkeleton* this_) nothrow;
28386 GLib2.Variant* /*new*/ g_dbus_interface_skeleton_get_properties(DBusInterfaceSkeleton* this_) nothrow;
28387 DBusInterfaceVTable* g_dbus_interface_skeleton_get_vtable(DBusInterfaceSkeleton* this_) nothrow;
28388 int g_dbus_interface_skeleton_has_connection(DBusInterfaceSkeleton* this_, DBusConnection* connection) nothrow;
28389 void g_dbus_interface_skeleton_set_flags(DBusInterfaceSkeleton* this_, DBusInterfaceSkeletonFlags flags) nothrow;
28390 void g_dbus_interface_skeleton_unexport(DBusInterfaceSkeleton* this_) nothrow;
28391 void g_dbus_interface_skeleton_unexport_from_connection(DBusInterfaceSkeleton* this_, DBusConnection* connection) nothrow;
28392 DBusMenuModel* /*new*/ g_dbus_menu_model_get(DBusConnection* connection, char* bus_name, char* object_path) nothrow;
28393 DBusMessage* /*new*/ g_dbus_message_new() nothrow;
28394 DBusMessage* /*new*/ g_dbus_message_new_from_blob(ubyte* blob, size_t blob_len, DBusCapabilityFlags capabilities, GLib2.Error** error) nothrow;
28395 DBusMessage* /*new*/ g_dbus_message_new_method_call(char* name, char* path, char* interface_, char* method) nothrow;
28396 DBusMessage* /*new*/ g_dbus_message_new_signal(char* path, char* interface_, char* signal) nothrow;
28397 ssize_t g_dbus_message_bytes_needed(ubyte* blob, size_t blob_len, GLib2.Error** error) nothrow;
28398 DBusMessage* /*new*/ g_dbus_message_copy(DBusMessage* this_, GLib2.Error** error) nothrow;
28399 char* g_dbus_message_get_arg0(DBusMessage* this_) nothrow;
28400 GLib2.Variant* /*new*/ g_dbus_message_get_body(DBusMessage* this_) nothrow;
28401 DBusMessageByteOrder g_dbus_message_get_byte_order(DBusMessage* this_) nothrow;
28402 char* g_dbus_message_get_destination(DBusMessage* this_) nothrow;
28403 char* g_dbus_message_get_error_name(DBusMessage* this_) nothrow;
28404 DBusMessageFlags g_dbus_message_get_flags(DBusMessage* this_) nothrow;
28405 GLib2.Variant* /*new*/ g_dbus_message_get_header(DBusMessage* this_, DBusMessageHeaderField header_field) nothrow;
28406 ubyte* g_dbus_message_get_header_fields(DBusMessage* this_) nothrow;
28407 char* g_dbus_message_get_interface(DBusMessage* this_) nothrow;
28408 int g_dbus_message_get_locked(DBusMessage* this_) nothrow;
28409 char* g_dbus_message_get_member(DBusMessage* this_) nothrow;
28410 DBusMessageType g_dbus_message_get_message_type(DBusMessage* this_) nothrow;
28411 uint g_dbus_message_get_num_unix_fds(DBusMessage* this_) nothrow;
28412 char* g_dbus_message_get_path(DBusMessage* this_) nothrow;
28413 uint g_dbus_message_get_reply_serial(DBusMessage* this_) nothrow;
28414 char* g_dbus_message_get_sender(DBusMessage* this_) nothrow;
28415 uint g_dbus_message_get_serial(DBusMessage* this_) nothrow;
28416 char* g_dbus_message_get_signature(DBusMessage* this_) nothrow;
28417 UnixFDList* g_dbus_message_get_unix_fd_list(DBusMessage* this_) nothrow;
28418 void g_dbus_message_lock(DBusMessage* this_) nothrow;
28419 DBusMessage* /*new*/ g_dbus_message_new_method_error(DBusMessage* this_, char* error_name, char* error_message_format, ...) nothrow;
28420 DBusMessage* /*new*/ g_dbus_message_new_method_error_literal(DBusMessage* this_, char* error_name, char* error_message) nothrow;
28421 DBusMessage* /*new*/ g_dbus_message_new_method_error_valist(DBusMessage* this_, char* error_name, char* error_message_format, va_list var_args) nothrow;
28422 DBusMessage* /*new*/ g_dbus_message_new_method_reply(DBusMessage* this_) nothrow;
28423 char* /*new*/ g_dbus_message_print(DBusMessage* this_, uint indent) nothrow;
28424 void g_dbus_message_set_body(DBusMessage* this_, GLib2.Variant* body_) nothrow;
28425 void g_dbus_message_set_byte_order(DBusMessage* this_, DBusMessageByteOrder byte_order) nothrow;
28426 void g_dbus_message_set_destination(DBusMessage* this_, char* value) nothrow;
28427 void g_dbus_message_set_error_name(DBusMessage* this_, char* value) nothrow;
28428 void g_dbus_message_set_flags(DBusMessage* this_, DBusMessageFlags flags) nothrow;
28429 void g_dbus_message_set_header(DBusMessage* this_, DBusMessageHeaderField header_field, GLib2.Variant* value) nothrow;
28430 void g_dbus_message_set_interface(DBusMessage* this_, char* value) nothrow;
28431 void g_dbus_message_set_member(DBusMessage* this_, char* value) nothrow;
28432 void g_dbus_message_set_message_type(DBusMessage* this_, DBusMessageType type) nothrow;
28433 void g_dbus_message_set_num_unix_fds(DBusMessage* this_, uint value) nothrow;
28434 void g_dbus_message_set_path(DBusMessage* this_, char* value) nothrow;
28435 void g_dbus_message_set_reply_serial(DBusMessage* this_, uint value) nothrow;
28436 void g_dbus_message_set_sender(DBusMessage* this_, char* value) nothrow;
28437 void g_dbus_message_set_serial(DBusMessage* this_, uint serial) nothrow;
28438 void g_dbus_message_set_signature(DBusMessage* this_, char* value) nothrow;
28439 void g_dbus_message_set_unix_fd_list(DBusMessage* this_, UnixFDList* fd_list=null) nothrow;
28440 ubyte* /*new*/ g_dbus_message_to_blob(DBusMessage* this_, /*out*/ size_t* out_size, DBusCapabilityFlags capabilities, GLib2.Error** error) nothrow;
28441 int g_dbus_message_to_gerror(DBusMessage* this_, GLib2.Error** error) nothrow;
28442 DBusMethodInfo* /*new*/ g_dbus_method_info_ref(DBusMethodInfo* this_) nothrow;
28443 void g_dbus_method_info_unref(DBusMethodInfo* this_) nothrow;
28444 DBusConnection* g_dbus_method_invocation_get_connection(DBusMethodInvocation* this_) nothrow;
28445 char* g_dbus_method_invocation_get_interface_name(DBusMethodInvocation* this_) nothrow;
28446 DBusMessage* g_dbus_method_invocation_get_message(DBusMethodInvocation* this_) nothrow;
28447 DBusMethodInfo* g_dbus_method_invocation_get_method_info(DBusMethodInvocation* this_) nothrow;
28448 char* g_dbus_method_invocation_get_method_name(DBusMethodInvocation* this_) nothrow;
28449 char* g_dbus_method_invocation_get_object_path(DBusMethodInvocation* this_) nothrow;
28450 GLib2.Variant* g_dbus_method_invocation_get_parameters(DBusMethodInvocation* this_) nothrow;
28451 char* g_dbus_method_invocation_get_sender(DBusMethodInvocation* this_) nothrow;
28452 void* g_dbus_method_invocation_get_user_data(DBusMethodInvocation* this_) nothrow;
28453 void g_dbus_method_invocation_return_dbus_error(DBusMethodInvocation* this_, char* error_name, char* error_message) nothrow;
28454 void g_dbus_method_invocation_return_error(DBusMethodInvocation* this_, GLib2.Quark domain, int code, char* format, ...) nothrow;
28455 void g_dbus_method_invocation_return_error_literal(DBusMethodInvocation* this_, GLib2.Quark domain, int code, char* message) nothrow;
28456 void g_dbus_method_invocation_return_error_valist(DBusMethodInvocation* this_, GLib2.Quark domain, int code, char* format, va_list var_args) nothrow;
28457 void g_dbus_method_invocation_return_gerror(DBusMethodInvocation* this_, GLib2.Error* error) nothrow;
28458 void g_dbus_method_invocation_return_value(DBusMethodInvocation* this_, GLib2.Variant* parameters=null) nothrow;
28459 void g_dbus_method_invocation_return_value_with_unix_fd_list(DBusMethodInvocation* this_, GLib2.Variant* parameters=null, UnixFDList* fd_list=null) nothrow;
28460 void g_dbus_method_invocation_take_error(DBusMethodInvocation* this_, GLib2.Error* error) nothrow;
28461 DBusNodeInfo* /*new*/ g_dbus_node_info_new_for_xml(char* xml_data, GLib2.Error** error) nothrow;
28462 void g_dbus_node_info_generate_xml(DBusNodeInfo* this_, uint indent, /*out*/ GLib2.String* string_builder) nothrow;
28463 DBusInterfaceInfo* g_dbus_node_info_lookup_interface(DBusNodeInfo* this_, char* name) nothrow;
28464 DBusNodeInfo* /*new*/ g_dbus_node_info_ref(DBusNodeInfo* this_) nothrow;
28465 void g_dbus_node_info_unref(DBusNodeInfo* this_) nothrow;
28466 DBusInterface* /*new*/ g_dbus_object_get_interface(DBusObject* this_, char* interface_name) nothrow;
28467 GLib2.List* /*new*/ g_dbus_object_get_interfaces(DBusObject* this_) nothrow;
28468 char* g_dbus_object_get_object_path(DBusObject* this_) nothrow;
28469 DBusInterface* /*new*/ g_dbus_object_manager_get_interface(DBusObjectManager* this_, char* object_path, char* interface_name) nothrow;
28470 DBusObject* /*new*/ g_dbus_object_manager_get_object(DBusObjectManager* this_, char* object_path) nothrow;
28471 char* g_dbus_object_manager_get_object_path(DBusObjectManager* this_) nothrow;
28472 GLib2.List* /*new*/ g_dbus_object_manager_get_objects(DBusObjectManager* this_) nothrow;
28473 DBusObjectManagerClient* /*new*/ g_dbus_object_manager_client_new_finish(AsyncResult* res, GLib2.Error** error) nothrow;
28474 DBusObjectManagerClient* /*new*/ g_dbus_object_manager_client_new_for_bus_finish(AsyncResult* res, GLib2.Error** error) nothrow;
28475 DBusObjectManagerClient* /*new*/ g_dbus_object_manager_client_new_for_bus_sync(BusType bus_type, DBusObjectManagerClientFlags flags, char* name, char* object_path, DBusProxyTypeFunc get_proxy_type_func, void* get_proxy_type_user_data, GLib2.DestroyNotify get_proxy_type_destroy_notify, Cancellable* cancellable, GLib2.Error** error) nothrow;
28476 DBusObjectManagerClient* /*new*/ g_dbus_object_manager_client_new_sync(DBusConnection* connection, DBusObjectManagerClientFlags flags, char* name, char* object_path, DBusProxyTypeFunc get_proxy_type_func, void* get_proxy_type_user_data, GLib2.DestroyNotify get_proxy_type_destroy_notify, Cancellable* cancellable, GLib2.Error** error) nothrow;
28477 void g_dbus_object_manager_client_new(DBusConnection* connection, DBusObjectManagerClientFlags flags, char* name, char* object_path, DBusProxyTypeFunc get_proxy_type_func, void* get_proxy_type_user_data, GLib2.DestroyNotify get_proxy_type_destroy_notify, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28478 void g_dbus_object_manager_client_new_for_bus(BusType bus_type, DBusObjectManagerClientFlags flags, char* name, char* object_path, DBusProxyTypeFunc get_proxy_type_func, void* get_proxy_type_user_data, GLib2.DestroyNotify get_proxy_type_destroy_notify, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28479 DBusConnection* g_dbus_object_manager_client_get_connection(DBusObjectManagerClient* this_) nothrow;
28480 DBusObjectManagerClientFlags g_dbus_object_manager_client_get_flags(DBusObjectManagerClient* this_) nothrow;
28481 char* g_dbus_object_manager_client_get_name(DBusObjectManagerClient* this_) nothrow;
28482 char* /*new*/ g_dbus_object_manager_client_get_name_owner(DBusObjectManagerClient* this_) nothrow;
28483 DBusObjectManagerServer* /*new*/ g_dbus_object_manager_server_new(char* object_path) nothrow;
28484 void g_dbus_object_manager_server_export(DBusObjectManagerServer* this_, DBusObjectSkeleton* object) nothrow;
28485 void g_dbus_object_manager_server_export_uniquely(DBusObjectManagerServer* this_, DBusObjectSkeleton* object) nothrow;
28486 DBusConnection* /*new*/ g_dbus_object_manager_server_get_connection(DBusObjectManagerServer* this_) nothrow;
28487 void g_dbus_object_manager_server_set_connection(DBusObjectManagerServer* this_, DBusConnection* connection=null) nothrow;
28488 int g_dbus_object_manager_server_unexport(DBusObjectManagerServer* this_, char* object_path) nothrow;
28489 DBusObjectProxy* /*new*/ g_dbus_object_proxy_new(DBusConnection* connection, char* object_path) nothrow;
28490 DBusConnection* g_dbus_object_proxy_get_connection(DBusObjectProxy* this_) nothrow;
28491 DBusObjectSkeleton* /*new*/ g_dbus_object_skeleton_new(char* object_path) nothrow;
28492 void g_dbus_object_skeleton_add_interface(DBusObjectSkeleton* this_, DBusInterfaceSkeleton* interface_) nothrow;
28493 void g_dbus_object_skeleton_flush(DBusObjectSkeleton* this_) nothrow;
28494 void g_dbus_object_skeleton_remove_interface(DBusObjectSkeleton* this_, DBusInterfaceSkeleton* interface_) nothrow;
28495 void g_dbus_object_skeleton_remove_interface_by_name(DBusObjectSkeleton* this_, char* interface_name) nothrow;
28496 void g_dbus_object_skeleton_set_object_path(DBusObjectSkeleton* this_, char* object_path) nothrow;
28497 DBusPropertyInfo* /*new*/ g_dbus_property_info_ref(DBusPropertyInfo* this_) nothrow;
28498 void g_dbus_property_info_unref(DBusPropertyInfo* this_) nothrow;
28499 DBusProxy* /*new*/ g_dbus_proxy_new_finish(AsyncResult* res, GLib2.Error** error) nothrow;
28500 DBusProxy* /*new*/ g_dbus_proxy_new_for_bus_finish(AsyncResult* res, GLib2.Error** error) nothrow;
28501 DBusProxy* /*new*/ g_dbus_proxy_new_for_bus_sync(BusType bus_type, DBusProxyFlags flags, DBusInterfaceInfo* info, char* name, char* object_path, char* interface_name, Cancellable* cancellable, GLib2.Error** error) nothrow;
28502 DBusProxy* /*new*/ g_dbus_proxy_new_sync(DBusConnection* connection, DBusProxyFlags flags, DBusInterfaceInfo* info, char* name, char* object_path, char* interface_name, Cancellable* cancellable, GLib2.Error** error) nothrow;
28503 void g_dbus_proxy_new(DBusConnection* connection, DBusProxyFlags flags, DBusInterfaceInfo* info, char* name, char* object_path, char* interface_name, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28504 void g_dbus_proxy_new_for_bus(BusType bus_type, DBusProxyFlags flags, DBusInterfaceInfo* info, char* name, char* object_path, char* interface_name, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28505 void g_dbus_proxy_call(DBusProxy* this_, char* method_name, GLib2.Variant* parameters, DBusCallFlags flags, int timeout_msec, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28506 GLib2.Variant* /*new*/ g_dbus_proxy_call_finish(DBusProxy* this_, AsyncResult* res, GLib2.Error** error) nothrow;
28507 GLib2.Variant* /*new*/ g_dbus_proxy_call_sync(DBusProxy* this_, char* method_name, GLib2.Variant* parameters, DBusCallFlags flags, int timeout_msec, Cancellable* cancellable, GLib2.Error** error) nothrow;
28508 void g_dbus_proxy_call_with_unix_fd_list(DBusProxy* this_, char* method_name, GLib2.Variant* parameters, DBusCallFlags flags, int timeout_msec, UnixFDList* fd_list, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28509 GLib2.Variant* /*new*/ g_dbus_proxy_call_with_unix_fd_list_finish(DBusProxy* this_, /*out*/ UnixFDList** out_fd_list, AsyncResult* res, GLib2.Error** error) nothrow;
28510 GLib2.Variant* /*new*/ g_dbus_proxy_call_with_unix_fd_list_sync(DBusProxy* this_, char* method_name, GLib2.Variant* parameters, DBusCallFlags flags, int timeout_msec, UnixFDList* fd_list, /*out*/ UnixFDList** out_fd_list, Cancellable* cancellable, GLib2.Error** error) nothrow;
28511 GLib2.Variant* /*new*/ g_dbus_proxy_get_cached_property(DBusProxy* this_, char* property_name) nothrow;
28512 char** /*new*/ g_dbus_proxy_get_cached_property_names(DBusProxy* this_) nothrow;
28513 DBusConnection* g_dbus_proxy_get_connection(DBusProxy* this_) nothrow;
28514 int g_dbus_proxy_get_default_timeout(DBusProxy* this_) nothrow;
28515 DBusProxyFlags g_dbus_proxy_get_flags(DBusProxy* this_) nothrow;
28516 DBusInterfaceInfo* /*new*/ g_dbus_proxy_get_interface_info(DBusProxy* this_) nothrow;
28517 char* g_dbus_proxy_get_interface_name(DBusProxy* this_) nothrow;
28518 char* g_dbus_proxy_get_name(DBusProxy* this_) nothrow;
28519 char* /*new*/ g_dbus_proxy_get_name_owner(DBusProxy* this_) nothrow;
28520 char* g_dbus_proxy_get_object_path(DBusProxy* this_) nothrow;
28521 void g_dbus_proxy_set_cached_property(DBusProxy* this_, char* property_name, GLib2.Variant* value=null) nothrow;
28522 void g_dbus_proxy_set_default_timeout(DBusProxy* this_, int timeout_msec) nothrow;
28523 void g_dbus_proxy_set_interface_info(DBusProxy* this_, DBusInterfaceInfo* info=null) nothrow;
28524 DBusServer* /*new*/ g_dbus_server_new_sync(char* address, DBusServerFlags flags, char* guid, DBusAuthObserver* observer, Cancellable* cancellable, GLib2.Error** error) nothrow;
28525 char* g_dbus_server_get_client_address(DBusServer* this_) nothrow;
28526 DBusServerFlags g_dbus_server_get_flags(DBusServer* this_) nothrow;
28527 char* g_dbus_server_get_guid(DBusServer* this_) nothrow;
28528 int g_dbus_server_is_active(DBusServer* this_) nothrow;
28529 void g_dbus_server_start(DBusServer* this_) nothrow;
28530 void g_dbus_server_stop(DBusServer* this_) nothrow;
28531 DBusSignalInfo* /*new*/ g_dbus_signal_info_ref(DBusSignalInfo* this_) nothrow;
28532 void g_dbus_signal_info_unref(DBusSignalInfo* this_) nothrow;
28533 DataInputStream* /*new*/ g_data_input_stream_new(InputStream* base_stream) nothrow;
28534 DataStreamByteOrder g_data_input_stream_get_byte_order(DataInputStream* this_) nothrow;
28535 DataStreamNewlineType g_data_input_stream_get_newline_type(DataInputStream* this_) nothrow;
28536 ubyte g_data_input_stream_read_byte(DataInputStream* this_, Cancellable* cancellable, GLib2.Error** error) nothrow;
28537 short g_data_input_stream_read_int16(DataInputStream* this_, Cancellable* cancellable, GLib2.Error** error) nothrow;
28538 int g_data_input_stream_read_int32(DataInputStream* this_, Cancellable* cancellable, GLib2.Error** error) nothrow;
28539 long g_data_input_stream_read_int64(DataInputStream* this_, Cancellable* cancellable, GLib2.Error** error) nothrow;
28540 ubyte* /*new*/ g_data_input_stream_read_line(DataInputStream* this_, /*out*/ size_t* length, Cancellable* cancellable, GLib2.Error** error) nothrow;
28541 void g_data_input_stream_read_line_async(DataInputStream* this_, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28542 ubyte* /*new*/ g_data_input_stream_read_line_finish(DataInputStream* this_, AsyncResult* result, /*out*/ size_t* length, GLib2.Error** error) nothrow;
28543 char* /*new*/ g_data_input_stream_read_line_finish_utf8(DataInputStream* this_, AsyncResult* result, /*out*/ size_t* length, GLib2.Error** error) nothrow;
28544 char* /*new*/ g_data_input_stream_read_line_utf8(DataInputStream* this_, /*out*/ size_t* length, Cancellable* cancellable, GLib2.Error** error) nothrow;
28545 ushort g_data_input_stream_read_uint16(DataInputStream* this_, Cancellable* cancellable, GLib2.Error** error) nothrow;
28546 uint g_data_input_stream_read_uint32(DataInputStream* this_, Cancellable* cancellable, GLib2.Error** error) nothrow;
28547 ulong g_data_input_stream_read_uint64(DataInputStream* this_, Cancellable* cancellable, GLib2.Error** error) nothrow;
28548 char* /*new*/ g_data_input_stream_read_until(DataInputStream* this_, char* stop_chars, /*out*/ size_t* length, Cancellable* cancellable, GLib2.Error** error) nothrow;
28549 void g_data_input_stream_read_until_async(DataInputStream* this_, char* stop_chars, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28550 char* /*new*/ g_data_input_stream_read_until_finish(DataInputStream* this_, AsyncResult* result, /*out*/ size_t* length, GLib2.Error** error) nothrow;
28551 char* /*new*/ g_data_input_stream_read_upto(DataInputStream* this_, char* stop_chars, ssize_t stop_chars_len, /*out*/ size_t* length, Cancellable* cancellable, GLib2.Error** error) nothrow;
28552 void g_data_input_stream_read_upto_async(DataInputStream* this_, char* stop_chars, ssize_t stop_chars_len, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28553 char* /*new*/ g_data_input_stream_read_upto_finish(DataInputStream* this_, AsyncResult* result, /*out*/ size_t* length, GLib2.Error** error) nothrow;
28554 void g_data_input_stream_set_byte_order(DataInputStream* this_, DataStreamByteOrder order) nothrow;
28555 void g_data_input_stream_set_newline_type(DataInputStream* this_, DataStreamNewlineType type) nothrow;
28556 DataOutputStream* /*new*/ g_data_output_stream_new(OutputStream* base_stream) nothrow;
28557 DataStreamByteOrder g_data_output_stream_get_byte_order(DataOutputStream* this_) nothrow;
28558 int g_data_output_stream_put_byte(DataOutputStream* this_, ubyte data, Cancellable* cancellable, GLib2.Error** error) nothrow;
28559 int g_data_output_stream_put_int16(DataOutputStream* this_, short data, Cancellable* cancellable, GLib2.Error** error) nothrow;
28560 int g_data_output_stream_put_int32(DataOutputStream* this_, int data, Cancellable* cancellable, GLib2.Error** error) nothrow;
28561 int g_data_output_stream_put_int64(DataOutputStream* this_, long data, Cancellable* cancellable, GLib2.Error** error) nothrow;
28562 int g_data_output_stream_put_string(DataOutputStream* this_, char* str, Cancellable* cancellable, GLib2.Error** error) nothrow;
28563 int g_data_output_stream_put_uint16(DataOutputStream* this_, ushort data, Cancellable* cancellable, GLib2.Error** error) nothrow;
28564 int g_data_output_stream_put_uint32(DataOutputStream* this_, uint data, Cancellable* cancellable, GLib2.Error** error) nothrow;
28565 int g_data_output_stream_put_uint64(DataOutputStream* this_, ulong data, Cancellable* cancellable, GLib2.Error** error) nothrow;
28566 void g_data_output_stream_set_byte_order(DataOutputStream* this_, DataStreamByteOrder order) nothrow;
28567 DesktopAppInfo* /*new*/ g_desktop_app_info_new(char* desktop_id) nothrow;
28568 DesktopAppInfo* /*new*/ g_desktop_app_info_new_from_filename(char* filename) nothrow;
28569 DesktopAppInfo* /*new*/ g_desktop_app_info_new_from_keyfile(GLib2.KeyFile* key_file) nothrow;
28570 void g_desktop_app_info_set_desktop_env(char* desktop_env) nothrow;
28571 char* g_desktop_app_info_get_categories(DesktopAppInfo* this_) nothrow;
28572 char* g_desktop_app_info_get_filename(DesktopAppInfo* this_) nothrow;
28573 char* g_desktop_app_info_get_generic_name(DesktopAppInfo* this_) nothrow;
28574 int g_desktop_app_info_get_is_hidden(DesktopAppInfo* this_) nothrow;
28575 char** g_desktop_app_info_get_keywords(DesktopAppInfo* this_) nothrow;
28576 int g_desktop_app_info_get_nodisplay(DesktopAppInfo* this_) nothrow;
28577 int g_desktop_app_info_get_show_in(DesktopAppInfo* this_, char* desktop_env) nothrow;
28578 int g_desktop_app_info_launch_uris_as_manager(DesktopAppInfo* this_, GLib2.List* uris, AppLaunchContext* launch_context, GLib2.SpawnFlags spawn_flags, GLib2.SpawnChildSetupFunc user_setup, void* user_setup_data, DesktopAppLaunchCallback pid_callback, void* pid_callback_data, GLib2.Error** error) nothrow;
28579 AppInfo* /*new*/ g_desktop_app_info_lookup_get_default_for_uri_scheme(DesktopAppInfoLookup* this_, char* uri_scheme) nothrow;
28580 int g_drive_can_eject(Drive* this_) nothrow;
28581 int g_drive_can_poll_for_media(Drive* this_) nothrow;
28582 int g_drive_can_start(Drive* this_) nothrow;
28583 int g_drive_can_start_degraded(Drive* this_) nothrow;
28584 int g_drive_can_stop(Drive* this_) nothrow;
28585 void g_drive_eject(Drive* this_, MountUnmountFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28586 int g_drive_eject_finish(Drive* this_, AsyncResult* result, GLib2.Error** error) nothrow;
28587 void g_drive_eject_with_operation(Drive* this_, MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28588 int g_drive_eject_with_operation_finish(Drive* this_, AsyncResult* result, GLib2.Error** error) nothrow;
28589 char** /*new*/ g_drive_enumerate_identifiers(Drive* this_) nothrow;
28590 Icon* /*new*/ g_drive_get_icon(Drive* this_) nothrow;
28591 char* /*new*/ g_drive_get_identifier(Drive* this_, char* kind) nothrow;
28592 char* /*new*/ g_drive_get_name(Drive* this_) nothrow;
28593 char* g_drive_get_sort_key(Drive* this_) nothrow;
28594 DriveStartStopType g_drive_get_start_stop_type(Drive* this_) nothrow;
28595 GLib2.List* /*new*/ g_drive_get_volumes(Drive* this_) nothrow;
28596 int g_drive_has_media(Drive* this_) nothrow;
28597 int g_drive_has_volumes(Drive* this_) nothrow;
28598 int g_drive_is_media_check_automatic(Drive* this_) nothrow;
28599 int g_drive_is_media_removable(Drive* this_) nothrow;
28600 void g_drive_poll_for_media(Drive* this_, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28601 int g_drive_poll_for_media_finish(Drive* this_, AsyncResult* result, GLib2.Error** error) nothrow;
28602 void g_drive_start(Drive* this_, DriveStartFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28603 int g_drive_start_finish(Drive* this_, AsyncResult* result, GLib2.Error** error) nothrow;
28604 void g_drive_stop(Drive* this_, MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28605 int g_drive_stop_finish(Drive* this_, AsyncResult* result, GLib2.Error** error) nothrow;
28606 Emblem* /*new*/ g_emblem_new(Icon* icon) nothrow;
28607 Emblem* /*new*/ g_emblem_new_with_origin(Icon* icon, EmblemOrigin origin) nothrow;
28608 Icon* g_emblem_get_icon(Emblem* this_) nothrow;
28609 EmblemOrigin g_emblem_get_origin(Emblem* this_) nothrow;
28610 EmblemedIcon* /*new*/ g_emblemed_icon_new(Icon* icon, Emblem* emblem=null) nothrow;
28611 void g_emblemed_icon_add_emblem(EmblemedIcon* this_, Emblem* emblem) nothrow;
28612 void g_emblemed_icon_clear_emblems(EmblemedIcon* this_) nothrow;
28613 GLib2.List* g_emblemed_icon_get_emblems(EmblemedIcon* this_) nothrow;
28614 Icon* g_emblemed_icon_get_icon(EmblemedIcon* this_) nothrow;
28615 File* /*new*/ g_file_new_for_commandline_arg(char* arg) nothrow;
28616 File* /*new*/ g_file_new_for_path(char* path) nothrow;
28617 File* /*new*/ g_file_new_for_uri(char* uri) nothrow;
28618 File* /*new*/ g_file_new_tmp(char* tmpl, /*out*/ FileIOStream** iostream, GLib2.Error** error) nothrow;
28619 File* /*new*/ g_file_parse_name(char* parse_name) nothrow;
28620 FileOutputStream* /*new*/ g_file_append_to(File* this_, FileCreateFlags flags, Cancellable* cancellable, GLib2.Error** error) nothrow;
28621 void g_file_append_to_async(File* this_, FileCreateFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28622 FileOutputStream* /*new*/ g_file_append_to_finish(File* this_, AsyncResult* res, GLib2.Error** error) nothrow;
28623 int g_file_copy(File* this_, File* destination, FileCopyFlags flags, Cancellable* cancellable, FileProgressCallback progress_callback, void* progress_callback_data, GLib2.Error** error) nothrow;
28624 void g_file_copy_async(File* this_, File* destination, FileCopyFlags flags, int io_priority, Cancellable* cancellable, FileProgressCallback progress_callback, void* progress_callback_data, AsyncReadyCallback callback, void* user_data) nothrow;
28625 int g_file_copy_attributes(File* this_, File* destination, FileCopyFlags flags, Cancellable* cancellable, GLib2.Error** error) nothrow;
28626 int g_file_copy_finish(File* this_, AsyncResult* res, GLib2.Error** error) nothrow;
28627 FileOutputStream* /*new*/ g_file_create(File* this_, FileCreateFlags flags, Cancellable* cancellable, GLib2.Error** error) nothrow;
28628 void g_file_create_async(File* this_, FileCreateFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28629 FileOutputStream* /*new*/ g_file_create_finish(File* this_, AsyncResult* res, GLib2.Error** error) nothrow;
28630 FileIOStream* /*new*/ g_file_create_readwrite(File* this_, FileCreateFlags flags, Cancellable* cancellable, GLib2.Error** error) nothrow;
28631 void g_file_create_readwrite_async(File* this_, FileCreateFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28632 FileIOStream* /*new*/ g_file_create_readwrite_finish(File* this_, AsyncResult* res, GLib2.Error** error) nothrow;
28633 int g_file_delete(File* this_, Cancellable* cancellable, GLib2.Error** error) nothrow;
28634 File* /*new*/ g_file_dup(File* this_) nothrow;
28635 void g_file_eject_mountable(File* this_, MountUnmountFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28636 int g_file_eject_mountable_finish(File* this_, AsyncResult* result, GLib2.Error** error) nothrow;
28637 void g_file_eject_mountable_with_operation(File* this_, MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28638 int g_file_eject_mountable_with_operation_finish(File* this_, AsyncResult* result, GLib2.Error** error) nothrow;
28639 FileEnumerator* /*new*/ g_file_enumerate_children(File* this_, char* attributes, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error) nothrow;
28640 void g_file_enumerate_children_async(File* this_, char* attributes, FileQueryInfoFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28641 FileEnumerator* /*new*/ g_file_enumerate_children_finish(File* this_, AsyncResult* res, GLib2.Error** error) nothrow;
28642 int g_file_equal(File* this_, File* file2) nothrow;
28643 Mount* /*new*/ g_file_find_enclosing_mount(File* this_, Cancellable* cancellable, GLib2.Error** error) nothrow;
28644 void g_file_find_enclosing_mount_async(File* this_, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28645 Mount* /*new*/ g_file_find_enclosing_mount_finish(File* this_, AsyncResult* res, GLib2.Error** error) nothrow;
28646 char* /*new*/ g_file_get_basename(File* this_) nothrow;
28647 File* /*new*/ g_file_get_child(File* this_, char* name) nothrow;
28648 File* /*new*/ g_file_get_child_for_display_name(File* this_, char* display_name, GLib2.Error** error) nothrow;
28649 File* /*new*/ g_file_get_parent(File* this_) nothrow;
28650 char* /*new*/ g_file_get_parse_name(File* this_) nothrow;
28651 char* /*new*/ g_file_get_path(File* this_) nothrow;
28652 char* /*new*/ g_file_get_relative_path(File* this_, File* descendant) nothrow;
28653 char* /*new*/ g_file_get_uri(File* this_) nothrow;
28654 char* /*new*/ g_file_get_uri_scheme(File* this_) nothrow;
28655 int g_file_has_parent(File* this_, File* parent=null) nothrow;
28656 int g_file_has_prefix(File* this_, File* prefix) nothrow;
28657 int g_file_has_uri_scheme(File* this_, char* uri_scheme) nothrow;
28658 uint g_file_hash(File* this_) nothrow;
28659 int g_file_is_native(File* this_) nothrow;
28660 int g_file_load_contents(File* this_, Cancellable* cancellable, /*out*/ ubyte** contents, /*out*/ size_t* length, /*out*/ char** etag_out, GLib2.Error** error) nothrow;
28661 void g_file_load_contents_async(File* this_, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28662 int g_file_load_contents_finish(File* this_, AsyncResult* res, /*out*/ ubyte** contents, /*out*/ size_t* length, /*out*/ char** etag_out, GLib2.Error** error) nothrow;
28663 void g_file_load_partial_contents_async(File* this_, Cancellable* cancellable, FileReadMoreCallback read_more_callback, AsyncReadyCallback callback, void* user_data) nothrow;
28664 int g_file_load_partial_contents_finish(File* this_, AsyncResult* res, /*out*/ ubyte** contents, /*out*/ size_t* length, /*out*/ char** etag_out, GLib2.Error** error) nothrow;
28665 int g_file_make_directory(File* this_, Cancellable* cancellable, GLib2.Error** error) nothrow;
28666 int g_file_make_directory_with_parents(File* this_, Cancellable* cancellable, GLib2.Error** error) nothrow;
28667 int g_file_make_symbolic_link(File* this_, char* symlink_value, Cancellable* cancellable, GLib2.Error** error) nothrow;
28668 FileMonitor* /*new*/ g_file_monitor(File* this_, FileMonitorFlags flags, Cancellable* cancellable, GLib2.Error** error) nothrow;
28669 FileMonitor* /*new*/ g_file_monitor_directory(File* this_, FileMonitorFlags flags, Cancellable* cancellable, GLib2.Error** error) nothrow;
28670 FileMonitor* /*new*/ g_file_monitor_file(File* this_, FileMonitorFlags flags, Cancellable* cancellable, GLib2.Error** error) nothrow;
28671 void g_file_mount_enclosing_volume(File* this_, MountMountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28672 int g_file_mount_enclosing_volume_finish(File* this_, AsyncResult* result, GLib2.Error** error) nothrow;
28673 void g_file_mount_mountable(File* this_, MountMountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28674 File* /*new*/ g_file_mount_mountable_finish(File* this_, AsyncResult* result, GLib2.Error** error) nothrow;
28675 int g_file_move(File* this_, File* destination, FileCopyFlags flags, Cancellable* cancellable, FileProgressCallback progress_callback, void* progress_callback_data, GLib2.Error** error) nothrow;
28676 FileIOStream* /*new*/ g_file_open_readwrite(File* this_, Cancellable* cancellable, GLib2.Error** error) nothrow;
28677 void g_file_open_readwrite_async(File* this_, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28678 FileIOStream* /*new*/ g_file_open_readwrite_finish(File* this_, AsyncResult* res, GLib2.Error** error) nothrow;
28679 void g_file_poll_mountable(File* this_, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28680 int g_file_poll_mountable_finish(File* this_, AsyncResult* result, GLib2.Error** error) nothrow;
28681 AppInfo* /*new*/ g_file_query_default_handler(File* this_, Cancellable* cancellable, GLib2.Error** error) nothrow;
28682 int g_file_query_exists(File* this_, Cancellable* cancellable=null) nothrow;
28683 FileType g_file_query_file_type(File* this_, FileQueryInfoFlags flags, Cancellable* cancellable=null) nothrow;
28684 FileInfo* /*new*/ g_file_query_filesystem_info(File* this_, char* attributes, Cancellable* cancellable, GLib2.Error** error) nothrow;
28685 void g_file_query_filesystem_info_async(File* this_, char* attributes, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28686 FileInfo* /*new*/ g_file_query_filesystem_info_finish(File* this_, AsyncResult* res, GLib2.Error** error) nothrow;
28687 FileInfo* /*new*/ g_file_query_info(File* this_, char* attributes, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error) nothrow;
28688 void g_file_query_info_async(File* this_, char* attributes, FileQueryInfoFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28689 FileInfo* /*new*/ g_file_query_info_finish(File* this_, AsyncResult* res, GLib2.Error** error) nothrow;
28690 FileAttributeInfoList* /*new*/ g_file_query_settable_attributes(File* this_, Cancellable* cancellable, GLib2.Error** error) nothrow;
28691 FileAttributeInfoList* /*new*/ g_file_query_writable_namespaces(File* this_, Cancellable* cancellable, GLib2.Error** error) nothrow;
28692 FileInputStream* /*new*/ g_file_read(File* this_, Cancellable* cancellable, GLib2.Error** error) nothrow;
28693 void g_file_read_async(File* this_, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28694 FileInputStream* /*new*/ g_file_read_finish(File* this_, AsyncResult* res, GLib2.Error** error) nothrow;
28695 FileOutputStream* /*new*/ g_file_replace(File* this_, char* etag, int make_backup, FileCreateFlags flags, Cancellable* cancellable, GLib2.Error** error) nothrow;
28696 void g_file_replace_async(File* this_, char* etag, int make_backup, FileCreateFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28697 int g_file_replace_contents(File* this_, ubyte* contents, size_t length, char* etag, int make_backup, FileCreateFlags flags, /*out*/ char** new_etag, Cancellable* cancellable, GLib2.Error** error) nothrow;
28698 void g_file_replace_contents_async(File* this_, ubyte* contents, size_t length, char* etag, int make_backup, FileCreateFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28699 int g_file_replace_contents_finish(File* this_, AsyncResult* res, /*out*/ char** new_etag, GLib2.Error** error) nothrow;
28700 FileOutputStream* /*new*/ g_file_replace_finish(File* this_, AsyncResult* res, GLib2.Error** error) nothrow;
28701 FileIOStream* /*new*/ g_file_replace_readwrite(File* this_, char* etag, int make_backup, FileCreateFlags flags, Cancellable* cancellable, GLib2.Error** error) nothrow;
28702 void g_file_replace_readwrite_async(File* this_, char* etag, int make_backup, FileCreateFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28703 FileIOStream* /*new*/ g_file_replace_readwrite_finish(File* this_, AsyncResult* res, GLib2.Error** error) nothrow;
28704 File* /*new*/ g_file_resolve_relative_path(File* this_, char* relative_path) nothrow;
28705 int g_file_set_attribute(File* this_, char* attribute, FileAttributeType type, void* value_p, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error) nothrow;
28706 int g_file_set_attribute_byte_string(File* this_, char* attribute, char* value, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error) nothrow;
28707 int g_file_set_attribute_int32(File* this_, char* attribute, int value, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error) nothrow;
28708 int g_file_set_attribute_int64(File* this_, char* attribute, long value, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error) nothrow;
28709 int g_file_set_attribute_string(File* this_, char* attribute, char* value, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error) nothrow;
28710 int g_file_set_attribute_uint32(File* this_, char* attribute, uint value, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error) nothrow;
28711 int g_file_set_attribute_uint64(File* this_, char* attribute, ulong value, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error) nothrow;
28712 void g_file_set_attributes_async(File* this_, FileInfo* info, FileQueryInfoFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28713 int g_file_set_attributes_finish(File* this_, AsyncResult* result, /*out*/ FileInfo** info, GLib2.Error** error) nothrow;
28714 int g_file_set_attributes_from_info(File* this_, FileInfo* info, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error) nothrow;
28715 File* /*new*/ g_file_set_display_name(File* this_, char* display_name, Cancellable* cancellable, GLib2.Error** error) nothrow;
28716 void g_file_set_display_name_async(File* this_, char* display_name, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28717 File* /*new*/ g_file_set_display_name_finish(File* this_, AsyncResult* res, GLib2.Error** error) nothrow;
28718 void g_file_start_mountable(File* this_, DriveStartFlags flags, MountOperation* start_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28719 int g_file_start_mountable_finish(File* this_, AsyncResult* result, GLib2.Error** error) nothrow;
28720 void g_file_stop_mountable(File* this_, MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28721 int g_file_stop_mountable_finish(File* this_, AsyncResult* result, GLib2.Error** error) nothrow;
28722 int g_file_supports_thread_contexts(File* this_) nothrow;
28723 int g_file_trash(File* this_, Cancellable* cancellable, GLib2.Error** error) nothrow;
28724 void g_file_unmount_mountable(File* this_, MountUnmountFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28725 int g_file_unmount_mountable_finish(File* this_, AsyncResult* result, GLib2.Error** error) nothrow;
28726 void g_file_unmount_mountable_with_operation(File* this_, MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28727 int g_file_unmount_mountable_with_operation_finish(File* this_, AsyncResult* result, GLib2.Error** error) nothrow;
28728 FileAttributeInfoList* /*new*/ g_file_attribute_info_list_new() nothrow;
28729 void g_file_attribute_info_list_add(FileAttributeInfoList* this_, char* name, FileAttributeType type, FileAttributeInfoFlags flags) nothrow;
28730 FileAttributeInfoList* /*new*/ g_file_attribute_info_list_dup(FileAttributeInfoList* this_) nothrow;
28731 FileAttributeInfo* g_file_attribute_info_list_lookup(FileAttributeInfoList* this_, char* name) nothrow;
28732 FileAttributeInfoList* /*new*/ g_file_attribute_info_list_ref(FileAttributeInfoList* this_) nothrow;
28733 void g_file_attribute_info_list_unref(FileAttributeInfoList* this_) nothrow;
28734 FileAttributeMatcher* /*new*/ g_file_attribute_matcher_new(char* attributes) nothrow;
28735 int g_file_attribute_matcher_enumerate_namespace(FileAttributeMatcher* this_, char* ns) nothrow;
28736 char* g_file_attribute_matcher_enumerate_next(FileAttributeMatcher* this_) nothrow;
28737 int g_file_attribute_matcher_matches(FileAttributeMatcher* this_, char* attribute) nothrow;
28738 int g_file_attribute_matcher_matches_only(FileAttributeMatcher* this_, char* attribute) nothrow;
28739 FileAttributeMatcher* /*new*/ g_file_attribute_matcher_ref(FileAttributeMatcher* this_) nothrow;
28740 FileAttributeMatcher* /*new*/ g_file_attribute_matcher_subtract(FileAttributeMatcher* this_, FileAttributeMatcher* subtract) nothrow;
28741 char* /*new*/ g_file_attribute_matcher_to_string(FileAttributeMatcher* this_) nothrow;
28742 void g_file_attribute_matcher_unref(FileAttributeMatcher* this_) nothrow;
28743 int g_file_descriptor_based_get_fd(FileDescriptorBased* this_) nothrow;
28744 int g_file_enumerator_close(FileEnumerator* this_, Cancellable* cancellable, GLib2.Error** error) nothrow;
28745 void g_file_enumerator_close_async(FileEnumerator* this_, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28746 int g_file_enumerator_close_finish(FileEnumerator* this_, AsyncResult* result, GLib2.Error** error) nothrow;
28747 File* g_file_enumerator_get_container(FileEnumerator* this_) nothrow;
28748 int g_file_enumerator_has_pending(FileEnumerator* this_) nothrow;
28749 int g_file_enumerator_is_closed(FileEnumerator* this_) nothrow;
28750 FileInfo* /*new*/ g_file_enumerator_next_file(FileEnumerator* this_, Cancellable* cancellable, GLib2.Error** error) nothrow;
28751 void g_file_enumerator_next_files_async(FileEnumerator* this_, int num_files, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28752 GLib2.List* /*new*/ g_file_enumerator_next_files_finish(FileEnumerator* this_, AsyncResult* result, GLib2.Error** error) nothrow;
28753 void g_file_enumerator_set_pending(FileEnumerator* this_, int pending) nothrow;
28754 char* /*new*/ g_file_io_stream_get_etag(FileIOStream* this_) nothrow;
28755 FileInfo* /*new*/ g_file_io_stream_query_info(FileIOStream* this_, char* attributes, Cancellable* cancellable, GLib2.Error** error) nothrow;
28756 void g_file_io_stream_query_info_async(FileIOStream* this_, char* attributes, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28757 FileInfo* /*new*/ g_file_io_stream_query_info_finish(FileIOStream* this_, AsyncResult* result, GLib2.Error** error) nothrow;
28758 FileIcon* /*new*/ g_file_icon_new(File* file) nothrow;
28759 File* g_file_icon_get_file(FileIcon* this_) nothrow;
28760 FileInfo* /*new*/ g_file_info_new() nothrow;
28761 void g_file_info_clear_status(FileInfo* this_) nothrow;
28762 void g_file_info_copy_into(FileInfo* this_, FileInfo* dest_info) nothrow;
28763 FileInfo* /*new*/ g_file_info_dup(FileInfo* this_) nothrow;
28764 char* /*new*/ g_file_info_get_attribute_as_string(FileInfo* this_, char* attribute) nothrow;
28765 int g_file_info_get_attribute_boolean(FileInfo* this_, char* attribute) nothrow;
28766 char* g_file_info_get_attribute_byte_string(FileInfo* this_, char* attribute) nothrow;
28767 int g_file_info_get_attribute_data(FileInfo* this_, char* attribute, /*out*/ FileAttributeType* type=null, /*out*/ void** value_pp=null, /*out*/ FileAttributeStatus* status=null) nothrow;
28768 int g_file_info_get_attribute_int32(FileInfo* this_, char* attribute) nothrow;
28769 long g_file_info_get_attribute_int64(FileInfo* this_, char* attribute) nothrow;
28770 GObject2.Object* g_file_info_get_attribute_object(FileInfo* this_, char* attribute) nothrow;
28771 FileAttributeStatus g_file_info_get_attribute_status(FileInfo* this_, char* attribute) nothrow;
28772 char* g_file_info_get_attribute_string(FileInfo* this_, char* attribute) nothrow;
28773 char** g_file_info_get_attribute_stringv(FileInfo* this_, char* attribute) nothrow;
28774 FileAttributeType g_file_info_get_attribute_type(FileInfo* this_, char* attribute) nothrow;
28775 uint g_file_info_get_attribute_uint32(FileInfo* this_, char* attribute) nothrow;
28776 ulong g_file_info_get_attribute_uint64(FileInfo* this_, char* attribute) nothrow;
28777 char* g_file_info_get_content_type(FileInfo* this_) nothrow;
28778 char* g_file_info_get_display_name(FileInfo* this_) nothrow;
28779 char* g_file_info_get_edit_name(FileInfo* this_) nothrow;
28780 char* g_file_info_get_etag(FileInfo* this_) nothrow;
28781 FileType g_file_info_get_file_type(FileInfo* this_) nothrow;
28782 Icon* g_file_info_get_icon(FileInfo* this_) nothrow;
28783 int g_file_info_get_is_backup(FileInfo* this_) nothrow;
28784 int g_file_info_get_is_hidden(FileInfo* this_) nothrow;
28785 int g_file_info_get_is_symlink(FileInfo* this_) nothrow;
28786 void g_file_info_get_modification_time(FileInfo* this_, /*out*/ GLib2.TimeVal* result) nothrow;
28787 char* g_file_info_get_name(FileInfo* this_) nothrow;
28788 long g_file_info_get_size(FileInfo* this_) nothrow;
28789 int g_file_info_get_sort_order(FileInfo* this_) nothrow;
28790 char* g_file_info_get_symlink_target(FileInfo* this_) nothrow;
28791 int g_file_info_has_attribute(FileInfo* this_, char* attribute) nothrow;
28792 int g_file_info_has_namespace(FileInfo* this_, char* name_space) nothrow;
28793 char** /*new*/ g_file_info_list_attributes(FileInfo* this_, char* name_space) nothrow;
28794 void g_file_info_remove_attribute(FileInfo* this_, char* attribute) nothrow;
28795 void g_file_info_set_attribute(FileInfo* this_, char* attribute, FileAttributeType type, void* value_p) nothrow;
28796 void g_file_info_set_attribute_boolean(FileInfo* this_, char* attribute, int attr_value) nothrow;
28797 void g_file_info_set_attribute_byte_string(FileInfo* this_, char* attribute, char* attr_value) nothrow;
28798 void g_file_info_set_attribute_int32(FileInfo* this_, char* attribute, int attr_value) nothrow;
28799 void g_file_info_set_attribute_int64(FileInfo* this_, char* attribute, long attr_value) nothrow;
28800 void g_file_info_set_attribute_mask(FileInfo* this_, FileAttributeMatcher* mask) nothrow;
28801 void g_file_info_set_attribute_object(FileInfo* this_, char* attribute, GObject2.Object* attr_value) nothrow;
28802 int g_file_info_set_attribute_status(FileInfo* this_, char* attribute, FileAttributeStatus status) nothrow;
28803 void g_file_info_set_attribute_string(FileInfo* this_, char* attribute, char* attr_value) nothrow;
28804 void g_file_info_set_attribute_stringv(FileInfo* this_, char* attribute, char** attr_value) nothrow;
28805 void g_file_info_set_attribute_uint32(FileInfo* this_, char* attribute, uint attr_value) nothrow;
28806 void g_file_info_set_attribute_uint64(FileInfo* this_, char* attribute, ulong attr_value) nothrow;
28807 void g_file_info_set_content_type(FileInfo* this_, char* content_type) nothrow;
28808 void g_file_info_set_display_name(FileInfo* this_, char* display_name) nothrow;
28809 void g_file_info_set_edit_name(FileInfo* this_, char* edit_name) nothrow;
28810 void g_file_info_set_file_type(FileInfo* this_, FileType type) nothrow;
28811 void g_file_info_set_icon(FileInfo* this_, Icon* icon) nothrow;
28812 void g_file_info_set_is_hidden(FileInfo* this_, int is_hidden) nothrow;
28813 void g_file_info_set_is_symlink(FileInfo* this_, int is_symlink) nothrow;
28814 void g_file_info_set_modification_time(FileInfo* this_, GLib2.TimeVal* mtime) nothrow;
28815 void g_file_info_set_name(FileInfo* this_, char* name) nothrow;
28816 void g_file_info_set_size(FileInfo* this_, long size) nothrow;
28817 void g_file_info_set_sort_order(FileInfo* this_, int sort_order) nothrow;
28818 void g_file_info_set_symlink_target(FileInfo* this_, char* symlink_target) nothrow;
28819 void g_file_info_unset_attribute_mask(FileInfo* this_) nothrow;
28820 FileInfo* /*new*/ g_file_input_stream_query_info(FileInputStream* this_, char* attributes, Cancellable* cancellable, GLib2.Error** error) nothrow;
28821 void g_file_input_stream_query_info_async(FileInputStream* this_, char* attributes, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28822 FileInfo* /*new*/ g_file_input_stream_query_info_finish(FileInputStream* this_, AsyncResult* result, GLib2.Error** error) nothrow;
28823 int g_file_monitor_cancel(FileMonitor* this_) nothrow;
28824 void g_file_monitor_emit_event(FileMonitor* this_, File* child, File* other_file, FileMonitorEvent event_type) nothrow;
28825 int g_file_monitor_is_cancelled(FileMonitor* this_) nothrow;
28826 void g_file_monitor_set_rate_limit(FileMonitor* this_, int limit_msecs) nothrow;
28827 char* /*new*/ g_file_output_stream_get_etag(FileOutputStream* this_) nothrow;
28828 FileInfo* /*new*/ g_file_output_stream_query_info(FileOutputStream* this_, char* attributes, Cancellable* cancellable, GLib2.Error** error) nothrow;
28829 void g_file_output_stream_query_info_async(FileOutputStream* this_, char* attributes, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28830 FileInfo* /*new*/ g_file_output_stream_query_info_finish(FileOutputStream* this_, AsyncResult* result, GLib2.Error** error) nothrow;
28831 FilenameCompleter* /*new*/ g_filename_completer_new() nothrow;
28832 char* /*new*/ g_filename_completer_get_completion_suffix(FilenameCompleter* this_, char* initial_text) nothrow;
28833 char** /*new*/ g_filename_completer_get_completions(FilenameCompleter* this_, char* initial_text) nothrow;
28834 void g_filename_completer_set_dirs_only(FilenameCompleter* this_, int dirs_only) nothrow;
28835 InputStream* g_filter_input_stream_get_base_stream(FilterInputStream* this_) nothrow;
28836 int g_filter_input_stream_get_close_base_stream(FilterInputStream* this_) nothrow;
28837 void g_filter_input_stream_set_close_base_stream(FilterInputStream* this_, int close_base) nothrow;
28838 OutputStream* g_filter_output_stream_get_base_stream(FilterOutputStream* this_) nothrow;
28839 int g_filter_output_stream_get_close_base_stream(FilterOutputStream* this_) nothrow;
28840 void g_filter_output_stream_set_close_base_stream(FilterOutputStream* this_, int close_base) nothrow;
28841 char* g_io_extension_get_name(IOExtension* this_) nothrow;
28842 int g_io_extension_get_priority(IOExtension* this_) nothrow;
28843 Type g_io_extension_get_type(IOExtension* this_) nothrow;
28844 GObject2.TypeClass* /*new*/ g_io_extension_ref_class(IOExtension* this_) nothrow;
28845 IOExtension* g_io_extension_point_get_extension_by_name(IOExtensionPoint* this_, char* name) nothrow;
28846 GLib2.List* g_io_extension_point_get_extensions(IOExtensionPoint* this_) nothrow;
28847 Type g_io_extension_point_get_required_type(IOExtensionPoint* this_) nothrow;
28848 void g_io_extension_point_set_required_type(IOExtensionPoint* this_, Type type) nothrow;
28849 IOExtension* g_io_extension_point_implement(char* extension_point_name, Type type, char* extension_name, int priority) nothrow;
28850 IOExtensionPoint* g_io_extension_point_lookup(char* name) nothrow;
28851 IOExtensionPoint* g_io_extension_point_register(char* name) nothrow;
28852 IOModule* /*new*/ g_io_module_new(char* filename) nothrow;
28853 char** /*new*/ g_io_module_query() nothrow;
28854 void g_io_module_load(IOModule* this_) nothrow;
28855 void g_io_module_unload(IOModule* this_) nothrow;
28856 void g_io_module_scope_block(IOModuleScope* this_, char* basename) nothrow;
28857 void g_io_module_scope_free(IOModuleScope* this_) nothrow;
28858 IOModuleScope* /*new*/ g_io_module_scope_new(IOModuleScopeFlags flags) nothrow;
28859 int g_io_scheduler_job_send_to_mainloop(IOSchedulerJob* this_, GLib2.SourceFunc func, void* user_data, GLib2.DestroyNotify notify) nothrow;
28860 void g_io_scheduler_job_send_to_mainloop_async(IOSchedulerJob* this_, GLib2.SourceFunc func, void* user_data, GLib2.DestroyNotify notify) nothrow;
28861 int g_io_stream_splice_finish(AsyncResult* result, GLib2.Error** error) nothrow;
28862 void g_io_stream_clear_pending(IOStream* this_) nothrow;
28863 int g_io_stream_close(IOStream* this_, Cancellable* cancellable, GLib2.Error** error) nothrow;
28864 void g_io_stream_close_async(IOStream* this_, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28865 int g_io_stream_close_finish(IOStream* this_, AsyncResult* result, GLib2.Error** error) nothrow;
28866 InputStream* g_io_stream_get_input_stream(IOStream* this_) nothrow;
28867 OutputStream* g_io_stream_get_output_stream(IOStream* this_) nothrow;
28868 int g_io_stream_has_pending(IOStream* this_) nothrow;
28869 int g_io_stream_is_closed(IOStream* this_) nothrow;
28870 int g_io_stream_set_pending(IOStream* this_, GLib2.Error** error) nothrow;
28871 void g_io_stream_splice_async(IOStream* this_, IOStream* stream2, IOStreamSpliceFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28872 uint g_icon_hash(const(void)* icon) nothrow;
28873 Icon* /*new*/ g_icon_new_for_string(char* str, GLib2.Error** error) nothrow;
28874 int g_icon_equal(Icon* this_, Icon* icon2=null) nothrow;
28875 char* /*new*/ g_icon_to_string(Icon* this_) nothrow;
28876 InetAddress* /*new*/ g_inet_address_new_any(SocketFamily family) nothrow;
28877 InetAddress* /*new*/ g_inet_address_new_from_bytes(ubyte* bytes, SocketFamily family) nothrow;
28878 InetAddress* /*new*/ g_inet_address_new_from_string(char* string_) nothrow;
28879 InetAddress* /*new*/ g_inet_address_new_loopback(SocketFamily family) nothrow;
28880 int g_inet_address_equal(InetAddress* this_, InetAddress* other_address) nothrow;
28881 SocketFamily g_inet_address_get_family(InetAddress* this_) nothrow;
28882 int g_inet_address_get_is_any(InetAddress* this_) nothrow;
28883 int g_inet_address_get_is_link_local(InetAddress* this_) nothrow;
28884 int g_inet_address_get_is_loopback(InetAddress* this_) nothrow;
28885 int g_inet_address_get_is_mc_global(InetAddress* this_) nothrow;
28886 int g_inet_address_get_is_mc_link_local(InetAddress* this_) nothrow;
28887 int g_inet_address_get_is_mc_node_local(InetAddress* this_) nothrow;
28888 int g_inet_address_get_is_mc_org_local(InetAddress* this_) nothrow;
28889 int g_inet_address_get_is_mc_site_local(InetAddress* this_) nothrow;
28890 int g_inet_address_get_is_multicast(InetAddress* this_) nothrow;
28891 int g_inet_address_get_is_site_local(InetAddress* this_) nothrow;
28892 size_t g_inet_address_get_native_size(InetAddress* this_) nothrow;
28893 ubyte* g_inet_address_to_bytes(InetAddress* this_) nothrow;
28894 char* /*new*/ g_inet_address_to_string(InetAddress* this_) nothrow;
28895 InetAddressMask* /*new*/ g_inet_address_mask_new(InetAddress* addr, uint length, GLib2.Error** error) nothrow;
28896 InetAddressMask* /*new*/ g_inet_address_mask_new_from_string(char* mask_string, GLib2.Error** error) nothrow;
28897 int g_inet_address_mask_equal(InetAddressMask* this_, InetAddressMask* mask2) nothrow;
28898 InetAddress* g_inet_address_mask_get_address(InetAddressMask* this_) nothrow;
28899 SocketFamily g_inet_address_mask_get_family(InetAddressMask* this_) nothrow;
28900 uint g_inet_address_mask_get_length(InetAddressMask* this_) nothrow;
28901 int g_inet_address_mask_matches(InetAddressMask* this_, InetAddress* address) nothrow;
28902 char* /*new*/ g_inet_address_mask_to_string(InetAddressMask* this_) nothrow;
28903 InetSocketAddress* /*new*/ g_inet_socket_address_new(InetAddress* address, ushort port) nothrow;
28904 InetAddress* g_inet_socket_address_get_address(InetSocketAddress* this_) nothrow;
28905 uint g_inet_socket_address_get_flowinfo(InetSocketAddress* this_) nothrow;
28906 ushort g_inet_socket_address_get_port(InetSocketAddress* this_) nothrow;
28907 uint g_inet_socket_address_get_scope_id(InetSocketAddress* this_) nothrow;
28908 void* /*new*/ g_initable_new(Type object_type, Cancellable* cancellable, GLib2.Error** error, char* first_property_name, ...) nothrow;
28909 GObject2.Object* /*new*/ g_initable_new_valist(Type object_type, char* first_property_name, va_list var_args, Cancellable* cancellable, GLib2.Error** error) nothrow;
28910 void* /*new*/ g_initable_newv(Type object_type, uint n_parameters, GObject2.Parameter* parameters, Cancellable* cancellable, GLib2.Error** error) nothrow;
28911 int g_initable_init(Initable* this_, Cancellable* cancellable, GLib2.Error** error) nothrow;
28912 void g_input_stream_clear_pending(InputStream* this_) nothrow;
28913 int g_input_stream_close(InputStream* this_, Cancellable* cancellable, GLib2.Error** error) nothrow;
28914 void g_input_stream_close_async(InputStream* this_, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28915 int g_input_stream_close_finish(InputStream* this_, AsyncResult* result, GLib2.Error** error) nothrow;
28916 int g_input_stream_has_pending(InputStream* this_) nothrow;
28917 int g_input_stream_is_closed(InputStream* this_) nothrow;
28918 ssize_t g_input_stream_read(InputStream* this_, void* buffer, size_t count, Cancellable* cancellable, GLib2.Error** error) nothrow;
28919 int g_input_stream_read_all(InputStream* this_, void* buffer, size_t count, /*out*/ size_t* bytes_read, Cancellable* cancellable, GLib2.Error** error) nothrow;
28920 void g_input_stream_read_async(InputStream* this_, void* buffer, size_t count, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28921 ssize_t g_input_stream_read_finish(InputStream* this_, AsyncResult* result, GLib2.Error** error) nothrow;
28922 int g_input_stream_set_pending(InputStream* this_, GLib2.Error** error) nothrow;
28923 ssize_t g_input_stream_skip(InputStream* this_, size_t count, Cancellable* cancellable, GLib2.Error** error) nothrow;
28924 void g_input_stream_skip_async(InputStream* this_, size_t count, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28925 ssize_t g_input_stream_skip_finish(InputStream* this_, AsyncResult* result, GLib2.Error** error) nothrow;
28926 InputStream* /*new*/ g_loadable_icon_load(LoadableIcon* this_, int size, /*out*/ char** type, Cancellable* cancellable, GLib2.Error** error) nothrow;
28927 void g_loadable_icon_load_async(LoadableIcon* this_, int size, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28928 InputStream* /*new*/ g_loadable_icon_load_finish(LoadableIcon* this_, AsyncResult* res, char** type, GLib2.Error** error) nothrow;
28929 MemoryInputStream* /*new*/ g_memory_input_stream_new() nothrow;
28930 MemoryInputStream* /*new*/ g_memory_input_stream_new_from_data(ubyte* data, ssize_t len, GLib2.DestroyNotify destroy=null) nothrow;
28931 void g_memory_input_stream_add_data(MemoryInputStream* this_, ubyte* data, ssize_t len, GLib2.DestroyNotify destroy=null) nothrow;
28932 MemoryOutputStream* /*new*/ g_memory_output_stream_new(void* data, size_t size, ReallocFunc realloc_function, GLib2.DestroyNotify destroy_function) nothrow;
28933 void* g_memory_output_stream_get_data(MemoryOutputStream* this_) nothrow;
28934 size_t g_memory_output_stream_get_data_size(MemoryOutputStream* this_) nothrow;
28935 size_t g_memory_output_stream_get_size(MemoryOutputStream* this_) nothrow;
28936 void* /*new*/ g_memory_output_stream_steal_data(MemoryOutputStream* this_) nothrow;
28937 Menu* /*new*/ g_menu_new() nothrow;
28938 void g_menu_append(Menu* this_, char* label=null, char* detailed_action=null) nothrow;
28939 void g_menu_append_item(Menu* this_, MenuItem* item) nothrow;
28940 void g_menu_append_section(Menu* this_, char* label, MenuModel* section) nothrow;
28941 void g_menu_append_submenu(Menu* this_, char* label, MenuModel* submenu) nothrow;
28942 void g_menu_freeze(Menu* this_) nothrow;
28943 void g_menu_insert(Menu* this_, int position, char* label=null, char* detailed_action=null) nothrow;
28944 void g_menu_insert_item(Menu* this_, int position, MenuItem* item) nothrow;
28945 void g_menu_insert_section(Menu* this_, int position, char* label, MenuModel* section) nothrow;
28946 void g_menu_insert_submenu(Menu* this_, int position, char* label, MenuModel* submenu) nothrow;
28947 void g_menu_prepend(Menu* this_, char* label=null, char* detailed_action=null) nothrow;
28948 void g_menu_prepend_item(Menu* this_, MenuItem* item) nothrow;
28949 void g_menu_prepend_section(Menu* this_, char* label, MenuModel* section) nothrow;
28950 void g_menu_prepend_submenu(Menu* this_, char* label, MenuModel* submenu) nothrow;
28951 void g_menu_remove(Menu* this_, int position) nothrow;
28952 char* g_menu_attribute_iter_get_name(MenuAttributeIter* this_) nothrow;
28953 int g_menu_attribute_iter_get_next(MenuAttributeIter* this_, /*out*/ char** out_name=null, /*out*/ GLib2.Variant** value=null) nothrow;
28954 GLib2.Variant* /*new*/ g_menu_attribute_iter_get_value(MenuAttributeIter* this_) nothrow;
28955 int g_menu_attribute_iter_next(MenuAttributeIter* this_) nothrow;
28956 MenuItem* /*new*/ g_menu_item_new(char* label=null, char* detailed_action=null) nothrow;
28957 MenuItem* /*new*/ g_menu_item_new_section(char* label, MenuModel* section) nothrow;
28958 MenuItem* /*new*/ g_menu_item_new_submenu(char* label, MenuModel* submenu) nothrow;
28959 void g_menu_item_set_action_and_target(MenuItem* this_, char* action=null, char* format_string=null, ...) nothrow;
28960 void g_menu_item_set_action_and_target_value(MenuItem* this_, char* action=null, GLib2.Variant* target_value=null) nothrow;
28961 void g_menu_item_set_attribute(MenuItem* this_, char* attribute, char* format_string=null, ...) nothrow;
28962 void g_menu_item_set_attribute_value(MenuItem* this_, char* attribute, GLib2.Variant* value=null) nothrow;
28963 void g_menu_item_set_detailed_action(MenuItem* this_, char* detailed_action) nothrow;
28964 void g_menu_item_set_label(MenuItem* this_, char* label=null) nothrow;
28965 void g_menu_item_set_link(MenuItem* this_, char* link, MenuModel* model=null) nothrow;
28966 void g_menu_item_set_section(MenuItem* this_, MenuModel* section=null) nothrow;
28967 void g_menu_item_set_submenu(MenuItem* this_, MenuModel* submenu=null) nothrow;
28968 char* g_menu_link_iter_get_name(MenuLinkIter* this_) nothrow;
28969 int g_menu_link_iter_get_next(MenuLinkIter* this_, /*out*/ char** out_link=null, /*out*/ MenuModel** value=null) nothrow;
28970 MenuModel* /*new*/ g_menu_link_iter_get_value(MenuLinkIter* this_) nothrow;
28971 int g_menu_link_iter_next(MenuLinkIter* this_) nothrow;
28972 int g_menu_model_get_item_attribute(MenuModel* this_, int item_index, char* attribute, char* format_string, ...) nothrow;
28973 GLib2.Variant* /*new*/ g_menu_model_get_item_attribute_value(MenuModel* this_, int item_index, char* attribute, GLib2.VariantType* expected_type=null) nothrow;
28974 MenuModel* /*new*/ g_menu_model_get_item_link(MenuModel* this_, int item_index, char* link) nothrow;
28975 int g_menu_model_get_n_items(MenuModel* this_) nothrow;
28976 int g_menu_model_is_mutable(MenuModel* this_) nothrow;
28977 void g_menu_model_items_changed(MenuModel* this_, int position, int removed, int added) nothrow;
28978 MenuAttributeIter* /*new*/ g_menu_model_iterate_item_attributes(MenuModel* this_, int item_index) nothrow;
28979 MenuLinkIter* /*new*/ g_menu_model_iterate_item_links(MenuModel* this_, int item_index) nothrow;
28980 int g_mount_can_eject(Mount* this_) nothrow;
28981 int g_mount_can_unmount(Mount* this_) nothrow;
28982 void g_mount_eject(Mount* this_, MountUnmountFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28983 int g_mount_eject_finish(Mount* this_, AsyncResult* result, GLib2.Error** error) nothrow;
28984 void g_mount_eject_with_operation(Mount* this_, MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28985 int g_mount_eject_with_operation_finish(Mount* this_, AsyncResult* result, GLib2.Error** error) nothrow;
28986 File* /*new*/ g_mount_get_default_location(Mount* this_) nothrow;
28987 Drive* /*new*/ g_mount_get_drive(Mount* this_) nothrow;
28988 Icon* /*new*/ g_mount_get_icon(Mount* this_) nothrow;
28989 char* /*new*/ g_mount_get_name(Mount* this_) nothrow;
28990 File* /*new*/ g_mount_get_root(Mount* this_) nothrow;
28991 char* g_mount_get_sort_key(Mount* this_) nothrow;
28992 char* /*new*/ g_mount_get_uuid(Mount* this_) nothrow;
28993 Volume* /*new*/ g_mount_get_volume(Mount* this_) nothrow;
28994 void g_mount_guess_content_type(Mount* this_, int force_rescan, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28995 char** /*new*/ g_mount_guess_content_type_finish(Mount* this_, AsyncResult* result, GLib2.Error** error) nothrow;
28996 char** /*new*/ g_mount_guess_content_type_sync(Mount* this_, int force_rescan, Cancellable* cancellable, GLib2.Error** error) nothrow;
28997 int g_mount_is_shadowed(Mount* this_) nothrow;
28998 void g_mount_remount(Mount* this_, MountMountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
28999 int g_mount_remount_finish(Mount* this_, AsyncResult* result, GLib2.Error** error) nothrow;
29000 void g_mount_shadow(Mount* this_) nothrow;
29001 void g_mount_unmount(Mount* this_, MountUnmountFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
29002 int g_mount_unmount_finish(Mount* this_, AsyncResult* result, GLib2.Error** error) nothrow;
29003 void g_mount_unmount_with_operation(Mount* this_, MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
29004 int g_mount_unmount_with_operation_finish(Mount* this_, AsyncResult* result, GLib2.Error** error) nothrow;
29005 void g_mount_unshadow(Mount* this_) nothrow;
29006 MountOperation* /*new*/ g_mount_operation_new() nothrow;
29007 int g_mount_operation_get_anonymous(MountOperation* this_) nothrow;
29008 int g_mount_operation_get_choice(MountOperation* this_) nothrow;
29009 char* g_mount_operation_get_domain(MountOperation* this_) nothrow;
29010 char* g_mount_operation_get_password(MountOperation* this_) nothrow;
29011 PasswordSave g_mount_operation_get_password_save(MountOperation* this_) nothrow;
29012 char* g_mount_operation_get_username(MountOperation* this_) nothrow;
29013 void g_mount_operation_reply(MountOperation* this_, MountOperationResult result) nothrow;
29014 void g_mount_operation_set_anonymous(MountOperation* this_, int anonymous) nothrow;
29015 void g_mount_operation_set_choice(MountOperation* this_, int choice) nothrow;
29016 void g_mount_operation_set_domain(MountOperation* this_, char* domain) nothrow;
29017 void g_mount_operation_set_password(MountOperation* this_, char* password) nothrow;
29018 void g_mount_operation_set_password_save(MountOperation* this_, PasswordSave save) nothrow;
29019 void g_mount_operation_set_username(MountOperation* this_, char* username) nothrow;
29020 NetworkAddress* /*new*/ g_network_address_new(char* hostname, ushort port) nothrow;
29021 SocketConnectable* /*new*/ g_network_address_parse(char* host_and_port, ushort default_port, GLib2.Error** error) nothrow;
29022 SocketConnectable* /*new*/ g_network_address_parse_uri(char* uri, ushort default_port, GLib2.Error** error) nothrow;
29023 char* g_network_address_get_hostname(NetworkAddress* this_) nothrow;
29024 ushort g_network_address_get_port(NetworkAddress* this_) nothrow;
29025 char* g_network_address_get_scheme(NetworkAddress* this_) nothrow;
29026 NetworkMonitor* g_network_monitor_get_default() nothrow;
29027 int g_network_monitor_can_reach(NetworkMonitor* this_, SocketConnectable* connectable, Cancellable* cancellable, GLib2.Error** error) nothrow;
29028 void g_network_monitor_can_reach_async(NetworkMonitor* this_, SocketConnectable* connectable, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
29029 int g_network_monitor_can_reach_finish(NetworkMonitor* this_, AsyncResult* result, GLib2.Error** error) nothrow;
29030 int g_network_monitor_get_network_available(NetworkMonitor* this_) nothrow;
29031 NetworkService* /*new*/ g_network_service_new(char* service, char* protocol, char* domain) nothrow;
29032 char* g_network_service_get_domain(NetworkService* this_) nothrow;
29033 char* g_network_service_get_protocol(NetworkService* this_) nothrow;
29034 char* g_network_service_get_scheme(NetworkService* this_) nothrow;
29035 char* g_network_service_get_service(NetworkService* this_) nothrow;
29036 void g_network_service_set_scheme(NetworkService* this_, char* scheme) nothrow;
29037 void g_output_stream_clear_pending(OutputStream* this_) nothrow;
29038 int g_output_stream_close(OutputStream* this_, Cancellable* cancellable, GLib2.Error** error) nothrow;
29039 void g_output_stream_close_async(OutputStream* this_, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
29040 int g_output_stream_close_finish(OutputStream* this_, AsyncResult* result, GLib2.Error** error) nothrow;
29041 int g_output_stream_flush(OutputStream* this_, Cancellable* cancellable, GLib2.Error** error) nothrow;
29042 void g_output_stream_flush_async(OutputStream* this_, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
29043 int g_output_stream_flush_finish(OutputStream* this_, AsyncResult* result, GLib2.Error** error) nothrow;
29044 int g_output_stream_has_pending(OutputStream* this_) nothrow;
29045 int g_output_stream_is_closed(OutputStream* this_) nothrow;
29046 int g_output_stream_is_closing(OutputStream* this_) nothrow;
29047 int g_output_stream_set_pending(OutputStream* this_, GLib2.Error** error) nothrow;
29048 ssize_t g_output_stream_splice(OutputStream* this_, InputStream* source, OutputStreamSpliceFlags flags, Cancellable* cancellable, GLib2.Error** error) nothrow;
29049 void g_output_stream_splice_async(OutputStream* this_, InputStream* source, OutputStreamSpliceFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
29050 ssize_t g_output_stream_splice_finish(OutputStream* this_, AsyncResult* result, GLib2.Error** error) nothrow;
29051 ssize_t g_output_stream_write(OutputStream* this_, ubyte* buffer, size_t count, Cancellable* cancellable, GLib2.Error** error) nothrow;
29052 int g_output_stream_write_all(OutputStream* this_, ubyte* buffer, size_t count, /*out*/ size_t* bytes_written, Cancellable* cancellable, GLib2.Error** error) nothrow;
29053 void g_output_stream_write_async(OutputStream* this_, ubyte* buffer, size_t count, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
29054 ssize_t g_output_stream_write_finish(OutputStream* this_, AsyncResult* result, GLib2.Error** error) nothrow;
29055 int g_permission_acquire(Permission* this_, Cancellable* cancellable, GLib2.Error** error) nothrow;
29056 void g_permission_acquire_async(Permission* this_, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
29057 int g_permission_acquire_finish(Permission* this_, AsyncResult* result, GLib2.Error** error) nothrow;
29058 int g_permission_get_allowed(Permission* this_) nothrow;
29059 int g_permission_get_can_acquire(Permission* this_) nothrow;
29060 int g_permission_get_can_release(Permission* this_) nothrow;
29061 void g_permission_impl_update(Permission* this_, int allowed, int can_acquire, int can_release) nothrow;
29062 int g_permission_release(Permission* this_, Cancellable* cancellable, GLib2.Error** error) nothrow;
29063 void g_permission_release_async(Permission* this_, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
29064 int g_permission_release_finish(Permission* this_, AsyncResult* result, GLib2.Error** error) nothrow;
29065 int g_pollable_input_stream_can_poll(PollableInputStream* this_) nothrow;
29066 GLib2.Source* /*new*/ g_pollable_input_stream_create_source(PollableInputStream* this_, Cancellable* cancellable=null) nothrow;
29067 int g_pollable_input_stream_is_readable(PollableInputStream* this_) nothrow;
29068 ssize_t g_pollable_input_stream_read_nonblocking(PollableInputStream* this_, void* buffer, size_t size, Cancellable* cancellable, GLib2.Error** error) nothrow;
29069 int g_pollable_output_stream_can_poll(PollableOutputStream* this_) nothrow;
29070 GLib2.Source* /*new*/ g_pollable_output_stream_create_source(PollableOutputStream* this_, Cancellable* cancellable=null) nothrow;
29071 int g_pollable_output_stream_is_writable(PollableOutputStream* this_) nothrow;
29072 ssize_t g_pollable_output_stream_write_nonblocking(PollableOutputStream* this_, ubyte* buffer, size_t size, Cancellable* cancellable, GLib2.Error** error) nothrow;
29073 Proxy* /*new*/ g_proxy_get_default_for_protocol(char* protocol) nothrow;
29074 IOStream* /*new*/ g_proxy_connect(Proxy* this_, IOStream* connection, ProxyAddress* proxy_address, Cancellable* cancellable, GLib2.Error** error) nothrow;
29075 void g_proxy_connect_async(Proxy* this_, IOStream* connection, ProxyAddress* proxy_address, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
29076 IOStream* /*new*/ g_proxy_connect_finish(Proxy* this_, AsyncResult* result, GLib2.Error** error) nothrow;
29077 int g_proxy_supports_hostname(Proxy* this_) nothrow;
29078 ProxyAddress* /*new*/ g_proxy_address_new(InetAddress* inetaddr, ushort port, char* protocol, char* dest_hostname, ushort dest_port, char* username=null, char* password=null) nothrow;
29079 char* g_proxy_address_get_destination_hostname(ProxyAddress* this_) nothrow;
29080 ushort g_proxy_address_get_destination_port(ProxyAddress* this_) nothrow;
29081 char* g_proxy_address_get_password(ProxyAddress* this_) nothrow;
29082 char* g_proxy_address_get_protocol(ProxyAddress* this_) nothrow;
29083 char* g_proxy_address_get_username(ProxyAddress* this_) nothrow;
29084 ProxyResolver* g_proxy_resolver_get_default() nothrow;
29085 int g_proxy_resolver_is_supported(ProxyResolver* this_) nothrow;
29086 char** /*new*/ g_proxy_resolver_lookup(ProxyResolver* this_, char* uri, Cancellable* cancellable, GLib2.Error** error) nothrow;
29087 void g_proxy_resolver_lookup_async(ProxyResolver* this_, char* uri, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
29088 char** /*new*/ g_proxy_resolver_lookup_finish(ProxyResolver* this_, AsyncResult* result, GLib2.Error** error) nothrow;
29089 void g_remote_action_group_activate_action_full(RemoteActionGroup* this_, char* action_name, GLib2.Variant* parameter, GLib2.Variant* platform_data) nothrow;
29090 void g_remote_action_group_change_action_state_full(RemoteActionGroup* this_, char* action_name, GLib2.Variant* value, GLib2.Variant* platform_data) nothrow;
29091 void g_resolver_free_addresses(GLib2.List* addresses) nothrow;
29092 void g_resolver_free_targets(GLib2.List* targets) nothrow;
29093 Resolver* /*new*/ g_resolver_get_default() nothrow;
29094 char* /*new*/ g_resolver_lookup_by_address(Resolver* this_, InetAddress* address, Cancellable* cancellable, GLib2.Error** error) nothrow;
29095 void g_resolver_lookup_by_address_async(Resolver* this_, InetAddress* address, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
29096 char* /*new*/ g_resolver_lookup_by_address_finish(Resolver* this_, AsyncResult* result, GLib2.Error** error) nothrow;
29097 GLib2.List* /*new*/ g_resolver_lookup_by_name(Resolver* this_, char* hostname, Cancellable* cancellable, GLib2.Error** error) nothrow;
29098 void g_resolver_lookup_by_name_async(Resolver* this_, char* hostname, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
29099 GLib2.List* /*new*/ g_resolver_lookup_by_name_finish(Resolver* this_, AsyncResult* result, GLib2.Error** error) nothrow;
29100 GLib2.List* /*new*/ g_resolver_lookup_service(Resolver* this_, char* service, char* protocol, char* domain, Cancellable* cancellable, GLib2.Error** error) nothrow;
29101 void g_resolver_lookup_service_async(Resolver* this_, char* service, char* protocol, char* domain, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
29102 GLib2.List* /*new*/ g_resolver_lookup_service_finish(Resolver* this_, AsyncResult* result, GLib2.Error** error) nothrow;
29103 void g_resolver_set_default(Resolver* this_) nothrow;
29104 Resource* /*new*/ g_resource_new_from_data(GLib2.Bytes* data, GLib2.Error** error) nothrow;
29105 void g_resources_register(Resource* this_) nothrow;
29106 void g_resources_unregister(Resource* this_) nothrow;
29107 char** /*new*/ g_resource_enumerate_children(Resource* this_, char* path, ResourceLookupFlags lookup_flags, GLib2.Error** error) nothrow;
29108 int g_resource_get_info(Resource* this_, char* path, ResourceLookupFlags lookup_flags, /*out*/ size_t* size, /*out*/ uint* flags, GLib2.Error** error) nothrow;
29109 GLib2.Bytes* /*new*/ g_resource_lookup_data(Resource* this_, char* path, ResourceLookupFlags lookup_flags, GLib2.Error** error) nothrow;
29110 InputStream* /*new*/ g_resource_open_stream(Resource* this_, char* path, ResourceLookupFlags lookup_flags, GLib2.Error** error) nothrow;
29111 Resource* /*new*/ g_resource_ref(Resource* this_) nothrow;
29112 void g_resource_unref(Resource* this_) nothrow;
29113 Resource* /*new*/ g_resource_load(char* filename, GLib2.Error** error) nothrow;
29114 int g_seekable_can_seek(Seekable* this_) nothrow;
29115 int g_seekable_can_truncate(Seekable* this_) nothrow;
29116 int g_seekable_seek(Seekable* this_, long offset, GLib2.SeekType type, Cancellable* cancellable, GLib2.Error** error) nothrow;
29117 long g_seekable_tell(Seekable* this_) nothrow;
29118 int g_seekable_truncate(Seekable* this_, long offset, Cancellable* cancellable, GLib2.Error** error) nothrow;
29119 Settings* /*new*/ g_settings_new(char* schema_id) nothrow;
29120 Settings* /*new*/ g_settings_new_full(SettingsSchema* schema, SettingsBackend* backend=null, char* path=null) nothrow;
29121 Settings* /*new*/ g_settings_new_with_backend(char* schema_id, SettingsBackend* backend) nothrow;
29122 Settings* /*new*/ g_settings_new_with_backend_and_path(char* schema_id, SettingsBackend* backend, char* path) nothrow;
29123 Settings* /*new*/ g_settings_new_with_path(char* schema_id, char* path) nothrow;
29124 char** g_settings_list_relocatable_schemas() nothrow;
29125 char** g_settings_list_schemas() nothrow;
29126 void g_settings_sync() nothrow;
29127 void g_settings_unbind(void* object, char* property) nothrow;
29128 void g_settings_apply(Settings* this_) nothrow;
29129 void g_settings_bind(Settings* this_, char* key, GObject2.Object* object, char* property, SettingsBindFlags flags) nothrow;
29130 void g_settings_bind_with_mapping(Settings* this_, char* key, GObject2.Object* object, char* property, SettingsBindFlags flags, SettingsBindGetMapping get_mapping, SettingsBindSetMapping set_mapping, void* user_data, GLib2.DestroyNotify destroy) nothrow;
29131 void g_settings_bind_writable(Settings* this_, char* key, GObject2.Object* object, char* property, int inverted) nothrow;
29132 Action* /*new*/ g_settings_create_action(Settings* this_, char* key) nothrow;
29133 void g_settings_delay(Settings* this_) nothrow;
29134 void g_settings_get(Settings* this_, char* key, char* format, ...) nothrow;
29135 int g_settings_get_boolean(Settings* this_, char* key) nothrow;
29136 Settings* /*new*/ g_settings_get_child(Settings* this_, char* name) nothrow;
29137 double g_settings_get_double(Settings* this_, char* key) nothrow;
29138 int g_settings_get_enum(Settings* this_, char* key) nothrow;
29139 uint g_settings_get_flags(Settings* this_, char* key) nothrow;
29140 int g_settings_get_has_unapplied(Settings* this_) nothrow;
29141 int g_settings_get_int(Settings* this_, char* key) nothrow;
29142 void* /*new*/ g_settings_get_mapped(Settings* this_, char* key, SettingsGetMapping mapping, void* user_data) nothrow;
29143 GLib2.Variant* /*new*/ g_settings_get_range(Settings* this_, char* key) nothrow;
29144 char* /*new*/ g_settings_get_string(Settings* this_, char* key) nothrow;
29145 char** /*new*/ g_settings_get_strv(Settings* this_, char* key) nothrow;
29146 uint g_settings_get_uint(Settings* this_, char* key) nothrow;
29147 GLib2.Variant* /*new*/ g_settings_get_value(Settings* this_, char* key) nothrow;
29148 int g_settings_is_writable(Settings* this_, char* name) nothrow;
29149 char** /*new*/ g_settings_list_children(Settings* this_) nothrow;
29150 char** /*new*/ g_settings_list_keys(Settings* this_) nothrow;
29151 int g_settings_range_check(Settings* this_, char* key, GLib2.Variant* value) nothrow;
29152 void g_settings_reset(Settings* this_, char* key) nothrow;
29153 void g_settings_revert(Settings* this_) nothrow;
29154 int g_settings_set(Settings* this_, char* key, char* format, ...) nothrow;
29155 int g_settings_set_boolean(Settings* this_, char* key, int value) nothrow;
29156 int g_settings_set_double(Settings* this_, char* key, double value) nothrow;
29157 int g_settings_set_enum(Settings* this_, char* key, int value) nothrow;
29158 int g_settings_set_flags(Settings* this_, char* key, uint value) nothrow;
29159 int g_settings_set_int(Settings* this_, char* key, int value) nothrow;
29160 int g_settings_set_string(Settings* this_, char* key, char* value) nothrow;
29161 int g_settings_set_strv(Settings* this_, char* key, char** value=null) nothrow;
29162 int g_settings_set_uint(Settings* this_, char* key, uint value) nothrow;
29163 int g_settings_set_value(Settings* this_, char* key, GLib2.Variant* value) nothrow;
29164 char* g_settings_schema_get_id(SettingsSchema* this_) nothrow;
29165 char* g_settings_schema_get_path(SettingsSchema* this_) nothrow;
29166 SettingsSchema* /*new*/ g_settings_schema_ref(SettingsSchema* this_) nothrow;
29167 void g_settings_schema_unref(SettingsSchema* this_) nothrow;
29168 SettingsSchemaSource* /*new*/ g_settings_schema_source_new_from_directory(char* directory, SettingsSchemaSource* parent, int trusted, GLib2.Error** error) nothrow;
29169 SettingsSchema* /*new*/ g_settings_schema_source_lookup(SettingsSchemaSource* this_, char* schema_id, int recursive) nothrow;
29170 SettingsSchemaSource* /*new*/ g_settings_schema_source_ref(SettingsSchemaSource* this_) nothrow;
29171 void g_settings_schema_source_unref(SettingsSchemaSource* this_) nothrow;
29172 SettingsSchemaSource* g_settings_schema_source_get_default() nothrow;
29173 SimpleAction* /*new*/ g_simple_action_new(char* name, GLib2.VariantType* parameter_type=null) nothrow;
29174 SimpleAction* /*new*/ g_simple_action_new_stateful(char* name, GLib2.VariantType* parameter_type, GLib2.Variant* state) nothrow;
29175 void g_simple_action_set_enabled(SimpleAction* this_, int enabled) nothrow;
29176 void g_simple_action_set_state(SimpleAction* this_, GLib2.Variant* value) nothrow;
29177 SimpleActionGroup* /*new*/ g_simple_action_group_new() nothrow;
29178 void g_simple_action_group_add_entries(SimpleActionGroup* this_, ActionEntry* entries, int n_entries, void* user_data) nothrow;
29179 void g_simple_action_group_insert(SimpleActionGroup* this_, Action* action) nothrow;
29180 Action* g_simple_action_group_lookup(SimpleActionGroup* this_, char* action_name) nothrow;
29181 void g_simple_action_group_remove(SimpleActionGroup* this_, char* action_name) nothrow;
29182 SimpleAsyncResult* /*new*/ g_simple_async_result_new(GObject2.Object* source_object, AsyncReadyCallback callback, void* user_data, void* source_tag) nothrow;
29183 SimpleAsyncResult* /*new*/ g_simple_async_result_new_error(GObject2.Object* source_object, AsyncReadyCallback callback, void* user_data, GLib2.Quark domain, int code, char* format, ...) nothrow;
29184 SimpleAsyncResult* /*new*/ g_simple_async_result_new_from_error(GObject2.Object* source_object, AsyncReadyCallback callback, void* user_data, GLib2.Error* error) nothrow;
29185 SimpleAsyncResult* /*new*/ g_simple_async_result_new_take_error(GObject2.Object* source_object, AsyncReadyCallback callback, void* user_data, GLib2.Error* error) nothrow;
29186 int g_simple_async_result_is_valid(AsyncResult* result, GObject2.Object* source, void* source_tag) nothrow;
29187 void g_simple_async_result_complete(SimpleAsyncResult* this_) nothrow;
29188 void g_simple_async_result_complete_in_idle(SimpleAsyncResult* this_) nothrow;
29189 int g_simple_async_result_get_op_res_gboolean(SimpleAsyncResult* this_) nothrow;
29190 void* g_simple_async_result_get_op_res_gpointer(SimpleAsyncResult* this_) nothrow;
29191 ssize_t g_simple_async_result_get_op_res_gssize(SimpleAsyncResult* this_) nothrow;
29192 void* g_simple_async_result_get_source_tag(SimpleAsyncResult* this_) nothrow;
29193 int g_simple_async_result_propagate_error(SimpleAsyncResult* this_, GLib2.Error** error) nothrow;
29194 void g_simple_async_result_run_in_thread(SimpleAsyncResult* this_, SimpleAsyncThreadFunc func, int io_priority, Cancellable* cancellable=null) nothrow;
29195 void g_simple_async_result_set_check_cancellable(SimpleAsyncResult* this_, Cancellable* check_cancellable=null) nothrow;
29196 void g_simple_async_result_set_error(SimpleAsyncResult* this_, GLib2.Quark domain, int code, char* format, ...) nothrow;
29197 void g_simple_async_result_set_error_va(SimpleAsyncResult* this_, GLib2.Quark domain, int code, char* format, va_list args) nothrow;
29198 void g_simple_async_result_set_from_error(SimpleAsyncResult* this_, GLib2.Error* error) nothrow;
29199 void g_simple_async_result_set_handle_cancellation(SimpleAsyncResult* this_, int handle_cancellation) nothrow;
29200 void g_simple_async_result_set_op_res_gboolean(SimpleAsyncResult* this_, int op_res) nothrow;
29201 void g_simple_async_result_set_op_res_gpointer(SimpleAsyncResult* this_, void* op_res, GLib2.DestroyNotify destroy_op_res) nothrow;
29202 void g_simple_async_result_set_op_res_gssize(SimpleAsyncResult* this_, ssize_t op_res) nothrow;
29203 void g_simple_async_result_take_error(SimpleAsyncResult* this_, GLib2.Error* error) nothrow;
29204 SimplePermission* /*new*/ g_simple_permission_new(int allowed) nothrow;
29205 Socket* /*new*/ g_socket_new(SocketFamily family, SocketType type, SocketProtocol protocol, GLib2.Error** error) nothrow;
29206 Socket* /*new*/ g_socket_new_from_fd(int fd, GLib2.Error** error) nothrow;
29207 Socket* /*new*/ g_socket_accept(Socket* this_, Cancellable* cancellable, GLib2.Error** error) nothrow;
29208 int g_socket_bind(Socket* this_, SocketAddress* address, int allow_reuse, GLib2.Error** error) nothrow;
29209 int g_socket_check_connect_result(Socket* this_, GLib2.Error** error) nothrow;
29210 int g_socket_close(Socket* this_, GLib2.Error** error) nothrow;
29211 GLib2.IOCondition g_socket_condition_check(Socket* this_, GLib2.IOCondition condition) nothrow;
29212 int g_socket_condition_timed_wait(Socket* this_, GLib2.IOCondition condition, long timeout, Cancellable* cancellable, GLib2.Error** error) nothrow;
29213 int g_socket_condition_wait(Socket* this_, GLib2.IOCondition condition, Cancellable* cancellable, GLib2.Error** error) nothrow;
29214 int g_socket_connect(Socket* this_, SocketAddress* address, Cancellable* cancellable, GLib2.Error** error) nothrow;
29215 SocketConnection* /*new*/ g_socket_connection_factory_create_connection(Socket* this_) nothrow;
29216 GLib2.Source* /*new*/ g_socket_create_source(Socket* this_, GLib2.IOCondition condition, Cancellable* cancellable=null) nothrow;
29217 ssize_t g_socket_get_available_bytes(Socket* this_) nothrow;
29218 int g_socket_get_blocking(Socket* this_) nothrow;
29219 int g_socket_get_broadcast(Socket* this_) nothrow;
29220 Credentials* /*new*/ g_socket_get_credentials(Socket* this_, GLib2.Error** error) nothrow;
29221 SocketFamily g_socket_get_family(Socket* this_) nothrow;
29222 int g_socket_get_fd(Socket* this_) nothrow;
29223 int g_socket_get_keepalive(Socket* this_) nothrow;
29224 int g_socket_get_listen_backlog(Socket* this_) nothrow;
29225 SocketAddress* /*new*/ g_socket_get_local_address(Socket* this_, GLib2.Error** error) nothrow;
29226 int g_socket_get_multicast_loopback(Socket* this_) nothrow;
29227 uint g_socket_get_multicast_ttl(Socket* this_) nothrow;
29228 SocketProtocol g_socket_get_protocol(Socket* this_) nothrow;
29229 SocketAddress* /*new*/ g_socket_get_remote_address(Socket* this_, GLib2.Error** error) nothrow;
29230 SocketType g_socket_get_socket_type(Socket* this_) nothrow;
29231 uint g_socket_get_timeout(Socket* this_) nothrow;
29232 uint g_socket_get_ttl(Socket* this_) nothrow;
29233 int g_socket_is_closed(Socket* this_) nothrow;
29234 int g_socket_is_connected(Socket* this_) nothrow;
29235 int g_socket_join_multicast_group(Socket* this_, InetAddress* group, int source_specific, char* iface, GLib2.Error** error) nothrow;
29236 int g_socket_leave_multicast_group(Socket* this_, InetAddress* group, int source_specific, char* iface, GLib2.Error** error) nothrow;
29237 int g_socket_listen(Socket* this_, GLib2.Error** error) nothrow;
29238 ssize_t g_socket_receive(Socket* this_, char* buffer, size_t size, Cancellable* cancellable, GLib2.Error** error) nothrow;
29239 ssize_t g_socket_receive_from(Socket* this_, /*out*/ SocketAddress** address, ubyte* buffer, size_t size, Cancellable* cancellable, GLib2.Error** error) nothrow;
29240 ssize_t g_socket_receive_message(Socket* this_, /*out*/ SocketAddress** address, InputVector* vectors, int num_vectors, SocketControlMessage*** messages, int* num_messages, int* flags, Cancellable* cancellable, GLib2.Error** error) nothrow;
29241 ssize_t g_socket_receive_with_blocking(Socket* this_, char* buffer, size_t size, int blocking, Cancellable* cancellable, GLib2.Error** error) nothrow;
29242 ssize_t g_socket_send(Socket* this_, ubyte* buffer, size_t size, Cancellable* cancellable, GLib2.Error** error) nothrow;
29243 ssize_t g_socket_send_message(Socket* this_, SocketAddress* address, OutputVector* vectors, int num_vectors, SocketControlMessage** messages, int num_messages, int flags, Cancellable* cancellable, GLib2.Error** error) nothrow;
29244 ssize_t g_socket_send_to(Socket* this_, SocketAddress* address, ubyte* buffer, size_t size, Cancellable* cancellable, GLib2.Error** error) nothrow;
29245 ssize_t g_socket_send_with_blocking(Socket* this_, ubyte* buffer, size_t size, int blocking, Cancellable* cancellable, GLib2.Error** error) nothrow;
29246 void g_socket_set_blocking(Socket* this_, int blocking) nothrow;
29247 void g_socket_set_broadcast(Socket* this_, int broadcast) nothrow;
29248 void g_socket_set_keepalive(Socket* this_, int keepalive) nothrow;
29249 void g_socket_set_listen_backlog(Socket* this_, int backlog) nothrow;
29250 void g_socket_set_multicast_loopback(Socket* this_, int loopback) nothrow;
29251 void g_socket_set_multicast_ttl(Socket* this_, uint ttl) nothrow;
29252 void g_socket_set_timeout(Socket* this_, uint timeout) nothrow;
29253 void g_socket_set_ttl(Socket* this_, uint ttl) nothrow;
29254 int g_socket_shutdown(Socket* this_, int shutdown_read, int shutdown_write, GLib2.Error** error) nothrow;
29255 int g_socket_speaks_ipv4(Socket* this_) nothrow;
29256 SocketAddress* /*new*/ g_socket_address_new_from_native(void* native, size_t len) nothrow;
29257 SocketFamily g_socket_address_get_family(SocketAddress* this_) nothrow;
29258 ssize_t g_socket_address_get_native_size(SocketAddress* this_) nothrow;
29259 int g_socket_address_to_native(SocketAddress* this_, void* dest, size_t destlen, GLib2.Error** error) nothrow;
29260 SocketAddress* /*new*/ g_socket_address_enumerator_next(SocketAddressEnumerator* this_, Cancellable* cancellable, GLib2.Error** error) nothrow;
29261 void g_socket_address_enumerator_next_async(SocketAddressEnumerator* this_, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
29262 SocketAddress* /*new*/ g_socket_address_enumerator_next_finish(SocketAddressEnumerator* this_, AsyncResult* result, GLib2.Error** error) nothrow;
29263 SocketClient* /*new*/ g_socket_client_new() nothrow;
29264 void g_socket_client_add_application_proxy(SocketClient* this_, char* protocol) nothrow;
29265 SocketConnection* /*new*/ g_socket_client_connect(SocketClient* this_, SocketConnectable* connectable, Cancellable* cancellable, GLib2.Error** error) nothrow;
29266 void g_socket_client_connect_async(SocketClient* this_, SocketConnectable* connectable, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
29267 SocketConnection* /*new*/ g_socket_client_connect_finish(SocketClient* this_, AsyncResult* result, GLib2.Error** error) nothrow;
29268 SocketConnection* /*new*/ g_socket_client_connect_to_host(SocketClient* this_, char* host_and_port, ushort default_port, Cancellable* cancellable, GLib2.Error** error) nothrow;
29269 void g_socket_client_connect_to_host_async(SocketClient* this_, char* host_and_port, ushort default_port, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
29270 SocketConnection* /*new*/ g_socket_client_connect_to_host_finish(SocketClient* this_, AsyncResult* result, GLib2.Error** error) nothrow;
29271 SocketConnection* /*new*/ g_socket_client_connect_to_service(SocketClient* this_, char* domain, char* service, Cancellable* cancellable, GLib2.Error** error) nothrow;
29272 void g_socket_client_connect_to_service_async(SocketClient* this_, char* domain, char* service, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
29273 SocketConnection* /*new*/ g_socket_client_connect_to_service_finish(SocketClient* this_, AsyncResult* result, GLib2.Error** error) nothrow;
29274 SocketConnection* /*new*/ g_socket_client_connect_to_uri(SocketClient* this_, char* uri, ushort default_port, Cancellable* cancellable, GLib2.Error** error) nothrow;
29275 void g_socket_client_connect_to_uri_async(SocketClient* this_, char* uri, ushort default_port, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
29276 SocketConnection* /*new*/ g_socket_client_connect_to_uri_finish(SocketClient* this_, AsyncResult* result, GLib2.Error** error) nothrow;
29277 int g_socket_client_get_enable_proxy(SocketClient* this_) nothrow;
29278 SocketFamily g_socket_client_get_family(SocketClient* this_) nothrow;
29279 SocketAddress* g_socket_client_get_local_address(SocketClient* this_) nothrow;
29280 SocketProtocol g_socket_client_get_protocol(SocketClient* this_) nothrow;
29281 SocketType g_socket_client_get_socket_type(SocketClient* this_) nothrow;
29282 uint g_socket_client_get_timeout(SocketClient* this_) nothrow;
29283 int g_socket_client_get_tls(SocketClient* this_) nothrow;
29284 TlsCertificateFlags g_socket_client_get_tls_validation_flags(SocketClient* this_) nothrow;
29285 void g_socket_client_set_enable_proxy(SocketClient* this_, int enable) nothrow;
29286 void g_socket_client_set_family(SocketClient* this_, SocketFamily family) nothrow;
29287 void g_socket_client_set_local_address(SocketClient* this_, SocketAddress* address) nothrow;
29288 void g_socket_client_set_protocol(SocketClient* this_, SocketProtocol protocol) nothrow;
29289 void g_socket_client_set_socket_type(SocketClient* this_, SocketType type) nothrow;
29290 void g_socket_client_set_timeout(SocketClient* this_, uint timeout) nothrow;
29291 void g_socket_client_set_tls(SocketClient* this_, int tls) nothrow;
29292 void g_socket_client_set_tls_validation_flags(SocketClient* this_, TlsCertificateFlags flags) nothrow;
29293 SocketAddressEnumerator* /*new*/ g_socket_connectable_enumerate(SocketConnectable* this_) nothrow;
29294 SocketAddressEnumerator* /*new*/ g_socket_connectable_proxy_enumerate(SocketConnectable* this_) nothrow;
29295 Type g_socket_connection_factory_lookup_type(SocketFamily family, SocketType type, int protocol_id) nothrow;
29296 void g_socket_connection_factory_register_type(Type g_type, SocketFamily family, SocketType type, int protocol) nothrow;
29297 int g_socket_connection_connect(SocketConnection* this_, SocketAddress* address, Cancellable* cancellable, GLib2.Error** error) nothrow;
29298 void g_socket_connection_connect_async(SocketConnection* this_, SocketAddress* address, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
29299 int g_socket_connection_connect_finish(SocketConnection* this_, AsyncResult* result, GLib2.Error** error) nothrow;
29300 SocketAddress* /*new*/ g_socket_connection_get_local_address(SocketConnection* this_, GLib2.Error** error) nothrow;
29301 SocketAddress* /*new*/ g_socket_connection_get_remote_address(SocketConnection* this_, GLib2.Error** error) nothrow;
29302 Socket* g_socket_connection_get_socket(SocketConnection* this_) nothrow;
29303 int g_socket_connection_is_connected(SocketConnection* this_) nothrow;
29304 SocketControlMessage* /*new*/ g_socket_control_message_deserialize(int level, int type, size_t size, void* data) nothrow;
29305 int g_socket_control_message_get_level(SocketControlMessage* this_) nothrow;
29306 int g_socket_control_message_get_msg_type(SocketControlMessage* this_) nothrow;
29307 size_t g_socket_control_message_get_size(SocketControlMessage* this_) nothrow;
29308 void g_socket_control_message_serialize(SocketControlMessage* this_, void* data) nothrow;
29309 SocketListener* /*new*/ g_socket_listener_new() nothrow;
29310 SocketConnection* /*new*/ g_socket_listener_accept(SocketListener* this_, /*out*/ GObject2.Object** source_object, Cancellable* cancellable, GLib2.Error** error) nothrow;
29311 void g_socket_listener_accept_async(SocketListener* this_, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
29312 SocketConnection* /*new*/ g_socket_listener_accept_finish(SocketListener* this_, AsyncResult* result, /*out*/ GObject2.Object** source_object, GLib2.Error** error) nothrow;
29313 Socket* /*new*/ g_socket_listener_accept_socket(SocketListener* this_, /*out*/ GObject2.Object** source_object, Cancellable* cancellable, GLib2.Error** error) nothrow;
29314 void g_socket_listener_accept_socket_async(SocketListener* this_, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
29315 Socket* /*new*/ g_socket_listener_accept_socket_finish(SocketListener* this_, AsyncResult* result, /*out*/ GObject2.Object** source_object, GLib2.Error** error) nothrow;
29316 int g_socket_listener_add_address(SocketListener* this_, SocketAddress* address, SocketType type, SocketProtocol protocol, GObject2.Object* source_object, /*out*/ SocketAddress** effective_address, GLib2.Error** error) nothrow;
29317 ushort g_socket_listener_add_any_inet_port(SocketListener* this_, GObject2.Object* source_object, GLib2.Error** error) nothrow;
29318 int g_socket_listener_add_inet_port(SocketListener* this_, ushort port, GObject2.Object* source_object, GLib2.Error** error) nothrow;
29319 int g_socket_listener_add_socket(SocketListener* this_, Socket* socket, GObject2.Object* source_object, GLib2.Error** error) nothrow;
29320 void g_socket_listener_close(SocketListener* this_) nothrow;
29321 void g_socket_listener_set_backlog(SocketListener* this_, int listen_backlog) nothrow;
29322 SocketService* /*new*/ g_socket_service_new() nothrow;
29323 int g_socket_service_is_active(SocketService* this_) nothrow;
29324 void g_socket_service_start(SocketService* this_) nothrow;
29325 void g_socket_service_stop(SocketService* this_) nothrow;
29326 SrvTarget* /*new*/ g_srv_target_new(char* hostname, ushort port, ushort priority, ushort weight) nothrow;
29327 SrvTarget* /*new*/ g_srv_target_copy(SrvTarget* this_) nothrow;
29328 void g_srv_target_free(SrvTarget* this_) nothrow;
29329 char* g_srv_target_get_hostname(SrvTarget* this_) nothrow;
29330 ushort g_srv_target_get_port(SrvTarget* this_) nothrow;
29331 ushort g_srv_target_get_priority(SrvTarget* this_) nothrow;
29332 ushort g_srv_target_get_weight(SrvTarget* this_) nothrow;
29333 GLib2.List* /*new*/ g_srv_target_list_sort(GLib2.List* targets) nothrow;
29334 void g_static_resource_fini(StaticResource* this_) nothrow;
29335 Resource* g_static_resource_get_resource(StaticResource* this_) nothrow;
29336 void g_static_resource_init(StaticResource* this_) nothrow;
29337 int g_tcp_connection_get_graceful_disconnect(TcpConnection* this_) nothrow;
29338 void g_tcp_connection_set_graceful_disconnect(TcpConnection* this_, int graceful_disconnect) nothrow;
29339 TcpWrapperConnection* /*new*/ g_tcp_wrapper_connection_new(IOStream* base_io_stream, Socket* socket) nothrow;
29340 IOStream* g_tcp_wrapper_connection_get_base_io_stream(TcpWrapperConnection* this_) nothrow;
29341 ThemedIcon* /*new*/ g_themed_icon_new(char* iconname) nothrow;
29342 ThemedIcon* /*new*/ g_themed_icon_new_from_names(char** iconnames, int len) nothrow;
29343 ThemedIcon* /*new*/ g_themed_icon_new_with_default_fallbacks(char* iconname) nothrow;
29344 void g_themed_icon_append_name(ThemedIcon* this_, char* iconname) nothrow;
29345 char** g_themed_icon_get_names(ThemedIcon* this_) nothrow;
29346 void g_themed_icon_prepend_name(ThemedIcon* this_, char* iconname) nothrow;
29347 ThreadedSocketService* /*new*/ g_threaded_socket_service_new(int max_threads) nothrow;
29348 TlsBackend* g_tls_backend_get_default() nothrow;
29349 Type g_tls_backend_get_certificate_type(TlsBackend* this_) nothrow;
29350 Type g_tls_backend_get_client_connection_type(TlsBackend* this_) nothrow;
29351 TlsDatabase* /*new*/ g_tls_backend_get_default_database(TlsBackend* this_) nothrow;
29352 Type g_tls_backend_get_file_database_type(TlsBackend* this_) nothrow;
29353 Type g_tls_backend_get_server_connection_type(TlsBackend* this_) nothrow;
29354 int g_tls_backend_supports_tls(TlsBackend* this_) nothrow;
29355 TlsCertificate* /*new*/ g_tls_certificate_new_from_file(char* file, GLib2.Error** error) nothrow;
29356 TlsCertificate* /*new*/ g_tls_certificate_new_from_files(char* cert_file, char* key_file, GLib2.Error** error) nothrow;
29357 TlsCertificate* /*new*/ g_tls_certificate_new_from_pem(char* data, ssize_t length, GLib2.Error** error) nothrow;
29358 GLib2.List* /*new*/ g_tls_certificate_list_new_from_file(char* file, GLib2.Error** error) nothrow;
29359 TlsCertificate* g_tls_certificate_get_issuer(TlsCertificate* this_) nothrow;
29360 TlsCertificateFlags g_tls_certificate_verify(TlsCertificate* this_, SocketConnectable* identity=null, TlsCertificate* trusted_ca=null) nothrow;
29361 TlsClientConnection* /*new*/ g_tls_client_connection_new(IOStream* base_io_stream, SocketConnectable* server_identity, GLib2.Error** error) nothrow;
29362 GLib2.List* /*new*/ g_tls_client_connection_get_accepted_cas(TlsClientConnection* this_) nothrow;
29363 SocketConnectable* g_tls_client_connection_get_server_identity(TlsClientConnection* this_) nothrow;
29364 int g_tls_client_connection_get_use_ssl3(TlsClientConnection* this_) nothrow;
29365 TlsCertificateFlags g_tls_client_connection_get_validation_flags(TlsClientConnection* this_) nothrow;
29366 void g_tls_client_connection_set_server_identity(TlsClientConnection* this_, SocketConnectable* identity) nothrow;
29367 void g_tls_client_connection_set_use_ssl3(TlsClientConnection* this_, int use_ssl3) nothrow;
29368 void g_tls_client_connection_set_validation_flags(TlsClientConnection* this_, TlsCertificateFlags flags) nothrow;
29369 int g_tls_connection_emit_accept_certificate(TlsConnection* this_, TlsCertificate* peer_cert, TlsCertificateFlags errors) nothrow;
29370 TlsCertificate* g_tls_connection_get_certificate(TlsConnection* this_) nothrow;
29371 TlsDatabase* g_tls_connection_get_database(TlsConnection* this_) nothrow;
29372 TlsInteraction* g_tls_connection_get_interaction(TlsConnection* this_) nothrow;
29373 TlsCertificate* g_tls_connection_get_peer_certificate(TlsConnection* this_) nothrow;
29374 TlsCertificateFlags g_tls_connection_get_peer_certificate_errors(TlsConnection* this_) nothrow;
29375 TlsRehandshakeMode g_tls_connection_get_rehandshake_mode(TlsConnection* this_) nothrow;
29376 int g_tls_connection_get_require_close_notify(TlsConnection* this_) nothrow;
29377 int g_tls_connection_get_use_system_certdb(TlsConnection* this_) nothrow;
29378 int g_tls_connection_handshake(TlsConnection* this_, Cancellable* cancellable, GLib2.Error** error) nothrow;
29379 void g_tls_connection_handshake_async(TlsConnection* this_, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
29380 int g_tls_connection_handshake_finish(TlsConnection* this_, AsyncResult* result, GLib2.Error** error) nothrow;
29381 void g_tls_connection_set_certificate(TlsConnection* this_, TlsCertificate* certificate) nothrow;
29382 void g_tls_connection_set_database(TlsConnection* this_, TlsDatabase* database) nothrow;
29383 void g_tls_connection_set_interaction(TlsConnection* this_, TlsInteraction* interaction=null) nothrow;
29384 void g_tls_connection_set_rehandshake_mode(TlsConnection* this_, TlsRehandshakeMode mode) nothrow;
29385 void g_tls_connection_set_require_close_notify(TlsConnection* this_, int require_close_notify) nothrow;
29386 void g_tls_connection_set_use_system_certdb(TlsConnection* this_, int use_system_certdb) nothrow;
29387 char* /*new*/ g_tls_database_create_certificate_handle(TlsDatabase* this_, TlsCertificate* certificate) nothrow;
29388 TlsCertificate* /*new*/ g_tls_database_lookup_certificate_for_handle(TlsDatabase* this_, char* handle, TlsInteraction* interaction, TlsDatabaseLookupFlags flags, Cancellable* cancellable, GLib2.Error** error) nothrow;
29389 void g_tls_database_lookup_certificate_for_handle_async(TlsDatabase* this_, char* handle, TlsInteraction* interaction, TlsDatabaseLookupFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
29390 TlsCertificate* /*new*/ g_tls_database_lookup_certificate_for_handle_finish(TlsDatabase* this_, AsyncResult* result, GLib2.Error** error) nothrow;
29391 TlsCertificate* /*new*/ g_tls_database_lookup_certificate_issuer(TlsDatabase* this_, TlsCertificate* certificate, TlsInteraction* interaction, TlsDatabaseLookupFlags flags, Cancellable* cancellable, GLib2.Error** error) nothrow;
29392 void g_tls_database_lookup_certificate_issuer_async(TlsDatabase* this_, TlsCertificate* certificate, TlsInteraction* interaction, TlsDatabaseLookupFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
29393 TlsCertificate* /*new*/ g_tls_database_lookup_certificate_issuer_finish(TlsDatabase* this_, AsyncResult* result, GLib2.Error** error) nothrow;
29394 GLib2.List* /*new*/ g_tls_database_lookup_certificates_issued_by(TlsDatabase* this_, ByteArray* issuer_raw_dn, TlsInteraction* interaction, TlsDatabaseLookupFlags flags, Cancellable* cancellable, GLib2.Error** error) nothrow;
29395 void g_tls_database_lookup_certificates_issued_by_async(TlsDatabase* this_, ByteArray* issuer_raw_dn, TlsInteraction* interaction, TlsDatabaseLookupFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
29396 GLib2.List* /*new*/ g_tls_database_lookup_certificates_issued_by_finish(TlsDatabase* this_, AsyncResult* result, GLib2.Error** error) nothrow;
29397 TlsCertificateFlags g_tls_database_verify_chain(TlsDatabase* this_, TlsCertificate* chain, char* purpose, SocketConnectable* identity, TlsInteraction* interaction, TlsDatabaseVerifyFlags flags, Cancellable* cancellable, GLib2.Error** error) nothrow;
29398 void g_tls_database_verify_chain_async(TlsDatabase* this_, TlsCertificate* chain, char* purpose, SocketConnectable* identity, TlsInteraction* interaction, TlsDatabaseVerifyFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
29399 TlsCertificateFlags g_tls_database_verify_chain_finish(TlsDatabase* this_, AsyncResult* result, GLib2.Error** error) nothrow;
29400 TlsFileDatabase* /*new*/ g_tls_file_database_new(char* anchors, GLib2.Error** error) nothrow;
29401 TlsInteractionResult g_tls_interaction_ask_password(TlsInteraction* this_, TlsPassword* password, Cancellable* cancellable, GLib2.Error** error) nothrow;
29402 void g_tls_interaction_ask_password_async(TlsInteraction* this_, TlsPassword* password, Cancellable* cancellable=null, AsyncReadyCallback callback=null, void* user_data=null) nothrow;
29403 TlsInteractionResult g_tls_interaction_ask_password_finish(TlsInteraction* this_, AsyncResult* result, GLib2.Error** error) nothrow;
29404 TlsInteractionResult g_tls_interaction_invoke_ask_password(TlsInteraction* this_, TlsPassword* password, Cancellable* cancellable, GLib2.Error** error) nothrow;
29405 TlsPassword* /*new*/ g_tls_password_new(TlsPasswordFlags flags, char* description) nothrow;
29406 char* g_tls_password_get_description(TlsPassword* this_) nothrow;
29407 TlsPasswordFlags g_tls_password_get_flags(TlsPassword* this_) nothrow;
29408 ubyte* g_tls_password_get_value(TlsPassword* this_, size_t* length=null) nothrow;
29409 char* g_tls_password_get_warning(TlsPassword* this_) nothrow;
29410 void g_tls_password_set_description(TlsPassword* this_, char* description) nothrow;
29411 void g_tls_password_set_flags(TlsPassword* this_, TlsPasswordFlags flags) nothrow;
29412 void g_tls_password_set_value(TlsPassword* this_, ubyte* value, ssize_t length) nothrow;
29413 void g_tls_password_set_value_full(TlsPassword* this_, ubyte* value, ssize_t length, GLib2.DestroyNotify destroy=null) nothrow;
29414 void g_tls_password_set_warning(TlsPassword* this_, char* warning) nothrow;
29415 TlsServerConnection* /*new*/ g_tls_server_connection_new(IOStream* base_io_stream, TlsCertificate* certificate, GLib2.Error** error) nothrow;
29416 Credentials* /*new*/ g_unix_connection_receive_credentials(UnixConnection* this_, Cancellable* cancellable, GLib2.Error** error) nothrow;
29417 void g_unix_connection_receive_credentials_async(UnixConnection* this_, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
29418 Credentials* /*new*/ g_unix_connection_receive_credentials_finish(UnixConnection* this_, AsyncResult* result, GLib2.Error** error) nothrow;
29419 int g_unix_connection_receive_fd(UnixConnection* this_, Cancellable* cancellable, GLib2.Error** error) nothrow;
29420 int g_unix_connection_send_credentials(UnixConnection* this_, Cancellable* cancellable, GLib2.Error** error) nothrow;
29421 void g_unix_connection_send_credentials_async(UnixConnection* this_, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
29422 int g_unix_connection_send_credentials_finish(UnixConnection* this_, AsyncResult* result, GLib2.Error** error) nothrow;
29423 int g_unix_connection_send_fd(UnixConnection* this_, int fd, Cancellable* cancellable, GLib2.Error** error) nothrow;
29424 UnixCredentialsMessage* /*new*/ g_unix_credentials_message_new() nothrow;
29425 UnixCredentialsMessage* /*new*/ g_unix_credentials_message_new_with_credentials(Credentials* credentials) nothrow;
29426 int g_unix_credentials_message_is_supported() nothrow;
29427 Credentials* g_unix_credentials_message_get_credentials(UnixCredentialsMessage* this_) nothrow;
29428 UnixFDList* /*new*/ g_unix_fd_list_new() nothrow;
29429 UnixFDList* /*new*/ g_unix_fd_list_new_from_array(int* fds, int n_fds) nothrow;
29430 int g_unix_fd_list_append(UnixFDList* this_, int fd, GLib2.Error** error) nothrow;
29431 int g_unix_fd_list_get(UnixFDList* this_, int index_, GLib2.Error** error) nothrow;
29432 int g_unix_fd_list_get_length(UnixFDList* this_) nothrow;
29433 int* g_unix_fd_list_peek_fds(UnixFDList* this_, /*out*/ int* length=null) nothrow;
29434 int* /*new*/ g_unix_fd_list_steal_fds(UnixFDList* this_, /*out*/ int* length=null) nothrow;
29435 UnixFDMessage* /*new*/ g_unix_fd_message_new() nothrow;
29436 UnixFDMessage* /*new*/ g_unix_fd_message_new_with_fd_list(UnixFDList* fd_list) nothrow;
29437 int g_unix_fd_message_append_fd(UnixFDMessage* this_, int fd, GLib2.Error** error) nothrow;
29438 UnixFDList* g_unix_fd_message_get_fd_list(UnixFDMessage* this_) nothrow;
29439 int* /*new*/ g_unix_fd_message_steal_fds(UnixFDMessage* this_, /*out*/ int* length=null) nothrow;
29440 UnixInputStream* /*new*/ g_unix_input_stream_new(int fd, int close_fd) nothrow;
29441 int g_unix_input_stream_get_close_fd(UnixInputStream* this_) nothrow;
29442 int g_unix_input_stream_get_fd(UnixInputStream* this_) nothrow;
29443 void g_unix_input_stream_set_close_fd(UnixInputStream* this_, int close_fd) nothrow;
29444 UnixMountMonitor* /*new*/ g_unix_mount_monitor_new() nothrow;
29445 void g_unix_mount_monitor_set_rate_limit(UnixMountMonitor* this_, int limit_msec) nothrow;
29446 int g_unix_mount_point_compare(UnixMountPoint* this_, UnixMountPoint* mount2) nothrow;
29447 void g_unix_mount_point_free(UnixMountPoint* this_) nothrow;
29448 char* g_unix_mount_point_get_device_path(UnixMountPoint* this_) nothrow;
29449 char* g_unix_mount_point_get_fs_type(UnixMountPoint* this_) nothrow;
29450 char* g_unix_mount_point_get_mount_path(UnixMountPoint* this_) nothrow;
29451 char* g_unix_mount_point_get_options(UnixMountPoint* this_) nothrow;
29452 int g_unix_mount_point_guess_can_eject(UnixMountPoint* this_) nothrow;
29453 Icon* /*new*/ g_unix_mount_point_guess_icon(UnixMountPoint* this_) nothrow;
29454 char* /*new*/ g_unix_mount_point_guess_name(UnixMountPoint* this_) nothrow;
29455 int g_unix_mount_point_is_loopback(UnixMountPoint* this_) nothrow;
29456 int g_unix_mount_point_is_readonly(UnixMountPoint* this_) nothrow;
29457 int g_unix_mount_point_is_user_mountable(UnixMountPoint* this_) nothrow;
29458 UnixOutputStream* /*new*/ g_unix_output_stream_new(int fd, int close_fd) nothrow;
29459 int g_unix_output_stream_get_close_fd(UnixOutputStream* this_) nothrow;
29460 int g_unix_output_stream_get_fd(UnixOutputStream* this_) nothrow;
29461 void g_unix_output_stream_set_close_fd(UnixOutputStream* this_, int close_fd) nothrow;
29462 UnixSocketAddress* /*new*/ g_unix_socket_address_new(char* path) nothrow;
29463 UnixSocketAddress* /*new*/ g_unix_socket_address_new_abstract(char* path, int path_len) nothrow;
29464 UnixSocketAddress* /*new*/ g_unix_socket_address_new_with_type(char* path, int path_len, UnixSocketAddressType type) nothrow;
29465 int g_unix_socket_address_abstract_names_supported() nothrow;
29466 UnixSocketAddressType g_unix_socket_address_get_address_type(UnixSocketAddress* this_) nothrow;
29467 int g_unix_socket_address_get_is_abstract(UnixSocketAddress* this_) nothrow;
29468 char* g_unix_socket_address_get_path(UnixSocketAddress* this_) nothrow;
29469 size_t g_unix_socket_address_get_path_len(UnixSocketAddress* this_) nothrow;
29470 Vfs* g_vfs_get_default() nothrow;
29471 Vfs* g_vfs_get_local() nothrow;
29472 File* /*new*/ g_vfs_get_file_for_path(Vfs* this_, char* path) nothrow;
29473 File* /*new*/ g_vfs_get_file_for_uri(Vfs* this_, char* uri) nothrow;
29474 char** g_vfs_get_supported_uri_schemes(Vfs* this_) nothrow;
29475 int g_vfs_is_active(Vfs* this_) nothrow;
29476 File* /*new*/ g_vfs_parse_name(Vfs* this_, char* parse_name) nothrow;
29477 int g_volume_can_eject(Volume* this_) nothrow;
29478 int g_volume_can_mount(Volume* this_) nothrow;
29479 void g_volume_eject(Volume* this_, MountUnmountFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
29480 int g_volume_eject_finish(Volume* this_, AsyncResult* result, GLib2.Error** error) nothrow;
29481 void g_volume_eject_with_operation(Volume* this_, MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
29482 int g_volume_eject_with_operation_finish(Volume* this_, AsyncResult* result, GLib2.Error** error) nothrow;
29483 char** /*new*/ g_volume_enumerate_identifiers(Volume* this_) nothrow;
29484 File* /*new*/ g_volume_get_activation_root(Volume* this_) nothrow;
29485 Drive* /*new*/ g_volume_get_drive(Volume* this_) nothrow;
29486 Icon* /*new*/ g_volume_get_icon(Volume* this_) nothrow;
29487 char* /*new*/ g_volume_get_identifier(Volume* this_, char* kind) nothrow;
29488 Mount* /*new*/ g_volume_get_mount(Volume* this_) nothrow;
29489 char* /*new*/ g_volume_get_name(Volume* this_) nothrow;
29490 char* g_volume_get_sort_key(Volume* this_) nothrow;
29491 char* /*new*/ g_volume_get_uuid(Volume* this_) nothrow;
29492 void g_volume_mount(Volume* this_, MountMountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
29493 int g_volume_mount_finish(Volume* this_, AsyncResult* result, GLib2.Error** error) nothrow;
29494 int g_volume_should_automount(Volume* this_) nothrow;
29495 Volume* /*new*/ g_volume_monitor_adopt_orphan_mount(Mount* mount) nothrow;
29496 VolumeMonitor* /*new*/ g_volume_monitor_get() nothrow;
29497 GLib2.List* /*new*/ g_volume_monitor_get_connected_drives(VolumeMonitor* this_) nothrow;
29498 Mount* /*new*/ g_volume_monitor_get_mount_for_uuid(VolumeMonitor* this_, char* uuid) nothrow;
29499 GLib2.List* /*new*/ g_volume_monitor_get_mounts(VolumeMonitor* this_) nothrow;
29500 Volume* /*new*/ g_volume_monitor_get_volume_for_uuid(VolumeMonitor* this_, char* uuid) nothrow;
29501 GLib2.List* /*new*/ g_volume_monitor_get_volumes(VolumeMonitor* this_) nothrow;
29502 ZlibCompressor* /*new*/ g_zlib_compressor_new(ZlibCompressorFormat format, int level) nothrow;
29503 FileInfo* g_zlib_compressor_get_file_info(ZlibCompressor* this_) nothrow;
29504 void g_zlib_compressor_set_file_info(ZlibCompressor* this_, FileInfo* file_info=null) nothrow;
29505 ZlibDecompressor* /*new*/ g_zlib_decompressor_new(ZlibCompressorFormat format) nothrow;
29506 FileInfo* g_zlib_decompressor_get_file_info(ZlibDecompressor* this_) nothrow;
29507 void g_bus_get(BusType bus_type, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
29508 DBusConnection* /*new*/ g_bus_get_finish(AsyncResult* res, GLib2.Error** error) nothrow;
29509 DBusConnection* /*new*/ g_bus_get_sync(BusType bus_type, Cancellable* cancellable, GLib2.Error** error) nothrow;
29510 uint g_bus_own_name(BusType bus_type, char* name, BusNameOwnerFlags flags, BusAcquiredCallback bus_acquired_handler, BusNameAcquiredCallback name_acquired_handler, BusNameLostCallback name_lost_handler, void* user_data, GLib2.DestroyNotify user_data_free_func) nothrow;
29511 uint g_bus_own_name_on_connection(DBusConnection* connection, char* name, BusNameOwnerFlags flags, BusNameAcquiredCallback name_acquired_handler, BusNameLostCallback name_lost_handler, void* user_data, GLib2.DestroyNotify user_data_free_func) nothrow;
29512 uint g_bus_own_name_on_connection_with_closures(DBusConnection* connection, char* name, BusNameOwnerFlags flags, GObject2.Closure* name_acquired_closure=null, GObject2.Closure* name_lost_closure=null) nothrow;
29513 uint g_bus_own_name_with_closures(BusType bus_type, char* name, BusNameOwnerFlags flags, GObject2.Closure* bus_acquired_closure=null, GObject2.Closure* name_acquired_closure=null, GObject2.Closure* name_lost_closure=null) nothrow;
29514 void g_bus_unown_name(uint owner_id) nothrow;
29515 void g_bus_unwatch_name(uint watcher_id) nothrow;
29516 uint g_bus_watch_name(BusType bus_type, char* name, BusNameWatcherFlags flags, BusNameAppearedCallback name_appeared_handler, BusNameVanishedCallback name_vanished_handler, void* user_data, GLib2.DestroyNotify user_data_free_func) nothrow;
29517 uint g_bus_watch_name_on_connection(DBusConnection* connection, char* name, BusNameWatcherFlags flags, BusNameAppearedCallback name_appeared_handler, BusNameVanishedCallback name_vanished_handler, void* user_data, GLib2.DestroyNotify user_data_free_func) nothrow;
29518 uint g_bus_watch_name_on_connection_with_closures(DBusConnection* connection, char* name, BusNameWatcherFlags flags, GObject2.Closure* name_appeared_closure=null, GObject2.Closure* name_vanished_closure=null) nothrow;
29519 uint g_bus_watch_name_with_closures(BusType bus_type, char* name, BusNameWatcherFlags flags, GObject2.Closure* name_appeared_closure=null, GObject2.Closure* name_vanished_closure=null) nothrow;
29520 int g_content_type_can_be_executable(char* type) nothrow;
29521 int g_content_type_equals(char* type1, char* type2) nothrow;
29522 char* /*new*/ g_content_type_from_mime_type(char* mime_type) nothrow;
29523 char* /*new*/ g_content_type_get_description(char* type) nothrow;
29524 Icon* /*new*/ g_content_type_get_icon(char* type) nothrow;
29525 char* /*new*/ g_content_type_get_mime_type(char* type) nothrow;
29526 char* /*new*/ g_content_type_guess(char* filename, ubyte* data, size_t data_size, /*out*/ int* result_uncertain=null) nothrow;
29527 char** /*new*/ g_content_type_guess_for_tree(File* root) nothrow;
29528 int g_content_type_is_a(char* type, char* supertype) nothrow;
29529 int g_content_type_is_unknown(char* type) nothrow;
29530 GLib2.List* /*new*/ g_content_types_get_registered() nothrow;
29531 char* /*new*/ g_dbus_address_get_for_bus_sync(BusType bus_type, Cancellable* cancellable, GLib2.Error** error) nothrow;
29532 void g_dbus_address_get_stream(char* address, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) nothrow;
29533 IOStream* /*new*/ g_dbus_address_get_stream_finish(AsyncResult* res, char** out_guid, GLib2.Error** error) nothrow;
29534 IOStream* /*new*/ g_dbus_address_get_stream_sync(char* address, char** out_guid, Cancellable* cancellable, GLib2.Error** error) nothrow;
29535 char* /*new*/ g_dbus_error_encode_gerror(GLib2.Error* error) nothrow;
29536 char* /*new*/ g_dbus_error_get_remote_error(GLib2.Error* error) nothrow;
29537 int g_dbus_error_is_remote_error(GLib2.Error* error) nothrow;
29538 GLib2.Error* /*new*/ g_dbus_error_new_for_dbus_error(char* dbus_error_name, char* dbus_error_message) nothrow;
29539 GLib2.Quark g_dbus_error_quark() nothrow;
29540 int g_dbus_error_register_error(GLib2.Quark error_domain, int error_code, char* dbus_error_name) nothrow;
29541 void g_dbus_error_register_error_domain(char* error_domain_quark_name, size_t* quark_volatile, DBusErrorEntry* entries, uint num_entries) nothrow;
29542 int g_dbus_error_strip_remote_error(GLib2.Error* error) nothrow;
29543 int g_dbus_error_unregister_error(GLib2.Quark error_domain, int error_code, char* dbus_error_name) nothrow;
29544 char* /*new*/ g_dbus_generate_guid() nothrow;
29545 GLib2.Variant* /*new*/ g_dbus_gvalue_to_gvariant(GObject2.Value* gvalue, GLib2.VariantType* type) nothrow;
29546 void g_dbus_gvariant_to_gvalue(GLib2.Variant* value, GObject2.Value* out_gvalue) nothrow;
29547 int g_dbus_is_address(char* string_) nothrow;
29548 int g_dbus_is_guid(char* string_) nothrow;
29549 int g_dbus_is_interface_name(char* string_) nothrow;
29550 int g_dbus_is_member_name(char* string_) nothrow;
29551 int g_dbus_is_name(char* string_) nothrow;
29552 int g_dbus_is_supported_address(char* string_, GLib2.Error** error) nothrow;
29553 int g_dbus_is_unique_name(char* string_) nothrow;
29554 IOErrorEnum g_io_error_from_errno(int err_no) nothrow;
29555 GLib2.Quark g_io_error_quark() nothrow;
29556 GLib2.List* /*new*/ g_io_modules_load_all_in_directory(char* dirname) nothrow;
29557 GLib2.List* /*new*/ g_io_modules_load_all_in_directory_with_scope(char* dirname, IOModuleScope* scope_) nothrow;
29558 void g_io_modules_scan_all_in_directory(char* dirname) nothrow;
29559 void g_io_modules_scan_all_in_directory_with_scope(char* dirname, IOModuleScope* scope_) nothrow;
29560 void g_io_scheduler_cancel_all_jobs() nothrow;
29561 void g_io_scheduler_push_job(IOSchedulerJobFunc job_func, void* user_data, GLib2.DestroyNotify notify, int io_priority, Cancellable* cancellable=null) nothrow;
29562 GLib2.Source* /*new*/ g_pollable_source_new(GObject2.Object* pollable_stream) nothrow;
29563 GLib2.Quark g_resolver_error_quark() nothrow;
29564 GLib2.Quark g_resource_error_quark() nothrow;
29565 char** /*new*/ g_resources_enumerate_children(char* path, ResourceLookupFlags lookup_flags, GLib2.Error** error) nothrow;
29566 int g_resources_get_info(char* path, ResourceLookupFlags lookup_flags, /*out*/ size_t* size, /*out*/ uint* flags, GLib2.Error** error) nothrow;
29567 GLib2.Bytes* /*new*/ g_resources_lookup_data(char* path, ResourceLookupFlags lookup_flags, GLib2.Error** error) nothrow;
29568 InputStream* /*new*/ g_resources_open_stream(char* path, ResourceLookupFlags lookup_flags, GLib2.Error** error) nothrow;
29569 void g_simple_async_report_error_in_idle(GObject2.Object* object, AsyncReadyCallback callback, void* user_data, GLib2.Quark domain, int code, char* format, ...) nothrow;
29570 void g_simple_async_report_gerror_in_idle(GObject2.Object* object, AsyncReadyCallback callback, void* user_data, GLib2.Error* error) nothrow;
29571 void g_simple_async_report_take_gerror_in_idle(GObject2.Object* object, AsyncReadyCallback callback, void* user_data, GLib2.Error* error) nothrow;
29572 GLib2.Quark g_tls_error_quark() nothrow;
29573 int g_unix_is_mount_path_system_internal(char* mount_path) nothrow;
29574 UnixMountEntry* /*new*/ g_unix_mount_at(char* mount_path, /*out*/ ulong* time_read=null) nothrow;
29575 int g_unix_mount_compare(UnixMountEntry* mount1, UnixMountEntry* mount2) nothrow;
29576 void g_unix_mount_free(UnixMountEntry* mount_entry) nothrow;
29577 char* g_unix_mount_get_device_path(UnixMountEntry* mount_entry) nothrow;
29578 char* g_unix_mount_get_fs_type(UnixMountEntry* mount_entry) nothrow;
29579 char* g_unix_mount_get_mount_path(UnixMountEntry* mount_entry) nothrow;
29580 int g_unix_mount_guess_can_eject(UnixMountEntry* mount_entry) nothrow;
29581 Icon* /*new*/ g_unix_mount_guess_icon(UnixMountEntry* mount_entry) nothrow;
29582 char* /*new*/ g_unix_mount_guess_name(UnixMountEntry* mount_entry) nothrow;
29583 int g_unix_mount_guess_should_display(UnixMountEntry* mount_entry) nothrow;
29584 int g_unix_mount_is_readonly(UnixMountEntry* mount_entry) nothrow;
29585 int g_unix_mount_is_system_internal(UnixMountEntry* mount_entry) nothrow;
29586 int g_unix_mount_points_changed_since(ulong time) nothrow;
29587 GLib2.List* /*new*/ g_unix_mount_points_get(/*out*/ ulong* time_read=null) nothrow;
29588 int g_unix_mounts_changed_since(ulong time) nothrow;
29589 GLib2.List* /*new*/ g_unix_mounts_get(/*out*/ ulong* time_read=null) nothrow;