Regenerate, with newer Clutter and GLib versions.
[girtod.git] / gtk2 / gio2.d
blob9223e85c53d319d798da63a80cc0edeab5f3a44f
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/gtk3/glib-2.31.16/include/gio-unix-2.0/gio/gdesktopappinfo.h";
14 // C header: "/sw/x86/gtk3/glib-2.31.16/include/gio-unix-2.0/gio/gfiledescriptorbased.h";
15 // C header: "/sw/x86/gtk3/glib-2.31.16/include/gio-unix-2.0/gio/gunixconnection.h";
16 // C header: "/sw/x86/gtk3/glib-2.31.16/include/gio-unix-2.0/gio/gunixcredentialsmessage.h";
17 // C header: "/sw/x86/gtk3/glib-2.31.16/include/gio-unix-2.0/gio/gunixfdlist.h";
18 // C header: "/sw/x86/gtk3/glib-2.31.16/include/gio-unix-2.0/gio/gunixfdmessage.h";
19 // C header: "/sw/x86/gtk3/glib-2.31.16/include/gio-unix-2.0/gio/gunixinputstream.h";
20 // C header: "/sw/x86/gtk3/glib-2.31.16/include/gio-unix-2.0/gio/gunixmounts.h";
21 // C header: "/sw/x86/gtk3/glib-2.31.16/include/gio-unix-2.0/gio/gunixoutputstream.h";
22 // C header: "/sw/x86/gtk3/glib-2.31.16/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()(GLib2.Variant* parameter=null) {
70 g_action_activate(cast(Action*)&this, 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()(GLib2.Variant* value) {
86 g_action_change_state(cast(Action*)&this, 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()() {
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()() {
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()() {
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()() {
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()() {
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()() {
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) activate;
193 char* parameter_type, state;
194 extern (C) void function (SimpleAction* action, GLib2.Variant* value, void* user_data) 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()(char* action_name) {
252 g_action_group_action_added(cast(ActionGroup*)&this, 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()(char* action_name, int enabled) {
262 g_action_group_action_enabled_changed(cast(ActionGroup*)&this, 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()(char* action_name) {
271 g_action_group_action_removed(cast(ActionGroup*)&this, 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()(char* action_name, GLib2.Variant* state) {
281 g_action_group_action_state_changed(cast(ActionGroup*)&this, action_name, 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()(char* action_name, GLib2.Variant* parameter=null) {
294 g_action_group_activate_action(cast(ActionGroup*)&this, action_name, 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()(char* action_name, GLib2.Variant* value) {
312 g_action_group_change_action_state(cast(ActionGroup*)&this, action_name, 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()(char* action_name) {
323 return g_action_group_get_action_enabled(cast(ActionGroup*)&this, 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()(char* action_name) {
343 return g_action_group_get_action_parameter_type(cast(ActionGroup*)&this, 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()(char* action_name) {
358 return g_action_group_get_action_state(cast(ActionGroup*)&this, 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()(char* action_name) {
383 return g_action_group_get_action_state_hint(cast(ActionGroup*)&this, 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()(char* action_name) {
406 return g_action_group_get_action_state_type(cast(ActionGroup*)&this, 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()(char* action_name) {
414 return g_action_group_has_action(cast(ActionGroup*)&this, 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()() {
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_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()(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) {
465 return g_action_group_query_action(cast(ActionGroup*)&this, action_name, enabled, parameter_type, state_type, state_hint, 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) 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)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
480 return signal_connect_data!()(&this, cast(char*)"action-added",
481 cast(GObject2.Callback)cb, data, null, cf);
484 // VERSION: 2.28
485 // Signals that the enabled status of the named action has changed.
486 // <action_name>: the name of the action in @action_group
487 // <enabled>: whether the action is enabled or not
488 extern (C) alias static void function (ActionGroup* this_, char* action_name, c_int enabled, void* user_data=null) signal_action_enabled_changed;
489 ulong signal_connect(string name:"action-enabled-changed", CB:signal_action_enabled_changed)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
490 return signal_connect_data!()(&this, cast(char*)"action-enabled-changed",
491 cast(GObject2.Callback)cb, data, null, cf);
494 // VERSION: 2.28
495 // Signals that an action is just about to be removed from the group.
496 // This signal is emitted before the action is removed, so the action
497 // is still visible and can be queried from the signal handler.
498 // <action_name>: the name of the action in @action_group
499 extern (C) alias static void function (ActionGroup* this_, char* action_name, void* user_data=null) signal_action_removed;
500 ulong signal_connect(string name:"action-removed", CB:signal_action_removed)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
501 return signal_connect_data!()(&this, cast(char*)"action-removed",
502 cast(GObject2.Callback)cb, data, null, cf);
505 // VERSION: 2.28
506 // Signals that the state of the named action has changed.
507 // <action_name>: the name of the action in @action_group
508 // <value>: the new value of the state
509 extern (C) alias static void function (ActionGroup* this_, char* action_name, GLib2.Variant* value, void* user_data=null) signal_action_state_changed;
510 ulong signal_connect(string name:"action-state-changed", CB:signal_action_state_changed)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
511 return signal_connect_data!()(&this, cast(char*)"action-state-changed",
512 cast(GObject2.Callback)cb, data, null, cf);
515 mixin __interface__;
518 // The virtual function table for #GActionGroup.
519 struct ActionGroupInterface /* Version 2.28 */ {
520 GObject2.TypeInterface g_iface;
522 // RETURNS: whether the named action exists
523 // <action_name>: the name of the action to check for
524 extern (C) int function (ActionGroup* action_group, char* action_name) has_action;
525 // RETURNS: a %NULL-terminated array of the names of the
526 extern (C) char** /*new*/ function (ActionGroup* action_group) list_actions;
528 // RETURNS: whether or not the action is currently enabled
529 // <action_name>: the name of the action to query
530 extern (C) int function (ActionGroup* action_group, char* action_name) get_action_enabled;
532 // RETURNS: the parameter type
533 // <action_name>: the name of the action to query
534 extern (C) GLib2.VariantType* function (ActionGroup* action_group, char* action_name) get_action_parameter_type;
536 // RETURNS: the state type, if the action is stateful
537 // <action_name>: the name of the action to query
538 extern (C) GLib2.VariantType* /*new*/ function (ActionGroup* action_group, char* action_name) get_action_state_type;
540 // RETURNS: the state range hint
541 // <action_name>: the name of the action to query
542 extern (C) GLib2.Variant* /*new*/ function (ActionGroup* action_group, char* action_name) get_action_state_hint;
544 // RETURNS: the current state of the action
545 // <action_name>: the name of the action to query
546 extern (C) GLib2.Variant* /*new*/ function (ActionGroup* action_group, char* action_name) get_action_state;
548 // <action_name>: the name of the action to request the change on
549 // <value>: the new state
550 extern (C) void function (ActionGroup* action_group, char* action_name, GLib2.Variant* value) change_action_state;
552 // <action_name>: the name of the action to activate
553 // <parameter>: parameters to the activation
554 extern (C) void function (ActionGroup* action_group, char* action_name, GLib2.Variant* parameter=null) activate_action;
555 // <action_name>: the name of an action in the group
556 extern (C) void function (ActionGroup* action_group, char* action_name) action_added;
557 // <action_name>: the name of an action in the group
558 extern (C) void function (ActionGroup* action_group, char* action_name) action_removed;
560 // <action_name>: the name of an action in the group
561 // <enabled>: whether or not the action is now enabled
562 extern (C) void function (ActionGroup* action_group, char* action_name, int enabled) action_enabled_changed;
564 // <action_name>: the name of an action in the group
565 // <state>: the new state of the named action
566 extern (C) void function (ActionGroup* action_group, char* action_name, GLib2.Variant* state) action_state_changed;
568 // RETURNS: %TRUE if the action exists, else %FALSE
569 // <action_name>: the name of an action in the group
570 // <enabled>: if the action is presently enabled
571 // <parameter_type>: the parameter type, or %NULL if none needed
572 // <state_type>: the state type, or %NULL if stateless
573 // <state_hint>: the state hint, or %NULL if none
574 // <state>: the current state, or %NULL if stateless
575 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) query_action;
578 // The virtual function table for #GAction.
579 struct ActionInterface /* Version 2.28 */ {
580 GObject2.TypeInterface g_iface;
581 // RETURNS: the name of the action
582 extern (C) char* function (Action* action) get_name;
583 // RETURNS: the parameter type
584 extern (C) GLib2.VariantType* function (Action* action) get_parameter_type;
585 // RETURNS: the state type, if the action is stateful
586 extern (C) GLib2.VariantType* function (Action* action) get_state_type;
587 // RETURNS: the state range hint
588 extern (C) GLib2.Variant* /*new*/ function (Action* action) get_state_hint;
589 // RETURNS: whether the action is enabled
590 extern (C) int function (Action* action) get_enabled;
591 // RETURNS: the current state of the action
592 extern (C) GLib2.Variant* /*new*/ function (Action* action) get_state;
593 // <value>: the new state
594 extern (C) void function (Action* action, GLib2.Variant* value) change_state;
595 // <parameter>: the parameter to the activation
596 extern (C) void function (Action* action, GLib2.Variant* parameter=null) activate;
600 // The GActionMap interface is implemented by #GActionGroup
601 // implementations that operate by containing a number of
602 // named #GAction instances, such as #GSimpleActionGroup.
604 // One useful application of this interface is to map the
605 // names of actions from various action groups to unique,
606 // prefixed names (e.g. by prepending "app." or "win.").
607 // This is the motivation for the 'Map' part of the interface
608 // name.
609 struct ActionMap /* Interface */ {
610 mixin template __interface__() {
611 // VERSION: 2.32
612 // Adds an action to the @action_map.
614 // If the action map already contains an action with the same name
615 // as @action then the old action is dropped from the action map.
617 // The action map takes its own reference on @action.
618 // <action>: a #GAction
619 void add_action()(Action* action) {
620 g_action_map_add_action(cast(ActionMap*)&this, action);
623 // VERSION: 2.32
624 // A convenience function for creating multiple #GSimpleAction instances
625 // and adding them to a #GActionMap.
627 // Each action is constructed as per one #GActionEntry.
629 // <example>
630 // <title>Using g_action_map_add_action_entries()</title>
631 // <programlisting>
632 // static void
633 // activate_quit (GSimpleAction *simple,
634 // GVariant *parameter,
635 // gpointer user_data)
636 // {
637 // exit (0);
638 // }
640 // static void
641 // activate_print_string (GSimpleAction *simple,
642 // GVariant *parameter,
643 // gpointer user_data)
644 // {
645 // g_print ("%s\n", g_variant_get_string (parameter, NULL));
646 // }
648 // static GActionGroup *
649 // create_action_group (void)
650 // {
651 // const GActionEntry entries[] = {
652 // { "quit", activate_quit },
653 // { "print-string", activate_print_string, "s" }
654 // };
655 // GSimpleActionGroup *group;
657 // group = g_simple_action_group_new ();
658 // g_action_map_add_action_entries (G_ACTION_MAP (group), entries, G_N_ELEMENTS (entries), NULL);
660 // return G_ACTION_GROUP (group);
661 // }
662 // </programlisting>
663 // </example>
664 // <entries>: a pointer to the first item in an array of #GActionEntry structs
665 // <n_entries>: the length of @entries, or -1 if @entries is %NULL-terminated
666 // <user_data>: the user data for signal connections
667 void add_action_entries()(ActionEntry* entries, int n_entries, void* user_data) {
668 g_action_map_add_action_entries(cast(ActionMap*)&this, entries, n_entries, user_data);
671 // VERSION: 2.32
672 // Looks up the action with the name @action_name in @action_map.
674 // If no such action exists, returns %NULL.
675 // RETURNS: a #GAction, or %NULL
676 // <action_name>: the name of an action
677 Action* lookup_action()(char* action_name) {
678 return g_action_map_lookup_action(cast(ActionMap*)&this, action_name);
681 // VERSION: 2.32
682 // Removes the named action from the action map.
684 // If no action of this name is in the map then nothing happens.
685 // <action_name>: the name of the action
686 void remove_action()(char* action_name) {
687 g_action_map_remove_action(cast(ActionMap*)&this, action_name);
690 mixin __interface__;
693 // The virtual function table for #GActionMap.
694 struct ActionMapInterface /* Version 2.32 */ {
695 GObject2.TypeInterface g_iface;
697 // RETURNS: a #GAction, or %NULL
698 // <action_name>: the name of an action
699 extern (C) Action* function (ActionMap* action_map, char* action_name) lookup_action;
700 // <action>: a #GAction
701 extern (C) void function (ActionMap* action_map, Action* action) add_action;
702 // <action_name>: the name of the action
703 extern (C) void function (ActionMap* action_map, char* action_name) remove_action;
707 // #GAppInfo and #GAppLaunchContext are used for describing and launching
708 // applications installed on the system.
710 // As of GLib 2.20, URIs will always be converted to POSIX paths
711 // (using g_file_get_path()) when using g_app_info_launch() even if
712 // the application requested an URI and not a POSIX path. For example
713 // for an desktop-file based application with Exec key <literal>totem
714 // &percnt;U</literal> and a single URI,
715 // <literal>sftp://foo/file.avi</literal>, then
716 // <literal>/home/user/.gvfs/sftp on foo/file.avi</literal> will be
717 // passed. This will only work if a set of suitable GIO extensions
718 // (such as gvfs 2.26 compiled with FUSE support), is available and
719 // operational; if this is not the case, the URI will be passed
720 // unmodified to the application. Some URIs, such as
721 // <literal>mailto:</literal>, of course cannot be mapped to a POSIX
722 // path (in gvfs there's no FUSE mount for it); such URIs will be
723 // passed unmodified to the application.
725 // Specifically for gvfs 2.26 and later, the POSIX URI will be mapped
726 // back to the GIO URI in the #GFile constructors (since gvfs
727 // implements the #GVfs extension point). As such, if the application
728 // needs to examine the URI, it needs to use g_file_get_uri() or
729 // similar on #GFile. In other words, an application cannot assume
730 // that the URI passed to e.g. g_file_new_for_commandline_arg() is
731 // equal to the result of g_file_get_uri(). The following snippet
732 // illustrates this:
734 // <programlisting>
735 // GFile *f;
736 // char *uri;
738 // file = g_file_new_for_commandline_arg (uri_from_commandline);
740 // uri = g_file_get_uri (file);
741 // strcmp (uri, uri_from_commandline) == 0; // FALSE
742 // g_free (uri);
744 // if (g_file_has_uri_scheme (file, "cdda"))
745 // {
746 // // do something special with uri
747 // }
748 // g_object_unref (file);
749 // </programlisting>
751 // This code will work when both <literal>cdda://sr0/Track
752 // 1.wav</literal> and <literal>/home/user/.gvfs/cdda on sr0/Track
753 // 1.wav</literal> is passed to the application. It should be noted
754 // that it's generally not safe for applications to rely on the format
755 // of a particular URIs. Different launcher applications (e.g. file
756 // managers) may have different ideas of what a given URI means.
757 struct AppInfo /* Interface */ {
758 mixin template __interface__() {
759 // Creates a new #GAppInfo from the given information.
760 // RETURNS: new #GAppInfo for given command.
761 // <commandline>: the commandline to use
762 // <application_name>: the application name, or %NULL to use @commandline
763 // <flags>: flags that can specify details of the created #GAppInfo
764 static AppInfo* /*new*/ create_from_commandline()(char* commandline, char* application_name, AppInfoCreateFlags flags, GLib2.Error** error=null) {
765 return g_app_info_create_from_commandline(commandline, application_name, flags, error);
768 // Gets a list of all of the applications currently registered
769 // on this system.
771 // For desktop files, this includes applications that have
772 // <literal>NoDisplay=true</literal> set or are excluded from
773 // display by means of <literal>OnlyShowIn</literal> or
774 // <literal>NotShowIn</literal>. See g_app_info_should_show().
775 // The returned list does not include applications which have
776 // the <literal>Hidden</literal> key set.
777 // RETURNS: a newly allocated #GList of references to #GAppInfo<!---->s.
778 static GLib2.List* /*new*/ get_all()() {
779 return g_app_info_get_all();
782 // Gets a list of all #GAppInfos for a given content type,
783 // including the recommended and fallback #GAppInfos. See
784 // g_app_info_get_recommended_for_type() and
785 // g_app_info_get_fallback_for_type().
787 // for given @content_type or %NULL on error.
788 // RETURNS: #GList of #GAppInfos
789 // <content_type>: the content type to find a #GAppInfo for
790 static GLib2.List* /*new*/ get_all_for_type()(char* content_type) {
791 return g_app_info_get_all_for_type(content_type);
794 // Gets the default #GAppInfo for a given content type.
796 // %NULL on error.
797 // RETURNS: #GAppInfo for given @content_type or
798 // <content_type>: the content type to find a #GAppInfo for
799 // <must_support_uris>: if %TRUE, the #GAppInfo is expected to support URIs
800 static AppInfo* /*new*/ get_default_for_type()(char* content_type, int must_support_uris) {
801 return g_app_info_get_default_for_type(content_type, must_support_uris);
804 // Gets the default application for handling URIs with
805 // the given URI scheme. A URI scheme is the initial part
806 // of the URI, up to but not including the ':', e.g. "http",
807 // "ftp" or "sip".
808 // RETURNS: #GAppInfo for given @uri_scheme or %NULL on error.
809 // <uri_scheme>: a string containing a URI scheme.
810 static AppInfo* /*new*/ get_default_for_uri_scheme()(char* uri_scheme) {
811 return g_app_info_get_default_for_uri_scheme(uri_scheme);
814 // VERSION: 2.28
815 // Gets a list of fallback #GAppInfos for a given content type, i.e.
816 // those applications which claim to support the given content type
817 // by MIME type subclassing and not directly.
819 // for given @content_type or %NULL on error.
820 // RETURNS: #GList of #GAppInfos
821 // <content_type>: the content type to find a #GAppInfo for
822 static GLib2.List* /*new*/ get_fallback_for_type()(char* content_type) {
823 return g_app_info_get_fallback_for_type(content_type);
826 // VERSION: 2.28
827 // Gets a list of recommended #GAppInfos for a given content type, i.e.
828 // those applications which claim to support the given content type exactly,
829 // and not by MIME type subclassing.
830 // Note that the first application of the list is the last used one, i.e.
831 // the last one for which g_app_info_set_as_last_used_for_type() has been
832 // called.
834 // for given @content_type or %NULL on error.
835 // RETURNS: #GList of #GAppInfos
836 // <content_type>: the content type to find a #GAppInfo for
837 static GLib2.List* /*new*/ get_recommended_for_type()(char* content_type) {
838 return g_app_info_get_recommended_for_type(content_type);
841 // Utility function that launches the default application
842 // registered to handle the specified uri. Synchronous I/O
843 // is done on the uri to detect the type of the file if
844 // required.
845 // RETURNS: %TRUE on success, %FALSE on error.
846 // <uri>: the uri to show
847 // <launch_context>: an optional #GAppLaunchContext.
848 static int launch_default_for_uri()(char* uri, AppLaunchContext* launch_context, GLib2.Error** error=null) {
849 return g_app_info_launch_default_for_uri(uri, launch_context, error);
852 // VERSION: 2.20
853 // Removes all changes to the type associations done by
854 // g_app_info_set_as_default_for_type(),
855 // g_app_info_set_as_default_for_extension(),
856 // g_app_info_add_supports_type() or
857 // g_app_info_remove_supports_type().
858 // <content_type>: a content type
859 static void reset_type_associations()(char* content_type) {
860 g_app_info_reset_type_associations(content_type);
863 // Adds a content type to the application information to indicate the
864 // application is capable of opening files with the given content type.
865 // RETURNS: %TRUE on success, %FALSE on error.
866 // <content_type>: a string.
867 int add_supports_type()(char* content_type, GLib2.Error** error=null) {
868 return g_app_info_add_supports_type(cast(AppInfo*)&this, content_type, error);
871 // VERSION: 2.20
872 // Obtains the information whether the #GAppInfo can be deleted.
873 // See g_app_info_delete().
874 // RETURNS: %TRUE if @appinfo can be deleted
875 int can_delete()() {
876 return g_app_info_can_delete(cast(AppInfo*)&this);
879 // Checks if a supported content type can be removed from an application.
881 // content types from a given @appinfo, %FALSE if not.
882 // RETURNS: %TRUE if it is possible to remove supported
883 int can_remove_supports_type()() {
884 return g_app_info_can_remove_supports_type(cast(AppInfo*)&this);
887 // VERSION: 2.20
888 // Tries to delete a #GAppInfo.
890 // On some platforms, there may be a difference between user-defined
891 // #GAppInfo<!-- -->s which can be deleted, and system-wide ones which
892 // cannot. See g_app_info_can_delete().
893 // RETURNS: %TRUE if @appinfo has been deleted
894 int delete_()() {
895 return g_app_info_delete(cast(AppInfo*)&this);
898 // Creates a duplicate of a #GAppInfo.
899 // RETURNS: a duplicate of @appinfo.
900 AppInfo* /*new*/ dup()() {
901 return g_app_info_dup(cast(AppInfo*)&this);
904 // Checks if two #GAppInfo<!-- -->s are equal.
905 // RETURNS: %TRUE if @appinfo1 is equal to @appinfo2. %FALSE otherwise.
906 // <appinfo2>: the second #GAppInfo.
907 int equal()(AppInfo* appinfo2) {
908 return g_app_info_equal(cast(AppInfo*)&this, appinfo2);
911 // VERSION: 2.20
912 // Gets the commandline with which the application will be
913 // started.
915 // or %NULL if this information is not available
916 // RETURNS: a string containing the @appinfo's commandline,
917 char* get_commandline()() {
918 return g_app_info_get_commandline(cast(AppInfo*)&this);
921 // Gets a human-readable description of an installed application.
923 // application @appinfo, or %NULL if none.
924 // RETURNS: a string containing a description of the
925 char* get_description()() {
926 return g_app_info_get_description(cast(AppInfo*)&this);
929 // VERSION: 2.24
930 // Gets the display name of the application. The display name is often more
931 // descriptive to the user than the name itself.
933 // no display name is available.
934 // RETURNS: the display name of the application for @appinfo, or the name if
935 char* get_display_name()() {
936 return g_app_info_get_display_name(cast(AppInfo*)&this);
939 // Gets the executable's name for the installed application.
941 // binaries name
942 // RETURNS: a string containing the @appinfo's application
943 char* get_executable()() {
944 return g_app_info_get_executable(cast(AppInfo*)&this);
947 // Gets the icon for the application.
949 // if there is no default icon.
950 // RETURNS: the default #GIcon for @appinfo or %NULL
951 Icon* get_icon()() {
952 return g_app_info_get_icon(cast(AppInfo*)&this);
955 // Gets the ID of an application. An id is a string that
956 // identifies the application. The exact format of the id is
957 // platform dependent. For instance, on Unix this is the
958 // desktop file id from the xdg menu specification.
960 // Note that the returned ID may be %NULL, depending on how
961 // the @appinfo has been constructed.
962 // RETURNS: a string containing the application's ID.
963 char* get_id()() {
964 return g_app_info_get_id(cast(AppInfo*)&this);
967 // Gets the installed name of the application.
968 // RETURNS: the name of the application for @appinfo.
969 char* get_name()() {
970 return g_app_info_get_name(cast(AppInfo*)&this);
973 // Launches the application. Passes @files to the launched application
974 // as arguments, using the optional @launch_context to get information
975 // about the details of the launcher (like what screen it is on).
976 // On error, @error will be set accordingly.
978 // To launch the application without arguments pass a %NULL @files list.
980 // Note that even if the launch is successful the application launched
981 // can fail to start if it runs into problems during startup. There is
982 // no way to detect this.
984 // Some URIs can be changed when passed through a GFile (for instance
985 // unsupported URIs with strange formats like mailto:), so if you have
986 // a textual URI you want to pass in as argument, consider using
987 // g_app_info_launch_uris() instead.
989 // The launched application inherits the environment of the launching
990 // process, but it can be modified with g_app_launch_context_setenv() and
991 // g_app_launch_context_unsetenv().
993 // On UNIX, this function sets the <envar>GIO_LAUNCHED_DESKTOP_FILE</envar>
994 // environment variable with the path of the launched desktop file and
995 // <envar>GIO_LAUNCHED_DESKTOP_FILE_PID</envar> to the process
996 // id of the launched process. This can be used to ignore
997 // <envar>GIO_LAUNCHED_DESKTOP_FILE</envar>, should it be inherited
998 // by further processes. The <envar>DISPLAY</envar> and
999 // <envar>DESKTOP_STARTUP_ID</envar> environment variables are also
1000 // set, based on information provided in @launch_context.
1001 // RETURNS: %TRUE on successful launch, %FALSE otherwise.
1002 // <files>: a #GList of #GFile objects
1003 // <launch_context>: a #GAppLaunchContext or %NULL
1004 int launch()(GLib2.List* files, AppLaunchContext* launch_context, GLib2.Error** error=null) {
1005 return g_app_info_launch(cast(AppInfo*)&this, files, launch_context, error);
1008 // Launches the application. This passes the @uris to the launched application
1009 // as arguments, using the optional @launch_context to get information
1010 // about the details of the launcher (like what screen it is on).
1011 // On error, @error will be set accordingly.
1013 // To launch the application without arguments pass a %NULL @uris list.
1015 // Note that even if the launch is successful the application launched
1016 // can fail to start if it runs into problems during startup. There is
1017 // no way to detect this.
1018 // RETURNS: %TRUE on successful launch, %FALSE otherwise.
1019 // <uris>: a #GList containing URIs to launch.
1020 // <launch_context>: a #GAppLaunchContext or %NULL
1021 int launch_uris()(GLib2.List* uris, AppLaunchContext* launch_context, GLib2.Error** error=null) {
1022 return g_app_info_launch_uris(cast(AppInfo*)&this, uris, launch_context, error);
1025 // Removes a supported type from an application, if possible.
1026 // RETURNS: %TRUE on success, %FALSE on error.
1027 // <content_type>: a string.
1028 int remove_supports_type()(char* content_type, GLib2.Error** error=null) {
1029 return g_app_info_remove_supports_type(cast(AppInfo*)&this, content_type, error);
1032 // Sets the application as the default handler for the given file extension.
1033 // RETURNS: %TRUE on success, %FALSE on error.
1034 // <extension>: a string containing the file extension (without the dot).
1035 int set_as_default_for_extension()(char* extension, GLib2.Error** error=null) {
1036 return g_app_info_set_as_default_for_extension(cast(AppInfo*)&this, extension, error);
1039 // Sets the application as the default handler for a given type.
1040 // RETURNS: %TRUE on success, %FALSE on error.
1041 // <content_type>: the content type.
1042 int set_as_default_for_type()(char* content_type, GLib2.Error** error=null) {
1043 return g_app_info_set_as_default_for_type(cast(AppInfo*)&this, content_type, error);
1046 // Sets the application as the last used application for a given type.
1047 // This will make the application appear as first in the list returned
1048 // by g_app_info_get_recommended_for_type(), regardless of the default
1049 // application for that content type.
1050 // RETURNS: %TRUE on success, %FALSE on error.
1051 // <content_type>: the content type.
1052 int set_as_last_used_for_type()(char* content_type, GLib2.Error** error=null) {
1053 return g_app_info_set_as_last_used_for_type(cast(AppInfo*)&this, content_type, error);
1056 // Checks if the application info should be shown in menus that
1057 // list available applications.
1058 // RETURNS: %TRUE if the @appinfo should be shown, %FALSE otherwise.
1059 int should_show()() {
1060 return g_app_info_should_show(cast(AppInfo*)&this);
1063 // Checks if the application accepts files as arguments.
1064 // RETURNS: %TRUE if the @appinfo supports files.
1065 int supports_files()() {
1066 return g_app_info_supports_files(cast(AppInfo*)&this);
1069 // Checks if the application supports reading files and directories from URIs.
1070 // RETURNS: %TRUE if the @appinfo supports URIs.
1071 int supports_uris()() {
1072 return g_app_info_supports_uris(cast(AppInfo*)&this);
1075 mixin __interface__;
1078 // Flags used when creating a #GAppInfo.
1079 enum AppInfoCreateFlags {
1080 NONE = 0,
1081 NEEDS_TERMINAL = 1,
1082 SUPPORTS_URIS = 2,
1083 SUPPORTS_STARTUP_NOTIFICATION = 4
1085 // Application Information interface, for operating system portability.
1086 struct AppInfoIface {
1087 GObject2.TypeInterface g_iface;
1088 // RETURNS: a duplicate of @appinfo.
1089 extern (C) AppInfo* /*new*/ function (AppInfo* appinfo) dup;
1091 // RETURNS: %TRUE if @appinfo1 is equal to @appinfo2. %FALSE otherwise.
1092 // <appinfo2>: the second #GAppInfo.
1093 extern (C) int function (AppInfo* appinfo1, AppInfo* appinfo2) equal;
1094 // RETURNS: a string containing the application's ID.
1095 extern (C) char* function (AppInfo* appinfo) get_id;
1096 // RETURNS: the name of the application for @appinfo.
1097 extern (C) char* function (AppInfo* appinfo) get_name;
1098 // RETURNS: a string containing a description of the
1099 extern (C) char* function (AppInfo* appinfo) get_description;
1100 // RETURNS: a string containing the @appinfo's application
1101 extern (C) char* function (AppInfo* appinfo) get_executable;
1102 // RETURNS: the default #GIcon for @appinfo or %NULL
1103 extern (C) Icon* function (AppInfo* appinfo) get_icon;
1105 // RETURNS: %TRUE on successful launch, %FALSE otherwise.
1106 // <files>: a #GList of #GFile objects
1107 // <launch_context>: a #GAppLaunchContext or %NULL
1108 extern (C) int function (AppInfo* appinfo, GLib2.List* files, AppLaunchContext* launch_context, GLib2.Error** error=null) launch;
1109 // RETURNS: %TRUE if the @appinfo supports URIs.
1110 extern (C) int function (AppInfo* appinfo) supports_uris;
1111 // RETURNS: %TRUE if the @appinfo supports files.
1112 extern (C) int function (AppInfo* appinfo) supports_files;
1114 // RETURNS: %TRUE on successful launch, %FALSE otherwise.
1115 // <uris>: a #GList containing URIs to launch.
1116 // <launch_context>: a #GAppLaunchContext or %NULL
1117 extern (C) int function (AppInfo* appinfo, GLib2.List* uris, AppLaunchContext* launch_context, GLib2.Error** error=null) launch_uris;
1118 // RETURNS: %TRUE if the @appinfo should be shown, %FALSE otherwise.
1119 extern (C) int function (AppInfo* appinfo) should_show;
1121 // RETURNS: %TRUE on success, %FALSE on error.
1122 // <content_type>: the content type.
1123 extern (C) int function (AppInfo* appinfo, char* content_type, GLib2.Error** error=null) set_as_default_for_type;
1125 // RETURNS: %TRUE on success, %FALSE on error.
1126 // <extension>: a string containing the file extension (without the dot).
1127 extern (C) int function (AppInfo* appinfo, char* extension, GLib2.Error** error=null) set_as_default_for_extension;
1129 // RETURNS: %TRUE on success, %FALSE on error.
1130 // <content_type>: a string.
1131 extern (C) int function (AppInfo* appinfo, char* content_type, GLib2.Error** error=null) add_supports_type;
1132 // RETURNS: %TRUE if it is possible to remove supported
1133 extern (C) int function (AppInfo* appinfo) can_remove_supports_type;
1135 // RETURNS: %TRUE on success, %FALSE on error.
1136 // <content_type>: a string.
1137 extern (C) int function (AppInfo* appinfo, char* content_type, GLib2.Error** error=null) remove_supports_type;
1138 // RETURNS: %TRUE if @appinfo can be deleted
1139 extern (C) int function (AppInfo* appinfo) can_delete;
1140 // RETURNS: %TRUE if @appinfo has been deleted
1141 extern (C) int function (AppInfo* appinfo) do_delete;
1142 // RETURNS: a string containing the @appinfo's commandline,
1143 extern (C) char* function (AppInfo* appinfo) get_commandline;
1144 // RETURNS: the display name of the application for @appinfo, or the name if
1145 extern (C) char* function (AppInfo* appinfo) get_display_name;
1147 // RETURNS: %TRUE on success, %FALSE on error.
1148 // <content_type>: the content type.
1149 extern (C) int function (AppInfo* appinfo, char* content_type, GLib2.Error** error=null) set_as_last_used_for_type;
1153 // Integrating the launch with the launching application. This is used to
1154 // handle for instance startup notification and launching the new application
1155 // on the same screen as the launching window.
1156 struct AppLaunchContext /* : GObject.Object */ {
1157 alias parent_instance this;
1158 alias parent_instance super_;
1159 alias parent_instance object;
1160 GObject2.Object parent_instance;
1161 private AppLaunchContextPrivate* priv;
1164 // Creates a new application launch context. This is not normally used,
1165 // instead you instantiate a subclass of this, such as #GdkAppLaunchContext.
1166 // RETURNS: a #GAppLaunchContext.
1167 static AppLaunchContext* /*new*/ new_()() {
1168 return g_app_launch_context_new();
1171 // Gets the display string for the @context. This is used to ensure new
1172 // applications are started on the same display as the launching
1173 // application, by setting the <envar>DISPLAY</envar> environment variable.
1174 // RETURNS: a display string for the display.
1175 // <info>: a #GAppInfo
1176 // <files>: a #GList of #GFile objects
1177 char* /*new*/ get_display()(AppInfo* info, GLib2.List* files) {
1178 return g_app_launch_context_get_display(&this, info, files);
1181 // VERSION: 2.32
1182 // Gets the complete environment variable list to be passed to
1183 // the child process when @context is used to launch an application.
1184 // This is a %NULL-terminated array of strings, where each string has
1185 // the form <literal>KEY=VALUE</literal>.
1187 // child's environment
1188 // RETURNS: the
1189 char** /*new*/ get_environment()() {
1190 return g_app_launch_context_get_environment(&this);
1193 // Initiates startup notification for the application and returns the
1194 // <envar>DESKTOP_STARTUP_ID</envar> for the launched operation,
1195 // if supported.
1197 // Startup notification IDs are defined in the <ulink
1198 // url="http://standards.freedesktop.org/startup-notification-spec/startup-notification-latest.txt">
1199 // FreeDesktop.Org Startup Notifications standard</ulink>.
1201 // not supported.
1202 // RETURNS: a startup notification ID for the application, or %NULL if
1203 // <info>: a #GAppInfo
1204 // <files>: a #GList of of #GFile objects
1205 char* /*new*/ get_startup_notify_id()(AppInfo* info, GLib2.List* files) {
1206 return g_app_launch_context_get_startup_notify_id(&this, info, files);
1209 // Called when an application has failed to launch, so that it can cancel
1210 // the application startup notification started in g_app_launch_context_get_startup_notify_id().
1211 // <startup_notify_id>: the startup notification id that was returned by g_app_launch_context_get_startup_notify_id().
1212 void launch_failed()(char* startup_notify_id) {
1213 g_app_launch_context_launch_failed(&this, startup_notify_id);
1216 // VERSION: 2.32
1217 // Arranges for @variable to be set to @value in the child's
1218 // environment when @context is used to launch an application.
1219 // <variable>: the environment variable to set
1220 // <value>: the value for to set the variable to.
1221 void setenv()(char* variable, char* value) {
1222 g_app_launch_context_setenv(&this, variable, value);
1225 // VERSION: 2.32
1226 // Arranges for @variable to be unset in the child's environment
1227 // when @context is used to launch an application.
1228 // <variable>: the environment variable to remove
1229 void unsetenv()(char* variable) {
1230 g_app_launch_context_unsetenv(&this, variable);
1234 struct AppLaunchContextClass {
1235 GObject2.ObjectClass parent_class;
1237 // RETURNS: a display string for the display.
1238 // <info>: a #GAppInfo
1239 // <files>: a #GList of #GFile objects
1240 extern (C) char* /*new*/ function (AppLaunchContext* context, AppInfo* info, GLib2.List* files) get_display;
1242 // RETURNS: a startup notification ID for the application, or %NULL if
1243 // <info>: a #GAppInfo
1244 // <files>: a #GList of of #GFile objects
1245 extern (C) char* /*new*/ function (AppLaunchContext* context, AppInfo* info, GLib2.List* files) get_startup_notify_id;
1246 // <startup_notify_id>: the startup notification id that was returned by g_app_launch_context_get_startup_notify_id().
1247 extern (C) void function (AppLaunchContext* context, char* startup_notify_id) launch_failed;
1248 extern (C) void function () _g_reserved1;
1249 extern (C) void function () _g_reserved2;
1250 extern (C) void function () _g_reserved3;
1251 extern (C) void function () _g_reserved4;
1252 extern (C) void function () _g_reserved5;
1255 struct AppLaunchContextPrivate {
1259 // A #GApplication is the foundation of an application, unique for a
1260 // given application identifier. The GApplication class wraps some
1261 // low-level platform-specific services and is intended to act as the
1262 // foundation for higher-level application classes such as
1263 // #GtkApplication or #MxApplication. In general, you should not use
1264 // this class outside of a higher level framework.
1266 // One of the core features that GApplication provides is process
1267 // uniqueness, in the context of a "session". The session concept is
1268 // platform-dependent, but corresponds roughly to a graphical desktop
1269 // login. When your application is launched again, its arguments
1270 // are passed through platform communication to the already running
1271 // program. The already running instance of the program is called the
1272 // <firstterm>primary instance</firstterm>. On Linux, the D-Bus session
1273 // bus is used for communication.
1275 // GApplication provides convenient life cycle management by maintaining
1276 // a <firstterm>use count</firstterm> for the primary application instance.
1277 // The use count can be changed using g_application_hold() and
1278 // g_application_release(). If it drops to zero, the application exits.
1279 // Higher-level classes such as #GtkApplication employ the use count to
1280 // ensure that the application stays alive as long as it has any opened
1281 // windows.
1283 // Before using GApplication, you must choose an "application identifier".
1284 // The expected form of an application identifier is very close to that of
1285 // of a <ulink url="http://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-names-interface">DBus bus name</ulink>.
1286 // Examples include: "com.example.MyApp", "org.example.internal-apps.Calculator".
1287 // For details on valid application identifiers, see g_application_id_is_valid().
1289 // On Linux, the application identifier is claimed as a well-known bus name
1290 // on the user's session bus. This means that the uniqueness of your
1291 // application is scoped to the current session. It also means that your
1292 // application may provide additional services (through registration of other
1293 // object paths) at that bus name. The registration of these object paths
1294 // should be done with the shared GDBus session bus. Note that due to the
1295 // internal architecture of GDBus, method calls can be dispatched at any time
1296 // (even if a main loop is not running). For this reason, you must ensure that
1297 // any object paths that you wish to register are registered before #GApplication
1298 // attempts to acquire the bus name of your application (which happens in
1299 // g_application_register()). Unfortunately, this means that you cannot use
1300 // g_application_get_is_remote() to decide if you want to register object paths.
1302 // GApplication also implements the #GActionGroup and #GActionMap
1303 // interfaces and lets you easily export actions by adding them with
1304 // g_action_map_add_action(). When invoking an action by calling
1305 // g_action_group_activate_action() on the application, it is always
1306 // invoked in the primary instance. The actions are also exported on
1307 // the session bus, and GIO provides the #GDBusActionGroup wrapper to
1308 // conveniently access them remotely. Additionally, g_application_set_app_menu()
1309 // and g_application_set_menubar() can be used to export representation
1310 // data for the actions, in the form of #GMenuModels. GIO provides
1311 // a #GDBusMenuModel wrapper for remote access to exported #GMenuModels.
1313 // There is a number of different entry points into a GApplication:
1314 // <itemizedlist>
1315 // <listitem>via 'Activate' (i.e. just starting the application)</listitem>
1316 // <listitem>via 'Open' (i.e. opening some files)</listitem>
1317 // <listitem>by handling a command-line</listitem>
1318 // <listitem>via activating an action</listitem>
1319 // </itemizedlist>
1320 // The #GApplication::startup signal lets you handle the application
1321 // initialization for all of these in a single place.
1323 // Regardless of which of these entry points is used to start the application,
1324 // GApplication passes some <firstterm id="platform-data">platform
1325 // data</firstterm> from the launching instance to the primary instance,
1326 // in the form of a #GVariant dictionary mapping strings to variants.
1327 // To use platform data, override the @before_emit or @after_emit virtual
1328 // functions in your #GApplication subclass. When dealing with
1329 // #GApplicationCommandline objects, the platform data is directly
1330 // available via g_application_command_line_get_cwd(),
1331 // g_application_command_line_get_environ() and
1332 // g_application_command_line_get_platform_data().
1334 // As the name indicates, the platform data may vary depending on the
1335 // operating system, but it always includes the current directory (key
1336 // "cwd"), and optionally the environment (ie the set of environment
1337 // variables and their values) of the calling process (key "environ").
1338 // The environment is only added to the platform data if the
1339 // #G_APPLICATION_SEND_ENVIONMENT flag is set. GApplication subclasses
1340 // can add their own platform data by overriding the @add_platform_data
1341 // virtual function. For instance, #GtkApplication adds startup notification
1342 // data in this way.
1344 // To parse commandline arguments you may handle the
1345 // #GApplication::command-line signal or override the local_command_line()
1346 // vfunc, to parse them in either the primary instance or the local instance,
1347 // respectively.
1349 // <example id="gapplication-example-open"><title>Opening files with a GApplication</title>
1350 // <programlisting>
1351 // <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-open.c">
1352 // <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
1353 // </xi:include>
1354 // </programlisting>
1355 // </example>
1357 // <example id="gapplication-example-actions"><title>A GApplication with actions</title>
1358 // <programlisting>
1359 // <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-actions.c">
1360 // <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
1361 // </xi:include>
1362 // </programlisting>
1363 // </example>
1365 // <example id="gapplication-example-menu"><title>A GApplication with menus</title>
1366 // <programlisting>
1367 // <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-menu.c">
1368 // <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
1369 // </xi:include>
1370 // </programlisting>
1371 // </example>
1372 struct Application /* : GObject.Object */ /* Version 2.28 */ {
1373 mixin ActionGroup.__interface__;
1374 mixin ActionMap.__interface__;
1375 alias parent_instance this;
1376 alias parent_instance super_;
1377 alias parent_instance object;
1378 GObject2.Object parent_instance;
1379 private ApplicationPrivate* priv;
1382 // Creates a new #GApplication instance.
1384 // This function calls g_type_init() for you.
1386 // The application id must be valid. See g_application_id_is_valid().
1387 // RETURNS: a new #GApplication instance
1388 // <application_id>: the application id
1389 // <flags>: the application flags
1390 static Application* /*new*/ new_()(char* application_id, ApplicationFlags flags) {
1391 return g_application_new(application_id, flags);
1394 // VERSION: 2.32
1395 // Returns the default #GApplication instance for this process.
1397 // Normally there is only one #GApplication per process and it becomes
1398 // the default when it is created. You can exercise more control over
1399 // this by using g_application_set_default().
1401 // If there is no default application then %NULL is returned.
1402 // RETURNS: the default application for this process, or %NULL
1403 static Application* get_default()() {
1404 return g_application_get_default();
1407 // Checks if @application_id is a valid application identifier.
1409 // A valid ID is required for calls to g_application_new() and
1410 // g_application_set_application_id().
1412 // For convenience, the restrictions on application identifiers are
1413 // reproduced here:
1414 // <itemizedlist>
1415 // <listitem>Application identifiers must contain only the ASCII characters "[A-Z][a-z][0-9]_-." and must not begin with a digit.</listitem>
1416 // <listitem>Application identifiers must contain at least one '.' (period) character (and thus at least three elements).</listitem>
1417 // <listitem>Application identifiers must not begin or end with a '.' (period) character.</listitem>
1418 // <listitem>Application identifiers must not contain consecutive '.' (period) characters.</listitem>
1419 // <listitem>Application identifiers must not exceed 255 characters.</listitem>
1420 // </itemizedlist>
1421 // RETURNS: %TRUE if @application_id is valid
1422 // <application_id>: a potential application identifier
1423 static int id_is_valid()(char* application_id) {
1424 return g_application_id_is_valid(application_id);
1427 // VERSION: 2.28
1428 // Activates the application.
1430 // In essence, this results in the #GApplication::activate() signal being
1431 // emitted in the primary instance.
1433 // The application must be registered before calling this function.
1434 void activate()() {
1435 g_application_activate(&this);
1438 // VERSION: 2.28
1439 // Gets the unique identifier for @application.
1440 // RETURNS: the identifier for @application, owned by @application
1441 char* get_application_id()() {
1442 return g_application_get_application_id(&this);
1445 // VERSION: 2.28
1446 // Gets the flags for @application.
1448 // See #GApplicationFlags.
1449 // RETURNS: the flags for @application
1450 ApplicationFlags get_flags()() {
1451 return g_application_get_flags(&this);
1454 // VERSION: 2.28
1455 // Gets the current inactivity timeout for the application.
1457 // This is the amount of time (in milliseconds) after the last call to
1458 // g_application_release() before the application stops running.
1459 // RETURNS: the timeout, in milliseconds
1460 uint get_inactivity_timeout()() {
1461 return g_application_get_inactivity_timeout(&this);
1464 // VERSION: 2.28
1465 // Checks if @application is registered.
1467 // An application is registered if g_application_register() has been
1468 // successfully called.
1469 // RETURNS: %TRUE if @application is registered
1470 int get_is_registered()() {
1471 return g_application_get_is_registered(&this);
1474 // VERSION: 2.28
1475 // Checks if @application is remote.
1477 // If @application is remote then it means that another instance of
1478 // application already exists (the 'primary' instance). Calls to
1479 // perform actions on @application will result in the actions being
1480 // performed by the primary instance.
1482 // The value of this property cannot be accessed before
1483 // g_application_register() has been called. See
1484 // g_application_get_is_registered().
1485 // RETURNS: %TRUE if @application is remote
1486 int get_is_remote()() {
1487 return g_application_get_is_remote(&this);
1490 // Increases the use count of @application.
1492 // Use this function to indicate that the application has a reason to
1493 // continue to run. For example, g_application_hold() is called by GTK+
1494 // when a toplevel window is on the screen.
1496 // To cancel the hold, call g_application_release().
1497 void hold()() {
1498 g_application_hold(&this);
1501 // VERSION: 2.28
1502 // Opens the given files.
1504 // In essence, this results in the #GApplication::open signal being emitted
1505 // in the primary instance.
1507 // @n_files must be greater than zero.
1509 // @hint is simply passed through to the ::open signal. It is
1510 // intended to be used by applications that have multiple modes for
1511 // opening files (eg: "view" vs "edit", etc). Unless you have a need
1512 // for this functionality, you should use "".
1514 // The application must be registered before calling this function
1515 // and it must have the %G_APPLICATION_HANDLES_OPEN flag set.
1516 // <files>: an array of #GFiles to open
1517 // <n_files>: the length of the @files array
1518 // <hint>: a hint (or ""), but never %NULL
1519 void open()(File** files, int n_files, char* hint) {
1520 g_application_open(&this, files, n_files, hint);
1523 // VERSION: 2.28
1524 // Attempts registration of the application.
1526 // This is the point at which the application discovers if it is the
1527 // primary instance or merely acting as a remote for an already-existing
1528 // primary instance. This is implemented by attempting to acquire the
1529 // application identifier as a unique bus name on the session bus using
1530 // GDBus.
1532 // Due to the internal architecture of GDBus, method calls can be
1533 // dispatched at any time (even if a main loop is not running). For
1534 // this reason, you must ensure that any object paths that you wish to
1535 // register are registered before calling this function.
1537 // If the application has already been registered then %TRUE is
1538 // returned with no work performed.
1540 // The #GApplication::startup signal is emitted if registration succeeds
1541 // and @application is the primary instance.
1543 // In the event of an error (such as @cancellable being cancelled, or a
1544 // failure to connect to the session bus), %FALSE is returned and @error
1545 // is set appropriately.
1547 // Note: the return value of this function is not an indicator that this
1548 // instance is or is not the primary instance of the application. See
1549 // g_application_get_is_remote() for that.
1550 // RETURNS: %TRUE if registration succeeded
1551 // <cancellable>: a #GCancellable, or %NULL
1552 int register()(Cancellable* cancellable, GLib2.Error** error=null) {
1553 return g_application_register(&this, cancellable, error);
1556 // Decrease the use count of @application.
1558 // When the use count reaches zero, the application will stop running.
1560 // Never call this function except to cancel the effect of a previous
1561 // call to g_application_hold().
1562 void release()() {
1563 g_application_release(&this);
1566 // VERSION: 2.28
1567 // Runs the application.
1569 // This function is intended to be run from main() and its return value
1570 // is intended to be returned by main(). Although you are expected to pass
1571 // the @argc, @argv parameters from main() to this function, it is possible
1572 // to pass %NULL if @argv is not available or commandline handling is not
1573 // required.
1575 // First, the local_command_line() virtual function is invoked.
1576 // This function always runs on the local instance. It gets passed a pointer
1577 // to a %NULL-terminated copy of @argv and is expected to remove the arguments
1578 // that it handled (shifting up remaining arguments). See
1579 // <xref linkend="gapplication-example-cmdline2"/> for an example of
1580 // parsing @argv manually. Alternatively, you may use the #GOptionContext API,
1581 // after setting <literal>argc = g_strv_length (argv);</literal>.
1583 // The last argument to local_command_line() is a pointer to the @status
1584 // variable which can used to set the exit status that is returned from
1585 // g_application_run().
1587 // If local_command_line() returns %TRUE, the command line is expected
1588 // to be completely handled, including possibly registering as the primary
1589 // instance, calling g_application_activate() or g_application_open(), etc.
1591 // If local_command_line() returns %FALSE then the application is registered
1592 // and the #GApplication::command-line signal is emitted in the primary
1593 // instance (which may or may not be this instance). The signal handler
1594 // gets passed a #GApplicationCommandline object that (among other things)
1595 // contains the remaining commandline arguments that have not been handled
1596 // by local_command_line().
1598 // If the application has the %G_APPLICATION_HANDLES_COMMAND_LINE
1599 // flag set then the default implementation of local_command_line()
1600 // always returns %FALSE immediately, resulting in the commandline
1601 // always being handled in the primary instance.
1603 // Otherwise, the default implementation of local_command_line() tries
1604 // to do a couple of things that are probably reasonable for most
1605 // applications. First, g_application_register() is called to attempt
1606 // to register the application. If that works, then the command line
1607 // arguments are inspected. If no commandline arguments are given, then
1608 // g_application_activate() is called. If commandline arguments are
1609 // given and the %G_APPLICATION_HANDLES_OPEN flag is set then they
1610 // are assumed to be filenames and g_application_open() is called.
1612 // If you need to handle commandline arguments that are not filenames,
1613 // and you don't mind commandline handling to happen in the primary
1614 // instance, you should set %G_APPLICATION_HANDLED_COMMAND_LINE and
1615 // process the commandline arguments in your #GApplication::command-line
1616 // signal handler, either manually or using the #GOptionContext API.
1618 // If you are interested in doing more complicated local handling of the
1619 // commandline then you should implement your own #GApplication subclass
1620 // and override local_command_line(). In this case, you most likely want
1621 // to return %TRUE from your local_command_line() implementation to
1622 // suppress the default handling. See
1623 // <xref linkend="gapplication-example-cmdline2"/> for an example.
1625 // If, after the above is done, the use count of the application is zero
1626 // then the exit status is returned immediately. If the use count is
1627 // non-zero then the default main context is iterated until the use count
1628 // falls to zero, at which point 0 is returned.
1630 // If the %G_APPLICATION_IS_SERVICE flag is set, then the exiting at
1631 // use count of zero is delayed for a while (ie: the instance stays
1632 // around to provide its <emphasis>service</emphasis> to others).
1633 // RETURNS: the exit status
1634 // <argc>: the argc from main() (or 0 if @argv is %NULL)
1635 // <argv>: the argv from main(), or %NULL
1636 int run()(int argc, char** argv=null) {
1637 return g_application_run(&this, argc, argv);
1640 // VERSION: 2.28
1641 // This used to be how actions were associated with a #GApplication.
1642 // Now there is #GActionMap for that.
1645 // Deprecated:2.32:Use the #GActionMap interface instead. Never ever
1646 // mix use of this API with use of #GActionMap on the same @application
1647 // or things will go very badly wrong. This function is known to
1648 // introduce buggy behaviour (ie: signals not emitted on changes to the
1649 // action group), so you should really use #GActionMap instead.
1650 // <action_group>: a #GActionGroup, or %NULL
1651 void set_action_group()(ActionGroup* action_group=null) {
1652 g_application_set_action_group(&this, action_group);
1655 // VERSION: 2.28
1656 // Sets the unique identifier for @application.
1658 // The application id can only be modified if @application has not yet
1659 // been registered.
1661 // The application id must be valid. See g_application_id_is_valid().
1662 // <application_id>: the identifier for @application
1663 void set_application_id()(char* application_id) {
1664 g_application_set_application_id(&this, application_id);
1667 // VERSION: 2.32
1668 // Sets or unsets the default application for the process, as returned
1669 // by g_application_get_default().
1671 // This function does not take its own reference on @application. If
1672 // @application is destroyed then the default application will revert
1673 // back to %NULL.
1674 void set_default()() {
1675 g_application_set_default(&this);
1678 // VERSION: 2.28
1679 // Sets the flags for @application.
1681 // The flags can only be modified if @application has not yet been
1682 // registered.
1684 // See #GApplicationFlags.
1685 // <flags>: the flags for @application
1686 void set_flags()(ApplicationFlags flags) {
1687 g_application_set_flags(&this, flags);
1690 // VERSION: 2.28
1691 // Sets the current inactivity timeout for the application.
1693 // This is the amount of time (in milliseconds) after the last call to
1694 // g_application_release() before the application stops running.
1696 // This call has no side effects of its own. The value set here is only
1697 // used for next time g_application_release() drops the use count to
1698 // zero. Any timeouts currently in progress are not impacted.
1699 // <inactivity_timeout>: the timeout, in milliseconds
1700 void set_inactivity_timeout()(uint inactivity_timeout) {
1701 g_application_set_inactivity_timeout(&this, inactivity_timeout);
1704 // The ::activate signal is emitted on the primary instance when an
1705 // activation occurs. See g_application_activate().
1706 extern (C) alias static void function (Application* this_, void* user_data=null) signal_activate;
1708 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
1709 return super_.signal_connect!name(cb, data, cf);
1712 ulong signal_connect(string name:"activate", CB:signal_activate)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
1713 return signal_connect_data!()(&this, cast(char*)"activate",
1714 cast(GObject2.Callback)cb, data, null, cf);
1717 // The ::command-line signal is emitted on the primary instance when
1718 // a commandline is not handled locally. See g_application_run() and
1719 // the #GApplicationCommandline documentation for more information.
1721 // process. See g_application_command_line_set_exit_status().
1722 // RETURNS: An integer that is set as the exit status for the calling
1723 // <command_line>: a #GApplicationCommandLine representing the passed commandline
1724 extern (C) alias static int function (Application* this_, ApplicationCommandLine* command_line, void* user_data=null) signal_command_line;
1725 ulong signal_connect(string name:"command-line", CB:signal_command_line)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
1726 return signal_connect_data!()(&this, cast(char*)"command-line",
1727 cast(GObject2.Callback)cb, data, null, cf);
1730 // The ::open signal is emitted on the primary instance when there are
1731 // files to open. See g_application_open() for more information.
1732 // <files>: an array of #GFiles
1733 // <n_files>: the length of @files
1734 // <hint>: a hint provided by the calling instance
1735 extern (C) alias static void function (Application* this_, File* files, int n_files, char* hint, void* user_data=null) signal_open;
1736 ulong signal_connect(string name:"open", CB:signal_open)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
1737 return signal_connect_data!()(&this, cast(char*)"open",
1738 cast(GObject2.Callback)cb, data, null, cf);
1741 // The ::shutdown signal is emitted only on the registered primary instance
1742 // immediately after the main loop terminates.
1743 extern (C) alias static void function (Application* this_, void* user_data=null) signal_shutdown;
1744 ulong signal_connect(string name:"shutdown", CB:signal_shutdown)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
1745 return signal_connect_data!()(&this, cast(char*)"shutdown",
1746 cast(GObject2.Callback)cb, data, null, cf);
1749 // The ::startup signal is emitted on the primary instance immediately
1750 // after registration. See g_application_register().
1751 extern (C) alias static void function (Application* this_, void* user_data=null) signal_startup;
1752 ulong signal_connect(string name:"startup", CB:signal_startup)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
1753 return signal_connect_data!()(&this, cast(char*)"startup",
1754 cast(GObject2.Callback)cb, data, null, cf);
1758 // Virtual function table for #GApplication.
1759 struct ApplicationClass /* Version 2.28 */ {
1760 private GObject2.ObjectClass parent_class;
1761 extern (C) void function (Application* application) startup;
1762 extern (C) void function (Application* application) activate;
1764 // <files>: an array of #GFiles to open
1765 // <n_files>: the length of the @files array
1766 // <hint>: a hint (or ""), but never %NULL
1767 extern (C) void function (Application* application, File** files, int n_files, char* hint) open;
1768 extern (C) int function (Application* application, ApplicationCommandLine* command_line) command_line;
1769 extern (C) int function (Application* application, char*** arguments, int* exit_status) local_command_line;
1770 extern (C) void function (Application* application, GLib2.Variant* platform_data) before_emit;
1771 extern (C) void function (Application* application, GLib2.Variant* platform_data) after_emit;
1772 extern (C) void function (Application* application, GLib2.VariantBuilder* builder) add_platform_data;
1773 extern (C) void function (Application* application) quit_mainloop;
1774 extern (C) void function (Application* application) run_mainloop;
1775 extern (C) void function (Application* application) shutdown;
1776 private void*[11] padding;
1780 // #GApplicationCommandLine represents a command-line invocation of
1781 // an application. It is created by #GApplication and emitted
1782 // in the #GApplication::command-line signal and virtual function.
1784 // The class contains the list of arguments that the program was invoked
1785 // with. It is also possible to query if the commandline invocation was
1786 // local (ie: the current process is running in direct response to the
1787 // invocation) or remote (ie: some other process forwarded the
1788 // commandline to this process).
1790 // The GApplicationCommandLine object can provide the @argc and @argv
1791 // parameters for use with the #GOptionContext command-line parsing API,
1792 // with the g_application_command_line_get_arguments() function. See
1793 // <xref linkend="gapplication-example-cmdline3"/> for an example.
1795 // The exit status of the originally-invoked process may be set and
1796 // messages can be printed to stdout or stderr of that process. The
1797 // lifecycle of the originally-invoked process is tied to the lifecycle
1798 // of this object (ie: the process exits when the last reference is
1799 // dropped).
1801 // The main use for #GApplicationCommandline (and the
1802 // #GApplication::command-line signal) is 'Emacs server' like use cases:
1803 // You can set the <envar>EDITOR</envar> environment variable to have
1804 // e.g. git use your favourite editor to edit commit messages, and if you
1805 // already have an instance of the editor running, the editing will happen
1806 // in the running instance, instead of opening a new one. An important
1807 // aspect of this use case is that the process that gets started by git
1808 // does not return until the editing is done.
1810 // <example id="gapplication-example-cmdline"><title>Handling commandline arguments with GApplication</title>
1811 // <para>
1812 // A simple example where the commandline is completely handled
1813 // in the #GApplication::command-line handler. The launching instance exits
1814 // once the signal handler in the primary instance has returned, and the
1815 // return value of the signal handler becomes the exit status of the launching
1816 // instance.
1817 // </para>
1818 // <programlisting>
1819 // <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-cmdline.c">
1820 // <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
1821 // </xi:include>
1822 // </programlisting>
1823 // </example>
1825 // <example id="gapplication-example-cmdline2"><title>Split commandline handling</title>
1826 // <para>
1827 // An example of split commandline handling. Options that start with
1828 // <literal>--local-</literal> are handled locally, all other options are
1829 // passed to the #GApplication::command-line handler which runs in the primary
1830 // instance.
1831 // </para>
1832 // <programlisting>
1833 // <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-cmdline2.c">
1834 // <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
1835 // </xi:include>
1836 // </programlisting>
1837 // </example>
1839 // <example id="gapplication-example-cmdline3"><title>Deferred commandline handling</title>
1840 // <para>
1841 // An example of deferred commandline handling. Here, the commandline is
1842 // not completely handled before the #GApplication::command-line handler
1843 // returns. Instead, we keep a reference to the GApplicationCommandline
1844 // object and handle it later(in this example, in an idle). Note that it
1845 // is necessary to hold the application until you are done with the
1846 // commandline.
1847 // </para>
1848 // <para>
1849 // This example also shows how to use #GOptionContext for parsing the
1850 // commandline arguments. Note that it is necessary to disable the
1851 // built-in help-handling of #GOptionContext, since it calls exit()
1852 // after printing help, which is not what you want to happen in
1853 // the primary instance.
1854 // </para>
1855 // <programlisting>
1856 // <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-cmdline3.c">
1857 // <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
1858 // </xi:include>
1859 // </programlisting>
1860 // </example>
1861 struct ApplicationCommandLine /* : GObject.Object */ {
1862 alias parent_instance this;
1863 alias parent_instance super_;
1864 alias parent_instance object;
1865 GObject2.Object parent_instance;
1866 private ApplicationCommandLinePrivate* priv;
1869 // VERSION: 2.28
1870 // Gets the list of arguments that was passed on the command line.
1872 // The strings in the array may contain non-utf8 data.
1874 // The return value is %NULL-terminated and should be freed using
1875 // g_strfreev().
1877 // containing the arguments (the argv)
1878 // RETURNS: the string array
1879 // <argc>: the length of the arguments array, or %NULL
1880 char** /*new*/ get_arguments()(/*out*/ int* argc) {
1881 return g_application_command_line_get_arguments(&this, argc);
1884 // VERSION: 2.28
1885 // Gets the working directory of the command line invocation.
1886 // The string may contain non-utf8 data.
1888 // It is possible that the remote application did not send a working
1889 // directory, so this may be %NULL.
1891 // The return value should not be modified or freed and is valid for as
1892 // long as @cmdline exists.
1893 // RETURNS: the current directory, or %NULL
1894 char* get_cwd()() {
1895 return g_application_command_line_get_cwd(&this);
1898 // VERSION: 2.28
1899 // Gets the contents of the 'environ' variable of the command line
1900 // invocation, as would be returned by g_get_environ(), ie as a
1901 // %NULL-terminated list of strings in the form 'NAME=VALUE'.
1902 // The strings may contain non-utf8 data.
1904 // The remote application usually does not send an environment. Use
1905 // %G_APPLICATION_SEND_ENVIRONMENT to affect that. Even with this flag
1906 // set it is possible that the environment is still not available (due
1907 // to invocation messages from other applications).
1909 // The return value should not be modified or freed and is valid for as
1910 // long as @cmdline exists.
1912 // See g_application_command_line_getenv() if you are only interested
1913 // in the value of a single environment variable.
1915 // strings, or %NULL if they were not sent
1916 // RETURNS: the environment
1917 char** get_environ()() {
1918 return g_application_command_line_get_environ(&this);
1921 // VERSION: 2.28
1922 // Gets the exit status of @cmdline. See
1923 // g_application_command_line_set_exit_status() for more information.
1924 // RETURNS: the exit status
1925 int get_exit_status()() {
1926 return g_application_command_line_get_exit_status(&this);
1929 // VERSION: 2.28
1930 // Determines if @cmdline represents a remote invocation.
1931 // RETURNS: %TRUE if the invocation was remote
1932 int get_is_remote()() {
1933 return g_application_command_line_get_is_remote(&this);
1936 // VERSION: 2.28
1937 // Gets the platform data associated with the invocation of @cmdline.
1939 // This is a #GVariant dictionary containing information about the
1940 // context in which the invocation occurred. It typically contains
1941 // information like the current working directory and the startup
1942 // notification ID.
1944 // For local invocation, it will be %NULL.
1945 // RETURNS: the platform data, or %NULL
1946 GLib2.Variant* /*new*/ get_platform_data()() {
1947 return g_application_command_line_get_platform_data(&this);
1950 // VERSION: 2.28
1951 // Gets the value of a particular environment variable of the command
1952 // line invocation, as would be returned by g_getenv(). The strings may
1953 // contain non-utf8 data.
1955 // The remote application usually does not send an environment. Use
1956 // %G_APPLICATION_SEND_ENVIRONMENT to affect that. Even with this flag
1957 // set it is possible that the environment is still not available (due
1958 // to invocation messages from other applications).
1960 // The return value should not be modified or freed and is valid for as
1961 // long as @cmdline exists.
1962 // RETURNS: the value of the variable, or %NULL if unset or unsent
1963 // <name>: the environment variable to get
1964 char* getenv()(char* name) {
1965 return g_application_command_line_getenv(&this, name);
1968 // Unintrospectable method: print() / g_application_command_line_print()
1969 // VERSION: 2.28
1970 // Formats a message and prints it using the stdout print handler in the
1971 // invoking process.
1973 // If @cmdline is a local invocation then this is exactly equivalent to
1974 // g_print(). If @cmdline is remote then this is equivalent to calling
1975 // g_print() in the invoking process.
1976 // <format>: a printf-style format string
1977 /+ Not available -- variadic methods unsupported - use the C function directly.
1978 alias g_application_command_line_print print; // Variadic
1981 // Unintrospectable method: printerr() / g_application_command_line_printerr()
1982 // VERSION: 2.28
1983 // Formats a message and prints it using the stderr print handler in the
1984 // invoking process.
1986 // If @cmdline is a local invocation then this is exactly equivalent to
1987 // g_printerr(). If @cmdline is remote then this is equivalent to
1988 // calling g_printerr() in the invoking process.
1989 // <format>: a printf-style format string
1990 /+ Not available -- variadic methods unsupported - use the C function directly.
1991 alias g_application_command_line_printerr printerr; // Variadic
1994 // VERSION: 2.28
1995 // Sets the exit status that will be used when the invoking process
1996 // exits.
1998 // The return value of the #GApplication::command-line signal is
1999 // passed to this function when the handler returns. This is the usual
2000 // way of setting the exit status.
2002 // In the event that you want the remote invocation to continue running
2003 // and want to decide on the exit status in the future, you can use this
2004 // call. For the case of a remote invocation, the remote process will
2005 // typically exit when the last reference is dropped on @cmdline. The
2006 // exit status of the remote process will be equal to the last value
2007 // that was set with this function.
2009 // In the case that the commandline invocation is local, the situation
2010 // is slightly more complicated. If the commandline invocation results
2011 // in the mainloop running (ie: because the use-count of the application
2012 // increased to a non-zero value) then the application is considered to
2013 // have been 'successful' in a certain sense, and the exit status is
2014 // always zero. If the application use count is zero, though, the exit
2015 // status of the local #GApplicationCommandLine is used.
2016 // <exit_status>: the exit status
2017 void set_exit_status()(int exit_status) {
2018 g_application_command_line_set_exit_status(&this, exit_status);
2023 // The <structname>GApplicationCommandLineClass</structname> structure
2024 // contains private data only
2025 struct ApplicationCommandLineClass /* Version 2.28 */ {
2026 private GObject2.ObjectClass parent_class;
2027 extern (C) void function (ApplicationCommandLine* cmdline, char* message) print_literal;
2028 extern (C) void function (ApplicationCommandLine* cmdline, char* message) printerr_literal;
2029 private void*[12] padding;
2032 struct ApplicationCommandLinePrivate {
2035 // Flags used to define the behaviour of a #GApplication.
2036 enum ApplicationFlags /* Version 2.28 */ {
2037 FLAGS_NONE = 0,
2038 IS_SERVICE = 1,
2039 IS_LAUNCHER = 2,
2040 HANDLES_OPEN = 4,
2041 HANDLES_COMMAND_LINE = 8,
2042 SEND_ENVIRONMENT = 16,
2043 NON_UNIQUE = 32
2045 struct ApplicationPrivate {
2049 // #GAskPasswordFlags are used to request specific information from the
2050 // user, or to notify the user of their choices in an authentication
2051 // situation.
2052 enum AskPasswordFlags {
2053 NEED_PASSWORD = 1,
2054 NEED_USERNAME = 2,
2055 NEED_DOMAIN = 4,
2056 SAVING_SUPPORTED = 8,
2057 ANONYMOUS_SUPPORTED = 16
2060 // This is the asynchronous version of #GInitable; it behaves the same
2061 // in all ways except that initialization is asynchronous. For more details
2062 // see the descriptions on #GInitable.
2064 // A class may implement both the #GInitable and #GAsyncInitable interfaces.
2066 // Users of objects implementing this are not intended to use the interface
2067 // method directly; instead it will be used automatically in various ways.
2068 // For C applications you generally just call g_async_initable_new_async()
2069 // directly, or indirectly via a foo_thing_new_async() wrapper. This will call
2070 // g_async_initable_init_async() under the cover, calling back with %NULL and
2071 // a set %GError on failure.
2073 // A typical implementation might look something like this:
2075 // |[
2076 // enum {
2077 // NOT_INITIALIZED,
2078 // INITIALIZING,
2079 // INITIALIZED
2080 // };
2082 // static void
2083 // _foo_ready_cb (Foo *self)
2084 // {
2085 // GList *l;
2087 // self->priv->state = INITIALIZED;
2089 // for (l = self->priv->init_results; l != NULL; l = l->next)
2090 // {
2091 // GSimpleAsyncResult *simple = l->data;
2093 // if (!self->priv->success)
2094 // g_simple_async_result_set_error (simple, ...);
2096 // g_simple_async_result_complete (simple);
2097 // g_object_unref (simple);
2098 // }
2100 // g_list_free (self->priv->init_results);
2101 // self->priv->init_results = NULL;
2102 // }
2104 // static void
2105 // foo_init_async (GAsyncInitable *initable,
2106 // int io_priority,
2107 // GCancellable *cancellable,
2108 // GAsyncReadyCallback callback,
2109 // gpointer user_data)
2110 // {
2111 // Foo *self = FOO (initable);
2112 // GSimpleAsyncResult *simple;
2114 // simple = g_simple_async_result_new (G_OBJECT (initable)
2115 // callback,
2116 // user_data,
2117 // foo_init_async);
2119 // switch (self->priv->state)
2120 // {
2121 // case NOT_INITIALIZED:
2122 // _foo_get_ready (self);
2123 // self->priv->init_results = g_list_append (self->priv->init_results,
2124 // simple);
2125 // self->priv->state = INITIALIZING;
2126 // break;
2127 // case INITIALIZING:
2128 // self->priv->init_results = g_list_append (self->priv->init_results,
2129 // simple);
2130 // break;
2131 // case INITIALIZED:
2132 // if (!self->priv->success)
2133 // g_simple_async_result_set_error (simple, ...);
2135 // g_simple_async_result_complete_in_idle (simple);
2136 // g_object_unref (simple);
2137 // break;
2138 // }
2139 // }
2141 // static gboolean
2142 // foo_init_finish (GAsyncInitable *initable,
2143 // GAsyncResult *result,
2144 // GError **error)
2145 // {
2146 // g_return_val_if_fail (g_simple_async_result_is_valid (result,
2147 // G_OBJECT (initable), foo_init_async), FALSE);
2149 // if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result),
2150 // error))
2151 // return FALSE;
2153 // return TRUE;
2154 // }
2156 // static void
2157 // foo_async_initable_iface_init (gpointer g_iface,
2158 // gpointer data)
2159 // {
2160 // GAsyncInitableIface *iface = g_iface;
2162 // iface->init_async = foo_init_async;
2163 // iface->init_finish = foo_init_finish;
2164 // }
2165 // ]|
2166 struct AsyncInitable /* Interface */ /* Version 2.22 */ {
2167 mixin template __interface__() {
2168 // Unintrospectable function: new_async() / g_async_initable_new_async()
2169 // VERSION: 2.22
2170 // Helper function for constructing #GAsyncInitable object. This is
2171 // similar to g_object_new() but also initializes the object asynchronously.
2173 // When the initialization is finished, @callback will be called. You can
2174 // then call g_async_initable_new_finish() to get the new object and check
2175 // for any errors.
2176 // <object_type>: a #GType supporting #GAsyncInitable.
2177 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the operation.
2178 // <cancellable>: optional #GCancellable object, %NULL to ignore.
2179 // <callback>: a #GAsyncReadyCallback to call when the initialization is finished
2180 // <user_data>: the data to pass to callback function
2181 // <first_property_name>: the name of the first property, or %NULL if no properties
2182 alias g_async_initable_new_async new_async; // Variadic
2184 // Unintrospectable function: new_valist_async() / g_async_initable_new_valist_async()
2185 // VERSION: 2.22
2186 // Helper function for constructing #GAsyncInitable object. This is
2187 // similar to g_object_new_valist() but also initializes the object
2188 // asynchronously.
2190 // When the initialization is finished, @callback will be called. You can
2191 // then call g_async_initable_new_finish() to get the new object and check
2192 // for any errors.
2193 // <object_type>: a #GType supporting #GAsyncInitable.
2194 // <first_property_name>: the name of the first property, followed by the value, and other property value pairs, and ended by %NULL.
2195 // <var_args>: The var args list generated from @first_property_name.
2196 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the operation.
2197 // <cancellable>: optional #GCancellable object, %NULL to ignore.
2198 // <callback>: a #GAsyncReadyCallback to call when the initialization is finished
2199 // <user_data>: the data to pass to callback function
2200 static void new_valist_async()(Type object_type, char* first_property_name, va_list var_args, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
2201 g_async_initable_new_valist_async(object_type, first_property_name, var_args, io_priority, cancellable, callback, user_data);
2204 // VERSION: 2.22
2205 // Helper function for constructing #GAsyncInitable object. This is
2206 // similar to g_object_newv() but also initializes the object asynchronously.
2208 // When the initialization is finished, @callback will be called. You can
2209 // then call g_async_initable_new_finish() to get the new object and check
2210 // for any errors.
2211 // <object_type>: a #GType supporting #GAsyncInitable.
2212 // <n_parameters>: the number of parameters in @parameters
2213 // <parameters>: the parameters to use to construct the object
2214 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the operation.
2215 // <cancellable>: optional #GCancellable object, %NULL to ignore.
2216 // <callback>: a #GAsyncReadyCallback to call when the initialization is finished
2217 // <user_data>: the data to pass to callback function
2218 static void newv_async()(Type object_type, uint n_parameters, GObject2.Parameter* parameters, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
2219 g_async_initable_newv_async(object_type, n_parameters, parameters, io_priority, cancellable, callback, user_data);
2222 // VERSION: 2.22
2223 // Starts asynchronous initialization of the object implementing the
2224 // interface. This must be done before any real use of the object after
2225 // initial construction. If the object also implements #GInitable you can
2226 // optionally call g_initable_init() instead.
2228 // When the initialization is finished, @callback will be called. You can
2229 // then call g_async_initable_init_finish() to get the result of the
2230 // initialization.
2232 // Implementations may also support cancellation. If @cancellable is not
2233 // %NULL, then initialization can be cancelled by triggering the cancellable
2234 // object from another thread. If the operation was cancelled, the error
2235 // %G_IO_ERROR_CANCELLED will be returned. If @cancellable is not %NULL, and
2236 // the object doesn't support cancellable initialization, the error
2237 // %G_IO_ERROR_NOT_SUPPORTED will be returned.
2239 // As with #GInitable, if the object is not initialized, or initialization
2240 // returns with an error, then all operations on the object except
2241 // g_object_ref() and g_object_unref() are considered to be invalid, and
2242 // have undefined behaviour. They will often fail with g_critical() or
2243 // g_warning(), but this must not be relied on.
2245 // Implementations of this method must be idempotent: i.e. multiple calls
2246 // to this function with the same argument should return the same results.
2247 // Only the first call initializes the object; further calls return the result
2248 // of the first call. This is so that it's safe to implement the singleton
2249 // pattern in the GObject constructor function.
2251 // For classes that also support the #GInitable interface, the default
2252 // implementation of this method will run the g_initable_init() function
2253 // in a thread, so if you want to support asynchronous initialization via
2254 // threads, just implement the #GAsyncInitable interface without overriding
2255 // any interface methods.
2256 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the operation.
2257 // <cancellable>: optional #GCancellable object, %NULL to ignore.
2258 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
2259 // <user_data>: the data to pass to callback function
2260 void init_async()(int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
2261 g_async_initable_init_async(cast(AsyncInitable*)&this, io_priority, cancellable, callback, user_data);
2264 // VERSION: 2.22
2265 // Finishes asynchronous initialization and returns the result.
2266 // See g_async_initable_init_async().
2268 // will return %FALSE and set @error appropriately if present.
2269 // RETURNS: %TRUE if successful. If an error has occurred, this function
2270 // <res>: a #GAsyncResult.
2271 int init_finish()(AsyncResult* res, GLib2.Error** error=null) {
2272 return g_async_initable_init_finish(cast(AsyncInitable*)&this, res, error);
2275 // VERSION: 2.22
2276 // Finishes the async construction for the various g_async_initable_new
2277 // calls, returning the created object or %NULL on error.
2279 // Free with g_object_unref().
2280 // RETURNS: a newly created #GObject, or %NULL on error.
2281 // <res>: the #GAsyncResult from the callback
2282 GObject2.Object* /*new*/ new_finish()(AsyncResult* res, GLib2.Error** error=null) {
2283 return g_async_initable_new_finish(cast(AsyncInitable*)&this, res, error);
2286 mixin __interface__;
2290 // Provides an interface for asynchronous initializing object such that
2291 // initialization may fail.
2292 struct AsyncInitableIface /* Version 2.22 */ {
2293 GObject2.TypeInterface g_iface;
2295 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the operation.
2296 // <cancellable>: optional #GCancellable object, %NULL to ignore.
2297 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
2298 // <user_data>: the data to pass to callback function
2299 extern (C) void function (AsyncInitable* initable, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) init_async;
2301 // RETURNS: %TRUE if successful. If an error has occurred, this function
2302 // <res>: a #GAsyncResult.
2303 extern (C) int function (AsyncInitable* initable, AsyncResult* res, GLib2.Error** error=null) init_finish;
2307 // Type definition for a function that will be called back when an asynchronous
2308 // operation within GIO has been completed.
2309 // <source_object>: the object the asynchronous operation was started with.
2310 // <res>: a #GAsyncResult.
2311 // <user_data>: user data passed to the callback.
2312 extern (C) alias void function (GObject2.Object* source_object, AsyncResult* res, void* user_data) AsyncReadyCallback;
2315 // Provides a base class for implementing asynchronous function results.
2317 // Asynchronous operations are broken up into two separate operations
2318 // which are chained together by a #GAsyncReadyCallback. To begin
2319 // an asynchronous operation, provide a #GAsyncReadyCallback to the
2320 // asynchronous function. This callback will be triggered when the
2321 // operation has completed, and will be passed a #GAsyncResult instance
2322 // filled with the details of the operation's success or failure, the
2323 // object the asynchronous function was started for and any error codes
2324 // returned. The asynchronous callback function is then expected to call
2325 // the corresponding "_finish()" function, passing the object the
2326 // function was called for, the #GAsyncResult instance, and (optionally)
2327 // an @error to grab any error conditions that may have occurred.
2329 // The "_finish()" function for an operation takes the generic result
2330 // (of type #GAsyncResult) and returns the specific result that the
2331 // operation in question yields (e.g. a #GFileEnumerator for a
2332 // "enumerate children" operation). If the result or error status of the
2333 // operation is not needed, there is no need to call the "_finish()"
2334 // function; GIO will take care of cleaning up the result and error
2335 // information after the #GAsyncReadyCallback returns. You can pass
2336 // %NULL for the #GAsyncReadyCallback if you don't need to take any
2337 // action at all after the operation completes. Applications may also
2338 // take a reference to the #GAsyncResult and call "_finish()" later;
2339 // however, the "_finish()" function may be called at most once.
2341 // Example of a typical asynchronous operation flow:
2342 // |[
2343 // void _theoretical_frobnitz_async (Theoretical *t,
2344 // GCancellable *c,
2345 // GAsyncReadyCallback *cb,
2346 // gpointer u);
2348 // gboolean _theoretical_frobnitz_finish (Theoretical *t,
2349 // GAsyncResult *res,
2350 // GError **e);
2352 // static void
2353 // frobnitz_result_func (GObject *source_object,
2354 // GAsyncResult *res,
2355 // gpointer user_data)
2356 // {
2357 // gboolean success = FALSE;
2359 // success = _theoretical_frobnitz_finish (source_object, res, NULL);
2361 // if (success)
2362 // g_printf ("Hurray!\n");
2363 // else
2364 // g_printf ("Uh oh!\n");
2366 // /<!-- -->* ... *<!-- -->/
2368 // }
2370 // int main (int argc, void *argv[])
2371 // {
2372 // /<!-- -->* ... *<!-- -->/
2374 // _theoretical_frobnitz_async (theoretical_data,
2375 // NULL,
2376 // frobnitz_result_func,
2377 // NULL);
2379 // /<!-- -->* ... *<!-- -->/
2380 // }
2381 // ]|
2383 // The callback for an asynchronous operation is called only once, and is
2384 // always called, even in the case of a cancelled operation. On cancellation
2385 // the result is a %G_IO_ERROR_CANCELLED error.
2386 struct AsyncResult /* Interface */ {
2387 mixin template __interface__() {
2388 // Gets the source object from a #GAsyncResult.
2390 // or %NULL if there is none.
2391 // RETURNS: a new reference to the source object for the @res,
2392 GObject2.Object* /*new*/ get_source_object()() {
2393 return g_async_result_get_source_object(cast(AsyncResult*)&this);
2396 // Gets the user data from a #GAsyncResult.
2397 // RETURNS: the user data for @res.
2398 void* /*new*/ get_user_data()() {
2399 return g_async_result_get_user_data(cast(AsyncResult*)&this);
2402 mixin __interface__;
2405 // Interface definition for #GAsyncResult.
2406 struct AsyncResultIface {
2407 GObject2.TypeInterface g_iface;
2408 // RETURNS: the user data for @res.
2409 extern (C) void* /*new*/ function (AsyncResult* res) get_user_data;
2410 // RETURNS: a new reference to the source object for the @res,
2411 extern (C) GObject2.Object* /*new*/ function (AsyncResult* res) get_source_object;
2415 // Buffered input stream implements #GFilterInputStream and provides
2416 // for buffered reads.
2418 // By default, #GBufferedInputStream's buffer size is set at 4 kilobytes.
2420 // To create a buffered input stream, use g_buffered_input_stream_new(),
2421 // or g_buffered_input_stream_new_sized() to specify the buffer's size at
2422 // construction.
2424 // To get the size of a buffer within a buffered input stream, use
2425 // g_buffered_input_stream_get_buffer_size(). To change the size of a
2426 // buffered input stream's buffer, use
2427 // g_buffered_input_stream_set_buffer_size(). Note that the buffer's size
2428 // cannot be reduced below the size of the data within the buffer.
2429 struct BufferedInputStream /* : FilterInputStream */ {
2430 alias parent_instance this;
2431 alias parent_instance super_;
2432 alias parent_instance filterinputstream;
2433 FilterInputStream parent_instance;
2434 private BufferedInputStreamPrivate* priv;
2437 // Creates a new #GInputStream from the given @base_stream, with
2438 // a buffer set to the default size (4 kilobytes).
2439 // RETURNS: a #GInputStream for the given @base_stream.
2440 // <base_stream>: a #GInputStream
2441 static BufferedInputStream* /*new*/ new_()(InputStream* base_stream) {
2442 return g_buffered_input_stream_new(base_stream);
2445 // Creates a new #GBufferedInputStream from the given @base_stream,
2446 // with a buffer set to @size.
2447 // RETURNS: a #GInputStream.
2448 // <base_stream>: a #GInputStream
2449 // <size>: a #gsize
2450 static BufferedInputStream* /*new*/ new_sized()(InputStream* base_stream, size_t size) {
2451 return g_buffered_input_stream_new_sized(base_stream, size);
2454 // Tries to read @count bytes from the stream into the buffer.
2455 // Will block during this read.
2457 // If @count is zero, returns zero and does nothing. A value of @count
2458 // larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
2460 // On success, the number of bytes read into the buffer is returned.
2461 // It is not an error if this is not the same as the requested size, as it
2462 // can happen e.g. near the end of a file. Zero is returned on end of file
2463 // (or if @count is zero), but never otherwise.
2465 // If @count is -1 then the attempted read size is equal to the number of
2466 // bytes that are required to fill the buffer.
2468 // If @cancellable is not %NULL, then the operation can be cancelled by
2469 // triggering the cancellable object from another thread. If the operation
2470 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
2471 // operation was partially finished when the operation was cancelled the
2472 // partial result will be returned, without an error.
2474 // On error -1 is returned and @error is set accordingly.
2476 // For the asynchronous, non-blocking, version of this function, see
2477 // g_buffered_input_stream_fill_async().
2479 // or -1 on error.
2480 // RETURNS: the number of bytes read into @stream's buffer, up to @count,
2481 // <count>: the number of bytes that will be read from the stream
2482 // <cancellable>: optional #GCancellable object, %NULL to ignore
2483 ssize_t fill()(ssize_t count, Cancellable* cancellable, GLib2.Error** error=null) {
2484 return g_buffered_input_stream_fill(&this, count, cancellable, error);
2487 // Reads data into @stream's buffer asynchronously, up to @count size.
2488 // @io_priority can be used to prioritize reads. For the synchronous
2489 // version of this function, see g_buffered_input_stream_fill().
2491 // If @count is -1 then the attempted read size is equal to the number
2492 // of bytes that are required to fill the buffer.
2493 // <count>: the number of bytes that will be read from the stream
2494 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request
2495 // <cancellable>: optional #GCancellable object
2496 // <callback>: a #GAsyncReadyCallback
2497 // <user_data>: a #gpointer
2498 void fill_async()(ssize_t count, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
2499 g_buffered_input_stream_fill_async(&this, count, io_priority, cancellable, callback, user_data);
2502 // Finishes an asynchronous read.
2503 // RETURNS: a #gssize of the read stream, or %-1 on an error.
2504 // <result>: a #GAsyncResult
2505 ssize_t fill_finish()(AsyncResult* result, GLib2.Error** error=null) {
2506 return g_buffered_input_stream_fill_finish(&this, result, error);
2509 // Gets the size of the available data within the stream.
2510 // RETURNS: size of the available stream.
2511 size_t get_available()() {
2512 return g_buffered_input_stream_get_available(&this);
2515 // Gets the size of the input buffer.
2516 // RETURNS: the current buffer size.
2517 size_t get_buffer_size()() {
2518 return g_buffered_input_stream_get_buffer_size(&this);
2521 // Peeks in the buffer, copying data of size @count into @buffer,
2522 // offset @offset bytes.
2523 // RETURNS: a #gsize of the number of bytes peeked, or -1 on error.
2524 // <buffer>: a pointer to an allocated chunk of memory
2525 // <offset>: a #gsize
2526 // <count>: a #gsize
2527 size_t peek()(ubyte* buffer, size_t offset, size_t count) {
2528 return g_buffered_input_stream_peek(&this, buffer, offset, count);
2531 // Returns the buffer with the currently available bytes. The returned
2532 // buffer must not be modified and will become invalid when reading from
2533 // the stream or filling the buffer.
2535 // read-only buffer
2536 // <count>: a #gsize to get the number of bytes available in the buffer
2537 ubyte* peek_buffer()(/*out*/ size_t* count) {
2538 return g_buffered_input_stream_peek_buffer(&this, count);
2541 // Tries to read a single byte from the stream or the buffer. Will block
2542 // during this read.
2544 // On success, the byte read from the stream is returned. On end of stream
2545 // -1 is returned but it's not an exceptional error and @error is not set.
2547 // If @cancellable is not %NULL, then the operation can be cancelled by
2548 // triggering the cancellable object from another thread. If the operation
2549 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
2550 // operation was partially finished when the operation was cancelled the
2551 // partial result will be returned, without an error.
2553 // On error -1 is returned and @error is set accordingly.
2554 // RETURNS: the byte read from the @stream, or -1 on end of stream or error.
2555 // <cancellable>: optional #GCancellable object, %NULL to ignore
2556 int read_byte()(Cancellable* cancellable, GLib2.Error** error=null) {
2557 return g_buffered_input_stream_read_byte(&this, cancellable, error);
2560 // Sets the size of the internal buffer of @stream to @size, or to the
2561 // size of the contents of the buffer. The buffer can never be resized
2562 // smaller than its current contents.
2563 // <size>: a #gsize
2564 void set_buffer_size()(size_t size) {
2565 g_buffered_input_stream_set_buffer_size(&this, size);
2569 struct BufferedInputStreamClass {
2570 FilterInputStreamClass parent_class;
2572 // RETURNS: the number of bytes read into @stream's buffer, up to @count,
2573 // <count>: the number of bytes that will be read from the stream
2574 // <cancellable>: optional #GCancellable object, %NULL to ignore
2575 extern (C) ssize_t function (BufferedInputStream* stream, ssize_t count, Cancellable* cancellable, GLib2.Error** error=null) fill;
2577 // <count>: the number of bytes that will be read from the stream
2578 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request
2579 // <cancellable>: optional #GCancellable object
2580 // <callback>: a #GAsyncReadyCallback
2581 // <user_data>: a #gpointer
2582 extern (C) void function (BufferedInputStream* stream, ssize_t count, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) fill_async;
2584 // RETURNS: a #gssize of the read stream, or %-1 on an error.
2585 // <result>: a #GAsyncResult
2586 extern (C) ssize_t function (BufferedInputStream* stream, AsyncResult* result, GLib2.Error** error=null) fill_finish;
2587 extern (C) void function () _g_reserved1;
2588 extern (C) void function () _g_reserved2;
2589 extern (C) void function () _g_reserved3;
2590 extern (C) void function () _g_reserved4;
2591 extern (C) void function () _g_reserved5;
2594 struct BufferedInputStreamPrivate {
2598 // Buffered output stream implements #GFilterOutputStream and provides
2599 // for buffered writes.
2601 // By default, #GBufferedOutputStream's buffer size is set at 4 kilobytes.
2603 // To create a buffered output stream, use g_buffered_output_stream_new(),
2604 // or g_buffered_output_stream_new_sized() to specify the buffer's size
2605 // at construction.
2607 // To get the size of a buffer within a buffered input stream, use
2608 // g_buffered_output_stream_get_buffer_size(). To change the size of a
2609 // buffered output stream's buffer, use
2610 // g_buffered_output_stream_set_buffer_size(). Note that the buffer's
2611 // size cannot be reduced below the size of the data within the buffer.
2612 struct BufferedOutputStream /* : FilterOutputStream */ {
2613 alias parent_instance this;
2614 alias parent_instance super_;
2615 alias parent_instance filteroutputstream;
2616 FilterOutputStream parent_instance;
2617 BufferedOutputStreamPrivate* priv;
2620 // Creates a new buffered output stream for a base stream.
2621 // RETURNS: a #GOutputStream for the given @base_stream.
2622 // <base_stream>: a #GOutputStream.
2623 static BufferedOutputStream* /*new*/ new_()(OutputStream* base_stream) {
2624 return g_buffered_output_stream_new(base_stream);
2627 // Creates a new buffered output stream with a given buffer size.
2628 // RETURNS: a #GOutputStream with an internal buffer set to @size.
2629 // <base_stream>: a #GOutputStream.
2630 // <size>: a #gsize.
2631 static BufferedOutputStream* /*new*/ new_sized()(OutputStream* base_stream, size_t size) {
2632 return g_buffered_output_stream_new_sized(base_stream, size);
2635 // Checks if the buffer automatically grows as data is added.
2637 // %FALSE otherwise.
2638 // RETURNS: %TRUE if the @stream's buffer automatically grows,
2639 int get_auto_grow()() {
2640 return g_buffered_output_stream_get_auto_grow(&this);
2643 // Gets the size of the buffer in the @stream.
2644 // RETURNS: the current size of the buffer.
2645 size_t get_buffer_size()() {
2646 return g_buffered_output_stream_get_buffer_size(&this);
2649 // Sets whether or not the @stream's buffer should automatically grow.
2650 // If @auto_grow is true, then each write will just make the buffer
2651 // larger, and you must manually flush the buffer to actually write out
2652 // the data to the underlying stream.
2653 // <auto_grow>: a #gboolean.
2654 void set_auto_grow()(int auto_grow) {
2655 g_buffered_output_stream_set_auto_grow(&this, auto_grow);
2658 // Sets the size of the internal buffer to @size.
2659 // <size>: a #gsize.
2660 void set_buffer_size()(size_t size) {
2661 g_buffered_output_stream_set_buffer_size(&this, size);
2665 struct BufferedOutputStreamClass {
2666 FilterOutputStreamClass parent_class;
2667 extern (C) void function () _g_reserved1;
2668 extern (C) void function () _g_reserved2;
2671 struct BufferedOutputStreamPrivate {
2675 // VERSION: 2.26
2676 // Invoked when a connection to a message bus has been obtained.
2677 // <connection>: The #GDBusConnection to a message bus.
2678 // <name>: The name that is requested to be owned.
2679 // <user_data>: User data passed to g_bus_own_name().
2680 extern (C) alias void function (DBusConnection* connection, char* name, void* user_data) BusAcquiredCallback;
2683 // VERSION: 2.26
2684 // Invoked when the name is acquired.
2685 // <connection>: The #GDBusConnection on which to acquired the name.
2686 // <name>: The name being owned.
2687 // <user_data>: User data passed to g_bus_own_name() or g_bus_own_name_on_connection().
2688 extern (C) alias void function (DBusConnection* connection, char* name, void* user_data) BusNameAcquiredCallback;
2691 // VERSION: 2.26
2692 // Invoked when the name being watched is known to have to have a owner.
2693 // <connection>: The #GDBusConnection the name is being watched on.
2694 // <name>: The name being watched.
2695 // <name_owner>: Unique name of the owner of the name being watched.
2696 // <user_data>: User data passed to g_bus_watch_name().
2697 extern (C) alias void function (DBusConnection* connection, char* name, char* name_owner, void* user_data) BusNameAppearedCallback;
2700 // VERSION: 2.26
2701 // Invoked when the name is lost or @connection has been closed.
2702 // <connection>: The #GDBusConnection on which to acquire the name or %NULL if the connection was disconnected.
2703 // <name>: The name being owned.
2704 // <user_data>: User data passed to g_bus_own_name() or g_bus_own_name_on_connection().
2705 extern (C) alias void function (DBusConnection* connection, char* name, void* user_data) BusNameLostCallback;
2707 // Flags used in g_bus_own_name().
2708 enum BusNameOwnerFlags /* Version 2.26 */ {
2709 NONE = 0,
2710 ALLOW_REPLACEMENT = 1,
2711 REPLACE = 2
2714 // VERSION: 2.26
2715 // Invoked when the name being watched is known not to have to have a owner.
2716 // <connection>: The #GDBusConnection the name is being watched on.
2717 // <name>: The name being watched.
2718 // <user_data>: User data passed to g_bus_watch_name().
2719 extern (C) alias void function (DBusConnection* connection, char* name, void* user_data) BusNameVanishedCallback;
2721 // Flags used in g_bus_watch_name().
2722 enum BusNameWatcherFlags /* Version 2.26 */ {
2723 NONE = 0,
2724 AUTO_START = 1
2726 // An enumeration for well-known message buses.
2727 enum BusType /* Version 2.26 */ {
2728 STARTER = -1,
2729 NONE = 0,
2730 SYSTEM = 1,
2731 SESSION = 2
2734 // GCancellable is a thread-safe operation cancellation stack used
2735 // throughout GIO to allow for cancellation of synchronous and
2736 // asynchronous operations.
2737 struct Cancellable /* : GObject.Object */ {
2738 alias parent_instance this;
2739 alias parent_instance super_;
2740 alias parent_instance object;
2741 GObject2.Object parent_instance;
2742 private CancellablePrivate* priv;
2745 // Creates a new #GCancellable object.
2747 // Applications that want to start one or more operations
2748 // that should be cancellable should create a #GCancellable
2749 // and pass it to the operations.
2751 // One #GCancellable can be used in multiple consecutive
2752 // operations or in multiple concurrent operations.
2753 // RETURNS: a #GCancellable.
2754 static Cancellable* /*new*/ new_()() {
2755 return g_cancellable_new();
2758 // Gets the top cancellable from the stack.
2760 // if the stack is empty.
2761 // RETURNS: a #GCancellable from the top of the stack, or %NULL
2762 static Cancellable* get_current()() {
2763 return g_cancellable_get_current();
2766 // Will set @cancellable to cancelled, and will emit the
2767 // #GCancellable::cancelled signal. (However, see the warning about
2768 // race conditions in the documentation for that signal if you are
2769 // planning to connect to it.)
2771 // This function is thread-safe. In other words, you can safely call
2772 // it from a thread other than the one running the operation that was
2773 // passed the @cancellable.
2775 // The convention within gio is that cancelling an asynchronous
2776 // operation causes it to complete asynchronously. That is, if you
2777 // cancel the operation from the same thread in which it is running,
2778 // then the operation's #GAsyncReadyCallback will not be invoked until
2779 // the application returns to the main loop.
2780 void cancel()() {
2781 g_cancellable_cancel(&this);
2784 // VERSION: 2.22
2785 // Convenience function to connect to the #GCancellable::cancelled
2786 // signal. Also handles the race condition that may happen
2787 // if the cancellable is cancelled right before connecting.
2789 // @callback is called at most once, either directly at the
2790 // time of the connect if @cancellable is already cancelled,
2791 // or when @cancellable is cancelled in some thread.
2793 // @data_destroy_func will be called when the handler is
2794 // disconnected, or immediately if the cancellable is already
2795 // cancelled.
2797 // See #GCancellable::cancelled for details on how to use this.
2799 // been cancelled.
2800 // RETURNS: The id of the signal handler or 0 if @cancellable has already
2801 // <callback>: The #GCallback to connect.
2802 // <data>: Data to pass to @callback.
2803 // <data_destroy_func>: Free function for @data or %NULL.
2804 c_ulong connect()(GObject2.Callback callback, void* data, GLib2.DestroyNotify data_destroy_func) {
2805 return g_cancellable_connect(&this, callback, data, data_destroy_func);
2808 // VERSION: 2.22
2809 // Disconnects a handler from a cancellable instance similar to
2810 // g_signal_handler_disconnect(). Additionally, in the event that a
2811 // signal handler is currently running, this call will block until the
2812 // handler has finished. Calling this function from a
2813 // #GCancellable::cancelled signal handler will therefore result in a
2814 // deadlock.
2816 // This avoids a race condition where a thread cancels at the
2817 // same time as the cancellable operation is finished and the
2818 // signal handler is removed. See #GCancellable::cancelled for
2819 // details on how to use this.
2821 // If @cancellable is %NULL or @handler_id is %0 this function does
2822 // nothing.
2823 // <handler_id>: Handler id of the handler to be disconnected, or %0.
2824 void disconnect()(c_ulong handler_id) {
2825 g_cancellable_disconnect(&this, handler_id);
2828 // Gets the file descriptor for a cancellable job. This can be used to
2829 // implement cancellable operations on Unix systems. The returned fd will
2830 // turn readable when @cancellable is cancelled.
2832 // You are not supposed to read from the fd yourself, just check for
2833 // readable status. Reading to unset the readable status is done
2834 // with g_cancellable_reset().
2836 // After a successful return from this function, you should use
2837 // g_cancellable_release_fd() to free up resources allocated for
2838 // the returned file descriptor.
2840 // See also g_cancellable_make_pollfd().
2842 // is not supported, or on errors.
2843 // RETURNS: A valid file descriptor. %-1 if the file descriptor
2844 int get_fd()() {
2845 return g_cancellable_get_fd(&this);
2848 // Checks if a cancellable job has been cancelled.
2850 // FALSE if called with %NULL or if item is not cancelled.
2851 // RETURNS: %TRUE if @cancellable is cancelled,
2852 int is_cancelled()() {
2853 return g_cancellable_is_cancelled(&this);
2856 // VERSION: 2.22
2857 // Creates a #GPollFD corresponding to @cancellable; this can be passed
2858 // to g_poll() and used to poll for cancellation. This is useful both
2859 // for unix systems without a native poll and for portability to
2860 // windows.
2862 // When this function returns %TRUE, you should use
2863 // g_cancellable_release_fd() to free up resources allocated for the
2864 // @pollfd. After a %FALSE return, do not call g_cancellable_release_fd().
2866 // If this function returns %FALSE, either no @cancellable was given or
2867 // resource limits prevent this function from allocating the necessary
2868 // structures for polling. (On Linux, you will likely have reached
2869 // the maximum number of file descriptors.) The suggested way to handle
2870 // these cases is to ignore the @cancellable.
2872 // You are not supposed to read from the fd yourself, just check for
2873 // readable status. Reading to unset the readable status is done
2874 // with g_cancellable_reset().
2876 // failure to prepare the cancellable.
2877 // RETURNS: %TRUE if @pollfd was successfully initialized, %FALSE on
2878 // <pollfd>: a pointer to a #GPollFD
2879 int make_pollfd()(GLib2.PollFD* pollfd) {
2880 return g_cancellable_make_pollfd(&this, pollfd);
2883 // Pops @cancellable off the cancellable stack (verifying that @cancellable
2884 // is on the top of the stack).
2885 void pop_current()() {
2886 g_cancellable_pop_current(&this);
2889 // Pushes @cancellable onto the cancellable stack. The current
2890 // cancellable can then be received using g_cancellable_get_current().
2892 // This is useful when implementing cancellable operations in
2893 // code that does not allow you to pass down the cancellable object.
2895 // This is typically called automatically by e.g. #GFile operations,
2896 // so you rarely have to call this yourself.
2897 void push_current()() {
2898 g_cancellable_push_current(&this);
2901 // VERSION: 2.22
2902 // Releases a resources previously allocated by g_cancellable_get_fd()
2903 // or g_cancellable_make_pollfd().
2905 // For compatibility reasons with older releases, calling this function
2906 // is not strictly required, the resources will be automatically freed
2907 // when the @cancellable is finalized. However, the @cancellable will
2908 // block scarce file descriptors until it is finalized if this function
2909 // is not called. This can cause the application to run out of file
2910 // descriptors when many #GCancellables are used at the same time.
2911 void release_fd()() {
2912 g_cancellable_release_fd(&this);
2915 // Resets @cancellable to its uncancelled state.
2917 // If cancellable is currently in use by any cancellable operation
2918 // then the behavior of this function is undefined.
2919 void reset()() {
2920 g_cancellable_reset(&this);
2923 // If the @cancellable is cancelled, sets the error to notify
2924 // that the operation was cancelled.
2925 // RETURNS: %TRUE if @cancellable was cancelled, %FALSE if it was not
2926 int set_error_if_cancelled()(GLib2.Error** error=null) {
2927 return g_cancellable_set_error_if_cancelled(&this, error);
2930 // Unintrospectable method: source_new() / g_cancellable_source_new()
2931 // VERSION: 2.28
2932 // Creates a source that triggers if @cancellable is cancelled and
2933 // calls its callback of type #GCancellableSourceFunc. This is
2934 // primarily useful for attaching to another (non-cancellable) source
2935 // with g_source_add_child_source() to add cancellability to it.
2937 // For convenience, you can call this with a %NULL #GCancellable,
2938 // in which case the source will never trigger.
2939 // RETURNS: the new #GSource.
2940 GLib2.Source* /*new*/ source_new()() {
2941 return g_cancellable_source_new(&this);
2944 // Emitted when the operation has been cancelled.
2946 // Can be used by implementations of cancellable operations. If the
2947 // operation is cancelled from another thread, the signal will be
2948 // emitted in the thread that cancelled the operation, not the
2949 // thread that is running the operation.
2951 // Note that disconnecting from this signal (or any signal) in a
2952 // multi-threaded program is prone to race conditions. For instance
2953 // it is possible that a signal handler may be invoked even
2954 // <emphasis>after</emphasis> a call to
2955 // g_signal_handler_disconnect() for that handler has already
2956 // returned.
2958 // There is also a problem when cancellation happen
2959 // right before connecting to the signal. If this happens the
2960 // signal will unexpectedly not be emitted, and checking before
2961 // connecting to the signal leaves a race condition where this is
2962 // still happening.
2964 // In order to make it safe and easy to connect handlers there
2965 // are two helper functions: g_cancellable_connect() and
2966 // g_cancellable_disconnect() which protect against problems
2967 // like this.
2969 // An example of how to us this:
2970 // |[
2971 // /<!-- -->* Make sure we don't do any unnecessary work if already cancelled *<!-- -->/
2972 // if (g_cancellable_set_error_if_cancelled (cancellable))
2973 // return;
2975 // /<!-- -->* Set up all the data needed to be able to
2976 // * handle cancellation of the operation *<!-- -->/
2977 // my_data = my_data_new (...);
2979 // id = 0;
2980 // if (cancellable)
2981 // id = g_cancellable_connect (cancellable,
2982 // G_CALLBACK (cancelled_handler)
2983 // data, NULL);
2985 // /<!-- -->* cancellable operation here... *<!-- -->/
2987 // g_cancellable_disconnect (cancellable, id);
2989 // /<!-- -->* cancelled_handler is never called after this, it
2990 // * is now safe to free the data *<!-- -->/
2991 // my_data_free (my_data);
2992 // ]|
2994 // Note that the cancelled signal is emitted in the thread that
2995 // the user cancelled from, which may be the main thread. So, the
2996 // cancellable signal should not do something that can block.
2997 extern (C) alias static void function (Cancellable* this_, void* user_data=null) signal_cancelled;
2999 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
3000 return super_.signal_connect!name(cb, data, cf);
3003 ulong signal_connect(string name:"cancelled", CB:signal_cancelled)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
3004 return signal_connect_data!()(&this, cast(char*)"cancelled",
3005 cast(GObject2.Callback)cb, data, null, cf);
3009 struct CancellableClass {
3010 GObject2.ObjectClass parent_class;
3011 extern (C) void function (Cancellable* cancellable) cancelled;
3012 extern (C) void function () _g_reserved1;
3013 extern (C) void function () _g_reserved2;
3014 extern (C) void function () _g_reserved3;
3015 extern (C) void function () _g_reserved4;
3016 extern (C) void function () _g_reserved5;
3019 struct CancellablePrivate {
3023 // VERSION: 2.28
3024 // This is the function type of the callback used for the #GSource
3025 // returned by g_cancellable_source_new().
3026 // RETURNS: it should return %FALSE if the source should be removed.
3027 // <cancellable>: the #GCancellable
3028 // <user_data>: data passed in by the user.
3029 extern (C) alias int function (Cancellable* cancellable, void* user_data) CancellableSourceFunc;
3032 // #GCharsetConverter is an implementation of #GConverter based on
3033 // GIConv.
3034 struct CharsetConverter /* : GObject.Object */ {
3035 mixin Converter.__interface__;
3036 mixin Initable.__interface__;
3037 alias method_parent this;
3038 alias method_parent super_;
3039 alias method_parent object;
3040 GObject2.Object method_parent;
3043 // VERSION: 2.24
3044 // Creates a new #GCharsetConverter.
3045 // RETURNS: a new #GCharsetConverter or %NULL on error.
3046 // <to_charset>: destination charset
3047 // <from_charset>: source charset
3048 static CharsetConverter* /*new*/ new_()(char* to_charset, char* from_charset, GLib2.Error** error=null) {
3049 return g_charset_converter_new(to_charset, from_charset, error);
3052 // VERSION: 2.24
3053 // Gets the number of fallbacks that @converter has applied so far.
3054 // RETURNS: the number of fallbacks that @converter has applied
3055 uint get_num_fallbacks()() {
3056 return g_charset_converter_get_num_fallbacks(&this);
3059 // VERSION: 2.24
3060 // Gets the #GCharsetConverter:use-fallback property.
3061 // RETURNS: %TRUE if fallbacks are used by @converter
3062 int get_use_fallback()() {
3063 return g_charset_converter_get_use_fallback(&this);
3066 // VERSION: 2.24
3067 // Sets the #GCharsetConverter:use-fallback property.
3068 // <use_fallback>: %TRUE to use fallbacks
3069 void set_use_fallback()(int use_fallback) {
3070 g_charset_converter_set_use_fallback(&this, use_fallback);
3074 struct CharsetConverterClass {
3075 GObject2.ObjectClass parent_class;
3079 // #GConverter is implemented by objects that convert
3080 // binary data in various ways. The conversion can be
3081 // stateful and may fail at any place.
3083 // Some example conversions are: character set conversion,
3084 // compression, decompression and regular expression
3085 // replace.
3086 struct Converter /* Interface */ /* Version 2.24 */ {
3087 mixin template __interface__() {
3088 // VERSION: 2.24
3089 // This is the main operation used when converting data. It is to be called
3090 // multiple times in a loop, and each time it will do some work, i.e.
3091 // producing some output (in @outbuf) or consuming some input (from @inbuf) or
3092 // both. If its not possible to do any work an error is returned.
3094 // Note that a single call may not consume all input (or any input at all).
3095 // Also a call may produce output even if given no input, due to state stored
3096 // in the converter producing output.
3098 // If any data was either produced or consumed, and then an error happens, then
3099 // only the successful conversion is reported and the error is returned on the
3100 // next call.
3102 // A full conversion loop involves calling this method repeatedly, each time
3103 // giving it new input and space output space. When there is no more input
3104 // data after the data in @inbuf, the flag %G_CONVERTER_INPUT_AT_END must be set.
3105 // The loop will be (unless some error happens) returning %G_CONVERTER_CONVERTED
3106 // each time until all data is consumed and all output is produced, then
3107 // %G_CONVERTER_FINISHED is returned instead. Note, that %G_CONVERTER_FINISHED
3108 // may be returned even if %G_CONVERTER_INPUT_AT_END is not set, for instance
3109 // in a decompression converter where the end of data is detectable from the
3110 // data (and there might even be other data after the end of the compressed data).
3112 // When some data has successfully been converted @bytes_read and is set to
3113 // the number of bytes read from @inbuf, and @bytes_written is set to indicate
3114 // how many bytes was written to @outbuf. If there are more data to output
3115 // or consume (i.e. unless the %G_CONVERTER_INPUT_AT_END is specified) then
3116 // %G_CONVERTER_CONVERTED is returned, and if no more data is to be output
3117 // then %G_CONVERTER_FINISHED is returned.
3119 // On error %G_CONVERTER_ERROR is returned and @error is set accordingly.
3120 // Some errors need special handling:
3122 // %G_IO_ERROR_NO_SPACE is returned if there is not enough space
3123 // to write the resulting converted data, the application should
3124 // call the function again with a larger @outbuf to continue.
3126 // %G_IO_ERROR_PARTIAL_INPUT is returned if there is not enough
3127 // input to fully determine what the conversion should produce,
3128 // and the %G_CONVERTER_INPUT_AT_END flag is not set. This happens for
3129 // example with an incomplete multibyte sequence when converting text,
3130 // or when a regexp matches up to the end of the input (and may match
3131 // further input). It may also happen when @inbuf_size is zero and
3132 // there is no more data to produce.
3134 // When this happens the application should read more input and then
3135 // call the function again. If further input shows that there is no
3136 // more data call the function again with the same data but with
3137 // the %G_CONVERTER_INPUT_AT_END flag set. This may cause the conversion
3138 // to finish as e.g. in the regexp match case (or, to fail again with
3139 // %G_IO_ERROR_PARTIAL_INPUT in e.g. a charset conversion where the
3140 // input is actually partial).
3142 // After g_converter_convert() has returned %G_CONVERTER_FINISHED the
3143 // converter object is in an invalid state where its not allowed
3144 // to call g_converter_convert() anymore. At this time you can only
3145 // free the object or call g_converter_reset() to reset it to the
3146 // initial state.
3148 // If the flag %G_CONVERTER_FLUSH is set then conversion is modified
3149 // to try to write out all internal state to the output. The application
3150 // has to call the function multiple times with the flag set, and when
3151 // the available input has been consumed and all internal state has
3152 // been produced then %G_CONVERTER_FLUSHED (or %G_CONVERTER_FINISHED if
3153 // really at the end) is returned instead of %G_CONVERTER_CONVERTED.
3154 // This is somewhat similar to what happens at the end of the input stream,
3155 // but done in the middle of the data.
3157 // This has different meanings for different conversions. For instance
3158 // in a compression converter it would mean that we flush all the
3159 // compression state into output such that if you uncompress the
3160 // compressed data you get back all the input data. Doing this may
3161 // make the final file larger due to padding though. Another example
3162 // is a regexp conversion, where if you at the end of the flushed data
3163 // have a match, but there is also a potential longer match. In the
3164 // non-flushed case we would ask for more input, but when flushing we
3165 // treat this as the end of input and do the match.
3167 // Flushing is not always possible (like if a charset converter flushes
3168 // at a partial multibyte sequence). Converters are supposed to try
3169 // to produce as much output as possible and then return an error
3170 // (typically %G_IO_ERROR_PARTIAL_INPUT).
3171 // RETURNS: a #GConverterResult, %G_CONVERTER_ERROR on error.
3172 // <inbuf>: the buffer containing the data to convert.
3173 // <inbuf_size>: the number of bytes in @inbuf
3174 // <outbuf>: a buffer to write converted data in.
3175 // <outbuf_size>: the number of bytes in @outbuf, must be at least one
3176 // <flags>: a #GConvertFlags controlling the conversion details
3177 // <bytes_read>: will be set to the number of bytes read from @inbuf on success
3178 // <bytes_written>: will be set to the number of bytes written to @outbuf on success
3179 ConverterResult convert()(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) {
3180 return g_converter_convert(cast(Converter*)&this, inbuf, inbuf_size, outbuf, outbuf_size, flags, bytes_read, bytes_written, error);
3183 // VERSION: 2.24
3184 // Resets all internal state in the converter, making it behave
3185 // as if it was just created. If the converter has any internal
3186 // state that would produce output then that output is lost.
3187 void reset()() {
3188 g_converter_reset(cast(Converter*)&this);
3191 mixin __interface__;
3194 // Flags used when calling a g_converter_convert().
3195 enum ConverterFlags /* Version 2.24 */ {
3196 G_CONVERTER_NO_FLAGS = 0,
3197 INPUT_AT_END = 1,
3198 FLUSH = 2
3201 // Provides an interface for converting data from one type
3202 // to another type. The conversion can be stateful
3203 // and may fail at any place.
3204 struct ConverterIface /* Version 2.24 */ {
3205 GObject2.TypeInterface g_iface;
3207 // RETURNS: a #GConverterResult, %G_CONVERTER_ERROR on error.
3208 // <inbuf>: the buffer containing the data to convert.
3209 // <inbuf_size>: the number of bytes in @inbuf
3210 // <outbuf>: a buffer to write converted data in.
3211 // <outbuf_size>: the number of bytes in @outbuf, must be at least one
3212 // <flags>: a #GConvertFlags controlling the conversion details
3213 // <bytes_read>: will be set to the number of bytes read from @inbuf on success
3214 // <bytes_written>: will be set to the number of bytes written to @outbuf on success
3215 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) convert;
3216 extern (C) void function (Converter* converter) reset;
3220 // Converter input stream implements #GInputStream and allows
3221 // conversion of data of various types during reading.
3222 struct ConverterInputStream /* : FilterInputStream */ {
3223 alias parent_instance this;
3224 alias parent_instance super_;
3225 alias parent_instance filterinputstream;
3226 FilterInputStream parent_instance;
3227 private ConverterInputStreamPrivate* priv;
3230 // Creates a new converter input stream for the @base_stream.
3231 // RETURNS: a new #GInputStream.
3232 // <base_stream>: a #GInputStream
3233 // <converter>: a #GConverter
3234 static ConverterInputStream* /*new*/ new_()(InputStream* base_stream, Converter* converter) {
3235 return g_converter_input_stream_new(base_stream, converter);
3238 // VERSION: 2.24
3239 // Gets the #GConverter that is used by @converter_stream.
3240 // RETURNS: the converter of the converter input stream
3241 Converter* get_converter()() {
3242 return g_converter_input_stream_get_converter(&this);
3246 struct ConverterInputStreamClass {
3247 FilterInputStreamClass parent_class;
3248 extern (C) void function () _g_reserved1;
3249 extern (C) void function () _g_reserved2;
3250 extern (C) void function () _g_reserved3;
3251 extern (C) void function () _g_reserved4;
3252 extern (C) void function () _g_reserved5;
3255 struct ConverterInputStreamPrivate {
3259 // Converter output stream implements #GOutputStream and allows
3260 // conversion of data of various types during reading.
3261 struct ConverterOutputStream /* : FilterOutputStream */ {
3262 alias parent_instance this;
3263 alias parent_instance super_;
3264 alias parent_instance filteroutputstream;
3265 FilterOutputStream parent_instance;
3266 private ConverterOutputStreamPrivate* priv;
3269 // Creates a new converter output stream for the @base_stream.
3270 // RETURNS: a new #GOutputStream.
3271 // <base_stream>: a #GOutputStream
3272 // <converter>: a #GConverter
3273 static ConverterOutputStream* /*new*/ new_()(OutputStream* base_stream, Converter* converter) {
3274 return g_converter_output_stream_new(base_stream, converter);
3277 // VERSION: 2.24
3278 // Gets the #GConverter that is used by @converter_stream.
3279 // RETURNS: the converter of the converter output stream
3280 Converter* get_converter()() {
3281 return g_converter_output_stream_get_converter(&this);
3285 struct ConverterOutputStreamClass {
3286 FilterOutputStreamClass parent_class;
3287 extern (C) void function () _g_reserved1;
3288 extern (C) void function () _g_reserved2;
3289 extern (C) void function () _g_reserved3;
3290 extern (C) void function () _g_reserved4;
3291 extern (C) void function () _g_reserved5;
3294 struct ConverterOutputStreamPrivate {
3297 // Results returned from g_converter_convert().
3298 enum ConverterResult /* Version 2.24 */ {
3299 ERROR = 0,
3300 CONVERTED = 1,
3301 FINISHED = 2,
3302 FLUSHED = 3
3305 // The #GCredentials type is a reference-counted wrapper for native
3306 // credentials. This information is typically used for identifying,
3307 // authenticating and authorizing other processes.
3309 // Some operating systems supports looking up the credentials of the
3310 // remote peer of a communication endpoint - see e.g.
3311 // g_socket_get_credentials().
3313 // Some operating systems supports securely sending and receiving
3314 // credentials over a Unix Domain Socket, see
3315 // #GUnixCredentialsMessage, g_unix_connection_send_credentials() and
3316 // g_unix_connection_receive_credentials() for details.
3318 // On Linux, the native credential type is a <type>struct ucred</type>
3319 // - see the
3320 // <citerefentry><refentrytitle>unix</refentrytitle><manvolnum>7</manvolnum></citerefentry>
3321 // man page for details. This corresponds to
3322 // %G_CREDENTIALS_TYPE_LINUX_UCRED.
3324 // On FreeBSD, the native credential type is a <type>struct cmsgcred</type>.
3325 // This corresponds to %G_CREDENTIALS_TYPE_FREEBSD_CMSGCRED.
3327 // On OpenBSD, the native credential type is a <type>struct sockpeercred</type>.
3328 // This corresponds to %G_CREDENTIALS_TYPE_OPENBSD_SOCKPEERCRED.
3329 struct Credentials /* : GObject.Object */ /* Version 2.26 */ {
3330 alias method_parent this;
3331 alias method_parent super_;
3332 alias method_parent object;
3333 GObject2.Object method_parent;
3336 // VERSION: 2.26
3337 // Creates a new #GCredentials object with credentials matching the
3338 // the current process.
3339 // RETURNS: A #GCredentials. Free with g_object_unref().
3340 static Credentials* /*new*/ new_()() {
3341 return g_credentials_new();
3344 // Unintrospectable method: get_native() / g_credentials_get_native()
3345 // VERSION: 2.26
3346 // Gets a pointer to native credentials of type @native_type from
3347 // @credentials.
3349 // It is a programming error (which will cause an warning to be
3350 // logged) to use this method if there is no #GCredentials support for
3351 // the OS or if @native_type isn't supported by the OS.
3353 // operation there is no #GCredentials support for the OS or if
3354 // @native_type isn't supported by the OS. Do not free the returned
3355 // data, it is owned by @credentials.
3356 // RETURNS: The pointer to native credentials or %NULL if the
3357 // <native_type>: The type of native credentials to get.
3358 void* get_native()(CredentialsType native_type) {
3359 return g_credentials_get_native(&this, native_type);
3362 // VERSION: 2.26
3363 // Tries to get the UNIX user identifier from @credentials. This
3364 // method is only available on UNIX platforms.
3366 // This operation can fail if #GCredentials is not supported on the
3367 // OS or if the native credentials type does not contain information
3368 // about the UNIX user.
3369 // RETURNS: The UNIX user identifier or -1 if @error is set.
3370 uint get_unix_user()(GLib2.Error** error=null) {
3371 return g_credentials_get_unix_user(&this, error);
3374 // VERSION: 2.26
3375 // Checks if @credentials and @other_credentials is the same user.
3377 // This operation can fail if #GCredentials is not supported on the
3378 // the OS.
3380 // user, %FALSE otherwise or if @error is set.
3381 // RETURNS: %TRUE if @credentials and @other_credentials has the same
3382 // <other_credentials>: A #GCredentials.
3383 int is_same_user()(Credentials* other_credentials, GLib2.Error** error=null) {
3384 return g_credentials_is_same_user(&this, other_credentials, error);
3387 // VERSION: 2.26
3388 // Copies the native credentials of type @native_type from @native
3389 // into @credentials.
3391 // It is a programming error (which will cause an warning to be
3392 // logged) to use this method if there is no #GCredentials support for
3393 // the OS or if @native_type isn't supported by the OS.
3394 // <native_type>: The type of native credentials to set.
3395 // <native>: A pointer to native credentials.
3396 void set_native()(CredentialsType native_type, void* native) {
3397 g_credentials_set_native(&this, native_type, native);
3400 // VERSION: 2.26
3401 // Tries to set the UNIX user identifier on @credentials. This method
3402 // is only available on UNIX platforms.
3404 // This operation can fail if #GCredentials is not supported on the
3405 // OS or if the native credentials type does not contain information
3406 // about the UNIX user.
3407 // RETURNS: %TRUE if @uid was set, %FALSE if error is set.
3408 // <uid>: The UNIX user identifier to set.
3409 int set_unix_user()(uint uid, GLib2.Error** error=null) {
3410 return g_credentials_set_unix_user(&this, uid, error);
3413 // VERSION: 2.26
3414 // Creates a human-readable textual representation of @credentials
3415 // that can be used in logging and debug messages. The format of the
3416 // returned string may change in future GLib release.
3417 // RETURNS: A string that should be freed with g_free().
3418 char* /*new*/ to_string()() {
3419 return g_credentials_to_string(&this);
3423 // Class structure for #GCredentials.
3424 struct CredentialsClass /* Version 2.26 */ {
3427 // Enumeration describing different kinds of native credential types.
3428 enum CredentialsType /* Version 2.26 */ {
3429 INVALID = 0,
3430 LINUX_UCRED = 1,
3431 FREEBSD_CMSGCRED = 2,
3432 OPENBSD_SOCKPEERCRED = 3
3435 // #GDBusActionGroup is an implementation of the #GActionGroup
3436 // interface that can be used as a proxy for an action group
3437 // that is exported over D-Bus with g_dbus_connection_export_action_group().
3438 struct DBusActionGroup /* : GObject.Object */ {
3439 mixin ActionGroup.__interface__;
3440 mixin RemoteActionGroup.__interface__;
3441 alias method_parent this;
3442 alias method_parent super_;
3443 alias method_parent object;
3444 GObject2.Object method_parent;
3447 // VERSION: 2.32
3448 // Obtains a #GDBusActionGroup for the action group which is exported at
3449 // the given @bus_name and @object_path.
3451 // The thread default main context is taken at the time of this call.
3452 // All signals on the menu model (and any linked models) are reported
3453 // with respect to this context. All calls on the returned menu model
3454 // (and linked models) must also originate from this same context, with
3455 // the thread default main context unchanged.
3457 // This call is non-blocking. The returned action group may or may not
3458 // already be filled in. The correct thing to do is connect the signals
3459 // for the action group to monitor for changes and then to call
3460 // g_action_group_list_actions() to get the initial list.
3461 // RETURNS: a #GDBusActionGroup
3462 // <connection>: A #GDBusConnection
3463 // <bus_name>: the bus name which exports the action group
3464 // <object_path>: the object path at which the action group is exported
3465 static DBusActionGroup* /*new*/ get()(DBusConnection* connection, char* bus_name, char* object_path) {
3466 return g_dbus_action_group_get(connection, bus_name, object_path);
3470 // Information about an annotation.
3471 struct DBusAnnotationInfo /* Version 2.26 */ {
3472 int ref_count;
3473 char* key, value;
3474 DBusAnnotationInfo*[666] annotations;
3477 // VERSION: 2.26
3478 // If @info is statically allocated does nothing. Otherwise increases
3479 // the reference count.
3480 // RETURNS: The same @info.
3481 DBusAnnotationInfo* /*new*/ ref_()() {
3482 return g_dbus_annotation_info_ref(&this);
3485 // VERSION: 2.26
3486 // If @info is statically allocated, does nothing. Otherwise decreases
3487 // the reference count of @info. When its reference count drops to 0,
3488 // the memory used is freed.
3489 void unref()() {
3490 g_dbus_annotation_info_unref(&this);
3493 // VERSION: 2.26
3494 // Looks up the value of an annotation.
3496 // This cost of this function is O(n) in number of annotations.
3497 // RETURNS: The value or %NULL if not found. Do not free, it is owned by @annotations.
3498 // <annotations>: A %NULL-terminated array of annotations or %NULL.
3499 // <name>: The name of the annotation to look up.
3500 static char* lookup()(DBusAnnotationInfo** annotations, char* name) {
3501 return g_dbus_annotation_info_lookup(annotations, name);
3505 // Information about an argument for a method or a signal.
3506 struct DBusArgInfo /* Version 2.26 */ {
3507 int ref_count;
3508 char* name, signature;
3509 DBusAnnotationInfo*[666] annotations;
3512 // VERSION: 2.26
3513 // If @info is statically allocated does nothing. Otherwise increases
3514 // the reference count.
3515 // RETURNS: The same @info.
3516 DBusArgInfo* /*new*/ ref_()() {
3517 return g_dbus_arg_info_ref(&this);
3520 // VERSION: 2.26
3521 // If @info is statically allocated, does nothing. Otherwise decreases
3522 // the reference count of @info. When its reference count drops to 0,
3523 // the memory used is freed.
3524 void unref()() {
3525 g_dbus_arg_info_unref(&this);
3530 // The #GDBusAuthObserver type provides a mechanism for participating
3531 // in how a #GDBusServer (or a #GDBusConnection) authenticates remote
3532 // peers. Simply instantiate a #GDBusAuthObserver and connect to the
3533 // signals you are interested in. Note that new signals may be added
3534 // in the future
3536 // For example, if you only want to allow D-Bus connections from
3537 // processes owned by the same uid as the server, you would use a
3538 // signal handler like the following:
3539 // <example id="auth-observer"><title>Controlling Authentication</title><programlisting>
3540 // static gboolean
3541 // on_authorize_authenticated_peer (GDBusAuthObserver *observer,
3542 // GIOStream *stream,
3543 // GCredentials *credentials,
3544 // gpointer user_data)
3545 // {
3546 // gboolean authorized;
3548 // authorized = FALSE;
3549 // if (credentials != NULL)
3550 // {
3551 // GCredentials *own_credentials;
3552 // own_credentials = g_credentials_new ();
3553 // if (g_credentials_is_same_user (credentials, own_credentials, NULL))
3554 // authorized = TRUE;
3555 // g_object_unref (own_credentials);
3556 // }
3558 // return authorized;
3559 // }
3560 // </programlisting></example>
3561 struct DBusAuthObserver /* : GObject.Object */ /* Version 2.26 */ {
3562 alias method_parent this;
3563 alias method_parent super_;
3564 alias method_parent object;
3565 GObject2.Object method_parent;
3568 // VERSION: 2.26
3569 // Creates a new #GDBusAuthObserver object.
3570 // RETURNS: A #GDBusAuthObserver. Free with g_object_unref().
3571 static DBusAuthObserver* /*new*/ new_()() {
3572 return g_dbus_auth_observer_new();
3575 // VERSION: 2.26
3576 // Emits the #GDBusAuthObserver::authorize-authenticated-peer signal on @observer.
3577 // RETURNS: %TRUE if the peer is authorized, %FALSE if not.
3578 // <stream>: A #GIOStream for the #GDBusConnection.
3579 // <credentials>: Credentials received from the peer or %NULL.
3580 int authorize_authenticated_peer()(IOStream* stream, Credentials* credentials) {
3581 return g_dbus_auth_observer_authorize_authenticated_peer(&this, stream, credentials);
3584 // VERSION: 2.26
3585 // Emitted to check if a peer that is successfully authenticated
3586 // is authorized.
3587 // RETURNS: %TRUE if the peer is authorized, %FALSE if not.
3588 // <stream>: A #GIOStream for the #GDBusConnection.
3589 // <credentials>: Credentials received from the peer or %NULL.
3590 extern (C) alias static c_int function (DBusAuthObserver* this_, IOStream* stream, Credentials* credentials, void* user_data=null) signal_authorize_authenticated_peer;
3592 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
3593 return super_.signal_connect!name(cb, data, cf);
3596 ulong signal_connect(string name:"authorize-authenticated-peer", CB:signal_authorize_authenticated_peer)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
3597 return signal_connect_data!()(&this, cast(char*)"authorize-authenticated-peer",
3598 cast(GObject2.Callback)cb, data, null, cf);
3602 // Flags used in g_dbus_connection_call() and similar APIs.
3603 enum DBusCallFlags /* Version 2.26 */ {
3604 NONE = 0,
3605 NO_AUTO_START = 1
3607 // Capabilities negotiated with the remote peer.
3608 enum DBusCapabilityFlags /* Version 2.26 */ {
3609 NONE = 0,
3610 UNIX_FD_PASSING = 1
3613 // The #GDBusConnection type is used for D-Bus connections to remote
3614 // peers such as a message buses. It is a low-level API that offers a
3615 // lot of flexibility. For instance, it lets you establish a connection
3616 // over any transport that can by represented as an #GIOStream.
3618 // This class is rarely used directly in D-Bus clients. If you are writing
3619 // an D-Bus client, it is often easier to use the g_bus_own_name(),
3620 // g_bus_watch_name() or g_dbus_proxy_new_for_bus() APIs.
3622 // As an exception to the usual GLib rule that a particular object must not be
3623 // used by two threads at the same time, #GDBusConnection's methods may be
3624 // called from any thread<footnote>
3625 // <para>
3626 // This is so that g_bus_get() and g_bus_get_sync() can safely return the
3627 // same #GDBusConnection when called from any thread.
3628 // </para>
3629 // </footnote>.
3631 // Most of the ways to obtain a #GDBusConnection automatically initialize it
3632 // (i.e. connect to D-Bus): for instance, g_dbus_connection_new() and
3633 // g_bus_get(), and the synchronous versions of those methods, give you an
3634 // initialized connection. Language bindings for GIO should use
3635 // g_initable_new() or g_async_initable_new(), which also initialize the
3636 // connection.
3638 // If you construct an uninitialized #GDBusConnection, such as via
3639 // g_object_new(), you must initialize it via g_initable_init() or
3640 // g_async_initable_init() before using its methods or properties. Calling
3641 // methods or accessing properties on a #GDBusConnection that has not completed
3642 // initialization successfully is considered to be invalid, and leads to
3643 // undefined behaviour. In particular, if initialization fails with a #GError,
3644 // the only valid thing you can do with that #GDBusConnection is to free it
3645 // with g_object_unref().
3647 // <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>
3649 // <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>
3651 // <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>
3653 // <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>
3654 struct DBusConnection /* : GObject.Object */ /* Version 2.26 */ {
3655 mixin AsyncInitable.__interface__;
3656 mixin Initable.__interface__;
3657 alias method_parent this;
3658 alias method_parent super_;
3659 alias method_parent object;
3660 GObject2.Object method_parent;
3663 // VERSION: 2.26
3664 // Finishes an operation started with g_dbus_connection_new().
3665 // RETURNS: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
3666 // <res>: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_new().
3667 static DBusConnection* /*new*/ new_finish()(AsyncResult* res, GLib2.Error** error=null) {
3668 return g_dbus_connection_new_finish(res, error);
3671 // VERSION: 2.26
3672 // Finishes an operation started with g_dbus_connection_new_for_address().
3673 // RETURNS: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
3674 // <res>: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_new().
3675 static DBusConnection* /*new*/ new_for_address_finish()(AsyncResult* res, GLib2.Error** error=null) {
3676 return g_dbus_connection_new_for_address_finish(res, error);
3679 // VERSION: 2.26
3680 // Synchronously connects and sets up a D-Bus client connection for
3681 // exchanging D-Bus messages with an endpoint specified by @address
3682 // which must be in the D-Bus address format.
3684 // This constructor can only be used to initiate client-side
3685 // connections - use g_dbus_connection_new_sync() if you need to act
3686 // as the server. In particular, @flags cannot contain the
3687 // %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER or
3688 // %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS flags.
3690 // This is a synchronous failable constructor. See
3691 // g_dbus_connection_new_for_address() for the asynchronous version.
3693 // If @observer is not %NULL it may be used to control the
3694 // authentication process.
3695 // RETURNS: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
3696 // <address>: A D-Bus address.
3697 // <flags>: Flags describing how to make the connection.
3698 // <observer>: A #GDBusAuthObserver or %NULL.
3699 // <cancellable>: A #GCancellable or %NULL.
3700 static DBusConnection* /*new*/ new_for_address_sync()(char* address, DBusConnectionFlags flags, DBusAuthObserver* observer, Cancellable* cancellable, GLib2.Error** error=null) {
3701 return g_dbus_connection_new_for_address_sync(address, flags, observer, cancellable, error);
3704 // VERSION: 2.26
3705 // Synchronously sets up a D-Bus connection for exchanging D-Bus messages
3706 // with the end represented by @stream.
3708 // If @stream is a #GSocketConnection, then the corresponding #GSocket
3709 // will be put into non-blocking mode.
3711 // The D-Bus connection will interact with @stream from a worker thread.
3712 // As a result, the caller should not interact with @stream after this
3713 // method has been called, except by calling g_object_unref() on it.
3715 // If @observer is not %NULL it may be used to control the
3716 // authentication process.
3718 // This is a synchronous failable constructor. See
3719 // g_dbus_connection_new() for the asynchronous version.
3720 // RETURNS: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
3721 // <stream>: A #GIOStream.
3722 // <guid>: The GUID to use if a authenticating as a server or %NULL.
3723 // <flags>: Flags describing how to make the connection.
3724 // <observer>: A #GDBusAuthObserver or %NULL.
3725 // <cancellable>: A #GCancellable or %NULL.
3726 static DBusConnection* /*new*/ new_sync()(IOStream* stream, char* guid, DBusConnectionFlags flags, DBusAuthObserver* observer, Cancellable* cancellable, GLib2.Error** error=null) {
3727 return g_dbus_connection_new_sync(stream, guid, flags, observer, cancellable, error);
3730 // VERSION: 2.26
3731 // Asynchronously sets up a D-Bus connection for exchanging D-Bus messages
3732 // with the end represented by @stream.
3734 // If @stream is a #GSocketConnection, then the corresponding #GSocket
3735 // will be put into non-blocking mode.
3737 // The D-Bus connection will interact with @stream from a worker thread.
3738 // As a result, the caller should not interact with @stream after this
3739 // method has been called, except by calling g_object_unref() on it.
3741 // If @observer is not %NULL it may be used to control the
3742 // authentication process.
3744 // When the operation is finished, @callback will be invoked. You can
3745 // then call g_dbus_connection_new_finish() to get the result of the
3746 // operation.
3748 // This is a asynchronous failable constructor. See
3749 // g_dbus_connection_new_sync() for the synchronous
3750 // version.
3751 // <stream>: A #GIOStream.
3752 // <guid>: The GUID to use if a authenticating as a server or %NULL.
3753 // <flags>: Flags describing how to make the connection.
3754 // <observer>: A #GDBusAuthObserver or %NULL.
3755 // <cancellable>: A #GCancellable or %NULL.
3756 // <callback>: A #GAsyncReadyCallback to call when the request is satisfied.
3757 // <user_data>: The data to pass to @callback.
3758 static void new_()(IOStream* stream, char* guid, DBusConnectionFlags flags, DBusAuthObserver* observer, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
3759 g_dbus_connection_new(stream, guid, flags, observer, cancellable, callback, user_data);
3762 // VERSION: 2.26
3763 // Asynchronously connects and sets up a D-Bus client connection for
3764 // exchanging D-Bus messages with an endpoint specified by @address
3765 // which must be in the D-Bus address format.
3767 // This constructor can only be used to initiate client-side
3768 // connections - use g_dbus_connection_new() if you need to act as the
3769 // server. In particular, @flags cannot contain the
3770 // %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER or
3771 // %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS flags.
3773 // When the operation is finished, @callback will be invoked. You can
3774 // then call g_dbus_connection_new_finish() to get the result of the
3775 // operation.
3777 // If @observer is not %NULL it may be used to control the
3778 // authentication process.
3780 // This is a asynchronous failable constructor. See
3781 // g_dbus_connection_new_for_address_sync() for the synchronous
3782 // version.
3783 // <address>: A D-Bus address.
3784 // <flags>: Flags describing how to make the connection.
3785 // <observer>: A #GDBusAuthObserver or %NULL.
3786 // <cancellable>: A #GCancellable or %NULL.
3787 // <callback>: A #GAsyncReadyCallback to call when the request is satisfied.
3788 // <user_data>: The data to pass to @callback.
3789 static void new_for_address()(char* address, DBusConnectionFlags flags, DBusAuthObserver* observer, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
3790 g_dbus_connection_new_for_address(address, flags, observer, cancellable, callback, user_data);
3793 // VERSION: 2.26
3794 // Adds a message filter. Filters are handlers that are run on all
3795 // incoming and outgoing messages, prior to standard dispatch. Filters
3796 // are run in the order that they were added. The same handler can be
3797 // added as a filter more than once, in which case it will be run more
3798 // than once. Filters added during a filter callback won't be run on
3799 // the message being processed. Filter functions are allowed to modify
3800 // and even drop messages.
3802 // Note that filters are run in a dedicated message handling thread so
3803 // they can't block and, generally, can't do anything but signal a
3804 // worker thread. Also note that filters are rarely needed - use API
3805 // such as g_dbus_connection_send_message_with_reply(),
3806 // g_dbus_connection_signal_subscribe() or g_dbus_connection_call() instead.
3808 // If a filter consumes an incoming message the message is not
3809 // dispatched anywhere else - not even the standard dispatch machinery
3810 // (that API such as g_dbus_connection_signal_subscribe() and
3811 // g_dbus_connection_send_message_with_reply() relies on) will see the
3812 // message. Similary, if a filter consumes an outgoing message, the
3813 // message will not be sent to the other peer.
3815 // g_dbus_connection_remove_filter().
3816 // RETURNS: A filter identifier that can be used with
3817 // <filter_function>: A filter function.
3818 // <user_data>: User data to pass to @filter_function.
3819 // <user_data_free_func>: Function to free @user_data with when filter is removed or %NULL.
3820 uint add_filter()(DBusMessageFilterFunction filter_function, void* user_data, GLib2.DestroyNotify user_data_free_func) {
3821 return g_dbus_connection_add_filter(&this, filter_function, user_data, user_data_free_func);
3824 // VERSION: 2.26
3825 // Asynchronously invokes the @method_name method on the
3826 // @interface_name D-Bus interface on the remote object at
3827 // @object_path owned by @bus_name.
3829 // If @connection is closed then the operation will fail with
3830 // %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will
3831 // fail with %G_IO_ERROR_CANCELLED. If @parameters contains a value
3832 // not compatible with the D-Bus protocol, the operation fails with
3833 // %G_IO_ERROR_INVALID_ARGUMENT.
3835 // If @reply_type is non-%NULL then the reply will be checked for having this type and an
3836 // error will be raised if it does not match. Said another way, if you give a @reply_type
3837 // then any non-%NULL return value will be of this type.
3839 // If the @parameters #GVariant is floating, it is consumed. This allows
3840 // convenient 'inline' use of g_variant_new(), e.g.:
3841 // |[
3842 // g_dbus_connection_call (connection,
3843 // "org.freedesktop.StringThings",
3844 // "/org/freedesktop/StringThings",
3845 // "org.freedesktop.StringThings",
3846 // "TwoStrings",
3847 // g_variant_new ("(ss)",
3848 // "Thing One",
3849 // "Thing Two"),
3850 // NULL,
3851 // G_DBUS_CALL_FLAGS_NONE,
3852 // -1,
3853 // NULL,
3854 // (GAsyncReadyCallback) two_strings_done,
3855 // NULL);
3856 // ]|
3858 // This is an asynchronous method. When the operation is finished, @callback will be invoked
3859 // in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
3860 // of the thread you are calling this method from. You can then call
3861 // g_dbus_connection_call_finish() to get the result of the operation.
3862 // See g_dbus_connection_call_sync() for the synchronous version of this
3863 // function.
3864 // <bus_name>: A unique or well-known bus name or %NULL if @connection is not a message bus connection.
3865 // <object_path>: Path of remote object.
3866 // <interface_name>: D-Bus interface to invoke method on.
3867 // <method_name>: The name of the method to invoke.
3868 // <parameters>: A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
3869 // <reply_type>: The expected type of the reply, or %NULL.
3870 // <flags>: Flags from the #GDBusCallFlags enumeration.
3871 // <timeout_msec>: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
3872 // <cancellable>: A #GCancellable or %NULL.
3873 // <callback>: A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result of the method invocation.
3874 // <user_data>: The data to pass to @callback.
3875 void call()(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) {
3876 g_dbus_connection_call(&this, bus_name, object_path, interface_name, method_name, parameters, reply_type, flags, timeout_msec, cancellable, callback, user_data);
3879 // VERSION: 2.26
3880 // Finishes an operation started with g_dbus_connection_call().
3882 // return values. Free with g_variant_unref().
3883 // RETURNS: %NULL if @error is set. Otherwise a #GVariant tuple with
3884 // <res>: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_call().
3885 GLib2.Variant* /*new*/ call_finish()(AsyncResult* res, GLib2.Error** error=null) {
3886 return g_dbus_connection_call_finish(&this, res, error);
3889 // VERSION: 2.26
3890 // Synchronously invokes the @method_name method on the
3891 // @interface_name D-Bus interface on the remote object at
3892 // @object_path owned by @bus_name.
3894 // If @connection is closed then the operation will fail with
3895 // %G_IO_ERROR_CLOSED. If @cancellable is canceled, the
3896 // operation will fail with %G_IO_ERROR_CANCELLED. If @parameters
3897 // contains a value not compatible with the D-Bus protocol, the operation
3898 // fails with %G_IO_ERROR_INVALID_ARGUMENT.
3899 // If @reply_type is non-%NULL then the reply will be checked for having
3900 // this type and an error will be raised if it does not match. Said
3901 // another way, if you give a @reply_type then any non-%NULL return
3902 // value will be of this type.
3904 // If the @parameters #GVariant is floating, it is consumed.
3905 // This allows convenient 'inline' use of g_variant_new(), e.g.:
3906 // |[
3907 // g_dbus_connection_call_sync (connection,
3908 // "org.freedesktop.StringThings",
3909 // "/org/freedesktop/StringThings",
3910 // "org.freedesktop.StringThings",
3911 // "TwoStrings",
3912 // g_variant_new ("(ss)",
3913 // "Thing One",
3914 // "Thing Two"),
3915 // NULL,
3916 // G_DBUS_CALL_FLAGS_NONE,
3917 // -1,
3918 // NULL,
3919 // &amp;error);
3920 // ]|
3922 // The calling thread is blocked until a reply is received. See
3923 // g_dbus_connection_call() for the asynchronous version of
3924 // this method.
3926 // return values. Free with g_variant_unref().
3927 // RETURNS: %NULL if @error is set. Otherwise a #GVariant tuple with
3928 // <bus_name>: A unique or well-known bus name.
3929 // <object_path>: Path of remote object.
3930 // <interface_name>: D-Bus interface to invoke method on.
3931 // <method_name>: The name of the method to invoke.
3932 // <parameters>: A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
3933 // <reply_type>: The expected type of the reply, or %NULL.
3934 // <flags>: Flags from the #GDBusCallFlags enumeration.
3935 // <timeout_msec>: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
3936 // <cancellable>: A #GCancellable or %NULL.
3937 GLib2.Variant* /*new*/ call_sync()(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=null) {
3938 return g_dbus_connection_call_sync(&this, bus_name, object_path, interface_name, method_name, parameters, reply_type, flags, timeout_msec, cancellable, error);
3941 // VERSION: 2.30
3942 // Like g_dbus_connection_call() but also takes a #GUnixFDList object.
3944 // This method is only available on UNIX.
3945 // <bus_name>: A unique or well-known bus name or %NULL if @connection is not a message bus connection.
3946 // <object_path>: Path of remote object.
3947 // <interface_name>: D-Bus interface to invoke method on.
3948 // <method_name>: The name of the method to invoke.
3949 // <parameters>: A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
3950 // <reply_type>: The expected type of the reply, or %NULL.
3951 // <flags>: Flags from the #GDBusCallFlags enumeration.
3952 // <timeout_msec>: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
3953 // <fd_list>: A #GUnixFDList or %NULL.
3954 // <cancellable>: A #GCancellable or %NULL.
3955 // <callback>: A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't * care about the result of the method invocation.
3956 // <user_data>: The data to pass to @callback.
3957 void call_with_unix_fd_list()(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) {
3958 g_dbus_connection_call_with_unix_fd_list(&this, bus_name, object_path, interface_name, method_name, parameters, reply_type, flags, timeout_msec, fd_list, cancellable, callback, user_data);
3961 // VERSION: 2.30
3962 // Finishes an operation started with g_dbus_connection_call_with_unix_fd_list().
3964 // return values. Free with g_variant_unref().
3965 // RETURNS: %NULL if @error is set. Otherwise a #GVariant tuple with
3966 // <out_fd_list>: Return location for a #GUnixFDList or %NULL.
3967 // <res>: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_call_with_unix_fd_list().
3968 GLib2.Variant* /*new*/ call_with_unix_fd_list_finish()(/*out*/ UnixFDList** out_fd_list, AsyncResult* res, GLib2.Error** error=null) {
3969 return g_dbus_connection_call_with_unix_fd_list_finish(&this, out_fd_list, res, error);
3972 // VERSION: 2.30
3973 // Like g_dbus_connection_call_sync() but also takes and returns #GUnixFDList objects.
3975 // This method is only available on UNIX.
3977 // return values. Free with g_variant_unref().
3978 // RETURNS: %NULL if @error is set. Otherwise a #GVariant tuple with
3979 // <bus_name>: A unique or well-known bus name.
3980 // <object_path>: Path of remote object.
3981 // <interface_name>: D-Bus interface to invoke method on.
3982 // <method_name>: The name of the method to invoke.
3983 // <parameters>: A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
3984 // <reply_type>: The expected type of the reply, or %NULL.
3985 // <flags>: Flags from the #GDBusCallFlags enumeration.
3986 // <timeout_msec>: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
3987 // <fd_list>: A #GUnixFDList or %NULL.
3988 // <out_fd_list>: Return location for a #GUnixFDList or %NULL.
3989 // <cancellable>: A #GCancellable or %NULL.
3990 GLib2.Variant* /*new*/ call_with_unix_fd_list_sync()(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=null) {
3991 return g_dbus_connection_call_with_unix_fd_list_sync(&this, bus_name, object_path, interface_name, method_name, parameters, reply_type, flags, timeout_msec, fd_list, out_fd_list, cancellable, error);
3994 // VERSION: 2.26
3995 // Closes @connection. Note that this never causes the process to
3996 // exit (this might only happen if the other end of a shared message
3997 // bus connection disconnects, see #GDBusConnection:exit-on-close).
3999 // Once the connection is closed, operations such as sending a message
4000 // will return with the error %G_IO_ERROR_CLOSED. Closing a connection
4001 // will not automatically flush the connection so queued messages may
4002 // be lost. Use g_dbus_connection_flush() if you need such guarantees.
4004 // If @connection is already closed, this method fails with
4005 // %G_IO_ERROR_CLOSED.
4007 // When @connection has been closed, the #GDBusConnection::closed
4008 // signal is emitted in the <link
4009 // linkend="g-main-context-push-thread-default">thread-default main
4010 // loop</link> of the thread that @connection was constructed in.
4012 // This is an asynchronous method. When the operation is finished,
4013 // @callback will be invoked in the <link
4014 // linkend="g-main-context-push-thread-default">thread-default main
4015 // loop</link> of the thread you are calling this method from. You can
4016 // then call g_dbus_connection_close_finish() to get the result of the
4017 // operation. See g_dbus_connection_close_sync() for the synchronous
4018 // version.
4019 // <cancellable>: A #GCancellable or %NULL.
4020 // <callback>: A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result.
4021 // <user_data>: The data to pass to @callback.
4022 void close()(Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
4023 g_dbus_connection_close(&this, cancellable, callback, user_data);
4026 // VERSION: 2.26
4027 // Finishes an operation started with g_dbus_connection_close().
4028 // RETURNS: %TRUE if the operation succeeded, %FALSE if @error is set.
4029 // <res>: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_close().
4030 int close_finish()(AsyncResult* res, GLib2.Error** error=null) {
4031 return g_dbus_connection_close_finish(&this, res, error);
4034 // VERSION: 2.26
4035 // Synchronously closees @connection. The calling thread is blocked
4036 // until this is done. See g_dbus_connection_close() for the
4037 // asynchronous version of this method and more details about what it
4038 // does.
4039 // RETURNS: %TRUE if the operation succeeded, %FALSE if @error is set.
4040 // <cancellable>: A #GCancellable or %NULL.
4041 int close_sync()(Cancellable* cancellable, GLib2.Error** error=null) {
4042 return g_dbus_connection_close_sync(&this, cancellable, error);
4045 // VERSION: 2.26
4046 // Emits a signal.
4048 // If the parameters GVariant is floating, it is consumed.
4050 // This can only fail if @parameters is not compatible with the D-Bus protocol.
4051 // RETURNS: %TRUE unless @error is set.
4052 // <destination_bus_name>: The unique bus name for the destination for the signal or %NULL to emit to all listeners.
4053 // <object_path>: Path of remote object.
4054 // <interface_name>: D-Bus interface to emit a signal on.
4055 // <signal_name>: The name of the signal to emit.
4056 // <parameters>: A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
4057 int emit_signal()(char* destination_bus_name, char* object_path, char* interface_name, char* signal_name, GLib2.Variant* parameters, GLib2.Error** error=null) {
4058 return g_dbus_connection_emit_signal(&this, destination_bus_name, object_path, interface_name, signal_name, parameters, error);
4061 // VERSION: 2.32
4062 // Exports @action_group on @connection at @object_path.
4064 // The implemented D-Bus API should be considered private. It is
4065 // subject to change in the future.
4067 // A given object path can only have one action group exported on it.
4068 // If this constraint is violated, the export will fail and 0 will be
4069 // returned (with @error set accordingly).
4071 // You can unexport the action group using
4072 // g_dbus_connection_unexport_action_group() with the return value of
4073 // this function.
4075 // The thread default main context is taken at the time of this call.
4076 // All incoming action activations and state change requests are
4077 // reported from this context. Any changes on the action group that
4078 // cause it to emit signals must also come from this same context.
4079 // Since incoming action activations and state change requests are
4080 // rather likely to cause changes on the action group, this effectively
4081 // limits a given action group to being exported from only one main
4082 // context.
4083 // RETURNS: the ID of the export (never zero), or 0 in case of failure
4084 // <object_path>: a D-Bus object path
4085 // <action_group>: a #GActionGroup
4086 uint export_action_group()(char* object_path, ActionGroup* action_group, GLib2.Error** error=null) {
4087 return g_dbus_connection_export_action_group(&this, object_path, action_group, error);
4090 // VERSION: 2.32
4091 // Exports @menu on @connection at @object_path.
4093 // The implemented D-Bus API should be considered private.
4094 // It is subject to change in the future.
4096 // An object path can only have one action group exported on it. If this
4097 // constraint is violated, the export will fail and 0 will be
4098 // returned (with @error set accordingly).
4100 // You can unexport the menu model using
4101 // g_dbus_connection_unexport_menu_model() with the return value of
4102 // this function.
4103 // RETURNS: the ID of the export (never zero), or 0 in case of failure
4104 // <object_path>: a D-Bus object path
4105 // <menu>: a #GMenuModel
4106 uint export_menu_model()(char* object_path, MenuModel* menu, GLib2.Error** error=null) {
4107 return g_dbus_connection_export_menu_model(&this, object_path, menu, error);
4110 // VERSION: 2.26
4111 // Asynchronously flushes @connection, that is, writes all queued
4112 // outgoing message to the transport and then flushes the transport
4113 // (using g_output_stream_flush_async()). This is useful in programs
4114 // that wants to emit a D-Bus signal and then exit
4115 // immediately. Without flushing the connection, there is no guarantee
4116 // that the message has been sent to the networking buffers in the OS
4117 // kernel.
4119 // This is an asynchronous method. When the operation is finished,
4120 // @callback will be invoked in the <link
4121 // linkend="g-main-context-push-thread-default">thread-default main
4122 // loop</link> of the thread you are calling this method from. You can
4123 // then call g_dbus_connection_flush_finish() to get the result of the
4124 // operation. See g_dbus_connection_flush_sync() for the synchronous
4125 // version.
4126 // <cancellable>: A #GCancellable or %NULL.
4127 // <callback>: A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result.
4128 // <user_data>: The data to pass to @callback.
4129 void flush()(Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
4130 g_dbus_connection_flush(&this, cancellable, callback, user_data);
4133 // VERSION: 2.26
4134 // Finishes an operation started with g_dbus_connection_flush().
4135 // RETURNS: %TRUE if the operation succeeded, %FALSE if @error is set.
4136 // <res>: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_flush().
4137 int flush_finish()(AsyncResult* res, GLib2.Error** error=null) {
4138 return g_dbus_connection_flush_finish(&this, res, error);
4141 // VERSION: 2.26
4142 // Synchronously flushes @connection. The calling thread is blocked
4143 // until this is done. See g_dbus_connection_flush() for the
4144 // asynchronous version of this method and more details about what it
4145 // does.
4146 // RETURNS: %TRUE if the operation succeeded, %FALSE if @error is set.
4147 // <cancellable>: A #GCancellable or %NULL.
4148 int flush_sync()(Cancellable* cancellable, GLib2.Error** error=null) {
4149 return g_dbus_connection_flush_sync(&this, cancellable, error);
4152 // VERSION: 2.26
4153 // Gets the capabilities negotiated with the remote peer
4154 // RETURNS: Zero or more flags from the #GDBusCapabilityFlags enumeration.
4155 DBusCapabilityFlags get_capabilities()() {
4156 return g_dbus_connection_get_capabilities(&this);
4159 // VERSION: 2.26
4160 // Gets whether the process is terminated when @connection is
4161 // closed by the remote peer. See
4162 // #GDBusConnection:exit-on-close for more details.
4164 // closed by the remote peer.
4165 // RETURNS: Whether the process is terminated when @connection is
4166 int get_exit_on_close()() {
4167 return g_dbus_connection_get_exit_on_close(&this);
4170 // VERSION: 2.26
4171 // The GUID of the peer performing the role of server when
4172 // authenticating. See #GDBusConnection:guid for more details.
4174 // @connection.
4175 // RETURNS: The GUID. Do not free this string, it is owned by
4176 char* get_guid()() {
4177 return g_dbus_connection_get_guid(&this);
4180 // VERSION: 2.26
4181 // Gets the credentials of the authenticated peer. This will always
4182 // return %NULL unless @connection acted as a server
4183 // (e.g. %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER was passed)
4184 // when set up and the client passed credentials as part of the
4185 // authentication process.
4187 // In a message bus setup, the message bus is always the server and
4188 // each application is a client. So this method will always return
4189 // %NULL for message bus clients.
4191 // this object, it is owned by @connection.
4192 // RETURNS: A #GCredentials or %NULL if not available. Do not free
4193 Credentials* get_peer_credentials()() {
4194 return g_dbus_connection_get_peer_credentials(&this);
4197 // VERSION: 2.26
4198 // Gets the underlying stream used for IO.
4200 // While the #GDBusConnection is active, it will interact with this
4201 // stream from a worker thread, so it is not safe to interact with
4202 // the stream directly.
4203 // RETURNS: the stream used for IO
4204 IOStream* get_stream()() {
4205 return g_dbus_connection_get_stream(&this);
4208 // VERSION: 2.26
4209 // Gets the unique name of @connection as assigned by the message
4210 // bus. This can also be used to figure out if @connection is a
4211 // message bus connection.
4213 // bus connection. Do not free this string, it is owned by
4214 // @connection.
4215 // RETURNS: The unique name or %NULL if @connection is not a message
4216 char* get_unique_name()() {
4217 return g_dbus_connection_get_unique_name(&this);
4220 // VERSION: 2.26
4221 // Gets whether @connection is closed.
4222 // RETURNS: %TRUE if the connection is closed, %FALSE otherwise.
4223 int is_closed()() {
4224 return g_dbus_connection_is_closed(&this);
4227 // VERSION: 2.26
4228 // Registers callbacks for exported objects at @object_path with the
4229 // D-Bus interface that is described in @interface_info.
4231 // Calls to functions in @vtable (and @user_data_free_func) will
4232 // happen in the <link linkend="g-main-context-push-thread-default">thread-default main
4233 // loop</link> of the thread you are calling this method from.
4235 // Note that all #GVariant values passed to functions in @vtable will match
4236 // the signature given in @interface_info - if a remote caller passes
4237 // incorrect values, the <literal>org.freedesktop.DBus.Error.InvalidArgs</literal>
4238 // is returned to the remote caller.
4240 // Additionally, if the remote caller attempts to invoke methods or
4241 // access properties not mentioned in @interface_info the
4242 // <literal>org.freedesktop.DBus.Error.UnknownMethod</literal> resp.
4243 // <literal>org.freedesktop.DBus.Error.InvalidArgs</literal> errors
4244 // are returned to the caller.
4246 // It is considered a programming error if the
4247 // #GDBusInterfaceGetPropertyFunc function in @vtable returns a
4248 // #GVariant of incorrect type.
4250 // If an existing callback is already registered at @object_path and
4251 // @interface_name, then @error is set to #G_IO_ERROR_EXISTS.
4253 // GDBus automatically implements the standard D-Bus interfaces
4254 // org.freedesktop.DBus.Properties, org.freedesktop.DBus.Introspectable
4255 // and org.freedesktop.Peer, so you don't have to implement those for
4256 // the objects you export. You <emphasis>can</emphasis> implement
4257 // org.freedesktop.DBus.Properties yourself, e.g. to handle getting
4258 // and setting of properties asynchronously.
4260 // Note that the reference count on @interface_info will be
4261 // incremented by 1 (unless allocated statically, e.g. if the
4262 // reference count is -1, see g_dbus_interface_info_ref()) for as long
4263 // as the object is exported. Also note that @vtable will be copied.
4265 // See <xref linkend="gdbus-server"/> for an example of how to use this method.
4267 // that can be used with g_dbus_connection_unregister_object() .
4268 // RETURNS: 0 if @error is set, otherwise a registration id (never 0)
4269 // <object_path>: The object path to register at.
4270 // <interface_info>: Introspection data for the interface.
4271 // <vtable>: A #GDBusInterfaceVTable to call into or %NULL.
4272 // <user_data>: Data to pass to functions in @vtable.
4273 // <user_data_free_func>: Function to call when the object path is unregistered.
4274 uint register_object()(char* object_path, DBusInterfaceInfo* interface_info, DBusInterfaceVTable* vtable, void* user_data, GLib2.DestroyNotify user_data_free_func, GLib2.Error** error=null) {
4275 return g_dbus_connection_register_object(&this, object_path, interface_info, vtable, user_data, user_data_free_func, error);
4278 // VERSION: 2.26
4279 // Registers a whole subtree of <quote>dynamic</quote> objects.
4281 // The @enumerate and @introspection functions in @vtable are used to
4282 // convey, to remote callers, what nodes exist in the subtree rooted
4283 // by @object_path.
4285 // When handling remote calls into any node in the subtree, first the
4286 // @enumerate function is used to check if the node exists. If the node exists
4287 // or the #G_DBUS_SUBTREE_FLAGS_DISPATCH_TO_UNENUMERATED_NODES flag is set
4288 // the @introspection function is used to check if the node supports the
4289 // requested method. If so, the @dispatch function is used to determine
4290 // where to dispatch the call. The collected #GDBusInterfaceVTable and
4291 // #gpointer will be used to call into the interface vtable for processing
4292 // the request.
4294 // All calls into user-provided code will be invoked in the <link
4295 // linkend="g-main-context-push-thread-default">thread-default main
4296 // loop</link> of the thread you are calling this method from.
4298 // If an existing subtree is already registered at @object_path or
4299 // then @error is set to #G_IO_ERROR_EXISTS.
4301 // Note that it is valid to register regular objects (using
4302 // g_dbus_connection_register_object()) in a subtree registered with
4303 // g_dbus_connection_register_subtree() - if so, the subtree handler
4304 // is tried as the last resort. One way to think about a subtree
4305 // handler is to consider it a <quote>fallback handler</quote>
4306 // for object paths not registered via g_dbus_connection_register_object()
4307 // or other bindings.
4309 // Note that @vtable will be copied so you cannot change it after
4310 // registration.
4312 // See <xref linkend="gdbus-subtree-server"/> for an example of how to use this method.
4314 // that can be used with g_dbus_connection_unregister_subtree() .
4315 // RETURNS: 0 if @error is set, otherwise a subtree registration id (never 0)
4316 // <object_path>: The object path to register the subtree at.
4317 // <vtable>: A #GDBusSubtreeVTable to enumerate, introspect and dispatch nodes in the subtree.
4318 // <flags>: Flags used to fine tune the behavior of the subtree.
4319 // <user_data>: Data to pass to functions in @vtable.
4320 // <user_data_free_func>: Function to call when the subtree is unregistered.
4321 uint register_subtree()(char* object_path, DBusSubtreeVTable* vtable, DBusSubtreeFlags flags, void* user_data, GLib2.DestroyNotify user_data_free_func, GLib2.Error** error=null) {
4322 return g_dbus_connection_register_subtree(&this, object_path, vtable, flags, user_data, user_data_free_func, error);
4325 // VERSION: 2.26
4326 // Removes a filter.
4327 // <filter_id>: an identifier obtained from g_dbus_connection_add_filter()
4328 void remove_filter()(uint filter_id) {
4329 g_dbus_connection_remove_filter(&this, filter_id);
4332 // VERSION: 2.26
4333 // Asynchronously sends @message to the peer represented by @connection.
4335 // Unless @flags contain the
4336 // %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number
4337 // will be assigned by @connection and set on @message via
4338 // g_dbus_message_set_serial(). If @out_serial is not %NULL, then the
4339 // serial number used will be written to this location prior to
4340 // submitting the message to the underlying transport.
4342 // If @connection is closed then the operation will fail with
4343 // %G_IO_ERROR_CLOSED. If @message is not well-formed,
4344 // the operation fails with %G_IO_ERROR_INVALID_ARGUMENT.
4346 // See <xref linkend="gdbus-server"/> and <xref
4347 // linkend="gdbus-unix-fd-client"/> for an example of how to use this
4348 // low-level API to send and receive UNIX file descriptors.
4350 // Note that @message must be unlocked, unless @flags contain the
4351 // %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
4353 // transmission, %FALSE if @error is set.
4354 // RETURNS: %TRUE if the message was well-formed and queued for
4355 // <message>: A #GDBusMessage
4356 // <flags>: Flags affecting how the message is sent.
4357 // <out_serial>: Return location for serial number assigned to @message when sending it or %NULL.
4358 int send_message()(DBusMessage* message, DBusSendMessageFlags flags, /*out*/ uint* out_serial, GLib2.Error** error=null) {
4359 return g_dbus_connection_send_message(&this, message, flags, out_serial, error);
4362 // VERSION: 2.26
4363 // Asynchronously sends @message to the peer represented by @connection.
4365 // Unless @flags contain the
4366 // %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number
4367 // will be assigned by @connection and set on @message via
4368 // g_dbus_message_set_serial(). If @out_serial is not %NULL, then the
4369 // serial number used will be written to this location prior to
4370 // submitting the message to the underlying transport.
4372 // If @connection is closed then the operation will fail with
4373 // %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will
4374 // fail with %G_IO_ERROR_CANCELLED. If @message is not well-formed,
4375 // the operation fails with %G_IO_ERROR_INVALID_ARGUMENT.
4377 // This is an asynchronous method. When the operation is finished, @callback will be invoked
4378 // in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
4379 // of the thread you are calling this method from. You can then call
4380 // g_dbus_connection_send_message_with_reply_finish() to get the result of the operation.
4381 // See g_dbus_connection_send_message_with_reply_sync() for the synchronous version.
4383 // Note that @message must be unlocked, unless @flags contain the
4384 // %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
4386 // See <xref linkend="gdbus-server"/> and <xref
4387 // linkend="gdbus-unix-fd-client"/> for an example of how to use this
4388 // low-level API to send and receive UNIX file descriptors.
4389 // <message>: A #GDBusMessage.
4390 // <flags>: Flags affecting how the message is sent.
4391 // <timeout_msec>: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
4392 // <out_serial>: Return location for serial number assigned to @message when sending it or %NULL.
4393 // <cancellable>: A #GCancellable or %NULL.
4394 // <callback>: A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result.
4395 // <user_data>: The data to pass to @callback.
4396 void send_message_with_reply()(DBusMessage* message, DBusSendMessageFlags flags, int timeout_msec, /*out*/ uint* out_serial, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
4397 g_dbus_connection_send_message_with_reply(&this, message, flags, timeout_msec, out_serial, cancellable, callback, user_data);
4400 // VERSION: 2.26
4401 // Finishes an operation started with g_dbus_connection_send_message_with_reply().
4403 // Note that @error is only set if a local in-process error
4404 // occurred. That is to say that the returned #GDBusMessage object may
4405 // be of type %G_DBUS_MESSAGE_TYPE_ERROR. Use
4406 // g_dbus_message_to_gerror() to transcode this to a #GError.
4408 // See <xref linkend="gdbus-server"/> and <xref
4409 // linkend="gdbus-unix-fd-client"/> for an example of how to use this
4410 // low-level API to send and receive UNIX file descriptors.
4411 // RETURNS: A locked #GDBusMessage or %NULL if @error is set.
4412 // <res>: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_send_message_with_reply().
4413 DBusMessage* /*new*/ send_message_with_reply_finish()(AsyncResult* res, GLib2.Error** error=null) {
4414 return g_dbus_connection_send_message_with_reply_finish(&this, res, error);
4417 // VERSION: 2.26
4418 // Synchronously sends @message to the peer represented by @connection
4419 // and blocks the calling thread until a reply is received or the
4420 // timeout is reached. See g_dbus_connection_send_message_with_reply()
4421 // for the asynchronous version of this method.
4423 // Unless @flags contain the
4424 // %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number
4425 // will be assigned by @connection and set on @message via
4426 // g_dbus_message_set_serial(). If @out_serial is not %NULL, then the
4427 // serial number used will be written to this location prior to
4428 // submitting the message to the underlying transport.
4430 // If @connection is closed then the operation will fail with
4431 // %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will
4432 // fail with %G_IO_ERROR_CANCELLED. If @message is not well-formed,
4433 // the operation fails with %G_IO_ERROR_INVALID_ARGUMENT.
4435 // Note that @error is only set if a local in-process error
4436 // occurred. That is to say that the returned #GDBusMessage object may
4437 // be of type %G_DBUS_MESSAGE_TYPE_ERROR. Use
4438 // g_dbus_message_to_gerror() to transcode this to a #GError.
4440 // See <xref linkend="gdbus-server"/> and <xref
4441 // linkend="gdbus-unix-fd-client"/> for an example of how to use this
4442 // low-level API to send and receive UNIX file descriptors.
4444 // Note that @message must be unlocked, unless @flags contain the
4445 // %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
4446 // RETURNS: A locked #GDBusMessage that is the reply to @message or %NULL if @error is set.
4447 // <message>: A #GDBusMessage.
4448 // <flags>: Flags affecting how the message is sent.
4449 // <timeout_msec>: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
4450 // <out_serial>: Return location for serial number assigned to @message when sending it or %NULL.
4451 // <cancellable>: A #GCancellable or %NULL.
4452 DBusMessage* /*new*/ send_message_with_reply_sync()(DBusMessage* message, DBusSendMessageFlags flags, int timeout_msec, /*out*/ uint* out_serial, Cancellable* cancellable, GLib2.Error** error=null) {
4453 return g_dbus_connection_send_message_with_reply_sync(&this, message, flags, timeout_msec, out_serial, cancellable, error);
4456 // VERSION: 2.26
4457 // Sets whether the process should be terminated when @connection is
4458 // closed by the remote peer. See #GDBusConnection:exit-on-close for
4459 // more details.
4461 // Note that this function should be used with care. Most modern UNIX
4462 // desktops tie the notion of a user session the session bus, and expect
4463 // all of a users applications to quit when their bus connection goes away.
4464 // If you are setting @exit_on_close to %FALSE for the shared session
4465 // bus connection, you should make sure that your application exits
4466 // when the user session ends.
4467 // <exit_on_close>: Whether the process should be terminated when @connection is closed by the remote peer.
4468 void set_exit_on_close()(int exit_on_close) {
4469 g_dbus_connection_set_exit_on_close(&this, exit_on_close);
4472 // VERSION: 2.26
4473 // Subscribes to signals on @connection and invokes @callback with a
4474 // whenever the signal is received. Note that @callback
4475 // will be invoked in the <link
4476 // linkend="g-main-context-push-thread-default">thread-default main
4477 // loop</link> of the thread you are calling this method from.
4479 // If @connection is not a message bus connection, @sender must be
4480 // %NULL.
4482 // If @sender is a well-known name note that @callback is invoked with
4483 // the unique name for the owner of @sender, not the well-known name
4484 // as one would expect. This is because the message bus rewrites the
4485 // name. As such, to avoid certain race conditions, users should be
4486 // tracking the name owner of the well-known name and use that when
4487 // processing the received signal.
4488 // RETURNS: A subscription identifier that can be used with g_dbus_connection_signal_unsubscribe().
4489 // <sender>: Sender name to match on (unique or well-known name) or %NULL to listen from all senders.
4490 // <interface_name>: D-Bus interface name to match on or %NULL to match on all interfaces.
4491 // <member>: D-Bus signal name to match on or %NULL to match on all signals.
4492 // <object_path>: Object path to match on or %NULL to match on all object paths.
4493 // <arg0>: Contents of first string argument to match on or %NULL to match on all kinds of arguments.
4494 // <flags>: Flags describing how to subscribe to the signal (currently unused).
4495 // <callback>: Callback to invoke when there is a signal matching the requested data.
4496 // <user_data>: User data to pass to @callback.
4497 // <user_data_free_func>: Function to free @user_data with when subscription is removed or %NULL.
4498 uint signal_subscribe()(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) {
4499 return g_dbus_connection_signal_subscribe(&this, sender, interface_name, member, object_path, arg0, flags, callback, user_data, user_data_free_func);
4502 // VERSION: 2.26
4503 // Unsubscribes from signals.
4504 // <subscription_id>: A subscription id obtained from g_dbus_connection_signal_subscribe().
4505 void signal_unsubscribe()(uint subscription_id) {
4506 g_dbus_connection_signal_unsubscribe(&this, subscription_id);
4509 // VERSION: 2.26
4510 // If @connection was created with
4511 // %G_DBUS_CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING, this method
4512 // starts processing messages. Does nothing on if @connection wasn't
4513 // created with this flag or if the method has already been called.
4514 void start_message_processing()() {
4515 g_dbus_connection_start_message_processing(&this);
4518 // VERSION: 2.32
4519 // Reverses the effect of a previous call to
4520 // g_dbus_connection_export_action_group().
4522 // It is an error to call this function with an ID that wasn't returned
4523 // from g_dbus_connection_export_action_group() or to call it with the
4524 // same ID more than once.
4525 // <export_id>: the ID from g_dbus_connection_export_action_group()
4526 void unexport_action_group()(uint export_id) {
4527 g_dbus_connection_unexport_action_group(&this, export_id);
4530 // VERSION: 2.32
4531 // Reverses the effect of a previous call to
4532 // g_dbus_connection_export_menu_model().
4534 // It is an error to call this function with an ID that wasn't returned
4535 // from g_dbus_connection_export_menu_model() or to call it with the
4536 // same ID more than once.
4537 // <export_id>: the ID from g_dbus_connection_export_menu_model()
4538 void unexport_menu_model()(uint export_id) {
4539 g_dbus_connection_unexport_menu_model(&this, export_id);
4542 // VERSION: 2.26
4543 // Unregisters an object.
4544 // RETURNS: %TRUE if the object was unregistered, %FALSE otherwise.
4545 // <registration_id>: A registration id obtained from g_dbus_connection_register_object().
4546 int unregister_object()(uint registration_id) {
4547 return g_dbus_connection_unregister_object(&this, registration_id);
4550 // VERSION: 2.26
4551 // Unregisters a subtree.
4552 // RETURNS: %TRUE if the subtree was unregistered, %FALSE otherwise.
4553 // <registration_id>: A subtree registration id obtained from g_dbus_connection_register_subtree().
4554 int unregister_subtree()(uint registration_id) {
4555 return g_dbus_connection_unregister_subtree(&this, registration_id);
4558 // VERSION: 2.26
4559 // Emitted when the connection is closed.
4561 // The cause of this event can be
4562 // <itemizedlist>
4563 // <listitem><para>
4564 // If g_dbus_connection_close() is called. In this case
4565 // @remote_peer_vanished is set to %FALSE and @error is %NULL.
4566 // </para></listitem>
4567 // <listitem><para>
4568 // If the remote peer closes the connection. In this case
4569 // @remote_peer_vanished is set to %TRUE and @error is set.
4570 // </para></listitem>
4571 // <listitem><para>
4572 // If the remote peer sends invalid or malformed data. In this
4573 // case @remote_peer_vanished is set to %FALSE and @error
4574 // is set.
4575 // </para></listitem>
4576 // </itemizedlist>
4578 // Upon receiving this signal, you should give up your reference to
4579 // @connection. You are guaranteed that this signal is emitted only
4580 // once.
4581 // <remote_peer_vanished>: %TRUE if @connection is closed because the remote peer closed its end of the connection.
4582 // <error>: A #GError with more details about the event or %NULL.
4583 extern (C) alias static void function (DBusConnection* this_, c_int remote_peer_vanished, GLib2.Error* error, void* user_data=null) signal_closed;
4585 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
4586 return super_.signal_connect!name(cb, data, cf);
4589 ulong signal_connect(string name:"closed", CB:signal_closed)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
4590 return signal_connect_data!()(&this, cast(char*)"closed",
4591 cast(GObject2.Callback)cb, data, null, cf);
4595 // Flags used when creating a new #GDBusConnection.
4596 enum DBusConnectionFlags /* Version 2.26 */ {
4597 NONE = 0,
4598 AUTHENTICATION_CLIENT = 1,
4599 AUTHENTICATION_SERVER = 2,
4600 AUTHENTICATION_ALLOW_ANONYMOUS = 4,
4601 MESSAGE_BUS_CONNECTION = 8,
4602 DELAY_MESSAGE_PROCESSING = 16
4605 // Certain timeout errors, e.g. while starting a service. Warning: this is
4606 // Error codes for the %G_DBUS_ERROR error domain.
4607 enum DBusError /* Version 2.26 */ {
4608 FAILED = 0,
4609 NO_MEMORY = 1,
4610 SERVICE_UNKNOWN = 2,
4611 NAME_HAS_NO_OWNER = 3,
4612 NO_REPLY = 4,
4613 IO_ERROR = 5,
4614 BAD_ADDRESS = 6,
4615 NOT_SUPPORTED = 7,
4616 LIMITS_EXCEEDED = 8,
4617 ACCESS_DENIED = 9,
4618 AUTH_FAILED = 10,
4619 NO_SERVER = 11,
4620 TIMEOUT = 12,
4621 NO_NETWORK = 13,
4622 ADDRESS_IN_USE = 14,
4623 DISCONNECTED = 15,
4624 INVALID_ARGS = 16,
4625 FILE_NOT_FOUND = 17,
4626 FILE_EXISTS = 18,
4627 UNKNOWN_METHOD = 19,
4628 TIMED_OUT = 20,
4629 MATCH_RULE_NOT_FOUND = 21,
4630 MATCH_RULE_INVALID = 22,
4631 SPAWN_EXEC_FAILED = 23,
4632 SPAWN_FORK_FAILED = 24,
4633 SPAWN_CHILD_EXITED = 25,
4634 SPAWN_CHILD_SIGNALED = 26,
4635 SPAWN_FAILED = 27,
4636 SPAWN_SETUP_FAILED = 28,
4637 SPAWN_CONFIG_INVALID = 29,
4638 SPAWN_SERVICE_INVALID = 30,
4639 SPAWN_SERVICE_NOT_FOUND = 31,
4640 SPAWN_PERMISSIONS_INVALID = 32,
4641 SPAWN_FILE_INVALID = 33,
4642 SPAWN_NO_MEMORY = 34,
4643 UNIX_PROCESS_ID_UNKNOWN = 35,
4644 INVALID_SIGNATURE = 36,
4645 INVALID_FILE_CONTENT = 37,
4646 SELINUX_SECURITY_CONTEXT_UNKNOWN = 38,
4647 ADT_AUDIT_DATA_UNKNOWN = 39,
4648 OBJECT_PATH_IN_USE = 40
4650 // Struct used in g_dbus_error_register_error_domain().
4651 struct DBusErrorEntry /* Version 2.26 */ {
4652 int error_code;
4653 char* dbus_error_name;
4657 // The #GDBusInterface type is the base type for D-Bus interfaces both
4658 // on the service side (see #GDBusInterfaceSkeleton) and client side
4659 // (see #GDBusProxy).
4660 struct DBusInterface /* Interface */ /* Version 2.30 */ {
4661 mixin template __interface__() { // Unintrospectable method: dup_object() / g_dbus_interface_dup_object()
4662 DBusObject* dup_object()() {
4663 return g_dbus_interface_dup_object(cast(DBusInterface*)&this);
4666 // VERSION: 2.30
4667 // Gets D-Bus introspection information for the D-Bus interface
4668 // implemented by @interface_.
4669 // RETURNS: A #GDBusInterfaceInfo. Do not free.
4670 DBusInterfaceInfo* get_info()() {
4671 return g_dbus_interface_get_info(cast(DBusInterface*)&this);
4674 // VERSION: 2.30
4675 // Gets the #GDBusObject that @interface_ belongs to, if any.
4677 // reference belongs to @interface_ and should not be freed.
4678 // RETURNS: A #GDBusObject or %NULL. The returned
4679 DBusObject* get_object()() {
4680 return g_dbus_interface_get_object(cast(DBusInterface*)&this);
4683 // VERSION: 2.30
4684 // Sets the #GDBusObject for @interface_ to @object.
4686 // Note that @interface_ will hold a weak reference to @object.
4687 // <object>: A #GDBusObject or %NULL.
4688 void set_object()(DBusObject* object) {
4689 g_dbus_interface_set_object(cast(DBusInterface*)&this, object);
4692 mixin __interface__;
4696 // VERSION: 2.26
4697 // The type of the @get_property function in #GDBusInterfaceVTable.
4699 // @error is set. If the returned #GVariant is floating, it is
4700 // consumed - otherwise its reference count is decreased by one.
4701 // RETURNS: A #GVariant with the value for @property_name or %NULL if
4702 // <connection>: A #GDBusConnection.
4703 // <sender>: The unique bus name of the remote caller.
4704 // <object_path>: The object path that the method was invoked on.
4705 // <interface_name>: The D-Bus interface name for the property.
4706 // <property_name>: The name of the property to get the value of.
4707 // <error>: Return location for error.
4708 // <user_data>: The @user_data #gpointer passed to g_dbus_connection_register_object().
4709 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) DBusInterfaceGetPropertyFunc;
4711 // Base type for D-Bus interfaces.
4712 struct DBusInterfaceIface /* Version 2.30 */ {
4713 GObject2.TypeInterface parent_iface;
4714 // RETURNS: A #GDBusInterfaceInfo. Do not free.
4715 extern (C) DBusInterfaceInfo* function (DBusInterface* interface_) get_info;
4716 // RETURNS: A #GDBusObject or %NULL. The returned
4717 extern (C) DBusObject* function (DBusInterface* interface_) get_object;
4718 // <object>: A #GDBusObject or %NULL.
4719 extern (C) void function (DBusInterface* interface_, DBusObject* object) set_object;
4720 // Unintrospectable functionp: dup_object() / ()
4721 extern (C) DBusObject* function (DBusInterface* interface_) dup_object;
4724 // Information about a D-Bus interface.
4725 struct DBusInterfaceInfo /* Version 2.26 */ {
4726 int ref_count;
4727 char* name;
4728 DBusMethodInfo*[666] methods;
4729 DBusSignalInfo*[666] signals;
4730 DBusPropertyInfo*[666] properties;
4731 DBusAnnotationInfo*[666] annotations;
4734 // VERSION: 2.30
4735 // Builds a lookup-cache to speed up
4736 // g_dbus_interface_info_lookup_method(),
4737 // g_dbus_interface_info_lookup_signal() and
4738 // g_dbus_interface_info_lookup_property().
4740 // If this has already been called with @info, the existing cache is
4741 // used and its use count is increased.
4743 // Note that @info cannot be modified until
4744 // g_dbus_interface_info_cache_release() is called.
4745 void cache_build()() {
4746 g_dbus_interface_info_cache_build(&this);
4749 // VERSION: 2.30
4750 // Decrements the usage count for the cache for @info built by
4751 // g_dbus_interface_info_cache_build() (if any) and frees the
4752 // resources used by the cache if the usage count drops to zero.
4753 void cache_release()() {
4754 g_dbus_interface_info_cache_release(&this);
4757 // VERSION: 2.26
4758 // Appends an XML representation of @info (and its children) to @string_builder.
4760 // This function is typically used for generating introspection XML
4761 // documents at run-time for handling the
4762 // <literal>org.freedesktop.DBus.Introspectable.Introspect</literal>
4763 // method.
4764 // <indent>: Indentation level.
4765 // <string_builder>: A #GString to to append XML data to.
4766 void generate_xml()(uint indent, /*out*/ GLib2.String* string_builder) {
4767 g_dbus_interface_info_generate_xml(&this, indent, string_builder);
4770 // VERSION: 2.26
4771 // Looks up information about a method.
4773 // This cost of this function is O(n) in number of methods unless
4774 // g_dbus_interface_info_cache_build() has been used on @info.
4775 // RETURNS: A #GDBusMethodInfo or %NULL if not found. Do not free, it is owned by @info.
4776 // <name>: A D-Bus method name (typically in CamelCase)
4777 DBusMethodInfo* lookup_method()(char* name) {
4778 return g_dbus_interface_info_lookup_method(&this, name);
4781 // VERSION: 2.26
4782 // Looks up information about a property.
4784 // This cost of this function is O(n) in number of properties unless
4785 // g_dbus_interface_info_cache_build() has been used on @info.
4786 // RETURNS: A #GDBusPropertyInfo or %NULL if not found. Do not free, it is owned by @info.
4787 // <name>: A D-Bus property name (typically in CamelCase).
4788 DBusPropertyInfo* lookup_property()(char* name) {
4789 return g_dbus_interface_info_lookup_property(&this, name);
4792 // VERSION: 2.26
4793 // Looks up information about a signal.
4795 // This cost of this function is O(n) in number of signals unless
4796 // g_dbus_interface_info_cache_build() has been used on @info.
4797 // RETURNS: A #GDBusSignalInfo or %NULL if not found. Do not free, it is owned by @info.
4798 // <name>: A D-Bus signal name (typically in CamelCase)
4799 DBusSignalInfo* lookup_signal()(char* name) {
4800 return g_dbus_interface_info_lookup_signal(&this, name);
4803 // VERSION: 2.26
4804 // If @info is statically allocated does nothing. Otherwise increases
4805 // the reference count.
4806 // RETURNS: The same @info.
4807 DBusInterfaceInfo* /*new*/ ref_()() {
4808 return g_dbus_interface_info_ref(&this);
4811 // VERSION: 2.26
4812 // If @info is statically allocated, does nothing. Otherwise decreases
4813 // the reference count of @info. When its reference count drops to 0,
4814 // the memory used is freed.
4815 void unref()() {
4816 g_dbus_interface_info_unref(&this);
4821 // VERSION: 2.26
4822 // The type of the @method_call function in #GDBusInterfaceVTable.
4823 // <connection>: A #GDBusConnection.
4824 // <sender>: The unique bus name of the remote caller.
4825 // <object_path>: The object path that the method was invoked on.
4826 // <interface_name>: The D-Bus interface name the method was invoked on.
4827 // <method_name>: The name of the method that was invoked.
4828 // <parameters>: A #GVariant tuple with parameters.
4829 // <invocation>: A #GDBusMethodInvocation object that can be used to return a value or error.
4830 // <user_data>: The @user_data #gpointer passed to g_dbus_connection_register_object().
4831 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) DBusInterfaceMethodCallFunc;
4834 // VERSION: 2.26
4835 // The type of the @set_property function in #GDBusInterfaceVTable.
4836 // RETURNS: %TRUE if the property was set to @value, %FALSE if @error is set.
4837 // <connection>: A #GDBusConnection.
4838 // <sender>: The unique bus name of the remote caller.
4839 // <object_path>: The object path that the method was invoked on.
4840 // <interface_name>: The D-Bus interface name for the property.
4841 // <property_name>: The name of the property to get the value of.
4842 // <value>: The value to set the property to.
4843 // <error>: Return location for error.
4844 // <user_data>: The @user_data #gpointer passed to g_dbus_connection_register_object().
4845 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) DBusInterfaceSetPropertyFunc;
4847 // Abstract base class for D-Bus interfaces on the service side.
4848 struct DBusInterfaceSkeleton /* : GObject.Object */ /* Version 2.30 */ {
4849 mixin DBusInterface.__interface__;
4850 alias parent_instance this;
4851 alias parent_instance super_;
4852 alias parent_instance object;
4853 GObject2.Object parent_instance;
4854 private DBusInterfaceSkeletonPrivate* priv;
4857 // VERSION: 2.30
4858 // Exports @interface_ at @object_path on @connection.
4860 // This can be called multiple times to export the same @interface_
4861 // onto multiple connections however the @object_path provided must be
4862 // the same for all connections.
4864 // Use g_dbus_interface_skeleton_unexport() to unexport the object.
4866 // @error set.
4867 // RETURNS: %TRUE if the interface was exported on @connection, otherwise %FALSE with
4868 // <connection>: A #GDBusConnection to export @interface_ on.
4869 // <object_path>: The path to export the interface at.
4870 int export_()(DBusConnection* connection, char* object_path, GLib2.Error** error=null) {
4871 return g_dbus_interface_skeleton_export(&this, connection, object_path, error);
4874 // VERSION: 2.30
4875 // If @interface_ has outstanding changes, request for these changes to be
4876 // emitted immediately.
4878 // For example, an exported D-Bus interface may queue up property
4879 // changes and emit the
4880 // <literal>org.freedesktop.DBus.Properties::PropertiesChanged</literal>
4881 // signal later (e.g. in an idle handler). This technique is useful
4882 // for collapsing multiple property changes into one.
4883 void flush()() {
4884 g_dbus_interface_skeleton_flush(&this);
4887 // VERSION: 2.30
4888 // Gets the first connection that @interface_ is exported on, if any.
4890 // not exported anywhere. Do not free, the object belongs to @interface_.
4891 // RETURNS: A #GDBusConnection or %NULL if @interface_ is
4892 DBusConnection* get_connection()() {
4893 return g_dbus_interface_skeleton_get_connection(&this);
4896 // VERSION: 2.32
4897 // Gets a list of the connections that @interface_ is exported on.
4899 // all the connections that @interface_ is exported on. The returned
4900 // list should be freed with g_list_free() after each element has
4901 // been freed with g_object_unref().
4902 // RETURNS: A list of
4903 GLib2.List* /*new*/ get_connections()() {
4904 return g_dbus_interface_skeleton_get_connections(&this);
4907 // VERSION: 2.30
4908 // Gets the #GDBusInterfaceSkeletonFlags that describes what the behavior
4909 // of @interface_
4910 // RETURNS: One or more flags from the #GDBusInterfaceSkeletonFlags enumeration.
4911 DBusInterfaceSkeletonFlags get_flags()() {
4912 return g_dbus_interface_skeleton_get_flags(&this);
4915 // VERSION: 2.30
4916 // Gets D-Bus introspection information for the D-Bus interface
4917 // implemented by @interface_.
4918 // RETURNS: A #GDBusInterfaceInfo (never %NULL). Do not free.
4919 DBusInterfaceInfo* get_info()() {
4920 return g_dbus_interface_skeleton_get_info(&this);
4923 // VERSION: 2.30
4924 // Gets the object path that @interface_ is exported on, if any.
4926 // anywhere. Do not free, the string belongs to @interface_.
4927 // RETURNS: A string owned by @interface_ or %NULL if @interface_ is not exported
4928 char* get_object_path()() {
4929 return g_dbus_interface_skeleton_get_object_path(&this);
4932 // VERSION: 2.30
4933 // Gets all D-Bus properties for @interface_.
4934 // RETURNS: A #GVariant of type <link linkend="G-VARIANT-TYPE-VARDICT:CAPS">'a{sv}'</link>. Free with g_variant_unref().
4935 GLib2.Variant* /*new*/ get_properties()() {
4936 return g_dbus_interface_skeleton_get_properties(&this);
4939 // Unintrospectable method: get_vtable() / g_dbus_interface_skeleton_get_vtable()
4940 // VERSION: 2.30
4941 // Gets the interface vtable for the D-Bus interface implemented by
4942 // @interface_. The returned function pointers should expect @interface_
4943 // itself to be passed as @user_data.
4944 // RETURNS: A #GDBusInterfaceVTable (never %NULL).
4945 DBusInterfaceVTable* get_vtable()() {
4946 return g_dbus_interface_skeleton_get_vtable(&this);
4949 // VERSION: 2.32
4950 // Checks if @interface_ is export on @connection.
4951 // RETURNS: %TRUE if @interface_ is exported on @connection, %FALSE otherwise.
4952 // <connection>: A #GDBusConnection.
4953 int has_connection()(DBusConnection* connection) {
4954 return g_dbus_interface_skeleton_has_connection(&this, connection);
4957 // VERSION: 2.30
4958 // Sets flags describing what the behavior of @skeleton should be.
4959 // <flags>: Flags from the #GDBusInterfaceSkeletonFlags enumeration.
4960 void set_flags()(DBusInterfaceSkeletonFlags flags) {
4961 g_dbus_interface_skeleton_set_flags(&this, flags);
4964 // VERSION: 2.30
4965 // Stops exporting @interface_ on all connections it is exported on.
4967 // To unexport @interface_ from only a single connection, use
4968 // g_dbus_interface_skeleton_export_from_connection()
4969 void unexport()() {
4970 g_dbus_interface_skeleton_unexport(&this);
4973 // VERSION: 2.32
4974 // Stops exporting @interface_ on @connection.
4976 // To stop exporting on all connections the interface is exported on,
4977 // use g_dbus_interface_skeleton_unexport().
4978 // <connection>: A #GDBusConnection.
4979 void unexport_from_connection()(DBusConnection* connection) {
4980 g_dbus_interface_skeleton_unexport_from_connection(&this, connection);
4983 // VERSION: 2.30
4984 // Emitted when a method is invoked by a remote caller and used to
4985 // determine if the method call is authorized.
4987 // Note that this signal is emitted in a thread dedicated to
4988 // handling the method call so handlers are allowed to perform
4989 // blocking IO. This means that it is appropriate to call
4990 // e.g. <ulink
4991 // url="http://hal.freedesktop.org/docs/polkit/PolkitAuthority.html#polkit-authority-check-authorization-sync">polkit_authority_check_authorization_sync()</ulink>
4992 // with the <ulink
4993 // 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.
4995 // If %FALSE is returned then no further handlers are run and the
4996 // signal handler must take a reference to @invocation and finish
4997 // handling the call (e.g. return an error via
4998 // g_dbus_method_invocation_return_error()).
5000 // Otherwise, if %TRUE is returned, signal emission continues. If no
5001 // handlers return %FALSE, then the method is dispatched. If
5002 // @interface has an enclosing #GDBusObjectSkeleton, then the
5003 // #GDBusObjectSkeleton::authorize-method signal handlers run before
5004 // the handlers for this signal.
5006 // The default class handler just returns %TRUE.
5008 // Please note that the common case is optimized: if no signals
5009 // handlers are connected and the default class handler isn't
5010 // overridden (for both @interface and the enclosing
5011 // #GDBusObjectSkeleton, if any) and #GDBusInterfaceSkeleton:g-flags does
5012 // not have the
5013 // %G_DBUS_INTERFACE_SKELETON_FLAGS_HANDLE_METHOD_INVOCATIONS_IN_THREAD
5014 // flags set, no dedicated thread is ever used and the call will be
5015 // handled in the same thread as the object that @interface belongs
5016 // to was exported in.
5017 // RETURNS: %TRUE if the call is authorized, %FALSE otherwise.
5018 // <invocation>: A #GDBusMethodInvocation.
5019 extern (C) alias static c_int function (DBusInterfaceSkeleton* this_, DBusMethodInvocation* invocation, void* user_data=null) signal_g_authorize_method;
5021 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
5022 return super_.signal_connect!name(cb, data, cf);
5025 ulong signal_connect(string name:"g-authorize-method", CB:signal_g_authorize_method)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
5026 return signal_connect_data!()(&this, cast(char*)"g-authorize-method",
5027 cast(GObject2.Callback)cb, data, null, cf);
5031 // Class structure for #GDBusInterfaceSkeleton.
5032 struct DBusInterfaceSkeletonClass /* Version 2.30 */ {
5033 GObject2.ObjectClass parent_class;
5034 // RETURNS: A #GDBusInterfaceInfo (never %NULL). Do not free.
5035 extern (C) DBusInterfaceInfo* function (DBusInterfaceSkeleton* interface_) get_info;
5037 // Unintrospectable functionp: get_vtable() / ()
5039 // RETURNS: A #GDBusInterfaceVTable (never %NULL).
5040 extern (C) DBusInterfaceVTable* function (DBusInterfaceSkeleton* interface_) get_vtable;
5041 // RETURNS: A #GVariant of type <link linkend="G-VARIANT-TYPE-VARDICT:CAPS">'a{sv}'</link>. Free with g_variant_unref().
5042 extern (C) GLib2.Variant* /*new*/ function (DBusInterfaceSkeleton* interface_) get_properties;
5043 extern (C) void function (DBusInterfaceSkeleton* interface_) flush;
5044 private void*[8] vfunc_padding;
5045 extern (C) int function (DBusInterfaceSkeleton* interface_, DBusMethodInvocation* invocation) g_authorize_method;
5046 private void*[8] signal_padding;
5049 // Flags describing the behavior of a #GDBusInterfaceSkeleton instance.
5050 enum DBusInterfaceSkeletonFlags /* Version 2.30 */ {
5051 NONE = 0,
5052 HANDLE_METHOD_INVOCATIONS_IN_THREAD = 1
5054 struct DBusInterfaceSkeletonPrivate {
5058 // Virtual table for handling properties and method calls for a D-Bus
5059 // interface.
5061 // If you want to handle getting/setting D-Bus properties asynchronously, simply
5062 // register an object with the <literal>org.freedesktop.DBus.Properties</literal>
5063 // D-Bus interface using g_dbus_connection_register_object().
5064 struct DBusInterfaceVTable /* Version 2.26 */ {
5065 DBusInterfaceMethodCallFunc method_call;
5066 DBusInterfaceGetPropertyFunc get_property;
5067 DBusInterfaceSetPropertyFunc set_property;
5068 private void*[8] padding;
5072 // #GDBusMenuModel is an implementation of #GMenuModel that can be used
5073 // as a proxy for a menu model that is exported over D-Bus with
5074 // g_dbus_connection_export_menu_model().
5075 struct DBusMenuModel /* : MenuModel */ {
5076 alias method_parent this;
5077 alias method_parent super_;
5078 alias method_parent menumodel;
5079 MenuModel method_parent;
5082 // VERSION: 2.32
5083 // Obtains a #GDBusMenuModel for the menu model which is exported
5084 // at the given @bus_name and @object_path.
5086 // The thread default main context is taken at the time of this call.
5087 // All signals on the menu model (and any linked models) are reported
5088 // with respect to this context. All calls on the returned menu model
5089 // (and linked models) must also originate from this same context, with
5090 // the thread default main context unchanged.
5092 // g_object_unref().
5093 // RETURNS: a #GDBusMenuModel object. Free with
5094 // <connection>: a #GDBusConnection
5095 // <bus_name>: the bus name which exports the menu model
5096 // <object_path>: the object path at which the menu model is exported
5097 static DBusMenuModel* /*new*/ get()(DBusConnection* connection, char* bus_name, char* object_path) {
5098 return g_dbus_menu_model_get(connection, bus_name, object_path);
5103 // A type for representing D-Bus messages that can be sent or received
5104 // on a #GDBusConnection.
5105 struct DBusMessage /* : GObject.Object */ /* Version 2.26 */ {
5106 alias method_parent this;
5107 alias method_parent super_;
5108 alias method_parent object;
5109 GObject2.Object method_parent;
5112 // VERSION: 2.26
5113 // Creates a new empty #GDBusMessage.
5114 // RETURNS: A #GDBusMessage. Free with g_object_unref().
5115 static DBusMessage* /*new*/ new_()() {
5116 return g_dbus_message_new();
5119 // VERSION: 2.26
5120 // Creates a new #GDBusMessage from the data stored at @blob. The byte
5121 // order that the message was in can be retrieved using
5122 // g_dbus_message_get_byte_order().
5124 // g_object_unref().
5125 // RETURNS: A new #GDBusMessage or %NULL if @error is set. Free with
5126 // <blob>: A blob represent a binary D-Bus message.
5127 // <blob_len>: The length of @blob.
5128 // <capabilities>: A #GDBusCapabilityFlags describing what protocol features are supported.
5129 static DBusMessage* /*new*/ new_from_blob()(ubyte* blob, size_t blob_len, DBusCapabilityFlags capabilities, GLib2.Error** error=null) {
5130 return g_dbus_message_new_from_blob(blob, blob_len, capabilities, error);
5133 // VERSION: 2.26
5134 // Creates a new #GDBusMessage for a method call.
5135 // RETURNS: A #GDBusMessage. Free with g_object_unref().
5136 // <name>: A valid D-Bus name or %NULL.
5137 // <path>: A valid object path.
5138 // <interface_>: A valid D-Bus interface name or %NULL.
5139 // <method>: A valid method name.
5140 static DBusMessage* /*new*/ new_method_call()(char* name, char* path, char* interface_, char* method) {
5141 return g_dbus_message_new_method_call(name, path, interface_, method);
5144 // VERSION: 2.26
5145 // Creates a new #GDBusMessage for a signal emission.
5146 // RETURNS: A #GDBusMessage. Free with g_object_unref().
5147 // <path>: A valid object path.
5148 // <interface_>: A valid D-Bus interface name.
5149 // <signal>: A valid signal name.
5150 static DBusMessage* /*new*/ new_signal()(char* path, char* interface_, char* signal) {
5151 return g_dbus_message_new_signal(path, interface_, signal);
5154 // VERSION: 2.26
5155 // Utility function to calculate how many bytes are needed to
5156 // completely deserialize the D-Bus message stored at @blob.
5158 // @blob contains invalid data or not enough data is available to
5159 // determine the size).
5160 // RETURNS: Number of bytes needed or -1 if @error is set (e.g. if
5161 // <blob>: A blob represent a binary D-Bus message.
5162 // <blob_len>: The length of @blob (must be at least 16).
5163 static ssize_t bytes_needed()(ubyte* blob, size_t blob_len, GLib2.Error** error=null) {
5164 return g_dbus_message_bytes_needed(blob, blob_len, error);
5167 // VERSION: 2.26
5168 // Copies @message. The copy is a deep copy and the returned
5169 // #GDBusMessage is completely identical except that it is guaranteed
5170 // to not be locked.
5172 // This operation can fail if e.g. @message contains file descriptors
5173 // and the per-process or system-wide open files limit is reached.
5175 // Free with g_object_unref().
5176 // RETURNS: A new #GDBusMessage or %NULL if @error is set.
5177 DBusMessage* /*new*/ copy()(GLib2.Error** error=null) {
5178 return g_dbus_message_copy(&this, error);
5181 // VERSION: 2.26
5182 // Convenience to get the first item in the body of @message.
5184 // @message is not a string.
5185 // RETURNS: The string item or %NULL if the first item in the body of
5186 char* get_arg0()() {
5187 return g_dbus_message_get_arg0(&this);
5190 // VERSION: 2.26
5191 // Gets the body of a message.
5192 // RETURNS: A #GVariant or %NULL if the body is empty. Do not free, it is owned by @message.
5193 GLib2.Variant* /*new*/ get_body()() {
5194 return g_dbus_message_get_body(&this);
5197 // Gets the byte order of @message.
5198 // RETURNS: The byte order.
5199 DBusMessageByteOrder get_byte_order()() {
5200 return g_dbus_message_get_byte_order(&this);
5203 // VERSION: 2.26
5204 // Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION header field.
5205 // RETURNS: The value.
5206 char* get_destination()() {
5207 return g_dbus_message_get_destination(&this);
5210 // VERSION: 2.26
5211 // Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field.
5212 // RETURNS: The value.
5213 char* get_error_name()() {
5214 return g_dbus_message_get_error_name(&this);
5217 // VERSION: 2.26
5218 // Gets the flags for @message.
5219 // RETURNS: Flags that are set (typically values from the #GDBusMessageFlags enumeration bitwise ORed together).
5220 DBusMessageFlags get_flags()() {
5221 return g_dbus_message_get_flags(&this);
5224 // VERSION: 2.26
5225 // Gets a header field on @message.
5227 // otherwise. Do not free, it is owned by @message.
5228 // RETURNS: A #GVariant with the value if the header was found, %NULL
5229 // <header_field>: A 8-bit unsigned integer (typically a value from the #GDBusMessageHeaderField enumeration)
5230 GLib2.Variant* /*new*/ get_header()(DBusMessageHeaderField header_field) {
5231 return g_dbus_message_get_header(&this, header_field);
5234 // VERSION: 2.26
5235 // Gets an array of all header fields on @message that are set.
5237 // terminated by %G_DBUS_MESSAGE_HEADER_FIELD_INVALID. Each element
5238 // is a #guchar. Free with g_free().
5239 // RETURNS: An array of header fields
5240 ubyte* get_header_fields()() {
5241 return g_dbus_message_get_header_fields(&this);
5244 // VERSION: 2.26
5245 // Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE header field.
5246 // RETURNS: The value.
5247 char* get_interface()() {
5248 return g_dbus_message_get_interface(&this);
5251 // VERSION: 2.26
5252 // Checks whether @message is locked. To monitor changes to this
5253 // value, conncet to the #GObject::notify signal to listen for changes
5254 // on the #GDBusMessage:locked property.
5255 // RETURNS: %TRUE if @message is locked, %FALSE otherwise.
5256 int get_locked()() {
5257 return g_dbus_message_get_locked(&this);
5260 // VERSION: 2.26
5261 // Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_MEMBER header field.
5262 // RETURNS: The value.
5263 char* get_member()() {
5264 return g_dbus_message_get_member(&this);
5267 // VERSION: 2.26
5268 // Gets the type of @message.
5269 // RETURNS: A 8-bit unsigned integer (typically a value from the #GDBusMessageType enumeration).
5270 DBusMessageType get_message_type()() {
5271 return g_dbus_message_get_message_type(&this);
5274 // VERSION: 2.26
5275 // Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header field.
5276 // RETURNS: The value.
5277 uint get_num_unix_fds()() {
5278 return g_dbus_message_get_num_unix_fds(&this);
5281 // VERSION: 2.26
5282 // Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_PATH header field.
5283 // RETURNS: The value.
5284 char* get_path()() {
5285 return g_dbus_message_get_path(&this);
5288 // VERSION: 2.26
5289 // Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL header field.
5290 // RETURNS: The value.
5291 uint get_reply_serial()() {
5292 return g_dbus_message_get_reply_serial(&this);
5295 // VERSION: 2.26
5296 // Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_SENDER header field.
5297 // RETURNS: The value.
5298 char* get_sender()() {
5299 return g_dbus_message_get_sender(&this);
5302 // VERSION: 2.26
5303 // Gets the serial for @message.
5304 // RETURNS: A #guint32.
5305 uint get_serial()() {
5306 return g_dbus_message_get_serial(&this);
5309 // VERSION: 2.26
5310 // Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field.
5311 // RETURNS: The value.
5312 char* get_signature()() {
5313 return g_dbus_message_get_signature(&this);
5316 // VERSION: 2.26
5317 // Gets the UNIX file descriptors associated with @message, if any.
5319 // This method is only available on UNIX.
5321 // associated. Do not free, this object is owned by @message.
5322 // RETURNS: A #GUnixFDList or %NULL if no file descriptors are
5323 UnixFDList* get_unix_fd_list()() {
5324 return g_dbus_message_get_unix_fd_list(&this);
5327 // VERSION: 2.26
5328 // If @message is locked, does nothing. Otherwise locks the message.
5329 void lock()() {
5330 g_dbus_message_lock(&this);
5333 // Unintrospectable method: new_method_error() / g_dbus_message_new_method_error()
5334 // VERSION: 2.26
5335 // Creates a new #GDBusMessage that is an error reply to @method_call_message.
5336 // RETURNS: A #GDBusMessage. Free with g_object_unref().
5337 // <error_name>: A valid D-Bus error name.
5338 // <error_message_format>: The D-Bus error message in a printf() format.
5339 /+ Not available -- variadic methods unsupported - use the C function directly.
5340 alias g_dbus_message_new_method_error new_method_error; // Variadic
5343 // VERSION: 2.26
5344 // Creates a new #GDBusMessage that is an error reply to @method_call_message.
5345 // RETURNS: A #GDBusMessage. Free with g_object_unref().
5346 // <error_name>: A valid D-Bus error name.
5347 // <error_message>: The D-Bus error message.
5348 DBusMessage* /*new*/ new_method_error_literal()(char* error_name, char* error_message) {
5349 return g_dbus_message_new_method_error_literal(&this, error_name, error_message);
5352 // Unintrospectable method: new_method_error_valist() / g_dbus_message_new_method_error_valist()
5353 // VERSION: 2.26
5354 // Like g_dbus_message_new_method_error() but intended for language bindings.
5355 // RETURNS: A #GDBusMessage. Free with g_object_unref().
5356 // <error_name>: A valid D-Bus error name.
5357 // <error_message_format>: The D-Bus error message in a printf() format.
5358 // <var_args>: Arguments for @error_message_format.
5359 DBusMessage* /*new*/ new_method_error_valist()(char* error_name, char* error_message_format, va_list var_args) {
5360 return g_dbus_message_new_method_error_valist(&this, error_name, error_message_format, var_args);
5363 // VERSION: 2.26
5364 // Creates a new #GDBusMessage that is a reply to @method_call_message.
5365 // RETURNS: #GDBusMessage. Free with g_object_unref().
5366 DBusMessage* /*new*/ new_method_reply()() {
5367 return g_dbus_message_new_method_reply(&this);
5370 // VERSION: 2.26
5371 // Produces a human-readable multi-line description of @message.
5373 // The contents of the description has no ABI guarantees, the contents
5374 // and formatting is subject to change at any time. Typical output
5375 // looks something like this:
5376 // <programlisting>
5377 // Flags: none
5378 // Version: 0
5379 // Serial: 4
5380 // Headers:
5381 // path -> objectpath '/org/gtk/GDBus/TestObject'
5382 // interface -> 'org.gtk.GDBus.TestInterface'
5383 // member -> 'GimmeStdout'
5384 // destination -> ':1.146'
5385 // Body: ()
5386 // UNIX File Descriptors:
5387 // (none)
5388 // </programlisting>
5389 // or
5390 // <programlisting>
5391 // Flags: no-reply-expected
5392 // Version: 0
5393 // Serial: 477
5394 // Headers:
5395 // reply-serial -> uint32 4
5396 // destination -> ':1.159'
5397 // sender -> ':1.146'
5398 // num-unix-fds -> uint32 1
5399 // Body: ()
5400 // UNIX File Descriptors:
5401 // fd 12: dev=0:10,mode=020620,ino=5,uid=500,gid=5,rdev=136:2,size=0,atime=1273085037,mtime=1273085851,ctime=1272982635
5402 // </programlisting>
5403 // RETURNS: A string that should be freed with g_free().
5404 // <indent>: Indentation level.
5405 char* /*new*/ print()(uint indent) {
5406 return g_dbus_message_print(&this, indent);
5409 // VERSION: 2.26
5410 // Sets the body @message. As a side-effect the
5411 // %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field is set to the
5412 // type string of @body (or cleared if @body is %NULL).
5414 // If @body is floating, @message assumes ownership of @body.
5415 // <body>: Either %NULL or a #GVariant that is a tuple.
5416 void set_body()(GLib2.Variant* body_) {
5417 g_dbus_message_set_body(&this, body_);
5420 // Sets the byte order of @message.
5421 // <byte_order>: The byte order.
5422 void set_byte_order()(DBusMessageByteOrder byte_order) {
5423 g_dbus_message_set_byte_order(&this, byte_order);
5426 // VERSION: 2.26
5427 // Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION header field.
5428 // <value>: The value to set.
5429 void set_destination()(char* value) {
5430 g_dbus_message_set_destination(&this, value);
5433 // VERSION: 2.26
5434 // Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field.
5435 // <value>: The value to set.
5436 void set_error_name()(char* value) {
5437 g_dbus_message_set_error_name(&this, value);
5440 // VERSION: 2.26
5441 // Sets the flags to set on @message.
5442 // <flags>: Flags for @message that are set (typically values from the #GDBusMessageFlags enumeration bitwise ORed together).
5443 void set_flags()(DBusMessageFlags flags) {
5444 g_dbus_message_set_flags(&this, flags);
5447 // VERSION: 2.26
5448 // Sets a header field on @message.
5450 // If @value is floating, @message assumes ownership of @value.
5451 // <header_field>: A 8-bit unsigned integer (typically a value from the #GDBusMessageHeaderField enumeration)
5452 // <value>: A #GVariant to set the header field or %NULL to clear the header field.
5453 void set_header()(DBusMessageHeaderField header_field, GLib2.Variant* value) {
5454 g_dbus_message_set_header(&this, header_field, value);
5457 // VERSION: 2.26
5458 // Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE header field.
5459 // <value>: The value to set.
5460 void set_interface()(char* value) {
5461 g_dbus_message_set_interface(&this, value);
5464 // VERSION: 2.26
5465 // Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_MEMBER header field.
5466 // <value>: The value to set.
5467 void set_member()(char* value) {
5468 g_dbus_message_set_member(&this, value);
5471 // VERSION: 2.26
5472 // Sets @message to be of @type.
5473 // <type>: A 8-bit unsigned integer (typically a value from the #GDBusMessageType enumeration).
5474 void set_message_type()(DBusMessageType type) {
5475 g_dbus_message_set_message_type(&this, type);
5478 // VERSION: 2.26
5479 // Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header field.
5480 // <value>: The value to set.
5481 void set_num_unix_fds()(uint value) {
5482 g_dbus_message_set_num_unix_fds(&this, value);
5485 // VERSION: 2.26
5486 // Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_PATH header field.
5487 // <value>: The value to set.
5488 void set_path()(char* value) {
5489 g_dbus_message_set_path(&this, value);
5492 // VERSION: 2.26
5493 // Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL header field.
5494 // <value>: The value to set.
5495 void set_reply_serial()(uint value) {
5496 g_dbus_message_set_reply_serial(&this, value);
5499 // VERSION: 2.26
5500 // Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_SENDER header field.
5501 // <value>: The value to set.
5502 void set_sender()(char* value) {
5503 g_dbus_message_set_sender(&this, value);
5506 // VERSION: 2.26
5507 // Sets the serial for @message.
5508 // <serial>: A #guint32.
5509 void set_serial()(uint serial) {
5510 g_dbus_message_set_serial(&this, serial);
5513 // VERSION: 2.26
5514 // Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field.
5515 // <value>: The value to set.
5516 void set_signature()(char* value) {
5517 g_dbus_message_set_signature(&this, value);
5520 // VERSION: 2.26
5521 // Sets the UNIX file descriptors associated with @message. As a
5522 // side-effect the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header
5523 // field is set to the number of fds in @fd_list (or cleared if
5524 // @fd_list is %NULL).
5526 // This method is only available on UNIX.
5527 // <fd_list>: A #GUnixFDList or %NULL.
5528 void set_unix_fd_list()(UnixFDList* fd_list=null) {
5529 g_dbus_message_set_unix_fd_list(&this, fd_list);
5532 // VERSION: 2.26
5533 // Serializes @message to a blob. The byte order returned by
5534 // g_dbus_message_get_byte_order() will be used.
5536 // valid binary D-Bus message of @out_size bytes generated by @message
5537 // or %NULL if @error is set. Free with g_free().
5538 // RETURNS: A pointer to a
5539 // <out_size>: Return location for size of generated blob.
5540 // <capabilities>: A #GDBusCapabilityFlags describing what protocol features are supported.
5541 ubyte* /*new*/ to_blob()(/*out*/ size_t* out_size, DBusCapabilityFlags capabilities, GLib2.Error** error=null) {
5542 return g_dbus_message_to_blob(&this, out_size, capabilities, error);
5545 // VERSION: 2.26
5546 // If @message is not of type %G_DBUS_MESSAGE_TYPE_ERROR does
5547 // nothing and returns %FALSE.
5549 // Otherwise this method encodes the error in @message as a #GError
5550 // using g_dbus_error_set_dbus_error() using the information in the
5551 // %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field of @message as
5552 // well as the first string item in @message's body.
5553 // RETURNS: %TRUE if @error was set, %FALSE otherwise.
5554 int to_gerror()(GLib2.Error** error=null) {
5555 return g_dbus_message_to_gerror(&this, error);
5559 // Enumeration used to describe the byte order of a D-Bus message.
5560 enum DBusMessageByteOrder /* Version 2.26 */ {
5561 BIG_ENDIAN = 66,
5562 LITTLE_ENDIAN = 108
5565 // VERSION: 2.26
5566 // Signature for function used in g_dbus_connection_add_filter().
5568 // A filter function is passed a #GDBusMessage and expected to return
5569 // a #GDBusMessage too. Passive filter functions that don't modify the
5570 // message can simply return the @message object:
5571 // |[
5572 // static GDBusMessage *
5573 // passive_filter (GDBusConnection *connection
5574 // GDBusMessage *message,
5575 // gboolean incoming,
5576 // gpointer user_data)
5577 // {
5578 // /<!-- -->* inspect @message *<!-- -->/
5579 // return message;
5580 // }
5581 // ]|
5582 // Filter functions that wants to drop a message can simply return %NULL:
5583 // |[
5584 // static GDBusMessage *
5585 // drop_filter (GDBusConnection *connection
5586 // GDBusMessage *message,
5587 // gboolean incoming,
5588 // gpointer user_data)
5589 // {
5590 // if (should_drop_message)
5591 // {
5592 // g_object_unref (message);
5593 // message = NULL;
5594 // }
5595 // return message;
5596 // }
5597 // ]|
5598 // Finally, a filter function may modify a message by copying it:
5599 // |[
5600 // static GDBusMessage *
5601 // modifying_filter (GDBusConnection *connection
5602 // GDBusMessage *message,
5603 // gboolean incoming,
5604 // gpointer user_data)
5605 // {
5606 // GDBusMessage *copy;
5607 // GError *error;
5609 // error = NULL;
5610 // copy = g_dbus_message_copy (message, &error);
5611 // /<!-- -->* handle @error being is set *<!-- -->/
5612 // g_object_unref (message);
5614 // /<!-- -->* modify @copy *<!-- -->/
5616 // return copy;
5617 // }
5618 // ]|
5619 // If the returned #GDBusMessage is different from @message and cannot
5620 // be sent on @connection (it could use features, such as file
5621 // descriptors, not compatible with @connection), then a warning is
5622 // logged to <emphasis>standard error</emphasis>. Applications can
5623 // check this ahead of time using g_dbus_message_to_blob() passing a
5624 // #GDBusCapabilityFlags value obtained from @connection.
5626 // g_object_unref() or %NULL to drop the message. Passive filter
5627 // functions can simply return the passed @message object.
5628 // RETURNS: A #GDBusMessage that will be freed with
5629 // <connection>: A #GDBusConnection.
5630 // <message>: A locked #GDBusMessage that the filter function takes ownership of.
5631 // <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.
5632 // <user_data>: User data passed when adding the filter.
5633 extern (C) alias DBusMessage* /*new*/ function (DBusConnection* connection, DBusMessage* message, int incoming, void* user_data) DBusMessageFilterFunction;
5635 // Message flags used in #GDBusMessage.
5636 enum DBusMessageFlags /* Version 2.26 */ {
5637 NONE = 0,
5638 NO_REPLY_EXPECTED = 1,
5639 NO_AUTO_START = 2
5641 // Header fields used in #GDBusMessage.
5642 enum DBusMessageHeaderField /* Version 2.26 */ {
5643 INVALID = 0,
5644 PATH = 1,
5645 INTERFACE = 2,
5646 MEMBER = 3,
5647 ERROR_NAME = 4,
5648 REPLY_SERIAL = 5,
5649 DESTINATION = 6,
5650 SENDER = 7,
5651 SIGNATURE = 8,
5652 NUM_UNIX_FDS = 9
5654 // Message types used in #GDBusMessage.
5655 enum DBusMessageType /* Version 2.26 */ {
5656 INVALID = 0,
5657 METHOD_CALL = 1,
5658 METHOD_RETURN = 2,
5659 ERROR = 3,
5660 SIGNAL = 4
5662 // Information about a method on an D-Bus interface.
5663 struct DBusMethodInfo /* Version 2.26 */ {
5664 int ref_count;
5665 char* name;
5666 DBusArgInfo*[666] in_args, out_args;
5667 DBusAnnotationInfo*[666] annotations;
5670 // VERSION: 2.26
5671 // If @info is statically allocated does nothing. Otherwise increases
5672 // the reference count.
5673 // RETURNS: The same @info.
5674 DBusMethodInfo* /*new*/ ref_()() {
5675 return g_dbus_method_info_ref(&this);
5678 // VERSION: 2.26
5679 // If @info is statically allocated, does nothing. Otherwise decreases
5680 // the reference count of @info. When its reference count drops to 0,
5681 // the memory used is freed.
5682 void unref()() {
5683 g_dbus_method_info_unref(&this);
5688 // Instances of the #GDBusMethodInvocation class are used when
5689 // handling D-Bus method calls. It provides a way to asynchronously
5690 // return results and errors.
5692 // The normal way to obtain a #GDBusMethodInvocation object is to receive
5693 // it as an argument to the handle_method_call() function in a
5694 // #GDBusInterfaceVTable that was passed to g_dbus_connection_register_object().
5695 struct DBusMethodInvocation /* : GObject.Object */ /* Version 2.26 */ {
5696 alias method_parent this;
5697 alias method_parent super_;
5698 alias method_parent object;
5699 GObject2.Object method_parent;
5702 // VERSION: 2.26
5703 // Gets the #GDBusConnection the method was invoked on.
5704 // RETURNS: A #GDBusConnection. Do not free, it is owned by @invocation.
5705 DBusConnection* get_connection()() {
5706 return g_dbus_method_invocation_get_connection(&this);
5709 // VERSION: 2.26
5710 // Gets the name of the D-Bus interface the method was invoked on.
5711 // RETURNS: A string. Do not free, it is owned by @invocation.
5712 char* get_interface_name()() {
5713 return g_dbus_method_invocation_get_interface_name(&this);
5716 // VERSION: 2.26
5717 // Gets the #GDBusMessage for the method invocation. This is useful if
5718 // you need to use low-level protocol features, such as UNIX file
5719 // descriptor passing, that cannot be properly expressed in the
5720 // #GVariant API.
5722 // See <xref linkend="gdbus-server"/> and <xref
5723 // linkend="gdbus-unix-fd-client"/> for an example of how to use this
5724 // low-level API to send and receive UNIX file descriptors.
5725 // RETURNS: #GDBusMessage. Do not free, it is owned by @invocation.
5726 DBusMessage* get_message()() {
5727 return g_dbus_method_invocation_get_message(&this);
5730 // VERSION: 2.26
5731 // Gets information about the method call, if any.
5732 // RETURNS: A #GDBusMethodInfo or %NULL. Do not free, it is owned by @invocation.
5733 DBusMethodInfo* get_method_info()() {
5734 return g_dbus_method_invocation_get_method_info(&this);
5737 // VERSION: 2.26
5738 // Gets the name of the method that was invoked.
5739 // RETURNS: A string. Do not free, it is owned by @invocation.
5740 char* get_method_name()() {
5741 return g_dbus_method_invocation_get_method_name(&this);
5744 // VERSION: 2.26
5745 // Gets the object path the method was invoked on.
5746 // RETURNS: A string. Do not free, it is owned by @invocation.
5747 char* get_object_path()() {
5748 return g_dbus_method_invocation_get_object_path(&this);
5751 // VERSION: 2.26
5752 // Gets the parameters of the method invocation. If there are no input
5753 // parameters then this will return a GVariant with 0 children rather than NULL.
5754 // RETURNS: A #GVariant tuple. Do not unref this because it is owned by @invocation.
5755 GLib2.Variant* get_parameters()() {
5756 return g_dbus_method_invocation_get_parameters(&this);
5759 // VERSION: 2.26
5760 // Gets the bus name that invoked the method.
5761 // RETURNS: A string. Do not free, it is owned by @invocation.
5762 char* get_sender()() {
5763 return g_dbus_method_invocation_get_sender(&this);
5766 // Unintrospectable method: get_user_data() / g_dbus_method_invocation_get_user_data()
5767 // VERSION: 2.26
5768 // Gets the @user_data #gpointer passed to g_dbus_connection_register_object().
5769 // RETURNS: A #gpointer.
5770 void* get_user_data()() {
5771 return g_dbus_method_invocation_get_user_data(&this);
5774 // VERSION: 2.26
5775 // Finishes handling a D-Bus method call by returning an error.
5777 // This method will free @invocation, you cannot use it afterwards.
5778 // <error_name>: A valid D-Bus error name.
5779 // <error_message>: A valid D-Bus error message.
5780 void return_dbus_error()(char* error_name, char* error_message) {
5781 g_dbus_method_invocation_return_dbus_error(&this, error_name, error_message);
5784 // Unintrospectable method: return_error() / g_dbus_method_invocation_return_error()
5785 // VERSION: 2.26
5786 // Finishes handling a D-Bus method call by returning an error.
5788 // See g_dbus_error_encode_gerror() for details about what error name
5789 // will be returned on the wire. In a nutshell, if the given error is
5790 // registered using g_dbus_error_register_error() the name given
5791 // during registration is used. Otherwise, a name of the form
5792 // <literal>org.gtk.GDBus.UnmappedGError.Quark...</literal> is
5793 // used. This provides transparent mapping of #GError between
5794 // applications using GDBus.
5796 // If you are writing an application intended to be portable,
5797 // <emphasis>always</emphasis> register errors with g_dbus_error_register_error()
5798 // or use g_dbus_method_invocation_return_dbus_error().
5800 // This method will free @invocation, you cannot use it afterwards.
5801 // <domain>: A #GQuark for the #GError error domain.
5802 // <code>: The error code.
5803 // <format>: printf()-style format.
5804 /+ Not available -- variadic methods unsupported - use the C function directly.
5805 alias g_dbus_method_invocation_return_error return_error; // Variadic
5808 // VERSION: 2.26
5809 // Like g_dbus_method_invocation_return_error() but without printf()-style formatting.
5811 // This method will free @invocation, you cannot use it afterwards.
5812 // <domain>: A #GQuark for the #GError error domain.
5813 // <code>: The error code.
5814 // <message>: The error message.
5815 void return_error_literal()(GLib2.Quark domain, int code, char* message) {
5816 g_dbus_method_invocation_return_error_literal(&this, domain, code, message);
5819 // Unintrospectable method: return_error_valist() / g_dbus_method_invocation_return_error_valist()
5820 // VERSION: 2.26
5821 // Like g_dbus_method_invocation_return_error() but intended for
5822 // language bindings.
5824 // This method will free @invocation, you cannot use it afterwards.
5825 // <domain>: A #GQuark for the #GError error domain.
5826 // <code>: The error code.
5827 // <format>: printf()-style format.
5828 // <var_args>: #va_list of parameters for @format.
5829 void return_error_valist()(GLib2.Quark domain, int code, char* format, va_list var_args) {
5830 g_dbus_method_invocation_return_error_valist(&this, domain, code, format, var_args);
5833 // VERSION: 2.26
5834 // Like g_dbus_method_invocation_return_error() but takes a #GError
5835 // instead of the error domain, error code and message.
5837 // This method will free @invocation, you cannot use it afterwards.
5838 // <error>: A #GError.
5839 void return_gerror()(GLib2.Error* error) {
5840 g_dbus_method_invocation_return_gerror(&this, error);
5843 // VERSION: 2.26
5844 // Finishes handling a D-Bus method call by returning @parameters.
5845 // If the @parameters GVariant is floating, it is consumed.
5847 // It is an error if @parameters is not of the right format.
5849 // This method will free @invocation, you cannot use it afterwards.
5850 // <parameters>: A #GVariant tuple with out parameters for the method or %NULL if not passing any parameters.
5851 void return_value()(GLib2.Variant* parameters=null) {
5852 g_dbus_method_invocation_return_value(&this, parameters);
5855 // VERSION: 2.30
5856 // Like g_dbus_method_invocation_return_value() but also takes a #GUnixFDList.
5858 // This method is only available on UNIX.
5860 // This method will free @invocation, you cannot use it afterwards.
5861 // <parameters>: A #GVariant tuple with out parameters for the method or %NULL if not passing any parameters.
5862 // <fd_list>: A #GUnixFDList or %NULL.
5863 void return_value_with_unix_fd_list()(GLib2.Variant* parameters=null, UnixFDList* fd_list=null) {
5864 g_dbus_method_invocation_return_value_with_unix_fd_list(&this, parameters, fd_list);
5867 // Unintrospectable method: take_error() / g_dbus_method_invocation_take_error()
5868 // VERSION: 2.30
5869 // Like g_dbus_method_invocation_return_gerror() but takes ownership
5870 // of @error so the caller does not need to free it.
5872 // This method will free @invocation, you cannot use it afterwards.
5873 // <error>: A #GError.
5874 void take_error()(GLib2.Error* error) {
5875 g_dbus_method_invocation_take_error(&this, error);
5879 // Information about nodes in a remote object hierarchy.
5880 struct DBusNodeInfo /* Version 2.26 */ {
5881 int ref_count;
5882 char* path;
5883 DBusInterfaceInfo*[666] interfaces;
5884 DBusNodeInfo*[666] nodes;
5885 DBusAnnotationInfo*[666] annotations;
5888 // VERSION: 2.26
5889 // Parses @xml_data and returns a #GDBusNodeInfo representing the data.
5891 // Note that this routine is using a
5892 // <link linkend="glib-Simple-XML-Subset-Parser.description">GMarkup</link>-based
5893 // parser that only accepts a subset of valid XML documents.
5895 // with g_dbus_node_info_unref().
5896 // RETURNS: A #GDBusNodeInfo structure or %NULL if @error is set. Free
5897 // <xml_data>: Valid D-Bus introspection XML.
5898 static DBusNodeInfo* /*new*/ new_for_xml()(char* xml_data, GLib2.Error** error=null) {
5899 return g_dbus_node_info_new_for_xml(xml_data, error);
5902 // VERSION: 2.26
5903 // Appends an XML representation of @info (and its children) to @string_builder.
5905 // This function is typically used for generating introspection XML documents at run-time for
5906 // handling the <literal>org.freedesktop.DBus.Introspectable.Introspect</literal> method.
5907 // <indent>: Indentation level.
5908 // <string_builder>: A #GString to to append XML data to.
5909 void generate_xml()(uint indent, /*out*/ GLib2.String* string_builder) {
5910 g_dbus_node_info_generate_xml(&this, indent, string_builder);
5913 // VERSION: 2.26
5914 // Looks up information about an interface.
5916 // This cost of this function is O(n) in number of interfaces.
5917 // RETURNS: A #GDBusInterfaceInfo or %NULL if not found. Do not free, it is owned by @info.
5918 // <name>: A D-Bus interface name.
5919 DBusInterfaceInfo* lookup_interface()(char* name) {
5920 return g_dbus_node_info_lookup_interface(&this, name);
5923 // VERSION: 2.26
5924 // If @info is statically allocated does nothing. Otherwise increases
5925 // the reference count.
5926 // RETURNS: The same @info.
5927 DBusNodeInfo* /*new*/ ref_()() {
5928 return g_dbus_node_info_ref(&this);
5931 // VERSION: 2.26
5932 // If @info is statically allocated, does nothing. Otherwise decreases
5933 // the reference count of @info. When its reference count drops to 0,
5934 // the memory used is freed.
5935 void unref()() {
5936 g_dbus_node_info_unref(&this);
5941 // The #GDBusObject type is the base type for D-Bus objects on both
5942 // the service side (see #GDBusObjectSkeleton) and the client side
5943 // (see #GDBusObjectProxy). It is essentially just a container of
5944 // interfaces.
5945 struct DBusObject /* Interface */ {
5946 mixin template __interface__() {
5947 // VERSION: 2.30
5948 // Gets the D-Bus interface with name @interface_name associated with
5949 // @object, if any.
5951 // #GDBusInterface that must be freed with g_object_unref().
5952 // RETURNS: %NULL if not found, otherwise a
5953 // <interface_name>: A D-Bus interface name.
5954 DBusInterface* /*new*/ get_interface()(char* interface_name) {
5955 return g_dbus_object_get_interface(cast(DBusObject*)&this, interface_name);
5958 // VERSION: 2.30
5959 // Gets the D-Bus interfaces associated with @object.
5961 // The returned list must be freed by g_list_free() after each element has been freed
5962 // with g_object_unref().
5963 // RETURNS: A list of #GDBusInterface instances.
5964 GLib2.List* /*new*/ get_interfaces()() {
5965 return g_dbus_object_get_interfaces(cast(DBusObject*)&this);
5968 // VERSION: 2.30
5969 // Gets the object path for @object.
5970 // RETURNS: A string owned by @object. Do not free.
5971 char* get_object_path()() {
5972 return g_dbus_object_get_object_path(cast(DBusObject*)&this);
5975 // VERSION: 2.30
5976 // Emitted when @interface is added to @object.
5977 // <interface>: The #GDBusInterface that was added.
5978 extern (C) alias static void function (DBusObject* this_, DBusInterface* interface_, void* user_data=null) signal_interface_added;
5980 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
5981 return super_.signal_connect!name(cb, data, cf);
5984 ulong signal_connect(string name:"interface-added", CB:signal_interface_added)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
5985 return signal_connect_data!()(&this, cast(char*)"interface-added",
5986 cast(GObject2.Callback)cb, data, null, cf);
5989 // VERSION: 2.30
5990 // Emitted when @interface is removed from @object.
5991 // <interface>: The #GDBusInterface that was removed.
5992 extern (C) alias static void function (DBusObject* this_, DBusInterface* interface_, void* user_data=null) signal_interface_removed;
5993 ulong signal_connect(string name:"interface-removed", CB:signal_interface_removed)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
5994 return signal_connect_data!()(&this, cast(char*)"interface-removed",
5995 cast(GObject2.Callback)cb, data, null, cf);
5998 mixin __interface__;
6001 // Base object type for D-Bus objects.
6002 struct DBusObjectIface /* Version 2.30 */ {
6003 GObject2.TypeInterface parent_iface;
6004 // RETURNS: A string owned by @object. Do not free.
6005 extern (C) char* function (DBusObject* object) get_object_path;
6006 // RETURNS: A list of #GDBusInterface instances.
6007 extern (C) GLib2.List* /*new*/ function (DBusObject* object) get_interfaces;
6009 // RETURNS: %NULL if not found, otherwise a
6010 // <interface_name>: A D-Bus interface name.
6011 extern (C) DBusInterface* /*new*/ function (DBusObject* object, char* interface_name) get_interface;
6012 extern (C) void function (DBusObject* object, DBusInterface* interface_) interface_added;
6013 extern (C) void function (DBusObject* object, DBusInterface* interface_) interface_removed;
6017 // The #GDBusObjectManager type is the base type for service- and
6018 // client-side implementations of the standardized <ulink
6019 // url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">org.freedesktop.DBus.ObjectManager</ulink>
6020 // interface.
6022 // See #GDBusObjectManagerClient for the client-side implementation
6023 // and #GDBusObjectManagerServer for the service-side implementation.
6024 struct DBusObjectManager /* Interface */ {
6025 mixin template __interface__() {
6026 // VERSION: 2.30
6027 // Gets the interface proxy for @interface_name at @object_path, if
6028 // any.
6030 // with g_object_unref().
6031 // RETURNS: A #GDBusInterface instance or %NULL. Free
6032 // <object_path>: Object path to lookup.
6033 // <interface_name>: D-Bus interface name to lookup.
6034 DBusInterface* /*new*/ get_interface()(char* object_path, char* interface_name) {
6035 return g_dbus_object_manager_get_interface(cast(DBusObjectManager*)&this, object_path, interface_name);
6038 // VERSION: 2.30
6039 // Gets the #GDBusObjectProxy at @object_path, if any.
6041 // g_object_unref().
6042 // RETURNS: A #GDBusObject or %NULL. Free with
6043 // <object_path>: Object path to lookup.
6044 DBusObject* /*new*/ get_object()(char* object_path) {
6045 return g_dbus_object_manager_get_object(cast(DBusObjectManager*)&this, object_path);
6048 // VERSION: 2.30
6049 // Gets the object path that @manager is for.
6050 // RETURNS: A string owned by @manager. Do not free.
6051 char* get_object_path()() {
6052 return g_dbus_object_manager_get_object_path(cast(DBusObjectManager*)&this);
6055 // VERSION: 2.30
6056 // Gets all #GDBusObject objects known to @manager.
6058 // #GDBusObject objects. The returned list should be freed with
6059 // g_list_free() after each element has been freed with
6060 // g_object_unref().
6061 // RETURNS: A list of
6062 GLib2.List* /*new*/ get_objects()() {
6063 return g_dbus_object_manager_get_objects(cast(DBusObjectManager*)&this);
6066 // VERSION: 2.30
6067 // Emitted when @interface is added to @object.
6069 // This signal exists purely as a convenience to avoid having to
6070 // connect signals to all objects managed by @manager.
6071 // <object>: The #GDBusObject on which an interface was added.
6072 // <interface>: The #GDBusInterface that was added.
6073 extern (C) alias static void function (DBusObjectManager* this_, DBusObject* object, DBusInterface* interface_, void* user_data=null) signal_interface_added;
6075 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
6076 return super_.signal_connect!name(cb, data, cf);
6079 ulong signal_connect(string name:"interface-added", CB:signal_interface_added)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
6080 return signal_connect_data!()(&this, cast(char*)"interface-added",
6081 cast(GObject2.Callback)cb, data, null, cf);
6084 // VERSION: 2.30
6085 // Emitted when @interface has been removed from @object.
6087 // This signal exists purely as a convenience to avoid having to
6088 // connect signals to all objects managed by @manager.
6089 // <object>: The #GDBusObject on which an interface was removed.
6090 // <interface>: The #GDBusInterface that was removed.
6091 extern (C) alias static void function (DBusObjectManager* this_, DBusObject* object, DBusInterface* interface_, void* user_data=null) signal_interface_removed;
6092 ulong signal_connect(string name:"interface-removed", CB:signal_interface_removed)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
6093 return signal_connect_data!()(&this, cast(char*)"interface-removed",
6094 cast(GObject2.Callback)cb, data, null, cf);
6097 // VERSION: 2.30
6098 // Emitted when @object is added to @manager.
6099 // <object>: The #GDBusObject that was added.
6100 extern (C) alias static void function (DBusObjectManager* this_, DBusObject* object, void* user_data=null) signal_object_added;
6101 ulong signal_connect(string name:"object-added", CB:signal_object_added)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
6102 return signal_connect_data!()(&this, cast(char*)"object-added",
6103 cast(GObject2.Callback)cb, data, null, cf);
6106 // VERSION: 2.30
6107 // Emitted when @object is removed from @manager.
6108 // <object>: The #GDBusObject that was removed.
6109 extern (C) alias static void function (DBusObjectManager* this_, DBusObject* object, void* user_data=null) signal_object_removed;
6110 ulong signal_connect(string name:"object-removed", CB:signal_object_removed)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
6111 return signal_connect_data!()(&this, cast(char*)"object-removed",
6112 cast(GObject2.Callback)cb, data, null, cf);
6115 mixin __interface__;
6119 // #GDBusObjectManagerClient is used to create, monitor and delete object
6120 // proxies for remote objects exported by a #GDBusObjectManagerServer (or any
6121 // code implementing the <ulink
6122 // url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">org.freedesktop.DBus.ObjectManager</ulink>
6123 // interface).
6125 // Once an instance of this type has been created, you can connect to
6126 // the #GDBusObjectManager::object-added and
6127 // #GDBusObjectManager::object-removed signals and inspect the
6128 // #GDBusObjectProxy objects returned by
6129 // g_dbus_object_manager_get_objects().
6131 // If the name for a #GDBusObjectManagerClient is not owned by anyone at
6132 // object construction time, the default behavior is to request the
6133 // message bus to launch an owner for the name. This behavior can be
6134 // disabled using the %G_DBUS_OBJECT_MANAGER_CLIENT_FLAGS_DO_NOT_AUTO_START
6135 // flag. It's also worth noting that this only works if the name of
6136 // interest is activatable in the first place. E.g. in some cases it
6137 // is not possible to launch an owner for the requested name. In this
6138 // case, #GDBusObjectManagerClient object construction still succeeds but
6139 // there will be no object proxies
6140 // (e.g. g_dbus_object_manager_get_objects() returns the empty list) and
6141 // the #GDBusObjectManagerClient:name-owner property is %NULL.
6143 // The owner of the requested name can come and go (for example
6144 // consider a system service being restarted) – #GDBusObjectManagerClient
6145 // handles this case too; simply connect to the #GObject::notify
6146 // signal to watch for changes on the #GDBusObjectManagerClient:name-owner
6147 // property. When the name owner vanishes, the behavior is that
6148 // #GDBusObjectManagerClient:name-owner is set to %NULL (this includes
6149 // emission of the #GObject::notify signal) and then
6150 // #GDBusObjectManager::object-removed signals are synthesized
6151 // for all currently existing object proxies. Since
6152 // #GDBusObjectManagerClient:name-owner is %NULL when this happens, you can
6153 // use this information to disambiguate a synthesized signal from a
6154 // genuine signal caused by object removal on the remote
6155 // #GDBusObjectManager. Similarly, when a new name owner appears,
6156 // #GDBusObjectManager::object-added signals are synthesized
6157 // while #GDBusObjectManagerClient:name-owner is still %NULL. Only when all
6158 // object proxies have been added, the #GDBusObjectManagerClient:name-owner
6159 // is set to the new name owner (this includes emission of the
6160 // #GObject::notify signal). Furthermore, you are guaranteed that
6161 // #GDBusObjectManagerClient:name-owner will alternate between a name owner
6162 // (e.g. <literal>:1.42</literal>) and %NULL even in the case where
6163 // the name of interest is atomically replaced
6165 // Ultimately, #GDBusObjectManagerClient is used to obtain #GDBusProxy
6166 // instances. All signals (including the
6167 // <literal>org.freedesktop.DBus.Properties::PropertiesChanged</literal>
6168 // signal) delivered to #GDBusProxy instances are guaranteed to
6169 // originate from the name owner. This guarantee along with the
6170 // behavior described above, means that certain race conditions
6171 // including the <emphasis><quote>half the proxy is from the old owner
6172 // and the other half is from the new owner</quote></emphasis> problem
6173 // cannot happen.
6175 // To avoid having the application connect to signals on the returned
6176 // #GDBusObjectProxy and #GDBusProxy objects, the
6177 // #GDBusObject::interface-added,
6178 // #GDBusObject::interface-removed,
6179 // #GDBusProxy::g-properties-changed and
6180 // #GDBusProxy::g-signal signals
6181 // are also emitted on the #GDBusObjectManagerClient instance managing these
6182 // objects. The signals emitted are
6183 // #GDBusObjectManager::interface-added,
6184 // #GDBusObjectManager::interface-removed,
6185 // #GDBusObjectManagerClient::interface-proxy-properties-changed and
6186 // #GDBusObjectManagerClient::interface-proxy-signal.
6188 // Note that all callbacks and signals are emitted in the
6189 // <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
6190 // that the #GDBusObjectManagerClient object was constructed
6191 // in. Additionally, the #GDBusObjectProxy and #GDBusProxy objects
6192 // originating from the #GDBusObjectManagerClient object will be created in
6193 // the same context and, consequently, will deliver signals in the
6194 // same main loop.
6195 struct DBusObjectManagerClient /* : GObject.Object */ /* Version 2.30 */ {
6196 mixin AsyncInitable.__interface__;
6197 mixin DBusObjectManager.__interface__;
6198 mixin Initable.__interface__;
6199 alias parent_instance this;
6200 alias parent_instance super_;
6201 alias parent_instance object;
6202 GObject2.Object parent_instance;
6203 private DBusObjectManagerClientPrivate* priv;
6206 // VERSION: 2.30
6207 // Finishes an operation started with g_dbus_object_manager_client_new().
6209 // #GDBusObjectManagerClient object or %NULL if @error is set. Free
6210 // with g_object_unref().
6211 // RETURNS: A
6212 // <res>: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_object_manager_client_new().
6213 static DBusObjectManagerClient* /*new*/ new_finish()(AsyncResult* res, GLib2.Error** error=null) {
6214 return g_dbus_object_manager_client_new_finish(res, error);
6217 // VERSION: 2.30
6218 // Finishes an operation started with g_dbus_object_manager_client_new_for_bus().
6220 // #GDBusObjectManagerClient object or %NULL if @error is set. Free
6221 // with g_object_unref().
6222 // RETURNS: A
6223 // <res>: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_object_manager_client_new_for_bus().
6224 static DBusObjectManagerClient* /*new*/ new_for_bus_finish()(AsyncResult* res, GLib2.Error** error=null) {
6225 return g_dbus_object_manager_client_new_for_bus_finish(res, error);
6228 // VERSION: 2.30
6229 // Like g_dbus_object_manager_client_new_sync() but takes a #GBusType instead
6230 // of a #GDBusConnection.
6232 // This is a synchronous failable constructor - the calling thread is
6233 // blocked until a reply is received. See g_dbus_object_manager_client_new_for_bus()
6234 // for the asynchronous version.
6236 // #GDBusObjectManagerClient object or %NULL if @error is set. Free
6237 // with g_object_unref().
6238 // RETURNS: A
6239 // <bus_type>: A #GBusType.
6240 // <flags>: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
6241 // <name>: The owner of the control object (unique or well-known name).
6242 // <object_path>: The object path of the control object.
6243 // <get_proxy_type_func>: A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
6244 // <get_proxy_type_user_data>: User data to pass to @get_proxy_type_func.
6245 // <get_proxy_type_destroy_notify>: Free function for @get_proxy_type_user_data or %NULL.
6246 // <cancellable>: A #GCancellable or %NULL
6247 static DBusObjectManagerClient* /*new*/ 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=null) {
6248 return g_dbus_object_manager_client_new_for_bus_sync(bus_type, flags, name, object_path, get_proxy_type_func, get_proxy_type_user_data, get_proxy_type_destroy_notify, cancellable, error);
6251 // VERSION: 2.30
6252 // Creates a new #GDBusObjectManagerClient object.
6254 // This is a synchronous failable constructor - the calling thread is
6255 // blocked until a reply is received. See g_dbus_object_manager_client_new()
6256 // for the asynchronous version.
6258 // #GDBusObjectManagerClient object or %NULL if @error is set. Free
6259 // with g_object_unref().
6260 // RETURNS: A
6261 // <connection>: A #GDBusConnection.
6262 // <flags>: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
6263 // <name>: The owner of the control object (unique or well-known name).
6264 // <object_path>: The object path of the control object.
6265 // <get_proxy_type_func>: A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
6266 // <get_proxy_type_user_data>: User data to pass to @get_proxy_type_func.
6267 // <get_proxy_type_destroy_notify>: Free function for @get_proxy_type_user_data or %NULL.
6268 // <cancellable>: A #GCancellable or %NULL
6269 static DBusObjectManagerClient* /*new*/ 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=null) {
6270 return g_dbus_object_manager_client_new_sync(connection, flags, name, object_path, get_proxy_type_func, get_proxy_type_user_data, get_proxy_type_destroy_notify, cancellable, error);
6273 // VERSION: 2.30
6274 // Asynchronously creates a new #GDBusObjectManagerClient object.
6276 // This is an asynchronous failable constructor. When the result is
6277 // ready, @callback will be invoked in the
6278 // <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
6279 // of the thread you are calling this method from. You can
6280 // then call g_dbus_object_manager_client_new_finish() to get the result. See
6281 // g_dbus_object_manager_client_new_sync() for the synchronous version.
6282 // <connection>: A #GDBusConnection.
6283 // <flags>: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
6284 // <name>: The owner of the control object (unique or well-known name).
6285 // <object_path>: The object path of the control object.
6286 // <get_proxy_type_func>: A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
6287 // <get_proxy_type_user_data>: User data to pass to @get_proxy_type_func.
6288 // <get_proxy_type_destroy_notify>: Free function for @get_proxy_type_user_data or %NULL.
6289 // <cancellable>: A #GCancellable or %NULL
6290 // <callback>: A #GAsyncReadyCallback to call when the request is satisfied.
6291 // <user_data>: The data to pass to @callback.
6292 static void 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) {
6293 g_dbus_object_manager_client_new(connection, flags, name, object_path, get_proxy_type_func, get_proxy_type_user_data, get_proxy_type_destroy_notify, cancellable, callback, user_data);
6296 // VERSION: 2.30
6297 // Like g_dbus_object_manager_client_new() but takes a #GBusType instead of a
6298 // #GDBusConnection.
6300 // This is an asynchronous failable constructor. When the result is
6301 // ready, @callback will be invoked in the
6302 // <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
6303 // of the thread you are calling this method from. You can
6304 // then call g_dbus_object_manager_client_new_for_bus_finish() to get the result. See
6305 // g_dbus_object_manager_client_new_for_bus_sync() for the synchronous version.
6306 // <bus_type>: A #GBusType.
6307 // <flags>: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
6308 // <name>: The owner of the control object (unique or well-known name).
6309 // <object_path>: The object path of the control object.
6310 // <get_proxy_type_func>: A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
6311 // <get_proxy_type_user_data>: User data to pass to @get_proxy_type_func.
6312 // <get_proxy_type_destroy_notify>: Free function for @get_proxy_type_user_data or %NULL.
6313 // <cancellable>: A #GCancellable or %NULL
6314 // <callback>: A #GAsyncReadyCallback to call when the request is satisfied.
6315 // <user_data>: The data to pass to @callback.
6316 static void 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) {
6317 g_dbus_object_manager_client_new_for_bus(bus_type, flags, name, object_path, get_proxy_type_func, get_proxy_type_user_data, get_proxy_type_destroy_notify, cancellable, callback, user_data);
6320 // VERSION: 2.30
6321 // Gets the #GDBusConnection used by @manager.
6323 // the object belongs to @manager.
6324 // RETURNS: A #GDBusConnection object. Do not free,
6325 DBusConnection* get_connection()() {
6326 return g_dbus_object_manager_client_get_connection(&this);
6329 // VERSION: 2.30
6330 // Gets the flags that @manager was constructed with.
6332 // enumeration.
6333 // RETURNS: Zero of more flags from the #GDBusObjectManagerClientFlags
6334 DBusObjectManagerClientFlags get_flags()() {
6335 return g_dbus_object_manager_client_get_flags(&this);
6338 // VERSION: 2.30
6339 // Gets the name that @manager is for.
6341 // belongs to @manager.
6342 // RETURNS: A unique or well-known name. Do not free, the string
6343 char* get_name()() {
6344 return g_dbus_object_manager_client_get_name(&this);
6347 // VERSION: 2.30
6348 // The unique name that owns the name that @manager is for or %NULL if
6349 // no-one currently owns that name. You can connect to the
6350 // #GObject::notify signal to track changes to the
6351 // #GDBusObjectManagerClient:name-owner property.
6353 // g_free().
6354 // RETURNS: The name owner or %NULL if no name owner exists. Free with
6355 char* /*new*/ get_name_owner()() {
6356 return g_dbus_object_manager_client_get_name_owner(&this);
6359 // VERSION: 2.30
6360 // Emitted when one or more D-Bus properties on proxy changes. The
6361 // local cache has already been updated when this signal fires. Note
6362 // that both @changed_properties and @invalidated_properties are
6363 // guaranteed to never be %NULL (either may be empty though).
6365 // This signal exists purely as a convenience to avoid having to
6366 // connect signals to all interface proxies managed by @manager.
6368 // This signal is emitted in the
6369 // <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
6370 // that @manager was constructed in.
6371 // <object_proxy>: The #GDBusObjectProxy on which an interface has properties that are changing.
6372 // <interface_proxy>: The #GDBusProxy that has properties that are changing.
6373 // <changed_properties>: A #GVariant containing the properties that changed.
6374 // <invalidated_properties>: A %NULL terminated array of properties that was invalidated.
6375 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) signal_interface_proxy_properties_changed;
6377 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
6378 return super_.signal_connect!name(cb, data, cf);
6381 ulong signal_connect(string name:"interface-proxy-properties-changed", CB:signal_interface_proxy_properties_changed)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
6382 return signal_connect_data!()(&this, cast(char*)"interface-proxy-properties-changed",
6383 cast(GObject2.Callback)cb, data, null, cf);
6386 // VERSION: 2.30
6387 // Emitted when a D-Bus signal is received on @interface_proxy.
6389 // This signal exists purely as a convenience to avoid having to
6390 // connect signals to all interface proxies managed by @manager.
6392 // This signal is emitted in the
6393 // <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
6394 // that @manager was constructed in.
6395 // <object_proxy>: The #GDBusObjectProxy on which an interface is emitting a D-Bus signal.
6396 // <interface_proxy>: The #GDBusProxy that is emitting a D-Bus signal.
6397 // <sender_name>: The sender of the signal or NULL if the connection is not a bus connection.
6398 // <signal_name>: The signal name.
6399 // <parameters>: A #GVariant tuple with parameters for the signal.
6400 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) signal_interface_proxy_signal;
6401 ulong signal_connect(string name:"interface-proxy-signal", CB:signal_interface_proxy_signal)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
6402 return signal_connect_data!()(&this, cast(char*)"interface-proxy-signal",
6403 cast(GObject2.Callback)cb, data, null, cf);
6407 // Class structure for #GDBusObjectManagerClient.
6408 struct DBusObjectManagerClientClass /* Version 2.30 */ {
6409 GObject2.ObjectClass parent_class;
6410 extern (C) void function (DBusObjectManagerClient* manager, DBusObjectProxy* object_proxy, DBusProxy* interface_proxy, char* sender_name, char* signal_name, GLib2.Variant* parameters) interface_proxy_signal;
6411 extern (C) void function (DBusObjectManagerClient* manager, DBusObjectProxy* object_proxy, DBusProxy* interface_proxy, GLib2.Variant* changed_properties, char** invalidated_properties) interface_proxy_properties_changed;
6412 private void*[8] padding;
6415 // Flags used when constructing a #GDBusObjectManagerClient.
6416 enum DBusObjectManagerClientFlags /* Version 2.30 */ {
6417 NONE = 0,
6418 DO_NOT_AUTO_START = 1
6420 struct DBusObjectManagerClientPrivate {
6423 // Base type for D-Bus object managers.
6424 struct DBusObjectManagerIface /* Version 2.30 */ {
6425 GObject2.TypeInterface parent_iface;
6426 // RETURNS: A string owned by @manager. Do not free.
6427 extern (C) char* function (DBusObjectManager* manager) get_object_path;
6428 // RETURNS: A list of
6429 extern (C) GLib2.List* /*new*/ function (DBusObjectManager* manager) get_objects;
6431 // RETURNS: A #GDBusObject or %NULL. Free with
6432 // <object_path>: Object path to lookup.
6433 extern (C) DBusObject* /*new*/ function (DBusObjectManager* manager, char* object_path) get_object;
6435 // RETURNS: A #GDBusInterface instance or %NULL. Free
6436 // <object_path>: Object path to lookup.
6437 // <interface_name>: D-Bus interface name to lookup.
6438 extern (C) DBusInterface* /*new*/ function (DBusObjectManager* manager, char* object_path, char* interface_name) get_interface;
6439 extern (C) void function (DBusObjectManager* manager, DBusObject* object) object_added;
6440 extern (C) void function (DBusObjectManager* manager, DBusObject* object) object_removed;
6441 extern (C) void function (DBusObjectManager* manager, DBusObject* object, DBusInterface* interface_) interface_added;
6442 extern (C) void function (DBusObjectManager* manager, DBusObject* object, DBusInterface* interface_) interface_removed;
6446 // #GDBusObjectManagerServer is used to export #GDBusObject instances using
6447 // the standardized <ulink
6448 // url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">org.freedesktop.DBus.ObjectManager</ulink>
6449 // interface. For example, remote D-Bus clients can get all objects
6450 // and properties in a single call. Additionally, any change in the
6451 // object hierarchy is broadcast using signals. This means that D-Bus
6452 // clients can keep caches up to date by only listening to D-Bus
6453 // signals.
6455 // See #GDBusObjectManagerClient for the client-side code that is
6456 // intended to be used with #GDBusObjectManagerServer or any D-Bus
6457 // object implementing the org.freedesktop.DBus.ObjectManager
6458 // interface.
6459 struct DBusObjectManagerServer /* : GObject.Object */ /* Version 2.30 */ {
6460 mixin DBusObjectManager.__interface__;
6461 alias parent_instance this;
6462 alias parent_instance super_;
6463 alias parent_instance object;
6464 GObject2.Object parent_instance;
6465 private DBusObjectManagerServerPrivate* priv;
6468 // VERSION: 2.30
6469 // Creates a new #GDBusObjectManagerServer object.
6471 // The returned server isn't yet exported on any connection. To do so,
6472 // use g_dbus_object_manager_server_set_connection(). Normally you
6473 // want to export all of your objects before doing so to avoid <ulink
6474 // url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">InterfacesAdded</ulink>
6475 // signals being emitted.
6476 // RETURNS: A #GDBusObjectManagerServer object. Free with g_object_unref().
6477 // <object_path>: The object path to export the manager object at.
6478 static DBusObjectManagerServer* /*new*/ new_()(char* object_path) {
6479 return g_dbus_object_manager_server_new(object_path);
6482 // VERSION: 2.30
6483 // Exports @object on @manager.
6485 // If there is already a #GDBusObject exported at the object path,
6486 // then the old object is removed.
6488 // The object path for @object must be in the hierarchy rooted by the
6489 // object path for @manager.
6491 // Note that @manager will take a reference on @object for as long as
6492 // it is exported.
6493 // <object>: A #GDBusObjectSkeleton.
6494 void export_()(DBusObjectSkeleton* object) {
6495 g_dbus_object_manager_server_export(&this, object);
6498 // VERSION: 2.30
6499 // Like g_dbus_object_manager_server_export() but appends a string of
6500 // the form <literal>_N</literal> (with N being a natural number) to
6501 // @object<!-- -->'s object path if an object with the given path
6502 // already exists. As such, the #GDBusObjectProxy:g-object-path property
6503 // of @object may be modified.
6504 // <object>: An object.
6505 void export_uniquely()(DBusObjectSkeleton* object) {
6506 g_dbus_object_manager_server_export_uniquely(&this, object);
6509 // VERSION: 2.30
6510 // Gets the #GDBusConnection used by @manager.
6512 // @manager isn't exported on a connection. The returned object should
6513 // be freed with g_object_unref().
6514 // RETURNS: A #GDBusConnection object or %NULL if
6515 DBusConnection* /*new*/ get_connection()() {
6516 return g_dbus_object_manager_server_get_connection(&this);
6519 // Exports all objects managed by @manager on @connection. If
6520 // @connection is %NULL, stops exporting objects.
6521 // <connection>: A #GDBusConnection or %NULL.
6522 void set_connection()(DBusConnection* connection=null) {
6523 g_dbus_object_manager_server_set_connection(&this, connection);
6526 // VERSION: 2.30
6527 // If @manager has an object at @path, removes the object. Otherwise
6528 // does nothing.
6530 // Note that @object_path must be in the hierarchy rooted by the
6531 // object path for @manager.
6532 // RETURNS: %TRUE if object at @object_path was removed, %FALSE otherwise.
6533 // <object_path>: An object path.
6534 int unexport()(char* object_path) {
6535 return g_dbus_object_manager_server_unexport(&this, object_path);
6539 // Class structure for #GDBusObjectManagerServer.
6540 struct DBusObjectManagerServerClass /* Version 2.30 */ {
6541 GObject2.ObjectClass parent_class;
6542 private void*[8] padding;
6545 struct DBusObjectManagerServerPrivate {
6549 // A #GDBusObjectProxy is an object used to represent a remote object
6550 // with one or more D-Bus interfaces. Normally, you don't instantiate
6551 // a #GDBusObjectProxy yourself - typically #GDBusObjectManagerClient
6552 // is used to obtain it.
6553 struct DBusObjectProxy /* : GObject.Object */ /* Version 2.30 */ {
6554 mixin DBusObject.__interface__;
6555 alias parent_instance this;
6556 alias parent_instance super_;
6557 alias parent_instance object;
6558 GObject2.Object parent_instance;
6559 private DBusObjectProxyPrivate* priv;
6562 // VERSION: 2.30
6563 // Creates a new #GDBusObjectProxy for the given connection and
6564 // object path.
6565 // RETURNS: a new #GDBusObjectProxy
6566 // <connection>: a #GDBusConnection
6567 // <object_path>: the object path
6568 static DBusObjectProxy* /*new*/ new_()(DBusConnection* connection, char* object_path) {
6569 return g_dbus_object_proxy_new(connection, object_path);
6572 // VERSION: 2.30
6573 // Gets the connection that @proxy is for.
6575 // object is owned by @proxy.
6576 // RETURNS: A #GDBusConnection. Do not free, the
6577 DBusConnection* get_connection()() {
6578 return g_dbus_object_proxy_get_connection(&this);
6582 // Class structure for #GDBusObjectProxy.
6583 struct DBusObjectProxyClass /* Version 2.30 */ {
6584 GObject2.ObjectClass parent_class;
6585 private void*[8] padding;
6588 struct DBusObjectProxyPrivate {
6592 // A #GDBusObjectSkeleton instance is essentially a group of D-Bus
6593 // interfaces. The set of exported interfaces on the object may be
6594 // dynamic and change at runtime.
6596 // This type is intended to be used with #GDBusObjectManager.
6597 struct DBusObjectSkeleton /* : GObject.Object */ /* Version 2.30 */ {
6598 mixin DBusObject.__interface__;
6599 alias parent_instance this;
6600 alias parent_instance super_;
6601 alias parent_instance object;
6602 GObject2.Object parent_instance;
6603 private DBusObjectSkeletonPrivate* priv;
6606 // VERSION: 2.30
6607 // Creates a new #GDBusObjectSkeleton.
6608 // RETURNS: A #GDBusObjectSkeleton. Free with g_object_unref().
6609 // <object_path>: An object path.
6610 static DBusObjectSkeleton* /*new*/ new_()(char* object_path) {
6611 return g_dbus_object_skeleton_new(object_path);
6614 // VERSION: 2.30
6615 // Adds @interface_ to @object.
6617 // If @object already contains a #GDBusInterfaceSkeleton with the same
6618 // interface name, it is removed before @interface_ is added.
6620 // Note that @object takes its own reference on @interface_ and holds
6621 // it until removed.
6622 // <interface_>: A #GDBusInterfaceSkeleton.
6623 void add_interface()(DBusInterfaceSkeleton* interface_) {
6624 g_dbus_object_skeleton_add_interface(&this, interface_);
6627 // VERSION: 2.30
6628 // This method simply calls g_dbus_interface_skeleton_flush() on all
6629 // interfaces belonging to @object. See that method for when flushing
6630 // is useful.
6631 void flush()() {
6632 g_dbus_object_skeleton_flush(&this);
6635 // VERSION: 2.30
6636 // Removes @interface_ from @object.
6637 // <interface_>: A #GDBusInterfaceSkeleton.
6638 void remove_interface()(DBusInterfaceSkeleton* interface_) {
6639 g_dbus_object_skeleton_remove_interface(&this, interface_);
6642 // VERSION: 2.30
6643 // Removes the #GDBusInterface with @interface_name from @object.
6645 // If no D-Bus interface of the given interface exists, this function
6646 // does nothing.
6647 // <interface_name>: A D-Bus interface name.
6648 void remove_interface_by_name()(char* interface_name) {
6649 g_dbus_object_skeleton_remove_interface_by_name(&this, interface_name);
6652 // VERSION: 2.30
6653 // Sets the object path for @object.
6654 // <object_path>: A valid D-Bus object path.
6655 void set_object_path()(char* object_path) {
6656 g_dbus_object_skeleton_set_object_path(&this, object_path);
6659 // VERSION: 2.30
6660 // Emitted when a method is invoked by a remote caller and used to
6661 // determine if the method call is authorized.
6663 // This signal is like #GDBusInterfaceSkeleton<!-- -->'s
6664 // #GDBusInterfaceSkeleton::g-authorize-method signal, except that it is
6665 // for the enclosing object.
6667 // The default class handler just returns %TRUE.
6668 // RETURNS: %TRUE if the call is authorized, %FALSE otherwise.
6669 // <interface>: The #GDBusInterfaceSkeleton that @invocation is for.
6670 // <invocation>: A #GDBusMethodInvocation.
6671 extern (C) alias static c_int function (DBusObjectSkeleton* this_, DBusInterfaceSkeleton* interface_, DBusMethodInvocation* invocation, void* user_data=null) signal_authorize_method;
6673 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
6674 return super_.signal_connect!name(cb, data, cf);
6677 ulong signal_connect(string name:"authorize-method", CB:signal_authorize_method)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
6678 return signal_connect_data!()(&this, cast(char*)"authorize-method",
6679 cast(GObject2.Callback)cb, data, null, cf);
6683 // Class structure for #GDBusObjectSkeleton.
6684 struct DBusObjectSkeletonClass /* Version 2.30 */ {
6685 GObject2.ObjectClass parent_class;
6686 extern (C) int function (DBusObjectSkeleton* object, DBusInterfaceSkeleton* interface_, DBusMethodInvocation* invocation) authorize_method;
6687 private void*[8] padding;
6690 struct DBusObjectSkeletonPrivate {
6693 // Information about a D-Bus property on a D-Bus interface.
6694 struct DBusPropertyInfo /* Version 2.26 */ {
6695 int ref_count;
6696 char* name, signature;
6697 DBusPropertyInfoFlags flags;
6698 DBusAnnotationInfo*[666] annotations;
6701 // VERSION: 2.26
6702 // If @info is statically allocated does nothing. Otherwise increases
6703 // the reference count.
6704 // RETURNS: The same @info.
6705 DBusPropertyInfo* /*new*/ ref_()() {
6706 return g_dbus_property_info_ref(&this);
6709 // VERSION: 2.26
6710 // If @info is statically allocated, does nothing. Otherwise decreases
6711 // the reference count of @info. When its reference count drops to 0,
6712 // the memory used is freed.
6713 void unref()() {
6714 g_dbus_property_info_unref(&this);
6718 // Flags describing the access control of a D-Bus property.
6719 enum DBusPropertyInfoFlags /* Version 2.26 */ {
6720 NONE = 0,
6721 READABLE = 1,
6722 WRITABLE = 2
6725 // #GDBusProxy is a base class used for proxies to access a D-Bus
6726 // interface on a remote object. A #GDBusProxy can be constructed for
6727 // both well-known and unique names.
6729 // By default, #GDBusProxy will cache all properties (and listen to
6730 // changes) of the remote object, and proxy all signals that gets
6731 // emitted. This behaviour can be changed by passing suitable
6732 // #GDBusProxyFlags when the proxy is created. If the proxy is for a
6733 // well-known name, the property cache is flushed when the name owner
6734 // vanishes and reloaded when a name owner appears.
6736 // If a #GDBusProxy is used for a well-known name, the owner of the
6737 // name is tracked and can be read from
6738 // #GDBusProxy:g-name-owner. Connect to the #GObject::notify signal to
6739 // get notified of changes. Additionally, only signals and property
6740 // changes emitted from the current name owner are considered and
6741 // calls are always sent to the current name owner. This avoids a
6742 // number of race conditions when the name is lost by one owner and
6743 // claimed by another. However, if no name owner currently exists,
6744 // then calls will be sent to the well-known name which may result in
6745 // the message bus launching an owner (unless
6746 // %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START is set).
6748 // The generic #GDBusProxy::g-properties-changed and
6749 // #GDBusProxy::g-signal signals are not very convenient to work
6750 // with. Therefore, the recommended way of working with proxies is to
6751 // subclass #GDBusProxy, and have more natural properties and signals
6752 // in your derived class. See <xref linkend="gdbus-example-gdbus-codegen"/>
6753 // for how this can easily be done using the
6754 // <command><link linkend="gdbus-codegen">gdbus-codegen</link></command>
6755 // tool.
6757 // A #GDBusProxy instance can be used from multiple threads but note
6758 // that all signals (e.g. #GDBusProxy::g-signal, #GDBusProxy::g-properties-changed
6759 // and #GObject::notify) are emitted in the
6760 // <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
6761 // of the thread where the instance was constructed.
6763 // <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>
6764 struct DBusProxy /* : GObject.Object */ /* Version 2.26 */ {
6765 mixin AsyncInitable.__interface__;
6766 mixin DBusInterface.__interface__;
6767 mixin Initable.__interface__;
6768 alias parent_instance this;
6769 alias parent_instance super_;
6770 alias parent_instance object;
6771 GObject2.Object parent_instance;
6772 private DBusProxyPrivate* priv;
6775 // VERSION: 2.26
6776 // Finishes creating a #GDBusProxy.
6777 // RETURNS: A #GDBusProxy or %NULL if @error is set. Free with g_object_unref().
6778 // <res>: A #GAsyncResult obtained from the #GAsyncReadyCallback function passed to g_dbus_proxy_new().
6779 static DBusProxy* /*new*/ new_finish()(AsyncResult* res, GLib2.Error** error=null) {
6780 return g_dbus_proxy_new_finish(res, error);
6783 // VERSION: 2.26
6784 // Finishes creating a #GDBusProxy.
6785 // RETURNS: A #GDBusProxy or %NULL if @error is set. Free with g_object_unref().
6786 // <res>: A #GAsyncResult obtained from the #GAsyncReadyCallback function passed to g_dbus_proxy_new_for_bus().
6787 static DBusProxy* /*new*/ new_for_bus_finish()(AsyncResult* res, GLib2.Error** error=null) {
6788 return g_dbus_proxy_new_for_bus_finish(res, error);
6791 // VERSION: 2.26
6792 // Like g_dbus_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
6794 // See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
6795 // RETURNS: A #GDBusProxy or %NULL if error is set. Free with g_object_unref().
6796 // <bus_type>: A #GBusType.
6797 // <flags>: Flags used when constructing the proxy.
6798 // <info>: A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
6799 // <name>: A bus name (well-known or unique).
6800 // <object_path>: An object path.
6801 // <interface_name>: A D-Bus interface name.
6802 // <cancellable>: A #GCancellable or %NULL.
6803 static DBusProxy* /*new*/ new_for_bus_sync()(BusType bus_type, DBusProxyFlags flags, DBusInterfaceInfo* info, char* name, char* object_path, char* interface_name, Cancellable* cancellable, GLib2.Error** error=null) {
6804 return g_dbus_proxy_new_for_bus_sync(bus_type, flags, info, name, object_path, interface_name, cancellable, error);
6807 // VERSION: 2.26
6808 // Creates a proxy for accessing @interface_name on the remote object
6809 // at @object_path owned by @name at @connection and synchronously
6810 // loads D-Bus properties unless the
6811 // %G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES flag is used.
6813 // If the %G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS flag is not set, also sets up
6814 // match rules for signals. Connect to the #GDBusProxy::g-signal signal
6815 // to handle signals from the remote object.
6817 // If @name is a well-known name and the
6818 // %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START flag isn't set and no name
6819 // owner currently exists, the message bus will be requested to launch
6820 // a name owner for the name.
6822 // This is a synchronous failable constructor. See g_dbus_proxy_new()
6823 // and g_dbus_proxy_new_finish() for the asynchronous version.
6825 // See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
6826 // RETURNS: A #GDBusProxy or %NULL if error is set. Free with g_object_unref().
6827 // <connection>: A #GDBusConnection.
6828 // <flags>: Flags used when constructing the proxy.
6829 // <info>: A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
6830 // <name>: A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
6831 // <object_path>: An object path.
6832 // <interface_name>: A D-Bus interface name.
6833 // <cancellable>: A #GCancellable or %NULL.
6834 static DBusProxy* /*new*/ new_sync()(DBusConnection* connection, DBusProxyFlags flags, DBusInterfaceInfo* info, char* name, char* object_path, char* interface_name, Cancellable* cancellable, GLib2.Error** error=null) {
6835 return g_dbus_proxy_new_sync(connection, flags, info, name, object_path, interface_name, cancellable, error);
6838 // VERSION: 2.26
6839 // Creates a proxy for accessing @interface_name on the remote object
6840 // at @object_path owned by @name at @connection and asynchronously
6841 // loads D-Bus properties unless the
6842 // %G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES flag is used. Connect to
6843 // the #GDBusProxy::g-properties-changed signal to get notified about
6844 // property changes.
6846 // If the %G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS flag is not set, also sets up
6847 // match rules for signals. Connect to the #GDBusProxy::g-signal signal
6848 // to handle signals from the remote object.
6850 // If @name is a well-known name and the
6851 // %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START flag isn't set and no name
6852 // owner currently exists, the message bus will be requested to launch
6853 // a name owner for the name.
6855 // This is a failable asynchronous constructor - when the proxy is
6856 // ready, @callback will be invoked and you can use
6857 // g_dbus_proxy_new_finish() to get the result.
6859 // See g_dbus_proxy_new_sync() and for a synchronous version of this constructor.
6861 // See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
6862 // <connection>: A #GDBusConnection.
6863 // <flags>: Flags used when constructing the proxy.
6864 // <info>: A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
6865 // <name>: A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
6866 // <object_path>: An object path.
6867 // <interface_name>: A D-Bus interface name.
6868 // <cancellable>: A #GCancellable or %NULL.
6869 // <callback>: Callback function to invoke when the proxy is ready.
6870 // <user_data>: User data to pass to @callback.
6871 static void new_()(DBusConnection* connection, DBusProxyFlags flags, DBusInterfaceInfo* info, char* name, char* object_path, char* interface_name, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
6872 g_dbus_proxy_new(connection, flags, info, name, object_path, interface_name, cancellable, callback, user_data);
6875 // VERSION: 2.26
6876 // Like g_dbus_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
6878 // See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
6879 // <bus_type>: A #GBusType.
6880 // <flags>: Flags used when constructing the proxy.
6881 // <info>: A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
6882 // <name>: A bus name (well-known or unique).
6883 // <object_path>: An object path.
6884 // <interface_name>: A D-Bus interface name.
6885 // <cancellable>: A #GCancellable or %NULL.
6886 // <callback>: Callback function to invoke when the proxy is ready.
6887 // <user_data>: User data to pass to @callback.
6888 static void 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) {
6889 g_dbus_proxy_new_for_bus(bus_type, flags, info, name, object_path, interface_name, cancellable, callback, user_data);
6892 // VERSION: 2.26
6893 // Asynchronously invokes the @method_name method on @proxy.
6895 // If @method_name contains any dots, then @name is split into interface and
6896 // method name parts. This allows using @proxy for invoking methods on
6897 // other interfaces.
6899 // If the #GDBusConnection associated with @proxy is closed then
6900 // the operation will fail with %G_IO_ERROR_CLOSED. If
6901 // @cancellable is canceled, the operation will fail with
6902 // %G_IO_ERROR_CANCELLED. If @parameters contains a value not
6903 // compatible with the D-Bus protocol, the operation fails with
6904 // %G_IO_ERROR_INVALID_ARGUMENT.
6906 // If the @parameters #GVariant is floating, it is consumed. This allows
6907 // convenient 'inline' use of g_variant_new(), e.g.:
6908 // |[
6909 // g_dbus_proxy_call (proxy,
6910 // "TwoStrings",
6911 // g_variant_new ("(ss)",
6912 // "Thing One",
6913 // "Thing Two"),
6914 // G_DBUS_CALL_FLAGS_NONE,
6915 // -1,
6916 // NULL,
6917 // (GAsyncReadyCallback) two_strings_done,
6918 // &amp;data);
6919 // ]|
6921 // If @proxy has an expected interface (see
6922 // #GDBusProxy:g-interface-info) and @method_name is referenced by it,
6923 // then the return value is checked against the return type.
6925 // This is an asynchronous method. When the operation is finished,
6926 // @callback will be invoked in the
6927 // <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
6928 // of the thread you are calling this method from.
6929 // You can then call g_dbus_proxy_call_finish() to get the result of
6930 // the operation. See g_dbus_proxy_call_sync() for the synchronous
6931 // version of this method.
6932 // <method_name>: Name of method to invoke.
6933 // <parameters>: A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
6934 // <flags>: Flags from the #GDBusCallFlags enumeration.
6935 // <timeout_msec>: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
6936 // <cancellable>: A #GCancellable or %NULL.
6937 // <callback>: A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result of the method invocation.
6938 // <user_data>: The data to pass to @callback.
6939 void call()(char* method_name, GLib2.Variant* parameters, DBusCallFlags flags, int timeout_msec, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
6940 g_dbus_proxy_call(&this, method_name, parameters, flags, timeout_msec, cancellable, callback, user_data);
6943 // VERSION: 2.26
6944 // Finishes an operation started with g_dbus_proxy_call().
6946 // return values. Free with g_variant_unref().
6947 // RETURNS: %NULL if @error is set. Otherwise a #GVariant tuple with
6948 // <res>: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_proxy_call().
6949 GLib2.Variant* /*new*/ call_finish()(AsyncResult* res, GLib2.Error** error=null) {
6950 return g_dbus_proxy_call_finish(&this, res, error);
6953 // VERSION: 2.26
6954 // Synchronously invokes the @method_name method on @proxy.
6956 // If @method_name contains any dots, then @name is split into interface and
6957 // method name parts. This allows using @proxy for invoking methods on
6958 // other interfaces.
6960 // If the #GDBusConnection associated with @proxy is disconnected then
6961 // the operation will fail with %G_IO_ERROR_CLOSED. If
6962 // @cancellable is canceled, the operation will fail with
6963 // %G_IO_ERROR_CANCELLED. If @parameters contains a value not
6964 // compatible with the D-Bus protocol, the operation fails with
6965 // %G_IO_ERROR_INVALID_ARGUMENT.
6967 // If the @parameters #GVariant is floating, it is consumed. This allows
6968 // convenient 'inline' use of g_variant_new(), e.g.:
6969 // |[
6970 // g_dbus_proxy_call_sync (proxy,
6971 // "TwoStrings",
6972 // g_variant_new ("(ss)",
6973 // "Thing One",
6974 // "Thing Two"),
6975 // G_DBUS_CALL_FLAGS_NONE,
6976 // -1,
6977 // NULL,
6978 // &amp;error);
6979 // ]|
6981 // The calling thread is blocked until a reply is received. See
6982 // g_dbus_proxy_call() for the asynchronous version of this
6983 // method.
6985 // If @proxy has an expected interface (see
6986 // #GDBusProxy:g-interface-info) and @method_name is referenced by it,
6987 // then the return value is checked against the return type.
6989 // return values. Free with g_variant_unref().
6990 // RETURNS: %NULL if @error is set. Otherwise a #GVariant tuple with
6991 // <method_name>: Name of method to invoke.
6992 // <parameters>: A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
6993 // <flags>: Flags from the #GDBusCallFlags enumeration.
6994 // <timeout_msec>: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
6995 // <cancellable>: A #GCancellable or %NULL.
6996 GLib2.Variant* /*new*/ call_sync()(char* method_name, GLib2.Variant* parameters, DBusCallFlags flags, int timeout_msec, Cancellable* cancellable, GLib2.Error** error=null) {
6997 return g_dbus_proxy_call_sync(&this, method_name, parameters, flags, timeout_msec, cancellable, error);
7000 // VERSION: 2.30
7001 // Like g_dbus_proxy_call() but also takes a #GUnixFDList object.
7003 // This method is only available on UNIX.
7004 // <method_name>: Name of method to invoke.
7005 // <parameters>: A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
7006 // <flags>: Flags from the #GDBusCallFlags enumeration.
7007 // <timeout_msec>: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
7008 // <fd_list>: A #GUnixFDList or %NULL.
7009 // <cancellable>: A #GCancellable or %NULL.
7010 // <callback>: A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result of the method invocation.
7011 // <user_data>: The data to pass to @callback.
7012 void call_with_unix_fd_list()(char* method_name, GLib2.Variant* parameters, DBusCallFlags flags, int timeout_msec, UnixFDList* fd_list, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
7013 g_dbus_proxy_call_with_unix_fd_list(&this, method_name, parameters, flags, timeout_msec, fd_list, cancellable, callback, user_data);
7016 // VERSION: 2.30
7017 // Finishes an operation started with g_dbus_proxy_call_with_unix_fd_list().
7019 // return values. Free with g_variant_unref().
7020 // RETURNS: %NULL if @error is set. Otherwise a #GVariant tuple with
7021 // <out_fd_list>: Return location for a #GUnixFDList or %NULL.
7022 // <res>: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_proxy_call_with_unix_fd_list().
7023 GLib2.Variant* /*new*/ call_with_unix_fd_list_finish()(/*out*/ UnixFDList** out_fd_list, AsyncResult* res, GLib2.Error** error=null) {
7024 return g_dbus_proxy_call_with_unix_fd_list_finish(&this, out_fd_list, res, error);
7027 // VERSION: 2.30
7028 // Like g_dbus_proxy_call_sync() but also takes and returns #GUnixFDList objects.
7030 // This method is only available on UNIX.
7032 // return values. Free with g_variant_unref().
7033 // RETURNS: %NULL if @error is set. Otherwise a #GVariant tuple with
7034 // <method_name>: Name of method to invoke.
7035 // <parameters>: A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
7036 // <flags>: Flags from the #GDBusCallFlags enumeration.
7037 // <timeout_msec>: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
7038 // <fd_list>: A #GUnixFDList or %NULL.
7039 // <out_fd_list>: Return location for a #GUnixFDList or %NULL.
7040 // <cancellable>: A #GCancellable or %NULL.
7041 GLib2.Variant* /*new*/ call_with_unix_fd_list_sync()(char* method_name, GLib2.Variant* parameters, DBusCallFlags flags, int timeout_msec, UnixFDList* fd_list, /*out*/ UnixFDList** out_fd_list, Cancellable* cancellable, GLib2.Error** error=null) {
7042 return g_dbus_proxy_call_with_unix_fd_list_sync(&this, method_name, parameters, flags, timeout_msec, fd_list, out_fd_list, cancellable, error);
7045 // VERSION: 2.26
7046 // Looks up the value for a property from the cache. This call does no
7047 // blocking IO.
7049 // If @proxy has an expected interface (see
7050 // #GDBusProxy:g-interface-info) and @property_name is referenced by
7051 // it, then @value is checked against the type of the property.
7053 // for @property_name or %NULL if the value is not in the cache. The
7054 // returned reference must be freed with g_variant_unref().
7055 // RETURNS: A reference to the #GVariant instance that holds the value
7056 // <property_name>: Property name.
7057 GLib2.Variant* /*new*/ get_cached_property()(char* property_name) {
7058 return g_dbus_proxy_get_cached_property(&this, property_name);
7061 // VERSION: 2.26
7062 // Gets the names of all cached properties on @proxy.
7064 // @proxy has no cached properties. Free the returned array with
7065 // g_strfreev().
7066 // RETURNS: A %NULL-terminated array of strings or %NULL if
7067 char** /*new*/ get_cached_property_names()() {
7068 return g_dbus_proxy_get_cached_property_names(&this);
7071 // VERSION: 2.26
7072 // Gets the connection @proxy is for.
7073 // RETURNS: A #GDBusConnection owned by @proxy. Do not free.
7074 DBusConnection* get_connection()() {
7075 return g_dbus_proxy_get_connection(&this);
7078 // VERSION: 2.26
7079 // Gets the timeout to use if -1 (specifying default timeout) is
7080 // passed as @timeout_msec in the g_dbus_proxy_call() and
7081 // g_dbus_proxy_call_sync() functions.
7083 // See the #GDBusProxy:g-default-timeout property for more details.
7084 // RETURNS: Timeout to use for @proxy.
7085 int get_default_timeout()() {
7086 return g_dbus_proxy_get_default_timeout(&this);
7089 // VERSION: 2.26
7090 // Gets the flags that @proxy was constructed with.
7091 // RETURNS: Flags from the #GDBusProxyFlags enumeration.
7092 DBusProxyFlags get_flags()() {
7093 return g_dbus_proxy_get_flags(&this);
7096 // VERSION: 2.26
7097 // Returns the #GDBusInterfaceInfo, if any, specifying the interface
7098 // that @proxy conforms to. See the #GDBusProxy:g-interface-info
7099 // property for more details.
7101 // object, it is owned by @proxy.
7102 // RETURNS: A #GDBusInterfaceInfo or %NULL. Do not unref the returned
7103 DBusInterfaceInfo* /*new*/ get_interface_info()() {
7104 return g_dbus_proxy_get_interface_info(&this);
7107 // VERSION: 2.26
7108 // Gets the D-Bus interface name @proxy is for.
7109 // RETURNS: A string owned by @proxy. Do not free.
7110 char* get_interface_name()() {
7111 return g_dbus_proxy_get_interface_name(&this);
7114 // VERSION: 2.26
7115 // Gets the name that @proxy was constructed for.
7116 // RETURNS: A string owned by @proxy. Do not free.
7117 char* get_name()() {
7118 return g_dbus_proxy_get_name(&this);
7121 // VERSION: 2.26
7122 // The unique name that owns the name that @proxy is for or %NULL if
7123 // no-one currently owns that name. You may connect to the
7124 // #GObject::notify signal to track changes to the
7125 // #GDBusProxy:g-name-owner property.
7126 // RETURNS: The name owner or %NULL if no name owner exists. Free with g_free().
7127 char* /*new*/ get_name_owner()() {
7128 return g_dbus_proxy_get_name_owner(&this);
7131 // VERSION: 2.26
7132 // Gets the object path @proxy is for.
7133 // RETURNS: A string owned by @proxy. Do not free.
7134 char* get_object_path()() {
7135 return g_dbus_proxy_get_object_path(&this);
7138 // VERSION: 2.26
7139 // If @value is not %NULL, sets the cached value for the property with
7140 // name @property_name to the value in @value.
7142 // If @value is %NULL, then the cached value is removed from the
7143 // property cache.
7145 // If @proxy has an expected interface (see
7146 // #GDBusProxy:g-interface-info) and @property_name is referenced by
7147 // it, then @value is checked against the type of the property.
7149 // If the @value #GVariant is floating, it is consumed. This allows
7150 // convenient 'inline' use of g_variant_new(), e.g.
7151 // |[
7152 // g_dbus_proxy_set_cached_property (proxy,
7153 // "SomeProperty",
7154 // g_variant_new ("(si)",
7155 // "A String",
7156 // 42));
7157 // ]|
7159 // Normally you will not need to use this method since @proxy is
7160 // tracking changes using the
7161 // <literal>org.freedesktop.DBus.Properties.PropertiesChanged</literal>
7162 // D-Bus signal. However, for performance reasons an object may decide
7163 // to not use this signal for some properties and instead use a
7164 // proprietary out-of-band mechanism to transmit changes.
7166 // As a concrete example, consider an object with a property
7167 // <literal>ChatroomParticipants</literal> which is an array of
7168 // strings. Instead of transmitting the same (long) array every time
7169 // the property changes, it is more efficient to only transmit the
7170 // delta using e.g. signals <literal>ChatroomParticipantJoined(String
7171 // name)</literal> and <literal>ChatroomParticipantParted(String
7172 // name)</literal>.
7173 // <property_name>: Property name.
7174 // <value>: Value for the property or %NULL to remove it from the cache.
7175 void set_cached_property()(char* property_name, GLib2.Variant* value=null) {
7176 g_dbus_proxy_set_cached_property(&this, property_name, value);
7179 // VERSION: 2.26
7180 // Sets the timeout to use if -1 (specifying default timeout) is
7181 // passed as @timeout_msec in the g_dbus_proxy_call() and
7182 // g_dbus_proxy_call_sync() functions.
7184 // See the #GDBusProxy:g-default-timeout property for more details.
7185 // <timeout_msec>: Timeout in milliseconds.
7186 void set_default_timeout()(int timeout_msec) {
7187 g_dbus_proxy_set_default_timeout(&this, timeout_msec);
7190 // VERSION: 2.26
7191 // Ensure that interactions with @proxy conform to the given
7192 // interface. See the #GDBusProxy:g-interface-info property for more
7193 // details.
7194 // <info>: Minimum interface this proxy conforms to or %NULL to unset.
7195 void set_interface_info()(DBusInterfaceInfo* info=null) {
7196 g_dbus_proxy_set_interface_info(&this, info);
7199 // VERSION: 2.26
7200 // Emitted when one or more D-Bus properties on @proxy changes. The
7201 // local cache has already been updated when this signal fires. Note
7202 // that both @changed_properties and @invalidated_properties are
7203 // guaranteed to never be %NULL (either may be empty though).
7205 // This signal corresponds to the
7206 // <literal>PropertiesChanged</literal> D-Bus signal on the
7207 // <literal>org.freedesktop.DBus.Properties</literal> interface.
7208 // <changed_properties>: A #GVariant containing the properties that changed
7209 // <invalidated_properties>: A %NULL terminated array of properties that was invalidated
7210 extern (C) alias static void function (DBusProxy* this_, GLib2.Variant* changed_properties, char* invalidated_properties, void* user_data=null) signal_g_properties_changed;
7212 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
7213 return super_.signal_connect!name(cb, data, cf);
7216 ulong signal_connect(string name:"g-properties-changed", CB:signal_g_properties_changed)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
7217 return signal_connect_data!()(&this, cast(char*)"g-properties-changed",
7218 cast(GObject2.Callback)cb, data, null, cf);
7221 // VERSION: 2.26
7222 // Emitted when a signal from the remote object and interface that @proxy is for, has been received.
7223 // <sender_name>: The sender of the signal or %NULL if the connection is not a bus connection.
7224 // <signal_name>: The name of the signal.
7225 // <parameters>: A #GVariant tuple with parameters for the signal.
7226 extern (C) alias static void function (DBusProxy* this_, char* sender_name, char* signal_name, GLib2.Variant* parameters, void* user_data=null) signal_g_signal;
7227 ulong signal_connect(string name:"g-signal", CB:signal_g_signal)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
7228 return signal_connect_data!()(&this, cast(char*)"g-signal",
7229 cast(GObject2.Callback)cb, data, null, cf);
7233 // Class structure for #GDBusProxy.
7234 struct DBusProxyClass /* Version 2.26 */ {
7235 private GObject2.ObjectClass parent_class;
7236 extern (C) void function (DBusProxy* proxy, GLib2.Variant* changed_properties, char** invalidated_properties) g_properties_changed;
7237 extern (C) void function (DBusProxy* proxy, char* sender_name, char* signal_name, GLib2.Variant* parameters) g_signal;
7238 private void*[32] padding;
7241 // Flags used when constructing an instance of a #GDBusProxy derived class.
7242 enum DBusProxyFlags /* Version 2.26 */ {
7243 NONE = 0,
7244 DO_NOT_LOAD_PROPERTIES = 1,
7245 DO_NOT_CONNECT_SIGNALS = 2,
7246 DO_NOT_AUTO_START = 4
7248 struct DBusProxyPrivate {
7252 // VERSION: 2.30
7253 // Function signature for a function used to determine the #GType to
7254 // use for an interface proxy (if @interface_name is not %NULL) or
7255 // object proxy (if @interface_name is %NULL).
7257 // This function is called in the
7258 // <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
7259 // that @manager was constructed in.
7261 // must be a #GDBusProxy<!-- -->- or #GDBusObjectProxy<!-- -->-derived
7262 // type.
7263 // RETURNS: A #GType to use for the remote object. The returned type
7264 // <manager>: A #GDBusObjectManagerClient.
7265 // <object_path>: The object path of the remote object.
7266 // <interface_name>: The interface name of the remote object or %NULL if a #GDBusObjectProxy #GType is requested.
7267 // <user_data>: User data.
7268 extern (C) alias Type function (DBusObjectManagerClient* manager, char* object_path, char* interface_name, void* user_data) DBusProxyTypeFunc;
7270 // Flags used when sending #GDBusMessage<!-- -->s on a #GDBusConnection.
7271 enum DBusSendMessageFlags /* Version 2.26 */ {
7272 NONE = 0,
7273 PRESERVE_SERIAL = 1
7276 // #GDBusServer is a helper for listening to and accepting D-Bus
7277 // connections. This can be used to create a new D-Bus server, allowing two
7278 // peers to use the D-Bus protocol for their own specialized communication.
7279 // A server instance provided in this way will not perform message routing or
7280 // implement the org.freedesktop.DBus interface.
7282 // To just export an object on a well-known name on a message bus, such as the
7283 // session or system bus, you should instead use g_bus_own_name().
7285 // <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>
7286 struct DBusServer /* : GObject.Object */ /* Version 2.26 */ {
7287 mixin Initable.__interface__;
7288 alias method_parent this;
7289 alias method_parent super_;
7290 alias method_parent object;
7291 GObject2.Object method_parent;
7294 // VERSION: 2.26
7295 // Creates a new D-Bus server that listens on the first address in
7296 // @address that works.
7298 // Once constructed, you can use g_dbus_server_get_client_address() to
7299 // get a D-Bus address string that clients can use to connect.
7301 // Connect to the #GDBusServer::new-connection signal to handle
7302 // incoming connections.
7304 // The returned #GDBusServer isn't active - you have to start it with
7305 // g_dbus_server_start().
7307 // See <xref linkend="gdbus-peer-to-peer"/> for how #GDBusServer can
7308 // be used.
7310 // This is a synchronous failable constructor. See
7311 // g_dbus_server_new() for the asynchronous version.
7313 // g_object_unref().
7314 // RETURNS: A #GDBusServer or %NULL if @error is set. Free with
7315 // <address>: A D-Bus address.
7316 // <flags>: Flags from the #GDBusServerFlags enumeration.
7317 // <guid>: A D-Bus GUID.
7318 // <observer>: A #GDBusAuthObserver or %NULL.
7319 // <cancellable>: A #GCancellable or %NULL.
7320 static DBusServer* /*new*/ new_sync()(char* address, DBusServerFlags flags, char* guid, DBusAuthObserver* observer, Cancellable* cancellable, GLib2.Error** error=null) {
7321 return g_dbus_server_new_sync(address, flags, guid, observer, cancellable, error);
7324 // VERSION: 2.26
7325 // Gets a D-Bus address string that can be used by clients to connect
7326 // to @server.
7328 // by @server.
7329 // RETURNS: A D-Bus address string. Do not free, the string is owned
7330 char* get_client_address()() {
7331 return g_dbus_server_get_client_address(&this);
7334 // VERSION: 2.26
7335 // Gets the flags for @server.
7336 // RETURNS: A set of flags from the #GDBusServerFlags enumeration.
7337 DBusServerFlags get_flags()() {
7338 return g_dbus_server_get_flags(&this);
7341 // VERSION: 2.26
7342 // Gets the GUID for @server.
7343 // RETURNS: A D-Bus GUID. Do not free this string, it is owned by @server.
7344 char* get_guid()() {
7345 return g_dbus_server_get_guid(&this);
7348 // VERSION: 2.26
7349 // Gets whether @server is active.
7350 // RETURNS: %TRUE if server is active, %FALSE otherwise.
7351 int is_active()() {
7352 return g_dbus_server_is_active(&this);
7355 // VERSION: 2.26
7356 // Starts @server.
7357 void start()() {
7358 g_dbus_server_start(&this);
7361 // VERSION: 2.26
7362 // Stops @server.
7363 void stop()() {
7364 g_dbus_server_stop(&this);
7367 // VERSION: 2.26
7368 // Emitted when a new authenticated connection has been made. Use
7369 // g_dbus_connection_get_peer_credentials() to figure out what
7370 // identity (if any), was authenticated.
7372 // If you want to accept the connection, take a reference to the
7373 // @connection object and return %TRUE. When you are done with the
7374 // connection call g_dbus_connection_close() and give up your
7375 // reference. Note that the other peer may disconnect at any time -
7376 // a typical thing to do when accepting a connection is to listen to
7377 // the #GDBusConnection::closed signal.
7379 // If #GDBusServer:flags contains %G_DBUS_SERVER_FLAGS_RUN_IN_THREAD
7380 // then the signal is emitted in a new thread dedicated to the
7381 // connection. Otherwise the signal is emitted in the <link
7382 // linkend="g-main-context-push-thread-default">thread-default main
7383 // loop</link> of the thread that @server was constructed in.
7385 // You are guaranteed that signal handlers for this signal runs
7386 // before incoming messages on @connection are processed. This means
7387 // that it's suitable to call g_dbus_connection_register_object() or
7388 // similar from the signal handler.
7390 // run.
7391 // RETURNS: %TRUE to claim @connection, %FALSE to let other handlers
7392 // <connection>: A #GDBusConnection for the new connection.
7393 extern (C) alias static c_int function (DBusServer* this_, DBusConnection* connection, void* user_data=null) signal_new_connection;
7395 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
7396 return super_.signal_connect!name(cb, data, cf);
7399 ulong signal_connect(string name:"new-connection", CB:signal_new_connection)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
7400 return signal_connect_data!()(&this, cast(char*)"new-connection",
7401 cast(GObject2.Callback)cb, data, null, cf);
7405 // Flags used when creating a #GDBusServer.
7406 enum DBusServerFlags /* Version 2.26 */ {
7407 NONE = 0,
7408 RUN_IN_THREAD = 1,
7409 AUTHENTICATION_ALLOW_ANONYMOUS = 2
7412 // VERSION: 2.26
7413 // Signature for callback function used in g_dbus_connection_signal_subscribe().
7414 // <connection>: A #GDBusConnection.
7415 // <sender_name>: The unique bus name of the sender of the signal.
7416 // <object_path>: The object path that the signal was emitted on.
7417 // <interface_name>: The name of the interface.
7418 // <signal_name>: The name of the signal.
7419 // <parameters>: A #GVariant tuple with parameters for the signal.
7420 // <user_data>: User data passed when subscribing to the signal.
7421 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) DBusSignalCallback;
7423 // Flags used when subscribing to signals via g_dbus_connection_signal_subscribe().
7424 enum DBusSignalFlags /* Version 2.26 */ {
7425 NONE = 0,
7426 NO_MATCH_RULE = 1
7428 // Information about a signal on a D-Bus interface.
7429 struct DBusSignalInfo /* Version 2.26 */ {
7430 int ref_count;
7431 char* name;
7432 DBusArgInfo*[666] args;
7433 DBusAnnotationInfo*[666] annotations;
7436 // VERSION: 2.26
7437 // If @info is statically allocated does nothing. Otherwise increases
7438 // the reference count.
7439 // RETURNS: The same @info.
7440 DBusSignalInfo* /*new*/ ref_()() {
7441 return g_dbus_signal_info_ref(&this);
7444 // VERSION: 2.26
7445 // If @info is statically allocated, does nothing. Otherwise decreases
7446 // the reference count of @info. When its reference count drops to 0,
7447 // the memory used is freed.
7448 void unref()() {
7449 g_dbus_signal_info_unref(&this);
7454 // VERSION: 2.26
7455 // The type of the @dispatch function in #GDBusSubtreeVTable.
7457 // Subtrees are flat. @node, if non-%NULL, is always exactly one
7458 // segment of the object path (ie: it never contains a slash).
7459 // RETURNS: A #GDBusInterfaceVTable or %NULL if you don't want to handle the methods.
7460 // <connection>: A #GDBusConnection.
7461 // <sender>: The unique bus name of the remote caller.
7462 // <object_path>: The object path that was registered with g_dbus_connection_register_subtree().
7463 // <interface_name>: The D-Bus interface name that the method call or property access is for.
7464 // <node>: A node that is a child of @object_path (relative to @object_path) or %NULL for the root of the subtree.
7465 // <out_user_data>: Return location for user data to pass to functions in the returned #GDBusInterfaceVTable (never %NULL).
7466 // <user_data>: The @user_data #gpointer passed to g_dbus_connection_register_subtree().
7467 extern (C) alias DBusInterfaceVTable* function (DBusConnection* connection, char* sender, char* object_path, char* interface_name, char* node, void** out_user_data, void* user_data) DBusSubtreeDispatchFunc;
7470 // Unintrospectable callback: DBusSubtreeEnumerateFunc() / ()
7471 // VERSION: 2.26
7472 // The type of the @enumerate function in #GDBusSubtreeVTable.
7474 // This function is called when generating introspection data and also
7475 // when preparing to dispatch incoming messages in the event that the
7476 // %G_DBUS_SUBTREE_FLAGS_DISPATCH_TO_UNENUMERATED_NODES flag is not
7477 // specified (ie: to verify that the object path is valid).
7479 // Hierarchies are not supported; the items that you return should not
7480 // contain the '/' character.
7482 // The return value will be freed with g_strfreev().
7483 // RETURNS: A newly allocated array of strings for node names that are children of @object_path.
7484 // <connection>: A #GDBusConnection.
7485 // <sender>: The unique bus name of the remote caller.
7486 // <object_path>: The object path that was registered with g_dbus_connection_register_subtree().
7487 // <user_data>: The @user_data #gpointer passed to g_dbus_connection_register_subtree().
7488 extern (C) alias char** function (DBusConnection* connection, char* sender, char* object_path, void* user_data) DBusSubtreeEnumerateFunc;
7490 // Flags passed to g_dbus_connection_register_subtree().
7491 enum DBusSubtreeFlags /* Version 2.26 */ {
7492 NONE = 0,
7493 DISPATCH_TO_UNENUMERATED_NODES = 1
7496 // VERSION: 2.26
7497 // The type of the @introspect function in #GDBusSubtreeVTable.
7499 // Subtrees are flat. @node, if non-%NULL, is always exactly one
7500 // segment of the object path (ie: it never contains a slash).
7502 // This function should return %NULL to indicate that there is no object
7503 // at this node.
7505 // If this function returns non-%NULL, the return value is expected to
7506 // be a %NULL-terminated array of pointers to #GDBusInterfaceInfo
7507 // structures describing the interfaces implemented by @node. This
7508 // array will have g_dbus_interface_info_unref() called on each item
7509 // before being freed with g_free().
7511 // The difference between returning %NULL and an array containing zero
7512 // items is that the standard DBus interfaces will returned to the
7513 // remote introspector in the empty array case, but not in the %NULL
7514 // case.
7515 // RETURNS: A %NULL-terminated array of pointers to #GDBusInterfaceInfo, or %NULL.
7516 // <connection>: A #GDBusConnection.
7517 // <sender>: The unique bus name of the remote caller.
7518 // <object_path>: The object path that was registered with g_dbus_connection_register_subtree().
7519 // <node>: A node that is a child of @object_path (relative to @object_path) or %NULL for the root of the subtree.
7520 // <user_data>: The @user_data #gpointer passed to g_dbus_connection_register_subtree().
7521 extern (C) alias DBusInterfaceInfo** /*new*/ function (DBusConnection* connection, char* sender, char* object_path, char* node, void* user_data) DBusSubtreeIntrospectFunc;
7523 // Virtual table for handling subtrees registered with g_dbus_connection_register_subtree().
7524 struct DBusSubtreeVTable /* Version 2.26 */ {
7525 DBusSubtreeEnumerateFunc enumerate;
7526 DBusSubtreeIntrospectFunc introspect;
7527 DBusSubtreeDispatchFunc dispatch;
7528 private void*[8] padding;
7531 enum DESKTOP_APP_INFO_LOOKUP_EXTENSION_POINT_NAME = "gio-desktop-app-info-lookup";
7533 // Data input stream implements #GInputStream and includes functions for
7534 // reading structured data directly from a binary input stream.
7535 struct DataInputStream /* : BufferedInputStream */ {
7536 alias parent_instance this;
7537 alias parent_instance super_;
7538 alias parent_instance bufferedinputstream;
7539 BufferedInputStream parent_instance;
7540 private DataInputStreamPrivate* priv;
7543 // Creates a new data input stream for the @base_stream.
7544 // RETURNS: a new #GDataInputStream.
7545 // <base_stream>: a #GInputStream.
7546 static DataInputStream* /*new*/ new_()(InputStream* base_stream) {
7547 return g_data_input_stream_new(base_stream);
7550 // Gets the byte order for the data input stream.
7551 // RETURNS: the @stream's current #GDataStreamByteOrder.
7552 DataStreamByteOrder get_byte_order()() {
7553 return g_data_input_stream_get_byte_order(&this);
7556 // Gets the current newline type for the @stream.
7557 // RETURNS: #GDataStreamNewlineType for the given @stream.
7558 DataStreamNewlineType get_newline_type()() {
7559 return g_data_input_stream_get_newline_type(&this);
7562 // Reads an unsigned 8-bit/1-byte value from @stream.
7564 // if an error occurred.
7565 // RETURNS: an unsigned 8-bit/1-byte value read from the @stream or %0
7566 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7567 ubyte read_byte()(Cancellable* cancellable, GLib2.Error** error=null) {
7568 return g_data_input_stream_read_byte(&this, cancellable, error);
7571 // Reads a 16-bit/2-byte value from @stream.
7573 // In order to get the correct byte order for this read operation,
7574 // see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
7576 // an error occurred.
7577 // RETURNS: a signed 16-bit/2-byte value read from @stream or %0 if
7578 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7579 short read_int16()(Cancellable* cancellable, GLib2.Error** error=null) {
7580 return g_data_input_stream_read_int16(&this, cancellable, error);
7583 // Reads a signed 32-bit/4-byte value from @stream.
7585 // In order to get the correct byte order for this read operation,
7586 // see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
7588 // If @cancellable is not %NULL, then the operation can be cancelled by
7589 // triggering the cancellable object from another thread. If the operation
7590 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
7592 // an error occurred.
7593 // RETURNS: a signed 32-bit/4-byte value read from the @stream or %0 if
7594 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7595 int read_int32()(Cancellable* cancellable, GLib2.Error** error=null) {
7596 return g_data_input_stream_read_int32(&this, cancellable, error);
7599 // Reads a 64-bit/8-byte value from @stream.
7601 // In order to get the correct byte order for this read operation,
7602 // see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
7604 // If @cancellable is not %NULL, then the operation can be cancelled by
7605 // triggering the cancellable object from another thread. If the operation
7606 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
7608 // an error occurred.
7609 // RETURNS: a signed 64-bit/8-byte value read from @stream or %0 if
7610 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7611 long read_int64()(Cancellable* cancellable, GLib2.Error** error=null) {
7612 return g_data_input_stream_read_int64(&this, cancellable, error);
7615 // Reads a line from the data input stream. Note that no encoding
7616 // checks or conversion is performed; the input is not guaranteed to
7617 // be UTF-8, and may in fact have embedded NUL characters.
7619 // If @cancellable is not %NULL, then the operation can be cancelled by
7620 // triggering the cancellable object from another thread. If the operation
7621 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
7623 // NUL terminated byte array with the line that was read in (without
7624 // the newlines). Set @length to a #gsize to get the length of the
7625 // read line. On an error, it will return %NULL and @error will be
7626 // set. If there's no content to read, it will still return %NULL,
7627 // but @error won't be set.
7628 // RETURNS: a
7629 // <length>: a #gsize to get the length of the data read in.
7630 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7631 ubyte* /*new*/ read_line()(/*out*/ size_t* length, Cancellable* cancellable, GLib2.Error** error=null) {
7632 return g_data_input_stream_read_line(&this, length, cancellable, error);
7635 // VERSION: 2.20
7636 // The asynchronous version of g_data_input_stream_read_line(). It is
7637 // an error to have two outstanding calls to this function.
7639 // When the operation is finished, @callback will be called. You
7640 // can then call g_data_input_stream_read_line_finish() to get
7641 // the result of the operation.
7642 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
7643 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7644 // <callback>: callback to call when the request is satisfied.
7645 // <user_data>: the data to pass to callback function.
7646 void read_line_async()(int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
7647 g_data_input_stream_read_line_async(&this, io_priority, cancellable, callback, user_data);
7650 // VERSION: 2.20
7651 // Finish an asynchronous call started by
7652 // g_data_input_stream_read_line_async(). Note the warning about
7653 // string encoding in g_data_input_stream_read_line() applies here as
7654 // well.
7656 // NUL-terminated byte array with the line that was read in
7657 // (without the newlines). Set @length to a #gsize to get the
7658 // length of the read line. On an error, it will return %NULL and
7659 // @error will be set. If there's no content to read, it will
7660 // still return %NULL, but @error won't be set.
7661 // RETURNS: a
7662 // <result>: the #GAsyncResult that was provided to the callback.
7663 // <length>: a #gsize to get the length of the data read in.
7664 ubyte* /*new*/ read_line_finish()(AsyncResult* result, /*out*/ size_t* length, GLib2.Error** error=null) {
7665 return g_data_input_stream_read_line_finish(&this, result, length, error);
7668 // VERSION: 2.30
7669 // Finish an asynchronous call started by
7670 // g_data_input_stream_read_line_async().
7672 // (without the newlines). Set @length to a #gsize to get the length
7673 // of the read line. On an error, it will return %NULL and @error
7674 // will be set. For UTF-8 conversion errors, the set error domain is
7675 // %G_CONVERT_ERROR. If there's no content to read, it will still
7676 // return %NULL, but @error won't be set.
7677 // RETURNS: a string with the line that was read in
7678 // <result>: the #GAsyncResult that was provided to the callback.
7679 // <length>: a #gsize to get the length of the data read in.
7680 char* /*new*/ read_line_finish_utf8()(AsyncResult* result, /*out*/ size_t* length, GLib2.Error** error=null) {
7681 return g_data_input_stream_read_line_finish_utf8(&this, result, length, error);
7684 // VERSION: 2.30
7685 // Reads a UTF-8 encoded line from the data input stream.
7687 // If @cancellable is not %NULL, then the operation can be cancelled by
7688 // triggering the cancellable object from another thread. If the operation
7689 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
7691 // line that was read in (without the newlines). Set @length to a
7692 // #gsize to get the length of the read line. On an error, it will
7693 // return %NULL and @error will be set. For UTF-8 conversion errors,
7694 // the set error domain is %G_CONVERT_ERROR. If there's no content to
7695 // read, it will still return %NULL, but @error won't be set.
7696 // RETURNS: a NUL terminated UTF-8 string with the
7697 // <length>: a #gsize to get the length of the data read in.
7698 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7699 char* /*new*/ read_line_utf8()(/*out*/ size_t* length, Cancellable* cancellable, GLib2.Error** error=null) {
7700 return g_data_input_stream_read_line_utf8(&this, length, cancellable, error);
7703 // Reads an unsigned 16-bit/2-byte value from @stream.
7705 // In order to get the correct byte order for this read operation,
7706 // see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
7708 // an error occurred.
7709 // RETURNS: an unsigned 16-bit/2-byte value read from the @stream or %0 if
7710 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7711 ushort read_uint16()(Cancellable* cancellable, GLib2.Error** error=null) {
7712 return g_data_input_stream_read_uint16(&this, cancellable, error);
7715 // Reads an unsigned 32-bit/4-byte value from @stream.
7717 // In order to get the correct byte order for this read operation,
7718 // see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
7720 // If @cancellable is not %NULL, then the operation can be cancelled by
7721 // triggering the cancellable object from another thread. If the operation
7722 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
7724 // an error occurred.
7725 // RETURNS: an unsigned 32-bit/4-byte value read from the @stream or %0 if
7726 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7727 uint read_uint32()(Cancellable* cancellable, GLib2.Error** error=null) {
7728 return g_data_input_stream_read_uint32(&this, cancellable, error);
7731 // Reads an unsigned 64-bit/8-byte value from @stream.
7733 // In order to get the correct byte order for this read operation,
7734 // see g_data_input_stream_get_byte_order().
7736 // If @cancellable is not %NULL, then the operation can be cancelled by
7737 // triggering the cancellable object from another thread. If the operation
7738 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
7740 // an error occurred.
7741 // RETURNS: an unsigned 64-bit/8-byte read from @stream or %0 if
7742 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7743 ulong read_uint64()(Cancellable* cancellable, GLib2.Error** error=null) {
7744 return g_data_input_stream_read_uint64(&this, cancellable, error);
7747 // Reads a string from the data input stream, up to the first
7748 // occurrence of any of the stop characters.
7750 // Note that, in contrast to g_data_input_stream_read_until_async(),
7751 // this function consumes the stop character that it finds.
7753 // Don't use this function in new code. Its functionality is
7754 // inconsistent with g_data_input_stream_read_until_async(). Both
7755 // functions will be marked as deprecated in a future release. Use
7756 // g_data_input_stream_read_upto() instead, but note that that function
7757 // does not consume the stop character.
7759 // before encountering any of the stop characters. Set @length to
7760 // a #gsize to get the length of the string. This function will
7761 // return %NULL on an error.
7762 // RETURNS: a string with the data that was read
7763 // <stop_chars>: characters to terminate the read.
7764 // <length>: a #gsize to get the length of the data read in.
7765 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7766 char* /*new*/ read_until()(char* stop_chars, /*out*/ size_t* length, Cancellable* cancellable, GLib2.Error** error=null) {
7767 return g_data_input_stream_read_until(&this, stop_chars, length, cancellable, error);
7770 // VERSION: 2.20
7771 // The asynchronous version of g_data_input_stream_read_until().
7772 // It is an error to have two outstanding calls to this function.
7774 // Note that, in contrast to g_data_input_stream_read_until(),
7775 // this function does not consume the stop character that it finds. You
7776 // must read it for yourself.
7778 // When the operation is finished, @callback will be called. You
7779 // can then call g_data_input_stream_read_until_finish() to get
7780 // the result of the operation.
7782 // Don't use this function in new code. Its functionality is
7783 // inconsistent with g_data_input_stream_read_until(). Both functions
7784 // will be marked as deprecated in a future release. Use
7785 // g_data_input_stream_read_upto_async() instead.
7786 // <stop_chars>: characters to terminate the read.
7787 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
7788 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7789 // <callback>: callback to call when the request is satisfied.
7790 // <user_data>: the data to pass to callback function.
7791 void read_until_async()(char* stop_chars, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
7792 g_data_input_stream_read_until_async(&this, stop_chars, io_priority, cancellable, callback, user_data);
7795 // VERSION: 2.20
7796 // Finish an asynchronous call started by
7797 // g_data_input_stream_read_until_async().
7800 // before encountering any of the stop characters. Set @length to
7801 // a #gsize to get the length of the string. This function will
7802 // return %NULL on an error.
7803 // RETURNS: a string with the data that was read
7804 // <result>: the #GAsyncResult that was provided to the callback.
7805 // <length>: a #gsize to get the length of the data read in.
7806 char* /*new*/ read_until_finish()(AsyncResult* result, /*out*/ size_t* length, GLib2.Error** error=null) {
7807 return g_data_input_stream_read_until_finish(&this, result, length, error);
7810 // VERSION: 2.26
7811 // Reads a string from the data input stream, up to the first
7812 // occurrence of any of the stop characters.
7814 // In contrast to g_data_input_stream_read_until(), this function
7815 // does <emphasis>not</emphasis> consume the stop character. You have
7816 // to use g_data_input_stream_read_byte() to get it before calling
7817 // g_data_input_stream_read_upto() again.
7819 // Note that @stop_chars may contain '\0' if @stop_chars_len is
7820 // specified.
7822 // before encountering any of the stop characters. Set @length to
7823 // a #gsize to get the length of the string. This function will
7824 // return %NULL on an error
7825 // RETURNS: a string with the data that was read
7826 // <stop_chars>: characters to terminate the read
7827 // <stop_chars_len>: length of @stop_chars. May be -1 if @stop_chars is nul-terminated
7828 // <length>: a #gsize to get the length of the data read in
7829 // <cancellable>: optional #GCancellable object, %NULL to ignore
7830 char* /*new*/ read_upto()(char* stop_chars, ssize_t stop_chars_len, /*out*/ size_t* length, Cancellable* cancellable, GLib2.Error** error=null) {
7831 return g_data_input_stream_read_upto(&this, stop_chars, stop_chars_len, length, cancellable, error);
7834 // VERSION: 2.26
7835 // The asynchronous version of g_data_input_stream_read_upto().
7836 // It is an error to have two outstanding calls to this function.
7838 // In contrast to g_data_input_stream_read_until(), this function
7839 // does <emphasis>not</emphasis> consume the stop character. You have
7840 // to use g_data_input_stream_read_byte() to get it before calling
7841 // g_data_input_stream_read_upto() again.
7843 // Note that @stop_chars may contain '\0' if @stop_chars_len is
7844 // specified.
7846 // When the operation is finished, @callback will be called. You
7847 // can then call g_data_input_stream_read_upto_finish() to get
7848 // the result of the operation.
7849 // <stop_chars>: characters to terminate the read
7850 // <stop_chars_len>: length of @stop_chars. May be -1 if @stop_chars is nul-terminated
7851 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
7852 // <cancellable>: optional #GCancellable object, %NULL to ignore
7853 // <callback>: callback to call when the request is satisfied
7854 // <user_data>: the data to pass to callback function
7855 void read_upto_async()(char* stop_chars, ssize_t stop_chars_len, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
7856 g_data_input_stream_read_upto_async(&this, stop_chars, stop_chars_len, io_priority, cancellable, callback, user_data);
7859 // VERSION: 2.24
7860 // Finish an asynchronous call started by
7861 // g_data_input_stream_read_upto_async().
7863 // Note that this function does <emphasis>not</emphasis> consume the
7864 // stop character. You have to use g_data_input_stream_read_byte() to
7865 // get it before calling g_data_input_stream_read_upto_async() again.
7867 // before encountering any of the stop characters. Set @length to
7868 // a #gsize to get the length of the string. This function will
7869 // return %NULL on an error.
7870 // RETURNS: a string with the data that was read
7871 // <result>: the #GAsyncResult that was provided to the callback
7872 // <length>: a #gsize to get the length of the data read in
7873 char* /*new*/ read_upto_finish()(AsyncResult* result, /*out*/ size_t* length, GLib2.Error** error=null) {
7874 return g_data_input_stream_read_upto_finish(&this, result, length, error);
7877 // This function sets the byte order for the given @stream. All subsequent
7878 // reads from the @stream will be read in the given @order.
7879 // <order>: a #GDataStreamByteOrder to set.
7880 void set_byte_order()(DataStreamByteOrder order) {
7881 g_data_input_stream_set_byte_order(&this, order);
7884 // Sets the newline type for the @stream.
7886 // Note that using G_DATA_STREAM_NEWLINE_TYPE_ANY is slightly unsafe. If a read
7887 // chunk ends in "CR" we must read an additional byte to know if this is "CR" or
7888 // "CR LF", and this might block if there is no more data available.
7889 // <type>: the type of new line return as #GDataStreamNewlineType.
7890 void set_newline_type()(DataStreamNewlineType type) {
7891 g_data_input_stream_set_newline_type(&this, type);
7895 struct DataInputStreamClass {
7896 BufferedInputStreamClass parent_class;
7897 extern (C) void function () _g_reserved1;
7898 extern (C) void function () _g_reserved2;
7899 extern (C) void function () _g_reserved3;
7900 extern (C) void function () _g_reserved4;
7901 extern (C) void function () _g_reserved5;
7904 struct DataInputStreamPrivate {
7908 // Data output stream implements #GOutputStream and includes functions for
7909 // writing data directly to an output stream.
7910 struct DataOutputStream /* : FilterOutputStream */ {
7911 alias parent_instance this;
7912 alias parent_instance super_;
7913 alias parent_instance filteroutputstream;
7914 FilterOutputStream parent_instance;
7915 private DataOutputStreamPrivate* priv;
7918 // Creates a new data output stream for @base_stream.
7919 // RETURNS: #GDataOutputStream.
7920 // <base_stream>: a #GOutputStream.
7921 static DataOutputStream* /*new*/ new_()(OutputStream* base_stream) {
7922 return g_data_output_stream_new(base_stream);
7925 // Gets the byte order for the stream.
7926 // RETURNS: the #GDataStreamByteOrder for the @stream.
7927 DataStreamByteOrder get_byte_order()() {
7928 return g_data_output_stream_get_byte_order(&this);
7931 // Puts a byte into the output stream.
7932 // RETURNS: %TRUE if @data was successfully added to the @stream.
7933 // <data>: a #guchar.
7934 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7935 int put_byte()(ubyte data, Cancellable* cancellable, GLib2.Error** error=null) {
7936 return g_data_output_stream_put_byte(&this, data, cancellable, error);
7939 // Puts a signed 16-bit integer into the output stream.
7940 // RETURNS: %TRUE if @data was successfully added to the @stream.
7941 // <data>: a #gint16.
7942 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7943 int put_int16()(short data, Cancellable* cancellable, GLib2.Error** error=null) {
7944 return g_data_output_stream_put_int16(&this, data, cancellable, error);
7947 // Puts a signed 32-bit integer into the output stream.
7948 // RETURNS: %TRUE if @data was successfully added to the @stream.
7949 // <data>: a #gint32.
7950 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7951 int put_int32()(int data, Cancellable* cancellable, GLib2.Error** error=null) {
7952 return g_data_output_stream_put_int32(&this, data, cancellable, error);
7955 // Puts a signed 64-bit integer into the stream.
7956 // RETURNS: %TRUE if @data was successfully added to the @stream.
7957 // <data>: a #gint64.
7958 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7959 int put_int64()(long data, Cancellable* cancellable, GLib2.Error** error=null) {
7960 return g_data_output_stream_put_int64(&this, data, cancellable, error);
7963 // Puts a string into the output stream.
7964 // RETURNS: %TRUE if @string was successfully added to the @stream.
7965 // <str>: a string.
7966 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7967 int put_string()(char* str, Cancellable* cancellable, GLib2.Error** error=null) {
7968 return g_data_output_stream_put_string(&this, str, cancellable, error);
7971 // Puts an unsigned 16-bit integer into the output stream.
7972 // RETURNS: %TRUE if @data was successfully added to the @stream.
7973 // <data>: a #guint16.
7974 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7975 int put_uint16()(ushort data, Cancellable* cancellable, GLib2.Error** error=null) {
7976 return g_data_output_stream_put_uint16(&this, data, cancellable, error);
7979 // Puts an unsigned 32-bit integer into the stream.
7980 // RETURNS: %TRUE if @data was successfully added to the @stream.
7981 // <data>: a #guint32.
7982 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7983 int put_uint32()(uint data, Cancellable* cancellable, GLib2.Error** error=null) {
7984 return g_data_output_stream_put_uint32(&this, data, cancellable, error);
7987 // Puts an unsigned 64-bit integer into the stream.
7988 // RETURNS: %TRUE if @data was successfully added to the @stream.
7989 // <data>: a #guint64.
7990 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7991 int put_uint64()(ulong data, Cancellable* cancellable, GLib2.Error** error=null) {
7992 return g_data_output_stream_put_uint64(&this, data, cancellable, error);
7995 // Sets the byte order of the data output stream to @order.
7996 // <order>: a %GDataStreamByteOrder.
7997 void set_byte_order()(DataStreamByteOrder order) {
7998 g_data_output_stream_set_byte_order(&this, order);
8002 struct DataOutputStreamClass {
8003 FilterOutputStreamClass parent_class;
8004 extern (C) void function () _g_reserved1;
8005 extern (C) void function () _g_reserved2;
8006 extern (C) void function () _g_reserved3;
8007 extern (C) void function () _g_reserved4;
8008 extern (C) void function () _g_reserved5;
8011 struct DataOutputStreamPrivate {
8015 // #GDataStreamByteOrder is used to ensure proper endianness of streaming data sources
8016 // across various machine architectures.
8017 enum DataStreamByteOrder {
8018 BIG_ENDIAN = 0,
8019 LITTLE_ENDIAN = 1,
8020 HOST_ENDIAN = 2
8022 // #GDataStreamNewlineType is used when checking for or setting the line endings for a given file.
8023 enum DataStreamNewlineType {
8024 LF = 0,
8025 CR = 1,
8026 CR_LF = 2,
8027 ANY = 3
8030 // #GDesktopAppInfo is an implementation of #GAppInfo based on
8031 // desktop files.
8033 // Note that <filename>&lt;gio/gdesktopappinfo.h&gt;</filename> belongs to
8034 // the UNIX-specific GIO interfaces, thus you have to use the
8035 // <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
8036 struct DesktopAppInfo /* : GObject.Object */ {
8037 mixin AppInfo.__interface__;
8038 alias method_parent this;
8039 alias method_parent super_;
8040 alias method_parent object;
8041 GObject2.Object method_parent;
8044 // Creates a new #GDesktopAppInfo based on a desktop file id.
8046 // A desktop file id is the basename of the desktop file, including the
8047 // .desktop extension. GIO is looking for a desktop file with this name
8048 // in the <filename>applications</filename> subdirectories of the XDG data
8049 // directories (i.e. the directories specified in the
8050 // <envar>XDG_DATA_HOME</envar> and <envar>XDG_DATA_DIRS</envar> environment
8051 // variables). GIO also supports the prefix-to-subdirectory mapping that is
8052 // described in the <ulink url="http://standards.freedesktop.org/menu-spec/latest/">Menu Spec</ulink>
8053 // (i.e. a desktop id of kde-foo.desktop will match
8054 // <filename>/usr/share/applications/kde/foo.desktop</filename>).
8055 // RETURNS: a new #GDesktopAppInfo, or %NULL if no desktop file with that id
8056 // <desktop_id>: the desktop file id
8057 static DesktopAppInfo* /*new*/ new_()(char* desktop_id) {
8058 return g_desktop_app_info_new(desktop_id);
8061 // Creates a new #GDesktopAppInfo.
8062 // RETURNS: a new #GDesktopAppInfo or %NULL on error.
8063 // <filename>: the path of a desktop file, in the GLib filename encoding
8064 static DesktopAppInfo* /*new*/ new_from_filename()(char* filename) {
8065 return g_desktop_app_info_new_from_filename(filename);
8068 // VERSION: 2.18
8069 // Creates a new #GDesktopAppInfo.
8070 // RETURNS: a new #GDesktopAppInfo or %NULL on error.
8071 // <key_file>: an opened #GKeyFile
8072 static DesktopAppInfo* /*new*/ new_from_keyfile()(GLib2.KeyFile* key_file) {
8073 return g_desktop_app_info_new_from_keyfile(key_file);
8076 // Sets the name of the desktop that the application is running in.
8077 // This is used by g_app_info_should_show() and
8078 // g_desktop_app_info_get_show_in() to evaluate the
8079 // <literal>OnlyShowIn</literal> and <literal>NotShowIn</literal>
8080 // desktop entry fields.
8082 // The <ulink url="http://standards.freedesktop.org/menu-spec/latest/">Desktop
8083 // Menu specification</ulink> recognizes the following:
8084 // <simplelist>
8085 // <member>GNOME</member>
8086 // <member>KDE</member>
8087 // <member>ROX</member>
8088 // <member>XFCE</member>
8089 // <member>LXDE</member>
8090 // <member>Unity</member>
8091 // <member>Old</member>
8092 // </simplelist>
8094 // Should be called only once; subsequent calls are ignored.
8095 // <desktop_env>: a string specifying what desktop this is
8096 static void set_desktop_env()(char* desktop_env) {
8097 g_desktop_app_info_set_desktop_env(desktop_env);
8100 // Gets the categories from the desktop file.
8102 // i.e. no attempt is made to split it by ';' or validate it.
8103 // RETURNS: The unparsed Categories key from the desktop file;
8104 char* get_categories()() {
8105 return g_desktop_app_info_get_categories(&this);
8108 // VERSION: 2.24
8109 // When @info was created from a known filename, return it. In some
8110 // situations such as the #GDesktopAppInfo returned from
8111 // g_desktop_app_info_new_from_keyfile(), this function will return %NULL.
8112 // RETURNS: The full path to the file for @info, or %NULL if not known.
8113 char* get_filename()() {
8114 return g_desktop_app_info_get_filename(&this);
8117 // Gets the generic name from the destkop file.
8118 // RETURNS: The value of the GenericName key
8119 char* get_generic_name()() {
8120 return g_desktop_app_info_get_generic_name(&this);
8123 // A desktop file is hidden if the Hidden key in it is
8124 // set to True.
8125 // RETURNS: %TRUE if hidden, %FALSE otherwise.
8126 int get_is_hidden()() {
8127 return g_desktop_app_info_get_is_hidden(&this);
8130 // VERSION: 2.32
8131 // Gets the keywords from the desktop file.
8132 // RETURNS: The value of the Keywords key
8133 char** get_keywords()() {
8134 return g_desktop_app_info_get_keywords(&this);
8137 // VERSION: 2.30
8138 // Gets the value of the NoDisplay key, which helps determine if the
8139 // application info should be shown in menus. See
8140 // #G_KEY_FILE_DESKTOP_KEY_NO_DISPLAY and g_app_info_should_show().
8141 // RETURNS: The value of the NoDisplay key
8142 int get_nodisplay()() {
8143 return g_desktop_app_info_get_nodisplay(&this);
8146 // VERSION: 2.30
8147 // Checks if the application info should be shown in menus that list available
8148 // applications for a specific name of the desktop, based on the
8149 // <literal>OnlyShowIn</literal> and <literal>NotShowIn</literal> keys.
8151 // If @desktop_env is %NULL, then the name of the desktop set with
8152 // g_desktop_app_info_set_desktop_env() is used.
8154 // Note that g_app_info_should_show() for @info will include this check (with
8155 // %NULL for @desktop_env) as well as additional checks.
8157 // <literal>OnlyShowIn</literal> and <literal>NotShowIn</literal> keys, %FALSE
8158 // otherwise.
8159 // RETURNS: %TRUE if the @info should be shown in @desktop_env according to the
8160 // <desktop_env>: a string specifying a desktop name
8161 int get_show_in()(char* desktop_env) {
8162 return g_desktop_app_info_get_show_in(&this, desktop_env);
8165 // This function performs the equivalent of g_app_info_launch_uris(),
8166 // but is intended primarily for operating system components that
8167 // launch applications. Ordinary applications should use
8168 // g_app_info_launch_uris().
8170 // In contrast to g_app_info_launch_uris(), all processes created will
8171 // always be run directly as children as if by the UNIX fork()/exec()
8172 // calls.
8174 // This guarantee allows additional control over the exact environment
8175 // of the child processes, which is provided via a setup function
8176 // @user_setup, as well as the process identifier of each child process
8177 // via @pid_callback. See g_spawn_async() for more information about the
8178 // semantics of the @user_setup function.
8179 // RETURNS: %TRUE on successful launch, %FALSE otherwise.
8180 // <uris>: List of URIs
8181 // <launch_context>: a #GAppLaunchContext
8182 // <spawn_flags>: #GSpawnFlags, used for each process
8183 // <user_setup>: a #GSpawnChildSetupFunc, used once for each process.
8184 // <user_setup_data>: User data for @user_setup
8185 // <pid_callback>: Callback for child processes
8186 // <pid_callback_data>: User data for @callback
8187 int launch_uris_as_manager()(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=null) {
8188 return g_desktop_app_info_launch_uris_as_manager(&this, uris, launch_context, spawn_flags, user_setup, user_setup_data, pid_callback, pid_callback_data, error);
8192 struct DesktopAppInfoClass {
8193 GObject2.ObjectClass parent_class;
8197 // Interface that is used by backends to associate default
8198 // handlers with URI schemes.
8199 struct DesktopAppInfoLookup /* Interface */ {
8200 mixin template __interface__() {
8201 // DEPRECATED method: get_default_for_uri_scheme - The #GDesktopAppInfoLookup interface is deprecated and unused by gio.
8202 // Gets the default application for launching applications
8203 // using this URI scheme for a particular GDesktopAppInfoLookup
8204 // implementation.
8206 // The GDesktopAppInfoLookup interface and this function is used
8207 // to implement g_app_info_get_default_for_uri_scheme() backends
8208 // in a GIO module. There is no reason for applications to use it
8209 // directly. Applications should use g_app_info_get_default_for_uri_scheme().
8210 // RETURNS: #GAppInfo for given @uri_scheme or %NULL on error.
8211 // <uri_scheme>: a string containing a URI scheme.
8212 AppInfo* /*new*/ get_default_for_uri_scheme()(char* uri_scheme) {
8213 return g_desktop_app_info_lookup_get_default_for_uri_scheme(cast(DesktopAppInfoLookup*)&this, uri_scheme);
8216 mixin __interface__;
8219 struct DesktopAppInfoLookupIface {
8220 GObject2.TypeInterface g_iface;
8222 // RETURNS: #GAppInfo for given @uri_scheme or %NULL on error.
8223 // <uri_scheme>: a string containing a URI scheme.
8224 extern (C) AppInfo* /*new*/ function (DesktopAppInfoLookup* lookup, char* uri_scheme) get_default_for_uri_scheme;
8228 // During invocation, g_desktop_app_info_launch_uris_as_manager() may
8229 // create one or more child processes. This callback is invoked once
8230 // for each, providing the process ID.
8231 // <appinfo>: a #GDesktopAppInfo
8232 // <pid>: Process identifier
8233 // <user_data>: User data
8234 extern (C) alias void function (DesktopAppInfo* appinfo, GLib2.Pid pid, void* user_data) DesktopAppLaunchCallback;
8237 // #GDrive - this represent a piece of hardware connected to the machine.
8238 // It's generally only created for removable hardware or hardware with
8239 // removable media.
8241 // #GDrive is a container class for #GVolume objects that stem from
8242 // the same piece of media. As such, #GDrive abstracts a drive with
8243 // (or without) removable media and provides operations for querying
8244 // whether media is available, determing whether media change is
8245 // automatically detected and ejecting the media.
8247 // If the #GDrive reports that media isn't automatically detected, one
8248 // can poll for media; typically one should not do this periodically
8249 // as a poll for media operation is potententially expensive and may
8250 // spin up the drive creating noise.
8252 // #GDrive supports starting and stopping drives with authentication
8253 // support for the former. This can be used to support a diverse set
8254 // of use cases including connecting/disconnecting iSCSI devices,
8255 // powering down external disk enclosures and starting/stopping
8256 // multi-disk devices such as RAID devices. Note that the actual
8257 // semantics and side-effects of starting/stopping a #GDrive may vary
8258 // according to implementation. To choose the correct verbs in e.g. a
8259 // file manager, use g_drive_get_start_stop_type().
8261 // For porting from GnomeVFS note that there is no equivalent of
8262 // #GDrive in that API.
8263 struct Drive /* Interface */ {
8264 mixin template __interface__() {
8265 // Checks if a drive can be ejected.
8266 // RETURNS: %TRUE if the @drive can be ejected, %FALSE otherwise.
8267 int can_eject()() {
8268 return g_drive_can_eject(cast(Drive*)&this);
8271 // Checks if a drive can be polled for media changes.
8273 // %FALSE otherwise.
8274 // RETURNS: %TRUE if the @drive can be polled for media changes,
8275 int can_poll_for_media()() {
8276 return g_drive_can_poll_for_media(cast(Drive*)&this);
8279 // VERSION: 2.22
8280 // Checks if a drive can be started.
8281 // RETURNS: %TRUE if the @drive can be started, %FALSE otherwise.
8282 int can_start()() {
8283 return g_drive_can_start(cast(Drive*)&this);
8286 // VERSION: 2.22
8287 // Checks if a drive can be started degraded.
8288 // RETURNS: %TRUE if the @drive can be started degraded, %FALSE otherwise.
8289 int can_start_degraded()() {
8290 return g_drive_can_start_degraded(cast(Drive*)&this);
8293 // VERSION: 2.22
8294 // Checks if a drive can be stopped.
8295 // RETURNS: %TRUE if the @drive can be stopped, %FALSE otherwise.
8296 int can_stop()() {
8297 return g_drive_can_stop(cast(Drive*)&this);
8300 // DEPRECATED (v2.22) method: eject - Use g_drive_eject_with_operation() instead.
8301 // Asynchronously ejects a drive.
8303 // When the operation is finished, @callback will be called.
8304 // You can then call g_drive_eject_finish() to obtain the
8305 // result of the operation.
8306 // <flags>: flags affecting the unmount if required for eject
8307 // <cancellable>: optional #GCancellable object, %NULL to ignore.
8308 // <callback>: a #GAsyncReadyCallback, or %NULL.
8309 // <user_data>: user data to pass to @callback
8310 void eject()(MountUnmountFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
8311 g_drive_eject(cast(Drive*)&this, flags, cancellable, callback, user_data);
8314 // DEPRECATED (v2.22) method: eject_finish - Use g_drive_eject_with_operation_finish() instead.
8315 // Finishes ejecting a drive.
8317 // %FALSE otherwise.
8318 // RETURNS: %TRUE if the drive has been ejected successfully,
8319 // <result>: a #GAsyncResult.
8320 int eject_finish()(AsyncResult* result, GLib2.Error** error=null) {
8321 return g_drive_eject_finish(cast(Drive*)&this, result, error);
8324 // VERSION: 2.22
8325 // Ejects a drive. This is an asynchronous operation, and is
8326 // finished by calling g_drive_eject_with_operation_finish() with the @drive
8327 // and #GAsyncResult data returned in the @callback.
8328 // <flags>: flags affecting the unmount if required for eject
8329 // <mount_operation>: a #GMountOperation or %NULL to avoid user interaction.
8330 // <cancellable>: optional #GCancellable object, %NULL to ignore.
8331 // <callback>: a #GAsyncReadyCallback, or %NULL.
8332 // <user_data>: user data passed to @callback.
8333 void eject_with_operation()(MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
8334 g_drive_eject_with_operation(cast(Drive*)&this, flags, mount_operation, cancellable, callback, user_data);
8337 // VERSION: 2.22
8338 // Finishes ejecting a drive. If any errors occurred during the operation,
8339 // @error will be set to contain the errors and %FALSE will be returned.
8340 // RETURNS: %TRUE if the drive was successfully ejected. %FALSE otherwise.
8341 // <result>: a #GAsyncResult.
8342 int eject_with_operation_finish()(AsyncResult* result, GLib2.Error** error=null) {
8343 return g_drive_eject_with_operation_finish(cast(Drive*)&this, result, error);
8346 // Gets the kinds of identifiers that @drive has.
8347 // Use g_drive_get_identifer() to obtain the identifiers
8348 // themselves.
8350 // array of strings containing kinds of identifiers. Use g_strfreev()
8351 // to free.
8352 // RETURNS: a %NULL-terminated
8353 char** /*new*/ enumerate_identifiers()() {
8354 return g_drive_enumerate_identifiers(cast(Drive*)&this);
8357 // Gets the icon for @drive.
8359 // Free the returned object with g_object_unref().
8360 // RETURNS: #GIcon for the @drive.
8361 Icon* /*new*/ get_icon()() {
8362 return g_drive_get_icon(cast(Drive*)&this);
8365 // Gets the identifier of the given kind for @drive.
8367 // requested identfier, or %NULL if the #GDrive
8368 // doesn't have this kind of identifier.
8369 // RETURNS: a newly allocated string containing the
8370 // <kind>: the kind of identifier to return
8371 char* /*new*/ get_identifier()(char* kind) {
8372 return g_drive_get_identifier(cast(Drive*)&this, kind);
8375 // Gets the name of @drive.
8377 // string should be freed when no longer needed.
8378 // RETURNS: a string containing @drive's name. The returned
8379 char* /*new*/ get_name()() {
8380 return g_drive_get_name(cast(Drive*)&this);
8383 // VERSION: 2.32
8384 // Gets the sort key for @drive, if any.
8385 // RETURNS: Sorting key for @drive or %NULL if no such key is available.
8386 char* get_sort_key()() {
8387 return g_drive_get_sort_key(cast(Drive*)&this);
8390 // VERSION: 2.22
8391 // Gets a hint about how a drive can be started/stopped.
8392 // RETURNS: A value from the #GDriveStartStopType enumeration.
8393 DriveStartStopType get_start_stop_type()() {
8394 return g_drive_get_start_stop_type(cast(Drive*)&this);
8397 // Get a list of mountable volumes for @drive.
8399 // The returned list should be freed with g_list_free(), after
8400 // its elements have been unreffed with g_object_unref().
8401 // RETURNS: #GList containing any #GVolume objects on the given @drive.
8402 GLib2.List* /*new*/ get_volumes()() {
8403 return g_drive_get_volumes(cast(Drive*)&this);
8406 // Checks if the @drive has media. Note that the OS may not be polling
8407 // the drive for media changes; see g_drive_is_media_check_automatic()
8408 // for more details.
8409 // RETURNS: %TRUE if @drive has media, %FALSE otherwise.
8410 int has_media()() {
8411 return g_drive_has_media(cast(Drive*)&this);
8414 // Check if @drive has any mountable volumes.
8415 // RETURNS: %TRUE if the @drive contains volumes, %FALSE otherwise.
8416 int has_volumes()() {
8417 return g_drive_has_volumes(cast(Drive*)&this);
8420 // Checks if @drive is capabable of automatically detecting media changes.
8422 // media changes, %FALSE otherwise.
8423 // RETURNS: %TRUE if the @drive is capabable of automatically detecting
8424 int is_media_check_automatic()() {
8425 return g_drive_is_media_check_automatic(cast(Drive*)&this);
8428 // Checks if the @drive supports removable media.
8429 // RETURNS: %TRUE if @drive supports removable media, %FALSE otherwise.
8430 int is_media_removable()() {
8431 return g_drive_is_media_removable(cast(Drive*)&this);
8434 // Asynchronously polls @drive to see if media has been inserted or removed.
8436 // When the operation is finished, @callback will be called.
8437 // You can then call g_drive_poll_for_media_finish() to obtain the
8438 // result of the operation.
8439 // <cancellable>: optional #GCancellable object, %NULL to ignore.
8440 // <callback>: a #GAsyncReadyCallback, or %NULL.
8441 // <user_data>: user data to pass to @callback
8442 void poll_for_media()(Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
8443 g_drive_poll_for_media(cast(Drive*)&this, cancellable, callback, user_data);
8446 // Finishes an operation started with g_drive_poll_for_media() on a drive.
8448 // %FALSE otherwise.
8449 // RETURNS: %TRUE if the drive has been poll_for_mediaed successfully,
8450 // <result>: a #GAsyncResult.
8451 int poll_for_media_finish()(AsyncResult* result, GLib2.Error** error=null) {
8452 return g_drive_poll_for_media_finish(cast(Drive*)&this, result, error);
8455 // VERSION: 2.22
8456 // Asynchronously starts a drive.
8458 // When the operation is finished, @callback will be called.
8459 // You can then call g_drive_start_finish() to obtain the
8460 // result of the operation.
8461 // <flags>: flags affecting the start operation.
8462 // <mount_operation>: a #GMountOperation or %NULL to avoid user interaction.
8463 // <cancellable>: optional #GCancellable object, %NULL to ignore.
8464 // <callback>: a #GAsyncReadyCallback, or %NULL.
8465 // <user_data>: user data to pass to @callback
8466 void start()(DriveStartFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
8467 g_drive_start(cast(Drive*)&this, flags, mount_operation, cancellable, callback, user_data);
8470 // VERSION: 2.22
8471 // Finishes starting a drive.
8473 // %FALSE otherwise.
8474 // RETURNS: %TRUE if the drive has been started successfully,
8475 // <result>: a #GAsyncResult.
8476 int start_finish()(AsyncResult* result, GLib2.Error** error=null) {
8477 return g_drive_start_finish(cast(Drive*)&this, result, error);
8480 // VERSION: 2.22
8481 // Asynchronously stops a drive.
8483 // When the operation is finished, @callback will be called.
8484 // You can then call g_drive_stop_finish() to obtain the
8485 // result of the operation.
8486 // <flags>: flags affecting the unmount if required for stopping.
8487 // <mount_operation>: a #GMountOperation or %NULL to avoid user interaction.
8488 // <cancellable>: optional #GCancellable object, %NULL to ignore.
8489 // <callback>: a #GAsyncReadyCallback, or %NULL.
8490 // <user_data>: user data to pass to @callback
8491 void stop()(MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
8492 g_drive_stop(cast(Drive*)&this, flags, mount_operation, cancellable, callback, user_data);
8495 // VERSION: 2.22
8496 // Finishes stopping a drive.
8498 // %FALSE otherwise.
8499 // RETURNS: %TRUE if the drive has been stopped successfully,
8500 // <result>: a #GAsyncResult.
8501 int stop_finish()(AsyncResult* result, GLib2.Error** error=null) {
8502 return g_drive_stop_finish(cast(Drive*)&this, result, error);
8504 // Emitted when the drive's state has changed.
8505 extern (C) alias static void function (Drive* this_, void* user_data=null) signal_changed;
8507 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
8508 return super_.signal_connect!name(cb, data, cf);
8511 ulong signal_connect(string name:"changed", CB:signal_changed)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
8512 return signal_connect_data!()(&this, cast(char*)"changed",
8513 cast(GObject2.Callback)cb, data, null, cf);
8516 // This signal is emitted when the #GDrive have been
8517 // disconnected. If the recipient is holding references to the
8518 // object they should release them so the object can be
8519 // finalized.
8520 extern (C) alias static void function (Drive* this_, void* user_data=null) signal_disconnected;
8521 ulong signal_connect(string name:"disconnected", CB:signal_disconnected)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
8522 return signal_connect_data!()(&this, cast(char*)"disconnected",
8523 cast(GObject2.Callback)cb, data, null, cf);
8526 // Emitted when the physical eject button (if any) of a drive has
8527 // been pressed.
8528 extern (C) alias static void function (Drive* this_, void* user_data=null) signal_eject_button;
8529 ulong signal_connect(string name:"eject-button", CB:signal_eject_button)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
8530 return signal_connect_data!()(&this, cast(char*)"eject-button",
8531 cast(GObject2.Callback)cb, data, null, cf);
8534 // VERSION: 2.22
8535 // Emitted when the physical stop button (if any) of a drive has
8536 // been pressed.
8537 extern (C) alias static void function (Drive* this_, void* user_data=null) signal_stop_button;
8538 ulong signal_connect(string name:"stop-button", CB:signal_stop_button)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
8539 return signal_connect_data!()(&this, cast(char*)"stop-button",
8540 cast(GObject2.Callback)cb, data, null, cf);
8543 mixin __interface__;
8546 // Interface for creating #GDrive implementations.
8547 struct DriveIface {
8548 GObject2.TypeInterface g_iface;
8549 extern (C) void function (Drive* drive) changed;
8550 extern (C) void function (Drive* drive) disconnected;
8551 extern (C) void function (Drive* drive) eject_button;
8552 // RETURNS: a string containing @drive's name. The returned
8553 extern (C) char* /*new*/ function (Drive* drive) get_name;
8554 // RETURNS: #GIcon for the @drive.
8555 extern (C) Icon* /*new*/ function (Drive* drive) get_icon;
8556 // RETURNS: %TRUE if the @drive contains volumes, %FALSE otherwise.
8557 extern (C) int function (Drive* drive) has_volumes;
8558 // RETURNS: #GList containing any #GVolume objects on the given @drive.
8559 extern (C) GLib2.List* /*new*/ function (Drive* drive) get_volumes;
8560 // RETURNS: %TRUE if @drive supports removable media, %FALSE otherwise.
8561 extern (C) int function (Drive* drive) is_media_removable;
8562 // RETURNS: %TRUE if @drive has media, %FALSE otherwise.
8563 extern (C) int function (Drive* drive) has_media;
8564 // RETURNS: %TRUE if the @drive is capabable of automatically detecting
8565 extern (C) int function (Drive* drive) is_media_check_automatic;
8566 // RETURNS: %TRUE if the @drive can be ejected, %FALSE otherwise.
8567 extern (C) int function (Drive* drive) can_eject;
8568 // RETURNS: %TRUE if the @drive can be polled for media changes,
8569 extern (C) int function (Drive* drive) can_poll_for_media;
8571 // <flags>: flags affecting the unmount if required for eject
8572 // <cancellable>: optional #GCancellable object, %NULL to ignore.
8573 // <callback>: a #GAsyncReadyCallback, or %NULL.
8574 // <user_data>: user data to pass to @callback
8575 extern (C) void function (Drive* drive, MountUnmountFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) eject;
8577 // RETURNS: %TRUE if the drive has been ejected successfully,
8578 // <result>: a #GAsyncResult.
8579 extern (C) int function (Drive* drive, AsyncResult* result, GLib2.Error** error=null) eject_finish;
8581 // <cancellable>: optional #GCancellable object, %NULL to ignore.
8582 // <callback>: a #GAsyncReadyCallback, or %NULL.
8583 // <user_data>: user data to pass to @callback
8584 extern (C) void function (Drive* drive, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) poll_for_media;
8586 // RETURNS: %TRUE if the drive has been poll_for_mediaed successfully,
8587 // <result>: a #GAsyncResult.
8588 extern (C) int function (Drive* drive, AsyncResult* result, GLib2.Error** error=null) poll_for_media_finish;
8590 // RETURNS: a newly allocated string containing the
8591 // <kind>: the kind of identifier to return
8592 extern (C) char* /*new*/ function (Drive* drive, char* kind) get_identifier;
8593 // RETURNS: a %NULL-terminated
8594 extern (C) char** /*new*/ function (Drive* drive) enumerate_identifiers;
8595 // RETURNS: A value from the #GDriveStartStopType enumeration.
8596 extern (C) DriveStartStopType function (Drive* drive) get_start_stop_type;
8597 // RETURNS: %TRUE if the @drive can be started, %FALSE otherwise.
8598 extern (C) int function (Drive* drive) can_start;
8599 // RETURNS: %TRUE if the @drive can be started degraded, %FALSE otherwise.
8600 extern (C) int function (Drive* drive) can_start_degraded;
8602 // <flags>: flags affecting the start operation.
8603 // <mount_operation>: a #GMountOperation or %NULL to avoid user interaction.
8604 // <cancellable>: optional #GCancellable object, %NULL to ignore.
8605 // <callback>: a #GAsyncReadyCallback, or %NULL.
8606 // <user_data>: user data to pass to @callback
8607 extern (C) void function (Drive* drive, DriveStartFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) start;
8609 // RETURNS: %TRUE if the drive has been started successfully,
8610 // <result>: a #GAsyncResult.
8611 extern (C) int function (Drive* drive, AsyncResult* result, GLib2.Error** error=null) start_finish;
8612 // RETURNS: %TRUE if the @drive can be stopped, %FALSE otherwise.
8613 extern (C) int function (Drive* drive) can_stop;
8615 // <flags>: flags affecting the unmount if required for stopping.
8616 // <mount_operation>: a #GMountOperation or %NULL to avoid user interaction.
8617 // <cancellable>: optional #GCancellable object, %NULL to ignore.
8618 // <callback>: a #GAsyncReadyCallback, or %NULL.
8619 // <user_data>: user data to pass to @callback
8620 extern (C) void function (Drive* drive, MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) stop;
8622 // RETURNS: %TRUE if the drive has been stopped successfully,
8623 // <result>: a #GAsyncResult.
8624 extern (C) int function (Drive* drive, AsyncResult* result, GLib2.Error** error=null) stop_finish;
8625 extern (C) void function (Drive* drive) stop_button;
8627 // <flags>: flags affecting the unmount if required for eject
8628 // <mount_operation>: a #GMountOperation or %NULL to avoid user interaction.
8629 // <cancellable>: optional #GCancellable object, %NULL to ignore.
8630 // <callback>: a #GAsyncReadyCallback, or %NULL.
8631 // <user_data>: user data passed to @callback.
8632 extern (C) void function (Drive* drive, MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) eject_with_operation;
8634 // RETURNS: %TRUE if the drive was successfully ejected. %FALSE otherwise.
8635 // <result>: a #GAsyncResult.
8636 extern (C) int function (Drive* drive, AsyncResult* result, GLib2.Error** error=null) eject_with_operation_finish;
8637 // RETURNS: Sorting key for @drive or %NULL if no such key is available.
8638 extern (C) char* function (Drive* drive) get_sort_key;
8641 // Flags used when starting a drive.
8642 enum DriveStartFlags /* Version 2.22 */ {
8643 NONE = 0
8645 // Enumeration describing how a drive can be started/stopped.
8646 enum DriveStartStopType /* Version 2.22 */ {
8647 UNKNOWN = 0,
8648 SHUTDOWN = 1,
8649 NETWORK = 2,
8650 MULTIDISK = 3,
8651 PASSWORD = 4
8654 // #GEmblem is an implementation of #GIcon that supports
8655 // having an emblem, which is an icon with additional properties.
8656 // It can than be added to a #GEmblemedIcon.
8658 // Currently, only metainformation about the emblem's origin is
8659 // supported. More may be added in the future.
8660 struct Emblem /* : GObject.Object */ {
8661 mixin Icon.__interface__;
8662 alias method_parent this;
8663 alias method_parent super_;
8664 alias method_parent object;
8665 GObject2.Object method_parent;
8668 // VERSION: 2.18
8669 // Creates a new emblem for @icon.
8670 // RETURNS: a new #GEmblem.
8671 // <icon>: a GIcon containing the icon.
8672 static Emblem* /*new*/ new_()(Icon* icon) {
8673 return g_emblem_new(icon);
8676 // VERSION: 2.18
8677 // Creates a new emblem for @icon.
8678 // RETURNS: a new #GEmblem.
8679 // <icon>: a GIcon containing the icon.
8680 // <origin>: a GEmblemOrigin enum defining the emblem's origin
8681 static Emblem* /*new*/ new_with_origin()(Icon* icon, EmblemOrigin origin) {
8682 return g_emblem_new_with_origin(icon, origin);
8685 // VERSION: 2.18
8686 // Gives back the icon from @emblem.
8688 // the emblem and should not be modified or freed.
8689 // RETURNS: a #GIcon. The returned object belongs to
8690 Icon* get_icon()() {
8691 return g_emblem_get_icon(&this);
8694 // VERSION: 2.18
8695 // Gets the origin of the emblem.
8696 // RETURNS: the origin of the emblem
8697 EmblemOrigin get_origin()() {
8698 return g_emblem_get_origin(&this);
8702 struct EmblemClass {
8706 // GEmblemOrigin is used to add information about the origin of the emblem
8707 // to #GEmblem.
8708 enum EmblemOrigin /* Version 2.18 */ {
8709 UNKNOWN = 0,
8710 DEVICE = 1,
8711 LIVEMETADATA = 2,
8712 TAG = 3
8715 // #GEmblemedIcon is an implementation of #GIcon that supports
8716 // adding an emblem to an icon. Adding multiple emblems to an
8717 // icon is ensured via g_emblemed_icon_add_emblem().
8719 // Note that #GEmblemedIcon allows no control over the position
8720 // of the emblems. See also #GEmblem for more information.
8721 struct EmblemedIcon /* : GObject.Object */ {
8722 mixin Icon.__interface__;
8723 alias parent_instance this;
8724 alias parent_instance super_;
8725 alias parent_instance object;
8726 GObject2.Object parent_instance;
8727 private EmblemedIconPrivate* priv;
8730 // VERSION: 2.18
8731 // Creates a new emblemed icon for @icon with the emblem @emblem.
8732 // RETURNS: a new #GIcon
8733 // <icon>: a #GIcon
8734 // <emblem>: a #GEmblem, or %NULL
8735 static EmblemedIcon* /*new*/ new_()(Icon* icon, Emblem* emblem=null) {
8736 return g_emblemed_icon_new(icon, emblem);
8739 // VERSION: 2.18
8740 // Adds @emblem to the #GList of #GEmblem <!-- -->s.
8741 // <emblem>: a #GEmblem
8742 void add_emblem()(Emblem* emblem) {
8743 g_emblemed_icon_add_emblem(&this, emblem);
8746 // VERSION: 2.28
8747 // Removes all the emblems from @icon.
8748 void clear_emblems()() {
8749 g_emblemed_icon_clear_emblems(&this);
8752 // VERSION: 2.18
8753 // Gets the list of emblems for the @icon.
8755 // #GEmblem <!-- -->s that is owned by @emblemed
8756 // RETURNS: a #GList of
8757 GLib2.List* get_emblems()() {
8758 return g_emblemed_icon_get_emblems(&this);
8761 // VERSION: 2.18
8762 // Gets the main icon for @emblemed.
8763 // RETURNS: a #GIcon that is owned by @emblemed
8764 Icon* get_icon()() {
8765 return g_emblemed_icon_get_icon(&this);
8769 struct EmblemedIconClass {
8770 GObject2.ObjectClass parent_class;
8773 struct EmblemedIconPrivate {
8776 enum FILE_ATTRIBUTE_ACCESS_CAN_DELETE = "access::can-delete";
8777 enum FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE = "access::can-execute";
8778 enum FILE_ATTRIBUTE_ACCESS_CAN_READ = "access::can-read";
8779 enum FILE_ATTRIBUTE_ACCESS_CAN_RENAME = "access::can-rename";
8780 enum FILE_ATTRIBUTE_ACCESS_CAN_TRASH = "access::can-trash";
8781 enum FILE_ATTRIBUTE_ACCESS_CAN_WRITE = "access::can-write";
8782 enum FILE_ATTRIBUTE_DOS_IS_ARCHIVE = "dos::is-archive";
8783 enum FILE_ATTRIBUTE_DOS_IS_SYSTEM = "dos::is-system";
8784 enum FILE_ATTRIBUTE_ETAG_VALUE = "etag::value";
8785 enum FILE_ATTRIBUTE_FILESYSTEM_FREE = "filesystem::free";
8786 enum FILE_ATTRIBUTE_FILESYSTEM_READONLY = "filesystem::readonly";
8787 enum FILE_ATTRIBUTE_FILESYSTEM_SIZE = "filesystem::size";
8788 enum FILE_ATTRIBUTE_FILESYSTEM_TYPE = "filesystem::type";
8789 enum FILE_ATTRIBUTE_FILESYSTEM_USED = "filesystem::used";
8790 enum FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW = "filesystem::use-preview";
8791 enum FILE_ATTRIBUTE_GVFS_BACKEND = "gvfs::backend";
8792 enum FILE_ATTRIBUTE_ID_FILE = "id::file";
8793 enum FILE_ATTRIBUTE_ID_FILESYSTEM = "id::filesystem";
8794 enum FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT = "mountable::can-eject";
8795 enum FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT = "mountable::can-mount";
8796 enum FILE_ATTRIBUTE_MOUNTABLE_CAN_POLL = "mountable::can-poll";
8797 enum FILE_ATTRIBUTE_MOUNTABLE_CAN_START = "mountable::can-start";
8798 enum FILE_ATTRIBUTE_MOUNTABLE_CAN_START_DEGRADED = "mountable::can-start-degraded";
8799 enum FILE_ATTRIBUTE_MOUNTABLE_CAN_STOP = "mountable::can-stop";
8800 enum FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT = "mountable::can-unmount";
8801 enum FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI = "mountable::hal-udi";
8802 enum FILE_ATTRIBUTE_MOUNTABLE_IS_MEDIA_CHECK_AUTOMATIC = "mountable::is-media-check-automatic";
8803 enum FILE_ATTRIBUTE_MOUNTABLE_START_STOP_TYPE = "mountable::start-stop-type";
8804 enum FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE = "mountable::unix-device";
8805 enum FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE_FILE = "mountable::unix-device-file";
8806 enum FILE_ATTRIBUTE_OWNER_GROUP = "owner::group";
8807 enum FILE_ATTRIBUTE_OWNER_USER = "owner::user";
8808 enum FILE_ATTRIBUTE_OWNER_USER_REAL = "owner::user-real";
8809 enum FILE_ATTRIBUTE_PREVIEW_ICON = "preview::icon";
8810 enum FILE_ATTRIBUTE_SELINUX_CONTEXT = "selinux::context";
8811 enum FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE = "standard::allocated-size";
8812 enum FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE = "standard::content-type";
8813 enum FILE_ATTRIBUTE_STANDARD_COPY_NAME = "standard::copy-name";
8814 enum FILE_ATTRIBUTE_STANDARD_DESCRIPTION = "standard::description";
8815 enum FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME = "standard::display-name";
8816 enum FILE_ATTRIBUTE_STANDARD_EDIT_NAME = "standard::edit-name";
8817 enum FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE = "standard::fast-content-type";
8818 enum FILE_ATTRIBUTE_STANDARD_ICON = "standard::icon";
8819 enum FILE_ATTRIBUTE_STANDARD_IS_BACKUP = "standard::is-backup";
8820 enum FILE_ATTRIBUTE_STANDARD_IS_HIDDEN = "standard::is-hidden";
8821 enum FILE_ATTRIBUTE_STANDARD_IS_SYMLINK = "standard::is-symlink";
8822 enum FILE_ATTRIBUTE_STANDARD_IS_VIRTUAL = "standard::is-virtual";
8823 enum FILE_ATTRIBUTE_STANDARD_NAME = "standard::name";
8824 enum FILE_ATTRIBUTE_STANDARD_SIZE = "standard::size";
8825 enum FILE_ATTRIBUTE_STANDARD_SORT_ORDER = "standard::sort-order";
8826 enum FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET = "standard::symlink-target";
8827 enum FILE_ATTRIBUTE_STANDARD_TARGET_URI = "standard::target-uri";
8828 enum FILE_ATTRIBUTE_STANDARD_TYPE = "standard::type";
8829 enum FILE_ATTRIBUTE_THUMBNAILING_FAILED = "thumbnail::failed";
8830 enum FILE_ATTRIBUTE_THUMBNAIL_PATH = "thumbnail::path";
8831 enum FILE_ATTRIBUTE_TIME_ACCESS = "time::access";
8832 enum FILE_ATTRIBUTE_TIME_ACCESS_USEC = "time::access-usec";
8833 enum FILE_ATTRIBUTE_TIME_CHANGED = "time::changed";
8834 enum FILE_ATTRIBUTE_TIME_CHANGED_USEC = "time::changed-usec";
8835 enum FILE_ATTRIBUTE_TIME_CREATED = "time::created";
8836 enum FILE_ATTRIBUTE_TIME_CREATED_USEC = "time::created-usec";
8837 enum FILE_ATTRIBUTE_TIME_MODIFIED = "time::modified";
8838 enum FILE_ATTRIBUTE_TIME_MODIFIED_USEC = "time::modified-usec";
8839 enum FILE_ATTRIBUTE_TRASH_DELETION_DATE = "trash::deletion-date";
8840 enum FILE_ATTRIBUTE_TRASH_ITEM_COUNT = "trash::item-count";
8841 enum FILE_ATTRIBUTE_TRASH_ORIG_PATH = "trash::orig-path";
8842 enum FILE_ATTRIBUTE_UNIX_BLOCKS = "unix::blocks";
8843 enum FILE_ATTRIBUTE_UNIX_BLOCK_SIZE = "unix::block-size";
8844 enum FILE_ATTRIBUTE_UNIX_DEVICE = "unix::device";
8845 enum FILE_ATTRIBUTE_UNIX_GID = "unix::gid";
8846 enum FILE_ATTRIBUTE_UNIX_INODE = "unix::inode";
8847 enum FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT = "unix::is-mountpoint";
8848 enum FILE_ATTRIBUTE_UNIX_MODE = "unix::mode";
8849 enum FILE_ATTRIBUTE_UNIX_NLINK = "unix::nlink";
8850 enum FILE_ATTRIBUTE_UNIX_RDEV = "unix::rdev";
8851 enum FILE_ATTRIBUTE_UNIX_UID = "unix::uid";
8853 // #GFile is a high level abstraction for manipulating files on a
8854 // virtual file system. #GFile<!-- -->s are lightweight, immutable
8855 // objects that do no I/O upon creation. It is necessary to understand that
8856 // #GFile objects do not represent files, merely an identifier for a file. All
8857 // file content I/O is implemented as streaming operations (see #GInputStream and
8858 // #GOutputStream).
8860 // To construct a #GFile, you can use:
8861 // g_file_new_for_path() if you have a path.
8862 // g_file_new_for_uri() if you have a URI.
8863 // g_file_new_for_commandline_arg() for a command line argument.
8864 // g_file_new_tmp() to create a temporary file from a template.
8865 // g_file_parse_name() from a utf8 string gotten from g_file_get_parse_name().
8867 // One way to think of a #GFile is as an abstraction of a pathname. For normal
8868 // files the system pathname is what is stored internally, but as #GFile<!-- -->s
8869 // are extensible it could also be something else that corresponds to a pathname
8870 // in a userspace implementation of a filesystem.
8872 // #GFile<!-- -->s make up hierarchies of directories and files that correspond to the
8873 // files on a filesystem. You can move through the file system with #GFile using
8874 // g_file_get_parent() to get an identifier for the parent directory, g_file_get_child()
8875 // to get a child within a directory, g_file_resolve_relative_path() to resolve a relative
8876 // path between two #GFile<!-- -->s. There can be multiple hierarchies, so you may not
8877 // end up at the same root if you repeatedly call g_file_get_parent() on two different
8878 // files.
8880 // All #GFile<!-- -->s have a basename (get with g_file_get_basename()). These names
8881 // are byte strings that are used to identify the file on the filesystem (relative to
8882 // its parent directory) and there is no guarantees that they have any particular charset
8883 // encoding or even make any sense at all. If you want to use filenames in a user
8884 // interface you should use the display name that you can get by requesting the
8885 // %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME attribute with g_file_query_info().
8886 // This is guaranteed to be in utf8 and can be used in a user interface. But always
8887 // store the real basename or the #GFile to use to actually access the file, because
8888 // there is no way to go from a display name to the actual name.
8890 // Using #GFile as an identifier has the same weaknesses as using a path in that
8891 // there may be multiple aliases for the same file. For instance, hard or
8892 // soft links may cause two different #GFile<!-- -->s to refer to the same file.
8893 // Other possible causes for aliases are: case insensitive filesystems, short
8894 // and long names on Fat/NTFS, or bind mounts in Linux. If you want to check if
8895 // two #GFile<!-- -->s point to the same file you can query for the
8896 // %G_FILE_ATTRIBUTE_ID_FILE attribute. Note that #GFile does some trivial
8897 // canonicalization of pathnames passed in, so that trivial differences in the
8898 // path string used at creation (duplicated slashes, slash at end of path, "."
8899 // or ".." path segments, etc) does not create different #GFile<!-- -->s.
8901 // Many #GFile operations have both synchronous and asynchronous versions
8902 // to suit your application. Asynchronous versions of synchronous functions
8903 // simply have _async() appended to their function names. The asynchronous
8904 // I/O functions call a #GAsyncReadyCallback which is then used to finalize
8905 // the operation, producing a GAsyncResult which is then passed to the
8906 // function's matching _finish() operation.
8908 // Some #GFile operations do not have synchronous analogs, as they may
8909 // take a very long time to finish, and blocking may leave an application
8910 // unusable. Notable cases include:
8911 // g_file_mount_mountable() to mount a mountable file.
8912 // g_file_unmount_mountable_with_operation() to unmount a mountable file.
8913 // g_file_eject_mountable_with_operation() to eject a mountable file.
8915 // <para id="gfile-etag"><indexterm><primary>entity tag</primary></indexterm>
8916 // One notable feature of #GFile<!-- -->s are entity tags, or "etags" for
8917 // short. Entity tags are somewhat like a more abstract version of the
8918 // traditional mtime, and can be used to quickly determine if the file has
8919 // been modified from the version on the file system. See the HTTP 1.1
8920 // <ulink url="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html">specification</ulink>
8921 // for HTTP Etag headers, which are a very similar concept.
8922 // </para>
8923 struct File /* Interface */ {
8924 mixin template __interface__() {
8925 // Creates a #GFile with the given argument from the command line. The value of
8926 // @arg can be either a URI, an absolute path or a relative path resolved
8927 // relative to the current working directory.
8928 // This operation never fails, but the returned object might not support any
8929 // I/O operation if @arg points to a malformed path.
8931 // Free the returned object with g_object_unref().
8932 // RETURNS: a new #GFile.
8933 // <arg>: a command line string.
8934 static File* /*new*/ new_for_commandline_arg()(char* arg) {
8935 return g_file_new_for_commandline_arg(arg);
8938 // Constructs a #GFile for a given path. This operation never
8939 // fails, but the returned object might not support any I/O
8940 // operation if @path is malformed.
8942 // Free the returned object with g_object_unref().
8943 // RETURNS: a new #GFile for the given @path.
8944 // <path>: a string containing a relative or absolute path. The string must be encoded in the glib filename encoding.
8945 static File* /*new*/ new_for_path()(char* path) {
8946 return g_file_new_for_path(path);
8949 // Constructs a #GFile for a given URI. This operation never
8950 // fails, but the returned object might not support any I/O
8951 // operation if @uri is malformed or if the uri type is
8952 // not supported.
8954 // Free the returned object with g_object_unref().
8955 // RETURNS: a new #GFile for the given @uri.
8956 // <uri>: a UTF8 string containing a URI.
8957 static File* /*new*/ new_for_uri()(char* uri) {
8958 return g_file_new_for_uri(uri);
8961 // VERSION: 2.32
8962 // Opens a file in the preferred directory for temporary files (as
8963 // returned by g_get_tmp_dir()) and returns a #GFile and
8964 // #GFileIOStream pointing to it.
8966 // @template should be a string in the GLib file name encoding
8967 // containing a sequence of six 'X' characters, and containing no
8968 // directory components. If it is %NULL, a default template is used.
8970 // Unlike the other #GFile constructors, this will return %NULL if
8971 // a temporary file could not be created.
8973 // Free the returned object with g_object_unref().
8974 // RETURNS: a new #GFile.
8975 // <tmpl>: Template for the file name, as in g_file_open_tmp(), or %NULL for a default template.
8976 // <iostream>: on return, a #GFileIOStream for the created file.
8977 static File* /*new*/ new_tmp()(char* tmpl, /*out*/ FileIOStream** iostream, GLib2.Error** error=null) {
8978 return g_file_new_tmp(tmpl, iostream, error);
8981 // Constructs a #GFile with the given @parse_name (i.e. something given by g_file_get_parse_name()).
8982 // This operation never fails, but the returned object might not support any I/O
8983 // operation if the @parse_name cannot be parsed.
8984 // RETURNS: a new #GFile.
8985 // <parse_name>: a file name or path to be parsed.
8986 static File* /*new*/ parse_name()(char* parse_name) {
8987 return g_file_parse_name(parse_name);
8990 // Gets an output stream for appending data to the file. If
8991 // the file doesn't already exist it is created.
8993 // By default files created are generally readable by everyone,
8994 // but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
8995 // will be made readable only to the current user, to the level that
8996 // is supported on the target filesystem.
8998 // If @cancellable is not %NULL, then the operation can be cancelled by
8999 // triggering the cancellable object from another thread. If the operation
9000 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9002 // Some file systems don't allow all file names, and may
9003 // return an %G_IO_ERROR_INVALID_FILENAME error.
9004 // If the file is a directory the %G_IO_ERROR_IS_DIRECTORY error will be
9005 // returned. Other errors are possible too, and depend on what kind of
9006 // filesystem the file is on.
9008 // Free the returned object with g_object_unref().
9009 // RETURNS: a #GFileOutputStream, or %NULL on error.
9010 // <flags>: a set of #GFileCreateFlags.
9011 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9012 FileOutputStream* /*new*/ append_to()(FileCreateFlags flags, Cancellable* cancellable, GLib2.Error** error=null) {
9013 return g_file_append_to(cast(File*)&this, flags, cancellable, error);
9016 // Asynchronously opens @file for appending.
9018 // For more details, see g_file_append_to() which is
9019 // the synchronous version of this call.
9021 // When the operation is finished, @callback will be called. You can then call
9022 // g_file_append_to_finish() to get the result of the operation.
9023 // <flags>: a set of #GFileCreateFlags.
9024 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
9025 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9026 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
9027 // <user_data>: the data to pass to callback function
9028 void append_to_async()(FileCreateFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
9029 g_file_append_to_async(cast(File*)&this, flags, io_priority, cancellable, callback, user_data);
9032 // Finishes an asynchronous file append operation started with
9033 // g_file_append_to_async().
9035 // Free the returned object with g_object_unref().
9036 // RETURNS: a valid #GFileOutputStream or %NULL on error.
9037 // <res>: #GAsyncResult
9038 FileOutputStream* /*new*/ append_to_finish()(AsyncResult* res, GLib2.Error** error=null) {
9039 return g_file_append_to_finish(cast(File*)&this, res, error);
9042 // Copies the file @source to the location specified by @destination.
9043 // Can not handle recursive copies of directories.
9045 // If the flag #G_FILE_COPY_OVERWRITE is specified an already
9046 // existing @destination file is overwritten.
9048 // If the flag #G_FILE_COPY_NOFOLLOW_SYMLINKS is specified then symlinks
9049 // will be copied as symlinks, otherwise the target of the
9050 // @source symlink will be copied.
9052 // If @cancellable is not %NULL, then the operation can be cancelled by
9053 // triggering the cancellable object from another thread. If the operation
9054 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9056 // If @progress_callback is not %NULL, then the operation can be monitored by
9057 // setting this to a #GFileProgressCallback function. @progress_callback_data
9058 // will be passed to this function. It is guaranteed that this callback will
9059 // be called after all data has been transferred with the total number of bytes
9060 // copied during the operation.
9062 // If the @source file does not exist then the G_IO_ERROR_NOT_FOUND
9063 // error is returned, independent on the status of the @destination.
9065 // If #G_FILE_COPY_OVERWRITE is not specified and the target exists, then the
9066 // error G_IO_ERROR_EXISTS is returned.
9068 // If trying to overwrite a file over a directory the G_IO_ERROR_IS_DIRECTORY
9069 // error is returned. If trying to overwrite a directory with a directory the
9070 // G_IO_ERROR_WOULD_MERGE error is returned.
9072 // If the source is a directory and the target does not exist, or
9073 // #G_FILE_COPY_OVERWRITE is specified and the target is a file, then the
9074 // G_IO_ERROR_WOULD_RECURSE error is returned.
9076 // If you are interested in copying the #GFile object itself (not the on-disk
9077 // file), see g_file_dup().
9078 // RETURNS: %TRUE on success, %FALSE otherwise.
9079 // <destination>: destination #GFile
9080 // <flags>: set of #GFileCopyFlags
9081 // <cancellable>: optional #GCancellable object, %NULL to ignore
9082 // <progress_callback>: function to callback with progress information, or %NULL if progress information is not needed
9083 // <progress_callback_data>: user data to pass to @progress_callback
9084 int copy()(File* destination, FileCopyFlags flags, Cancellable* cancellable, FileProgressCallback progress_callback, void* progress_callback_data, GLib2.Error** error=null) {
9085 return g_file_copy(cast(File*)&this, destination, flags, cancellable, progress_callback, progress_callback_data, error);
9088 // Unintrospectable method: copy_async() / g_file_copy_async()
9089 // Copies the file @source to the location specified by @destination
9090 // asynchronously. For details of the behaviour, see g_file_copy().
9092 // If @progress_callback is not %NULL, then that function that will be called
9093 // just like in g_file_copy(), however the callback will run in the main loop,
9094 // not in the thread that is doing the I/O operation.
9096 // When the operation is finished, @callback will be called. You can then call
9097 // g_file_copy_finish() to get the result of the operation.
9098 // <destination>: destination #GFile
9099 // <flags>: set of #GFileCopyFlags
9100 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request
9101 // <cancellable>: optional #GCancellable object, %NULL to ignore
9102 // <progress_callback>: function to callback with progress information, or %NULL if progress information is not needed
9103 // <progress_callback_data>: user data to pass to @progress_callback
9104 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
9105 // <user_data>: the data to pass to callback function
9106 void copy_async()(File* destination, FileCopyFlags flags, int io_priority, Cancellable* cancellable, FileProgressCallback progress_callback, void* progress_callback_data, AsyncReadyCallback callback, void* user_data) {
9107 g_file_copy_async(cast(File*)&this, destination, flags, io_priority, cancellable, progress_callback, progress_callback_data, callback, user_data);
9110 // Copies the file attributes from @source to @destination.
9112 // Normally only a subset of the file attributes are copied,
9113 // those that are copies in a normal file copy operation
9114 // (which for instance does not include e.g. owner). However
9115 // if #G_FILE_COPY_ALL_METADATA is specified in @flags, then
9116 // all the metadata that is possible to copy is copied. This
9117 // is useful when implementing move by copy + delete source.
9118 // RETURNS: %TRUE if the attributes were copied successfully, %FALSE otherwise.
9119 // <destination>: a #GFile to copy attributes to.
9120 // <flags>: a set of #GFileCopyFlags.
9121 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9122 int copy_attributes()(File* destination, FileCopyFlags flags, Cancellable* cancellable, GLib2.Error** error=null) {
9123 return g_file_copy_attributes(cast(File*)&this, destination, flags, cancellable, error);
9126 // Finishes copying the file started with
9127 // g_file_copy_async().
9128 // RETURNS: a %TRUE on success, %FALSE on error.
9129 // <res>: a #GAsyncResult.
9130 int copy_finish()(AsyncResult* res, GLib2.Error** error=null) {
9131 return g_file_copy_finish(cast(File*)&this, res, error);
9134 // Creates a new file and returns an output stream for writing to it.
9135 // The file must not already exist.
9137 // By default files created are generally readable by everyone,
9138 // but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
9139 // will be made readable only to the current user, to the level that
9140 // is supported on the target filesystem.
9142 // If @cancellable is not %NULL, then the operation can be cancelled by
9143 // triggering the cancellable object from another thread. If the operation
9144 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9146 // If a file or directory with this name already exists the G_IO_ERROR_EXISTS
9147 // error will be returned.
9148 // Some file systems don't allow all file names, and may
9149 // return an G_IO_ERROR_INVALID_FILENAME error, and if the name
9150 // is to long G_IO_ERROR_FILENAME_TOO_LONG will be returned.
9151 // Other errors are possible too, and depend on what kind of
9152 // filesystem the file is on.
9154 // %NULL on error.
9155 // Free the returned object with g_object_unref().
9156 // RETURNS: a #GFileOutputStream for the newly created file, or
9157 // <flags>: a set of #GFileCreateFlags.
9158 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9159 FileOutputStream* /*new*/ create()(FileCreateFlags flags, Cancellable* cancellable, GLib2.Error** error=null) {
9160 return g_file_create(cast(File*)&this, flags, cancellable, error);
9163 // Asynchronously creates a new file and returns an output stream for writing to it.
9164 // The file must not already exist.
9166 // For more details, see g_file_create() which is
9167 // the synchronous version of this call.
9169 // When the operation is finished, @callback will be called. You can then call
9170 // g_file_create_finish() to get the result of the operation.
9171 // <flags>: a set of #GFileCreateFlags.
9172 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
9173 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9174 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
9175 // <user_data>: the data to pass to callback function
9176 void create_async()(FileCreateFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
9177 g_file_create_async(cast(File*)&this, flags, io_priority, cancellable, callback, user_data);
9180 // Finishes an asynchronous file create operation started with
9181 // g_file_create_async().
9183 // Free the returned object with g_object_unref().
9184 // RETURNS: a #GFileOutputStream or %NULL on error.
9185 // <res>: a #GAsyncResult.
9186 FileOutputStream* /*new*/ create_finish()(AsyncResult* res, GLib2.Error** error=null) {
9187 return g_file_create_finish(cast(File*)&this, res, error);
9190 // VERSION: 2.22
9191 // Creates a new file and returns a stream for reading and writing to it.
9192 // The file must not already exist.
9194 // By default files created are generally readable by everyone,
9195 // but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
9196 // will be made readable only to the current user, to the level that
9197 // is supported on the target filesystem.
9199 // If @cancellable is not %NULL, then the operation can be cancelled by
9200 // triggering the cancellable object from another thread. If the operation
9201 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9203 // If a file or directory with this name already exists the %G_IO_ERROR_EXISTS
9204 // error will be returned. Some file systems don't allow all file names,
9205 // and may return an %G_IO_ERROR_INVALID_FILENAME error, and if the name
9206 // is too long, %G_IO_ERROR_FILENAME_TOO_LONG will be returned. Other errors
9207 // are possible too, and depend on what kind of filesystem the file is on.
9209 // Note that in many non-local file cases read and write streams are not
9210 // supported, so make sure you really need to do read and write streaming,
9211 // rather than just opening for reading or writing.
9213 // Free the returned object with g_object_unref().
9214 // RETURNS: a #GFileIOStream for the newly created file, or %NULL on error.
9215 // <flags>: a set of #GFileCreateFlags
9216 // <cancellable>: optional #GCancellable object, %NULL to ignore
9217 FileIOStream* /*new*/ create_readwrite()(FileCreateFlags flags, Cancellable* cancellable, GLib2.Error** error=null) {
9218 return g_file_create_readwrite(cast(File*)&this, flags, cancellable, error);
9221 // VERSION: 2.22
9222 // Asynchronously creates a new file and returns a stream for reading and
9223 // writing to it. The file must not already exist.
9225 // For more details, see g_file_create_readwrite() which is
9226 // the synchronous version of this call.
9228 // When the operation is finished, @callback will be called. You can then
9229 // call g_file_create_readwrite_finish() to get the result of the operation.
9230 // <flags>: a set of #GFileCreateFlags
9231 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request
9232 // <cancellable>: optional #GCancellable object, %NULL to ignore
9233 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
9234 // <user_data>: the data to pass to callback function
9235 void create_readwrite_async()(FileCreateFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
9236 g_file_create_readwrite_async(cast(File*)&this, flags, io_priority, cancellable, callback, user_data);
9239 // VERSION: 2.22
9240 // Finishes an asynchronous file create operation started with
9241 // g_file_create_readwrite_async().
9243 // Free the returned object with g_object_unref().
9244 // RETURNS: a #GFileIOStream or %NULL on error.
9245 // <res>: a #GAsyncResult
9246 FileIOStream* /*new*/ create_readwrite_finish()(AsyncResult* res, GLib2.Error** error=null) {
9247 return g_file_create_readwrite_finish(cast(File*)&this, res, error);
9250 // Deletes a file. If the @file is a directory, it will only be deleted if it
9251 // is empty.
9253 // If @cancellable is not %NULL, then the operation can be cancelled by
9254 // triggering the cancellable object from another thread. If the operation
9255 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9256 // RETURNS: %TRUE if the file was deleted. %FALSE otherwise.
9257 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9258 int delete_()(Cancellable* cancellable, GLib2.Error** error=null) {
9259 return g_file_delete(cast(File*)&this, cancellable, error);
9262 // Duplicates a #GFile handle. This operation does not duplicate
9263 // the actual file or directory represented by the #GFile; see
9264 // g_file_copy() if attempting to copy a file.
9266 // This call does no blocking i/o.
9267 // RETURNS: a new #GFile that is a duplicate of the given #GFile.
9268 File* /*new*/ dup()() {
9269 return g_file_dup(cast(File*)&this);
9272 // DEPRECATED (v2.22) method: eject_mountable - Use g_file_eject_mountable_with_operation() instead.
9273 // Starts an asynchronous eject on a mountable.
9274 // When this operation has completed, @callback will be called with
9275 // @user_user data, and the operation can be finalized with
9276 // g_file_eject_mountable_finish().
9278 // If @cancellable is not %NULL, then the operation can be cancelled by
9279 // triggering the cancellable object from another thread. If the operation
9280 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9281 // <flags>: flags affecting the operation
9282 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9283 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
9284 // <user_data>: the data to pass to callback function
9285 void eject_mountable()(MountUnmountFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
9286 g_file_eject_mountable(cast(File*)&this, flags, cancellable, callback, user_data);
9289 // DEPRECATED (v2.22) method: eject_mountable_finish - Use g_file_eject_mountable_with_operation_finish() instead.
9290 // Finishes an asynchronous eject operation started by
9291 // g_file_eject_mountable().
9293 // otherwise.
9294 // RETURNS: %TRUE if the @file was ejected successfully. %FALSE
9295 // <result>: a #GAsyncResult.
9296 int eject_mountable_finish()(AsyncResult* result, GLib2.Error** error=null) {
9297 return g_file_eject_mountable_finish(cast(File*)&this, result, error);
9300 // VERSION: 2.22
9301 // Starts an asynchronous eject on a mountable.
9302 // When this operation has completed, @callback will be called with
9303 // @user_user data, and the operation can be finalized with
9304 // g_file_eject_mountable_with_operation_finish().
9306 // If @cancellable is not %NULL, then the operation can be cancelled by
9307 // triggering the cancellable object from another thread. If the operation
9308 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9309 // <flags>: flags affecting the operation
9310 // <mount_operation>: a #GMountOperation, or %NULL to avoid user interaction.
9311 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9312 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
9313 // <user_data>: the data to pass to callback function
9314 void eject_mountable_with_operation()(MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
9315 g_file_eject_mountable_with_operation(cast(File*)&this, flags, mount_operation, cancellable, callback, user_data);
9318 // VERSION: 2.22
9319 // Finishes an asynchronous eject operation started by
9320 // g_file_eject_mountable_with_operation().
9322 // otherwise.
9323 // RETURNS: %TRUE if the @file was ejected successfully. %FALSE
9324 // <result>: a #GAsyncResult.
9325 int eject_mountable_with_operation_finish()(AsyncResult* result, GLib2.Error** error=null) {
9326 return g_file_eject_mountable_with_operation_finish(cast(File*)&this, result, error);
9329 // Gets the requested information about the files in a directory. The result
9330 // is a #GFileEnumerator object that will give out #GFileInfo objects for
9331 // all the files in the directory.
9333 // The @attributes value is a string that specifies the file attributes that
9334 // should be gathered. It is not an error if it's not possible to read a particular
9335 // requested attribute from a file - it just won't be set. @attributes should
9336 // be a comma-separated list of attributes or attribute wildcards. The wildcard "*"
9337 // means all attributes, and a wildcard like "standard::*" means all attributes in the standard
9338 // namespace. An example attribute query be "standard::*,owner::user".
9339 // The standard attributes are available as defines, like #G_FILE_ATTRIBUTE_STANDARD_NAME.
9341 // If @cancellable is not %NULL, then the operation can be cancelled by
9342 // triggering the cancellable object from another thread. If the operation
9343 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9345 // If the file does not exist, the G_IO_ERROR_NOT_FOUND error will be returned.
9346 // If the file is not a directory, the G_FILE_ERROR_NOTDIR error will be returned.
9347 // Other errors are possible too.
9349 // Free the returned object with g_object_unref().
9350 // RETURNS: A #GFileEnumerator if successful, %NULL on error.
9351 // <attributes>: an attribute query string.
9352 // <flags>: a set of #GFileQueryInfoFlags.
9353 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9354 FileEnumerator* /*new*/ enumerate_children()(char* attributes, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error=null) {
9355 return g_file_enumerate_children(cast(File*)&this, attributes, flags, cancellable, error);
9358 // Asynchronously gets the requested information about the files in a directory. The result
9359 // is a #GFileEnumerator object that will give out #GFileInfo objects for
9360 // all the files in the directory.
9362 // For more details, see g_file_enumerate_children() which is
9363 // the synchronous version of this call.
9365 // When the operation is finished, @callback will be called. You can then call
9366 // g_file_enumerate_children_finish() to get the result of the operation.
9367 // <attributes>: an attribute query string.
9368 // <flags>: a set of #GFileQueryInfoFlags.
9369 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
9370 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9371 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
9372 // <user_data>: the data to pass to callback function
9373 void enumerate_children_async()(char* attributes, FileQueryInfoFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
9374 g_file_enumerate_children_async(cast(File*)&this, attributes, flags, io_priority, cancellable, callback, user_data);
9377 // Finishes an async enumerate children operation.
9378 // See g_file_enumerate_children_async().
9380 // Free the returned object with g_object_unref().
9381 // RETURNS: a #GFileEnumerator or %NULL if an error occurred.
9382 // <res>: a #GAsyncResult.
9383 FileEnumerator* /*new*/ enumerate_children_finish()(AsyncResult* res, GLib2.Error** error=null) {
9384 return g_file_enumerate_children_finish(cast(File*)&this, res, error);
9387 // Checks equality of two given #GFile<!-- -->s. Note that two
9388 // #GFile<!-- -->s that differ can still refer to the same
9389 // file on the filesystem due to various forms of filename
9390 // aliasing.
9392 // This call does no blocking i/o.
9394 // %FALSE if either is not a #GFile.
9395 // RETURNS: %TRUE if @file1 and @file2 are equal.
9396 // <file2>: the second #GFile.
9397 int equal()(File* file2) {
9398 return g_file_equal(cast(File*)&this, file2);
9401 // Gets a #GMount for the #GFile.
9403 // If the #GFileIface for @file does not have a mount (e.g. possibly a
9404 // remote share), @error will be set to %G_IO_ERROR_NOT_FOUND and %NULL
9405 // will be returned.
9407 // If @cancellable is not %NULL, then the operation can be cancelled by
9408 // triggering the cancellable object from another thread. If the operation
9409 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9411 // Free the returned object with g_object_unref().
9412 // RETURNS: a #GMount where the @file is located or %NULL on error.
9413 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9414 Mount* /*new*/ find_enclosing_mount()(Cancellable* cancellable, GLib2.Error** error=null) {
9415 return g_file_find_enclosing_mount(cast(File*)&this, cancellable, error);
9418 // Asynchronously gets the mount for the file.
9420 // For more details, see g_file_find_enclosing_mount() which is
9421 // the synchronous version of this call.
9423 // When the operation is finished, @callback will be called. You can then call
9424 // g_file_find_enclosing_mount_finish() to get the result of the operation.
9425 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
9426 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9427 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
9428 // <user_data>: the data to pass to callback function
9429 void find_enclosing_mount_async()(int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
9430 g_file_find_enclosing_mount_async(cast(File*)&this, io_priority, cancellable, callback, user_data);
9433 // Finishes an asynchronous find mount request.
9434 // See g_file_find_enclosing_mount_async().
9436 // Free the returned object with g_object_unref().
9437 // RETURNS: #GMount for given @file or %NULL on error.
9438 // <res>: a #GAsyncResult
9439 Mount* /*new*/ find_enclosing_mount_finish()(AsyncResult* res, GLib2.Error** error=null) {
9440 return g_file_find_enclosing_mount_finish(cast(File*)&this, res, error);
9443 // Gets the base name (the last component of the path) for a given #GFile.
9445 // If called for the top level of a system (such as the filesystem root
9446 // or a uri like sftp://host/) it will return a single directory separator
9447 // (and on Windows, possibly a drive letter).
9449 // The base name is a byte string (*not* UTF-8). It has no defined encoding
9450 // or rules other than it may not contain zero bytes. If you want to use
9451 // filenames in a user interface you should use the display name that you
9452 // can get by requesting the %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME
9453 // attribute with g_file_query_info().
9455 // This call does no blocking i/o.
9457 // if given #GFile is invalid. The returned string should be
9458 // freed with g_free() when no longer needed.
9459 // RETURNS: string containing the #GFile's base name, or %NULL
9460 char* /*new*/ get_basename()() {
9461 return g_file_get_basename(cast(File*)&this);
9464 // Gets a child of @file with basename equal to @name.
9466 // Note that the file with that specific name might not exist, but
9467 // you can still have a #GFile that points to it. You can use this
9468 // for instance to create that file.
9470 // This call does no blocking i/o.
9472 // Free the returned object with g_object_unref().
9473 // RETURNS: a #GFile to a child specified by @name.
9474 // <name>: string containing the child's basename.
9475 File* /*new*/ get_child()(char* name) {
9476 return g_file_get_child(cast(File*)&this, name);
9479 // Gets the child of @file for a given @display_name (i.e. a UTF8
9480 // version of the name). If this function fails, it returns %NULL and @error will be
9481 // set. This is very useful when constructing a GFile for a new file
9482 // and the user entered the filename in the user interface, for instance
9483 // when you select a directory and type a filename in the file selector.
9485 // This call does no blocking i/o.
9487 // %NULL if the display name couldn't be converted.
9488 // Free the returned object with g_object_unref().
9489 // RETURNS: a #GFile to the specified child, or
9490 // <display_name>: string to a possible child.
9491 File* /*new*/ get_child_for_display_name()(char* display_name, GLib2.Error** error=null) {
9492 return g_file_get_child_for_display_name(cast(File*)&this, display_name, error);
9495 // Gets the parent directory for the @file.
9496 // If the @file represents the root directory of the
9497 // file system, then %NULL will be returned.
9499 // This call does no blocking i/o.
9501 // #GFile or %NULL if there is no parent.
9502 // Free the returned object with g_object_unref().
9503 // RETURNS: a #GFile structure to the parent of the given
9504 File* /*new*/ get_parent()() {
9505 return g_file_get_parent(cast(File*)&this);
9508 // Gets the parse name of the @file.
9509 // A parse name is a UTF-8 string that describes the
9510 // file such that one can get the #GFile back using
9511 // g_file_parse_name().
9513 // This is generally used to show the #GFile as a nice
9514 // full-pathname kind of string in a user interface,
9515 // like in a location entry.
9517 // For local files with names that can safely be converted
9518 // to UTF8 the pathname is used, otherwise the IRI is used
9519 // (a form of URI that allows UTF8 characters unescaped).
9521 // This call does no blocking i/o.
9523 // string should be freed with g_free() when no longer needed.
9524 // RETURNS: a string containing the #GFile's parse name. The returned
9525 char* /*new*/ get_parse_name()() {
9526 return g_file_get_parse_name(cast(File*)&this);
9529 // Gets the local pathname for #GFile, if one exists.
9531 // This call does no blocking i/o.
9533 // no such path exists. The returned string should be
9534 // freed with g_free() when no longer needed.
9535 // RETURNS: string containing the #GFile's path, or %NULL if
9536 char* /*new*/ get_path()() {
9537 return g_file_get_path(cast(File*)&this);
9540 // Gets the path for @descendant relative to @parent.
9542 // This call does no blocking i/o.
9544 // to @parent, or %NULL if @descendant doesn't have @parent as prefix.
9545 // The returned string should be freed with g_free() when no longer needed.
9546 // RETURNS: string with the relative path from @descendant
9547 // <descendant>: input #GFile.
9548 char* /*new*/ get_relative_path()(File* descendant) {
9549 return g_file_get_relative_path(cast(File*)&this, descendant);
9552 // Gets the URI for the @file.
9554 // This call does no blocking i/o.
9556 // The returned string should be freed with g_free() when no longer needed.
9557 // RETURNS: a string containing the #GFile's URI.
9558 char* /*new*/ get_uri()() {
9559 return g_file_get_uri(cast(File*)&this);
9562 // Gets the URI scheme for a #GFile.
9563 // RFC 3986 decodes the scheme as:
9564 // <programlisting>
9565 // URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
9566 // </programlisting>
9567 // Common schemes include "file", "http", "ftp", etc.
9569 // This call does no blocking i/o.
9571 // #GFile. The returned string should be freed with g_free()
9572 // when no longer needed.
9573 // RETURNS: a string containing the URI scheme for the given
9574 char* /*new*/ get_uri_scheme()() {
9575 return g_file_get_uri_scheme(cast(File*)&this);
9578 // VERSION: 2.24
9579 // Checks if @file has a parent, and optionally, if it is @parent.
9581 // If @parent is %NULL then this function returns %TRUE if @file has any
9582 // parent at all. If @parent is non-%NULL then %TRUE is only returned
9583 // if @file is a child of @parent.
9585 // case that @parent is %NULL).
9586 // RETURNS: %TRUE if @file is a child of @parent (or any parent in the
9587 // <parent>: the parent to check for, or %NULL
9588 int has_parent()(File* parent=null) {
9589 return g_file_has_parent(cast(File*)&this, parent);
9592 // Checks whether @file has the prefix specified by @prefix. In other word,
9593 // if the names of initial elements of @file<!-- -->s pathname match @prefix.
9594 // Only full pathname elements are matched, so a path like /foo is not
9595 // considered a prefix of /foobar, only of /foo/bar.
9597 // This call does no i/o, as it works purely on names. As such it can
9598 // sometimes return %FALSE even if @file is inside a @prefix (from a
9599 // filesystem point of view), because the prefix of @file is an alias
9600 // of @prefix.
9602 // %FALSE otherwise.
9603 // RETURNS: %TRUE if the @files's parent, grandparent, etc is @prefix.
9604 // <prefix>: input #GFile.
9605 int has_prefix()(File* prefix) {
9606 return g_file_has_prefix(cast(File*)&this, prefix);
9609 // Checks to see if a #GFile has a given URI scheme.
9611 // This call does no blocking i/o.
9613 // given URI scheme, %FALSE if URI scheme is %NULL,
9614 // not supported, or #GFile is invalid.
9615 // RETURNS: %TRUE if #GFile's backend supports the
9616 // <uri_scheme>: a string containing a URI scheme.
9617 int has_uri_scheme()(char* uri_scheme) {
9618 return g_file_has_uri_scheme(cast(File*)&this, uri_scheme);
9621 // Creates a hash value for a #GFile.
9623 // This call does no blocking i/o.
9625 // integer that can be used as hash value for the #GFile.
9626 // This function is intended for easily hashing a #GFile to
9627 // add to a #GHashTable or similar data structure.
9628 // RETURNS: 0 if @file is not a valid #GFile, otherwise an
9629 uint hash()() {
9630 return g_file_hash(cast(File*)&this);
9633 // Checks to see if a file is native to the platform.
9635 // A native file s one expressed in the platform-native filename format,
9636 // e.g. "C:\Windows" or "/usr/bin/". This does not mean the file is local,
9637 // as it might be on a locally mounted remote filesystem.
9639 // On some systems non-native files may be available using
9640 // the native filesystem via a userspace filesystem (FUSE), in
9641 // these cases this call will return %FALSE, but g_file_get_path()
9642 // will still return a native path.
9644 // This call does no blocking i/o.
9645 // RETURNS: %TRUE if file is native.
9646 int is_native()() {
9647 return g_file_is_native(cast(File*)&this);
9650 // Loads the content of the file into memory. The data is always
9651 // zero-terminated, but this is not included in the resultant @length.
9652 // The returned @content should be freed with g_free() when no longer
9653 // needed.
9655 // If @cancellable is not %NULL, then the operation can be cancelled by
9656 // triggering the cancellable object from another thread. If the operation
9657 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9659 // %FALSE if there were errors.
9660 // RETURNS: %TRUE if the @file's contents were successfully loaded.
9661 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9662 // <contents>: a location to place the contents of the file.
9663 // <length>: a location to place the length of the contents of the file, or %NULL if the length is not needed
9664 // <etag_out>: a location to place the current entity tag for the file, or %NULL if the entity tag is not needed
9665 int load_contents()(Cancellable* cancellable, /*out*/ ubyte** contents, /*out*/ size_t* length, /*out*/ char** etag_out, GLib2.Error** error=null) {
9666 return g_file_load_contents(cast(File*)&this, cancellable, contents, length, etag_out, error);
9669 // Starts an asynchronous load of the @file's contents.
9671 // For more details, see g_file_load_contents() which is
9672 // the synchronous version of this call.
9674 // When the load operation has completed, @callback will be called
9675 // with @user data. To finish the operation, call
9676 // g_file_load_contents_finish() with the #GAsyncResult returned by
9677 // the @callback.
9679 // If @cancellable is not %NULL, then the operation can be cancelled by
9680 // triggering the cancellable object from another thread. If the operation
9681 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9682 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9683 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
9684 // <user_data>: the data to pass to callback function
9685 void load_contents_async()(Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
9686 g_file_load_contents_async(cast(File*)&this, cancellable, callback, user_data);
9689 // Finishes an asynchronous load of the @file's contents.
9690 // The contents are placed in @contents, and @length is set to the
9691 // size of the @contents string. The @content should be freed with
9692 // g_free() when no longer needed. If @etag_out is present, it will be
9693 // set to the new entity tag for the @file.
9695 // present, it will be set appropriately.
9696 // RETURNS: %TRUE if the load was successful. If %FALSE and @error is
9697 // <res>: a #GAsyncResult.
9698 // <contents>: a location to place the contents of the file.
9699 // <length>: a location to place the length of the contents of the file, or %NULL if the length is not needed
9700 // <etag_out>: a location to place the current entity tag for the file, or %NULL if the entity tag is not needed
9701 int load_contents_finish()(AsyncResult* res, /*out*/ ubyte** contents, /*out*/ size_t* length, /*out*/ char** etag_out, GLib2.Error** error=null) {
9702 return g_file_load_contents_finish(cast(File*)&this, res, contents, length, etag_out, error);
9705 // Unintrospectable method: load_partial_contents_async() / g_file_load_partial_contents_async()
9706 // Reads the partial contents of a file. A #GFileReadMoreCallback should be
9707 // used to stop reading from the file when appropriate, else this function
9708 // will behave exactly as g_file_load_contents_async(). This operation
9709 // can be finished by g_file_load_partial_contents_finish().
9711 // Users of this function should be aware that @user_data is passed to
9712 // both the @read_more_callback and the @callback.
9714 // If @cancellable is not %NULL, then the operation can be cancelled by
9715 // triggering the cancellable object from another thread. If the operation
9716 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9717 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9718 // <read_more_callback>: a #GFileReadMoreCallback to receive partial data and to specify whether further data should be read.
9719 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
9720 // <user_data>: the data to pass to the callback functions.
9721 void load_partial_contents_async()(Cancellable* cancellable, FileReadMoreCallback read_more_callback, AsyncReadyCallback callback, void* user_data) {
9722 g_file_load_partial_contents_async(cast(File*)&this, cancellable, read_more_callback, callback, user_data);
9725 // Finishes an asynchronous partial load operation that was started
9726 // with g_file_load_partial_contents_async(). The data is always
9727 // zero-terminated, but this is not included in the resultant @length.
9728 // The returned @content should be freed with g_free() when no longer
9729 // needed.
9731 // present, it will be set appropriately.
9732 // RETURNS: %TRUE if the load was successful. If %FALSE and @error is
9733 // <res>: a #GAsyncResult.
9734 // <contents>: a location to place the contents of the file.
9735 // <length>: a location to place the length of the contents of the file, or %NULL if the length is not needed
9736 // <etag_out>: a location to place the current entity tag for the file, or %NULL if the entity tag is not needed
9737 int load_partial_contents_finish()(AsyncResult* res, /*out*/ ubyte** contents, /*out*/ size_t* length, /*out*/ char** etag_out, GLib2.Error** error=null) {
9738 return g_file_load_partial_contents_finish(cast(File*)&this, res, contents, length, etag_out, error);
9741 // Creates a directory. Note that this will only create a child directory of
9742 // the immediate parent directory of the path or URI given by the #GFile. To
9743 // recursively create directories, see g_file_make_directory_with_parents().
9744 // This function will fail if the parent directory does not exist, setting
9745 // @error to %G_IO_ERROR_NOT_FOUND. If the file system doesn't support creating
9746 // directories, this function will fail, setting @error to
9747 // %G_IO_ERROR_NOT_SUPPORTED.
9749 // For a local #GFile the newly created directory will have the default
9750 // (current) ownership and permissions of the current process.
9752 // If @cancellable is not %NULL, then the operation can be cancelled by
9753 // triggering the cancellable object from another thread. If the operation
9754 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9755 // RETURNS: %TRUE on successful creation, %FALSE otherwise.
9756 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9757 int make_directory()(Cancellable* cancellable, GLib2.Error** error=null) {
9758 return g_file_make_directory(cast(File*)&this, cancellable, error);
9761 // VERSION: 2.18
9762 // Creates a directory and any parent directories that may not exist similar to
9763 // 'mkdir -p'. If the file system does not support creating directories, this
9764 // function will fail, setting @error to %G_IO_ERROR_NOT_SUPPORTED. If the
9765 // directory itself already exists, this function will fail setting @error
9766 // to %G_IO_ERROR_EXISTS, unlike the similar g_mkdir_with_parents().
9768 // For a local #GFile the newly created directories will have the default
9769 // (current) ownership and permissions of the current process.
9771 // If @cancellable is not %NULL, then the operation can be cancelled by
9772 // triggering the cancellable object from another thread. If the operation
9773 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9775 // otherwise.
9776 // RETURNS: %TRUE if all directories have been successfully created, %FALSE
9777 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9778 int make_directory_with_parents()(Cancellable* cancellable, GLib2.Error** error=null) {
9779 return g_file_make_directory_with_parents(cast(File*)&this, cancellable, error);
9782 // Creates a symbolic link named @file which contains the string
9783 // @symlink_value.
9785 // If @cancellable is not %NULL, then the operation can be cancelled by
9786 // triggering the cancellable object from another thread. If the operation
9787 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9788 // RETURNS: %TRUE on the creation of a new symlink, %FALSE otherwise.
9789 // <symlink_value>: a string with the path for the target of the new symlink
9790 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9791 int make_symbolic_link()(char* symlink_value, Cancellable* cancellable, GLib2.Error** error=null) {
9792 return g_file_make_symbolic_link(cast(File*)&this, symlink_value, cancellable, error);
9795 // VERSION: 2.18
9796 // Obtains a file or directory monitor for the given file, depending
9797 // on the type of the file.
9799 // If @cancellable is not %NULL, then the operation can be cancelled by
9800 // triggering the cancellable object from another thread. If the operation
9801 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9803 // Free the returned object with g_object_unref().
9804 // RETURNS: a #GFileMonitor for the given @file, or %NULL on error.
9805 // <flags>: a set of #GFileMonitorFlags
9806 // <cancellable>: optional #GCancellable object, %NULL to ignore
9807 FileMonitor* /*new*/ monitor()(FileMonitorFlags flags, Cancellable* cancellable, GLib2.Error** error=null) {
9808 return g_file_monitor(cast(File*)&this, flags, cancellable, error);
9811 // Obtains a directory monitor for the given file.
9812 // This may fail if directory monitoring is not supported.
9814 // If @cancellable is not %NULL, then the operation can be cancelled by
9815 // triggering the cancellable object from another thread. If the operation
9816 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9818 // Free the returned object with g_object_unref().
9819 // RETURNS: a #GFileMonitor for the given @file, or %NULL on error.
9820 // <flags>: a set of #GFileMonitorFlags.
9821 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9822 FileMonitor* /*new*/ monitor_directory()(FileMonitorFlags flags, Cancellable* cancellable, GLib2.Error** error=null) {
9823 return g_file_monitor_directory(cast(File*)&this, flags, cancellable, error);
9826 // Obtains a file monitor for the given file. If no file notification
9827 // mechanism exists, then regular polling of the file is used.
9829 // If @cancellable is not %NULL, then the operation can be cancelled by
9830 // triggering the cancellable object from another thread. If the operation
9831 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9833 // Free the returned object with g_object_unref().
9834 // RETURNS: a #GFileMonitor for the given @file, or %NULL on error.
9835 // <flags>: a set of #GFileMonitorFlags.
9836 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9837 FileMonitor* /*new*/ monitor_file()(FileMonitorFlags flags, Cancellable* cancellable, GLib2.Error** error=null) {
9838 return g_file_monitor_file(cast(File*)&this, flags, cancellable, error);
9841 // Starts a @mount_operation, mounting the volume that contains the file @location.
9843 // When this operation has completed, @callback will be called with
9844 // @user_user data, and the operation can be finalized with
9845 // g_file_mount_enclosing_volume_finish().
9847 // If @cancellable is not %NULL, then the operation can be cancelled by
9848 // triggering the cancellable object from another thread. If the operation
9849 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9850 // <flags>: flags affecting the operation
9851 // <mount_operation>: a #GMountOperation or %NULL to avoid user interaction.
9852 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9853 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
9854 // <user_data>: the data to pass to callback function
9855 void mount_enclosing_volume()(MountMountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
9856 g_file_mount_enclosing_volume(cast(File*)&this, flags, mount_operation, cancellable, callback, user_data);
9859 // Finishes a mount operation started by g_file_mount_enclosing_volume().
9861 // has occurred, this function will return %FALSE and set @error
9862 // appropriately if present.
9863 // RETURNS: %TRUE if successful. If an error
9864 // <result>: a #GAsyncResult.
9865 int mount_enclosing_volume_finish()(AsyncResult* result, GLib2.Error** error=null) {
9866 return g_file_mount_enclosing_volume_finish(cast(File*)&this, result, error);
9869 // Mounts a file of type G_FILE_TYPE_MOUNTABLE.
9870 // Using @mount_operation, you can request callbacks when, for instance,
9871 // passwords are needed during authentication.
9873 // If @cancellable is not %NULL, then the operation can be cancelled by
9874 // triggering the cancellable object from another thread. If the operation
9875 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9877 // When the operation is finished, @callback will be called. You can then call
9878 // g_file_mount_mountable_finish() to get the result of the operation.
9879 // <flags>: flags affecting the operation
9880 // <mount_operation>: a #GMountOperation, or %NULL to avoid user interaction.
9881 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9882 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
9883 // <user_data>: the data to pass to callback function
9884 void mount_mountable()(MountMountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
9885 g_file_mount_mountable(cast(File*)&this, flags, mount_operation, cancellable, callback, user_data);
9888 // Finishes a mount operation. See g_file_mount_mountable() for details.
9890 // Finish an asynchronous mount operation that was started
9891 // with g_file_mount_mountable().
9893 // Free the returned object with g_object_unref().
9894 // RETURNS: a #GFile or %NULL on error.
9895 // <result>: a #GAsyncResult.
9896 File* /*new*/ mount_mountable_finish()(AsyncResult* result, GLib2.Error** error=null) {
9897 return g_file_mount_mountable_finish(cast(File*)&this, result, error);
9900 // Tries to move the file or directory @source to the location specified by @destination.
9901 // If native move operations are supported then this is used, otherwise a copy + delete
9902 // fallback is used. The native implementation may support moving directories (for instance
9903 // on moves inside the same filesystem), but the fallback code does not.
9905 // If the flag #G_FILE_COPY_OVERWRITE is specified an already
9906 // existing @destination file is overwritten.
9908 // If the flag #G_FILE_COPY_NOFOLLOW_SYMLINKS is specified then symlinks
9909 // will be copied as symlinks, otherwise the target of the
9910 // @source symlink will be copied.
9912 // If @cancellable is not %NULL, then the operation can be cancelled by
9913 // triggering the cancellable object from another thread. If the operation
9914 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9916 // If @progress_callback is not %NULL, then the operation can be monitored by
9917 // setting this to a #GFileProgressCallback function. @progress_callback_data
9918 // will be passed to this function. It is guaranteed that this callback will
9919 // be called after all data has been transferred with the total number of bytes
9920 // copied during the operation.
9922 // If the @source file does not exist then the G_IO_ERROR_NOT_FOUND
9923 // error is returned, independent on the status of the @destination.
9925 // If #G_FILE_COPY_OVERWRITE is not specified and the target exists, then the
9926 // error G_IO_ERROR_EXISTS is returned.
9928 // If trying to overwrite a file over a directory the G_IO_ERROR_IS_DIRECTORY
9929 // error is returned. If trying to overwrite a directory with a directory the
9930 // G_IO_ERROR_WOULD_MERGE error is returned.
9932 // If the source is a directory and the target does not exist, or #G_FILE_COPY_OVERWRITE is
9933 // specified and the target is a file, then the G_IO_ERROR_WOULD_RECURSE error
9934 // may be returned (if the native move operation isn't available).
9935 // RETURNS: %TRUE on successful move, %FALSE otherwise.
9936 // <destination>: #GFile pointing to the destination location.
9937 // <flags>: set of #GFileCopyFlags.
9938 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9939 // <progress_callback>: #GFileProgressCallback function for updates.
9940 // <progress_callback_data>: gpointer to user data for the callback function.
9941 int move()(File* destination, FileCopyFlags flags, Cancellable* cancellable, FileProgressCallback progress_callback, void* progress_callback_data, GLib2.Error** error=null) {
9942 return g_file_move(cast(File*)&this, destination, flags, cancellable, progress_callback, progress_callback_data, error);
9945 // VERSION: 2.22
9946 // Opens an existing file for reading and writing. The result is
9947 // a #GFileIOStream that can be used to read and write the contents of the file.
9949 // If @cancellable is not %NULL, then the operation can be cancelled by
9950 // triggering the cancellable object from another thread. If the operation
9951 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9953 // If the file does not exist, the G_IO_ERROR_NOT_FOUND error will be returned.
9954 // If the file is a directory, the G_IO_ERROR_IS_DIRECTORY error will be returned.
9955 // Other errors are possible too, and depend on what kind of filesystem the file is on.
9956 // Note that in many non-local file cases read and write streams are not supported,
9957 // so make sure you really need to do read and write streaming, rather than
9958 // just opening for reading or writing.
9960 // Free the returned object with g_object_unref().
9961 // RETURNS: #GFileIOStream or %NULL on error.
9962 // <cancellable>: a #GCancellable
9963 FileIOStream* /*new*/ open_readwrite()(Cancellable* cancellable, GLib2.Error** error=null) {
9964 return g_file_open_readwrite(cast(File*)&this, cancellable, error);
9967 // VERSION: 2.22
9968 // Asynchronously opens @file for reading and writing.
9970 // For more details, see g_file_open_readwrite() which is
9971 // the synchronous version of this call.
9973 // When the operation is finished, @callback will be called. You can then call
9974 // g_file_open_readwrite_finish() to get the result of the operation.
9975 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
9976 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9977 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
9978 // <user_data>: the data to pass to callback function
9979 void open_readwrite_async()(int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
9980 g_file_open_readwrite_async(cast(File*)&this, io_priority, cancellable, callback, user_data);
9983 // VERSION: 2.22
9984 // Finishes an asynchronous file read operation started with
9985 // g_file_open_readwrite_async().
9987 // Free the returned object with g_object_unref().
9988 // RETURNS: a #GFileIOStream or %NULL on error.
9989 // <res>: a #GAsyncResult.
9990 FileIOStream* /*new*/ open_readwrite_finish()(AsyncResult* res, GLib2.Error** error=null) {
9991 return g_file_open_readwrite_finish(cast(File*)&this, res, error);
9994 // VERSION: 2.22
9995 // Polls a file of type G_FILE_TYPE_MOUNTABLE.
9997 // If @cancellable is not %NULL, then the operation can be cancelled by
9998 // triggering the cancellable object from another thread. If the operation
9999 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10001 // When the operation is finished, @callback will be called. You can then call
10002 // g_file_mount_mountable_finish() to get the result of the operation.
10003 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10004 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
10005 // <user_data>: the data to pass to callback function
10006 void poll_mountable()(Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
10007 g_file_poll_mountable(cast(File*)&this, cancellable, callback, user_data);
10010 // VERSION: 2.22
10011 // Finishes a poll operation. See g_file_poll_mountable() for details.
10013 // Finish an asynchronous poll operation that was polled
10014 // with g_file_poll_mountable().
10016 // otherwise.
10017 // RETURNS: %TRUE if the operation finished successfully. %FALSE
10018 // <result>: a #GAsyncResult.
10019 int poll_mountable_finish()(AsyncResult* result, GLib2.Error** error=null) {
10020 return g_file_poll_mountable_finish(cast(File*)&this, result, error);
10023 // Returns the #GAppInfo that is registered as the default
10024 // application to handle the file specified by @file.
10026 // If @cancellable is not %NULL, then the operation can be cancelled by
10027 // triggering the cancellable object from another thread. If the operation
10028 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10030 // When you are done with it, release it with g_object_unref()
10031 // RETURNS: a #GAppInfo if the handle was found, %NULL if there were errors.
10032 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10033 AppInfo* /*new*/ query_default_handler()(Cancellable* cancellable, GLib2.Error** error=null) {
10034 return g_file_query_default_handler(cast(File*)&this, cancellable, error);
10037 // Utility function to check if a particular file exists. This is
10038 // implemented using g_file_query_info() and as such does blocking I/O.
10040 // Note that in many cases it is racy to first check for file existence
10041 // and then execute something based on the outcome of that, because the
10042 // file might have been created or removed in between the operations. The
10043 // general approach to handling that is to not check, but just do the
10044 // operation and handle the errors as they come.
10046 // As an example of race-free checking, take the case of reading a file, and
10047 // if it doesn't exist, creating it. There are two racy versions: read it, and
10048 // on error create it; and: check if it exists, if not create it. These
10049 // can both result in two processes creating the file (with perhaps a partially
10050 // written file as the result). The correct approach is to always try to create
10051 // the file with g_file_create() which will either atomically create the file
10052 // or fail with a G_IO_ERROR_EXISTS error.
10054 // However, in many cases an existence check is useful in a user
10055 // interface, for instance to make a menu item sensitive/insensitive, so that
10056 // you don't have to fool users that something is possible and then just show
10057 // and error dialog. If you do this, you should make sure to also handle the
10058 // errors that can happen due to races when you execute the operation.
10059 // RETURNS: %TRUE if the file exists (and can be detected without error), %FALSE otherwise (or if cancelled).
10060 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10061 int query_exists()(Cancellable* cancellable=null) {
10062 return g_file_query_exists(cast(File*)&this, cancellable);
10065 // VERSION: 2.18
10066 // Utility function to inspect the #GFileType of a file. This is
10067 // implemented using g_file_query_info() and as such does blocking I/O.
10069 // The primary use case of this method is to check if a file is a regular file,
10070 // directory, or symlink.
10072 // does not exist
10073 // RETURNS: The #GFileType of the file and #G_FILE_TYPE_UNKNOWN if the file
10074 // <flags>: a set of #GFileQueryInfoFlags passed to g_file_query_info().
10075 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10076 FileType query_file_type()(FileQueryInfoFlags flags, Cancellable* cancellable=null) {
10077 return g_file_query_file_type(cast(File*)&this, flags, cancellable);
10080 // Similar to g_file_query_info(), but obtains information
10081 // about the filesystem the @file is on, rather than the file itself.
10082 // For instance the amount of space available and the type of
10083 // the filesystem.
10085 // The @attributes value is a string that specifies the file attributes that
10086 // should be gathered. It is not an error if it's not possible to read a particular
10087 // requested attribute from a file - it just won't be set. @attributes should
10088 // be a comma-separated list of attributes or attribute wildcards. The wildcard "*"
10089 // means all attributes, and a wildcard like "filesystem::*" means all attributes in the
10090 // filesystem namespace. The standard namespace for filesystem attributes is "filesystem".
10091 // Common attributes of interest are #G_FILE_ATTRIBUTE_FILESYSTEM_SIZE
10092 // (the total size of the filesystem in bytes), #G_FILE_ATTRIBUTE_FILESYSTEM_FREE (number of
10093 // bytes available), and #G_FILE_ATTRIBUTE_FILESYSTEM_TYPE (type of the filesystem).
10095 // If @cancellable is not %NULL, then the operation can be cancelled by
10096 // triggering the cancellable object from another thread. If the operation
10097 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10099 // If the file does not exist, the G_IO_ERROR_NOT_FOUND error will be returned.
10100 // Other errors are possible too, and depend on what kind of filesystem the file is on.
10102 // Free the returned object with g_object_unref().
10103 // RETURNS: a #GFileInfo or %NULL if there was an error.
10104 // <attributes>: an attribute query string.
10105 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10106 FileInfo* /*new*/ query_filesystem_info()(char* attributes, Cancellable* cancellable, GLib2.Error** error=null) {
10107 return g_file_query_filesystem_info(cast(File*)&this, attributes, cancellable, error);
10110 // Asynchronously gets the requested information about the filesystem
10111 // that the specified @file is on. The result is a #GFileInfo object
10112 // that contains key-value attributes (such as type or size for the
10113 // file).
10115 // For more details, see g_file_query_filesystem_info() which is the
10116 // synchronous version of this call.
10118 // When the operation is finished, @callback will be called. You can
10119 // then call g_file_query_info_finish() to get the result of the
10120 // operation.
10121 // <attributes>: an attribute query string.
10122 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
10123 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10124 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
10125 // <user_data>: the data to pass to callback function
10126 void query_filesystem_info_async()(char* attributes, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
10127 g_file_query_filesystem_info_async(cast(File*)&this, attributes, io_priority, cancellable, callback, user_data);
10130 // Finishes an asynchronous filesystem info query. See
10131 // g_file_query_filesystem_info_async().
10133 // Free the returned object with g_object_unref().
10134 // RETURNS: #GFileInfo for given @file or %NULL on error.
10135 // <res>: a #GAsyncResult.
10136 FileInfo* /*new*/ query_filesystem_info_finish()(AsyncResult* res, GLib2.Error** error=null) {
10137 return g_file_query_filesystem_info_finish(cast(File*)&this, res, error);
10140 // Gets the requested information about specified @file. The result
10141 // is a #GFileInfo object that contains key-value attributes (such as
10142 // the type or size of the file).
10144 // The @attributes value is a string that specifies the file attributes that
10145 // should be gathered. It is not an error if it's not possible to read a particular
10146 // requested attribute from a file - it just won't be set. @attributes should
10147 // be a comma-separated list of attributes or attribute wildcards. The wildcard "*"
10148 // means all attributes, and a wildcard like "standard::*" means all attributes in the standard
10149 // namespace. An example attribute query be "standard::*,owner::user".
10150 // The standard attributes are available as defines, like #G_FILE_ATTRIBUTE_STANDARD_NAME.
10152 // If @cancellable is not %NULL, then the operation can be cancelled by
10153 // triggering the cancellable object from another thread. If the operation
10154 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10156 // For symlinks, normally the information about the target of the
10157 // symlink is returned, rather than information about the symlink itself.
10158 // However if you pass #G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS in @flags the
10159 // information about the symlink itself will be returned. Also, for symlinks
10160 // that point to non-existing files the information about the symlink itself
10161 // will be returned.
10163 // If the file does not exist, the G_IO_ERROR_NOT_FOUND error will be returned.
10164 // Other errors are possible too, and depend on what kind of filesystem the file is on.
10166 // Free the returned object with g_object_unref().
10167 // RETURNS: a #GFileInfo for the given @file, or %NULL on error.
10168 // <attributes>: an attribute query string.
10169 // <flags>: a set of #GFileQueryInfoFlags.
10170 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10171 FileInfo* /*new*/ query_info()(char* attributes, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error=null) {
10172 return g_file_query_info(cast(File*)&this, attributes, flags, cancellable, error);
10175 // Asynchronously gets the requested information about specified @file. The result
10176 // is a #GFileInfo object that contains key-value attributes (such as type or size
10177 // for the file).
10179 // For more details, see g_file_query_info() which is
10180 // the synchronous version of this call.
10182 // When the operation is finished, @callback will be called. You can then call
10183 // g_file_query_info_finish() to get the result of the operation.
10184 // <attributes>: an attribute query string.
10185 // <flags>: a set of #GFileQueryInfoFlags.
10186 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
10187 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10188 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
10189 // <user_data>: the data to pass to callback function
10190 void query_info_async()(char* attributes, FileQueryInfoFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
10191 g_file_query_info_async(cast(File*)&this, attributes, flags, io_priority, cancellable, callback, user_data);
10194 // Finishes an asynchronous file info query.
10195 // See g_file_query_info_async().
10197 // Free the returned object with g_object_unref().
10198 // RETURNS: #GFileInfo for given @file or %NULL on error.
10199 // <res>: a #GAsyncResult.
10200 FileInfo* /*new*/ query_info_finish()(AsyncResult* res, GLib2.Error** error=null) {
10201 return g_file_query_info_finish(cast(File*)&this, res, error);
10204 // Obtain the list of settable attributes for the file.
10206 // Returns the type and full attribute name of all the attributes
10207 // that can be set on this file. This doesn't mean setting it will always
10208 // succeed though, you might get an access failure, or some specific
10209 // file may not support a specific attribute.
10211 // If @cancellable is not %NULL, then the operation can be cancelled by
10212 // triggering the cancellable object from another thread. If the operation
10213 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10215 // When you are done with it, release it with g_file_attribute_info_list_unref()
10216 // RETURNS: a #GFileAttributeInfoList describing the settable attributes.
10217 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10218 FileAttributeInfoList* /*new*/ query_settable_attributes()(Cancellable* cancellable, GLib2.Error** error=null) {
10219 return g_file_query_settable_attributes(cast(File*)&this, cancellable, error);
10222 // Obtain the list of attribute namespaces where new attributes
10223 // can be created by a user. An example of this is extended
10224 // attributes (in the "xattr" namespace).
10226 // If @cancellable is not %NULL, then the operation can be cancelled by
10227 // triggering the cancellable object from another thread. If the operation
10228 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10230 // When you are done with it, release it with g_file_attribute_info_list_unref()
10231 // RETURNS: a #GFileAttributeInfoList describing the writable namespaces.
10232 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10233 FileAttributeInfoList* /*new*/ query_writable_namespaces()(Cancellable* cancellable, GLib2.Error** error=null) {
10234 return g_file_query_writable_namespaces(cast(File*)&this, cancellable, error);
10237 // Opens a file for reading. The result is a #GFileInputStream that
10238 // can be used to read the contents of the file.
10240 // If @cancellable is not %NULL, then the operation can be cancelled by
10241 // triggering the cancellable object from another thread. If the operation
10242 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10244 // If the file does not exist, the G_IO_ERROR_NOT_FOUND error will be returned.
10245 // If the file is a directory, the G_IO_ERROR_IS_DIRECTORY error will be returned.
10246 // Other errors are possible too, and depend on what kind of filesystem the file is on.
10248 // Free the returned object with g_object_unref().
10249 // RETURNS: #GFileInputStream or %NULL on error.
10250 // <cancellable>: a #GCancellable
10251 FileInputStream* /*new*/ read()(Cancellable* cancellable, GLib2.Error** error=null) {
10252 return g_file_read(cast(File*)&this, cancellable, error);
10255 // Asynchronously opens @file for reading.
10257 // For more details, see g_file_read() which is
10258 // the synchronous version of this call.
10260 // When the operation is finished, @callback will be called. You can then call
10261 // g_file_read_finish() to get the result of the operation.
10262 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
10263 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10264 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
10265 // <user_data>: the data to pass to callback function
10266 void read_async()(int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
10267 g_file_read_async(cast(File*)&this, io_priority, cancellable, callback, user_data);
10270 // Finishes an asynchronous file read operation started with
10271 // g_file_read_async().
10273 // Free the returned object with g_object_unref().
10274 // RETURNS: a #GFileInputStream or %NULL on error.
10275 // <res>: a #GAsyncResult.
10276 FileInputStream* /*new*/ read_finish()(AsyncResult* res, GLib2.Error** error=null) {
10277 return g_file_read_finish(cast(File*)&this, res, error);
10280 // Returns an output stream for overwriting the file, possibly
10281 // creating a backup copy of the file first. If the file doesn't exist,
10282 // it will be created.
10284 // This will try to replace the file in the safest way possible so
10285 // that any errors during the writing will not affect an already
10286 // existing copy of the file. For instance, for local files it
10287 // may write to a temporary file and then atomically rename over
10288 // the destination when the stream is closed.
10290 // By default files created are generally readable by everyone,
10291 // but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
10292 // will be made readable only to the current user, to the level that
10293 // is supported on the target filesystem.
10295 // If @cancellable is not %NULL, then the operation can be cancelled by
10296 // triggering the cancellable object from another thread. If the operation
10297 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10299 // If you pass in a non-#NULL @etag value, then this value is
10300 // compared to the current entity tag of the file, and if they differ
10301 // an G_IO_ERROR_WRONG_ETAG error is returned. This generally means
10302 // that the file has been changed since you last read it. You can get
10303 // the new etag from g_file_output_stream_get_etag() after you've
10304 // finished writing and closed the #GFileOutputStream. When you load
10305 // a new file you can use g_file_input_stream_query_info() to get
10306 // the etag of the file.
10308 // If @make_backup is %TRUE, this function will attempt to make a backup
10309 // of the current file before overwriting it. If this fails a G_IO_ERROR_CANT_CREATE_BACKUP
10310 // error will be returned. If you want to replace anyway, try again with
10311 // @make_backup set to %FALSE.
10313 // If the file is a directory the G_IO_ERROR_IS_DIRECTORY error will be returned,
10314 // and if the file is some other form of non-regular file then a
10315 // G_IO_ERROR_NOT_REGULAR_FILE error will be returned.
10316 // Some file systems don't allow all file names, and may
10317 // return an G_IO_ERROR_INVALID_FILENAME error, and if the name
10318 // is to long G_IO_ERROR_FILENAME_TOO_LONG will be returned.
10319 // Other errors are possible too, and depend on what kind of
10320 // filesystem the file is on.
10322 // Free the returned object with g_object_unref().
10323 // RETURNS: a #GFileOutputStream or %NULL on error.
10324 // <etag>: an optional <link linkend="gfile-etag">entity tag</link> for the current #GFile, or #NULL to ignore.
10325 // <make_backup>: %TRUE if a backup should be created.
10326 // <flags>: a set of #GFileCreateFlags.
10327 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10328 FileOutputStream* /*new*/ replace()(char* etag, int make_backup, FileCreateFlags flags, Cancellable* cancellable, GLib2.Error** error=null) {
10329 return g_file_replace(cast(File*)&this, etag, make_backup, flags, cancellable, error);
10332 // Asynchronously overwrites the file, replacing the contents, possibly
10333 // creating a backup copy of the file first.
10335 // For more details, see g_file_replace() which is
10336 // the synchronous version of this call.
10338 // When the operation is finished, @callback will be called. You can then call
10339 // g_file_replace_finish() to get the result of the operation.
10340 // <etag>: an <link linkend="gfile-etag">entity tag</link> for the current #GFile, or NULL to ignore.
10341 // <make_backup>: %TRUE if a backup should be created.
10342 // <flags>: a set of #GFileCreateFlags.
10343 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
10344 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10345 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
10346 // <user_data>: the data to pass to callback function
10347 void replace_async()(char* etag, int make_backup, FileCreateFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
10348 g_file_replace_async(cast(File*)&this, etag, make_backup, flags, io_priority, cancellable, callback, user_data);
10351 // Replaces the contents of @file with @contents of @length bytes.
10352 // If @etag is specified (not %NULL) any existing file must have that etag, or
10353 // the error %G_IO_ERROR_WRONG_ETAG will be returned.
10355 // If @make_backup is %TRUE, this function will attempt to make a backup of @file.
10357 // If @cancellable is not %NULL, then the operation can be cancelled by
10358 // triggering the cancellable object from another thread. If the operation
10359 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10361 // The returned @new_etag can be used to verify that the file hasn't changed the
10362 // next time it is saved over.
10364 // has occurred, this function will return %FALSE and set @error
10365 // appropriately if present.
10366 // RETURNS: %TRUE if successful. If an error
10367 // <contents>: a string containing the new contents for @file.
10368 // <length>: the length of @contents in bytes.
10369 // <etag>: the old <link linkend="gfile-etag">entity tag</link> for the document, or %NULL
10370 // <make_backup>: %TRUE if a backup should be created.
10371 // <flags>: a set of #GFileCreateFlags.
10372 // <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
10373 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10374 int replace_contents()(ubyte* contents, size_t length, char* etag, int make_backup, FileCreateFlags flags, /*out*/ char** new_etag, Cancellable* cancellable, GLib2.Error** error=null) {
10375 return g_file_replace_contents(cast(File*)&this, contents, length, etag, make_backup, flags, new_etag, cancellable, error);
10378 // Starts an asynchronous replacement of @file with the given
10379 // @contents of @length bytes. @etag will replace the document's
10380 // current entity tag.
10382 // When this operation has completed, @callback will be called with
10383 // @user_user data, and the operation can be finalized with
10384 // g_file_replace_contents_finish().
10386 // If @cancellable is not %NULL, then the operation can be cancelled by
10387 // triggering the cancellable object from another thread. If the operation
10388 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10390 // If @make_backup is %TRUE, this function will attempt to
10391 // make a backup of @file.
10392 // <contents>: string of contents to replace the file with.
10393 // <length>: the length of @contents in bytes.
10394 // <etag>: a new <link linkend="gfile-etag">entity tag</link> for the @file, or %NULL
10395 // <make_backup>: %TRUE if a backup should be created.
10396 // <flags>: a set of #GFileCreateFlags.
10397 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10398 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
10399 // <user_data>: the data to pass to callback function
10400 void replace_contents_async()(ubyte* contents, size_t length, char* etag, int make_backup, FileCreateFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
10401 g_file_replace_contents_async(cast(File*)&this, contents, length, etag, make_backup, flags, cancellable, callback, user_data);
10404 // Finishes an asynchronous replace of the given @file. See
10405 // g_file_replace_contents_async(). Sets @new_etag to the new entity
10406 // tag for the document, if present.
10407 // RETURNS: %TRUE on success, %FALSE on failure.
10408 // <res>: a #GAsyncResult.
10409 // <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
10410 int replace_contents_finish()(AsyncResult* res, /*out*/ char** new_etag, GLib2.Error** error=null) {
10411 return g_file_replace_contents_finish(cast(File*)&this, res, new_etag, error);
10414 // Finishes an asynchronous file replace operation started with
10415 // g_file_replace_async().
10417 // Free the returned object with g_object_unref().
10418 // RETURNS: a #GFileOutputStream, or %NULL on error.
10419 // <res>: a #GAsyncResult.
10420 FileOutputStream* /*new*/ replace_finish()(AsyncResult* res, GLib2.Error** error=null) {
10421 return g_file_replace_finish(cast(File*)&this, res, error);
10424 // VERSION: 2.22
10425 // Returns an output stream for overwriting the file in readwrite mode,
10426 // possibly creating a backup copy of the file first. If the file doesn't
10427 // exist, it will be created.
10429 // For details about the behaviour, see g_file_replace() which does the same
10430 // thing but returns an output stream only.
10432 // Note that in many non-local file cases read and write streams are not
10433 // supported, so make sure you really need to do read and write streaming,
10434 // rather than just opening for reading or writing.
10436 // Free the returned object with g_object_unref().
10437 // RETURNS: a #GFileIOStream or %NULL on error.
10438 // <etag>: an optional <link linkend="gfile-etag">entity tag</link> for the current #GFile, or #NULL to ignore
10439 // <make_backup>: %TRUE if a backup should be created
10440 // <flags>: a set of #GFileCreateFlags
10441 // <cancellable>: optional #GCancellable object, %NULL to ignore
10442 FileIOStream* /*new*/ replace_readwrite()(char* etag, int make_backup, FileCreateFlags flags, Cancellable* cancellable, GLib2.Error** error=null) {
10443 return g_file_replace_readwrite(cast(File*)&this, etag, make_backup, flags, cancellable, error);
10446 // VERSION: 2.22
10447 // Asynchronously overwrites the file in read-write mode, replacing the
10448 // contents, possibly creating a backup copy of the file first.
10450 // For more details, see g_file_replace_readwrite() which is
10451 // the synchronous version of this call.
10453 // When the operation is finished, @callback will be called. You can then
10454 // call g_file_replace_readwrite_finish() to get the result of the operation.
10455 // <etag>: an <link linkend="gfile-etag">entity tag</link> for the current #GFile, or NULL to ignore.
10456 // <make_backup>: %TRUE if a backup should be created.
10457 // <flags>: a set of #GFileCreateFlags.
10458 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
10459 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10460 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
10461 // <user_data>: the data to pass to callback function
10462 void replace_readwrite_async()(char* etag, int make_backup, FileCreateFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
10463 g_file_replace_readwrite_async(cast(File*)&this, etag, make_backup, flags, io_priority, cancellable, callback, user_data);
10466 // VERSION: 2.22
10467 // Finishes an asynchronous file replace operation started with
10468 // g_file_replace_readwrite_async().
10470 // Free the returned object with g_object_unref().
10471 // RETURNS: a #GFileIOStream, or %NULL on error.
10472 // <res>: a #GAsyncResult.
10473 FileIOStream* /*new*/ replace_readwrite_finish()(AsyncResult* res, GLib2.Error** error=null) {
10474 return g_file_replace_readwrite_finish(cast(File*)&this, res, error);
10477 // Resolves a relative path for @file to an absolute path.
10479 // This call does no blocking i/o.
10481 // is %NULL or if @file is invalid.
10482 // Free the returned object with g_object_unref().
10483 // RETURNS: #GFile to the resolved path. %NULL if @relative_path
10484 // <relative_path>: a given relative path string.
10485 File* /*new*/ resolve_relative_path()(char* relative_path) {
10486 return g_file_resolve_relative_path(cast(File*)&this, relative_path);
10489 // Sets an attribute in the file with attribute name @attribute to @value.
10491 // Some attributes can be unset by setting @attribute to
10492 // %G_FILE_ATTRIBUTE_TYPE_INVALID and @value_p to %NULL.
10494 // If @cancellable is not %NULL, then the operation can be cancelled by
10495 // triggering the cancellable object from another thread. If the operation
10496 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10497 // RETURNS: %TRUE if the attribute was set, %FALSE otherwise.
10498 // <attribute>: a string containing the attribute's name.
10499 // <type>: The type of the attribute
10500 // <value_p>: a pointer to the value (or the pointer itself if the type is a pointer type)
10501 // <flags>: a set of #GFileQueryInfoFlags.
10502 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10503 int set_attribute()(char* attribute, FileAttributeType type, void* value_p, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error=null) {
10504 return g_file_set_attribute(cast(File*)&this, attribute, type, value_p, flags, cancellable, error);
10507 // Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING to @value.
10508 // If @attribute is of a different type, this operation will fail,
10509 // returning %FALSE.
10511 // If @cancellable is not %NULL, then the operation can be cancelled by
10512 // triggering the cancellable object from another thread. If the operation
10513 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10515 // in the @file, %FALSE otherwise.
10516 // RETURNS: %TRUE if the @attribute was successfully set to @value
10517 // <attribute>: a string containing the attribute's name.
10518 // <value>: a string containing the attribute's new value.
10519 // <flags>: a #GFileQueryInfoFlags.
10520 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10521 int set_attribute_byte_string()(char* attribute, char* value, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error=null) {
10522 return g_file_set_attribute_byte_string(cast(File*)&this, attribute, value, flags, cancellable, error);
10525 // Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_INT32 to @value.
10526 // If @attribute is of a different type, this operation will fail.
10528 // If @cancellable is not %NULL, then the operation can be cancelled by
10529 // triggering the cancellable object from another thread. If the operation
10530 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10532 // in the @file, %FALSE otherwise.
10533 // RETURNS: %TRUE if the @attribute was successfully set to @value
10534 // <attribute>: a string containing the attribute's name.
10535 // <value>: a #gint32 containing the attribute's new value.
10536 // <flags>: a #GFileQueryInfoFlags.
10537 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10538 int set_attribute_int32()(char* attribute, int value, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error=null) {
10539 return g_file_set_attribute_int32(cast(File*)&this, attribute, value, flags, cancellable, error);
10542 // Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_INT64 to @value.
10543 // If @attribute is of a different type, this operation will fail.
10545 // If @cancellable is not %NULL, then the operation can be cancelled by
10546 // triggering the cancellable object from another thread. If the operation
10547 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10548 // RETURNS: %TRUE if the @attribute was successfully set, %FALSE otherwise.
10549 // <attribute>: a string containing the attribute's name.
10550 // <value>: a #guint64 containing the attribute's new value.
10551 // <flags>: a #GFileQueryInfoFlags.
10552 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10553 int set_attribute_int64()(char* attribute, long value, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error=null) {
10554 return g_file_set_attribute_int64(cast(File*)&this, attribute, value, flags, cancellable, error);
10557 // Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_STRING to @value.
10558 // If @attribute is of a different type, this operation will fail.
10560 // If @cancellable is not %NULL, then the operation can be cancelled by
10561 // triggering the cancellable object from another thread. If the operation
10562 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10563 // RETURNS: %TRUE if the @attribute was successfully set, %FALSE otherwise.
10564 // <attribute>: a string containing the attribute's name.
10565 // <value>: a string containing the attribute's value.
10566 // <flags>: #GFileQueryInfoFlags.
10567 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10568 int set_attribute_string()(char* attribute, char* value, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error=null) {
10569 return g_file_set_attribute_string(cast(File*)&this, attribute, value, flags, cancellable, error);
10572 // Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_UINT32 to @value.
10573 // If @attribute is of a different type, this operation will fail.
10575 // If @cancellable is not %NULL, then the operation can be cancelled by
10576 // triggering the cancellable object from another thread. If the operation
10577 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10579 // in the @file, %FALSE otherwise.
10580 // RETURNS: %TRUE if the @attribute was successfully set to @value
10581 // <attribute>: a string containing the attribute's name.
10582 // <value>: a #guint32 containing the attribute's new value.
10583 // <flags>: a #GFileQueryInfoFlags.
10584 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10585 int set_attribute_uint32()(char* attribute, uint value, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error=null) {
10586 return g_file_set_attribute_uint32(cast(File*)&this, attribute, value, flags, cancellable, error);
10589 // Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_UINT64 to @value.
10590 // If @attribute is of a different type, this operation will fail.
10592 // If @cancellable is not %NULL, then the operation can be cancelled by
10593 // triggering the cancellable object from another thread. If the operation
10594 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10596 // in the @file, %FALSE otherwise.
10597 // RETURNS: %TRUE if the @attribute was successfully set to @value
10598 // <attribute>: a string containing the attribute's name.
10599 // <value>: a #guint64 containing the attribute's new value.
10600 // <flags>: a #GFileQueryInfoFlags.
10601 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10602 int set_attribute_uint64()(char* attribute, ulong value, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error=null) {
10603 return g_file_set_attribute_uint64(cast(File*)&this, attribute, value, flags, cancellable, error);
10606 // Asynchronously sets the attributes of @file with @info.
10608 // For more details, see g_file_set_attributes_from_info() which is
10609 // the synchronous version of this call.
10611 // When the operation is finished, @callback will be called. You can then call
10612 // g_file_set_attributes_finish() to get the result of the operation.
10613 // <info>: a #GFileInfo.
10614 // <flags>: a #GFileQueryInfoFlags.
10615 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
10616 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10617 // <callback>: a #GAsyncReadyCallback.
10618 // <user_data>: a #gpointer.
10619 void set_attributes_async()(FileInfo* info, FileQueryInfoFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
10620 g_file_set_attributes_async(cast(File*)&this, info, flags, io_priority, cancellable, callback, user_data);
10623 // Finishes setting an attribute started in g_file_set_attributes_async().
10624 // RETURNS: %TRUE if the attributes were set correctly, %FALSE otherwise.
10625 // <result>: a #GAsyncResult.
10626 // <info>: a #GFileInfo.
10627 int set_attributes_finish()(AsyncResult* result, /*out*/ FileInfo** info, GLib2.Error** error=null) {
10628 return g_file_set_attributes_finish(cast(File*)&this, result, info, error);
10631 // Tries to set all attributes in the #GFileInfo on the target values,
10632 // not stopping on the first error.
10634 // If there is any error during this operation then @error will be set to
10635 // the first error. Error on particular fields are flagged by setting
10636 // the "status" field in the attribute value to
10637 // %G_FILE_ATTRIBUTE_STATUS_ERROR_SETTING, which means you can also detect
10638 // further errors.
10640 // If @cancellable is not %NULL, then the operation can be cancelled by
10641 // triggering the cancellable object from another thread. If the operation
10642 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10643 // RETURNS: %TRUE if there was any error, %FALSE otherwise.
10644 // <info>: a #GFileInfo.
10645 // <flags>: #GFileQueryInfoFlags
10646 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10647 int set_attributes_from_info()(FileInfo* info, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error=null) {
10648 return g_file_set_attributes_from_info(cast(File*)&this, info, flags, cancellable, error);
10651 // Renames @file to the specified display name.
10653 // The display name is converted from UTF8 to the correct encoding for the target
10654 // filesystem if possible and the @file is renamed to this.
10656 // If you want to implement a rename operation in the user interface the edit name
10657 // (#G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME) should be used as the initial value in the rename
10658 // widget, and then the result after editing should be passed to g_file_set_display_name().
10660 // On success the resulting converted filename is returned.
10662 // If @cancellable is not %NULL, then the operation can be cancelled by
10663 // triggering the cancellable object from another thread. If the operation
10664 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10666 // if there was an error.
10667 // Free the returned object with g_object_unref().
10668 // RETURNS: a #GFile specifying what @file was renamed to, or %NULL
10669 // <display_name>: a string.
10670 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10671 File* /*new*/ set_display_name()(char* display_name, Cancellable* cancellable, GLib2.Error** error=null) {
10672 return g_file_set_display_name(cast(File*)&this, display_name, cancellable, error);
10675 // Asynchronously sets the display name for a given #GFile.
10677 // For more details, see g_file_set_display_name() which is
10678 // the synchronous version of this call.
10680 // When the operation is finished, @callback will be called. You can then call
10681 // g_file_set_display_name_finish() to get the result of the operation.
10682 // <display_name>: a string.
10683 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
10684 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10685 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
10686 // <user_data>: the data to pass to callback function
10687 void set_display_name_async()(char* display_name, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
10688 g_file_set_display_name_async(cast(File*)&this, display_name, io_priority, cancellable, callback, user_data);
10691 // Finishes setting a display name started with
10692 // g_file_set_display_name_async().
10694 // Free the returned object with g_object_unref().
10695 // RETURNS: a #GFile or %NULL on error.
10696 // <res>: a #GAsyncResult.
10697 File* /*new*/ set_display_name_finish()(AsyncResult* res, GLib2.Error** error=null) {
10698 return g_file_set_display_name_finish(cast(File*)&this, res, error);
10701 // VERSION: 2.22
10702 // Starts a file of type G_FILE_TYPE_MOUNTABLE.
10703 // Using @start_operation, you can request callbacks when, for instance,
10704 // passwords are needed during authentication.
10706 // If @cancellable is not %NULL, then the operation can be cancelled by
10707 // triggering the cancellable object from another thread. If the operation
10708 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10710 // When the operation is finished, @callback will be called. You can then call
10711 // g_file_mount_mountable_finish() to get the result of the operation.
10712 // <flags>: flags affecting the operation
10713 // <start_operation>: a #GMountOperation, or %NULL to avoid user interaction.
10714 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10715 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
10716 // <user_data>: the data to pass to callback function
10717 void start_mountable()(DriveStartFlags flags, MountOperation* start_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
10718 g_file_start_mountable(cast(File*)&this, flags, start_operation, cancellable, callback, user_data);
10721 // VERSION: 2.22
10722 // Finishes a start operation. See g_file_start_mountable() for details.
10724 // Finish an asynchronous start operation that was started
10725 // with g_file_start_mountable().
10727 // otherwise.
10728 // RETURNS: %TRUE if the operation finished successfully. %FALSE
10729 // <result>: a #GAsyncResult.
10730 int start_mountable_finish()(AsyncResult* result, GLib2.Error** error=null) {
10731 return g_file_start_mountable_finish(cast(File*)&this, result, error);
10734 // VERSION: 2.22
10735 // Stops a file of type G_FILE_TYPE_MOUNTABLE.
10737 // If @cancellable is not %NULL, then the operation can be cancelled by
10738 // triggering the cancellable object from another thread. If the operation
10739 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10741 // When the operation is finished, @callback will be called. You can then call
10742 // g_file_stop_mountable_finish() to get the result of the operation.
10743 // <flags>: flags affecting the operation
10744 // <mount_operation>: a #GMountOperation, or %NULL to avoid user interaction.
10745 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10746 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
10747 // <user_data>: the data to pass to callback function
10748 void stop_mountable()(MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
10749 g_file_stop_mountable(cast(File*)&this, flags, mount_operation, cancellable, callback, user_data);
10752 // VERSION: 2.22
10753 // Finishes an stop operation, see g_file_stop_mountable() for details.
10755 // Finish an asynchronous stop operation that was started
10756 // with g_file_stop_mountable().
10758 // otherwise.
10759 // RETURNS: %TRUE if the operation finished successfully. %FALSE
10760 // <result>: a #GAsyncResult.
10761 int stop_mountable_finish()(AsyncResult* result, GLib2.Error** error=null) {
10762 return g_file_stop_mountable_finish(cast(File*)&this, result, error);
10765 // VERSION: 2.22
10766 // Checks if @file supports <link
10767 // linkend="g-main-context-push-thread-default-context">thread-default
10768 // contexts</link>. If this returns %FALSE, you cannot perform
10769 // asynchronous operations on @file in a thread that has a
10770 // thread-default context.
10771 // RETURNS: Whether or not @file supports thread-default contexts.
10772 int supports_thread_contexts()() {
10773 return g_file_supports_thread_contexts(cast(File*)&this);
10776 // Sends @file to the "Trashcan", if possible. This is similar to
10777 // deleting it, but the user can recover it before emptying the trashcan.
10778 // Not all file systems support trashing, so this call can return the
10779 // %G_IO_ERROR_NOT_SUPPORTED error.
10782 // If @cancellable is not %NULL, then the operation can be cancelled by
10783 // triggering the cancellable object from another thread. If the operation
10784 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10785 // RETURNS: %TRUE on successful trash, %FALSE otherwise.
10786 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10787 int trash()(Cancellable* cancellable, GLib2.Error** error=null) {
10788 return g_file_trash(cast(File*)&this, cancellable, error);
10791 // DEPRECATED (v2.22) method: unmount_mountable - Use g_file_unmount_mountable_with_operation() instead.
10792 // Unmounts a file of type G_FILE_TYPE_MOUNTABLE.
10794 // If @cancellable is not %NULL, then the operation can be cancelled by
10795 // triggering the cancellable object from another thread. If the operation
10796 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10798 // When the operation is finished, @callback will be called. You can then call
10799 // g_file_unmount_mountable_finish() to get the result of the operation.
10800 // <flags>: flags affecting the operation
10801 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10802 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
10803 // <user_data>: the data to pass to callback function
10804 void unmount_mountable()(MountUnmountFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
10805 g_file_unmount_mountable(cast(File*)&this, flags, cancellable, callback, user_data);
10808 // DEPRECATED (v2.22) method: unmount_mountable_finish - Use g_file_unmount_mountable_with_operation_finish() instead.
10809 // Finishes an unmount operation, see g_file_unmount_mountable() for details.
10811 // Finish an asynchronous unmount operation that was started
10812 // with g_file_unmount_mountable().
10814 // otherwise.
10815 // RETURNS: %TRUE if the operation finished successfully. %FALSE
10816 // <result>: a #GAsyncResult.
10817 int unmount_mountable_finish()(AsyncResult* result, GLib2.Error** error=null) {
10818 return g_file_unmount_mountable_finish(cast(File*)&this, result, error);
10821 // VERSION: 2.22
10822 // Unmounts a file of type G_FILE_TYPE_MOUNTABLE.
10824 // If @cancellable is not %NULL, then the operation can be cancelled by
10825 // triggering the cancellable object from another thread. If the operation
10826 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10828 // When the operation is finished, @callback will be called. You can then call
10829 // g_file_unmount_mountable_finish() to get the result of the operation.
10830 // <flags>: flags affecting the operation
10831 // <mount_operation>: a #GMountOperation, or %NULL to avoid user interaction.
10832 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10833 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
10834 // <user_data>: the data to pass to callback function
10835 void unmount_mountable_with_operation()(MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
10836 g_file_unmount_mountable_with_operation(cast(File*)&this, flags, mount_operation, cancellable, callback, user_data);
10839 // VERSION: 2.22
10840 // Finishes an unmount operation, see g_file_unmount_mountable_with_operation() for details.
10842 // Finish an asynchronous unmount operation that was started
10843 // with g_file_unmount_mountable_with_operation().
10845 // otherwise.
10846 // RETURNS: %TRUE if the operation finished successfully. %FALSE
10847 // <result>: a #GAsyncResult.
10848 int unmount_mountable_with_operation_finish()(AsyncResult* result, GLib2.Error** error=null) {
10849 return g_file_unmount_mountable_with_operation_finish(cast(File*)&this, result, error);
10852 mixin __interface__;
10855 // Information about a specific attribute.
10856 struct FileAttributeInfo {
10857 char* name;
10858 FileAttributeType type;
10859 FileAttributeInfoFlags flags;
10862 // Flags specifying the behaviour of an attribute.
10863 enum FileAttributeInfoFlags {
10864 NONE = 0,
10865 COPY_WITH_FILE = 1,
10866 COPY_WHEN_MOVED = 2
10869 // Acts as a lightweight registry for possible valid file attributes.
10870 // The registry stores Key-Value pair formats as #GFileAttributeInfo<!-- -->s.
10871 struct FileAttributeInfoList {
10872 FileAttributeInfo* infos;
10873 int n_infos;
10876 // Creates a new file attribute info list.
10877 // RETURNS: a #GFileAttributeInfoList.
10878 static FileAttributeInfoList* /*new*/ new_()() {
10879 return g_file_attribute_info_list_new();
10882 // Adds a new attribute with @name to the @list, setting
10883 // its @type and @flags.
10884 // <name>: the name of the attribute to add.
10885 // <type>: the #GFileAttributeType for the attribute.
10886 // <flags>: #GFileAttributeInfoFlags for the attribute.
10887 void add()(char* name, FileAttributeType type, FileAttributeInfoFlags flags) {
10888 g_file_attribute_info_list_add(&this, name, type, flags);
10891 // Makes a duplicate of a file attribute info list.
10892 // RETURNS: a copy of the given @list.
10893 FileAttributeInfoList* /*new*/ dup()() {
10894 return g_file_attribute_info_list_dup(&this);
10897 // Gets the file attribute with the name @name from @list.
10899 // attribute isn't found.
10900 // RETURNS: a #GFileAttributeInfo for the @name, or %NULL if an
10901 // <name>: the name of the attribute to lookup.
10902 FileAttributeInfo* lookup()(char* name) {
10903 return g_file_attribute_info_list_lookup(&this, name);
10906 // References a file attribute info list.
10907 // RETURNS: #GFileAttributeInfoList or %NULL on error.
10908 FileAttributeInfoList* /*new*/ ref_()() {
10909 return g_file_attribute_info_list_ref(&this);
10912 // Removes a reference from the given @list. If the reference count
10913 // falls to zero, the @list is deleted.
10914 void unref()() {
10915 g_file_attribute_info_list_unref(&this);
10919 // Determines if a string matches a file attribute.
10920 struct FileAttributeMatcher {
10922 // Creates a new file attribute matcher, which matches attributes
10923 // against a given string. #GFileAttributeMatcher<!-- -->s are reference
10924 // counted structures, and are created with a reference count of 1. If
10925 // the number of references falls to 0, the #GFileAttributeMatcher is
10926 // automatically destroyed.
10928 // The @attribute string should be formatted with specific keys separated
10929 // from namespaces with a double colon. Several "namespace::key" strings may be
10930 // concatenated with a single comma (e.g. "standard::type,standard::is-hidden").
10931 // The wildcard "*" may be used to match all keys and namespaces, or
10932 // "namespace::*" will match all keys in a given namespace.
10934 // Examples of strings to use:
10935 // <table>
10936 // <title>File Attribute Matcher strings and results</title>
10937 // <tgroup cols='2' align='left'><thead>
10938 // <row><entry> Matcher String </entry><entry> Matches </entry></row></thead>
10939 // <tbody>
10940 // <row><entry>"*"</entry><entry>matches all attributes.</entry></row>
10941 // <row><entry>"standard::is-hidden"</entry><entry>matches only the key is-hidden in the standard namespace.</entry></row>
10942 // <row><entry>"standard::type,unix::*"</entry><entry>matches the type key in the standard namespace and
10943 // all keys in the unix namespace.</entry></row>
10944 // </tbody></tgroup>
10945 // </table>
10946 // RETURNS: a #GFileAttributeMatcher.
10947 // <attributes>: an attribute string to match.
10948 static FileAttributeMatcher* /*new*/ new_()(char* attributes) {
10949 return g_file_attribute_matcher_new(attributes);
10952 // Checks if the matcher will match all of the keys in a given namespace.
10953 // This will always return %TRUE if a wildcard character is in use (e.g. if
10954 // matcher was created with "standard::*" and @ns is "standard", or if matcher was created
10955 // using "*" and namespace is anything.)
10957 // TODO: this is awkwardly worded.
10959 // in the given @ns, %FALSE otherwise.
10960 // RETURNS: %TRUE if the matcher matches all of the entries
10961 // <ns>: a string containing a file attribute namespace.
10962 int enumerate_namespace()(char* ns) {
10963 return g_file_attribute_matcher_enumerate_namespace(&this, ns);
10966 // Gets the next matched attribute from a #GFileAttributeMatcher.
10968 // no more attribute exist.
10969 // RETURNS: a string containing the next attribute or %NULL if
10970 char* enumerate_next()() {
10971 return g_file_attribute_matcher_enumerate_next(&this);
10974 // Checks if an attribute will be matched by an attribute matcher. If
10975 // the matcher was created with the "*" matching string, this function
10976 // will always return %TRUE.
10977 // RETURNS: %TRUE if @attribute matches @matcher. %FALSE otherwise.
10978 // <attribute>: a file attribute key.
10979 int matches()(char* attribute) {
10980 return g_file_attribute_matcher_matches(&this, attribute);
10983 // Checks if a attribute matcher only matches a given attribute. Always
10984 // returns %FALSE if "*" was used when creating the matcher.
10985 // RETURNS: %TRUE if the matcher only matches @attribute. %FALSE otherwise.
10986 // <attribute>: a file attribute key.
10987 int matches_only()(char* attribute) {
10988 return g_file_attribute_matcher_matches_only(&this, attribute);
10991 // References a file attribute matcher.
10992 // RETURNS: a #GFileAttributeMatcher.
10993 FileAttributeMatcher* /*new*/ ref_()() {
10994 return g_file_attribute_matcher_ref(&this);
10997 // Subtracts all attributes of @subtract from @matcher and returns
10998 // a matcher that supports those attributes.
11000 // Note that currently it is not possible to remove a single
11001 // attribute when the @matcher matches the whole namespace - or remove
11002 // a namespace or attribute when the matcher matches everything. This
11003 // is a limitation of the current implementation, but may be fixed
11004 // in the future.
11006 // @matcher that are not matched by @subtract
11007 // RETURNS: A file attribute matcher matching all attributes of
11008 // <subtract>: The matcher to subtract
11009 FileAttributeMatcher* /*new*/ subtract()(FileAttributeMatcher* subtract) {
11010 return g_file_attribute_matcher_subtract(&this, subtract);
11013 // VERSION: 2.32
11014 // Prints what the matcher is matching against. The format will be
11015 // equal to the format passed to g_file_attribute_matcher_new().
11016 // The output however, might not be identical, as the matcher may
11017 // decide to use a different order or omit needless parts.
11019 // against or %NULL if @matcher was %NULL.
11020 // RETURNS: a string describing the attributes the matcher matches
11021 char* /*new*/ to_string()() {
11022 return g_file_attribute_matcher_to_string(&this);
11025 // Unreferences @matcher. If the reference count falls below 1,
11026 // the @matcher is automatically freed.
11027 void unref()() {
11028 g_file_attribute_matcher_unref(&this);
11032 // Used by g_file_set_attributes_from_info() when setting file attributes.
11033 enum FileAttributeStatus {
11034 UNSET = 0,
11035 SET = 1,
11036 ERROR_SETTING = 2
11038 // The data types for file attributes.
11039 enum FileAttributeType {
11040 INVALID = 0,
11041 STRING = 1,
11042 BYTE_STRING = 2,
11043 BOOLEAN = 3,
11044 UINT32 = 4,
11045 INT32 = 5,
11046 UINT64 = 6,
11047 INT64 = 7,
11048 OBJECT = 8,
11049 STRINGV = 9
11051 // Flags used when copying or moving files.
11052 enum FileCopyFlags {
11053 NONE = 0,
11054 OVERWRITE = 1,
11055 BACKUP = 2,
11056 NOFOLLOW_SYMLINKS = 4,
11057 ALL_METADATA = 8,
11058 NO_FALLBACK_FOR_MOVE = 16,
11059 TARGET_DEFAULT_PERMS = 32
11061 // Flags used when an operation may create a file.
11062 enum FileCreateFlags {
11063 NONE = 0,
11064 PRIVATE = 1,
11065 REPLACE_DESTINATION = 2
11068 // #GFileDescriptorBased is implemented by streams (implementations of
11069 // #GInputStream or #GOutputStream) that are based on file descriptors.
11071 // Note that <filename>&lt;gio/gfiledescriptorbased.h&gt;</filename> belongs to
11072 // the UNIX-specific GIO interfaces, thus you have to use the
11073 // <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
11074 struct FileDescriptorBased /* Interface */ {
11075 mixin template __interface__() {
11076 // VERSION: 2.24
11077 // Gets the underlying file descriptor.
11078 // RETURNS: The file descriptor
11079 int get_fd()() {
11080 return g_file_descriptor_based_get_fd(cast(FileDescriptorBased*)&this);
11083 mixin __interface__;
11086 struct FileDescriptorBasedIface {
11087 GObject2.TypeInterface g_iface;
11088 // RETURNS: The file descriptor
11089 extern (C) int function (FileDescriptorBased* fd_based) get_fd;
11093 // #GFileEnumerator allows you to operate on a set of #GFile<!-- -->s,
11094 // returning a #GFileInfo structure for each file enumerated (e.g.
11095 // g_file_enumerate_children() will return a #GFileEnumerator for each
11096 // of the children within a directory).
11098 // To get the next file's information from a #GFileEnumerator, use
11099 // g_file_enumerator_next_file() or its asynchronous version,
11100 // g_file_enumerator_next_files_async(). Note that the asynchronous
11101 // version will return a list of #GFileInfo<!---->s, whereas the
11102 // synchronous will only return the next file in the enumerator.
11104 // To close a #GFileEnumerator, use g_file_enumerator_close(), or
11105 // its asynchronous version, g_file_enumerator_close_async(). Once
11106 // a #GFileEnumerator is closed, no further actions may be performed
11107 // on it, and it should be freed with g_object_unref().
11108 struct FileEnumerator /* : GObject.Object */ {
11109 alias parent_instance this;
11110 alias parent_instance super_;
11111 alias parent_instance object;
11112 GObject2.Object parent_instance;
11113 private FileEnumeratorPrivate* priv;
11116 // Releases all resources used by this enumerator, making the
11117 // enumerator return %G_IO_ERROR_CLOSED on all calls.
11119 // This will be automatically called when the last reference
11120 // is dropped, but you might want to call this function to make
11121 // sure resources are released as early as possible.
11122 // RETURNS: #TRUE on success or #FALSE on error.
11123 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11124 int close()(Cancellable* cancellable, GLib2.Error** error=null) {
11125 return g_file_enumerator_close(&this, cancellable, error);
11128 // Asynchronously closes the file enumerator.
11130 // If @cancellable is not %NULL, then the operation can be cancelled by
11131 // triggering the cancellable object from another thread. If the operation
11132 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned in
11133 // g_file_enumerator_close_finish().
11134 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
11135 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11136 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
11137 // <user_data>: the data to pass to callback function
11138 void close_async()(int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
11139 g_file_enumerator_close_async(&this, io_priority, cancellable, callback, user_data);
11142 // Finishes closing a file enumerator, started from g_file_enumerator_close_async().
11144 // If the file enumerator was already closed when g_file_enumerator_close_async()
11145 // was called, then this function will report %G_IO_ERROR_CLOSED in @error, and
11146 // return %FALSE. If the file enumerator had pending operation when the close
11147 // operation was started, then this function will report %G_IO_ERROR_PENDING, and
11148 // return %FALSE. If @cancellable was not %NULL, then the operation may have been
11149 // cancelled by triggering the cancellable object from another thread. If the operation
11150 // was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %FALSE will be
11151 // returned.
11152 // RETURNS: %TRUE if the close operation has finished successfully.
11153 // <result>: a #GAsyncResult.
11154 int close_finish()(AsyncResult* result, GLib2.Error** error=null) {
11155 return g_file_enumerator_close_finish(&this, result, error);
11158 // VERSION: 2.18
11159 // Get the #GFile container which is being enumerated.
11160 // RETURNS: the #GFile which is being enumerated.
11161 File* get_container()() {
11162 return g_file_enumerator_get_container(&this);
11165 // Checks if the file enumerator has pending operations.
11166 // RETURNS: %TRUE if the @enumerator has pending operations.
11167 int has_pending()() {
11168 return g_file_enumerator_has_pending(&this);
11171 // Checks if the file enumerator has been closed.
11172 // RETURNS: %TRUE if the @enumerator is closed.
11173 int is_closed()() {
11174 return g_file_enumerator_is_closed(&this);
11177 // Returns information for the next file in the enumerated object.
11178 // Will block until the information is available. The #GFileInfo
11179 // returned from this function will contain attributes that match the
11180 // attribute string that was passed when the #GFileEnumerator was created.
11182 // On error, returns %NULL and sets @error to the error. If the
11183 // enumerator is at the end, %NULL will be returned and @error will
11184 // be unset.
11186 // Free the returned object with g_object_unref() when no longer needed.
11187 // RETURNS: A #GFileInfo or %NULL on error or end of enumerator.
11188 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11189 FileInfo* /*new*/ next_file()(Cancellable* cancellable, GLib2.Error** error=null) {
11190 return g_file_enumerator_next_file(&this, cancellable, error);
11193 // Request information for a number of files from the enumerator asynchronously.
11194 // When all i/o for the operation is finished the @callback will be called with
11195 // the requested information.
11197 // The callback can be called with less than @num_files files in case of error
11198 // or at the end of the enumerator. In case of a partial error the callback will
11199 // be called with any succeeding items and no error, and on the next request the
11200 // error will be reported. If a request is cancelled the callback will be called
11201 // with %G_IO_ERROR_CANCELLED.
11203 // During an async request no other sync and async calls are allowed, and will
11204 // result in %G_IO_ERROR_PENDING errors.
11206 // Any outstanding i/o request with higher priority (lower numerical value) will
11207 // be executed before an outstanding request with lower priority. Default
11208 // priority is %G_PRIORITY_DEFAULT.
11209 // <num_files>: the number of file info objects to request
11210 // <io_priority>: the <link linkend="gioscheduler">io priority</link> of the request.
11211 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11212 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
11213 // <user_data>: the data to pass to callback function
11214 void next_files_async()(int num_files, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
11215 g_file_enumerator_next_files_async(&this, num_files, io_priority, cancellable, callback, user_data);
11218 // Finishes the asynchronous operation started with g_file_enumerator_next_files_async().
11220 // g_list_free() and unref the infos with g_object_unref() when you're
11221 // done with them.
11222 // RETURNS: a #GList of #GFileInfo<!---->s. You must free the list with
11223 // <result>: a #GAsyncResult.
11224 GLib2.List* /*new*/ next_files_finish()(AsyncResult* result, GLib2.Error** error=null) {
11225 return g_file_enumerator_next_files_finish(&this, result, error);
11228 // Sets the file enumerator as having pending operations.
11229 // <pending>: a boolean value.
11230 void set_pending()(int pending) {
11231 g_file_enumerator_set_pending(&this, pending);
11235 struct FileEnumeratorClass {
11236 GObject2.ObjectClass parent_class;
11238 // RETURNS: A #GFileInfo or %NULL on error or end of enumerator.
11239 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11240 extern (C) FileInfo* /*new*/ function (FileEnumerator* enumerator, Cancellable* cancellable, GLib2.Error** error=null) next_file;
11241 extern (C) int function (FileEnumerator* enumerator, Cancellable* cancellable, GLib2.Error** error=null) close_fn;
11243 // <num_files>: the number of file info objects to request
11244 // <io_priority>: the <link linkend="gioscheduler">io priority</link> of the request.
11245 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11246 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
11247 // <user_data>: the data to pass to callback function
11248 extern (C) void function (FileEnumerator* enumerator, int num_files, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) next_files_async;
11250 // RETURNS: a #GList of #GFileInfo<!---->s. You must free the list with
11251 // <result>: a #GAsyncResult.
11252 extern (C) GLib2.List* /*new*/ function (FileEnumerator* enumerator, AsyncResult* result, GLib2.Error** error=null) next_files_finish;
11254 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
11255 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11256 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
11257 // <user_data>: the data to pass to callback function
11258 extern (C) void function (FileEnumerator* enumerator, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) close_async;
11260 // RETURNS: %TRUE if the close operation has finished successfully.
11261 // <result>: a #GAsyncResult.
11262 extern (C) int function (FileEnumerator* enumerator, AsyncResult* result, GLib2.Error** error=null) close_finish;
11263 extern (C) void function () _g_reserved1;
11264 extern (C) void function () _g_reserved2;
11265 extern (C) void function () _g_reserved3;
11266 extern (C) void function () _g_reserved4;
11267 extern (C) void function () _g_reserved5;
11268 extern (C) void function () _g_reserved6;
11269 extern (C) void function () _g_reserved7;
11272 struct FileEnumeratorPrivate {
11276 // GFileIOStream provides io streams that both read and write to the same
11277 // file handle.
11279 // GFileIOStream implements #GSeekable, which allows the io
11280 // stream to jump to arbitrary positions in the file and to truncate
11281 // the file, provided the filesystem of the file supports these
11282 // operations.
11284 // To find the position of a file io stream, use
11285 // g_seekable_tell().
11287 // To find out if a file io stream supports seeking, use g_seekable_can_seek().
11288 // To position a file io stream, use g_seekable_seek().
11289 // To find out if a file io stream supports truncating, use
11290 // g_seekable_can_truncate(). To truncate a file io
11291 // stream, use g_seekable_truncate().
11293 // The default implementation of all the #GFileIOStream operations
11294 // and the implementation of #GSeekable just call into the same operations
11295 // on the output stream.
11296 struct FileIOStream /* : IOStream */ {
11297 mixin Seekable.__interface__;
11298 alias parent_instance this;
11299 alias parent_instance super_;
11300 alias parent_instance iostream;
11301 IOStream parent_instance;
11302 private FileIOStreamPrivate* priv;
11305 // VERSION: 2.22
11306 // Gets the entity tag for the file when it has been written.
11307 // This must be called after the stream has been written
11308 // and closed, as the etag can change while writing.
11309 // RETURNS: the entity tag for the stream.
11310 char* /*new*/ get_etag()() {
11311 return g_file_io_stream_get_etag(&this);
11314 // VERSION: 2.22
11315 // Queries a file io stream for the given @attributes.
11316 // This function blocks while querying the stream. For the asynchronous
11317 // version of this function, see g_file_io_stream_query_info_async().
11318 // While the stream is blocked, the stream will set the pending flag
11319 // internally, and any other operations on the stream will fail with
11320 // %G_IO_ERROR_PENDING.
11322 // Can fail if the stream was already closed (with @error being set to
11323 // %G_IO_ERROR_CLOSED), the stream has pending operations (with @error being
11324 // set to %G_IO_ERROR_PENDING), or if querying info is not supported for
11325 // the stream's interface (with @error being set to %G_IO_ERROR_NOT_SUPPORTED). I
11326 // all cases of failure, %NULL will be returned.
11328 // If @cancellable is not %NULL, then the operation can be cancelled by
11329 // triggering the cancellable object from another thread. If the operation
11330 // was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %NULL will
11331 // be returned.
11332 // RETURNS: a #GFileInfo for the @stream, or %NULL on error.
11333 // <attributes>: a file attribute query string.
11334 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11335 FileInfo* /*new*/ query_info()(char* attributes, Cancellable* cancellable, GLib2.Error** error=null) {
11336 return g_file_io_stream_query_info(&this, attributes, cancellable, error);
11339 // VERSION: 2.22
11340 // Asynchronously queries the @stream for a #GFileInfo. When completed,
11341 // @callback will be called with a #GAsyncResult which can be used to
11342 // finish the operation with g_file_io_stream_query_info_finish().
11344 // For the synchronous version of this function, see
11345 // g_file_io_stream_query_info().
11346 // <attributes>: a file attribute query string.
11347 // <io_priority>: the <link linkend="gio-GIOScheduler">I/O priority</link> of the request.
11348 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11349 // <callback>: callback to call when the request is satisfied
11350 // <user_data>: the data to pass to callback function
11351 void query_info_async()(char* attributes, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
11352 g_file_io_stream_query_info_async(&this, attributes, io_priority, cancellable, callback, user_data);
11355 // VERSION: 2.22
11356 // Finalizes the asynchronous query started
11357 // by g_file_io_stream_query_info_async().
11358 // RETURNS: A #GFileInfo for the finished query.
11359 // <result>: a #GAsyncResult.
11360 FileInfo* /*new*/ query_info_finish()(AsyncResult* result, GLib2.Error** error=null) {
11361 return g_file_io_stream_query_info_finish(&this, result, error);
11365 struct FileIOStreamClass {
11366 IOStreamClass parent_class;
11367 extern (C) long function (FileIOStream* stream) tell;
11368 extern (C) int function (FileIOStream* stream) can_seek;
11369 extern (C) int function (FileIOStream* stream, long offset, GLib2.SeekType type, Cancellable* cancellable, GLib2.Error** error=null) seek;
11370 extern (C) int function (FileIOStream* stream) can_truncate;
11371 extern (C) int function (FileIOStream* stream, long size, Cancellable* cancellable, GLib2.Error** error=null) truncate_fn;
11373 // RETURNS: a #GFileInfo for the @stream, or %NULL on error.
11374 // <attributes>: a file attribute query string.
11375 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11376 extern (C) FileInfo* /*new*/ function (FileIOStream* stream, char* attributes, Cancellable* cancellable, GLib2.Error** error=null) query_info;
11378 // <attributes>: a file attribute query string.
11379 // <io_priority>: the <link linkend="gio-GIOScheduler">I/O priority</link> of the request.
11380 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11381 // <callback>: callback to call when the request is satisfied
11382 // <user_data>: the data to pass to callback function
11383 extern (C) void function (FileIOStream* stream, char* attributes, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) query_info_async;
11385 // RETURNS: A #GFileInfo for the finished query.
11386 // <result>: a #GAsyncResult.
11387 extern (C) FileInfo* /*new*/ function (FileIOStream* stream, AsyncResult* result, GLib2.Error** error=null) query_info_finish;
11388 // RETURNS: the entity tag for the stream.
11389 extern (C) char* /*new*/ function (FileIOStream* stream) get_etag;
11390 extern (C) void function () _g_reserved1;
11391 extern (C) void function () _g_reserved2;
11392 extern (C) void function () _g_reserved3;
11393 extern (C) void function () _g_reserved4;
11394 extern (C) void function () _g_reserved5;
11397 struct FileIOStreamPrivate {
11401 // #GFileIcon specifies an icon by pointing to an image file
11402 // to be used as icon.
11403 struct FileIcon /* : GObject.Object */ {
11404 mixin Icon.__interface__;
11405 mixin LoadableIcon.__interface__;
11406 alias method_parent this;
11407 alias method_parent super_;
11408 alias method_parent object;
11409 GObject2.Object method_parent;
11412 // Creates a new icon for a file.
11414 // @file, or %NULL on error.
11415 // RETURNS: a #GIcon for the given
11416 // <file>: a #GFile.
11417 static FileIcon* /*new*/ new_()(File* file) {
11418 return g_file_icon_new(file);
11421 // Gets the #GFile associated with the given @icon.
11422 // RETURNS: a #GFile, or %NULL.
11423 File* get_file()() {
11424 return g_file_icon_get_file(&this);
11428 struct FileIconClass {
11431 // An interface for writing VFS file handles.
11432 struct FileIface {
11433 GObject2.TypeInterface g_iface;
11434 // RETURNS: a new #GFile that is a duplicate of the given #GFile.
11435 extern (C) File* /*new*/ function (File* file) dup;
11436 // RETURNS: 0 if @file is not a valid #GFile, otherwise an
11437 extern (C) uint function (File* file) hash;
11439 // RETURNS: %TRUE if @file1 and @file2 are equal.
11440 // <file2>: the second #GFile.
11441 extern (C) int function (File* file1, File* file2) equal;
11442 // RETURNS: %TRUE if file is native.
11443 extern (C) int function (File* file) is_native;
11445 // RETURNS: %TRUE if #GFile's backend supports the
11446 // <uri_scheme>: a string containing a URI scheme.
11447 extern (C) int function (File* file, char* uri_scheme) has_uri_scheme;
11448 // RETURNS: a string containing the URI scheme for the given
11449 extern (C) char* /*new*/ function (File* file) get_uri_scheme;
11450 // RETURNS: string containing the #GFile's base name, or %NULL
11451 extern (C) char* /*new*/ function (File* file) get_basename;
11452 // RETURNS: string containing the #GFile's path, or %NULL if
11453 extern (C) char* /*new*/ function (File* file) get_path;
11454 // RETURNS: a string containing the #GFile's URI.
11455 extern (C) char* /*new*/ function (File* file) get_uri;
11456 // RETURNS: a string containing the #GFile's parse name. The returned
11457 extern (C) char* /*new*/ function (File* file) get_parse_name;
11458 // RETURNS: a #GFile structure to the parent of the given
11459 extern (C) File* /*new*/ function (File* file) get_parent;
11461 // RETURNS: %TRUE if the @files's parent, grandparent, etc is @prefix.
11462 // <file>: input #GFile.
11463 extern (C) int function (File* prefix, File* file) prefix_matches;
11465 // RETURNS: string with the relative path from @descendant
11466 // <descendant>: input #GFile.
11467 extern (C) char* /*new*/ function (File* parent, File* descendant) get_relative_path;
11469 // RETURNS: #GFile to the resolved path. %NULL if @relative_path
11470 // <relative_path>: a given relative path string.
11471 extern (C) File* /*new*/ function (File* file, char* relative_path) resolve_relative_path;
11473 // RETURNS: a #GFile to the specified child, or
11474 // <display_name>: string to a possible child.
11475 extern (C) File* /*new*/ function (File* file, char* display_name, GLib2.Error** error=null) get_child_for_display_name;
11477 // RETURNS: A #GFileEnumerator if successful, %NULL on error.
11478 // <attributes>: an attribute query string.
11479 // <flags>: a set of #GFileQueryInfoFlags.
11480 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11481 extern (C) FileEnumerator* /*new*/ function (File* file, char* attributes, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error=null) enumerate_children;
11483 // <attributes>: an attribute query string.
11484 // <flags>: a set of #GFileQueryInfoFlags.
11485 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
11486 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11487 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
11488 // <user_data>: the data to pass to callback function
11489 extern (C) void function (File* file, char* attributes, FileQueryInfoFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) enumerate_children_async;
11491 // RETURNS: a #GFileEnumerator or %NULL if an error occurred.
11492 // <res>: a #GAsyncResult.
11493 extern (C) FileEnumerator* /*new*/ function (File* file, AsyncResult* res, GLib2.Error** error=null) enumerate_children_finish;
11495 // RETURNS: a #GFileInfo for the given @file, or %NULL on error.
11496 // <attributes>: an attribute query string.
11497 // <flags>: a set of #GFileQueryInfoFlags.
11498 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11499 extern (C) FileInfo* /*new*/ function (File* file, char* attributes, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error=null) query_info;
11501 // <attributes>: an attribute query string.
11502 // <flags>: a set of #GFileQueryInfoFlags.
11503 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
11504 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11505 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
11506 // <user_data>: the data to pass to callback function
11507 extern (C) void function (File* file, char* attributes, FileQueryInfoFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) query_info_async;
11509 // RETURNS: #GFileInfo for given @file or %NULL on error.
11510 // <res>: a #GAsyncResult.
11511 extern (C) FileInfo* /*new*/ function (File* file, AsyncResult* res, GLib2.Error** error=null) query_info_finish;
11513 // RETURNS: a #GFileInfo or %NULL if there was an error.
11514 // <attributes>: an attribute query string.
11515 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11516 extern (C) FileInfo* /*new*/ function (File* file, char* attributes, Cancellable* cancellable, GLib2.Error** error=null) query_filesystem_info;
11518 // <attributes>: an attribute query string.
11519 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
11520 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11521 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
11522 // <user_data>: the data to pass to callback function
11523 extern (C) void function (File* file, char* attributes, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) query_filesystem_info_async;
11525 // RETURNS: #GFileInfo for given @file or %NULL on error.
11526 // <res>: a #GAsyncResult.
11527 extern (C) FileInfo* /*new*/ function (File* file, AsyncResult* res, GLib2.Error** error=null) query_filesystem_info_finish;
11529 // RETURNS: a #GMount where the @file is located or %NULL on error.
11530 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11531 extern (C) Mount* /*new*/ function (File* file, Cancellable* cancellable, GLib2.Error** error=null) find_enclosing_mount;
11533 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
11534 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11535 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
11536 // <user_data>: the data to pass to callback function
11537 extern (C) void function (File* file, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) find_enclosing_mount_async;
11539 // RETURNS: #GMount for given @file or %NULL on error.
11540 // <res>: a #GAsyncResult
11541 extern (C) Mount* /*new*/ function (File* file, AsyncResult* res, GLib2.Error** error=null) find_enclosing_mount_finish;
11543 // RETURNS: a #GFile specifying what @file was renamed to, or %NULL
11544 // <display_name>: a string.
11545 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11546 extern (C) File* /*new*/ function (File* file, char* display_name, Cancellable* cancellable, GLib2.Error** error=null) set_display_name;
11548 // <display_name>: a string.
11549 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
11550 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11551 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
11552 // <user_data>: the data to pass to callback function
11553 extern (C) void function (File* file, char* display_name, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) set_display_name_async;
11555 // RETURNS: a #GFile or %NULL on error.
11556 // <res>: a #GAsyncResult.
11557 extern (C) File* /*new*/ function (File* file, AsyncResult* res, GLib2.Error** error=null) set_display_name_finish;
11559 // RETURNS: a #GFileAttributeInfoList describing the settable attributes.
11560 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11561 extern (C) FileAttributeInfoList* /*new*/ function (File* file, Cancellable* cancellable, GLib2.Error** error=null) query_settable_attributes;
11562 extern (C) void function () _query_settable_attributes_async;
11563 extern (C) void function () _query_settable_attributes_finish;
11565 // RETURNS: a #GFileAttributeInfoList describing the writable namespaces.
11566 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11567 extern (C) FileAttributeInfoList* /*new*/ function (File* file, Cancellable* cancellable, GLib2.Error** error=null) query_writable_namespaces;
11568 extern (C) void function () _query_writable_namespaces_async;
11569 extern (C) void function () _query_writable_namespaces_finish;
11571 // RETURNS: %TRUE if the attribute was set, %FALSE otherwise.
11572 // <attribute>: a string containing the attribute's name.
11573 // <type>: The type of the attribute
11574 // <value_p>: a pointer to the value (or the pointer itself if the type is a pointer type)
11575 // <flags>: a set of #GFileQueryInfoFlags.
11576 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11577 extern (C) int function (File* file, char* attribute, FileAttributeType type, void* value_p, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error=null) set_attribute;
11579 // RETURNS: %TRUE if there was any error, %FALSE otherwise.
11580 // <info>: a #GFileInfo.
11581 // <flags>: #GFileQueryInfoFlags
11582 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11583 extern (C) int function (File* file, FileInfo* info, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error=null) set_attributes_from_info;
11585 // <info>: a #GFileInfo.
11586 // <flags>: a #GFileQueryInfoFlags.
11587 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
11588 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11589 // <callback>: a #GAsyncReadyCallback.
11590 // <user_data>: a #gpointer.
11591 extern (C) void function (File* file, FileInfo* info, FileQueryInfoFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) set_attributes_async;
11593 // RETURNS: %TRUE if the attributes were set correctly, %FALSE otherwise.
11594 // <result>: a #GAsyncResult.
11595 // <info>: a #GFileInfo.
11596 extern (C) int function (File* file, AsyncResult* result, /*out*/ FileInfo** info, GLib2.Error** error=null) set_attributes_finish;
11598 // RETURNS: #GFileInputStream or %NULL on error.
11599 // <cancellable>: a #GCancellable
11600 extern (C) FileInputStream* /*new*/ function (File* file, Cancellable* cancellable, GLib2.Error** error=null) read_fn;
11602 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
11603 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11604 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
11605 // <user_data>: the data to pass to callback function
11606 extern (C) void function (File* file, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) read_async;
11608 // RETURNS: a #GFileInputStream or %NULL on error.
11609 // <res>: a #GAsyncResult.
11610 extern (C) FileInputStream* /*new*/ function (File* file, AsyncResult* res, GLib2.Error** error=null) read_finish;
11612 // RETURNS: a #GFileOutputStream, or %NULL on error.
11613 // <flags>: a set of #GFileCreateFlags.
11614 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11615 extern (C) FileOutputStream* /*new*/ function (File* file, FileCreateFlags flags, Cancellable* cancellable, GLib2.Error** error=null) append_to;
11617 // <flags>: a set of #GFileCreateFlags.
11618 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
11619 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11620 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
11621 // <user_data>: the data to pass to callback function
11622 extern (C) void function (File* file, FileCreateFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) append_to_async;
11624 // RETURNS: a valid #GFileOutputStream or %NULL on error.
11625 // <res>: #GAsyncResult
11626 extern (C) FileOutputStream* /*new*/ function (File* file, AsyncResult* res, GLib2.Error** error=null) append_to_finish;
11628 // RETURNS: a #GFileOutputStream for the newly created file, or
11629 // <flags>: a set of #GFileCreateFlags.
11630 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11631 extern (C) FileOutputStream* /*new*/ function (File* file, FileCreateFlags flags, Cancellable* cancellable, GLib2.Error** error=null) create;
11633 // <flags>: a set of #GFileCreateFlags.
11634 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
11635 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11636 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
11637 // <user_data>: the data to pass to callback function
11638 extern (C) void function (File* file, FileCreateFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) create_async;
11640 // RETURNS: a #GFileOutputStream or %NULL on error.
11641 // <res>: a #GAsyncResult.
11642 extern (C) FileOutputStream* /*new*/ function (File* file, AsyncResult* res, GLib2.Error** error=null) create_finish;
11644 // RETURNS: a #GFileOutputStream or %NULL on error.
11645 // <etag>: an optional <link linkend="gfile-etag">entity tag</link> for the current #GFile, or #NULL to ignore.
11646 // <make_backup>: %TRUE if a backup should be created.
11647 // <flags>: a set of #GFileCreateFlags.
11648 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11649 extern (C) FileOutputStream* /*new*/ function (File* file, char* etag, int make_backup, FileCreateFlags flags, Cancellable* cancellable, GLib2.Error** error=null) replace;
11651 // <etag>: an <link linkend="gfile-etag">entity tag</link> for the current #GFile, or NULL to ignore.
11652 // <make_backup>: %TRUE if a backup should be created.
11653 // <flags>: a set of #GFileCreateFlags.
11654 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
11655 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11656 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
11657 // <user_data>: the data to pass to callback function
11658 extern (C) void function (File* file, char* etag, int make_backup, FileCreateFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) replace_async;
11660 // RETURNS: a #GFileOutputStream, or %NULL on error.
11661 // <res>: a #GAsyncResult.
11662 extern (C) FileOutputStream* /*new*/ function (File* file, AsyncResult* res, GLib2.Error** error=null) replace_finish;
11664 // RETURNS: %TRUE if the file was deleted. %FALSE otherwise.
11665 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11666 extern (C) int function (File* file, Cancellable* cancellable, GLib2.Error** error=null) delete_file;
11667 extern (C) void function () _delete_file_async;
11668 extern (C) void function () _delete_file_finish;
11670 // RETURNS: %TRUE on successful trash, %FALSE otherwise.
11671 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11672 extern (C) int function (File* file, Cancellable* cancellable, GLib2.Error** error=null) trash;
11673 extern (C) void function () _trash_async;
11674 extern (C) void function () _trash_finish;
11676 // RETURNS: %TRUE on successful creation, %FALSE otherwise.
11677 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11678 extern (C) int function (File* file, Cancellable* cancellable, GLib2.Error** error=null) make_directory;
11679 extern (C) void function () _make_directory_async;
11680 extern (C) void function () _make_directory_finish;
11682 // RETURNS: %TRUE on the creation of a new symlink, %FALSE otherwise.
11683 // <symlink_value>: a string with the path for the target of the new symlink
11684 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11685 extern (C) int function (File* file, char* symlink_value, Cancellable* cancellable, GLib2.Error** error=null) make_symbolic_link;
11686 extern (C) void function () _make_symbolic_link_async;
11687 extern (C) void function () _make_symbolic_link_finish;
11689 // RETURNS: %TRUE on success, %FALSE otherwise.
11690 // <destination>: destination #GFile
11691 // <flags>: set of #GFileCopyFlags
11692 // <cancellable>: optional #GCancellable object, %NULL to ignore
11693 // <progress_callback>: function to callback with progress information, or %NULL if progress information is not needed
11694 // <progress_callback_data>: user data to pass to @progress_callback
11695 extern (C) int function (File* source, File* destination, FileCopyFlags flags, Cancellable* cancellable, FileProgressCallback progress_callback, void* progress_callback_data, GLib2.Error** error=null) copy;
11697 // Unintrospectable functionp: copy_async() / ()
11699 // <destination>: destination #GFile
11700 // <flags>: set of #GFileCopyFlags
11701 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request
11702 // <cancellable>: optional #GCancellable object, %NULL to ignore
11703 // <progress_callback>: function to callback with progress information, or %NULL if progress information is not needed
11704 // <progress_callback_data>: user data to pass to @progress_callback
11705 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
11706 // <user_data>: the data to pass to callback function
11707 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) copy_async;
11709 // RETURNS: a %TRUE on success, %FALSE on error.
11710 // <res>: a #GAsyncResult.
11711 extern (C) int function (File* file, AsyncResult* res, GLib2.Error** error=null) copy_finish;
11713 // RETURNS: %TRUE on successful move, %FALSE otherwise.
11714 // <destination>: #GFile pointing to the destination location.
11715 // <flags>: set of #GFileCopyFlags.
11716 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11717 // <progress_callback>: #GFileProgressCallback function for updates.
11718 // <progress_callback_data>: gpointer to user data for the callback function.
11719 extern (C) int function (File* source, File* destination, FileCopyFlags flags, Cancellable* cancellable, FileProgressCallback progress_callback, void* progress_callback_data, GLib2.Error** error=null) move;
11720 extern (C) void function () _move_async;
11721 extern (C) void function () _move_finish;
11723 // <flags>: flags affecting the operation
11724 // <mount_operation>: a #GMountOperation, or %NULL to avoid user interaction.
11725 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11726 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
11727 // <user_data>: the data to pass to callback function
11728 extern (C) void function (File* file, MountMountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) mount_mountable;
11730 // RETURNS: a #GFile or %NULL on error.
11731 // <result>: a #GAsyncResult.
11732 extern (C) File* /*new*/ function (File* file, AsyncResult* result, GLib2.Error** error=null) mount_mountable_finish;
11734 // <flags>: flags affecting the operation
11735 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11736 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
11737 // <user_data>: the data to pass to callback function
11738 extern (C) void function (File* file, MountUnmountFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) unmount_mountable;
11740 // RETURNS: %TRUE if the operation finished successfully. %FALSE
11741 // <result>: a #GAsyncResult.
11742 extern (C) int function (File* file, AsyncResult* result, GLib2.Error** error=null) unmount_mountable_finish;
11744 // <flags>: flags affecting the operation
11745 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11746 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
11747 // <user_data>: the data to pass to callback function
11748 extern (C) void function (File* file, MountUnmountFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) eject_mountable;
11750 // RETURNS: %TRUE if the @file was ejected successfully. %FALSE
11751 // <result>: a #GAsyncResult.
11752 extern (C) int function (File* file, AsyncResult* result, GLib2.Error** error=null) eject_mountable_finish;
11754 // <flags>: flags affecting the operation
11755 // <mount_operation>: a #GMountOperation or %NULL to avoid user interaction.
11756 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11757 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
11758 // <user_data>: the data to pass to callback function
11759 extern (C) void function (File* location, MountMountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) mount_enclosing_volume;
11761 // RETURNS: %TRUE if successful. If an error
11762 // <result>: a #GAsyncResult.
11763 extern (C) int function (File* location, AsyncResult* result, GLib2.Error** error=null) mount_enclosing_volume_finish;
11765 // RETURNS: a #GFileMonitor for the given @file, or %NULL on error.
11766 // <flags>: a set of #GFileMonitorFlags.
11767 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11768 extern (C) FileMonitor* /*new*/ function (File* file, FileMonitorFlags flags, Cancellable* cancellable, GLib2.Error** error=null) monitor_dir;
11770 // RETURNS: a #GFileMonitor for the given @file, or %NULL on error.
11771 // <flags>: a set of #GFileMonitorFlags.
11772 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11773 extern (C) FileMonitor* /*new*/ function (File* file, FileMonitorFlags flags, Cancellable* cancellable, GLib2.Error** error=null) monitor_file;
11775 // RETURNS: #GFileIOStream or %NULL on error.
11776 // <cancellable>: a #GCancellable
11777 extern (C) FileIOStream* /*new*/ function (File* file, Cancellable* cancellable, GLib2.Error** error=null) open_readwrite;
11779 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
11780 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11781 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
11782 // <user_data>: the data to pass to callback function
11783 extern (C) void function (File* file, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) open_readwrite_async;
11785 // RETURNS: a #GFileIOStream or %NULL on error.
11786 // <res>: a #GAsyncResult.
11787 extern (C) FileIOStream* /*new*/ function (File* file, AsyncResult* res, GLib2.Error** error=null) open_readwrite_finish;
11789 // RETURNS: a #GFileIOStream for the newly created file, or %NULL on error.
11790 // <flags>: a set of #GFileCreateFlags
11791 // <cancellable>: optional #GCancellable object, %NULL to ignore
11792 extern (C) FileIOStream* /*new*/ function (File* file, FileCreateFlags flags, Cancellable* cancellable, GLib2.Error** error=null) create_readwrite;
11794 // <flags>: a set of #GFileCreateFlags
11795 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request
11796 // <cancellable>: optional #GCancellable object, %NULL to ignore
11797 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
11798 // <user_data>: the data to pass to callback function
11799 extern (C) void function (File* file, FileCreateFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) create_readwrite_async;
11801 // RETURNS: a #GFileIOStream or %NULL on error.
11802 // <res>: a #GAsyncResult
11803 extern (C) FileIOStream* /*new*/ function (File* file, AsyncResult* res, GLib2.Error** error=null) create_readwrite_finish;
11805 // RETURNS: a #GFileIOStream or %NULL on error.
11806 // <etag>: an optional <link linkend="gfile-etag">entity tag</link> for the current #GFile, or #NULL to ignore
11807 // <make_backup>: %TRUE if a backup should be created
11808 // <flags>: a set of #GFileCreateFlags
11809 // <cancellable>: optional #GCancellable object, %NULL to ignore
11810 extern (C) FileIOStream* /*new*/ function (File* file, char* etag, int make_backup, FileCreateFlags flags, Cancellable* cancellable, GLib2.Error** error=null) replace_readwrite;
11812 // <etag>: an <link linkend="gfile-etag">entity tag</link> for the current #GFile, or NULL to ignore.
11813 // <make_backup>: %TRUE if a backup should be created.
11814 // <flags>: a set of #GFileCreateFlags.
11815 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
11816 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11817 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
11818 // <user_data>: the data to pass to callback function
11819 extern (C) void function (File* file, char* etag, int make_backup, FileCreateFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) replace_readwrite_async;
11821 // RETURNS: a #GFileIOStream, or %NULL on error.
11822 // <res>: a #GAsyncResult.
11823 extern (C) FileIOStream* /*new*/ function (File* file, AsyncResult* res, GLib2.Error** error=null) replace_readwrite_finish;
11825 // <flags>: flags affecting the operation
11826 // <start_operation>: a #GMountOperation, or %NULL to avoid user interaction.
11827 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11828 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
11829 // <user_data>: the data to pass to callback function
11830 extern (C) void function (File* file, DriveStartFlags flags, MountOperation* start_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) start_mountable;
11832 // RETURNS: %TRUE if the operation finished successfully. %FALSE
11833 // <result>: a #GAsyncResult.
11834 extern (C) int function (File* file, AsyncResult* result, GLib2.Error** error=null) start_mountable_finish;
11836 // <flags>: flags affecting the operation
11837 // <mount_operation>: a #GMountOperation, or %NULL to avoid user interaction.
11838 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11839 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
11840 // <user_data>: the data to pass to callback function
11841 extern (C) void function (File* file, MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) stop_mountable;
11843 // RETURNS: %TRUE if the operation finished successfully. %FALSE
11844 // <result>: a #GAsyncResult.
11845 extern (C) int function (File* file, AsyncResult* result, GLib2.Error** error=null) stop_mountable_finish;
11846 int supports_thread_contexts;
11848 // <flags>: flags affecting the operation
11849 // <mount_operation>: a #GMountOperation, or %NULL to avoid user interaction.
11850 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11851 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
11852 // <user_data>: the data to pass to callback function
11853 extern (C) void function (File* file, MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) unmount_mountable_with_operation;
11855 // RETURNS: %TRUE if the operation finished successfully. %FALSE
11856 // <result>: a #GAsyncResult.
11857 extern (C) int function (File* file, AsyncResult* result, GLib2.Error** error=null) unmount_mountable_with_operation_finish;
11859 // <flags>: flags affecting the operation
11860 // <mount_operation>: a #GMountOperation, or %NULL to avoid user interaction.
11861 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11862 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
11863 // <user_data>: the data to pass to callback function
11864 extern (C) void function (File* file, MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) eject_mountable_with_operation;
11866 // RETURNS: %TRUE if the @file was ejected successfully. %FALSE
11867 // <result>: a #GAsyncResult.
11868 extern (C) int function (File* file, AsyncResult* result, GLib2.Error** error=null) eject_mountable_with_operation_finish;
11870 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11871 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
11872 // <user_data>: the data to pass to callback function
11873 extern (C) void function (File* file, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) poll_mountable;
11875 // RETURNS: %TRUE if the operation finished successfully. %FALSE
11876 // <result>: a #GAsyncResult.
11877 extern (C) int function (File* file, AsyncResult* result, GLib2.Error** error=null) poll_mountable_finish;
11881 // Functionality for manipulating basic metadata for files. #GFileInfo
11882 // implements methods for getting information that all files should
11883 // contain, and allows for manipulation of extended attributes.
11885 // See <link linkend="gio-GFileAttribute">GFileAttribute</link> for more
11886 // information on how GIO handles file attributes.
11888 // To obtain a #GFileInfo for a #GFile, use g_file_query_info() (or its
11889 // async variant). To obtain a #GFileInfo for a file input or output
11890 // stream, use g_file_input_stream_query_info() or
11891 // g_file_output_stream_query_info() (or their async variants).
11893 // To change the actual attributes of a file, you should then set the
11894 // attribute in the #GFileInfo and call g_file_set_attributes_from_info()
11895 // or g_file_set_attributes_async() on a GFile.
11897 // However, not all attributes can be changed in the file. For instance,
11898 // the actual size of a file cannot be changed via g_file_info_set_size().
11899 // You may call g_file_query_settable_attributes() and
11900 // g_file_query_writable_namespaces() to discover the settable attributes
11901 // of a particular file at runtime.
11903 // #GFileAttributeMatcher allows for searching through a #GFileInfo for
11904 // attributes.
11905 struct FileInfo /* : GObject.Object */ {
11906 alias method_parent this;
11907 alias method_parent super_;
11908 alias method_parent object;
11909 GObject2.Object method_parent;
11912 // Creates a new file info structure.
11913 // RETURNS: a #GFileInfo.
11914 static FileInfo* /*new*/ new_()() {
11915 return g_file_info_new();
11917 // Clears the status information from @info.
11918 void clear_status()() {
11919 g_file_info_clear_status(&this);
11922 // Copies all of the #GFileAttribute<!-- -->s from @src_info to @dest_info.
11923 // <dest_info>: destination to copy attributes to.
11924 void copy_into()(FileInfo* dest_info) {
11925 g_file_info_copy_into(&this, dest_info);
11928 // Duplicates a file info structure.
11929 // RETURNS: a duplicate #GFileInfo of @other.
11930 FileInfo* /*new*/ dup()() {
11931 return g_file_info_dup(&this);
11934 // Gets the value of a attribute, formated as a string.
11935 // This escapes things as needed to make the string valid
11936 // utf8.
11938 // When you're done with the string it must be freed with g_free().
11939 // RETURNS: a UTF-8 string associated with the given @attribute.
11940 // <attribute>: a file attribute key.
11941 char* /*new*/ get_attribute_as_string()(char* attribute) {
11942 return g_file_info_get_attribute_as_string(&this, attribute);
11945 // Gets the value of a boolean attribute. If the attribute does not
11946 // contain a boolean value, %FALSE will be returned.
11947 // RETURNS: the boolean value contained within the attribute.
11948 // <attribute>: a file attribute key.
11949 int get_attribute_boolean()(char* attribute) {
11950 return g_file_info_get_attribute_boolean(&this, attribute);
11953 // Gets the value of a byte string attribute. If the attribute does
11954 // not contain a byte string, %NULL will be returned.
11956 // %NULL otherwise.
11957 // RETURNS: the contents of the @attribute value as a byte string, or
11958 // <attribute>: a file attribute key.
11959 char* get_attribute_byte_string()(char* attribute) {
11960 return g_file_info_get_attribute_byte_string(&this, attribute);
11963 // Gets the attribute type, value and status for an attribute key.
11965 // %FALSE otherwise.
11966 // RETURNS: %TRUE if @info has an attribute named @attribute,
11967 // <attribute>: a file attribute key
11968 // <type>: return location for the attribute type, or %NULL
11969 // <value_pp>: return location for the attribute value, or %NULL
11970 // <status>: return location for the attribute status, or %NULL
11971 int get_attribute_data()(char* attribute, /*out*/ FileAttributeType* type=null, /*out*/ void** value_pp=null, /*out*/ FileAttributeStatus* status=null) {
11972 return g_file_info_get_attribute_data(&this, attribute, type, value_pp, status);
11975 // Gets a signed 32-bit integer contained within the attribute. If the
11976 // attribute does not contain a signed 32-bit integer, or is invalid,
11977 // 0 will be returned.
11978 // RETURNS: a signed 32-bit integer from the attribute.
11979 // <attribute>: a file attribute key.
11980 int get_attribute_int32()(char* attribute) {
11981 return g_file_info_get_attribute_int32(&this, attribute);
11984 // Gets a signed 64-bit integer contained within the attribute. If the
11985 // attribute does not contain an signed 64-bit integer, or is invalid,
11986 // 0 will be returned.
11987 // RETURNS: a signed 64-bit integer from the attribute.
11988 // <attribute>: a file attribute key.
11989 long get_attribute_int64()(char* attribute) {
11990 return g_file_info_get_attribute_int64(&this, attribute);
11993 // Gets the value of a #GObject attribute. If the attribute does
11994 // not contain a #GObject, %NULL will be returned.
11996 // %NULL otherwise.
11997 // RETURNS: a #GObject associated with the given @attribute, or
11998 // <attribute>: a file attribute key.
11999 GObject2.Object* get_attribute_object()(char* attribute) {
12000 return g_file_info_get_attribute_object(&this, attribute);
12003 // Gets the attribute status for an attribute key.
12005 // %G_FILE_ATTRIBUTE_STATUS_UNSET if the key is invalid.
12006 // RETURNS: a #GFileAttributeStatus for the given @attribute, or
12007 // <attribute>: a file attribute key
12008 FileAttributeStatus get_attribute_status()(char* attribute) {
12009 return g_file_info_get_attribute_status(&this, attribute);
12012 // Gets the value of a string attribute. If the attribute does
12013 // not contain a string, %NULL will be returned.
12015 // %NULL otherwise.
12016 // RETURNS: the contents of the @attribute value as a UTF-8 string, or
12017 // <attribute>: a file attribute key.
12018 char* get_attribute_string()(char* attribute) {
12019 return g_file_info_get_attribute_string(&this, attribute);
12022 // VERSION: 2.22
12023 // Gets the value of a stringv attribute. If the attribute does
12024 // not contain a stringv, %NULL will be returned.
12026 // %NULL otherwise. Do not free. These returned strings are UTF-8.
12027 // RETURNS: the contents of the @attribute value as a stringv, or
12028 // <attribute>: a file attribute key.
12029 char** get_attribute_stringv()(char* attribute) {
12030 return g_file_info_get_attribute_stringv(&this, attribute);
12033 // Gets the attribute type for an attribute key.
12035 // %G_FILE_ATTRIBUTE_TYPE_INVALID if the key is not set.
12036 // RETURNS: a #GFileAttributeType for the given @attribute, or
12037 // <attribute>: a file attribute key.
12038 FileAttributeType get_attribute_type()(char* attribute) {
12039 return g_file_info_get_attribute_type(&this, attribute);
12042 // Gets an unsigned 32-bit integer contained within the attribute. If the
12043 // attribute does not contain an unsigned 32-bit integer, or is invalid,
12044 // 0 will be returned.
12045 // RETURNS: an unsigned 32-bit integer from the attribute.
12046 // <attribute>: a file attribute key.
12047 uint get_attribute_uint32()(char* attribute) {
12048 return g_file_info_get_attribute_uint32(&this, attribute);
12051 // Gets a unsigned 64-bit integer contained within the attribute. If the
12052 // attribute does not contain an unsigned 64-bit integer, or is invalid,
12053 // 0 will be returned.
12054 // RETURNS: a unsigned 64-bit integer from the attribute.
12055 // <attribute>: a file attribute key.
12056 ulong get_attribute_uint64()(char* attribute) {
12057 return g_file_info_get_attribute_uint64(&this, attribute);
12060 // Gets the file's content type.
12061 // RETURNS: a string containing the file's content type.
12062 char* get_content_type()() {
12063 return g_file_info_get_content_type(&this);
12066 // Gets a display name for a file.
12067 // RETURNS: a string containing the display name.
12068 char* get_display_name()() {
12069 return g_file_info_get_display_name(&this);
12072 // Gets the edit name for a file.
12073 // RETURNS: a string containing the edit name.
12074 char* get_edit_name()() {
12075 return g_file_info_get_edit_name(&this);
12078 // Gets the <link linkend="gfile-etag">entity tag</link> for a given
12079 // #GFileInfo. See %G_FILE_ATTRIBUTE_ETAG_VALUE.
12080 // RETURNS: a string containing the value of the "etag:value" attribute.
12081 char* get_etag()() {
12082 return g_file_info_get_etag(&this);
12085 // Gets a file's type (whether it is a regular file, symlink, etc).
12086 // This is different from the file's content type, see g_file_info_get_content_type().
12087 // RETURNS: a #GFileType for the given file.
12088 FileType get_file_type()() {
12089 return g_file_info_get_file_type(&this);
12092 // Gets the icon for a file.
12093 // RETURNS: #GIcon for the given @info.
12094 Icon* get_icon()() {
12095 return g_file_info_get_icon(&this);
12098 // Checks if a file is a backup file.
12099 // RETURNS: %TRUE if file is a backup file, %FALSE otherwise.
12100 int get_is_backup()() {
12101 return g_file_info_get_is_backup(&this);
12104 // Checks if a file is hidden.
12105 // RETURNS: %TRUE if the file is a hidden file, %FALSE otherwise.
12106 int get_is_hidden()() {
12107 return g_file_info_get_is_hidden(&this);
12110 // Checks if a file is a symlink.
12111 // RETURNS: %TRUE if the given @info is a symlink.
12112 int get_is_symlink()() {
12113 return g_file_info_get_is_symlink(&this);
12116 // Gets the modification time of the current @info and sets it
12117 // in @result.
12118 // <result>: a #GTimeVal.
12119 void get_modification_time()(/*out*/ GLib2.TimeVal* result) {
12120 g_file_info_get_modification_time(&this, result);
12123 // Gets the name for a file.
12124 // RETURNS: a string containing the file name.
12125 char* get_name()() {
12126 return g_file_info_get_name(&this);
12129 // Gets the file's size.
12130 // RETURNS: a #goffset containing the file's size.
12131 long get_size()() {
12132 return g_file_info_get_size(&this);
12135 // Gets the value of the sort_order attribute from the #GFileInfo.
12136 // See %G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER.
12137 // RETURNS: a #gint32 containing the value of the "standard::sort_order" attribute.
12138 int get_sort_order()() {
12139 return g_file_info_get_sort_order(&this);
12142 // Gets the symlink target for a given #GFileInfo.
12143 // RETURNS: a string containing the symlink target.
12144 char* get_symlink_target()() {
12145 return g_file_info_get_symlink_target(&this);
12148 // Checks if a file info structure has an attribute named @attribute.
12150 // %FALSE otherwise.
12151 // RETURNS: %TRUE if @Ginfo has an attribute named @attribute,
12152 // <attribute>: a file attribute key.
12153 int has_attribute()(char* attribute) {
12154 return g_file_info_has_attribute(&this, attribute);
12157 // VERSION: 2.22
12158 // Checks if a file info structure has an attribute in the
12159 // specified @name_space.
12161 // %FALSE otherwise.
12162 // RETURNS: %TRUE if @Ginfo has an attribute in @name_space,
12163 // <name_space>: a file attribute namespace.
12164 int has_namespace()(char* name_space) {
12165 return g_file_info_has_namespace(&this, name_space);
12168 // Lists the file info structure's attributes.
12170 // possible attribute types for the given @name_space, or
12171 // %NULL on error.
12172 // RETURNS: a null-terminated array of strings of all of the
12173 // <name_space>: a file attribute key's namespace.
12174 char** /*new*/ list_attributes()(char* name_space) {
12175 return g_file_info_list_attributes(&this, name_space);
12178 // Removes all cases of @attribute from @info if it exists.
12179 // <attribute>: a file attribute key.
12180 void remove_attribute()(char* attribute) {
12181 g_file_info_remove_attribute(&this, attribute);
12184 // Sets the @attribute to contain the given value, if possible.
12185 // <attribute>: a file attribute key.
12186 // <type>: a #GFileAttributeType
12187 // <value_p>: pointer to the value
12188 void set_attribute()(char* attribute, FileAttributeType type, void* value_p) {
12189 g_file_info_set_attribute(&this, attribute, type, value_p);
12192 // Sets the @attribute to contain the given @attr_value,
12193 // if possible.
12194 // <attribute>: a file attribute key.
12195 // <attr_value>: a boolean value.
12196 void set_attribute_boolean()(char* attribute, int attr_value) {
12197 g_file_info_set_attribute_boolean(&this, attribute, attr_value);
12200 // Sets the @attribute to contain the given @attr_value,
12201 // if possible.
12202 // <attribute>: a file attribute key.
12203 // <attr_value>: a byte string.
12204 void set_attribute_byte_string()(char* attribute, char* attr_value) {
12205 g_file_info_set_attribute_byte_string(&this, attribute, attr_value);
12208 // Sets the @attribute to contain the given @attr_value,
12209 // if possible.
12210 // <attribute>: a file attribute key.
12211 // <attr_value>: a signed 32-bit integer
12212 void set_attribute_int32()(char* attribute, int attr_value) {
12213 g_file_info_set_attribute_int32(&this, attribute, attr_value);
12216 // Sets the @attribute to contain the given @attr_value,
12217 // if possible.
12218 // <attribute>: attribute name to set.
12219 // <attr_value>: int64 value to set attribute to.
12220 void set_attribute_int64()(char* attribute, long attr_value) {
12221 g_file_info_set_attribute_int64(&this, attribute, attr_value);
12224 // Sets @mask on @info to match specific attribute types.
12225 // <mask>: a #GFileAttributeMatcher.
12226 void set_attribute_mask()(FileAttributeMatcher* mask) {
12227 g_file_info_set_attribute_mask(&this, mask);
12230 // Sets the @attribute to contain the given @attr_value,
12231 // if possible.
12232 // <attribute>: a file attribute key.
12233 // <attr_value>: a #GObject.
12234 void set_attribute_object()(char* attribute, GObject2.Object* attr_value) {
12235 g_file_info_set_attribute_object(&this, attribute, attr_value);
12238 // VERSION: 2.22
12239 // Sets the attribute status for an attribute key. This is only
12240 // needed by external code that implement g_file_set_attributes_from_info()
12241 // or similar functions.
12243 // The attribute must exist in @info for this to work. Otherwise %FALSE
12244 // is returned and @info is unchanged.
12245 // RETURNS: %TRUE if the status was changed, %FALSE if the key was not set.
12246 // <attribute>: a file attribute key
12247 // <status>: a #GFileAttributeStatus
12248 int set_attribute_status()(char* attribute, FileAttributeStatus status) {
12249 return g_file_info_set_attribute_status(&this, attribute, status);
12252 // Sets the @attribute to contain the given @attr_value,
12253 // if possible.
12254 // <attribute>: a file attribute key.
12255 // <attr_value>: a UTF-8 string.
12256 void set_attribute_string()(char* attribute, char* attr_value) {
12257 g_file_info_set_attribute_string(&this, attribute, attr_value);
12260 // Sets the @attribute to contain the given @attr_value,
12261 // if possible.
12263 // Sinze: 2.22
12264 // <attribute>: a file attribute key
12265 // <attr_value>: a %NULL terminated array of UTF-8 strings.
12266 void set_attribute_stringv()(char* attribute, char** attr_value) {
12267 g_file_info_set_attribute_stringv(&this, attribute, attr_value);
12270 // Sets the @attribute to contain the given @attr_value,
12271 // if possible.
12272 // <attribute>: a file attribute key.
12273 // <attr_value>: an unsigned 32-bit integer.
12274 void set_attribute_uint32()(char* attribute, uint attr_value) {
12275 g_file_info_set_attribute_uint32(&this, attribute, attr_value);
12278 // Sets the @attribute to contain the given @attr_value,
12279 // if possible.
12280 // <attribute>: a file attribute key.
12281 // <attr_value>: an unsigned 64-bit integer.
12282 void set_attribute_uint64()(char* attribute, ulong attr_value) {
12283 g_file_info_set_attribute_uint64(&this, attribute, attr_value);
12286 // Sets the content type attribute for a given #GFileInfo.
12287 // See %G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE.
12288 // <content_type>: a content type. See <link linkend="gio-GContentType">GContentType</link>.
12289 void set_content_type()(char* content_type) {
12290 g_file_info_set_content_type(&this, content_type);
12293 // Sets the display name for the current #GFileInfo.
12294 // See %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME.
12295 // <display_name>: a string containing a display name.
12296 void set_display_name()(char* display_name) {
12297 g_file_info_set_display_name(&this, display_name);
12300 // Sets the edit name for the current file.
12301 // See %G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME.
12302 // <edit_name>: a string containing an edit name.
12303 void set_edit_name()(char* edit_name) {
12304 g_file_info_set_edit_name(&this, edit_name);
12307 // Sets the file type in a #GFileInfo to @type.
12308 // See %G_FILE_ATTRIBUTE_STANDARD_TYPE.
12309 // <type>: a #GFileType.
12310 void set_file_type()(FileType type) {
12311 g_file_info_set_file_type(&this, type);
12314 // Sets the icon for a given #GFileInfo.
12315 // See %G_FILE_ATTRIBUTE_STANDARD_ICON.
12316 // <icon>: a #GIcon.
12317 void set_icon()(Icon* icon) {
12318 g_file_info_set_icon(&this, icon);
12321 // Sets the "is_hidden" attribute in a #GFileInfo according to @is_symlink.
12322 // See %G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN.
12323 // <is_hidden>: a #gboolean.
12324 void set_is_hidden()(int is_hidden) {
12325 g_file_info_set_is_hidden(&this, is_hidden);
12328 // Sets the "is_symlink" attribute in a #GFileInfo according to @is_symlink.
12329 // See %G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK.
12330 // <is_symlink>: a #gboolean.
12331 void set_is_symlink()(int is_symlink) {
12332 g_file_info_set_is_symlink(&this, is_symlink);
12335 // Sets the %G_FILE_ATTRIBUTE_TIME_MODIFIED attribute in the file
12336 // info to the given time value.
12337 // <mtime>: a #GTimeVal.
12338 void set_modification_time()(GLib2.TimeVal* mtime) {
12339 g_file_info_set_modification_time(&this, mtime);
12342 // Sets the name attribute for the current #GFileInfo.
12343 // See %G_FILE_ATTRIBUTE_STANDARD_NAME.
12344 // <name>: a string containing a name.
12345 void set_name()(char* name) {
12346 g_file_info_set_name(&this, name);
12349 // Sets the %G_FILE_ATTRIBUTE_STANDARD_SIZE attribute in the file info
12350 // to the given size.
12351 // <size>: a #goffset containing the file's size.
12352 void set_size()(long size) {
12353 g_file_info_set_size(&this, size);
12356 // Sets the sort order attribute in the file info structure. See
12357 // %G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER.
12358 // <sort_order>: a sort order integer.
12359 void set_sort_order()(int sort_order) {
12360 g_file_info_set_sort_order(&this, sort_order);
12363 // Sets the %G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET attribute in the file info
12364 // to the given symlink target.
12365 // <symlink_target>: a static string containing a path to a symlink target.
12366 void set_symlink_target()(char* symlink_target) {
12367 g_file_info_set_symlink_target(&this, symlink_target);
12370 // Unsets a mask set by g_file_info_set_attribute_mask(), if one
12371 // is set.
12372 void unset_attribute_mask()() {
12373 g_file_info_unset_attribute_mask(&this);
12377 struct FileInfoClass {
12381 // GFileInputStream provides input streams that take their
12382 // content from a file.
12384 // GFileInputStream implements #GSeekable, which allows the input
12385 // stream to jump to arbitrary positions in the file, provided the
12386 // filesystem of the file allows it. To find the position of a file
12387 // input stream, use g_seekable_tell(). To find out if a file input
12388 // stream supports seeking, use g_seekable_stream_can_seek().
12389 // To position a file input stream, use g_seekable_seek().
12390 struct FileInputStream /* : InputStream */ {
12391 mixin Seekable.__interface__;
12392 alias parent_instance this;
12393 alias parent_instance super_;
12394 alias parent_instance inputstream;
12395 InputStream parent_instance;
12396 private FileInputStreamPrivate* priv;
12399 // Queries a file input stream the given @attributes. This function blocks
12400 // while querying the stream. For the asynchronous (non-blocking) version
12401 // of this function, see g_file_input_stream_query_info_async(). While the
12402 // stream is blocked, the stream will set the pending flag internally, and
12403 // any other operations on the stream will fail with %G_IO_ERROR_PENDING.
12404 // RETURNS: a #GFileInfo, or %NULL on error.
12405 // <attributes>: a file attribute query string.
12406 // <cancellable>: optional #GCancellable object, %NULL to ignore.
12407 FileInfo* /*new*/ query_info()(char* attributes, Cancellable* cancellable, GLib2.Error** error=null) {
12408 return g_file_input_stream_query_info(&this, attributes, cancellable, error);
12411 // Queries the stream information asynchronously.
12412 // When the operation is finished @callback will be called.
12413 // You can then call g_file_input_stream_query_info_finish()
12414 // to get the result of the operation.
12416 // For the synchronous version of this function,
12417 // see g_file_input_stream_query_info().
12419 // If @cancellable is not %NULL, then the operation can be cancelled by
12420 // triggering the cancellable object from another thread. If the operation
12421 // was cancelled, the error %G_IO_ERROR_CANCELLED will be set
12422 // <attributes>: a file attribute query string.
12423 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
12424 // <cancellable>: optional #GCancellable object, %NULL to ignore.
12425 // <callback>: callback to call when the request is satisfied
12426 // <user_data>: the data to pass to callback function
12427 void query_info_async()(char* attributes, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
12428 g_file_input_stream_query_info_async(&this, attributes, io_priority, cancellable, callback, user_data);
12431 // Finishes an asynchronous info query operation.
12432 // RETURNS: #GFileInfo.
12433 // <result>: a #GAsyncResult.
12434 FileInfo* /*new*/ query_info_finish()(AsyncResult* result, GLib2.Error** error=null) {
12435 return g_file_input_stream_query_info_finish(&this, result, error);
12439 struct FileInputStreamClass {
12440 InputStreamClass parent_class;
12441 extern (C) long function (FileInputStream* stream) tell;
12442 extern (C) int function (FileInputStream* stream) can_seek;
12443 extern (C) int function (FileInputStream* stream, long offset, GLib2.SeekType type, Cancellable* cancellable, GLib2.Error** error=null) seek;
12445 // RETURNS: a #GFileInfo, or %NULL on error.
12446 // <attributes>: a file attribute query string.
12447 // <cancellable>: optional #GCancellable object, %NULL to ignore.
12448 extern (C) FileInfo* /*new*/ function (FileInputStream* stream, char* attributes, Cancellable* cancellable, GLib2.Error** error=null) query_info;
12450 // <attributes>: a file attribute query string.
12451 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
12452 // <cancellable>: optional #GCancellable object, %NULL to ignore.
12453 // <callback>: callback to call when the request is satisfied
12454 // <user_data>: the data to pass to callback function
12455 extern (C) void function (FileInputStream* stream, char* attributes, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) query_info_async;
12457 // RETURNS: #GFileInfo.
12458 // <result>: a #GAsyncResult.
12459 extern (C) FileInfo* /*new*/ function (FileInputStream* stream, AsyncResult* result, GLib2.Error** error=null) query_info_finish;
12460 extern (C) void function () _g_reserved1;
12461 extern (C) void function () _g_reserved2;
12462 extern (C) void function () _g_reserved3;
12463 extern (C) void function () _g_reserved4;
12464 extern (C) void function () _g_reserved5;
12467 struct FileInputStreamPrivate {
12471 // Monitors a file or directory for changes.
12473 // To obtain a #GFileMonitor for a file or directory, use
12474 // g_file_monitor(), g_file_monitor_file(), or
12475 // g_file_monitor_directory().
12477 // To get informed about changes to the file or directory you are
12478 // monitoring, connect to the #GFileMonitor::changed signal. The
12479 // signal will be emitted in the <link
12480 // linkend="g-main-context-push-thread-default">thread-default main
12481 // context</link> of the thread that the monitor was created in
12482 // (though if the global default main context is blocked, this may
12483 // cause notifications to be blocked even if the thread-default
12484 // context is still running).
12485 struct FileMonitor /* : GObject.Object */ {
12486 alias parent_instance this;
12487 alias parent_instance super_;
12488 alias parent_instance object;
12489 GObject2.Object parent_instance;
12490 private FileMonitorPrivate* priv;
12493 // Cancels a file monitor.
12494 // RETURNS: %TRUE if monitor was cancelled.
12495 int cancel()() {
12496 return g_file_monitor_cancel(&this);
12499 // Emits the #GFileMonitor::changed signal if a change
12500 // has taken place. Should be called from file monitor
12501 // implementations only.
12503 // The signal will be emitted from an idle handler (in the <link
12504 // linkend="g-main-context-push-thread-default">thread-default main
12505 // context</link>).
12506 // <child>: a #GFile.
12507 // <other_file>: a #GFile.
12508 // <event_type>: a set of #GFileMonitorEvent flags.
12509 void emit_event()(File* child, File* other_file, FileMonitorEvent event_type) {
12510 g_file_monitor_emit_event(&this, child, other_file, event_type);
12513 // Returns whether the monitor is canceled.
12514 // RETURNS: %TRUE if monitor is canceled. %FALSE otherwise.
12515 int is_cancelled()() {
12516 return g_file_monitor_is_cancelled(&this);
12519 // Sets the rate limit to which the @monitor will report
12520 // consecutive change events to the same file.
12521 // <limit_msecs>: a non-negative integer with the limit in milliseconds to poll for changes
12522 void set_rate_limit()(int limit_msecs) {
12523 g_file_monitor_set_rate_limit(&this, limit_msecs);
12526 // Emitted when @file has been changed.
12528 // If using #G_FILE_MONITOR_SEND_MOVED flag and @event_type is
12529 // #G_FILE_MONITOR_SEND_MOVED, @file will be set to a #GFile containing the
12530 // old path, and @other_file will be set to a #GFile containing the new path.
12532 // In all the other cases, @other_file will be set to #NULL.
12533 // <file>: a #GFile.
12534 // <other_file>: a #GFile or #NULL.
12535 // <event_type>: a #GFileMonitorEvent.
12536 extern (C) alias static void function (FileMonitor* this_, File* file, File* other_file, FileMonitorEvent* event_type, void* user_data=null) signal_changed;
12538 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
12539 return super_.signal_connect!name(cb, data, cf);
12542 ulong signal_connect(string name:"changed", CB:signal_changed)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
12543 return signal_connect_data!()(&this, cast(char*)"changed",
12544 cast(GObject2.Callback)cb, data, null, cf);
12548 struct FileMonitorClass {
12549 GObject2.ObjectClass parent_class;
12550 extern (C) void function (FileMonitor* monitor, File* file, File* other_file, FileMonitorEvent event_type) changed;
12551 // RETURNS: %TRUE if monitor was cancelled.
12552 extern (C) int function (FileMonitor* monitor) cancel;
12553 extern (C) void function () _g_reserved1;
12554 extern (C) void function () _g_reserved2;
12555 extern (C) void function () _g_reserved3;
12556 extern (C) void function () _g_reserved4;
12557 extern (C) void function () _g_reserved5;
12560 // Specifies what type of event a monitor event is.
12561 enum FileMonitorEvent {
12562 CHANGED = 0,
12563 CHANGES_DONE_HINT = 1,
12564 DELETED = 2,
12565 CREATED = 3,
12566 ATTRIBUTE_CHANGED = 4,
12567 PRE_UNMOUNT = 5,
12568 UNMOUNTED = 6,
12569 MOVED = 7
12571 // Flags used to set what a #GFileMonitor will watch for.
12572 enum FileMonitorFlags {
12573 NONE = 0,
12574 WATCH_MOUNTS = 1,
12575 SEND_MOVED = 2
12577 struct FileMonitorPrivate {
12581 // GFileOutputStream provides output streams that write their
12582 // content to a file.
12584 // GFileOutputStream implements #GSeekable, which allows the output
12585 // stream to jump to arbitrary positions in the file and to truncate
12586 // the file, provided the filesystem of the file supports these
12587 // operations.
12589 // To find the position of a file output stream, use g_seekable_tell().
12590 // To find out if a file output stream supports seeking, use
12591 // g_seekable_can_seek().To position a file output stream, use
12592 // g_seekable_seek(). To find out if a file output stream supports
12593 // truncating, use g_seekable_can_truncate(). To truncate a file output
12594 // stream, use g_seekable_truncate().
12595 struct FileOutputStream /* : OutputStream */ {
12596 mixin Seekable.__interface__;
12597 alias parent_instance this;
12598 alias parent_instance super_;
12599 alias parent_instance outputstream;
12600 OutputStream parent_instance;
12601 private FileOutputStreamPrivate* priv;
12604 // Gets the entity tag for the file when it has been written.
12605 // This must be called after the stream has been written
12606 // and closed, as the etag can change while writing.
12607 // RETURNS: the entity tag for the stream.
12608 char* /*new*/ get_etag()() {
12609 return g_file_output_stream_get_etag(&this);
12612 // Queries a file output stream for the given @attributes.
12613 // This function blocks while querying the stream. For the asynchronous
12614 // version of this function, see g_file_output_stream_query_info_async().
12615 // While the stream is blocked, the stream will set the pending flag
12616 // internally, and any other operations on the stream will fail with
12617 // %G_IO_ERROR_PENDING.
12619 // Can fail if the stream was already closed (with @error being set to
12620 // %G_IO_ERROR_CLOSED), the stream has pending operations (with @error being
12621 // set to %G_IO_ERROR_PENDING), or if querying info is not supported for
12622 // the stream's interface (with @error being set to %G_IO_ERROR_NOT_SUPPORTED). In
12623 // all cases of failure, %NULL will be returned.
12625 // If @cancellable is not %NULL, then the operation can be cancelled by
12626 // triggering the cancellable object from another thread. If the operation
12627 // was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %NULL will
12628 // be returned.
12629 // RETURNS: a #GFileInfo for the @stream, or %NULL on error.
12630 // <attributes>: a file attribute query string.
12631 // <cancellable>: optional #GCancellable object, %NULL to ignore.
12632 FileInfo* /*new*/ query_info()(char* attributes, Cancellable* cancellable, GLib2.Error** error=null) {
12633 return g_file_output_stream_query_info(&this, attributes, cancellable, error);
12636 // Asynchronously queries the @stream for a #GFileInfo. When completed,
12637 // @callback will be called with a #GAsyncResult which can be used to
12638 // finish the operation with g_file_output_stream_query_info_finish().
12640 // For the synchronous version of this function, see
12641 // g_file_output_stream_query_info().
12642 // <attributes>: a file attribute query string.
12643 // <io_priority>: the <link linkend="gio-GIOScheduler">I/O priority</link> of the request.
12644 // <cancellable>: optional #GCancellable object, %NULL to ignore.
12645 // <callback>: callback to call when the request is satisfied
12646 // <user_data>: the data to pass to callback function
12647 void query_info_async()(char* attributes, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
12648 g_file_output_stream_query_info_async(&this, attributes, io_priority, cancellable, callback, user_data);
12651 // Finalizes the asynchronous query started
12652 // by g_file_output_stream_query_info_async().
12653 // RETURNS: A #GFileInfo for the finished query.
12654 // <result>: a #GAsyncResult.
12655 FileInfo* /*new*/ query_info_finish()(AsyncResult* result, GLib2.Error** error=null) {
12656 return g_file_output_stream_query_info_finish(&this, result, error);
12660 struct FileOutputStreamClass {
12661 OutputStreamClass parent_class;
12662 extern (C) long function (FileOutputStream* stream) tell;
12663 extern (C) int function (FileOutputStream* stream) can_seek;
12664 extern (C) int function (FileOutputStream* stream, long offset, GLib2.SeekType type, Cancellable* cancellable, GLib2.Error** error=null) seek;
12665 extern (C) int function (FileOutputStream* stream) can_truncate;
12666 extern (C) int function (FileOutputStream* stream, long size, Cancellable* cancellable, GLib2.Error** error=null) truncate_fn;
12668 // RETURNS: a #GFileInfo for the @stream, or %NULL on error.
12669 // <attributes>: a file attribute query string.
12670 // <cancellable>: optional #GCancellable object, %NULL to ignore.
12671 extern (C) FileInfo* /*new*/ function (FileOutputStream* stream, char* attributes, Cancellable* cancellable, GLib2.Error** error=null) query_info;
12673 // <attributes>: a file attribute query string.
12674 // <io_priority>: the <link linkend="gio-GIOScheduler">I/O priority</link> of the request.
12675 // <cancellable>: optional #GCancellable object, %NULL to ignore.
12676 // <callback>: callback to call when the request is satisfied
12677 // <user_data>: the data to pass to callback function
12678 extern (C) void function (FileOutputStream* stream, char* attributes, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) query_info_async;
12680 // RETURNS: A #GFileInfo for the finished query.
12681 // <result>: a #GAsyncResult.
12682 extern (C) FileInfo* /*new*/ function (FileOutputStream* stream, AsyncResult* result, GLib2.Error** error=null) query_info_finish;
12683 // RETURNS: the entity tag for the stream.
12684 extern (C) char* /*new*/ function (FileOutputStream* stream) get_etag;
12685 extern (C) void function () _g_reserved1;
12686 extern (C) void function () _g_reserved2;
12687 extern (C) void function () _g_reserved3;
12688 extern (C) void function () _g_reserved4;
12689 extern (C) void function () _g_reserved5;
12692 struct FileOutputStreamPrivate {
12696 // When doing file operations that may take a while, such as moving
12697 // a file or copying a file, a progress callback is used to pass how
12698 // far along that operation is to the application.
12699 // <current_num_bytes>: the current number of bytes in the operation.
12700 // <total_num_bytes>: the total number of bytes in the operation.
12701 // <user_data>: user data passed to the callback.
12702 extern (C) alias void function (long current_num_bytes, long total_num_bytes, void* user_data) FileProgressCallback;
12704 // Flags used when querying a #GFileInfo.
12705 enum FileQueryInfoFlags {
12706 NONE = 0,
12707 NOFOLLOW_SYMLINKS = 1
12710 // When loading the partial contents of a file with g_file_load_partial_contents_async(),
12711 // it may become necessary to determine if any more data from the file should be loaded.
12712 // A #GFileReadMoreCallback function facilitates this by returning %TRUE if more data
12713 // should be read, or %FALSE otherwise.
12714 // RETURNS: %TRUE if more data should be read back. %FALSE otherwise.
12715 // <file_contents>: the data as currently read.
12716 // <file_size>: the size of the data currently read.
12717 // <callback_data>: data passed to the callback.
12718 extern (C) alias int function (char* file_contents, long file_size, void* callback_data) FileReadMoreCallback;
12720 // Indicates the file's on-disk type.
12721 enum FileType {
12722 UNKNOWN = 0,
12723 REGULAR = 1,
12724 DIRECTORY = 2,
12725 SYMBOLIC_LINK = 3,
12726 SPECIAL = 4,
12727 SHORTCUT = 5,
12728 MOUNTABLE = 6
12731 // Completes partial file and directory names given a partial string by
12732 // looking in the file system for clues. Can return a list of possible
12733 // completion strings for widget implementations.
12734 struct FilenameCompleter /* : GObject.Object */ {
12735 alias method_parent this;
12736 alias method_parent super_;
12737 alias method_parent object;
12738 GObject2.Object method_parent;
12741 // Creates a new filename completer.
12742 // RETURNS: a #GFilenameCompleter.
12743 static FilenameCompleter* /*new*/ new_()() {
12744 return g_filename_completer_new();
12747 // Obtains a completion for @initial_text from @completer.
12749 // This string is not owned by GIO, so remember to g_free() it
12750 // when finished.
12751 // RETURNS: a completed string, or %NULL if no completion exists.
12752 // <initial_text>: text to be completed.
12753 char* /*new*/ get_completion_suffix()(char* initial_text) {
12754 return g_filename_completer_get_completion_suffix(&this, initial_text);
12757 // Gets an array of completion strings for a given initial text.
12759 // This array must be freed by g_strfreev() when finished.
12760 // RETURNS: array of strings with possible completions for @initial_text.
12761 // <initial_text>: text to be completed.
12762 char** /*new*/ get_completions()(char* initial_text) {
12763 return g_filename_completer_get_completions(&this, initial_text);
12766 // If @dirs_only is %TRUE, @completer will only
12767 // complete directory names, and not file names.
12768 // <dirs_only>: a #gboolean.
12769 void set_dirs_only()(int dirs_only) {
12770 g_filename_completer_set_dirs_only(&this, dirs_only);
12772 // Emitted when the file name completion information comes available.
12773 extern (C) alias static void function (FilenameCompleter* this_, void* user_data=null) signal_got_completion_data;
12775 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
12776 return super_.signal_connect!name(cb, data, cf);
12779 ulong signal_connect(string name:"got-completion-data", CB:signal_got_completion_data)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
12780 return signal_connect_data!()(&this, cast(char*)"got-completion-data",
12781 cast(GObject2.Callback)cb, data, null, cf);
12785 struct FilenameCompleterClass {
12786 GObject2.ObjectClass parent_class;
12787 extern (C) void function (FilenameCompleter* filename_completer) got_completion_data;
12788 extern (C) void function () _g_reserved1;
12789 extern (C) void function () _g_reserved2;
12790 extern (C) void function () _g_reserved3;
12794 // Indicates a hint from the file system whether files should be
12795 // previewed in a file manager. Returned as the value of the key
12796 // #G_FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW.
12797 enum FilesystemPreviewType {
12798 IF_ALWAYS = 0,
12799 IF_LOCAL = 1,
12800 NEVER = 2
12803 // Base class for input stream implementations that perform some
12804 // kind of filtering operation on a base stream. Typical examples
12805 // of filtering operations are character set conversion, compression
12806 // and byte order flipping.
12807 struct FilterInputStream /* : InputStream */ {
12808 alias parent_instance this;
12809 alias parent_instance super_;
12810 alias parent_instance inputstream;
12811 InputStream parent_instance;
12812 InputStream* base_stream;
12815 // Gets the base stream for the filter stream.
12816 // RETURNS: a #GInputStream.
12817 InputStream* get_base_stream()() {
12818 return g_filter_input_stream_get_base_stream(&this);
12821 // Returns whether the base stream will be closed when @stream is
12822 // closed.
12823 // RETURNS: %TRUE if the base stream will be closed.
12824 int get_close_base_stream()() {
12825 return g_filter_input_stream_get_close_base_stream(&this);
12828 // Sets whether the base stream will be closed when @stream is closed.
12829 // <close_base>: %TRUE to close the base stream.
12830 void set_close_base_stream()(int close_base) {
12831 g_filter_input_stream_set_close_base_stream(&this, close_base);
12835 struct FilterInputStreamClass {
12836 InputStreamClass parent_class;
12837 extern (C) void function () _g_reserved1;
12838 extern (C) void function () _g_reserved2;
12839 extern (C) void function () _g_reserved3;
12843 // Base class for output stream implementations that perform some
12844 // kind of filtering operation on a base stream. Typical examples
12845 // of filtering operations are character set conversion, compression
12846 // and byte order flipping.
12847 struct FilterOutputStream /* : OutputStream */ {
12848 alias parent_instance this;
12849 alias parent_instance super_;
12850 alias parent_instance outputstream;
12851 OutputStream parent_instance;
12852 OutputStream* base_stream;
12855 // Gets the base stream for the filter stream.
12856 // RETURNS: a #GOutputStream.
12857 OutputStream* get_base_stream()() {
12858 return g_filter_output_stream_get_base_stream(&this);
12861 // Returns whether the base stream will be closed when @stream is
12862 // closed.
12863 // RETURNS: %TRUE if the base stream will be closed.
12864 int get_close_base_stream()() {
12865 return g_filter_output_stream_get_close_base_stream(&this);
12868 // Sets whether the base stream will be closed when @stream is closed.
12869 // <close_base>: %TRUE to close the base stream.
12870 void set_close_base_stream()(int close_base) {
12871 g_filter_output_stream_set_close_base_stream(&this, close_base);
12875 struct FilterOutputStreamClass {
12876 OutputStreamClass parent_class;
12877 extern (C) void function () _g_reserved1;
12878 extern (C) void function () _g_reserved2;
12879 extern (C) void function () _g_reserved3;
12882 // Error codes returned by GIO functions.
12883 enum IOErrorEnum {
12884 FAILED = 0,
12885 NOT_FOUND = 1,
12886 EXISTS = 2,
12887 IS_DIRECTORY = 3,
12888 NOT_DIRECTORY = 4,
12889 NOT_EMPTY = 5,
12890 NOT_REGULAR_FILE = 6,
12891 NOT_SYMBOLIC_LINK = 7,
12892 NOT_MOUNTABLE_FILE = 8,
12893 FILENAME_TOO_LONG = 9,
12894 INVALID_FILENAME = 10,
12895 TOO_MANY_LINKS = 11,
12896 NO_SPACE = 12,
12897 INVALID_ARGUMENT = 13,
12898 PERMISSION_DENIED = 14,
12899 NOT_SUPPORTED = 15,
12900 NOT_MOUNTED = 16,
12901 ALREADY_MOUNTED = 17,
12902 CLOSED = 18,
12903 CANCELLED = 19,
12904 PENDING = 20,
12905 READ_ONLY = 21,
12906 CANT_CREATE_BACKUP = 22,
12907 WRONG_ETAG = 23,
12908 TIMED_OUT = 24,
12909 WOULD_RECURSE = 25,
12910 BUSY = 26,
12911 WOULD_BLOCK = 27,
12912 HOST_NOT_FOUND = 28,
12913 WOULD_MERGE = 29,
12914 FAILED_HANDLED = 30,
12915 TOO_MANY_OPEN_FILES = 31,
12916 NOT_INITIALIZED = 32,
12917 ADDRESS_IN_USE = 33,
12918 PARTIAL_INPUT = 34,
12919 INVALID_DATA = 35,
12920 DBUS_ERROR = 36,
12921 HOST_UNREACHABLE = 37,
12922 NETWORK_UNREACHABLE = 38,
12923 CONNECTION_REFUSED = 39,
12924 PROXY_FAILED = 40,
12925 PROXY_AUTH_FAILED = 41,
12926 PROXY_NEED_AUTH = 42,
12927 PROXY_NOT_ALLOWED = 43
12929 struct IOExtension {
12931 // Gets the name under which @extension was registered.
12933 // Note that the same type may be registered as extension
12934 // for multiple extension points, under different names.
12935 // RETURNS: the name of @extension.
12936 char* get_name()() {
12937 return g_io_extension_get_name(&this);
12940 // Gets the priority with which @extension was registered.
12941 // RETURNS: the priority of @extension
12942 int get_priority()() {
12943 return g_io_extension_get_priority(&this);
12946 // Unintrospectable method: ref_class() / g_io_extension_ref_class()
12947 // Gets a reference to the class for the type that is
12948 // associated with @extension.
12949 // RETURNS: the #GTypeClass for the type of @extension
12950 GObject2.TypeClass* /*new*/ ref_class()() {
12951 return g_io_extension_ref_class(&this);
12955 struct IOExtensionPoint {
12957 // Finds a #GIOExtension for an extension point by name.
12959 // given name, or %NULL if there is no extension with that name
12960 // RETURNS: the #GIOExtension for @extension_point that has the
12961 // <name>: the name of the extension to get
12962 IOExtension* get_extension_by_name()(char* name) {
12963 return g_io_extension_point_get_extension_by_name(&this, name);
12966 // Gets a list of all extensions that implement this extension point.
12967 // The list is sorted by priority, beginning with the highest priority.
12969 // #GIOExtension<!-- -->s. The list is owned by GIO and should not be
12970 // modified.
12971 // RETURNS: a #GList of
12972 GLib2.List* get_extensions()() {
12973 return g_io_extension_point_get_extensions(&this);
12976 // Gets the required type for @extension_point.
12978 // or #G_TYPE_INVALID if the extension point has no required type
12979 // RETURNS: the #GType that all implementations must have,
12980 Type get_required_type()() {
12981 return g_io_extension_point_get_required_type(&this);
12984 // Sets the required type for @extension_point to @type.
12985 // All implementations must henceforth have this type.
12986 // <type>: the #GType to require
12987 void set_required_type()(Type type) {
12988 g_io_extension_point_set_required_type(&this, type);
12991 // Registers @type as extension for the extension point with name
12992 // @extension_point_name.
12994 // If @type has already been registered as an extension for this
12995 // extension point, the existing #GIOExtension object is returned.
12996 // RETURNS: a #GIOExtension object for #GType
12997 // <extension_point_name>: the name of the extension point
12998 // <type>: the #GType to register as extension
12999 // <extension_name>: the name for the extension
13000 // <priority>: the priority for the extension
13001 static IOExtension* implement()(char* extension_point_name, Type type, char* extension_name, int priority) {
13002 return g_io_extension_point_implement(extension_point_name, type, extension_name, priority);
13005 // Looks up an existing extension point.
13007 // is no registered extension point with the given name.
13008 // RETURNS: the #GIOExtensionPoint, or %NULL if there
13009 // <name>: the name of the extension point
13010 static IOExtensionPoint* lookup()(char* name) {
13011 return g_io_extension_point_lookup(name);
13014 // Registers an extension point.
13016 // owned by GIO and should not be freed.
13017 // RETURNS: the new #GIOExtensionPoint. This object is
13018 // <name>: The name of the extension point
13019 static IOExtensionPoint* register()(char* name) {
13020 return g_io_extension_point_register(name);
13025 // Provides an interface and default functions for loading and unloading
13026 // modules. This is used internally to make GIO extensible, but can also
13027 // be used by others to implement module loading.
13028 struct IOModule /* : GObject.TypeModule */ {
13029 mixin GObject2.TypePlugin.__interface__;
13030 alias method_parent this;
13031 alias method_parent super_;
13032 alias method_parent typemodule;
13033 GObject2.TypeModule method_parent;
13036 // Creates a new GIOModule that will load the specific
13037 // shared library when in use.
13039 // or %NULL on error.
13040 // RETURNS: a #GIOModule from given @filename,
13041 // <filename>: filename of the shared library module.
13042 static IOModule* /*new*/ new_()(char* filename) {
13043 return g_io_module_new(filename);
13046 // VERSION: 2.24
13047 // Optional API for GIO modules to implement.
13049 // Should return a list of all the extension points that may be
13050 // implemented in this module.
13052 // This method will not be called in normal use, however it may be
13053 // called when probing existing modules and recording which extension
13054 // points that this model is used for. This means we won't have to
13055 // load and initialze this module unless its needed.
13057 // If this function is not implemented by the module the module will
13058 // always be loaded, initialized and then unloaded on application startup
13059 // so that it can register its extension points during init.
13061 // Note that a module need not actually implement all the extension points
13062 // that g_io_module_query returns, since the exact list of extension may
13063 // depend on runtime issues. However all extension points actually implemented
13064 // must be returned by g_io_module_query() (if defined).
13066 // When installing a module that implements g_io_module_query you must
13067 // run gio-querymodules in order to build the cache files required for
13068 // lazy loading.
13070 // extension points of the module. The array must be suitable for
13071 // freeing with g_strfreev().
13072 // RETURNS: A %NULL-terminated array of strings, listing the supported
13073 static char** /*new*/ query()() {
13074 return g_io_module_query();
13077 // Required API for GIO modules to implement.
13078 // This function is ran after the module has been loaded into GIO,
13079 // to initialize the module.
13080 void load()() {
13081 g_io_module_load(&this);
13084 // Required API for GIO modules to implement.
13085 // This function is ran when the module is being unloaded from GIO,
13086 // to finalize the module.
13087 void unload()() {
13088 g_io_module_unload(&this);
13092 struct IOModuleClass {
13096 // Represents a scope for loading IO modules. A scope can be used for blocking
13097 // duplicate modules, or blocking a module you don't want to load.
13099 // The scope can be used with g_io_modules_load_all_in_directory_with_scope()
13100 // or g_io_modules_scan_all_in_directory_with_scope().
13101 struct IOModuleScope /* Version 2.30 */ {
13103 // VERSION: 2.30
13104 // Block modules with the given @basename from being loaded when
13105 // this scope is used with g_io_modules_scan_all_in_directory_with_scope()
13106 // or g_io_modules_load_all_in_directory_with_scope().
13107 // <basename>: the basename to block
13108 void block()(char* basename) {
13109 g_io_module_scope_block(&this, basename);
13112 // VERSION: 2.30
13113 // Free a module scope.
13114 void free()() {
13115 g_io_module_scope_free(&this);
13118 // Unintrospectable function: new() / g_io_module_scope_new()
13119 // VERSION: 2.30
13120 // Create a new scope for loading of IO modules. A scope can be used for
13121 // blocking duplicate modules, or blocking a module you don't want to load.
13123 // Specify the %G_IO_MODULES_SCOPE_BLOCK_DUPLICATES flag to block modules
13124 // which have the same base name as a module that has already been seen
13125 // in this scope.
13126 // RETURNS: the new module scope
13127 // <flags>: flags for the new scope
13128 static IOModuleScope* /*new*/ new_()(IOModuleScopeFlags flags) {
13129 return g_io_module_scope_new(flags);
13133 // Flags for use with g_io_module_scope_new().
13134 enum IOModuleScopeFlags /* Version 2.30 */ {
13135 NONE = 0,
13136 BLOCK_DUPLICATES = 1
13138 // Opaque class for defining and scheduling IO jobs.
13139 struct IOSchedulerJob {
13141 // Used from an I/O job to send a callback to be run in the thread
13142 // that the job was started from, waiting for the result (and thus
13143 // blocking the I/O job).
13144 // RETURNS: The return value of @func
13145 // <func>: a #GSourceFunc callback that will be called in the original thread
13146 // <user_data>: data to pass to @func
13147 // <notify>: a #GDestroyNotify for @user_data, or %NULL
13148 int send_to_mainloop()(GLib2.SourceFunc func, void* user_data, GLib2.DestroyNotify notify) {
13149 return g_io_scheduler_job_send_to_mainloop(&this, func, user_data, notify);
13152 // Used from an I/O job to send a callback to be run asynchronously in
13153 // the thread that the job was started from. The callback will be run
13154 // when the main loop is available, but at that time the I/O job might
13155 // have finished. The return value from the callback is ignored.
13157 // Note that if you are passing the @user_data from g_io_scheduler_push_job()
13158 // on to this function you have to ensure that it is not freed before
13159 // @func is called, either by passing %NULL as @notify to
13160 // g_io_scheduler_push_job() or by using refcounting for @user_data.
13161 // <func>: a #GSourceFunc callback that will be called in the original thread
13162 // <user_data>: data to pass to @func
13163 // <notify>: a #GDestroyNotify for @user_data, or %NULL
13164 void send_to_mainloop_async()(GLib2.SourceFunc func, void* user_data, GLib2.DestroyNotify notify) {
13165 g_io_scheduler_job_send_to_mainloop_async(&this, func, user_data, notify);
13170 // I/O Job function.
13172 // Long-running jobs should periodically check the @cancellable
13173 // to see if they have been cancelled.
13175 // complete the job, %FALSE if the job is complete (or cancelled)
13176 // RETURNS: %TRUE if this function should be called again to
13177 // <job>: a #GIOSchedulerJob.
13178 // <cancellable>: optional #GCancellable object, %NULL to ignore.
13179 // <user_data>: the data to pass to callback function
13180 extern (C) alias int function (IOSchedulerJob* job, Cancellable* cancellable, void* user_data) IOSchedulerJobFunc;
13183 // GIOStream represents an object that has both read and write streams.
13184 // Generally the two streams acts as separate input and output streams,
13185 // but they share some common resources and state. For instance, for
13186 // seekable streams they may use the same position in both streams.
13188 // Examples of #GIOStream objects are #GSocketConnection which represents
13189 // a two-way network connection, and #GFileIOStream which represent a
13190 // file handle opened in read-write mode.
13192 // To do the actual reading and writing you need to get the substreams
13193 // with g_io_stream_get_input_stream() and g_io_stream_get_output_stream().
13195 // The #GIOStream object owns the input and the output streams, not the other
13196 // way around, so keeping the substreams alive will not keep the #GIOStream
13197 // object alive. If the #GIOStream object is freed it will be closed, thus
13198 // closing the substream, so even if the substreams stay alive they will
13199 // always just return a %G_IO_ERROR_CLOSED for all operations.
13201 // To close a stream use g_io_stream_close() which will close the common
13202 // stream object and also the individual substreams. You can also close
13203 // the substreams themselves. In most cases this only marks the
13204 // substream as closed, so further I/O on it fails. However, some streams
13205 // may support "half-closed" states where one direction of the stream
13206 // is actually shut down.
13207 struct IOStream /* : GObject.Object */ {
13208 alias parent_instance this;
13209 alias parent_instance super_;
13210 alias parent_instance object;
13211 GObject2.Object parent_instance;
13212 private IOStreamPrivate* priv;
13215 // VERSION: 2.28
13216 // Finishes an asynchronous io stream splice operation.
13217 // RETURNS: %TRUE on success, %FALSE otherwise.
13218 // <result>: a #GAsyncResult.
13219 static int splice_finish()(AsyncResult* result, GLib2.Error** error=null) {
13220 return g_io_stream_splice_finish(result, error);
13223 // VERSION: 2.22
13224 // Clears the pending flag on @stream.
13225 void clear_pending()() {
13226 g_io_stream_clear_pending(&this);
13229 // VERSION: 2.22
13230 // Closes the stream, releasing resources related to it. This will also
13231 // closes the individual input and output streams, if they are not already
13232 // closed.
13234 // Once the stream is closed, all other operations will return
13235 // %G_IO_ERROR_CLOSED. Closing a stream multiple times will not
13236 // return an error.
13238 // Closing a stream will automatically flush any outstanding buffers
13239 // in the stream.
13241 // Streams will be automatically closed when the last reference
13242 // is dropped, but you might want to call this function to make sure
13243 // resources are released as early as possible.
13245 // Some streams might keep the backing store of the stream (e.g. a file
13246 // descriptor) open after the stream is closed. See the documentation for
13247 // the individual stream for details.
13249 // On failure the first error that happened will be reported, but the
13250 // close operation will finish as much as possible. A stream that failed
13251 // to close will still return %G_IO_ERROR_CLOSED for all operations.
13252 // Still, it is important to check and report the error to the user,
13253 // otherwise there might be a loss of data as all data might not be written.
13255 // If @cancellable is not NULL, then the operation can be cancelled by
13256 // triggering the cancellable object from another thread. If the operation
13257 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
13258 // Cancelling a close will still leave the stream closed, but some streams
13259 // can use a faster close that doesn't block to e.g. check errors.
13261 // The default implementation of this method just calls close on the
13262 // individual input/output streams.
13263 // RETURNS: %TRUE on success, %FALSE on failure
13264 // <cancellable>: optional #GCancellable object, %NULL to ignore
13265 int close()(Cancellable* cancellable, GLib2.Error** error=null) {
13266 return g_io_stream_close(&this, cancellable, error);
13269 // VERSION: 2.22
13270 // Requests an asynchronous close of the stream, releasing resources
13271 // related to it. When the operation is finished @callback will be
13272 // called. You can then call g_io_stream_close_finish() to get
13273 // the result of the operation.
13275 // For behaviour details see g_io_stream_close().
13277 // The asynchronous methods have a default fallback that uses threads
13278 // to implement asynchronicity, so they are optional for inheriting
13279 // classes. However, if you override one you must override all.
13280 // <io_priority>: the io priority of the request
13281 // <cancellable>: optional cancellable object
13282 // <callback>: callback to call when the request is satisfied
13283 // <user_data>: the data to pass to callback function
13284 void close_async()(int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
13285 g_io_stream_close_async(&this, io_priority, cancellable, callback, user_data);
13288 // VERSION: 2.22
13289 // Closes a stream.
13290 // RETURNS: %TRUE if stream was successfully closed, %FALSE otherwise.
13291 // <result>: a #GAsyncResult
13292 int close_finish()(AsyncResult* result, GLib2.Error** error=null) {
13293 return g_io_stream_close_finish(&this, result, error);
13296 // VERSION: 2.22
13297 // Gets the input stream for this object. This is used
13298 // for reading.
13300 // Do not free.
13301 // RETURNS: a #GInputStream, owned by the #GIOStream.
13302 InputStream* get_input_stream()() {
13303 return g_io_stream_get_input_stream(&this);
13306 // VERSION: 2.22
13307 // Gets the output stream for this object. This is used for
13308 // writing.
13310 // Do not free.
13311 // RETURNS: a #GOutputStream, owned by the #GIOStream.
13312 OutputStream* get_output_stream()() {
13313 return g_io_stream_get_output_stream(&this);
13316 // VERSION: 2.22
13317 // Checks if a stream has pending actions.
13318 // RETURNS: %TRUE if @stream has pending actions.
13319 int has_pending()() {
13320 return g_io_stream_has_pending(&this);
13323 // VERSION: 2.22
13324 // Checks if a stream is closed.
13325 // RETURNS: %TRUE if the stream is closed.
13326 int is_closed()() {
13327 return g_io_stream_is_closed(&this);
13330 // VERSION: 2.22
13331 // Sets @stream to have actions pending. If the pending flag is
13332 // already set or @stream is closed, it will return %FALSE and set
13333 // @error.
13334 // RETURNS: %TRUE if pending was previously unset and is now set.
13335 int set_pending()(GLib2.Error** error=null) {
13336 return g_io_stream_set_pending(&this, error);
13339 // VERSION: 2.28
13340 // Asyncronously splice the output stream of @stream1 to the input stream of
13341 // @stream2, and splice the output stream of @stream2 to the input stream of
13342 // @stream1.
13344 // When the operation is finished @callback will be called.
13345 // You can then call g_io_stream_splice_finish() to get the
13346 // result of the operation.
13347 // <stream2>: a #GIOStream.
13348 // <flags>: a set of #GIOStreamSpliceFlags.
13349 // <io_priority>: the io priority of the request.
13350 // <cancellable>: optional #GCancellable object, %NULL to ignore.
13351 // <callback>: a #GAsyncReadyCallback.
13352 // <user_data>: user data passed to @callback.
13353 void splice_async()(IOStream* stream2, IOStreamSpliceFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
13354 g_io_stream_splice_async(&this, stream2, flags, io_priority, cancellable, callback, user_data);
13358 struct IOStreamAdapter {
13361 struct IOStreamClass {
13362 GObject2.ObjectClass parent_class;
13363 // RETURNS: a #GInputStream, owned by the #GIOStream.
13364 extern (C) InputStream* function (IOStream* stream) get_input_stream;
13365 // RETURNS: a #GOutputStream, owned by the #GIOStream.
13366 extern (C) OutputStream* function (IOStream* stream) get_output_stream;
13367 extern (C) int function (IOStream* stream, Cancellable* cancellable, GLib2.Error** error=null) close_fn;
13369 // <io_priority>: the io priority of the request
13370 // <cancellable>: optional cancellable object
13371 // <callback>: callback to call when the request is satisfied
13372 // <user_data>: the data to pass to callback function
13373 extern (C) void function (IOStream* stream, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) close_async;
13375 // RETURNS: %TRUE if stream was successfully closed, %FALSE otherwise.
13376 // <result>: a #GAsyncResult
13377 extern (C) int function (IOStream* stream, AsyncResult* result, GLib2.Error** error=null) close_finish;
13378 extern (C) void function () _g_reserved1;
13379 extern (C) void function () _g_reserved2;
13380 extern (C) void function () _g_reserved3;
13381 extern (C) void function () _g_reserved4;
13382 extern (C) void function () _g_reserved5;
13383 extern (C) void function () _g_reserved6;
13384 extern (C) void function () _g_reserved7;
13385 extern (C) void function () _g_reserved8;
13386 extern (C) void function () _g_reserved9;
13387 extern (C) void function () _g_reserved10;
13390 struct IOStreamPrivate {
13393 // GIOStreamSpliceFlags determine how streams should be spliced.
13394 enum IOStreamSpliceFlags /* Version 2.28 */ {
13395 NONE = 0,
13396 CLOSE_STREAM1 = 1,
13397 CLOSE_STREAM2 = 2,
13398 WAIT_FOR_BOTH = 4
13401 // #GIcon is a very minimal interface for icons. It provides functions
13402 // for checking the equality of two icons, hashing of icons and
13403 // serializing an icon to and from strings.
13405 // #GIcon does not provide the actual pixmap for the icon as this is out
13406 // of GIO's scope, however implementations of #GIcon may contain the name
13407 // of an icon (see #GThemedIcon), or the path to an icon (see #GLoadableIcon).
13409 // To obtain a hash of a #GIcon, see g_icon_hash().
13411 // To check if two #GIcons are equal, see g_icon_equal().
13413 // For serializing a #GIcon, use g_icon_to_string() and
13414 // g_icon_new_for_string().
13416 // If your application or library provides one or more #GIcon
13417 // implementations you need to ensure that each #GType is registered
13418 // with the type system prior to calling g_icon_new_for_string().
13419 struct Icon /* Interface */ {
13420 mixin template __interface__() {
13421 // Gets a hash for an icon.
13423 // use in a #GHashTable or similar data structure.
13424 // RETURNS: a #guint containing a hash for the @icon, suitable for
13425 // <icon>: #gconstpointer to an icon object.
13426 static uint hash()(const(void)* icon) {
13427 return g_icon_hash(icon);
13430 // VERSION: 2.20
13431 // Generate a #GIcon instance from @str. This function can fail if
13432 // @str is not valid - see g_icon_to_string() for discussion.
13434 // If your application or library provides one or more #GIcon
13435 // implementations you need to ensure that each #GType is registered
13436 // with the type system prior to calling g_icon_new_for_string().
13438 // interface or %NULL if @error is set.
13439 // RETURNS: An object implementing the #GIcon
13440 // <str>: A string obtained via g_icon_to_string().
13441 static Icon* /*new*/ new_for_string()(char* str, GLib2.Error** error=null) {
13442 return g_icon_new_for_string(str, error);
13445 // Checks if two icons are equal.
13446 // RETURNS: %TRUE if @icon1 is equal to @icon2. %FALSE otherwise.
13447 // <icon2>: pointer to the second #GIcon.
13448 int equal()(Icon* icon2=null) {
13449 return g_icon_equal(cast(Icon*)&this, icon2);
13452 // VERSION: 2.20
13453 // Generates a textual representation of @icon that can be used for
13454 // serialization such as when passing @icon to a different process or
13455 // saving it to persistent storage. Use g_icon_new_for_string() to
13456 // get @icon back from the returned string.
13458 // The encoding of the returned string is proprietary to #GIcon except
13459 // in the following two cases
13461 // <itemizedlist>
13462 // <listitem><para>
13463 // If @icon is a #GFileIcon, the returned string is a native path
13464 // (such as <literal>/path/to/my icon.png</literal>) without escaping
13465 // if the #GFile for @icon is a native file. If the file is not
13466 // native, the returned string is the result of g_file_get_uri()
13467 // (such as <literal>sftp://path/to/my&percnt;20icon.png</literal>).
13468 // </para></listitem>
13469 // <listitem><para>
13470 // If @icon is a #GThemedIcon with exactly one name, the encoding is
13471 // simply the name (such as <literal>network-server</literal>).
13472 // </para></listitem>
13473 // </itemizedlist>
13475 // be serialized. Use g_free() to free.
13476 // RETURNS: An allocated NUL-terminated UTF8 string or %NULL if @icon can't
13477 char* /*new*/ to_string()() {
13478 return g_icon_to_string(cast(Icon*)&this);
13481 mixin __interface__;
13485 // GIconIface is used to implement GIcon types for various
13486 // different systems. See #GThemedIcon and #GLoadableIcon for
13487 // examples of how to implement this interface.
13488 struct IconIface {
13489 GObject2.TypeInterface g_iface;
13490 // RETURNS: a #guint containing a hash for the @icon, suitable for
13491 extern (C) uint function (Icon* icon) hash;
13493 // RETURNS: %TRUE if @icon1 is equal to @icon2. %FALSE otherwise.
13494 // <icon2>: pointer to the second #GIcon.
13495 extern (C) int function (Icon* icon1, Icon* icon2=null) equal;
13496 // RETURNS: An allocated NUL-terminated UTF8 string or %NULL if @icon can't
13497 extern (C) int function (Icon* icon, PtrArray* tokens, int* out_version) to_tokens;
13498 // Unintrospectable functionp: from_tokens() / ()
13499 extern (C) Icon* function (char** tokens, int num_tokens, int version_, GLib2.Error** error=null) from_tokens;
13503 // #GInetAddress represents an IPv4 or IPv6 internet address. Use
13504 // g_resolver_lookup_by_name() or g_resolver_lookup_by_name_async() to
13505 // look up the #GInetAddress for a hostname. Use
13506 // g_resolver_lookup_by_address() or
13507 // g_resolver_lookup_by_address_async() to look up the hostname for a
13508 // #GInetAddress.
13510 // To actually connect to a remote host, you will need a
13511 // #GInetSocketAddress (which includes a #GInetAddress as well as a
13512 // port number).
13513 struct InetAddress /* : GObject.Object */ {
13514 alias parent_instance this;
13515 alias parent_instance super_;
13516 alias parent_instance object;
13517 GObject2.Object parent_instance;
13518 private InetAddressPrivate* priv;
13521 // VERSION: 2.22
13522 // Creates a #GInetAddress for the "any" address (unassigned/"don't
13523 // care") for @family.
13525 // for @family.
13526 // RETURNS: a new #GInetAddress corresponding to the "any" address
13527 // <family>: the address family
13528 static InetAddress* /*new*/ new_any()(SocketFamily family) {
13529 return g_inet_address_new_any(family);
13532 // VERSION: 2.22
13533 // Creates a new #GInetAddress from the given @family and @bytes.
13534 // @bytes should be 4 bytes for %G_SOCKET_FAMILY_IPV4 and 16 bytes for
13535 // %G_SOCKET_FAMILY_IPV6.
13536 // RETURNS: a new #GInetAddress corresponding to @family and @bytes.
13537 // <bytes>: raw address data
13538 // <family>: the address family of @bytes
13539 static InetAddress* /*new*/ new_from_bytes()(ubyte* bytes, SocketFamily family) {
13540 return g_inet_address_new_from_bytes(bytes, family);
13543 // VERSION: 2.22
13544 // Parses @string as an IP address and creates a new #GInetAddress.
13546 // @string could not be parsed.
13547 // RETURNS: a new #GInetAddress corresponding to @string, or %NULL if
13548 // <string>: a string representation of an IP address
13549 static InetAddress* /*new*/ new_from_string()(char* string_) {
13550 return g_inet_address_new_from_string(string_);
13553 // VERSION: 2.22
13554 // Creates a #GInetAddress for the loopback address for @family.
13556 // for @family.
13557 // RETURNS: a new #GInetAddress corresponding to the loopback address
13558 // <family>: the address family
13559 static InetAddress* /*new*/ new_loopback()(SocketFamily family) {
13560 return g_inet_address_new_loopback(family);
13563 // VERSION: 2.30
13564 // Checks if two #GInetAddress instances are equal, e.g. the same address.
13565 // RETURNS: %TRUE if @address and @other_address are equal, %FALSE otherwise.
13566 // <other_address>: Another #GInetAddress.
13567 int equal()(InetAddress* other_address) {
13568 return g_inet_address_equal(&this, other_address);
13571 // VERSION: 2.22
13572 // Gets @address's family
13573 // RETURNS: @address's family
13574 SocketFamily get_family()() {
13575 return g_inet_address_get_family(&this);
13578 // VERSION: 2.22
13579 // Tests whether @address is the "any" address for its family.
13580 // RETURNS: %TRUE if @address is the "any" address for its family.
13581 int get_is_any()() {
13582 return g_inet_address_get_is_any(&this);
13585 // VERSION: 2.22
13586 // Tests whether @address is a link-local address (that is, if it
13587 // identifies a host on a local network that is not connected to the
13588 // Internet).
13589 // RETURNS: %TRUE if @address is a link-local address.
13590 int get_is_link_local()() {
13591 return g_inet_address_get_is_link_local(&this);
13594 // VERSION: 2.22
13595 // Tests whether @address is the loopback address for its family.
13596 // RETURNS: %TRUE if @address is the loopback address for its family.
13597 int get_is_loopback()() {
13598 return g_inet_address_get_is_loopback(&this);
13601 // VERSION: 2.22
13602 // Tests whether @address is a global multicast address.
13603 // RETURNS: %TRUE if @address is a global multicast address.
13604 int get_is_mc_global()() {
13605 return g_inet_address_get_is_mc_global(&this);
13608 // VERSION: 2.22
13609 // Tests whether @address is a link-local multicast address.
13610 // RETURNS: %TRUE if @address is a link-local multicast address.
13611 int get_is_mc_link_local()() {
13612 return g_inet_address_get_is_mc_link_local(&this);
13615 // VERSION: 2.22
13616 // Tests whether @address is a node-local multicast address.
13617 // RETURNS: %TRUE if @address is a node-local multicast address.
13618 int get_is_mc_node_local()() {
13619 return g_inet_address_get_is_mc_node_local(&this);
13622 // VERSION: 2.22
13623 // Tests whether @address is an organization-local multicast address.
13624 // RETURNS: %TRUE if @address is an organization-local multicast address.
13625 int get_is_mc_org_local()() {
13626 return g_inet_address_get_is_mc_org_local(&this);
13629 // VERSION: 2.22
13630 // Tests whether @address is a site-local multicast address.
13631 // RETURNS: %TRUE if @address is a site-local multicast address.
13632 int get_is_mc_site_local()() {
13633 return g_inet_address_get_is_mc_site_local(&this);
13636 // VERSION: 2.22
13637 // Tests whether @address is a multicast address.
13638 // RETURNS: %TRUE if @address is a multicast address.
13639 int get_is_multicast()() {
13640 return g_inet_address_get_is_multicast(&this);
13643 // VERSION: 2.22
13644 // Tests whether @address is a site-local address such as 10.0.0.1
13645 // (that is, the address identifies a host on a local network that can
13646 // not be reached directly from the Internet, but which may have
13647 // outgoing Internet connectivity via a NAT or firewall).
13648 // RETURNS: %TRUE if @address is a site-local address.
13649 int get_is_site_local()() {
13650 return g_inet_address_get_is_site_local(&this);
13653 // VERSION: 2.22
13654 // Gets the size of the native raw binary address for @address. This
13655 // is the size of the data that you get from g_inet_address_to_bytes().
13656 // RETURNS: the number of bytes used for the native version of @address.
13657 size_t get_native_size()() {
13658 return g_inet_address_get_native_size(&this);
13661 // Unintrospectable method: to_bytes() / g_inet_address_to_bytes()
13662 // VERSION: 2.22
13663 // Gets the raw binary address data from @address.
13665 // which should not be modified, stored, or freed. The size of this
13666 // array can be gotten with g_inet_address_get_native_size().
13667 // RETURNS: a pointer to an internal array of the bytes in @address,
13668 ubyte* to_bytes()() {
13669 return g_inet_address_to_bytes(&this);
13672 // VERSION: 2.22
13673 // Converts @address to string form.
13675 // freed after use.
13676 // RETURNS: a representation of @address as a string, which should be
13677 char* /*new*/ to_string()() {
13678 return g_inet_address_to_string(&this);
13682 struct InetAddressClass {
13683 GObject2.ObjectClass parent_class;
13684 // RETURNS: a representation of @address as a string, which should be
13685 extern (C) char* /*new*/ function (InetAddress* address) to_string;
13686 // RETURNS: a pointer to an internal array of the bytes in @address,
13687 extern (C) ubyte* function (InetAddress* address) to_bytes;
13691 // #GInetAddressMask represents a range of IPv4 or IPv6 addresses
13692 // described by a base address and a length indicating how many bits
13693 // of the base address are relevant for matching purposes. These are
13694 // often given in string form. Eg, "10.0.0.0/8", or "fe80::/10".
13695 struct InetAddressMask /* : GObject.Object */ /* Version 2.32 */ {
13696 mixin Initable.__interface__;
13697 alias parent_instance this;
13698 alias parent_instance super_;
13699 alias parent_instance object;
13700 GObject2.Object parent_instance;
13701 private InetAddressMaskPrivate* priv;
13704 // VERSION: 2.32
13705 // Creates a new #GInetAddressMask representing all addresses whose
13706 // first @length bits match @addr.
13707 // RETURNS: a new #GInetAddressMask, or %NULL on error
13708 // <addr>: a #GInetAddress
13709 // <length>: number of bits of @addr to use
13710 static InetAddressMask* /*new*/ new_()(InetAddress* addr, uint length, GLib2.Error** error=null) {
13711 return g_inet_address_mask_new(addr, length, error);
13714 // VERSION: 2.32
13715 // Parses @mask_string as an IP address and (optional) length, and
13716 // creates a new #GInetAddressMask. The length, if present, is
13717 // delimited by a "/". If it is not present, then the length is
13718 // assumed to be the full length of the address.
13720 // on error.
13721 // RETURNS: a new #GInetAddressMask corresponding to @string, or %NULL
13722 // <mask_string>: an IP address or address/length string
13723 static InetAddressMask* /*new*/ new_from_string()(char* mask_string, GLib2.Error** error=null) {
13724 return g_inet_address_mask_new_from_string(mask_string, error);
13727 // VERSION: 2.32
13728 // Tests if @mask and @mask2 are the same mask.
13729 // RETURNS: whether @mask and @mask2 are the same mask
13730 // <mask2>: another #GInetAddressMask
13731 int equal()(InetAddressMask* mask2) {
13732 return g_inet_address_mask_equal(&this, mask2);
13735 // VERSION: 2.32
13736 // Gets @mask's base address
13737 // RETURNS: @mask's base address
13738 InetAddress* get_address()() {
13739 return g_inet_address_mask_get_address(&this);
13742 // VERSION: 2.32
13743 // Gets the #GSocketFamily of @mask's address
13744 // RETURNS: the #GSocketFamily of @mask's address
13745 SocketFamily get_family()() {
13746 return g_inet_address_mask_get_family(&this);
13749 // VERSION: 2.32
13750 // Gets @mask's length
13751 // RETURNS: @mask's length
13752 uint get_length()() {
13753 return g_inet_address_mask_get_length(&this);
13756 // VERSION: 2.32
13757 // Tests if @address falls within the range described by @mask.
13759 // @mask.
13760 // RETURNS: whether @address falls within the range described by
13761 // <address>: a #GInetAddress
13762 int matches()(InetAddress* address) {
13763 return g_inet_address_mask_matches(&this, address);
13766 // VERSION: 2.32
13767 // Converts @mask back to its corresponding string form.
13768 // RETURNS: a string corresponding to @mask.
13769 char* /*new*/ to_string()() {
13770 return g_inet_address_mask_to_string(&this);
13774 struct InetAddressMaskClass {
13775 GObject2.ObjectClass parent_class;
13778 struct InetAddressMaskPrivate {
13781 struct InetAddressPrivate {
13785 // An IPv4 or IPv6 socket address; that is, the combination of a
13786 // #GInetAddress and a port number.
13787 struct InetSocketAddress /* : SocketAddress */ {
13788 mixin SocketConnectable.__interface__;
13789 alias parent_instance this;
13790 alias parent_instance super_;
13791 alias parent_instance socketaddress;
13792 SocketAddress parent_instance;
13793 private InetSocketAddressPrivate* priv;
13796 // VERSION: 2.22
13797 // Creates a new #GInetSocketAddress for @address and @port.
13798 // RETURNS: a new #GInetSocketAddress
13799 // <address>: a #GInetAddress
13800 // <port>: a port number
13801 static InetSocketAddress* /*new*/ new_()(InetAddress* address, ushort port) {
13802 return g_inet_socket_address_new(address, port);
13805 // VERSION: 2.22
13806 // Gets @address's #GInetAddress.
13808 // g_object_ref()'d if it will be stored
13809 // RETURNS: the #GInetAddress for @address, which must be
13810 InetAddress* get_address()() {
13811 return g_inet_socket_address_get_address(&this);
13814 // VERSION: 2.32
13815 // Gets the <literal>sin6_flowinfo</literal> field from @address,
13816 // which must be an IPv6 address.
13817 // RETURNS: the flowinfo field
13818 uint get_flowinfo()() {
13819 return g_inet_socket_address_get_flowinfo(&this);
13822 // VERSION: 2.22
13823 // Gets @address's port.
13824 // RETURNS: the port for @address
13825 ushort get_port()() {
13826 return g_inet_socket_address_get_port(&this);
13828 uint get_scope_id()() {
13829 return g_inet_socket_address_get_scope_id(&this);
13833 struct InetSocketAddressClass {
13834 SocketAddressClass parent_class;
13837 struct InetSocketAddressPrivate {
13841 // #GInitable is implemented by objects that can fail during
13842 // initialization. If an object implements this interface then
13843 // it must be initialized as the first thing after construction,
13844 // either via g_initable_init() or g_async_initable_init_async()
13845 // (the latter is only available if it also implements #GAsyncInitable).
13847 // If the object is not initialized, or initialization returns with an
13848 // error, then all operations on the object except g_object_ref() and
13849 // g_object_unref() are considered to be invalid, and have undefined
13850 // behaviour. They will often fail with g_critical() or g_warning(), but
13851 // this must not be relied on.
13853 // Users of objects implementing this are not intended to use
13854 // the interface method directly, instead it will be used automatically
13855 // in various ways. For C applications you generally just call
13856 // g_initable_new() directly, or indirectly via a foo_thing_new() wrapper.
13857 // This will call g_initable_init() under the cover, returning %NULL and
13858 // setting a #GError on failure (at which point the instance is
13859 // unreferenced).
13861 // For bindings in languages where the native constructor supports
13862 // exceptions the binding could check for objects implemention %GInitable
13863 // during normal construction and automatically initialize them, throwing
13864 // an exception on failure.
13865 struct Initable /* Interface */ /* Version 2.22 */ {
13866 mixin template __interface__() {
13867 // Unintrospectable function: new() / g_initable_new()
13868 // VERSION: 2.22
13869 // Helper function for constructing #GInitiable object. This is
13870 // similar to g_object_new() but also initializes the object
13871 // and returns %NULL, setting an error on failure.
13872 // RETURNS: a newly allocated #GObject, or %NULL on error
13873 // <object_type>: a #GType supporting #GInitable.
13874 // <cancellable>: optional #GCancellable object, %NULL to ignore.
13875 // <error>: a #GError location to store the error occurring, or %NULL to ignore.
13876 // <first_property_name>: the name of the first property, or %NULL if no properties
13877 alias g_initable_new new_; // Variadic
13879 // Unintrospectable function: new_valist() / g_initable_new_valist()
13880 // VERSION: 2.22
13881 // Helper function for constructing #GInitiable object. This is
13882 // similar to g_object_new_valist() but also initializes the object
13883 // and returns %NULL, setting an error on failure.
13884 // RETURNS: a newly allocated #GObject, or %NULL on error
13885 // <object_type>: a #GType supporting #GInitable.
13886 // <first_property_name>: the name of the first property, followed by the value, and other property value pairs, and ended by %NULL.
13887 // <var_args>: The var args list generated from @first_property_name.
13888 // <cancellable>: optional #GCancellable object, %NULL to ignore.
13889 static GObject2.Object* /*new*/ new_valist()(Type object_type, char* first_property_name, va_list var_args, Cancellable* cancellable, GLib2.Error** error=null) {
13890 return g_initable_new_valist(object_type, first_property_name, var_args, cancellable, error);
13893 // VERSION: 2.22
13894 // Helper function for constructing #GInitiable object. This is
13895 // similar to g_object_newv() but also initializes the object
13896 // and returns %NULL, setting an error on failure.
13897 // RETURNS: a newly allocated #GObject, or %NULL on error
13898 // <object_type>: a #GType supporting #GInitable.
13899 // <n_parameters>: the number of parameters in @parameters
13900 // <parameters>: the parameters to use to construct the object
13901 // <cancellable>: optional #GCancellable object, %NULL to ignore.
13902 static void* /*new*/ newv()(Type object_type, uint n_parameters, GObject2.Parameter* parameters, Cancellable* cancellable, GLib2.Error** error=null) {
13903 return g_initable_newv(object_type, n_parameters, parameters, cancellable, error);
13906 // VERSION: 2.22
13907 // Initializes the object implementing the interface.
13909 // The object must be initialized before any real use after initial
13910 // construction, either with this function or g_async_initable_init_async().
13912 // Implementations may also support cancellation. If @cancellable is not %NULL,
13913 // then initialization can be cancelled by triggering the cancellable object
13914 // from another thread. If the operation was cancelled, the error
13915 // %G_IO_ERROR_CANCELLED will be returned. If @cancellable is not %NULL and
13916 // the object doesn't support cancellable initialization the error
13917 // %G_IO_ERROR_NOT_SUPPORTED will be returned.
13919 // If the object is not initialized, or initialization returns with an
13920 // error, then all operations on the object except g_object_ref() and
13921 // g_object_unref() are considered to be invalid, and have undefined
13922 // behaviour. See the <xref linkend="ginitable"/> section introduction
13923 // for more details.
13925 // Implementations of this method must be idempotent, i.e. multiple calls
13926 // to this function with the same argument should return the same results.
13927 // Only the first call initializes the object, further calls return the result
13928 // of the first call. This is so that it's safe to implement the singleton
13929 // pattern in the GObject constructor function.
13931 // return %FALSE and set @error appropriately if present.
13932 // RETURNS: %TRUE if successful. If an error has occurred, this function will
13933 // <cancellable>: optional #GCancellable object, %NULL to ignore.
13934 int init()(Cancellable* cancellable, GLib2.Error** error=null) {
13935 return g_initable_init(cast(Initable*)&this, cancellable, error);
13938 mixin __interface__;
13942 // Provides an interface for initializing object such that initialization
13943 // may fail.
13944 struct InitableIface /* Version 2.22 */ {
13945 GObject2.TypeInterface g_iface;
13947 // RETURNS: %TRUE if successful. If an error has occurred, this function will
13948 // <cancellable>: optional #GCancellable object, %NULL to ignore.
13949 extern (C) int function (Initable* initable, Cancellable* cancellable, GLib2.Error** error=null) init;
13953 // GInputStream has functions to read from a stream (g_input_stream_read()),
13954 // to close a stream (g_input_stream_close()) and to skip some content
13955 // (g_input_stream_skip()).
13957 // To copy the content of an input stream to an output stream without
13958 // manually handling the reads and writes, use g_output_stream_splice().
13960 // All of these functions have async variants too.
13961 struct InputStream /* : GObject.Object */ {
13962 alias parent_instance this;
13963 alias parent_instance super_;
13964 alias parent_instance object;
13965 GObject2.Object parent_instance;
13966 private InputStreamPrivate* priv;
13968 // Clears the pending flag on @stream.
13969 void clear_pending()() {
13970 g_input_stream_clear_pending(&this);
13973 // Closes the stream, releasing resources related to it.
13975 // Once the stream is closed, all other operations will return %G_IO_ERROR_CLOSED.
13976 // Closing a stream multiple times will not return an error.
13978 // Streams will be automatically closed when the last reference
13979 // is dropped, but you might want to call this function to make sure
13980 // resources are released as early as possible.
13982 // Some streams might keep the backing store of the stream (e.g. a file descriptor)
13983 // open after the stream is closed. See the documentation for the individual
13984 // stream for details.
13986 // On failure the first error that happened will be reported, but the close
13987 // operation will finish as much as possible. A stream that failed to
13988 // close will still return %G_IO_ERROR_CLOSED for all operations. Still, it
13989 // is important to check and report the error to the user.
13991 // If @cancellable is not NULL, then the operation can be cancelled by
13992 // triggering the cancellable object from another thread. If the operation
13993 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
13994 // Cancelling a close will still leave the stream closed, but some streams
13995 // can use a faster close that doesn't block to e.g. check errors.
13996 // RETURNS: %TRUE on success, %FALSE on failure
13997 // <cancellable>: optional #GCancellable object, %NULL to ignore.
13998 int close()(Cancellable* cancellable, GLib2.Error** error=null) {
13999 return g_input_stream_close(&this, cancellable, error);
14002 // Requests an asynchronous closes of the stream, releasing resources related to it.
14003 // When the operation is finished @callback will be called.
14004 // You can then call g_input_stream_close_finish() to get the result of the
14005 // operation.
14007 // For behaviour details see g_input_stream_close().
14009 // The asyncronous methods have a default fallback that uses threads to implement
14010 // asynchronicity, so they are optional for inheriting classes. However, if you
14011 // override one you must override all.
14012 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
14013 // <cancellable>: optional cancellable object
14014 // <callback>: callback to call when the request is satisfied
14015 // <user_data>: the data to pass to callback function
14016 void close_async()(int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
14017 g_input_stream_close_async(&this, io_priority, cancellable, callback, user_data);
14020 // Finishes closing a stream asynchronously, started from g_input_stream_close_async().
14021 // RETURNS: %TRUE if the stream was closed successfully.
14022 // <result>: a #GAsyncResult.
14023 int close_finish()(AsyncResult* result, GLib2.Error** error=null) {
14024 return g_input_stream_close_finish(&this, result, error);
14027 // Checks if an input stream has pending actions.
14028 // RETURNS: %TRUE if @stream has pending actions.
14029 int has_pending()() {
14030 return g_input_stream_has_pending(&this);
14033 // Checks if an input stream is closed.
14034 // RETURNS: %TRUE if the stream is closed.
14035 int is_closed()() {
14036 return g_input_stream_is_closed(&this);
14039 // Tries to read @count bytes from the stream into the buffer starting at
14040 // @buffer. Will block during this read.
14042 // If count is zero returns zero and does nothing. A value of @count
14043 // larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
14045 // On success, the number of bytes read into the buffer is returned.
14046 // It is not an error if this is not the same as the requested size, as it
14047 // can happen e.g. near the end of a file. Zero is returned on end of file
14048 // (or if @count is zero), but never otherwise.
14050 // If @cancellable is not NULL, then the operation can be cancelled by
14051 // triggering the cancellable object from another thread. If the operation
14052 // was cancelled, the error G_IO_ERROR_CANCELLED will be returned. If an
14053 // operation was partially finished when the operation was cancelled the
14054 // partial result will be returned, without an error.
14056 // On error -1 is returned and @error is set accordingly.
14057 // RETURNS: Number of bytes read, or -1 on error
14058 // <buffer>: a buffer to read data into (which should be at least count bytes long).
14059 // <count>: the number of bytes that will be read from the stream
14060 // <cancellable>: optional #GCancellable object, %NULL to ignore.
14061 ssize_t read()(void* buffer, size_t count, Cancellable* cancellable, GLib2.Error** error=null) {
14062 return g_input_stream_read(&this, buffer, count, cancellable, error);
14065 // Tries to read @count bytes from the stream into the buffer starting at
14066 // @buffer. Will block during this read.
14068 // This function is similar to g_input_stream_read(), except it tries to
14069 // read as many bytes as requested, only stopping on an error or end of stream.
14071 // On a successful read of @count bytes, or if we reached the end of the
14072 // stream, %TRUE is returned, and @bytes_read is set to the number of bytes
14073 // read into @buffer.
14075 // If there is an error during the operation %FALSE is returned and @error
14076 // is set to indicate the error status, @bytes_read is updated to contain
14077 // the number of bytes read into @buffer before the error occurred.
14078 // RETURNS: %TRUE on success, %FALSE if there was an error
14079 // <buffer>: a buffer to read data into (which should be at least count bytes long).
14080 // <count>: the number of bytes that will be read from the stream
14081 // <bytes_read>: location to store the number of bytes that was read from the stream
14082 // <cancellable>: optional #GCancellable object, %NULL to ignore.
14083 int read_all()(void* buffer, size_t count, /*out*/ size_t* bytes_read, Cancellable* cancellable, GLib2.Error** error=null) {
14084 return g_input_stream_read_all(&this, buffer, count, bytes_read, cancellable, error);
14087 // Request an asynchronous read of @count bytes from the stream into the buffer
14088 // starting at @buffer. When the operation is finished @callback will be called.
14089 // You can then call g_input_stream_read_finish() to get the result of the
14090 // operation.
14092 // During an async request no other sync and async calls are allowed on @stream, and will
14093 // result in %G_IO_ERROR_PENDING errors.
14095 // A value of @count larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
14097 // On success, the number of bytes read into the buffer will be passed to the
14098 // callback. It is not an error if this is not the same as the requested size, as it
14099 // can happen e.g. near the end of a file, but generally we try to read
14100 // as many bytes as requested. Zero is returned on end of file
14101 // (or if @count is zero), but never otherwise.
14103 // Any outstanding i/o request with higher priority (lower numerical value) will
14104 // be executed before an outstanding request with lower priority. Default
14105 // priority is %G_PRIORITY_DEFAULT.
14107 // The asyncronous methods have a default fallback that uses threads to implement
14108 // asynchronicity, so they are optional for inheriting classes. However, if you
14109 // override one you must override all.
14110 // <buffer>: a buffer to read data into (which should be at least count bytes long).
14111 // <count>: the number of bytes that will be read from the stream
14112 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
14113 // <cancellable>: optional #GCancellable object, %NULL to ignore.
14114 // <callback>: callback to call when the request is satisfied
14115 // <user_data>: the data to pass to callback function
14116 void read_async()(void* buffer, size_t count, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
14117 g_input_stream_read_async(&this, buffer, count, io_priority, cancellable, callback, user_data);
14120 // Finishes an asynchronous stream read operation.
14121 // RETURNS: number of bytes read in, or -1 on error.
14122 // <result>: a #GAsyncResult.
14123 ssize_t read_finish()(AsyncResult* result, GLib2.Error** error=null) {
14124 return g_input_stream_read_finish(&this, result, error);
14127 // Sets @stream to have actions pending. If the pending flag is
14128 // already set or @stream is closed, it will return %FALSE and set
14129 // @error.
14130 // RETURNS: %TRUE if pending was previously unset and is now set.
14131 int set_pending()(GLib2.Error** error=null) {
14132 return g_input_stream_set_pending(&this, error);
14135 // Tries to skip @count bytes from the stream. Will block during the operation.
14137 // This is identical to g_input_stream_read(), from a behaviour standpoint,
14138 // but the bytes that are skipped are not returned to the user. Some
14139 // streams have an implementation that is more efficient than reading the data.
14141 // This function is optional for inherited classes, as the default implementation
14142 // emulates it using read.
14144 // If @cancellable is not %NULL, then the operation can be cancelled by
14145 // triggering the cancellable object from another thread. If the operation
14146 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
14147 // operation was partially finished when the operation was cancelled the
14148 // partial result will be returned, without an error.
14149 // RETURNS: Number of bytes skipped, or -1 on error
14150 // <count>: the number of bytes that will be skipped from the stream
14151 // <cancellable>: optional #GCancellable object, %NULL to ignore.
14152 ssize_t skip()(size_t count, Cancellable* cancellable, GLib2.Error** error=null) {
14153 return g_input_stream_skip(&this, count, cancellable, error);
14156 // Request an asynchronous skip of @count bytes from the stream.
14157 // When the operation is finished @callback will be called.
14158 // You can then call g_input_stream_skip_finish() to get the result
14159 // of the operation.
14161 // During an async request no other sync and async calls are allowed,
14162 // and will result in %G_IO_ERROR_PENDING errors.
14164 // A value of @count larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
14166 // On success, the number of bytes skipped will be passed to the callback.
14167 // It is not an error if this is not the same as the requested size, as it
14168 // can happen e.g. near the end of a file, but generally we try to skip
14169 // as many bytes as requested. Zero is returned on end of file
14170 // (or if @count is zero), but never otherwise.
14172 // Any outstanding i/o request with higher priority (lower numerical value)
14173 // will be executed before an outstanding request with lower priority.
14174 // Default priority is %G_PRIORITY_DEFAULT.
14176 // The asynchronous methods have a default fallback that uses threads to
14177 // implement asynchronicity, so they are optional for inheriting classes.
14178 // However, if you override one, you must override all.
14179 // <count>: the number of bytes that will be skipped from the stream
14180 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
14181 // <cancellable>: optional #GCancellable object, %NULL to ignore.
14182 // <callback>: callback to call when the request is satisfied
14183 // <user_data>: the data to pass to callback function
14184 void skip_async()(size_t count, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
14185 g_input_stream_skip_async(&this, count, io_priority, cancellable, callback, user_data);
14188 // Finishes a stream skip operation.
14189 // RETURNS: the size of the bytes skipped, or %-1 on error.
14190 // <result>: a #GAsyncResult.
14191 ssize_t skip_finish()(AsyncResult* result, GLib2.Error** error=null) {
14192 return g_input_stream_skip_finish(&this, result, error);
14196 struct InputStreamClass {
14197 GObject2.ObjectClass parent_class;
14198 extern (C) ssize_t function (InputStream* stream, void* buffer, size_t count, Cancellable* cancellable, GLib2.Error** error=null) read_fn;
14200 // RETURNS: Number of bytes skipped, or -1 on error
14201 // <count>: the number of bytes that will be skipped from the stream
14202 // <cancellable>: optional #GCancellable object, %NULL to ignore.
14203 extern (C) ssize_t function (InputStream* stream, size_t count, Cancellable* cancellable, GLib2.Error** error=null) skip;
14204 extern (C) int function (InputStream* stream, Cancellable* cancellable, GLib2.Error** error=null) close_fn;
14206 // <buffer>: a buffer to read data into (which should be at least count bytes long).
14207 // <count>: the number of bytes that will be read from the stream
14208 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
14209 // <cancellable>: optional #GCancellable object, %NULL to ignore.
14210 // <callback>: callback to call when the request is satisfied
14211 // <user_data>: the data to pass to callback function
14212 extern (C) void function (InputStream* stream, void* buffer, size_t count, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) read_async;
14214 // RETURNS: number of bytes read in, or -1 on error.
14215 // <result>: a #GAsyncResult.
14216 extern (C) ssize_t function (InputStream* stream, AsyncResult* result, GLib2.Error** error=null) read_finish;
14218 // <count>: the number of bytes that will be skipped from the stream
14219 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
14220 // <cancellable>: optional #GCancellable object, %NULL to ignore.
14221 // <callback>: callback to call when the request is satisfied
14222 // <user_data>: the data to pass to callback function
14223 extern (C) void function (InputStream* stream, size_t count, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) skip_async;
14225 // RETURNS: the size of the bytes skipped, or %-1 on error.
14226 // <result>: a #GAsyncResult.
14227 extern (C) ssize_t function (InputStream* stream, AsyncResult* result, GLib2.Error** error=null) skip_finish;
14229 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
14230 // <cancellable>: optional cancellable object
14231 // <callback>: callback to call when the request is satisfied
14232 // <user_data>: the data to pass to callback function
14233 extern (C) void function (InputStream* stream, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) close_async;
14235 // RETURNS: %TRUE if the stream was closed successfully.
14236 // <result>: a #GAsyncResult.
14237 extern (C) int function (InputStream* stream, AsyncResult* result, GLib2.Error** error=null) close_finish;
14238 extern (C) void function () _g_reserved1;
14239 extern (C) void function () _g_reserved2;
14240 extern (C) void function () _g_reserved3;
14241 extern (C) void function () _g_reserved4;
14242 extern (C) void function () _g_reserved5;
14245 struct InputStreamPrivate {
14249 // Structure used for scatter/gather data input.
14250 // You generally pass in an array of #GInputVector<!-- -->s
14251 // and the operation will store the read data starting in the
14252 // first buffer, switching to the next as needed.
14253 struct InputVector /* Version 2.22 */ {
14254 void* buffer;
14255 size_t size;
14259 // Extends the #GIcon interface and adds the ability to
14260 // load icons from streams.
14261 struct LoadableIcon /* Interface */ {
14262 mixin template __interface__() {
14263 // Loads a loadable icon. For the asynchronous version of this function,
14264 // see g_loadable_icon_load_async().
14265 // RETURNS: a #GInputStream to read the icon from.
14266 // <size>: an integer.
14267 // <type>: a location to store the type of the loaded icon, %NULL to ignore.
14268 // <cancellable>: optional #GCancellable object, %NULL to ignore.
14269 InputStream* /*new*/ load()(int size, /*out*/ char** type, Cancellable* cancellable, GLib2.Error** error=null) {
14270 return g_loadable_icon_load(cast(LoadableIcon*)&this, size, type, cancellable, error);
14273 // Loads an icon asynchronously. To finish this function, see
14274 // g_loadable_icon_load_finish(). For the synchronous, blocking
14275 // version of this function, see g_loadable_icon_load().
14276 // <size>: an integer.
14277 // <cancellable>: optional #GCancellable object, %NULL to ignore.
14278 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
14279 // <user_data>: the data to pass to callback function
14280 void load_async()(int size, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
14281 g_loadable_icon_load_async(cast(LoadableIcon*)&this, size, cancellable, callback, user_data);
14284 // Finishes an asynchronous icon load started in g_loadable_icon_load_async().
14285 // RETURNS: a #GInputStream to read the icon from.
14286 // <res>: a #GAsyncResult.
14287 // <type>: a location to store the type of the loaded icon, %NULL to ignore.
14288 InputStream* /*new*/ load_finish()(AsyncResult* res, char** type, GLib2.Error** error=null) {
14289 return g_loadable_icon_load_finish(cast(LoadableIcon*)&this, res, type, error);
14292 mixin __interface__;
14295 // Interface for icons that can be loaded as a stream.
14296 struct LoadableIconIface {
14297 GObject2.TypeInterface g_iface;
14299 // RETURNS: a #GInputStream to read the icon from.
14300 // <size>: an integer.
14301 // <type>: a location to store the type of the loaded icon, %NULL to ignore.
14302 // <cancellable>: optional #GCancellable object, %NULL to ignore.
14303 extern (C) InputStream* /*new*/ function (LoadableIcon* icon, int size, /*out*/ char** type, Cancellable* cancellable, GLib2.Error** error=null) load;
14305 // <size>: an integer.
14306 // <cancellable>: optional #GCancellable object, %NULL to ignore.
14307 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
14308 // <user_data>: the data to pass to callback function
14309 extern (C) void function (LoadableIcon* icon, int size, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) load_async;
14311 // RETURNS: a #GInputStream to read the icon from.
14312 // <res>: a #GAsyncResult.
14313 // <type>: a location to store the type of the loaded icon, %NULL to ignore.
14314 extern (C) InputStream* /*new*/ function (LoadableIcon* icon, AsyncResult* res, char** type, GLib2.Error** error=null) load_finish;
14317 enum MENU_ATTRIBUTE_ACTION = "action";
14318 enum MENU_ATTRIBUTE_LABEL = "label";
14319 enum MENU_ATTRIBUTE_TARGET = "target";
14320 enum MENU_LINK_SECTION = "section";
14321 enum MENU_LINK_SUBMENU = "submenu";
14323 // #GMemoryInputStream is a class for using arbitrary
14324 // memory chunks as input for GIO streaming input operations.
14325 struct MemoryInputStream /* : InputStream */ {
14326 mixin Seekable.__interface__;
14327 alias parent_instance this;
14328 alias parent_instance super_;
14329 alias parent_instance inputstream;
14330 InputStream parent_instance;
14331 private MemoryInputStreamPrivate* priv;
14334 // Creates a new empty #GMemoryInputStream.
14335 // RETURNS: a new #GInputStream
14336 static MemoryInputStream* /*new*/ new_()() {
14337 return g_memory_input_stream_new();
14340 // Creates a new #GMemoryInputStream with data in memory of a given size.
14341 // RETURNS: new #GInputStream read from @data of @len bytes.
14342 // <data>: input data
14343 // <len>: length of the data, may be -1 if @data is a nul-terminated string
14344 // <destroy>: function that is called to free @data, or %NULL
14345 static MemoryInputStream* /*new*/ new_from_data()(ubyte* data, ssize_t len, GLib2.DestroyNotify destroy=null) {
14346 return g_memory_input_stream_new_from_data(data, len, destroy);
14349 // Appends @data to data that can be read from the input stream
14350 // <data>: input data
14351 // <len>: length of the data, may be -1 if @data is a nul-terminated string
14352 // <destroy>: function that is called to free @data, or %NULL
14353 void add_data()(ubyte* data, ssize_t len, GLib2.DestroyNotify destroy=null) {
14354 g_memory_input_stream_add_data(&this, data, len, destroy);
14358 struct MemoryInputStreamClass {
14359 InputStreamClass parent_class;
14360 extern (C) void function () _g_reserved1;
14361 extern (C) void function () _g_reserved2;
14362 extern (C) void function () _g_reserved3;
14363 extern (C) void function () _g_reserved4;
14364 extern (C) void function () _g_reserved5;
14367 struct MemoryInputStreamPrivate {
14371 // #GMemoryOutputStream is a class for using arbitrary
14372 // memory chunks as output for GIO streaming output operations.
14373 struct MemoryOutputStream /* : OutputStream */ {
14374 mixin Seekable.__interface__;
14375 alias parent_instance this;
14376 alias parent_instance super_;
14377 alias parent_instance outputstream;
14378 OutputStream parent_instance;
14379 private MemoryOutputStreamPrivate* priv;
14382 // Unintrospectable constructor: new() / g_memory_output_stream_new()
14383 // Creates a new #GMemoryOutputStream.
14385 // If @data is non-%NULL, the stream will use that for its internal storage.
14386 // If @realloc_fn is non-%NULL, it will be used for resizing the internal
14387 // storage when necessary. To construct a fixed-size output stream,
14388 // pass %NULL as @realloc_fn.
14390 // |[
14391 // /&ast; a stream that can grow &ast;/
14392 // stream = g_memory_output_stream_new (NULL, 0, realloc, free);
14394 // /&ast; another stream that can grow &ast;/
14395 // stream2 = g_memory_output_stream_new (NULL, 0, g_realloc, g_free);
14397 // /&ast; a fixed-size stream &ast;/
14398 // data = malloc (200);
14399 // stream3 = g_memory_output_stream_new (data, 200, NULL, free);
14400 // ]|
14401 // RETURNS: A newly created #GMemoryOutputStream object.
14402 // <data>: pointer to a chunk of memory to use, or %NULL
14403 // <size>: the size of @data
14404 // <realloc_function>: a function with realloc() semantics (like g_realloc()) to be called when @data needs to be grown, or %NULL
14405 // <destroy_function>: a function to be called on @data when the stream is finalized, or %NULL
14406 static MemoryOutputStream* /*new*/ new_()(void* data, size_t size, ReallocFunc realloc_function, GLib2.DestroyNotify destroy_function) {
14407 return g_memory_output_stream_new(data, size, realloc_function, destroy_function);
14410 // Gets any loaded data from the @ostream.
14412 // Note that the returned pointer may become invalid on the next
14413 // write or truncate operation on the stream.
14414 // RETURNS: pointer to the stream's data
14415 void* get_data()() {
14416 return g_memory_output_stream_get_data(&this);
14419 // VERSION: 2.18
14420 // Returns the number of bytes from the start up
14421 // to including the last byte written in the stream
14422 // that has not been truncated away.
14423 // RETURNS: the number of bytes written to the stream
14424 size_t get_data_size()() {
14425 return g_memory_output_stream_get_data_size(&this);
14428 // Gets the size of the currently allocated data area (available from
14429 // g_memory_output_stream_get_data()). If the stream isn't
14430 // growable (no realloc was passed to g_memory_output_stream_new()) then
14431 // this is the maximum size of the stream and further writes
14432 // will return %G_IO_ERROR_NO_SPACE.
14434 // Note that for growable streams the returned size may become invalid on
14435 // the next write or truncate operation on the stream.
14437 // If you want the number of bytes currently written to the stream, use
14438 // g_memory_output_stream_get_data_size().
14439 // RETURNS: the number of bytes allocated for the data buffer
14440 size_t get_size()() {
14441 return g_memory_output_stream_get_size(&this);
14444 // VERSION: 2.26
14445 // Gets any loaded data from the @ostream. Ownership of the data
14446 // is transferred to the caller; when no longer needed it must be
14447 // freed using the free function set in @ostream's
14448 // #GMemoryOutputStream:destroy-function property.
14450 // @ostream must be closed before calling this function.
14451 // RETURNS: the stream's data
14452 void* /*new*/ steal_data()() {
14453 return g_memory_output_stream_steal_data(&this);
14457 struct MemoryOutputStreamClass {
14458 OutputStreamClass parent_class;
14459 extern (C) void function () _g_reserved1;
14460 extern (C) void function () _g_reserved2;
14461 extern (C) void function () _g_reserved3;
14462 extern (C) void function () _g_reserved4;
14463 extern (C) void function () _g_reserved5;
14466 struct MemoryOutputStreamPrivate {
14470 // #GMenu is a simple implementation of #GMenuModel.
14471 // You populate a #GMenu by adding #GMenuItem instances to it.
14473 // There are some convenience functions to allow you to directly
14474 // add items (avoiding #GMenuItem) for the common cases. To add
14475 // a regular item, use g_menu_insert(). To add a section, use
14476 // g_menu_insert_section(). To add a submenu, use
14477 // g_menu_insert_submenu().
14479 // Often it is more convenient to create a #GMenu from an XML
14480 // fragment, using <link linkend="gio-GMenu-Markup">GMenu Markup</link>.
14481 struct Menu /* : MenuModel */ /* Version 2.32 */ {
14482 alias method_parent this;
14483 alias method_parent super_;
14484 alias method_parent menumodel;
14485 MenuModel method_parent;
14488 // VERSION: 2.32
14489 // Creates a new #GMenu.
14491 // The new menu has no items.
14492 // RETURNS: a new #GMenu
14493 static Menu* /*new*/ new_()() {
14494 return g_menu_new();
14497 // VERSION: 2.32
14498 // Convenience function for appending a normal menu item to the end of
14499 // @menu. Combine g_menu_new() and g_menu_insert_item() for a more
14500 // flexible alternative.
14501 // <label>: the section label, or %NULL
14502 // <detailed_action>: the detailed action string, or %NULL
14503 void append()(char* label=null, char* detailed_action=null) {
14504 g_menu_append(&this, label, detailed_action);
14507 // VERSION: 2.32
14508 // Appends @item to the end of @menu.
14510 // See g_menu_insert_item() for more information.
14511 // <item>: a #GMenuItem to append
14512 void append_item()(MenuItem* item) {
14513 g_menu_append_item(&this, item);
14516 // VERSION: 2.32
14517 // Convenience function for appending a section menu item to the end of
14518 // @menu. Combine g_menu_item_new_section() and g_menu_insert_item() for a
14519 // more flexible alternative.
14520 // <label>: the section label, or %NULL
14521 // <section>: a #GMenuModel with the items of the section
14522 void append_section()(char* label, MenuModel* section) {
14523 g_menu_append_section(&this, label, section);
14526 // VERSION: 2.32
14527 // Convenience function for appending a submenu menu item to the end of
14528 // @menu. Combine g_menu_new_submenu() and g_menu_insert_item() for a
14529 // more flexible alternative.
14530 // <label>: the section label, or %NULL
14531 // <submenu>: a #GMenuModel with the items of the submenu
14532 void append_submenu()(char* label, MenuModel* submenu) {
14533 g_menu_append_submenu(&this, label, submenu);
14536 // VERSION: 2.32
14537 // Marks @menu as frozen.
14539 // After the menu is frozen, it is an error to attempt to make any
14540 // changes to it. In effect this means that the #GMenu API must no
14541 // longer be used.
14543 // This function causes g_menu_model_is_mutable() to begin returning
14544 // %FALSE, which has some positive performance implications.
14545 void freeze()() {
14546 g_menu_freeze(&this);
14549 // VERSION: 2.32
14550 // Convenience function for inserting a normal menu item into @menu.
14551 // Combine g_menu_new() and g_menu_insert_item() for a more flexible
14552 // alternative.
14553 // <position>: the position at which to insert the item
14554 // <label>: the section label, or %NULL
14555 // <detailed_action>: the detailed action string, or %NULL
14556 void insert()(int position, char* label=null, char* detailed_action=null) {
14557 g_menu_insert(&this, position, label, detailed_action);
14560 // VERSION: 2.32
14561 // Inserts @item into @menu.
14563 // The "insertion" is actually done by copying all of the attribute and
14564 // link values of @item and using them to form a new item within @menu.
14565 // As such, @item itself is not really inserted, but rather, a menu item
14566 // that is exactly the same as the one presently described by @item.
14568 // This means that @item is essentially useless after the insertion
14569 // occurs. Any changes you make to it are ignored unless it is inserted
14570 // again (at which point its updated values will be copied).
14572 // You should probably just free @item once you're done.
14574 // There are many convenience functions to take care of common cases.
14575 // See g_menu_insert(), g_menu_insert_section() and
14576 // g_menu_insert_submenu() as well as "prepend" and "append" variants of
14577 // each of these functions.
14578 // <position>: the position at which to insert the item
14579 // <item>: the #GMenuItem to insert
14580 void insert_item()(int position, MenuItem* item) {
14581 g_menu_insert_item(&this, position, item);
14584 // VERSION: 2.32
14585 // Convenience function for inserting a section menu item into @menu.
14586 // Combine g_menu_item_new_section() and g_menu_insert_item() for a more
14587 // flexible alternative.
14588 // <position>: the position at which to insert the item
14589 // <label>: the section label, or %NULL
14590 // <section>: a #GMenuModel with the items of the section
14591 void insert_section()(int position, char* label, MenuModel* section) {
14592 g_menu_insert_section(&this, position, label, section);
14595 // VERSION: 2.32
14596 // Convenience function for inserting a submenu menu item into @menu.
14597 // Combine g_menu_new_submenu() and g_menu_insert_item() for a more
14598 // flexible alternative.
14599 // <position>: the position at which to insert the item
14600 // <label>: the section label, or %NULL
14601 // <submenu>: a #GMenuModel with the items of the submenu
14602 void insert_submenu()(int position, char* label, MenuModel* submenu) {
14603 g_menu_insert_submenu(&this, position, label, submenu);
14606 // VERSION: 2.32
14607 // Convenience function for prepending a normal menu item to the start
14608 // of @menu. Combine g_menu_new() and g_menu_insert_item() for a more
14609 // flexible alternative.
14610 // <label>: the section label, or %NULL
14611 // <detailed_action>: the detailed action string, or %NULL
14612 void prepend()(char* label=null, char* detailed_action=null) {
14613 g_menu_prepend(&this, label, detailed_action);
14616 // VERSION: 2.32
14617 // Prepends @item to the start of @menu.
14619 // See g_menu_insert_item() for more information.
14620 // <item>: a #GMenuItem to prepend
14621 void prepend_item()(MenuItem* item) {
14622 g_menu_prepend_item(&this, item);
14625 // VERSION: 2.32
14626 // Convenience function for prepending a section menu item to the start
14627 // of @menu. Combine g_menu_item_new_section() and g_menu_insert_item() for
14628 // a more flexible alternative.
14629 // <label>: the section label, or %NULL
14630 // <section>: a #GMenuModel with the items of the section
14631 void prepend_section()(char* label, MenuModel* section) {
14632 g_menu_prepend_section(&this, label, section);
14635 // VERSION: 2.32
14636 // Convenience function for prepending a submenu menu item to the start
14637 // of @menu. Combine g_menu_new_submenu() and g_menu_insert_item() for
14638 // a more flexible alternative.
14639 // <label>: the section label, or %NULL
14640 // <submenu>: a #GMenuModel with the items of the submenu
14641 void prepend_submenu()(char* label, MenuModel* submenu) {
14642 g_menu_prepend_submenu(&this, label, submenu);
14645 // VERSION: 2.32
14646 // Removes an item from the menu.
14648 // @position gives the index of the item to remove.
14650 // It is an error if position is not in range the range from 0 to one
14651 // less than the number of items in the menu.
14653 // It is not possible to remove items by identity since items are added
14654 // to the menu simply by copying their links and attributes (ie:
14655 // identity of the item itself is not preserved).
14656 // <position>: the position of the item to remove
14657 void remove()(int position) {
14658 g_menu_remove(&this, position);
14663 // #GMenuAttributeIter is an opaque structure type. You must access it
14664 // using the functions below.
14665 struct MenuAttributeIter /* : GObject.Object */ /* Version 2.32 */ {
14666 alias parent_instance this;
14667 alias parent_instance super_;
14668 alias parent_instance object;
14669 GObject2.Object parent_instance;
14670 MenuAttributeIterPrivate* priv;
14673 // VERSION: 2.32
14674 // Gets the name of the attribute at the current iterator position, as
14675 // a string.
14677 // The iterator is not advanced.
14678 // RETURNS: the name of the attribute
14679 char* get_name()() {
14680 return g_menu_attribute_iter_get_name(&this);
14683 // VERSION: 2.32
14684 // This function combines g_menu_attribute_iter_next() with
14685 // g_menu_attribute_iter_get_name() and g_menu_attribute_iter_get_value().
14687 // First the iterator is advanced to the next (possibly first) attribute.
14688 // If that fails, then %FALSE is returned and there are no other
14689 // effects.
14691 // If successful, @name and @value are set to the name and value of the
14692 // attribute that has just been advanced to. At this point,
14693 // g_menu_item_get_name() and g_menu_item_get_value() will return the
14694 // same values again.
14696 // The value returned in @name remains valid for as long as the iterator
14697 // remains at the current position. The value returned in @value must
14698 // be unreffed using g_variant_unref() when it is no longer in use.
14700 // attribute
14701 // RETURNS: %TRUE on success, or %FALSE if there is no additional
14702 // <out_name>: the type of the attribute
14703 // <value>: the attribute value
14704 int get_next()(/*out*/ char** out_name=null, /*out*/ GLib2.Variant** value=null) {
14705 return g_menu_attribute_iter_get_next(&this, out_name, value);
14708 // VERSION: 2.32
14709 // Gets the value of the attribute at the current iterator position.
14711 // The iterator is not advanced.
14712 // RETURNS: the value of the current attribute
14713 GLib2.Variant* /*new*/ get_value()() {
14714 return g_menu_attribute_iter_get_value(&this);
14717 // VERSION: 2.32
14718 // Attempts to advance the iterator to the next (possibly first)
14719 // attribute.
14721 // %TRUE is returned on success, or %FALSE if there are no more
14722 // attributes.
14724 // You must call this function when you first acquire the iterator
14725 // to advance it to the first attribute (and determine if the first
14726 // attribute exists at all).
14727 // RETURNS: %TRUE on success, or %FALSE when there are no more attributes
14728 int next()() {
14729 return g_menu_attribute_iter_next(&this);
14733 struct MenuAttributeIterClass {
14734 GObject2.ObjectClass parent_class;
14736 // RETURNS: %TRUE on success, or %FALSE if there is no additional
14737 // <value>: the attribute value
14738 extern (C) int function (MenuAttributeIter* iter, char** out_type, /*out*/ GLib2.Variant** value=null) get_next;
14741 struct MenuAttributeIterPrivate {
14745 // #GMenuItem is an opaque structure type. You must access it using the
14746 // functions below.
14747 struct MenuItem /* : GObject.Object */ /* Version 2.32 */ {
14748 alias method_parent this;
14749 alias method_parent super_;
14750 alias method_parent object;
14751 GObject2.Object method_parent;
14754 // VERSION: 2.32
14755 // Creates a new #GMenuItem.
14757 // If @label is non-%NULL it is used to set the "label" attribute of the
14758 // new item.
14760 // If @detailed_action is non-%NULL it is used to set the "action" and
14761 // possibly the "target" attribute of the new item. See
14762 // g_menu_item_set_detailed_action() for more information.
14763 // RETURNS: a new #GMenuItem
14764 // <label>: the section label, or %NULL
14765 // <detailed_action>: the detailed action string, or %NULL
14766 static MenuItem* /*new*/ new_()(char* label=null, char* detailed_action=null) {
14767 return g_menu_item_new(label, detailed_action);
14770 // VERSION: 2.32
14771 // Creates a new #GMenuItem representing a section.
14773 // This is a convenience API around g_menu_item_new() and
14774 // g_menu_item_set_section().
14776 // The effect of having one menu appear as a section of another is
14777 // exactly as it sounds: the items from @section become a direct part of
14778 // the menu that @menu_item is added to.
14780 // Visual separation is typically displayed between two non-empty
14781 // sections. If @label is non-%NULL then it will be encorporated into
14782 // this visual indication. This allows for labeled subsections of a
14783 // menu.
14785 // As a simple example, consider a typical "Edit" menu from a simple
14786 // program. It probably contains an "Undo" and "Redo" item, followed by
14787 // a separator, followed by "Cut", "Copy" and "Paste".
14789 // This would be accomplished by creating three #GMenu instances. The
14790 // first would be populated with the "Undo" and "Redo" items, and the
14791 // second with the "Cut", "Copy" and "Paste" items. The first and
14792 // second menus would then be added as submenus of the third. In XML
14793 // format, this would look something like the following:
14795 // <informalexample><programlisting><![CDATA[
14796 // <menu id='edit-menu'>
14797 // <section>
14798 // <item label='Undo'/>
14799 // <item label='Redo'/>
14800 // </section>
14801 // <section>
14802 // <item label='Cut'/>
14803 // <item label='Copy'/>
14804 // <item label='Paste'/>
14805 // </section>
14806 // </menu>
14807 // ]]></programlisting></informalexample>
14809 // The following example is exactly equivalent. It is more illustrative
14810 // of the exact relationship between the menus and items (keeping in
14811 // mind that the 'link' element defines a new menu that is linked to the
14812 // containing one). The style of the second example is more verbose and
14813 // difficult to read (and therefore not recommended except for the
14814 // purpose of understanding what is really going on).
14816 // <informalexample><programlisting><![CDATA[
14817 // <menu id='edit-menu'>
14818 // <item>
14819 // <link name='section'>
14820 // <item label='Undo'/>
14821 // <item label='Redo'/>
14822 // </link>
14823 // </item>
14824 // <item>
14825 // <link name='section'>
14826 // <item label='Cut'/>
14827 // <item label='Copy'/>
14828 // <item label='Paste'/>
14829 // </link>
14830 // </item>
14831 // </menu>
14832 // ]]></programlisting></informalexample>
14833 // RETURNS: a new #GMenuItem
14834 // <label>: the section label, or %NULL
14835 // <section>: a #GMenuModel with the items of the section
14836 static MenuItem* /*new*/ new_section()(char* label, MenuModel* section) {
14837 return g_menu_item_new_section(label, section);
14840 // VERSION: 2.32
14841 // Creates a new #GMenuItem representing a submenu.
14843 // This is a convenience API around g_menu_item_new() and
14844 // g_menu_item_set_submenu().
14845 // RETURNS: a new #GMenuItem
14846 // <label>: the section label, or %NULL
14847 // <submenu>: a #GMenuModel with the items of the submenu
14848 static MenuItem* /*new*/ new_submenu()(char* label, MenuModel* submenu) {
14849 return g_menu_item_new_submenu(label, submenu);
14852 // Unintrospectable method: set_action_and_target() / g_menu_item_set_action_and_target()
14853 // VERSION: 2.32
14854 // Sets or unsets the "action" and "target" attributes of @menu_item.
14856 // If @action is %NULL then both the "action" and "target" attributes
14857 // are unset (and @format_string is ignored along with the positional
14858 // parameters).
14860 // If @action is non-%NULL then the "action" attribute is set.
14861 // @format_string is then inspected. If it is non-%NULL then the proper
14862 // position parameters are collected to create a #GVariant instance to
14863 // use as the target value. If it is %NULL then the positional
14864 // parameters are ignored and the "target" attribute is unset.
14866 // See also g_menu_item_set_action_and_target_value() for an equivalent
14867 // call that directly accepts a #GVariant. See
14868 // g_menu_item_set_detailed_action() for a more convenient version that
14869 // works with string-typed targets.
14871 // See also g_menu_item_set_action_and_target_value() for a
14872 // description of the semantics of the action and target attributes.
14873 // <action>: the name of the action for this item
14874 // <format_string>: a GVariant format string
14875 /+ Not available -- variadic methods unsupported - use the C function directly.
14876 alias g_menu_item_set_action_and_target set_action_and_target; // Variadic
14879 // VERSION: 2.32
14880 // Sets or unsets the "action" and "target" attributes of @menu_item.
14882 // If @action is %NULL then both the "action" and "target" attributes
14883 // are unset (and @target_value is ignored).
14885 // If @action is non-%NULL then the "action" attribute is set. The
14886 // "target" attribute is then set to the value of @target_value if it is
14887 // non-%NULL or unset otherwise.
14889 // Normal menu items (ie: not submenu, section or other custom item
14890 // types) are expected to have the "action" attribute set to identify
14891 // the action that they are associated with. The state type of the
14892 // action help to determine the disposition of the menu item. See
14893 // #GAction and #GActionGroup for an overview of actions.
14895 // In general, clicking on the menu item will result in activation of
14896 // the named action with the "target" attribute given as the parameter
14897 // to the action invocation. If the "target" attribute is not set then
14898 // the action is invoked with no parameter.
14900 // If the action has no state then the menu item is usually drawn as a
14901 // plain menu item (ie: with no additional decoration).
14903 // If the action has a boolean state then the menu item is usually drawn
14904 // as a toggle menu item (ie: with a checkmark or equivalent
14905 // indication). The item should be marked as 'toggled' or 'checked'
14906 // when the boolean state is %TRUE.
14908 // If the action has a string state then the menu item is usually drawn
14909 // as a radio menu item (ie: with a radio bullet or equivalent
14910 // indication). The item should be marked as 'selected' when the string
14911 // state is equal to the value of the @target property.
14913 // See g_menu_item_set_action_and_target() or
14914 // g_menu_item_set_detailed_action() for two equivalent calls that are
14915 // probably more convenient for most uses.
14916 // <action>: the name of the action for this item
14917 // <target_value>: a #GVariant to use as the action target
14918 void set_action_and_target_value()(char* action=null, GLib2.Variant* target_value=null) {
14919 g_menu_item_set_action_and_target_value(&this, action, target_value);
14922 // Unintrospectable method: set_attribute() / g_menu_item_set_attribute()
14923 // VERSION: 2.32
14924 // Sets or unsets an attribute on @menu_item.
14926 // The attribute to set or unset is specified by @attribute. This
14927 // can be one of the standard attribute names %G_MENU_ATTRIBUTE_LABEL,
14928 // %G_MENU_ATTRIBUTE_ACTION, %G_MENU_ATTRIBUTE_TARGET, or a custom
14929 // attribute name.
14930 // Attribute names are restricted to lowercase characters, numbers
14931 // and '-'. Furthermore, the names must begin with a lowercase character,
14932 // must not end with a '-', and must not contain consecutive dashes.
14934 // If @format_string is non-%NULL then the proper position parameters
14935 // are collected to create a #GVariant instance to use as the attribute
14936 // value. If it is %NULL then the positional parameterrs are ignored
14937 // and the named attribute is unset.
14939 // See also g_menu_item_set_attribute_value() for an equivalent call
14940 // that directly accepts a #GVariant.
14941 // <attribute>: the attribute to set
14942 // <format_string>: a #GVariant format string, or %NULL
14943 /+ Not available -- variadic methods unsupported - use the C function directly.
14944 alias g_menu_item_set_attribute set_attribute; // Variadic
14947 // VERSION: 2.32
14948 // Sets or unsets an attribute on @menu_item.
14950 // The attribute to set or unset is specified by @attribute. This
14951 // can be one of the standard attribute names %G_MENU_ATTRIBUTE_LABEL,
14952 // %G_MENU_ATTRIBUTE_ACTION, %G_MENU_ATTRIBUTE_TARGET, or a custom
14953 // attribute name.
14954 // Attribute names are restricted to lowercase characters, numbers
14955 // and '-'. Furthermore, the names must begin with a lowercase character,
14956 // must not end with a '-', and must not contain consecutive dashes.
14958 // must consist only of lowercase
14959 // ASCII characters, digits and '-'.
14961 // If @value is non-%NULL then it is used as the new value for the
14962 // attribute. If @value is %NULL then the attribute is unset. If
14963 // the @value #GVariant is floating, it is consumed.
14965 // See also g_menu_item_set_attribute() for a more convenient way to do
14966 // the same.
14967 // <attribute>: the attribute to set
14968 // <value>: a #GVariant to use as the value, or %NULL
14969 void set_attribute_value()(char* attribute, GLib2.Variant* value=null) {
14970 g_menu_item_set_attribute_value(&this, attribute, value);
14973 // VERSION: 2.32
14974 // Sets the "action" and possibly the "target" attribute of @menu_item.
14976 // If @detailed_action contains a double colon ("::") then it is used as
14977 // a separator between an action name and a target string. In this
14978 // case, this call is equivalent to calling
14979 // g_menu_item_set_action_and_target() with the part before the "::" and
14980 // g_menu_item_set_target_value() with a string-type #GVariant
14981 // containing the part following the "::".
14983 // If @detailed_action doesn't contain "::" then the action is set to
14984 // the given string (verbatim) and the target value is unset.
14986 // See g_menu_item_set_action_and_target() or
14987 // g_menu_item_set_action_and_target_value() for more flexible (but
14988 // slightly less convenient) alternatives.
14990 // See also g_menu_set_action_and_target_value() for a description of
14991 // the semantics of the action and target attributes.
14992 // <detailed_action>: the "detailed" action string
14993 void set_detailed_action()(char* detailed_action) {
14994 g_menu_item_set_detailed_action(&this, detailed_action);
14997 // VERSION: 2.32
14998 // Sets or unsets the "label" attribute of @menu_item.
15000 // If @label is non-%NULL it is used as the label for the menu item. If
15001 // it is %NULL then the label attribute is unset.
15002 // <label>: the label to set, or %NULL to unset
15003 void set_label()(char* label=null) {
15004 g_menu_item_set_label(&this, label);
15007 // VERSION: 2.32
15008 // Creates a link from @menu_item to @model if non-%NULL, or unsets it.
15010 // Links are used to establish a relationship between a particular menu
15011 // item and another menu. For example, %G_MENU_LINK_SUBMENU is used to
15012 // associate a submenu with a particular menu item, and %G_MENU_LINK_SECTION
15013 // is used to create a section. Other types of link can be used, but there
15014 // is no guarantee that clients will be able to make sense of them.
15015 // Link types are restricted to lowercase characters, numbers
15016 // and '-'. Furthermore, the names must begin with a lowercase character,
15017 // must not end with a '-', and must not contain consecutive dashes.
15018 // <link>: type of link to establish or unset
15019 // <model>: the #GMenuModel to link to (or %NULL to unset)
15020 void set_link()(char* link, MenuModel* model=null) {
15021 g_menu_item_set_link(&this, link, model);
15024 // VERSION: 2.32
15025 // Sets or unsets the "section" link of @menu_item to @section.
15027 // The effect of having one menu appear as a section of another is
15028 // exactly as it sounds: the items from @section become a direct part of
15029 // the menu that @menu_item is added to. See g_menu_item_new_section()
15030 // for more information about what it means for a menu item to be a
15031 // section.
15032 // <section>: a #GMenuModel, or %NULL
15033 void set_section()(MenuModel* section=null) {
15034 g_menu_item_set_section(&this, section);
15037 // VERSION: 2.32
15038 // Sets or unsets the "submenu" link of @menu_item to @submenu.
15040 // If @submenu is non-%NULL, it is linked to. If it is %NULL then the
15041 // link is unset.
15043 // The effect of having one menu appear as a submenu of another is
15044 // exactly as it sounds.
15045 // <submenu>: a #GMenuModel, or %NULL
15046 void set_submenu()(MenuModel* submenu=null) {
15047 g_menu_item_set_submenu(&this, submenu);
15052 // #GMenuLinkIter is an opaque structure type. You must access it using
15053 // the functions below.
15054 struct MenuLinkIter /* : GObject.Object */ /* Version 2.32 */ {
15055 alias parent_instance this;
15056 alias parent_instance super_;
15057 alias parent_instance object;
15058 GObject2.Object parent_instance;
15059 MenuLinkIterPrivate* priv;
15062 // VERSION: 2.32
15063 // Gets the name of the link at the current iterator position.
15065 // The iterator is not advanced.
15066 // RETURNS: the type of the link
15067 char* get_name()() {
15068 return g_menu_link_iter_get_name(&this);
15071 // VERSION: 2.32
15072 // This function combines g_menu_link_iter_next() with
15073 // g_menu_link_iter_get_name() and g_menu_link_iter_get_value().
15075 // First the iterator is advanced to the next (possibly first) link.
15076 // If that fails, then %FALSE is returned and there are no other effects.
15078 // If successful, @out_link and @value are set to the name and #GMenuModel
15079 // of the link that has just been advanced to. At this point,
15080 // g_menu_item_get_name() and g_menu_item_get_value() will return the
15081 // same values again.
15083 // The value returned in @out_link remains valid for as long as the iterator
15084 // remains at the current position. The value returned in @value must
15085 // be unreffed using g_object_unref() when it is no longer in use.
15086 // RETURNS: %TRUE on success, or %FALSE if there is no additional link
15087 // <out_link>: the name of the link
15088 // <value>: the linked #GMenuModel
15089 int get_next()(/*out*/ char** out_link=null, /*out*/ MenuModel** value=null) {
15090 return g_menu_link_iter_get_next(&this, out_link, value);
15093 // VERSION: 2.32
15094 // Gets the linked #GMenuModel at the current iterator position.
15096 // The iterator is not advanced.
15097 // RETURNS: the #GMenuModel that is linked to
15098 MenuModel* /*new*/ get_value()() {
15099 return g_menu_link_iter_get_value(&this);
15102 // VERSION: 2.32
15103 // Attempts to advance the iterator to the next (possibly first)
15104 // link.
15106 // %TRUE is returned on success, or %FALSE if there are no more links.
15108 // You must call this function when you first acquire the iterator to
15109 // advance it to the first link (and determine if the first link exists
15110 // at all).
15111 // RETURNS: %TRUE on success, or %FALSE when there are no more links
15112 int next()() {
15113 return g_menu_link_iter_next(&this);
15117 struct MenuLinkIterClass {
15118 GObject2.ObjectClass parent_class;
15120 // RETURNS: %TRUE on success, or %FALSE if there is no additional link
15121 // <value>: the linked #GMenuModel
15122 extern (C) int function (MenuLinkIter* iter, char** out_name, /*out*/ MenuModel** value=null) get_next;
15125 struct MenuLinkIterPrivate {
15129 // #GMenuModel represents the contents of a menu -- an ordered list of
15130 // menu items. The items are associated with actions, which can be
15131 // activated through them. Items can be grouped in sections, and may
15132 // have submenus associated with them. Both items and sections usually
15133 // have some representation data, such as labels or icons. The type of
15134 // the associated action (ie whether it is stateful, and what kind of
15135 // state it has) can influence the representation of the item.
15137 // The conceptual model of menus in #GMenuModel is hierarchical:
15138 // sections and submenus are again represented by #GMenuModels.
15139 // Menus themselves do not define their own roles. Rather, the role
15140 // of a particular #GMenuModel is defined by the item that references
15141 // it (or, in the case of the 'root' menu, is defined by the context
15142 // in which it is used).
15144 // As an example, consider the visible portions of the menu in
15145 // <xref linkend="menu-example"/>.
15147 // <figure id="menu-example">
15148 // <title>An example menu</title>
15149 // <graphic fileref="menu-example.png" format="PNG"></graphic>
15150 // </figure>
15152 // There are 8 "menus" visible in the screenshot: one menubar, two
15153 // submenus and 5 sections:
15154 // <itemizedlist>
15155 // <listitem>the toplevel menubar (containing 4 items)</listitem>
15156 // <listitem>the View submenu (containing 3 sections)</listitem>
15157 // <listitem>the first section of the View submenu (containing 2 items)</listitem>
15158 // <listitem>the second section of the View submenu (containing 1 item)</listitem>
15159 // <listitem>the final section of the View submenu (containing 1 item)</listitem>
15160 // <listitem>the Highlight Mode submenu (containing 2 sections)</listitem>
15161 // <listitem>the Sources section (containing 2 items)</listitem>
15162 // <listitem>the Markup section (containing 2 items)</listitem>
15163 // </itemizedlist>
15165 // <xref linkend="menu-model"/> illustrates the conceptual connection between
15166 // these 8 menus. Each large block in the figure represents a menu and the
15167 // smaller blocks within the large block represent items in that menu. Some
15168 // items contain references to other menus.
15170 // <figure id="menu-model">
15171 // <title>A menu model</title>
15172 // <graphic fileref="menu-model.png" format="PNG"></graphic>
15173 // </figure>
15175 // Notice that the separators visible in <xref linkend="menu-example"/>
15176 // appear nowhere in <xref linkend="menu-model"/>. This is because
15177 // separators are not explicitly represented in the menu model. Instead,
15178 // a separator is inserted between any two non-empty sections of a menu.
15179 // Section items can have labels just like any other item. In that case,
15180 // a display system may show a section header instead of a separator.
15182 // The motivation for this abstract model of application controls is
15183 // that modern user interfaces tend to make these controls available
15184 // outside the application. Examples include global menus, jumplists,
15185 // dash boards, etc. To support such uses, it is necessary to 'export'
15186 // information about actions and their representation in menus, which
15187 // is exactly what the
15188 // <link linkend="gio-GActionGroup-exporter">GActionGroup exporter</link>
15189 // and the
15190 // <link linkend="gio-GMenuModel-exporter">GMenuModel exporter</link>
15191 // do for #GActionGroup and #GMenuModel. The client-side counterparts
15192 // to make use of the exported information are #GDBusActionGroup and
15193 // #GDBusMenuModel.
15195 // The API of #GMenuModel is very generic, with iterators for the
15196 // attributes and links of an item, see g_menu_model_iterate_item_attributes()
15197 // and g_menu_model_iterate_item_links(). The 'standard' attributes and
15198 // link types have predefined names: %G_MENU_ATTRIBUTE_LABEL,
15199 // %G_MENU_ATTRIBUTE_ACTION, %G_MENU_ATTRIBUTE_TARGET, %G_MENU_LINK_SECTION
15200 // and %G_MENU_LINK_SUBMENU.
15202 // Items in a #GMenuModel represent active controls if they refer to
15203 // an action that can get activated when the user interacts with the
15204 // menu item. The reference to the action is encoded by the string id
15205 // in the %G_MENU_ATTRIBUTE_ACTION attribute. An action id uniquely
15206 // identifies an action in an action group. Which action group(s) provide
15207 // actions depends on the context in which the menu model is used.
15208 // E.g. when the model is exported as the application menu of a
15209 // #GtkApplication, actions can be application-wide or window-specific
15210 // (and thus come from two different action groups). By convention, the
15211 // application-wide actions have names that start with "app.", while the
15212 // names of window-specific actions start with "win.".
15214 // While a wide variety of stateful actions is possible, the following
15215 // is the minimum that is expected to be supported by all users of exported
15216 // menu information:
15217 // <itemizedlist>
15218 // <listitem>an action with no parameter type and no state</listitem>
15219 // <listitem>an action with no parameter type and boolean state</listitem>
15220 // <listitem>an action with string parameter type and string state</listitem>
15221 // </itemizedlist>
15223 // <formalpara><title>Stateless</title>
15224 // <para>
15225 // A stateless action typically corresponds to an ordinary menu item.
15226 // </para>
15227 // <para>
15228 // Selecting such a menu item will activate the action (with no parameter).
15229 // </para>
15230 // </formalpara>
15232 // <formalpara><title>Boolean State</title>
15233 // <para>
15234 // An action with a boolean state will most typically be used with a "toggle"
15235 // or "switch" menu item. The state can be set directly, but activating the
15236 // action (with no parameter) results in the state being toggled.
15237 // </para>
15238 // <para>
15239 // Selecting a toggle menu item will activate the action. The menu item should
15240 // be rendered as "checked" when the state is true.
15241 // </para>
15242 // </formalpara>
15244 // <formalpara><title>String Parameter and State</title>
15245 // <para>
15246 // Actions with string parameters and state will most typically be used to
15247 // represent an enumerated choice over the items available for a group of
15248 // radio menu items. Activating the action with a string parameter is
15249 // equivalent to setting that parameter as the state.
15250 // </para>
15251 // <para>
15252 // Radio menu items, in addition to being associated with the action, will
15253 // have a target value. Selecting that menu item will result in activation
15254 // of the action with the target value as the parameter. The menu item should
15255 // be rendered as "selected" when the state of the action is equal to the
15256 // target value of the menu item.
15257 // </para>
15258 // </formalpara>
15259 struct MenuModel /* : GObject.Object */ /* Version 2.32 */ {
15260 alias parent_instance this;
15261 alias parent_instance super_;
15262 alias parent_instance object;
15263 GObject2.Object parent_instance;
15264 MenuModelPrivate* priv;
15267 // Unintrospectable method: get_item_attribute() / g_menu_model_get_item_attribute()
15268 // VERSION: 2.32
15269 // Queries item at position @item_index in @model for the attribute
15270 // specified by @attribute.
15272 // If the attribute exists and matches the #GVariantType corresponding
15273 // to @format_string then @format_string is used to deconstruct the
15274 // value into the positional parameters and %TRUE is returned.
15276 // If the attribute does not exist, or it does exist but has the wrong
15277 // type, then the positional parameters are ignored and %FALSE is
15278 // returned.
15280 // type
15281 // RETURNS: %TRUE if the named attribute was found with the expected
15282 // <item_index>: the index of the item
15283 // <attribute>: the attribute to query
15284 // <format_string>: a #GVariant format string
15285 /+ Not available -- variadic methods unsupported - use the C function directly.
15286 alias g_menu_model_get_item_attribute get_item_attribute; // Variadic
15289 // VERSION: 2.32
15290 // Queries the item at position @item_index in @model for the attribute
15291 // specified by @attribute.
15293 // If @expected_type is non-%NULL then it specifies the expected type of
15294 // the attribute. If it is %NULL then any type will be accepted.
15296 // If the attribute exists and matches @expected_type (or if the
15297 // expected type is unspecified) then the value is returned.
15299 // If the attribute does not exist, or does not match the expected type
15300 // then %NULL is returned.
15301 // RETURNS: the value of the attribute
15302 // <item_index>: the index of the item
15303 // <attribute>: the attribute to query
15304 // <expected_type>: the expected type of the attribute, or %NULL
15305 GLib2.Variant* /*new*/ get_item_attribute_value()(int item_index, char* attribute, GLib2.VariantType* expected_type=null) {
15306 return g_menu_model_get_item_attribute_value(&this, item_index, attribute, expected_type);
15309 // VERSION: 2.32
15310 // Queries the item at position @item_index in @model for the link
15311 // specified by @link.
15313 // If the link exists, the linked #GMenuModel is returned. If the link
15314 // does not exist, %NULL is returned.
15315 // RETURNS: the linked #GMenuModel, or %NULL
15316 // <item_index>: the index of the item
15317 // <link>: the link to query
15318 MenuModel* /*new*/ get_item_link()(int item_index, char* link) {
15319 return g_menu_model_get_item_link(&this, item_index, link);
15322 // VERSION: 2.32
15323 // Query the number of items in @model.
15324 // RETURNS: the number of items
15325 int get_n_items()() {
15326 return g_menu_model_get_n_items(&this);
15329 // VERSION: 2.32
15330 // Queries if @model is mutable.
15332 // An immutable #GMenuModel will never emit the #GMenuModel::items-changed
15333 // signal. Consumers of the model may make optimisations accordingly.
15335 // emitted).
15336 // RETURNS: %TRUE if the model is mutable (ie: "items-changed" may be
15337 int is_mutable()() {
15338 return g_menu_model_is_mutable(&this);
15341 // VERSION: 2.32
15342 // Requests emission of the #GMenuModel::items-changed signal on @model.
15344 // This function should never be called except by #GMenuModel
15345 // subclasses. Any other calls to this function will very likely lead
15346 // to a violation of the interface of the model.
15348 // The implementation should update its internal representation of the
15349 // menu before emitting the signal. The implementation should further
15350 // expect to receive queries about the new state of the menu (and
15351 // particularly added menu items) while signal handlers are running.
15353 // The implementation must dispatch this call directly from a mainloop
15354 // entry and not in response to calls -- particularly those from the
15355 // #GMenuModel API. Said another way: the menu must not change while
15356 // user code is running without returning to the mainloop.
15357 // <position>: the position of the change
15358 // <removed>: the number of items removed
15359 // <added>: the number of items added
15360 void items_changed()(int position, int removed, int added) {
15361 g_menu_model_items_changed(&this, position, removed, added);
15364 // VERSION: 2.32
15365 // Creates a #GMenuAttributeIter to iterate over the attributes of
15366 // the item at position @item_index in @model.
15368 // You must free the iterator with g_object_unref() when you are done.
15369 // RETURNS: a new #GMenuAttributeIter
15370 // <item_index>: the index of the item
15371 MenuAttributeIter* /*new*/ iterate_item_attributes()(int item_index) {
15372 return g_menu_model_iterate_item_attributes(&this, item_index);
15375 // VERSION: 2.32
15376 // Creates a #GMenuLinkIter to iterate over the links of the item at
15377 // position @item_index in @model.
15379 // You must free the iterator with g_object_unref() when you are done.
15380 // RETURNS: a new #GMenuLinkIter
15381 // <item_index>: the index of the item
15382 MenuLinkIter* /*new*/ iterate_item_links()(int item_index) {
15383 return g_menu_model_iterate_item_links(&this, item_index);
15386 // Emitted when a change has occured to the menu.
15388 // The only changes that can occur to a menu is that items are removed
15389 // or added. Items may not change (except by being removed and added
15390 // back in the same location). This signal is capable of describing
15391 // both of those changes (at the same time).
15393 // The signal means that starting at the index @position, @removed
15394 // items were removed and @added items were added in their place. If
15395 // @removed is zero then only items were added. If @added is zero
15396 // then only items were removed.
15398 // As an example, if the menu contains items a, b, c, d (in that
15399 // order) and the signal (2, 1, 3) occurs then the new composition of
15400 // the menu will be a, b, _, _, _, d (with each _ representing some
15401 // new item).
15403 // Signal handlers may query the model (particularly the added items)
15404 // and expect to see the results of the modification that is being
15405 // reported. The signal is emitted after the modification.
15406 // <position>: the position of the change
15407 // <removed>: the number of items removed
15408 // <added>: the number of items added
15409 extern (C) alias static void function (MenuModel* this_, int position, int removed, int added, void* user_data=null) signal_items_changed;
15411 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
15412 return super_.signal_connect!name(cb, data, cf);
15415 ulong signal_connect(string name:"items-changed", CB:signal_items_changed)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
15416 return signal_connect_data!()(&this, cast(char*)"items-changed",
15417 cast(GObject2.Callback)cb, data, null, cf);
15421 struct MenuModelClass {
15422 GObject2.ObjectClass parent_class;
15423 // RETURNS: %TRUE if the model is mutable (ie: "items-changed" may be
15424 extern (C) int function (MenuModel* model) is_mutable;
15425 // RETURNS: the number of items
15426 extern (C) int function (MenuModel* model) get_n_items;
15427 extern (C) void function (MenuModel* model, int item_index, GLib2.HashTable** attributes) get_item_attributes;
15429 // RETURNS: a new #GMenuAttributeIter
15430 // <item_index>: the index of the item
15431 extern (C) MenuAttributeIter* /*new*/ function (MenuModel* model, int item_index) iterate_item_attributes;
15433 // RETURNS: the value of the attribute
15434 // <item_index>: the index of the item
15435 // <attribute>: the attribute to query
15436 // <expected_type>: the expected type of the attribute, or %NULL
15437 extern (C) GLib2.Variant* /*new*/ function (MenuModel* model, int item_index, char* attribute, GLib2.VariantType* expected_type=null) get_item_attribute_value;
15438 extern (C) void function (MenuModel* model, int item_index, GLib2.HashTable** links) get_item_links;
15440 // RETURNS: a new #GMenuLinkIter
15441 // <item_index>: the index of the item
15442 extern (C) MenuLinkIter* /*new*/ function (MenuModel* model, int item_index) iterate_item_links;
15444 // RETURNS: the linked #GMenuModel, or %NULL
15445 // <item_index>: the index of the item
15446 // <link>: the link to query
15447 extern (C) MenuModel* /*new*/ function (MenuModel* model, int item_index, char* link) get_item_link;
15450 struct MenuModelPrivate {
15454 // The #GMount interface represents user-visible mounts. Note, when
15455 // porting from GnomeVFS, #GMount is the moral equivalent of #GnomeVFSVolume.
15457 // #GMount is a "mounted" filesystem that you can access. Mounted is in
15458 // quotes because it's not the same as a unix mount, it might be a gvfs
15459 // mount, but you can still access the files on it if you use GIO. Might or
15460 // might not be related to a volume object.
15462 // Unmounting a #GMount instance is an asynchronous operation. For
15463 // more information about asynchronous operations, see #GAsyncReady
15464 // and #GSimpleAsyncReady. To unmount a #GMount instance, first call
15465 // g_mount_unmount_with_operation() with (at least) the #GMount instance and a
15466 // #GAsyncReadyCallback. The callback will be fired when the
15467 // operation has resolved (either with success or failure), and a
15468 // #GAsyncReady structure will be passed to the callback. That
15469 // callback should then call g_mount_unmount_with_operation_finish() with the #GMount
15470 // and the #GAsyncReady data to see if the operation was completed
15471 // successfully. If an @error is present when g_mount_unmount_with_operation_finish()
15472 // is called, then it will be filled with any error information.
15473 struct Mount /* Interface */ {
15474 mixin template __interface__() {
15475 // Checks if @mount can be eject.
15476 // RETURNS: %TRUE if the @mount can be ejected.
15477 int can_eject()() {
15478 return g_mount_can_eject(cast(Mount*)&this);
15481 // Checks if @mount can be mounted.
15482 // RETURNS: %TRUE if the @mount can be unmounted.
15483 int can_unmount()() {
15484 return g_mount_can_unmount(cast(Mount*)&this);
15487 // DEPRECATED (v2.22) method: eject - Use g_mount_eject_with_operation() instead.
15488 // Ejects a mount. This is an asynchronous operation, and is
15489 // finished by calling g_mount_eject_finish() with the @mount
15490 // and #GAsyncResult data returned in the @callback.
15491 // <flags>: flags affecting the unmount if required for eject
15492 // <cancellable>: optional #GCancellable object, %NULL to ignore.
15493 // <callback>: a #GAsyncReadyCallback, or %NULL.
15494 // <user_data>: user data passed to @callback.
15495 void eject()(MountUnmountFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
15496 g_mount_eject(cast(Mount*)&this, flags, cancellable, callback, user_data);
15499 // DEPRECATED (v2.22) method: eject_finish - Use g_mount_eject_with_operation_finish() instead.
15500 // Finishes ejecting a mount. If any errors occurred during the operation,
15501 // @error will be set to contain the errors and %FALSE will be returned.
15502 // RETURNS: %TRUE if the mount was successfully ejected. %FALSE otherwise.
15503 // <result>: a #GAsyncResult.
15504 int eject_finish()(AsyncResult* result, GLib2.Error** error=null) {
15505 return g_mount_eject_finish(cast(Mount*)&this, result, error);
15508 // VERSION: 2.22
15509 // Ejects a mount. This is an asynchronous operation, and is
15510 // finished by calling g_mount_eject_with_operation_finish() with the @mount
15511 // and #GAsyncResult data returned in the @callback.
15512 // <flags>: flags affecting the unmount if required for eject
15513 // <mount_operation>: a #GMountOperation or %NULL to avoid user interaction.
15514 // <cancellable>: optional #GCancellable object, %NULL to ignore.
15515 // <callback>: a #GAsyncReadyCallback, or %NULL.
15516 // <user_data>: user data passed to @callback.
15517 void eject_with_operation()(MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
15518 g_mount_eject_with_operation(cast(Mount*)&this, flags, mount_operation, cancellable, callback, user_data);
15521 // VERSION: 2.22
15522 // Finishes ejecting a mount. If any errors occurred during the operation,
15523 // @error will be set to contain the errors and %FALSE will be returned.
15524 // RETURNS: %TRUE if the mount was successfully ejected. %FALSE otherwise.
15525 // <result>: a #GAsyncResult.
15526 int eject_with_operation_finish()(AsyncResult* result, GLib2.Error** error=null) {
15527 return g_mount_eject_with_operation_finish(cast(Mount*)&this, result, error);
15530 // Gets the default location of @mount. The default location of the given
15531 // @mount is a path that reflects the main entry point for the user (e.g.
15532 // the home directory, or the root of the volume).
15534 // The returned object should be unreffed with
15535 // g_object_unref() when no longer needed.
15536 // RETURNS: a #GFile.
15537 File* /*new*/ get_default_location()() {
15538 return g_mount_get_default_location(cast(Mount*)&this);
15541 // Gets the drive for the @mount.
15543 // This is a convenience method for getting the #GVolume and then
15544 // using that object to get the #GDrive.
15546 // The returned object should be unreffed with
15547 // g_object_unref() when no longer needed.
15548 // RETURNS: a #GDrive or %NULL if @mount is not associated with a volume or a drive.
15549 Drive* /*new*/ get_drive()() {
15550 return g_mount_get_drive(cast(Mount*)&this);
15553 // Gets the icon for @mount.
15555 // The returned object should be unreffed with
15556 // g_object_unref() when no longer needed.
15557 // RETURNS: a #GIcon.
15558 Icon* /*new*/ get_icon()() {
15559 return g_mount_get_icon(cast(Mount*)&this);
15562 // Gets the name of @mount.
15564 // The returned string should be freed with g_free()
15565 // when no longer needed.
15566 // RETURNS: the name for the given @mount.
15567 char* /*new*/ get_name()() {
15568 return g_mount_get_name(cast(Mount*)&this);
15571 // Gets the root directory on @mount.
15573 // The returned object should be unreffed with
15574 // g_object_unref() when no longer needed.
15575 // RETURNS: a #GFile.
15576 File* /*new*/ get_root()() {
15577 return g_mount_get_root(cast(Mount*)&this);
15580 // VERSION: 2.32
15581 // Gets the sort key for @mount, if any.
15582 // RETURNS: Sorting key for @mount or %NULL if no such key is available.
15583 char* get_sort_key()() {
15584 return g_mount_get_sort_key(cast(Mount*)&this);
15587 // Gets the UUID for the @mount. The reference is typically based on
15588 // the file system UUID for the mount in question and should be
15589 // considered an opaque string. Returns %NULL if there is no UUID
15590 // available.
15592 // The returned string should be freed with g_free()
15593 // when no longer needed.
15594 // RETURNS: the UUID for @mount or %NULL if no UUID can be computed.
15595 char* /*new*/ get_uuid()() {
15596 return g_mount_get_uuid(cast(Mount*)&this);
15599 // Gets the volume for the @mount.
15601 // The returned object should be unreffed with
15602 // g_object_unref() when no longer needed.
15603 // RETURNS: a #GVolume or %NULL if @mount is not associated with a volume.
15604 Volume* /*new*/ get_volume()() {
15605 return g_mount_get_volume(cast(Mount*)&this);
15608 // VERSION: 2.18
15609 // Tries to guess the type of content stored on @mount. Returns one or
15610 // more textual identifiers of well-known content types (typically
15611 // prefixed with "x-content/"), e.g. x-content/image-dcf for camera
15612 // memory cards. See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
15613 // specification for more on x-content types.
15615 // This is an asynchronous operation (see
15616 // g_mount_guess_content_type_sync() for the synchronous version), and
15617 // is finished by calling g_mount_guess_content_type_finish() with the
15618 // @mount and #GAsyncResult data returned in the @callback.
15619 // <force_rescan>: Whether to force a rescan of the content. Otherwise a cached result will be used if available
15620 // <cancellable>: optional #GCancellable object, %NULL to ignore
15621 // <callback>: a #GAsyncReadyCallback
15622 // <user_data>: user data passed to @callback
15623 void guess_content_type()(int force_rescan, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
15624 g_mount_guess_content_type(cast(Mount*)&this, force_rescan, cancellable, callback, user_data);
15627 // VERSION: 2.18
15628 // Finishes guessing content types of @mount. If any errors occurred
15629 // during the operation, @error will be set to contain the errors and
15630 // %FALSE will be returned. In particular, you may get an
15631 // %G_IO_ERROR_NOT_SUPPORTED if the mount does not support content
15632 // guessing.
15634 // Caller should free this array with g_strfreev() when done with it.
15635 // RETURNS: a %NULL-terminated array of content types or %NULL on error.
15636 // <result>: a #GAsyncResult
15637 char** /*new*/ guess_content_type_finish()(AsyncResult* result, GLib2.Error** error=null) {
15638 return g_mount_guess_content_type_finish(cast(Mount*)&this, result, error);
15641 // VERSION: 2.18
15642 // Tries to guess the type of content stored on @mount. Returns one or
15643 // more textual identifiers of well-known content types (typically
15644 // prefixed with "x-content/"), e.g. x-content/image-dcf for camera
15645 // memory cards. See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
15646 // specification for more on x-content types.
15648 // This is an synchronous operation and as such may block doing IO;
15649 // see g_mount_guess_content_type() for the asynchronous version.
15651 // Caller should free this array with g_strfreev() when done with it.
15652 // RETURNS: a %NULL-terminated array of content types or %NULL on error.
15653 // <force_rescan>: Whether to force a rescan of the content. Otherwise a cached result will be used if available
15654 // <cancellable>: optional #GCancellable object, %NULL to ignore
15655 char** /*new*/ guess_content_type_sync()(int force_rescan, Cancellable* cancellable, GLib2.Error** error=null) {
15656 return g_mount_guess_content_type_sync(cast(Mount*)&this, force_rescan, cancellable, error);
15659 // VERSION: 2.20
15660 // Determines if @mount is shadowed. Applications or libraries should
15661 // avoid displaying @mount in the user interface if it is shadowed.
15663 // A mount is said to be shadowed if there exists one or more user
15664 // visible objects (currently #GMount objects) with a root that is
15665 // inside the root of @mount.
15667 // One application of shadow mounts is when exposing a single file
15668 // system that is used to address several logical volumes. In this
15669 // situation, a #GVolumeMonitor implementation would create two
15670 // #GVolume objects (for example, one for the camera functionality of
15671 // the device and one for a SD card reader on the device) with
15672 // activation URIs <literal>gphoto2://[usb:001,002]/store1/</literal>
15673 // and <literal>gphoto2://[usb:001,002]/store2/</literal>. When the
15674 // underlying mount (with root
15675 // <literal>gphoto2://[usb:001,002]/</literal>) is mounted, said
15676 // #GVolumeMonitor implementation would create two #GMount objects
15677 // (each with their root matching the corresponding volume activation
15678 // root) that would shadow the original mount.
15680 // The proxy monitor in GVfs 2.26 and later, automatically creates and
15681 // manage shadow mounts (and shadows the underlying mount) if the
15682 // activation root on a #GVolume is set.
15683 // RETURNS: %TRUE if @mount is shadowed.
15684 int is_shadowed()() {
15685 return g_mount_is_shadowed(cast(Mount*)&this);
15688 // Remounts a mount. This is an asynchronous operation, and is
15689 // finished by calling g_mount_remount_finish() with the @mount
15690 // and #GAsyncResults data returned in the @callback.
15692 // Remounting is useful when some setting affecting the operation
15693 // of the volume has been changed, as these may need a remount to
15694 // take affect. While this is semantically equivalent with unmounting
15695 // and then remounting not all backends might need to actually be
15696 // unmounted.
15697 // <flags>: flags affecting the operation
15698 // <mount_operation>: a #GMountOperation or %NULL to avoid user interaction.
15699 // <cancellable>: optional #GCancellable object, %NULL to ignore.
15700 // <callback>: a #GAsyncReadyCallback, or %NULL.
15701 // <user_data>: user data passed to @callback.
15702 void remount()(MountMountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
15703 g_mount_remount(cast(Mount*)&this, flags, mount_operation, cancellable, callback, user_data);
15706 // Finishes remounting a mount. If any errors occurred during the operation,
15707 // @error will be set to contain the errors and %FALSE will be returned.
15708 // RETURNS: %TRUE if the mount was successfully remounted. %FALSE otherwise.
15709 // <result>: a #GAsyncResult.
15710 int remount_finish()(AsyncResult* result, GLib2.Error** error=null) {
15711 return g_mount_remount_finish(cast(Mount*)&this, result, error);
15714 // VERSION: 2.20
15715 // Increments the shadow count on @mount. Usually used by
15716 // #GVolumeMonitor implementations when creating a shadow mount for
15717 // @mount, see g_mount_is_shadowed() for more information. The caller
15718 // will need to emit the #GMount::changed signal on @mount manually.
15719 void shadow()() {
15720 g_mount_shadow(cast(Mount*)&this);
15723 // DEPRECATED (v2.22) method: unmount - Use g_mount_unmount_with_operation() instead.
15724 // Unmounts a mount. This is an asynchronous operation, and is
15725 // finished by calling g_mount_unmount_finish() with the @mount
15726 // and #GAsyncResult data returned in the @callback.
15727 // <flags>: flags affecting the operation
15728 // <cancellable>: optional #GCancellable object, %NULL to ignore.
15729 // <callback>: a #GAsyncReadyCallback, or %NULL.
15730 // <user_data>: user data passed to @callback.
15731 void unmount()(MountUnmountFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
15732 g_mount_unmount(cast(Mount*)&this, flags, cancellable, callback, user_data);
15735 // DEPRECATED (v2.22) method: unmount_finish - Use g_mount_unmount_with_operation_finish() instead.
15736 // Finishes unmounting a mount. If any errors occurred during the operation,
15737 // @error will be set to contain the errors and %FALSE will be returned.
15738 // RETURNS: %TRUE if the mount was successfully unmounted. %FALSE otherwise.
15739 // <result>: a #GAsyncResult.
15740 int unmount_finish()(AsyncResult* result, GLib2.Error** error=null) {
15741 return g_mount_unmount_finish(cast(Mount*)&this, result, error);
15744 // VERSION: 2.22
15745 // Unmounts a mount. This is an asynchronous operation, and is
15746 // finished by calling g_mount_unmount_with_operation_finish() with the @mount
15747 // and #GAsyncResult data returned in the @callback.
15748 // <flags>: flags affecting the operation
15749 // <mount_operation>: a #GMountOperation or %NULL to avoid user interaction.
15750 // <cancellable>: optional #GCancellable object, %NULL to ignore.
15751 // <callback>: a #GAsyncReadyCallback, or %NULL.
15752 // <user_data>: user data passed to @callback.
15753 void unmount_with_operation()(MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
15754 g_mount_unmount_with_operation(cast(Mount*)&this, flags, mount_operation, cancellable, callback, user_data);
15757 // VERSION: 2.22
15758 // Finishes unmounting a mount. If any errors occurred during the operation,
15759 // @error will be set to contain the errors and %FALSE will be returned.
15760 // RETURNS: %TRUE if the mount was successfully unmounted. %FALSE otherwise.
15761 // <result>: a #GAsyncResult.
15762 int unmount_with_operation_finish()(AsyncResult* result, GLib2.Error** error=null) {
15763 return g_mount_unmount_with_operation_finish(cast(Mount*)&this, result, error);
15766 // VERSION: 2.20
15767 // Decrements the shadow count on @mount. Usually used by
15768 // #GVolumeMonitor implementations when destroying a shadow mount for
15769 // @mount, see g_mount_is_shadowed() for more information. The caller
15770 // will need to emit the #GMount::changed signal on @mount manually.
15771 void unshadow()() {
15772 g_mount_unshadow(cast(Mount*)&this);
15774 // Emitted when the mount has been changed.
15775 extern (C) alias static void function (Mount* this_, void* user_data=null) signal_changed;
15777 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
15778 return super_.signal_connect!name(cb, data, cf);
15781 ulong signal_connect(string name:"changed", CB:signal_changed)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
15782 return signal_connect_data!()(&this, cast(char*)"changed",
15783 cast(GObject2.Callback)cb, data, null, cf);
15786 // VERSION: 2.22
15787 // This signal is emitted when the #GMount is about to be
15788 // unmounted.
15789 extern (C) alias static void function (Mount* this_, void* user_data=null) signal_pre_unmount;
15790 ulong signal_connect(string name:"pre-unmount", CB:signal_pre_unmount)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
15791 return signal_connect_data!()(&this, cast(char*)"pre-unmount",
15792 cast(GObject2.Callback)cb, data, null, cf);
15795 // This signal is emitted when the #GMount have been
15796 // unmounted. If the recipient is holding references to the
15797 // object they should release them so the object can be
15798 // finalized.
15799 extern (C) alias static void function (Mount* this_, void* user_data=null) signal_unmounted;
15800 ulong signal_connect(string name:"unmounted", CB:signal_unmounted)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
15801 return signal_connect_data!()(&this, cast(char*)"unmounted",
15802 cast(GObject2.Callback)cb, data, null, cf);
15805 mixin __interface__;
15808 // Interface for implementing operations for mounts.
15809 struct MountIface {
15810 GObject2.TypeInterface g_iface;
15811 extern (C) void function (Mount* mount) changed;
15812 extern (C) void function (Mount* mount) unmounted;
15813 // RETURNS: a #GFile.
15814 extern (C) File* /*new*/ function (Mount* mount) get_root;
15815 // RETURNS: the name for the given @mount.
15816 extern (C) char* /*new*/ function (Mount* mount) get_name;
15817 // RETURNS: a #GIcon.
15818 extern (C) Icon* /*new*/ function (Mount* mount) get_icon;
15819 // RETURNS: the UUID for @mount or %NULL if no UUID can be computed.
15820 extern (C) char* /*new*/ function (Mount* mount) get_uuid;
15821 // RETURNS: a #GVolume or %NULL if @mount is not associated with a volume.
15822 extern (C) Volume* /*new*/ function (Mount* mount) get_volume;
15823 // RETURNS: a #GDrive or %NULL if @mount is not associated with a volume or a drive.
15824 extern (C) Drive* /*new*/ function (Mount* mount) get_drive;
15825 // RETURNS: %TRUE if the @mount can be unmounted.
15826 extern (C) int function (Mount* mount) can_unmount;
15827 // RETURNS: %TRUE if the @mount can be ejected.
15828 extern (C) int function (Mount* mount) can_eject;
15830 // <flags>: flags affecting the operation
15831 // <cancellable>: optional #GCancellable object, %NULL to ignore.
15832 // <callback>: a #GAsyncReadyCallback, or %NULL.
15833 // <user_data>: user data passed to @callback.
15834 extern (C) void function (Mount* mount, MountUnmountFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) unmount;
15836 // RETURNS: %TRUE if the mount was successfully unmounted. %FALSE otherwise.
15837 // <result>: a #GAsyncResult.
15838 extern (C) int function (Mount* mount, AsyncResult* result, GLib2.Error** error=null) unmount_finish;
15840 // <flags>: flags affecting the unmount if required for eject
15841 // <cancellable>: optional #GCancellable object, %NULL to ignore.
15842 // <callback>: a #GAsyncReadyCallback, or %NULL.
15843 // <user_data>: user data passed to @callback.
15844 extern (C) void function (Mount* mount, MountUnmountFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) eject;
15846 // RETURNS: %TRUE if the mount was successfully ejected. %FALSE otherwise.
15847 // <result>: a #GAsyncResult.
15848 extern (C) int function (Mount* mount, AsyncResult* result, GLib2.Error** error=null) eject_finish;
15850 // <flags>: flags affecting the operation
15851 // <mount_operation>: a #GMountOperation or %NULL to avoid user interaction.
15852 // <cancellable>: optional #GCancellable object, %NULL to ignore.
15853 // <callback>: a #GAsyncReadyCallback, or %NULL.
15854 // <user_data>: user data passed to @callback.
15855 extern (C) void function (Mount* mount, MountMountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) remount;
15857 // RETURNS: %TRUE if the mount was successfully remounted. %FALSE otherwise.
15858 // <result>: a #GAsyncResult.
15859 extern (C) int function (Mount* mount, AsyncResult* result, GLib2.Error** error=null) remount_finish;
15861 // <force_rescan>: Whether to force a rescan of the content. Otherwise a cached result will be used if available
15862 // <cancellable>: optional #GCancellable object, %NULL to ignore
15863 // <callback>: a #GAsyncReadyCallback
15864 // <user_data>: user data passed to @callback
15865 extern (C) void function (Mount* mount, int force_rescan, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) guess_content_type;
15867 // RETURNS: a %NULL-terminated array of content types or %NULL on error.
15868 // <result>: a #GAsyncResult
15869 extern (C) char** /*new*/ function (Mount* mount, AsyncResult* result, GLib2.Error** error=null) guess_content_type_finish;
15871 // RETURNS: a %NULL-terminated array of content types or %NULL on error.
15872 // <force_rescan>: Whether to force a rescan of the content. Otherwise a cached result will be used if available
15873 // <cancellable>: optional #GCancellable object, %NULL to ignore
15874 extern (C) char** /*new*/ function (Mount* mount, int force_rescan, Cancellable* cancellable, GLib2.Error** error=null) guess_content_type_sync;
15875 extern (C) void function (Mount* mount) pre_unmount;
15877 // <flags>: flags affecting the operation
15878 // <mount_operation>: a #GMountOperation or %NULL to avoid user interaction.
15879 // <cancellable>: optional #GCancellable object, %NULL to ignore.
15880 // <callback>: a #GAsyncReadyCallback, or %NULL.
15881 // <user_data>: user data passed to @callback.
15882 extern (C) void function (Mount* mount, MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) unmount_with_operation;
15884 // RETURNS: %TRUE if the mount was successfully unmounted. %FALSE otherwise.
15885 // <result>: a #GAsyncResult.
15886 extern (C) int function (Mount* mount, AsyncResult* result, GLib2.Error** error=null) unmount_with_operation_finish;
15888 // <flags>: flags affecting the unmount if required for eject
15889 // <mount_operation>: a #GMountOperation or %NULL to avoid user interaction.
15890 // <cancellable>: optional #GCancellable object, %NULL to ignore.
15891 // <callback>: a #GAsyncReadyCallback, or %NULL.
15892 // <user_data>: user data passed to @callback.
15893 extern (C) void function (Mount* mount, MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) eject_with_operation;
15895 // RETURNS: %TRUE if the mount was successfully ejected. %FALSE otherwise.
15896 // <result>: a #GAsyncResult.
15897 extern (C) int function (Mount* mount, AsyncResult* result, GLib2.Error** error=null) eject_with_operation_finish;
15898 // RETURNS: a #GFile.
15899 extern (C) File* /*new*/ function (Mount* mount) get_default_location;
15900 // RETURNS: Sorting key for @mount or %NULL if no such key is available.
15901 extern (C) char* function (Mount* mount) get_sort_key;
15904 // Flags used when mounting a mount.
15905 enum MountMountFlags {
15906 NONE = 0
15909 // #GMountOperation provides a mechanism for interacting with the user.
15910 // It can be used for authenticating mountable operations, such as loop
15911 // mounting files, hard drive partitions or server locations. It can
15912 // also be used to ask the user questions or show a list of applications
15913 // preventing unmount or eject operations from completing.
15915 // Note that #GMountOperation is used for more than just #GMount
15916 // objects – for example it is also used in g_drive_start() and
15917 // g_drive_stop().
15919 // Users should instantiate a subclass of this that implements all the
15920 // various callbacks to show the required dialogs, such as
15921 // #GtkMountOperation. If no user interaction is desired (for example
15922 // when automounting filesystems at login time), usually %NULL can be
15923 // passed, see each method taking a #GMountOperation for details.
15924 struct MountOperation /* : GObject.Object */ {
15925 alias parent_instance this;
15926 alias parent_instance super_;
15927 alias parent_instance object;
15928 GObject2.Object parent_instance;
15929 MountOperationPrivate* priv;
15932 // Creates a new mount operation.
15933 // RETURNS: a #GMountOperation.
15934 static MountOperation* /*new*/ new_()() {
15935 return g_mount_operation_new();
15938 // Check to see whether the mount operation is being used
15939 // for an anonymous user.
15940 // RETURNS: %TRUE if mount operation is anonymous.
15941 int get_anonymous()() {
15942 return g_mount_operation_get_anonymous(&this);
15945 // Gets a choice from the mount operation.
15947 // the choice's list, or %0.
15948 // RETURNS: an integer containing an index of the user's choice from
15949 int get_choice()() {
15950 return g_mount_operation_get_choice(&this);
15953 // Gets the domain of the mount operation.
15954 // RETURNS: a string set to the domain.
15955 char* get_domain()() {
15956 return g_mount_operation_get_domain(&this);
15959 // Gets a password from the mount operation.
15960 // RETURNS: a string containing the password within @op.
15961 char* get_password()() {
15962 return g_mount_operation_get_password(&this);
15965 // Gets the state of saving passwords for the mount operation.
15966 // RETURNS: a #GPasswordSave flag.
15967 PasswordSave get_password_save()() {
15968 return g_mount_operation_get_password_save(&this);
15971 // Get the user name from the mount operation.
15972 // RETURNS: a string containing the user name.
15973 char* get_username()() {
15974 return g_mount_operation_get_username(&this);
15977 // Emits the #GMountOperation::reply signal.
15978 // <result>: a #GMountOperationResult
15979 void reply()(MountOperationResult result) {
15980 g_mount_operation_reply(&this, result);
15983 // Sets the mount operation to use an anonymous user if @anonymous is %TRUE.
15984 // <anonymous>: boolean value.
15985 void set_anonymous()(int anonymous) {
15986 g_mount_operation_set_anonymous(&this, anonymous);
15989 // Sets a default choice for the mount operation.
15990 // <choice>: an integer.
15991 void set_choice()(int choice) {
15992 g_mount_operation_set_choice(&this, choice);
15995 // Sets the mount operation's domain.
15996 // <domain>: the domain to set.
15997 void set_domain()(char* domain) {
15998 g_mount_operation_set_domain(&this, domain);
16001 // Sets the mount operation's password to @password.
16002 // <password>: password to set.
16003 void set_password()(char* password) {
16004 g_mount_operation_set_password(&this, password);
16007 // Sets the state of saving passwords for the mount operation.
16008 // <save>: a set of #GPasswordSave flags.
16009 void set_password_save()(PasswordSave save) {
16010 g_mount_operation_set_password_save(&this, save);
16013 // Sets the user name within @op to @username.
16014 // <username>: input username.
16015 void set_username()(char* username) {
16016 g_mount_operation_set_username(&this, username);
16019 // VERSION: 2.20
16020 // Emitted by the backend when e.g. a device becomes unavailable
16021 // while a mount operation is in progress.
16023 // Implementations of GMountOperation should handle this signal
16024 // by dismissing open password dialogs.
16025 extern (C) alias static void function (MountOperation* this_, void* user_data=null) signal_aborted;
16027 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
16028 return super_.signal_connect!name(cb, data, cf);
16031 ulong signal_connect(string name:"aborted", CB:signal_aborted)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
16032 return signal_connect_data!()(&this, cast(char*)"aborted",
16033 cast(GObject2.Callback)cb, data, null, cf);
16036 // Emitted when a mount operation asks the user for a password.
16038 // If the message contains a line break, the first line should be
16039 // presented as a heading. For example, it may be used as the
16040 // primary text in a #GtkMessageDialog.
16041 // <message>: string containing a message to display to the user.
16042 // <default_user>: string containing the default user name.
16043 // <default_domain>: string containing the default domain.
16044 // <flags>: a set of #GAskPasswordFlags.
16045 extern (C) alias static void function (MountOperation* this_, char* message, char* default_user, char* default_domain, AskPasswordFlags* flags, void* user_data=null) signal_ask_password;
16046 ulong signal_connect(string name:"ask-password", CB:signal_ask_password)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
16047 return signal_connect_data!()(&this, cast(char*)"ask-password",
16048 cast(GObject2.Callback)cb, data, null, cf);
16051 // Emitted when asking the user a question and gives a list of
16052 // choices for the user to choose from.
16054 // If the message contains a line break, the first line should be
16055 // presented as a heading. For example, it may be used as the
16056 // primary text in a #GtkMessageDialog.
16057 // <message>: string containing a message to display to the user.
16058 // <choices>: an array of strings for each possible choice.
16059 extern (C) alias static void function (MountOperation* this_, char* message, char* choices, void* user_data=null) signal_ask_question;
16060 ulong signal_connect(string name:"ask-question", CB:signal_ask_question)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
16061 return signal_connect_data!()(&this, cast(char*)"ask-question",
16062 cast(GObject2.Callback)cb, data, null, cf);
16065 // Emitted when the user has replied to the mount operation.
16066 // <result>: a #GMountOperationResult indicating how the request was handled
16067 extern (C) alias static void function (MountOperation* this_, MountOperationResult* result, void* user_data=null) signal_reply;
16068 ulong signal_connect(string name:"reply", CB:signal_reply)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
16069 return signal_connect_data!()(&this, cast(char*)"reply",
16070 cast(GObject2.Callback)cb, data, null, cf);
16073 // VERSION: 2.22
16074 // Emitted when one or more processes are blocking an operation
16075 // e.g. unmounting/ejecting a #GMount or stopping a #GDrive.
16077 // Note that this signal may be emitted several times to update the
16078 // list of blocking processes as processes close files. The
16079 // application should only respond with g_mount_operation_reply() to
16080 // the latest signal (setting #GMountOperation:choice to the choice
16081 // the user made).
16083 // If the message contains a line break, the first line should be
16084 // presented as a heading. For example, it may be used as the
16085 // primary text in a #GtkMessageDialog.
16086 // <message>: string containing a message to display to the user.
16087 // <processes>: an array of #GPid for processes blocking the operation.
16088 // <choices>: an array of strings for each possible choice.
16089 extern (C) alias static void function (MountOperation* this_, char* message, GLib2.Pid* processes, char* choices, void* user_data=null) signal_show_processes;
16090 ulong signal_connect(string name:"show-processes", CB:signal_show_processes)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
16091 return signal_connect_data!()(&this, cast(char*)"show-processes",
16092 cast(GObject2.Callback)cb, data, null, cf);
16096 struct MountOperationClass {
16097 GObject2.ObjectClass parent_class;
16098 extern (C) void function (MountOperation* op, char* message, char* default_user, char* default_domain, AskPasswordFlags flags) ask_password;
16099 extern (C) void function (MountOperation* op, char* message, char* choices) ask_question;
16100 // <result>: a #GMountOperationResult
16101 extern (C) void function (MountOperation* op, MountOperationResult result) reply;
16102 extern (C) void function (MountOperation* op) aborted;
16103 extern (C) void function (MountOperation* op, char* message, Array* processes, char* choices) show_processes;
16104 extern (C) void function () _g_reserved1;
16105 extern (C) void function () _g_reserved2;
16106 extern (C) void function () _g_reserved3;
16107 extern (C) void function () _g_reserved4;
16108 extern (C) void function () _g_reserved5;
16109 extern (C) void function () _g_reserved6;
16110 extern (C) void function () _g_reserved7;
16111 extern (C) void function () _g_reserved8;
16112 extern (C) void function () _g_reserved9;
16113 extern (C) void function () _g_reserved10;
16116 struct MountOperationPrivate {
16120 // #GMountOperationResult is returned as a result when a request for
16121 // information is send by the mounting operation.
16122 enum MountOperationResult {
16123 HANDLED = 0,
16124 ABORTED = 1,
16125 UNHANDLED = 2
16127 // Flags used when an unmounting a mount.
16128 enum MountUnmountFlags {
16129 NONE = 0,
16130 FORCE = 1
16132 enum NATIVE_VOLUME_MONITOR_EXTENSION_POINT_NAME = "gio-native-volume-monitor";
16133 enum NETWORK_MONITOR_EXTENSION_POINT_NAME = "gio-network-monitor";
16134 struct NativeVolumeMonitor /* : VolumeMonitor */ {
16135 alias parent_instance this;
16136 alias parent_instance super_;
16137 alias parent_instance volumemonitor;
16138 VolumeMonitor parent_instance;
16141 struct NativeVolumeMonitorClass {
16142 VolumeMonitorClass parent_class;
16143 // Unintrospectable functionp: get_mount_for_mount_path() / ()
16144 extern (C) Mount* function (char* mount_path, Cancellable* cancellable) get_mount_for_mount_path;
16148 // #GNetworkAddress provides an easy way to resolve a hostname and
16149 // then attempt to connect to that host, handling the possibility of
16150 // multiple IP addresses and multiple address families.
16152 // See #GSocketConnectable for and example of using the connectable
16153 // interface.
16154 struct NetworkAddress /* : GObject.Object */ {
16155 mixin SocketConnectable.__interface__;
16156 alias parent_instance this;
16157 alias parent_instance super_;
16158 alias parent_instance object;
16159 GObject2.Object parent_instance;
16160 private NetworkAddressPrivate* priv;
16163 // VERSION: 2.22
16164 // Creates a new #GSocketConnectable for connecting to the given
16165 // @hostname and @port.
16166 // RETURNS: the new #GNetworkAddress
16167 // <hostname>: the hostname
16168 // <port>: the port
16169 static NetworkAddress* /*new*/ new_()(char* hostname, ushort port) {
16170 return g_network_address_new(hostname, port);
16173 // VERSION: 2.22
16174 // Creates a new #GSocketConnectable for connecting to the given
16175 // @hostname and @port. May fail and return %NULL in case
16176 // parsing @host_and_port fails.
16178 // @host_and_port may be in any of a number of recognised formats; an IPv6
16179 // address, an IPv4 address, or a domain name (in which case a DNS
16180 // lookup is performed). Quoting with [] is supported for all address
16181 // types. A port override may be specified in the usual way with a
16182 // colon.
16184 // If no port is specified in @host_and_port then @default_port will be
16185 // used as the port number to connect to.
16187 // In general, @host_and_port is expected to be provided by the user
16188 // (allowing them to give the hostname, and a port overide if necessary)
16189 // and @default_port is expected to be provided by the application.
16191 // (The port component of @host_and_port can also be specified as a
16192 // service name rather than as a numeric port, but this functionality
16193 // is deprecated, because it depends on the contents of /etc/services,
16194 // which is generally quite sparse on platforms other than Linux.)
16195 // RETURNS: the new #GNetworkAddress, or %NULL on error
16196 // <host_and_port>: the hostname and optionally a port
16197 // <default_port>: the default port if not in @host_and_port
16198 static SocketConnectable* /*new*/ parse()(char* host_and_port, ushort default_port, GLib2.Error** error=null) {
16199 return g_network_address_parse(host_and_port, default_port, error);
16202 // VERSION: 2.26
16203 // Creates a new #GSocketConnectable for connecting to the given
16204 // @uri. May fail and return %NULL in case parsing @uri fails.
16206 // Using this rather than g_network_address_new() or
16207 // g_network_address_parse_host() allows #GSocketClient to determine
16208 // when to use application-specific proxy protocols.
16209 // RETURNS: the new #GNetworkAddress, or %NULL on error
16210 // <uri>: the hostname and optionally a port
16211 // <default_port>: The default port if none is found in the URI
16212 static SocketConnectable* /*new*/ parse_uri()(char* uri, ushort default_port, GLib2.Error** error=null) {
16213 return g_network_address_parse_uri(uri, default_port, error);
16216 // VERSION: 2.22
16217 // Gets @addr's hostname. This might be either UTF-8 or ASCII-encoded,
16218 // depending on what @addr was created with.
16219 // RETURNS: @addr's hostname
16220 char* get_hostname()() {
16221 return g_network_address_get_hostname(&this);
16224 // VERSION: 2.22
16225 // Gets @addr's port number
16226 // RETURNS: @addr's port (which may be 0)
16227 ushort get_port()() {
16228 return g_network_address_get_port(&this);
16231 // VERSION: 2.26
16232 // Gets @addr's scheme
16233 // RETURNS: @addr's scheme (%NULL if not built from URI)
16234 char* get_scheme()() {
16235 return g_network_address_get_scheme(&this);
16239 struct NetworkAddressClass {
16240 GObject2.ObjectClass parent_class;
16243 struct NetworkAddressPrivate {
16246 struct NetworkMonitor /* Interface */ /* Version 2.32 */ {
16247 mixin template __interface__() {
16248 // VERSION: 2.32
16249 // Gets the default #GNetworkMonitor for the system.
16250 // RETURNS: a #GNetworkMonitor
16251 static NetworkMonitor* get_default()() {
16252 return g_network_monitor_get_default();
16255 // VERSION: 2.32
16256 // Attempts to determine whether or not the host pointed to by
16257 // @connectable can be reached, without actually trying to connect to
16258 // it.
16260 // This may return %TRUE even when #GNetworkMonitor:network-available
16261 // is %FALSE, if, for example, @monitor can determine that
16262 // @connectable refers to a host on a local network.
16264 // If @monitor believes that an attempt to connect to @connectable
16265 // will succeed, it will return %TRUE. Otherwise, it will return
16266 // %FALSE and set @error to an appropriate error (such as
16267 // %G_IO_ERROR_HOST_UNREACHABLE).
16269 // Note that although this does not attempt to connect to
16270 // @connectable, it may still block for a brief period of time (eg,
16271 // trying to do multicast DNS on the local network), so if you do not
16272 // want to block, you should use g_network_monitor_can_reach_async().
16273 // RETURNS: %TRUE if @connectable is reachable, %FALSE if not.
16274 // <connectable>: a #GSocketConnectable
16275 // <cancellable>: a #GCancellable, or %NULL
16276 int can_reach()(SocketConnectable* connectable, Cancellable* cancellable, GLib2.Error** error=null) {
16277 return g_network_monitor_can_reach(cast(NetworkMonitor*)&this, connectable, cancellable, error);
16279 void can_reach_async()(SocketConnectable* connectable, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
16280 g_network_monitor_can_reach_async(cast(NetworkMonitor*)&this, connectable, cancellable, callback, user_data);
16282 int can_reach_finish()(AsyncResult* result, GLib2.Error** error=null) {
16283 return g_network_monitor_can_reach_finish(cast(NetworkMonitor*)&this, result, error);
16286 // VERSION: 2.32
16287 // Checks if the network is available. "Available" here means that the
16288 // system has a default route available for at least one of IPv4 or
16289 // IPv6. It does not necessarily imply that the public Internet is
16290 // reachable. See #GNetworkMonitor:network-available for more details.
16291 // RETURNS: whether the network is available
16292 int get_network_available()() {
16293 return g_network_monitor_get_network_available(cast(NetworkMonitor*)&this);
16296 // VERSION: 2.32
16297 // Emitted when the network configuration changes. If @available is
16298 // %TRUE, then some hosts may be reachable that were not reachable
16299 // before, while others that were reachable before may no longer be
16300 // reachable. If @available is %FALSE, then no remote hosts are
16301 // reachable.
16302 // <available>: the current value of #GNetworkMonitor:network-available
16303 extern (C) alias static void function (NetworkMonitor* this_, c_int available, void* user_data=null) signal_network_changed;
16305 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
16306 return super_.signal_connect!name(cb, data, cf);
16309 ulong signal_connect(string name:"network-changed", CB:signal_network_changed)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
16310 return signal_connect_data!()(&this, cast(char*)"network-changed",
16311 cast(GObject2.Callback)cb, data, null, cf);
16314 mixin __interface__;
16317 struct NetworkMonitorInterface {
16318 GObject2.TypeInterface g_iface;
16319 extern (C) void function (NetworkMonitor* monitor, int available) network_changed;
16321 // RETURNS: %TRUE if @connectable is reachable, %FALSE if not.
16322 // <connectable>: a #GSocketConnectable
16323 // <cancellable>: a #GCancellable, or %NULL
16324 extern (C) int function (NetworkMonitor* monitor, SocketConnectable* connectable, Cancellable* cancellable, GLib2.Error** error=null) can_reach;
16325 extern (C) void function (NetworkMonitor* monitor, SocketConnectable* connectable, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) can_reach_async;
16326 extern (C) int function (NetworkMonitor* monitor, AsyncResult* result, GLib2.Error** error=null) can_reach_finish;
16330 // Like #GNetworkAddress does with hostnames, #GNetworkService
16331 // provides an easy way to resolve a SRV record, and then attempt to
16332 // connect to one of the hosts that implements that service, handling
16333 // service priority/weighting, multiple IP addresses, and multiple
16334 // address families.
16336 // See #GSrvTarget for more information about SRV records, and see
16337 // #GSocketConnectable for and example of using the connectable
16338 // interface.
16339 struct NetworkService /* : GObject.Object */ {
16340 mixin SocketConnectable.__interface__;
16341 alias parent_instance this;
16342 alias parent_instance super_;
16343 alias parent_instance object;
16344 GObject2.Object parent_instance;
16345 private NetworkServicePrivate* priv;
16348 // VERSION: 2.22
16349 // Creates a new #GNetworkService representing the given @service,
16350 // @protocol, and @domain. This will initially be unresolved; use the
16351 // #GSocketConnectable interface to resolve it.
16352 // RETURNS: a new #GNetworkService
16353 // <service>: the service type to look up (eg, "ldap")
16354 // <protocol>: the networking protocol to use for @service (eg, "tcp")
16355 // <domain>: the DNS domain to look up the service in
16356 static NetworkService* /*new*/ new_()(char* service, char* protocol, char* domain) {
16357 return g_network_service_new(service, protocol, domain);
16360 // VERSION: 2.22
16361 // Gets the domain that @srv serves. This might be either UTF-8 or
16362 // ASCII-encoded, depending on what @srv was created with.
16363 // RETURNS: @srv's domain name
16364 char* get_domain()() {
16365 return g_network_service_get_domain(&this);
16368 // VERSION: 2.22
16369 // Gets @srv's protocol name (eg, "tcp").
16370 // RETURNS: @srv's protocol name
16371 char* get_protocol()() {
16372 return g_network_service_get_protocol(&this);
16375 // VERSION: 2.26
16376 // Get's the URI scheme used to resolve proxies. By default, the service name
16377 // is used as scheme.
16378 // RETURNS: @srv's scheme name
16379 char* get_scheme()() {
16380 return g_network_service_get_scheme(&this);
16383 // VERSION: 2.22
16384 // Gets @srv's service name (eg, "ldap").
16385 // RETURNS: @srv's service name
16386 char* get_service()() {
16387 return g_network_service_get_service(&this);
16390 // VERSION: 2.26
16391 // Set's the URI scheme used to resolve proxies. By default, the service name
16392 // is used as scheme.
16393 // <scheme>: a URI scheme
16394 void set_scheme()(char* scheme) {
16395 g_network_service_set_scheme(&this, scheme);
16399 struct NetworkServiceClass {
16400 GObject2.ObjectClass parent_class;
16403 struct NetworkServicePrivate {
16407 // GOutputStream has functions to write to a stream (g_output_stream_write()),
16408 // to close a stream (g_output_stream_close()) and to flush pending writes
16409 // (g_output_stream_flush()).
16411 // To copy the content of an input stream to an output stream without
16412 // manually handling the reads and writes, use g_output_stream_splice().
16414 // All of these functions have async variants too.
16415 struct OutputStream /* : GObject.Object */ {
16416 alias parent_instance this;
16417 alias parent_instance super_;
16418 alias parent_instance object;
16419 GObject2.Object parent_instance;
16420 private OutputStreamPrivate* priv;
16422 // Clears the pending flag on @stream.
16423 void clear_pending()() {
16424 g_output_stream_clear_pending(&this);
16427 // Closes the stream, releasing resources related to it.
16429 // Once the stream is closed, all other operations will return %G_IO_ERROR_CLOSED.
16430 // Closing a stream multiple times will not return an error.
16432 // Closing a stream will automatically flush any outstanding buffers in the
16433 // stream.
16435 // Streams will be automatically closed when the last reference
16436 // is dropped, but you might want to call this function to make sure
16437 // resources are released as early as possible.
16439 // Some streams might keep the backing store of the stream (e.g. a file descriptor)
16440 // open after the stream is closed. See the documentation for the individual
16441 // stream for details.
16443 // On failure the first error that happened will be reported, but the close
16444 // operation will finish as much as possible. A stream that failed to
16445 // close will still return %G_IO_ERROR_CLOSED for all operations. Still, it
16446 // is important to check and report the error to the user, otherwise
16447 // there might be a loss of data as all data might not be written.
16449 // If @cancellable is not NULL, then the operation can be cancelled by
16450 // triggering the cancellable object from another thread. If the operation
16451 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
16452 // Cancelling a close will still leave the stream closed, but there some streams
16453 // can use a faster close that doesn't block to e.g. check errors. On
16454 // cancellation (as with any error) there is no guarantee that all written
16455 // data will reach the target.
16456 // RETURNS: %TRUE on success, %FALSE on failure
16457 // <cancellable>: optional cancellable object
16458 int close()(Cancellable* cancellable, GLib2.Error** error=null) {
16459 return g_output_stream_close(&this, cancellable, error);
16462 // Requests an asynchronous close of the stream, releasing resources
16463 // related to it. When the operation is finished @callback will be
16464 // called. You can then call g_output_stream_close_finish() to get
16465 // the result of the operation.
16467 // For behaviour details see g_output_stream_close().
16469 // The asyncronous methods have a default fallback that uses threads
16470 // to implement asynchronicity, so they are optional for inheriting
16471 // classes. However, if you override one you must override all.
16472 // <io_priority>: the io priority of the request.
16473 // <cancellable>: optional cancellable object
16474 // <callback>: callback to call when the request is satisfied
16475 // <user_data>: the data to pass to callback function
16476 void close_async()(int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
16477 g_output_stream_close_async(&this, io_priority, cancellable, callback, user_data);
16480 // Closes an output stream.
16481 // RETURNS: %TRUE if stream was successfully closed, %FALSE otherwise.
16482 // <result>: a #GAsyncResult.
16483 int close_finish()(AsyncResult* result, GLib2.Error** error=null) {
16484 return g_output_stream_close_finish(&this, result, error);
16487 // Forces a write of all user-space buffered data for the given
16488 // @stream. Will block during the operation. Closing the stream will
16489 // implicitly cause a flush.
16491 // This function is optional for inherited classes.
16493 // If @cancellable is not %NULL, then the operation can be cancelled by
16494 // triggering the cancellable object from another thread. If the operation
16495 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
16496 // RETURNS: %TRUE on success, %FALSE on error
16497 // <cancellable>: optional cancellable object
16498 int flush()(Cancellable* cancellable, GLib2.Error** error=null) {
16499 return g_output_stream_flush(&this, cancellable, error);
16502 // Forces an asynchronous write of all user-space buffered data for
16503 // the given @stream.
16504 // For behaviour details see g_output_stream_flush().
16506 // When the operation is finished @callback will be
16507 // called. You can then call g_output_stream_flush_finish() to get the
16508 // result of the operation.
16509 // <io_priority>: the io priority of the request.
16510 // <cancellable>: optional #GCancellable object, %NULL to ignore.
16511 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
16512 // <user_data>: the data to pass to callback function
16513 void flush_async()(int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
16514 g_output_stream_flush_async(&this, io_priority, cancellable, callback, user_data);
16517 // Finishes flushing an output stream.
16518 // RETURNS: %TRUE if flush operation succeeded, %FALSE otherwise.
16519 // <result>: a GAsyncResult.
16520 int flush_finish()(AsyncResult* result, GLib2.Error** error=null) {
16521 return g_output_stream_flush_finish(&this, result, error);
16524 // Checks if an ouput stream has pending actions.
16525 // RETURNS: %TRUE if @stream has pending actions.
16526 int has_pending()() {
16527 return g_output_stream_has_pending(&this);
16530 // Checks if an output stream has already been closed.
16531 // RETURNS: %TRUE if @stream is closed. %FALSE otherwise.
16532 int is_closed()() {
16533 return g_output_stream_is_closed(&this);
16536 // VERSION: 2.24
16537 // Checks if an output stream is being closed. This can be
16538 // used inside e.g. a flush implementation to see if the
16539 // flush (or other i/o operation) is called from within
16540 // the closing operation.
16541 // RETURNS: %TRUE if @stream is being closed. %FALSE otherwise.
16542 int is_closing()() {
16543 return g_output_stream_is_closing(&this);
16546 // Sets @stream to have actions pending. If the pending flag is
16547 // already set or @stream is closed, it will return %FALSE and set
16548 // @error.
16549 // RETURNS: %TRUE if pending was previously unset and is now set.
16550 int set_pending()(GLib2.Error** error=null) {
16551 return g_output_stream_set_pending(&this, error);
16554 // Splices an input stream into an output stream.
16556 // -1 if an error occurred. Note that if the number of bytes
16557 // spliced is greater than %G_MAXSSIZE, then that will be
16558 // returned, and there is no way to determine the actual number
16559 // of bytes spliced.
16560 // RETURNS: a #gssize containing the size of the data spliced, or
16561 // <source>: a #GInputStream.
16562 // <flags>: a set of #GOutputStreamSpliceFlags.
16563 // <cancellable>: optional #GCancellable object, %NULL to ignore.
16564 ssize_t splice()(InputStream* source, OutputStreamSpliceFlags flags, Cancellable* cancellable, GLib2.Error** error=null) {
16565 return g_output_stream_splice(&this, source, flags, cancellable, error);
16568 // Splices a stream asynchronously.
16569 // When the operation is finished @callback will be called.
16570 // You can then call g_output_stream_splice_finish() to get the
16571 // result of the operation.
16573 // For the synchronous, blocking version of this function, see
16574 // g_output_stream_splice().
16575 // <source>: a #GInputStream.
16576 // <flags>: a set of #GOutputStreamSpliceFlags.
16577 // <io_priority>: the io priority of the request.
16578 // <cancellable>: optional #GCancellable object, %NULL to ignore.
16579 // <callback>: a #GAsyncReadyCallback.
16580 // <user_data>: user data passed to @callback.
16581 void splice_async()(InputStream* source, OutputStreamSpliceFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
16582 g_output_stream_splice_async(&this, source, flags, io_priority, cancellable, callback, user_data);
16585 // Finishes an asynchronous stream splice operation.
16587 // number of bytes spliced is greater than %G_MAXSSIZE, then that
16588 // will be returned, and there is no way to determine the actual
16589 // number of bytes spliced.
16590 // RETURNS: a #gssize of the number of bytes spliced. Note that if the
16591 // <result>: a #GAsyncResult.
16592 ssize_t splice_finish()(AsyncResult* result, GLib2.Error** error=null) {
16593 return g_output_stream_splice_finish(&this, result, error);
16596 // Tries to write @count bytes from @buffer into the stream. Will block
16597 // during the operation.
16599 // If count is 0, returns 0 and does nothing. A value of @count
16600 // larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
16602 // On success, the number of bytes written to the stream is returned.
16603 // It is not an error if this is not the same as the requested size, as it
16604 // can happen e.g. on a partial I/O error, or if there is not enough
16605 // storage in the stream. All writes block until at least one byte
16606 // is written or an error occurs; 0 is never returned (unless
16607 // @count is 0).
16609 // If @cancellable is not NULL, then the operation can be cancelled by
16610 // triggering the cancellable object from another thread. If the operation
16611 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
16612 // operation was partially finished when the operation was cancelled the
16613 // partial result will be returned, without an error.
16615 // On error -1 is returned and @error is set accordingly.
16616 // RETURNS: Number of bytes written, or -1 on error
16617 // <buffer>: the buffer containing the data to write.
16618 // <count>: the number of bytes to write
16619 // <cancellable>: optional cancellable object
16620 ssize_t write()(ubyte* buffer, size_t count, Cancellable* cancellable, GLib2.Error** error=null) {
16621 return g_output_stream_write(&this, buffer, count, cancellable, error);
16624 // Tries to write @count bytes from @buffer into the stream. Will block
16625 // during the operation.
16627 // This function is similar to g_output_stream_write(), except it tries to
16628 // write as many bytes as requested, only stopping on an error.
16630 // On a successful write of @count bytes, %TRUE is returned, and @bytes_written
16631 // is set to @count.
16633 // If there is an error during the operation FALSE is returned and @error
16634 // is set to indicate the error status, @bytes_written is updated to contain
16635 // the number of bytes written into the stream before the error occurred.
16636 // RETURNS: %TRUE on success, %FALSE if there was an error
16637 // <buffer>: the buffer containing the data to write.
16638 // <count>: the number of bytes to write
16639 // <bytes_written>: location to store the number of bytes that was written to the stream
16640 // <cancellable>: optional #GCancellable object, %NULL to ignore.
16641 int write_all()(ubyte* buffer, size_t count, /*out*/ size_t* bytes_written, Cancellable* cancellable, GLib2.Error** error=null) {
16642 return g_output_stream_write_all(&this, buffer, count, bytes_written, cancellable, error);
16645 // Request an asynchronous write of @count bytes from @buffer into
16646 // the stream. When the operation is finished @callback will be called.
16647 // You can then call g_output_stream_write_finish() to get the result of the
16648 // operation.
16650 // During an async request no other sync and async calls are allowed,
16651 // and will result in %G_IO_ERROR_PENDING errors.
16653 // A value of @count larger than %G_MAXSSIZE will cause a
16654 // %G_IO_ERROR_INVALID_ARGUMENT error.
16656 // On success, the number of bytes written will be passed to the
16657 // @callback. It is not an error if this is not the same as the
16658 // requested size, as it can happen e.g. on a partial I/O error,
16659 // but generally we try to write as many bytes as requested.
16661 // You are guaranteed that this method will never fail with
16662 // %G_IO_ERROR_WOULD_BLOCK - if @stream can't accept more data, the
16663 // method will just wait until this changes.
16665 // Any outstanding I/O request with higher priority (lower numerical
16666 // value) will be executed before an outstanding request with lower
16667 // priority. Default priority is %G_PRIORITY_DEFAULT.
16669 // The asyncronous methods have a default fallback that uses threads
16670 // to implement asynchronicity, so they are optional for inheriting
16671 // classes. However, if you override one you must override all.
16673 // For the synchronous, blocking version of this function, see
16674 // g_output_stream_write().
16675 // <buffer>: the buffer containing the data to write.
16676 // <count>: the number of bytes to write
16677 // <io_priority>: the io priority of the request.
16678 // <cancellable>: optional #GCancellable object, %NULL to ignore.
16679 // <callback>: callback to call when the request is satisfied
16680 // <user_data>: the data to pass to callback function
16681 void write_async()(ubyte* buffer, size_t count, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
16682 g_output_stream_write_async(&this, buffer, count, io_priority, cancellable, callback, user_data);
16685 // Finishes a stream write operation.
16686 // RETURNS: a #gssize containing the number of bytes written to the stream.
16687 // <result>: a #GAsyncResult.
16688 ssize_t write_finish()(AsyncResult* result, GLib2.Error** error=null) {
16689 return g_output_stream_write_finish(&this, result, error);
16693 struct OutputStreamClass {
16694 GObject2.ObjectClass parent_class;
16696 // RETURNS: Number of bytes written, or -1 on error
16697 // <buffer>: the buffer containing the data to write.
16698 // <count>: the number of bytes to write
16699 // <cancellable>: optional cancellable object
16700 extern (C) ssize_t function (OutputStream* stream, ubyte* buffer, size_t count, Cancellable* cancellable, GLib2.Error** error=null) write_fn;
16702 // RETURNS: a #gssize containing the size of the data spliced, or
16703 // <source>: a #GInputStream.
16704 // <flags>: a set of #GOutputStreamSpliceFlags.
16705 // <cancellable>: optional #GCancellable object, %NULL to ignore.
16706 extern (C) ssize_t function (OutputStream* stream, InputStream* source, OutputStreamSpliceFlags flags, Cancellable* cancellable, GLib2.Error** error=null) splice;
16708 // RETURNS: %TRUE on success, %FALSE on error
16709 // <cancellable>: optional cancellable object
16710 extern (C) int function (OutputStream* stream, Cancellable* cancellable, GLib2.Error** error=null) flush;
16711 extern (C) int function (OutputStream* stream, Cancellable* cancellable, GLib2.Error** error=null) close_fn;
16713 // <buffer>: the buffer containing the data to write.
16714 // <count>: the number of bytes to write
16715 // <io_priority>: the io priority of the request.
16716 // <cancellable>: optional #GCancellable object, %NULL to ignore.
16717 // <callback>: callback to call when the request is satisfied
16718 // <user_data>: the data to pass to callback function
16719 extern (C) void function (OutputStream* stream, ubyte* buffer, size_t count, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) write_async;
16721 // RETURNS: a #gssize containing the number of bytes written to the stream.
16722 // <result>: a #GAsyncResult.
16723 extern (C) ssize_t function (OutputStream* stream, AsyncResult* result, GLib2.Error** error=null) write_finish;
16725 // <source>: a #GInputStream.
16726 // <flags>: a set of #GOutputStreamSpliceFlags.
16727 // <io_priority>: the io priority of the request.
16728 // <cancellable>: optional #GCancellable object, %NULL to ignore.
16729 // <callback>: a #GAsyncReadyCallback.
16730 // <user_data>: user data passed to @callback.
16731 extern (C) void function (OutputStream* stream, InputStream* source, OutputStreamSpliceFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) splice_async;
16733 // RETURNS: a #gssize of the number of bytes spliced. Note that if the
16734 // <result>: a #GAsyncResult.
16735 extern (C) ssize_t function (OutputStream* stream, AsyncResult* result, GLib2.Error** error=null) splice_finish;
16737 // <io_priority>: the io priority of the request.
16738 // <cancellable>: optional #GCancellable object, %NULL to ignore.
16739 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
16740 // <user_data>: the data to pass to callback function
16741 extern (C) void function (OutputStream* stream, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) flush_async;
16743 // RETURNS: %TRUE if flush operation succeeded, %FALSE otherwise.
16744 // <result>: a GAsyncResult.
16745 extern (C) int function (OutputStream* stream, AsyncResult* result, GLib2.Error** error=null) flush_finish;
16747 // <io_priority>: the io priority of the request.
16748 // <cancellable>: optional cancellable object
16749 // <callback>: callback to call when the request is satisfied
16750 // <user_data>: the data to pass to callback function
16751 extern (C) void function (OutputStream* stream, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) close_async;
16753 // RETURNS: %TRUE if stream was successfully closed, %FALSE otherwise.
16754 // <result>: a #GAsyncResult.
16755 extern (C) int function (OutputStream* stream, AsyncResult* result, GLib2.Error** error=null) close_finish;
16756 extern (C) void function () _g_reserved1;
16757 extern (C) void function () _g_reserved2;
16758 extern (C) void function () _g_reserved3;
16759 extern (C) void function () _g_reserved4;
16760 extern (C) void function () _g_reserved5;
16761 extern (C) void function () _g_reserved6;
16762 extern (C) void function () _g_reserved7;
16763 extern (C) void function () _g_reserved8;
16766 struct OutputStreamPrivate {
16769 // GOutputStreamSpliceFlags determine how streams should be spliced.
16770 enum OutputStreamSpliceFlags {
16771 NONE = 0,
16772 CLOSE_SOURCE = 1,
16773 CLOSE_TARGET = 2
16776 // Structure used for scatter/gather data output.
16777 // You generally pass in an array of #GOutputVector<!-- -->s
16778 // and the operation will use all the buffers as if they were
16779 // one buffer.
16780 struct OutputVector /* Version 2.22 */ {
16781 const(void)* buffer;
16782 size_t size;
16785 enum PROXY_EXTENSION_POINT_NAME = "gio-proxy";
16786 enum PROXY_RESOLVER_EXTENSION_POINT_NAME = "gio-proxy-resolver";
16788 // #GPasswordSave is used to indicate the lifespan of a saved password.
16790 // #Gvfs stores passwords in the Gnome keyring when this flag allows it
16791 // to, and later retrieves it again from there.
16792 enum PasswordSave {
16793 NEVER = 0,
16794 FOR_SESSION = 1,
16795 PERMANENTLY = 2
16798 // A #GPermission represents the status of the caller's permission to
16799 // perform a certain action.
16801 // You can query if the action is currently allowed and if it is
16802 // possible to acquire the permission so that the action will be allowed
16803 // in the future.
16805 // There is also an API to actually acquire the permission and one to
16806 // release it.
16808 // As an example, a #GPermission might represent the ability for the
16809 // user to write to a #GSettings object. This #GPermission object could
16810 // then be used to decide if it is appropriate to show a "Click here to
16811 // unlock" button in a dialog and to provide the mechanism to invoke
16812 // when that button is clicked.
16813 struct Permission /* : GObject.Object */ {
16814 alias parent_instance this;
16815 alias parent_instance super_;
16816 alias parent_instance object;
16817 GObject2.Object parent_instance;
16818 private PermissionPrivate* priv;
16821 // VERSION: 2.26
16822 // Attempts to acquire the permission represented by @permission.
16824 // The precise method by which this happens depends on the permission
16825 // and the underlying authentication mechanism. A simple example is
16826 // that a dialog may appear asking the user to enter their password.
16828 // You should check with g_permission_get_can_acquire() before calling
16829 // this function.
16831 // If the permission is acquired then %TRUE is returned. Otherwise,
16832 // %FALSE is returned and @error is set appropriately.
16834 // This call is blocking, likely for a very long time (in the case that
16835 // user interaction is required). See g_permission_acquire_async() for
16836 // the non-blocking version.
16837 // RETURNS: %TRUE if the permission was successfully acquired
16838 // <cancellable>: a #GCancellable, or %NULL
16839 int acquire()(Cancellable* cancellable, GLib2.Error** error=null) {
16840 return g_permission_acquire(&this, cancellable, error);
16843 // VERSION: 2.26
16844 // Attempts to acquire the permission represented by @permission.
16846 // This is the first half of the asynchronous version of
16847 // g_permission_acquire().
16848 // <cancellable>: a #GCancellable, or %NULL
16849 // <callback>: the #GAsyncReadyCallback to call when done
16850 // <user_data>: the user data to pass to @callback
16851 void acquire_async()(Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
16852 g_permission_acquire_async(&this, cancellable, callback, user_data);
16855 // VERSION: 2.26
16856 // Collects the result of attempting to acquire the permission
16857 // represented by @permission.
16859 // This is the second half of the asynchronous version of
16860 // g_permission_acquire().
16861 // RETURNS: %TRUE if the permission was successfully acquired
16862 // <result>: the #GAsyncResult given to the #GAsyncReadyCallback
16863 int acquire_finish()(AsyncResult* result, GLib2.Error** error=null) {
16864 return g_permission_acquire_finish(&this, result, error);
16867 // VERSION: 2.26
16868 // Gets the value of the 'allowed' property. This property is %TRUE if
16869 // the caller currently has permission to perform the action that
16870 // @permission represents the permission to perform.
16871 // RETURNS: the value of the 'allowed' property
16872 int get_allowed()() {
16873 return g_permission_get_allowed(&this);
16876 // VERSION: 2.26
16877 // Gets the value of the 'can-acquire' property. This property is %TRUE
16878 // if it is generally possible to acquire the permission by calling
16879 // g_permission_acquire().
16880 // RETURNS: the value of the 'can-acquire' property
16881 int get_can_acquire()() {
16882 return g_permission_get_can_acquire(&this);
16885 // VERSION: 2.26
16886 // Gets the value of the 'can-release' property. This property is %TRUE
16887 // if it is generally possible to release the permission by calling
16888 // g_permission_release().
16889 // RETURNS: the value of the 'can-release' property
16890 int get_can_release()() {
16891 return g_permission_get_can_release(&this);
16894 // VERSION: 2.26
16895 // This function is called by the #GPermission implementation to update
16896 // the properties of the permission. You should never call this
16897 // function except from a #GPermission implementation.
16899 // GObject notify signals are generated, as appropriate.
16900 // <allowed>: the new value for the 'allowed' property
16901 // <can_acquire>: the new value for the 'can-acquire' property
16902 // <can_release>: the new value for the 'can-release' property
16903 void impl_update()(int allowed, int can_acquire, int can_release) {
16904 g_permission_impl_update(&this, allowed, can_acquire, can_release);
16907 // VERSION: 2.26
16908 // Attempts to release the permission represented by @permission.
16910 // The precise method by which this happens depends on the permission
16911 // and the underlying authentication mechanism. In most cases the
16912 // permission will be dropped immediately without further action.
16914 // You should check with g_permission_get_can_release() before calling
16915 // this function.
16917 // If the permission is released then %TRUE is returned. Otherwise,
16918 // %FALSE is returned and @error is set appropriately.
16920 // This call is blocking, likely for a very long time (in the case that
16921 // user interaction is required). See g_permission_release_async() for
16922 // the non-blocking version.
16923 // RETURNS: %TRUE if the permission was successfully released
16924 // <cancellable>: a #GCancellable, or %NULL
16925 int release()(Cancellable* cancellable, GLib2.Error** error=null) {
16926 return g_permission_release(&this, cancellable, error);
16929 // VERSION: 2.26
16930 // Attempts to release the permission represented by @permission.
16932 // This is the first half of the asynchronous version of
16933 // g_permission_release().
16934 // <cancellable>: a #GCancellable, or %NULL
16935 // <callback>: the #GAsyncReadyCallback to call when done
16936 // <user_data>: the user data to pass to @callback
16937 void release_async()(Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
16938 g_permission_release_async(&this, cancellable, callback, user_data);
16941 // VERSION: 2.26
16942 // Collects the result of attempting to release the permission
16943 // represented by @permission.
16945 // This is the second half of the asynchronous version of
16946 // g_permission_release().
16947 // RETURNS: %TRUE if the permission was successfully released
16948 // <result>: the #GAsyncResult given to the #GAsyncReadyCallback
16949 int release_finish()(AsyncResult* result, GLib2.Error** error=null) {
16950 return g_permission_release_finish(&this, result, error);
16954 struct PermissionClass {
16955 GObject2.ObjectClass parent_class;
16957 // RETURNS: %TRUE if the permission was successfully acquired
16958 // <cancellable>: a #GCancellable, or %NULL
16959 extern (C) int function (Permission* permission, Cancellable* cancellable, GLib2.Error** error=null) acquire;
16961 // <cancellable>: a #GCancellable, or %NULL
16962 // <callback>: the #GAsyncReadyCallback to call when done
16963 // <user_data>: the user data to pass to @callback
16964 extern (C) void function (Permission* permission, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) acquire_async;
16966 // RETURNS: %TRUE if the permission was successfully acquired
16967 // <result>: the #GAsyncResult given to the #GAsyncReadyCallback
16968 extern (C) int function (Permission* permission, AsyncResult* result, GLib2.Error** error=null) acquire_finish;
16970 // RETURNS: %TRUE if the permission was successfully released
16971 // <cancellable>: a #GCancellable, or %NULL
16972 extern (C) int function (Permission* permission, Cancellable* cancellable, GLib2.Error** error=null) release;
16974 // <cancellable>: a #GCancellable, or %NULL
16975 // <callback>: the #GAsyncReadyCallback to call when done
16976 // <user_data>: the user data to pass to @callback
16977 extern (C) void function (Permission* permission, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) release_async;
16979 // RETURNS: %TRUE if the permission was successfully released
16980 // <result>: the #GAsyncResult given to the #GAsyncReadyCallback
16981 extern (C) int function (Permission* permission, AsyncResult* result, GLib2.Error** error=null) release_finish;
16982 void*[16] reserved;
16985 struct PermissionPrivate {
16989 // #GPollableInputStream is implemented by #GInputStream<!-- -->s that
16990 // can be polled for readiness to read. This can be used when
16991 // interfacing with a non-GIO API that expects
16992 // UNIX-file-descriptor-style asynchronous I/O rather than GIO-style.
16993 struct PollableInputStream /* Interface */ /* Version 2.28 */ {
16994 mixin template __interface__() {
16995 // VERSION: 2.28
16996 // Checks if @stream is actually pollable. Some classes may implement
16997 // #GPollableInputStream but have only certain instances of that class
16998 // be pollable. If this method returns %FALSE, then the behavior of
16999 // other #GPollableInputStream methods is undefined.
17001 // For any given stream, the value returned by this method is constant;
17002 // a stream cannot switch from pollable to non-pollable or vice versa.
17003 // RETURNS: %TRUE if @stream is pollable, %FALSE if not.
17004 int can_poll()() {
17005 return g_pollable_input_stream_can_poll(cast(PollableInputStream*)&this);
17008 // VERSION: 2.28
17009 // Creates a #GSource that triggers when @stream can be read, or
17010 // @cancellable is triggered or an error occurs. The callback on the
17011 // source is of the #GPollableSourceFunc type.
17013 // As with g_pollable_input_stream_is_readable(), it is possible that
17014 // the stream may not actually be readable even after the source
17015 // triggers, so you should use g_pollable_input_stream_read_nonblocking()
17016 // rather than g_input_stream_read() from the callback.
17017 // RETURNS: a new #GSource
17018 // <cancellable>: a #GCancellable, or %NULL
17019 GLib2.Source* /*new*/ create_source()(Cancellable* cancellable=null) {
17020 return g_pollable_input_stream_create_source(cast(PollableInputStream*)&this, cancellable);
17023 // VERSION: 2.28
17024 // Checks if @stream can be read.
17026 // Note that some stream types may not be able to implement this 100%
17027 // reliably, and it is possible that a call to g_input_stream_read()
17028 // after this returns %TRUE would still block. To guarantee
17029 // non-blocking behavior, you should always use
17030 // g_pollable_input_stream_read_nonblocking(), which will return a
17031 // %G_IO_ERROR_WOULD_BLOCK error rather than blocking.
17033 // has occurred on @stream, this will result in
17034 // g_pollable_input_stream_is_readable() returning %TRUE, and the
17035 // next attempt to read will return the error.
17036 // RETURNS: %TRUE if @stream is readable, %FALSE if not. If an error
17037 int is_readable()() {
17038 return g_pollable_input_stream_is_readable(cast(PollableInputStream*)&this);
17041 // Attempts to read up to @size bytes from @stream into @buffer, as
17042 // with g_input_stream_read(). If @stream is not currently readable,
17043 // this will immediately return %G_IO_ERROR_WOULD_BLOCK, and you can
17044 // use g_pollable_input_stream_create_source() to create a #GSource
17045 // that will be triggered when @stream is readable.
17047 // Note that since this method never blocks, you cannot actually
17048 // use @cancellable to cancel it. However, it will return an error
17049 // if @cancellable has already been cancelled when you call, which
17050 // may happen if you call this method after a source triggers due
17051 // to having been cancelled.
17053 // %G_IO_ERROR_WOULD_BLOCK).
17054 // RETURNS: the number of bytes read, or -1 on error (including
17055 // <buffer>: a buffer to read data into (which should be at least @size bytes long).
17056 // <size>: the number of bytes you want to read
17057 // <cancellable>: a #GCancellable, or %NULL
17058 ssize_t read_nonblocking()(void* buffer, size_t size, Cancellable* cancellable, GLib2.Error** error=null) {
17059 return g_pollable_input_stream_read_nonblocking(cast(PollableInputStream*)&this, buffer, size, cancellable, error);
17062 mixin __interface__;
17066 // The interface for pollable input streams.
17068 // The default implementation of @can_poll always returns %TRUE.
17070 // The default implementation of @read_nonblocking calls
17071 // g_pollable_input_stream_is_readable(), and then calls
17072 // g_input_stream_read() if it returns %TRUE. This means you only need
17073 // to override it if it is possible that your @is_readable
17074 // implementation may return %TRUE when the stream is not actually
17075 // readable.
17076 struct PollableInputStreamInterface /* Version 2.28 */ {
17077 GObject2.TypeInterface g_iface;
17078 // RETURNS: %TRUE if @stream is pollable, %FALSE if not.
17079 extern (C) int function (PollableInputStream* stream) can_poll;
17080 // RETURNS: %TRUE if @stream is readable, %FALSE if not. If an error
17081 extern (C) int function (PollableInputStream* stream) is_readable;
17083 // RETURNS: a new #GSource
17084 // <cancellable>: a #GCancellable, or %NULL
17085 extern (C) GLib2.Source* /*new*/ function (PollableInputStream* stream, Cancellable* cancellable=null) create_source;
17087 // RETURNS: the number of bytes read, or -1 on error (including
17088 // <buffer>: a buffer to read data into (which should be at least @size bytes long).
17089 // <size>: the number of bytes you want to read
17090 extern (C) ssize_t function (PollableInputStream* stream, void* buffer, size_t size, GLib2.Error** error=null) read_nonblocking;
17094 // #GPollableOutputStream is implemented by #GOutputStream<!-- -->s that
17095 // can be polled for readiness to write. This can be used when
17096 // interfacing with a non-GIO API that expects
17097 // UNIX-file-descriptor-style asynchronous I/O rather than GIO-style.
17098 struct PollableOutputStream /* Interface */ /* Version 2.28 */ {
17099 mixin template __interface__() {
17100 // VERSION: 2.28
17101 // Checks if @stream is actually pollable. Some classes may implement
17102 // #GPollableOutputStream but have only certain instances of that
17103 // class be pollable. If this method returns %FALSE, then the behavior
17104 // of other #GPollableOutputStream methods is undefined.
17106 // For any given stream, the value returned by this method is constant;
17107 // a stream cannot switch from pollable to non-pollable or vice versa.
17108 // RETURNS: %TRUE if @stream is pollable, %FALSE if not.
17109 int can_poll()() {
17110 return g_pollable_output_stream_can_poll(cast(PollableOutputStream*)&this);
17113 // VERSION: 2.28
17114 // Creates a #GSource that triggers when @stream can be written, or
17115 // @cancellable is triggered or an error occurs. The callback on the
17116 // source is of the #GPollableSourceFunc type.
17118 // As with g_pollable_output_stream_is_writable(), it is possible that
17119 // the stream may not actually be writable even after the source
17120 // triggers, so you should use g_pollable_output_stream_write_nonblocking()
17121 // rather than g_output_stream_write() from the callback.
17122 // RETURNS: a new #GSource
17123 // <cancellable>: a #GCancellable, or %NULL
17124 GLib2.Source* /*new*/ create_source()(Cancellable* cancellable=null) {
17125 return g_pollable_output_stream_create_source(cast(PollableOutputStream*)&this, cancellable);
17128 // VERSION: 2.28
17129 // Checks if @stream can be written.
17131 // Note that some stream types may not be able to implement this 100%
17132 // reliably, and it is possible that a call to g_output_stream_write()
17133 // after this returns %TRUE would still block. To guarantee
17134 // non-blocking behavior, you should always use
17135 // g_pollable_output_stream_write_nonblocking(), which will return a
17136 // %G_IO_ERROR_WOULD_BLOCK error rather than blocking.
17138 // has occurred on @stream, this will result in
17139 // g_pollable_output_stream_is_writable() returning %TRUE, and the
17140 // next attempt to write will return the error.
17141 // RETURNS: %TRUE if @stream is writable, %FALSE if not. If an error
17142 int is_writable()() {
17143 return g_pollable_output_stream_is_writable(cast(PollableOutputStream*)&this);
17146 // Attempts to write up to @size bytes from @buffer to @stream, as
17147 // with g_output_stream_write(). If @stream is not currently writable,
17148 // this will immediately return %G_IO_ERROR_WOULD_BLOCK, and you can
17149 // use g_pollable_output_stream_create_source() to create a #GSource
17150 // that will be triggered when @stream is writable.
17152 // Note that since this method never blocks, you cannot actually
17153 // use @cancellable to cancel it. However, it will return an error
17154 // if @cancellable has already been cancelled when you call, which
17155 // may happen if you call this method after a source triggers due
17156 // to having been cancelled.
17158 // %G_IO_ERROR_WOULD_BLOCK).
17159 // RETURNS: the number of bytes written, or -1 on error (including
17160 // <buffer>: a buffer to write data from
17161 // <size>: the number of bytes you want to write
17162 // <cancellable>: a #GCancellable, or %NULL
17163 ssize_t write_nonblocking()(ubyte* buffer, size_t size, Cancellable* cancellable, GLib2.Error** error=null) {
17164 return g_pollable_output_stream_write_nonblocking(cast(PollableOutputStream*)&this, buffer, size, cancellable, error);
17167 mixin __interface__;
17171 // The interface for pollable output streams.
17173 // The default implementation of @can_poll always returns %TRUE.
17175 // The default implementation of @write_nonblocking calls
17176 // g_pollable_output_stream_is_writable(), and then calls
17177 // g_output_stream_write() if it returns %TRUE. This means you only
17178 // need to override it if it is possible that your @is_writable
17179 // implementation may return %TRUE when the stream is not actually
17180 // writable.
17181 struct PollableOutputStreamInterface /* Version 2.28 */ {
17182 GObject2.TypeInterface g_iface;
17183 // RETURNS: %TRUE if @stream is pollable, %FALSE if not.
17184 extern (C) int function (PollableOutputStream* stream) can_poll;
17185 // RETURNS: %TRUE if @stream is writable, %FALSE if not. If an error
17186 extern (C) int function (PollableOutputStream* stream) is_writable;
17188 // RETURNS: a new #GSource
17189 // <cancellable>: a #GCancellable, or %NULL
17190 extern (C) GLib2.Source* /*new*/ function (PollableOutputStream* stream, Cancellable* cancellable=null) create_source;
17192 // RETURNS: the number of bytes written, or -1 on error (including
17193 // <buffer>: a buffer to write data from
17194 // <size>: the number of bytes you want to write
17195 extern (C) ssize_t function (PollableOutputStream* stream, ubyte* buffer, size_t size, GLib2.Error** error=null) write_nonblocking;
17199 // VERSION: 2.28
17200 // This is the function type of the callback used for the #GSource
17201 // returned by g_pollable_input_stream_create_source() and
17202 // g_pollable_output_stream_create_source().
17203 // RETURNS: it should return %FALSE if the source should be removed.
17204 // <pollable_stream>: the #GPollableInputStream or #GPollableOutputStream
17205 // <user_data>: data passed in by the user.
17206 extern (C) alias int function (GObject2.Object* pollable_stream, void* user_data) PollableSourceFunc;
17209 // A #GProxy handles connecting to a remote host via a given type of
17210 // proxy server. It is implemented by the 'gio-proxy' extension point.
17211 // The extensions are named after their proxy protocol name. As an
17212 // example, a SOCKS5 proxy implementation can be retrieved with the
17213 // name 'socks5' using the function
17214 // g_io_extension_point_get_extension_by_name().
17215 struct Proxy /* Interface */ /* Version 2.26 */ {
17216 mixin template __interface__() {
17217 // VERSION: 2.26
17218 // Lookup "gio-proxy" extension point for a proxy implementation that supports
17219 // specified protocol.
17221 // is not supported.
17222 // RETURNS: return a #GProxy or NULL if protocol
17223 // <protocol>: the proxy protocol name (e.g. http, socks, etc)
17224 static Proxy* /*new*/ get_default_for_protocol()(char* protocol) {
17225 return g_proxy_get_default_for_protocol(protocol);
17228 // VERSION: 2.26
17229 // Given @connection to communicate with a proxy (eg, a
17230 // #GSocketConnection that is connected to the proxy server), this
17231 // does the necessary handshake to connect to @proxy_address, and if
17232 // required, wraps the #GIOStream to handle proxy payload.
17234 // be the same as @connection, in which case a reference
17235 // will be added.
17236 // RETURNS: a #GIOStream that will replace @connection. This might
17237 // <connection>: a #GIOStream
17238 // <proxy_address>: a #GProxyAddress
17239 // <cancellable>: a #GCancellable
17240 IOStream* /*new*/ connect()(IOStream* connection, ProxyAddress* proxy_address, Cancellable* cancellable, GLib2.Error** error=null) {
17241 return g_proxy_connect(cast(Proxy*)&this, connection, proxy_address, cancellable, error);
17244 // VERSION: 2.26
17245 // Asynchronous version of g_proxy_connect().
17246 // <connection>: a #GIOStream
17247 // <proxy_address>: a #GProxyAddress
17248 // <cancellable>: a #GCancellable
17249 // <callback>: a #GAsyncReadyCallback
17250 // <user_data>: callback data
17251 void connect_async()(IOStream* connection, ProxyAddress* proxy_address, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
17252 g_proxy_connect_async(cast(Proxy*)&this, connection, proxy_address, cancellable, callback, user_data);
17255 // VERSION: 2.26
17256 // See g_proxy_connect().
17257 // RETURNS: a #GIOStream.
17258 // <result>: a #GAsyncResult
17259 IOStream* /*new*/ connect_finish()(AsyncResult* result, GLib2.Error** error=null) {
17260 return g_proxy_connect_finish(cast(Proxy*)&this, result, error);
17263 // VERSION: 2.26
17264 // Some proxy protocols expect to be passed a hostname, which they
17265 // will resolve to an IP address themselves. Others, like SOCKS4, do
17266 // not allow this. This function will return %FALSE if @proxy is
17267 // implementing such a protocol. When %FALSE is returned, the caller
17268 // should resolve the destination hostname first, and then pass a
17269 // #GProxyAddress containing the stringified IP address to
17270 // g_proxy_connect() or g_proxy_connect_async().
17271 // RETURNS: %TRUE if hostname resolution is supported.
17272 int supports_hostname()() {
17273 return g_proxy_supports_hostname(cast(Proxy*)&this);
17276 mixin __interface__;
17279 // Support for proxied #GInetSocketAddress.
17280 struct ProxyAddress /* : InetSocketAddress */ /* Version 2.26 */ {
17281 mixin SocketConnectable.__interface__;
17282 alias parent_instance this;
17283 alias parent_instance super_;
17284 alias parent_instance inetsocketaddress;
17285 InetSocketAddress parent_instance;
17286 private ProxyAddressPrivate* priv;
17289 // VERSION: 2.26
17290 // Creates a new #GProxyAddress for @inetaddr with @protocol that should
17291 // tunnel through @dest_hostname and @dest_port.
17292 // RETURNS: a new #GProxyAddress
17293 // <inetaddr>: The proxy server #GInetAddress.
17294 // <port>: The proxy server port.
17295 // <protocol>: The proxy protocol to support, in lower case (e.g. socks, http).
17296 // <dest_hostname>: The destination hostname the the proxy should tunnel to.
17297 // <dest_port>: The destination port to tunnel to.
17298 // <username>: The username to authenticate to the proxy server (or %NULL).
17299 // <password>: The password to authenticate to the proxy server (or %NULL).
17300 static ProxyAddress* /*new*/ new_()(InetAddress* inetaddr, ushort port, char* protocol, char* dest_hostname, ushort dest_port, char* username=null, char* password=null) {
17301 return g_proxy_address_new(inetaddr, port, protocol, dest_hostname, dest_port, username, password);
17304 // VERSION: 2.26
17305 // Gets @proxy's destination hostname.
17306 // RETURNS: the @proxy's destination hostname
17307 char* get_destination_hostname()() {
17308 return g_proxy_address_get_destination_hostname(&this);
17311 // VERSION: 2.26
17312 // Gets @proxy's destination port.
17313 // RETURNS: the @proxy's destination port
17314 ushort get_destination_port()() {
17315 return g_proxy_address_get_destination_port(&this);
17318 // VERSION: 2.26
17319 // Gets @proxy's password.
17320 // RETURNS: the @proxy's password
17321 char* get_password()() {
17322 return g_proxy_address_get_password(&this);
17325 // VERSION: 2.26
17326 // Gets @proxy's protocol.
17327 // RETURNS: the @proxy's protocol
17328 char* get_protocol()() {
17329 return g_proxy_address_get_protocol(&this);
17332 // VERSION: 2.26
17333 // Gets @proxy's username.
17334 // RETURNS: the @proxy's username
17335 char* get_username()() {
17336 return g_proxy_address_get_username(&this);
17340 struct ProxyAddressClass {
17341 InetSocketAddressClass parent_class;
17345 // A subclass of #GSocketAddressEnumerator that takes another address
17346 // enumerator and wraps its results in #GProxyAddress<!-- -->es as
17347 // directed by the default #GProxyResolver.
17348 struct ProxyAddressEnumerator /* : SocketAddressEnumerator */ {
17349 alias parent_instance this;
17350 alias parent_instance super_;
17351 alias parent_instance socketaddressenumerator;
17352 SocketAddressEnumerator parent_instance;
17353 ProxyAddressEnumeratorPrivate* priv;
17356 struct ProxyAddressEnumeratorClass {
17357 SocketAddressEnumeratorClass parent_class;
17358 extern (C) void function () _g_reserved1;
17359 extern (C) void function () _g_reserved2;
17360 extern (C) void function () _g_reserved3;
17361 extern (C) void function () _g_reserved4;
17362 extern (C) void function () _g_reserved5;
17363 extern (C) void function () _g_reserved6;
17364 extern (C) void function () _g_reserved7;
17367 struct ProxyAddressEnumeratorPrivate {
17370 struct ProxyAddressPrivate {
17373 // Provides an interface for handling proxy connection and payload.
17374 struct ProxyInterface /* Version 2.26 */ {
17375 GObject2.TypeInterface g_iface;
17377 // RETURNS: a #GIOStream that will replace @connection. This might
17378 // <connection>: a #GIOStream
17379 // <proxy_address>: a #GProxyAddress
17380 // <cancellable>: a #GCancellable
17381 extern (C) IOStream* /*new*/ function (Proxy* proxy, IOStream* connection, ProxyAddress* proxy_address, Cancellable* cancellable, GLib2.Error** error=null) connect;
17383 // <connection>: a #GIOStream
17384 // <proxy_address>: a #GProxyAddress
17385 // <cancellable>: a #GCancellable
17386 // <callback>: a #GAsyncReadyCallback
17387 // <user_data>: callback data
17388 extern (C) void function (Proxy* proxy, IOStream* connection, ProxyAddress* proxy_address, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) connect_async;
17390 // RETURNS: a #GIOStream.
17391 // <result>: a #GAsyncResult
17392 extern (C) IOStream* /*new*/ function (Proxy* proxy, AsyncResult* result, GLib2.Error** error=null) connect_finish;
17393 // RETURNS: %TRUE if hostname resolution is supported.
17394 extern (C) int function (Proxy* proxy) supports_hostname;
17398 // #GProxyResolver provides synchronous and asynchronous network proxy
17399 // resolution. #GProxyResolver is used within #GSocketClient through
17400 // the method g_socket_connectable_proxy_enumerate().
17401 struct ProxyResolver /* Interface */ {
17402 mixin template __interface__() {
17403 // VERSION: 2.26
17404 // Gets the default #GProxyResolver for the system.
17405 // RETURNS: the default #GProxyResolver.
17406 static ProxyResolver* get_default()() {
17407 return g_proxy_resolver_get_default();
17410 // VERSION: 2.26
17411 // Checks if @resolver can be used on this system. (This is used
17412 // internally; g_proxy_resolver_get_default() will only return a proxy
17413 // resolver that returns %TRUE for this method.)
17414 // RETURNS: %TRUE if @resolver is supported.
17415 int is_supported()() {
17416 return g_proxy_resolver_is_supported(cast(ProxyResolver*)&this);
17419 // VERSION: 2.26
17420 // Looks into the system proxy configuration to determine what proxy,
17421 // if any, to use to connect to @uri. The returned proxy URIs are of the
17422 // form <literal>&lt;protocol&gt;://[user[:password]@]host:port</literal>
17423 // or <literal>direct://</literal>, where &lt;protocol&gt; could be
17424 // http, rtsp, socks or other proxying protocol.
17426 // If you don't know what network protocol is being used on the
17427 // socket, you should use <literal>none</literal> as the URI protocol.
17428 // In this case, the resolver might still return a generic proxy type
17429 // (such as SOCKS), but would not return protocol-specific proxy types
17430 // (such as http).
17432 // <literal>direct://</literal> is used when no proxy is needed.
17433 // Direct connection should not be attempted unless it is part of the
17434 // returned array of proxies.
17436 // NULL-terminated array of proxy URIs. Must be freed
17437 // with g_strfreev().
17438 // RETURNS: A
17439 // <uri>: a URI representing the destination to connect to
17440 // <cancellable>: a #GCancellable, or %NULL
17441 char** /*new*/ lookup()(char* uri, Cancellable* cancellable, GLib2.Error** error=null) {
17442 return g_proxy_resolver_lookup(cast(ProxyResolver*)&this, uri, cancellable, error);
17445 // VERSION: 2.26
17446 // Asynchronous lookup of proxy. See g_proxy_resolver_lookup() for more
17447 // details.
17448 // <uri>: a URI representing the destination to connect to
17449 // <cancellable>: a #GCancellable, or %NULL
17450 // <callback>: callback to call after resolution completes
17451 // <user_data>: data for @callback
17452 void lookup_async()(char* uri, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
17453 g_proxy_resolver_lookup_async(cast(ProxyResolver*)&this, uri, cancellable, callback, user_data);
17456 // VERSION: 2.26
17457 // Call this function to obtain the array of proxy URIs when
17458 // g_proxy_resolver_lookup_async() is complete. See
17459 // g_proxy_resolver_lookup() for more details.
17461 // NULL-terminated array of proxy URIs. Must be freed
17462 // with g_strfreev().
17463 // RETURNS: A
17464 // <result>: the result passed to your #GAsyncReadyCallback
17465 char** /*new*/ lookup_finish()(AsyncResult* result, GLib2.Error** error=null) {
17466 return g_proxy_resolver_lookup_finish(cast(ProxyResolver*)&this, result, error);
17469 mixin __interface__;
17472 struct ProxyResolverInterface {
17473 GObject2.TypeInterface g_iface;
17474 // RETURNS: %TRUE if @resolver is supported.
17475 extern (C) int function (ProxyResolver* resolver) is_supported;
17477 // RETURNS: A
17478 // <uri>: a URI representing the destination to connect to
17479 // <cancellable>: a #GCancellable, or %NULL
17480 extern (C) char** /*new*/ function (ProxyResolver* resolver, char* uri, Cancellable* cancellable, GLib2.Error** error=null) lookup;
17482 // <uri>: a URI representing the destination to connect to
17483 // <cancellable>: a #GCancellable, or %NULL
17484 // <callback>: callback to call after resolution completes
17485 // <user_data>: data for @callback
17486 extern (C) void function (ProxyResolver* resolver, char* uri, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) lookup_async;
17488 // RETURNS: A
17489 // <result>: the result passed to your #GAsyncReadyCallback
17490 extern (C) char** /*new*/ function (ProxyResolver* resolver, AsyncResult* result, GLib2.Error** error=null) lookup_finish;
17494 // Unintrospectable callback: ReallocFunc() / ()
17495 // Changes the size of the memory block pointed to by @data to
17496 // @size bytes.
17498 // The function should have the same semantics as realloc().
17499 // RETURNS: a pointer to the reallocated memory
17500 // <data>: memory block to reallocate
17501 // <size>: size to reallocate @data to
17502 extern (C) alias void* function (void* data, size_t size) ReallocFunc;
17505 // The GRemoteActionGroup interface is implemented by #GActionGroup
17506 // instances that either transmit action invocations to other processes
17507 // or receive action invocations in the local process from other
17508 // processes.
17510 // The interface has <literal>_full</literal> variants of the two
17511 // methods on #GActionGroup used to activate actions:
17512 // g_action_group_activate_action() and
17513 // g_action_group_change_action_state(). These variants allow a
17514 // "platform data" #GVariant to be specified: a dictionary providing
17515 // context for the action invocation (for example: timestamps, startup
17516 // notification IDs, etc).
17518 // #GDBusActionGroup implements #GRemoteActionGroup. This provides a
17519 // mechanism to send platform data for action invocations over D-Bus.
17521 // Additionally, g_dbus_connection_export_action_group() will check if
17522 // the exported #GActionGroup implements #GRemoteActionGroup and use the
17523 // <literal>_full</literal> variants of the calls if available. This
17524 // provides a mechanism by which to receive platform data for action
17525 // invocations that arrive by way of D-Bus.
17526 struct RemoteActionGroup /* Interface */ {
17527 mixin template __interface__() {
17528 // VERSION: 2.32
17529 // Changes the state of a remote action.
17531 // This is the same as g_action_group_change_action_state() except that
17532 // it allows for provision of "platform data" to be sent along with the
17533 // state change request. This typically contains details such as the
17534 // user interaction timestamp or startup notification information.
17536 // @platform_data must be non-%NULL and must have the type
17537 // %G_VARIANT_TYPE_VARDICT. If it is floating, it will be consumed.
17538 // <action_name>: the name of the action to change the state of
17539 // <platform_data>: the platform data to send
17540 void activate_action_full()(char* action_name, GLib2.Variant* parameter, GLib2.Variant* platform_data) {
17541 g_remote_action_group_activate_action_full(cast(RemoteActionGroup*)&this, action_name, parameter, platform_data);
17543 void change_action_state_full()(char* action_name, GLib2.Variant* value, GLib2.Variant* platform_data) {
17544 g_remote_action_group_change_action_state_full(cast(RemoteActionGroup*)&this, action_name, value, platform_data);
17547 mixin __interface__;
17550 // The virtual function table for #GRemoteActionGroup.
17551 struct RemoteActionGroupInterface /* Version 2.32 */ {
17552 GObject2.TypeInterface g_iface;
17554 // <action_name>: the name of the action to change the state of
17555 // <platform_data>: the platform data to send
17556 extern (C) void function (RemoteActionGroup* remote, char* action_name, GLib2.Variant* parameter, GLib2.Variant* platform_data) activate_action_full;
17557 extern (C) void function (RemoteActionGroup* remote, char* action_name, GLib2.Variant* value, GLib2.Variant* platform_data) change_action_state_full;
17561 // #GResolver provides cancellable synchronous and asynchronous DNS
17562 // resolution, for hostnames (g_resolver_lookup_by_address(),
17563 // g_resolver_lookup_by_name() and their async variants) and SRV
17564 // (service) records (g_resolver_lookup_service()).
17566 // #GNetworkAddress and #GNetworkService provide wrappers around
17567 // #GResolver functionality that also implement #GSocketConnectable,
17568 // making it easy to connect to a remote host/service.
17569 struct Resolver /* : GObject.Object */ {
17570 alias parent_instance this;
17571 alias parent_instance super_;
17572 alias parent_instance object;
17573 GObject2.Object parent_instance;
17574 ResolverPrivate* priv;
17577 // Unintrospectable function: free_addresses() / g_resolver_free_addresses()
17578 // VERSION: 2.22
17579 // Frees @addresses (which should be the return value from
17580 // g_resolver_lookup_by_name() or g_resolver_lookup_by_name_finish()).
17581 // (This is a convenience method; you can also simply free the results
17582 // by hand.)
17583 // <addresses>: a #GList of #GInetAddress
17584 static void free_addresses()(GLib2.List* addresses) {
17585 g_resolver_free_addresses(addresses);
17588 // Unintrospectable function: free_targets() / g_resolver_free_targets()
17589 // VERSION: 2.22
17590 // Frees @targets (which should be the return value from
17591 // g_resolver_lookup_service() or g_resolver_lookup_service_finish()).
17592 // (This is a convenience method; you can also simply free the
17593 // results by hand.)
17594 // <targets>: a #GList of #GSrvTarget
17595 static void free_targets()(GLib2.List* targets) {
17596 g_resolver_free_targets(targets);
17599 // VERSION: 2.22
17600 // Gets the default #GResolver. You should unref it when you are done
17601 // with it. #GResolver may use its reference count as a hint about how
17602 // many threads it should allocate for concurrent DNS resolutions.
17603 // RETURNS: the default #GResolver.
17604 static Resolver* /*new*/ get_default()() {
17605 return g_resolver_get_default();
17608 // VERSION: 2.22
17609 // Synchronously reverse-resolves @address to determine its
17610 // associated hostname.
17612 // If the DNS resolution fails, @error (if non-%NULL) will be set to
17613 // a value from #GResolverError.
17615 // If @cancellable is non-%NULL, it can be used to cancel the
17616 // operation, in which case @error (if non-%NULL) will be set to
17617 // %G_IO_ERROR_CANCELLED.
17619 // form), or %NULL on error.
17620 // RETURNS: a hostname (either ASCII-only, or in ASCII-encoded
17621 // <address>: the address to reverse-resolve
17622 // <cancellable>: a #GCancellable, or %NULL
17623 char* /*new*/ lookup_by_address()(InetAddress* address, Cancellable* cancellable, GLib2.Error** error=null) {
17624 return g_resolver_lookup_by_address(&this, address, cancellable, error);
17627 // VERSION: 2.22
17628 // Begins asynchronously reverse-resolving @address to determine its
17629 // associated hostname, and eventually calls @callback, which must
17630 // call g_resolver_lookup_by_address_finish() to get the final result.
17631 // <address>: the address to reverse-resolve
17632 // <cancellable>: a #GCancellable, or %NULL
17633 // <callback>: callback to call after resolution completes
17634 // <user_data>: data for @callback
17635 void lookup_by_address_async()(InetAddress* address, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
17636 g_resolver_lookup_by_address_async(&this, address, cancellable, callback, user_data);
17639 // VERSION: 2.22
17640 // Retrieves the result of a previous call to
17641 // g_resolver_lookup_by_address_async().
17643 // If the DNS resolution failed, @error (if non-%NULL) will be set to
17644 // a value from #GResolverError. If the operation was cancelled,
17645 // @error will be set to %G_IO_ERROR_CANCELLED.
17647 // form), or %NULL on error.
17648 // RETURNS: a hostname (either ASCII-only, or in ASCII-encoded
17649 // <result>: the result passed to your #GAsyncReadyCallback
17650 char* /*new*/ lookup_by_address_finish()(AsyncResult* result, GLib2.Error** error=null) {
17651 return g_resolver_lookup_by_address_finish(&this, result, error);
17654 // VERSION: 2.22
17655 // Synchronously resolves @hostname to determine its associated IP
17656 // address(es). @hostname may be an ASCII-only or UTF-8 hostname, or
17657 // the textual form of an IP address (in which case this just becomes
17658 // a wrapper around g_inet_address_new_from_string()).
17660 // On success, g_resolver_lookup_by_name() will return a #GList of
17661 // #GInetAddress, sorted in order of preference and guaranteed to not
17662 // contain duplicates. That is, if using the result to connect to
17663 // @hostname, you should attempt to connect to the first address
17664 // first, then the second if the first fails, etc. If you are using
17665 // the result to listen on a socket, it is appropriate to add each
17666 // result using e.g. g_socket_listener_add_address().
17668 // If the DNS resolution fails, @error (if non-%NULL) will be set to a
17669 // value from #GResolverError.
17671 // If @cancellable is non-%NULL, it can be used to cancel the
17672 // operation, in which case @error (if non-%NULL) will be set to
17673 // %G_IO_ERROR_CANCELLED.
17675 // If you are planning to connect to a socket on the resolved IP
17676 // address, it may be easier to create a #GNetworkAddress and use its
17677 // #GSocketConnectable interface.
17679 // of #GInetAddress, or %NULL on error. You
17680 // must unref each of the addresses and free the list when you are
17681 // done with it. (You can use g_resolver_free_addresses() to do this.)
17682 // RETURNS: a #GList
17683 // <hostname>: the hostname to look up
17684 // <cancellable>: a #GCancellable, or %NULL
17685 GLib2.List* /*new*/ lookup_by_name()(char* hostname, Cancellable* cancellable, GLib2.Error** error=null) {
17686 return g_resolver_lookup_by_name(&this, hostname, cancellable, error);
17689 // VERSION: 2.22
17690 // Begins asynchronously resolving @hostname to determine its
17691 // associated IP address(es), and eventually calls @callback, which
17692 // must call g_resolver_lookup_by_name_finish() to get the result.
17693 // See g_resolver_lookup_by_name() for more details.
17694 // <hostname>: the hostname to look up the address of
17695 // <cancellable>: a #GCancellable, or %NULL
17696 // <callback>: callback to call after resolution completes
17697 // <user_data>: data for @callback
17698 void lookup_by_name_async()(char* hostname, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
17699 g_resolver_lookup_by_name_async(&this, hostname, cancellable, callback, user_data);
17702 // VERSION: 2.22
17703 // Retrieves the result of a call to
17704 // g_resolver_lookup_by_name_async().
17706 // If the DNS resolution failed, @error (if non-%NULL) will be set to
17707 // a value from #GResolverError. If the operation was cancelled,
17708 // @error will be set to %G_IO_ERROR_CANCELLED.
17710 // of #GInetAddress, or %NULL on error. See g_resolver_lookup_by_name()
17711 // for more details.
17712 // RETURNS: a #GList
17713 // <result>: the result passed to your #GAsyncReadyCallback
17714 GLib2.List* /*new*/ lookup_by_name_finish()(AsyncResult* result, GLib2.Error** error=null) {
17715 return g_resolver_lookup_by_name_finish(&this, result, error);
17718 // VERSION: 2.22
17719 // Synchronously performs a DNS SRV lookup for the given @service and
17720 // @protocol in the given @domain and returns an array of #GSrvTarget.
17721 // @domain may be an ASCII-only or UTF-8 hostname. Note also that the
17722 // @service and @protocol arguments <emphasis>do not</emphasis>
17723 // include the leading underscore that appears in the actual DNS
17724 // entry.
17726 // On success, g_resolver_lookup_service() will return a #GList of
17727 // #GSrvTarget, sorted in order of preference. (That is, you should
17728 // attempt to connect to the first target first, then the second if
17729 // the first fails, etc.)
17731 // If the DNS resolution fails, @error (if non-%NULL) will be set to
17732 // a value from #GResolverError.
17734 // If @cancellable is non-%NULL, it can be used to cancel the
17735 // operation, in which case @error (if non-%NULL) will be set to
17736 // %G_IO_ERROR_CANCELLED.
17738 // If you are planning to connect to the service, it is usually easier
17739 // to create a #GNetworkService and use its #GSocketConnectable
17740 // interface.
17742 // or %NULL on error. You must free each of the targets and the list when you are
17743 // done with it. (You can use g_resolver_free_targets() to do this.)
17744 // RETURNS: a #GList of #GSrvTarget,
17745 // <service>: the service type to look up (eg, "ldap")
17746 // <protocol>: the networking protocol to use for @service (eg, "tcp")
17747 // <domain>: the DNS domain to look up the service in
17748 // <cancellable>: a #GCancellable, or %NULL
17749 GLib2.List* /*new*/ lookup_service()(char* service, char* protocol, char* domain, Cancellable* cancellable, GLib2.Error** error=null) {
17750 return g_resolver_lookup_service(&this, service, protocol, domain, cancellable, error);
17753 // VERSION: 2.22
17754 // Begins asynchronously performing a DNS SRV lookup for the given
17755 // @service and @protocol in the given @domain, and eventually calls
17756 // @callback, which must call g_resolver_lookup_service_finish() to
17757 // get the final result. See g_resolver_lookup_service() for more
17758 // details.
17759 // <service>: the service type to look up (eg, "ldap")
17760 // <protocol>: the networking protocol to use for @service (eg, "tcp")
17761 // <domain>: the DNS domain to look up the service in
17762 // <cancellable>: a #GCancellable, or %NULL
17763 // <callback>: callback to call after resolution completes
17764 // <user_data>: data for @callback
17765 void lookup_service_async()(char* service, char* protocol, char* domain, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
17766 g_resolver_lookup_service_async(&this, service, protocol, domain, cancellable, callback, user_data);
17769 // VERSION: 2.22
17770 // Retrieves the result of a previous call to
17771 // g_resolver_lookup_service_async().
17773 // If the DNS resolution failed, @error (if non-%NULL) will be set to
17774 // a value from #GResolverError. If the operation was cancelled,
17775 // @error will be set to %G_IO_ERROR_CANCELLED.
17777 // or %NULL on error. See g_resolver_lookup_service() for more details.
17778 // RETURNS: a #GList of #GSrvTarget,
17779 // <result>: the result passed to your #GAsyncReadyCallback
17780 GLib2.List* /*new*/ lookup_service_finish()(AsyncResult* result, GLib2.Error** error=null) {
17781 return g_resolver_lookup_service_finish(&this, result, error);
17784 // VERSION: 2.22
17785 // Sets @resolver to be the application's default resolver (reffing
17786 // @resolver, and unreffing the previous default resolver, if any).
17787 // Future calls to g_resolver_get_default() will return this resolver.
17789 // This can be used if an application wants to perform any sort of DNS
17790 // caching or "pinning"; it can implement its own #GResolver that
17791 // calls the original default resolver for DNS operations, and
17792 // implements its own cache policies on top of that, and then set
17793 // itself as the default resolver for all later code to use.
17794 void set_default()() {
17795 g_resolver_set_default(&this);
17798 // Emitted when the resolver notices that the system resolver
17799 // configuration has changed.
17800 extern (C) alias static void function (Resolver* this_, void* user_data=null) signal_reload;
17802 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
17803 return super_.signal_connect!name(cb, data, cf);
17806 ulong signal_connect(string name:"reload", CB:signal_reload)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
17807 return signal_connect_data!()(&this, cast(char*)"reload",
17808 cast(GObject2.Callback)cb, data, null, cf);
17812 struct ResolverClass {
17813 GObject2.ObjectClass parent_class;
17814 extern (C) void function (Resolver* resolver) reload;
17816 // RETURNS: a #GList
17817 // <hostname>: the hostname to look up
17818 // <cancellable>: a #GCancellable, or %NULL
17819 extern (C) GLib2.List* /*new*/ function (Resolver* resolver, char* hostname, Cancellable* cancellable, GLib2.Error** error=null) lookup_by_name;
17821 // <hostname>: the hostname to look up the address of
17822 // <cancellable>: a #GCancellable, or %NULL
17823 // <callback>: callback to call after resolution completes
17824 // <user_data>: data for @callback
17825 extern (C) void function (Resolver* resolver, char* hostname, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) lookup_by_name_async;
17827 // RETURNS: a #GList
17828 // <result>: the result passed to your #GAsyncReadyCallback
17829 extern (C) GLib2.List* /*new*/ function (Resolver* resolver, AsyncResult* result, GLib2.Error** error=null) lookup_by_name_finish;
17831 // RETURNS: a hostname (either ASCII-only, or in ASCII-encoded
17832 // <address>: the address to reverse-resolve
17833 // <cancellable>: a #GCancellable, or %NULL
17834 extern (C) char* /*new*/ function (Resolver* resolver, InetAddress* address, Cancellable* cancellable, GLib2.Error** error=null) lookup_by_address;
17836 // <address>: the address to reverse-resolve
17837 // <cancellable>: a #GCancellable, or %NULL
17838 // <callback>: callback to call after resolution completes
17839 // <user_data>: data for @callback
17840 extern (C) void function (Resolver* resolver, InetAddress* address, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) lookup_by_address_async;
17842 // RETURNS: a hostname (either ASCII-only, or in ASCII-encoded
17843 // <result>: the result passed to your #GAsyncReadyCallback
17844 extern (C) char* /*new*/ function (Resolver* resolver, AsyncResult* result, GLib2.Error** error=null) lookup_by_address_finish;
17845 // Unintrospectable functionp: lookup_service() / ()
17846 extern (C) GLib2.List* function (Resolver* resolver, char* rrname, Cancellable* cancellable, GLib2.Error** error=null) lookup_service;
17847 extern (C) void function (Resolver* resolver, char* rrname, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) lookup_service_async;
17849 // RETURNS: a #GList of #GSrvTarget,
17850 // <result>: the result passed to your #GAsyncReadyCallback
17851 extern (C) GLib2.List* /*new*/ function (Resolver* resolver, AsyncResult* result, GLib2.Error** error=null) lookup_service_finish;
17852 extern (C) void function () _g_reserved1;
17853 extern (C) void function () _g_reserved2;
17854 extern (C) void function () _g_reserved3;
17855 extern (C) void function () _g_reserved4;
17856 extern (C) void function () _g_reserved5;
17857 extern (C) void function () _g_reserved6;
17861 // An error code used with %G_RESOLVER_ERROR in a #GError returned
17862 // from a #GResolver routine.
17863 enum ResolverError /* Version 2.22 */ {
17864 NOT_FOUND = 0,
17865 TEMPORARY_FAILURE = 1,
17866 INTERNAL = 2
17868 struct ResolverPrivate {
17872 // Applications and libraries often contain binary or textual data that is really part of the
17873 // application, rather than user data. For instance #GtkBuilder .ui files, splashscreen images,
17874 // GMenu markup xml, CSS files, icons, etc. These are often shipped as files in <filename>$datadir/appname</filename>, or
17875 // manually included as literal strings in the code.
17877 // The #GResource API and the <link linkend="glib-compile-schemas">glib-compile-resources</link> program
17878 // provide a convenient and efficient alternative to this which has some nice properties. You
17879 // maintain the files as normal files, so its easy to edit them, but during the build the files
17880 // are combined into a binary bundle that is linked into the executable. This means that loading
17881 // the resource files are efficient (as they are already in memory, shared with other instances) and
17882 // simple (no need to check for things like I/O errors or locate the files in the filesystem). It
17883 // also makes it easier to create relocatable applications.
17885 // Resource files can also be marked as compresses. Such files will be included in the resource bundle
17886 // in a compressed form, but will be automatically uncompressed when the resource is used. This
17887 // is very useful e.g. for larger text files that are parsed once (or rarely) and then thrown away.
17889 // Resource bundles are created by the <link linkend="glib-compile-schemas">glib-compile-resources</link> program
17890 // which takes an xml file that describes the bundle, and a set of files that the xml references. These
17891 // are combined into a binary resource bundle.
17893 // <example id="resource-example"><title>Example resource description</title>
17894 // <programlisting><![CDATA[
17895 // <?xml version="1.0" encoding="UTF-8"?>
17896 // <gresources>
17897 // <gresource prefix="/org/gtk/Example">
17898 // <file>data/splashscreen.png</file>
17899 // <file compressed="true">dialog.ui</file>
17900 // <file>menumarkup.xml</file>
17901 // </gresource>
17902 // </gresources>
17903 // ]]></programlisting></example>
17905 // This will create a resource bundle with the following files:
17906 // <programlisting><![CDATA[
17907 // /org/gtk/Example/data/splashscreen.png
17908 // /org/gtk/Example/dialog.ui
17909 // /org/gtk/Example/menumarkup.xml
17910 // ]]></programlisting>
17912 // Note that all resources in the process share the same namespace, so use java-style
17913 // path prefixes (like in the above example) to avoid conflicts.
17915 // You can then use <link linkend="glib-compile-schemas">glib-compile-resources</link> to compile the xml to a
17916 // binary bundle that you can load with g_resource_load(). However, its more common to use the --generate-source and
17917 // --generate-header arguments to create a source file and header to link directly into your application.
17919 // Once a #GResource has been created and registered all the data in it can be accessed globally in the process by
17920 // using API calls like g_resources_open_stream() to stream the data or g_resources_lookup_data() to get a direct pointer
17921 // to the data. You can also use uris like "resource:///org/gtk/Example/data/splashscreen.png" with #GFile to access
17922 // the resource data.
17924 // There are two forms of the generated source, the default version uses the compiler support for constructor
17925 // and destructor functions (where availible) to automatically create and register the #GResource on startup
17926 // or library load time. If you pass --manual-register two functions to register/unregister the resource is instead
17927 // created. This requires an explicit initialization call in your application/library, but it works on all platforms,
17928 // even on the minor ones where this is not availible. (Constructor support is availible for at least Win32, MacOS and Linux.)
17930 // Note that resource data can point directly into the data segment of e.g. a library, so if you are unloading libraries
17931 // during runtime you need to be very careful with keeping around pointers to data from a resource, as this goes away
17932 // when the library is unloaded. However, in practice this is not generally a problem, since most resource accesses
17933 // is for your own resources, and resource data is often used once, during parsing, and then released.
17934 struct Resource /* Version 2.32 */ {
17936 // VERSION: 2.32
17937 // Creates a GResource from a reference to the binary resource bundle.
17938 // This will keep a reference to @data while the resource lives, so
17939 // the data should not be modified or freed.
17941 // If you want to use this resource in the global resource namespace you need
17942 // to register it with g_resources_register().
17943 // RETURNS: a new #GResource, or %NULL on error.
17944 // <data>: A #GBytes.
17945 static Resource* /*new*/ new_from_data()(GLib2.Bytes* data, GLib2.Error** error=null) {
17946 return g_resource_new_from_data(data, error);
17949 // VERSION: 2.32
17950 // Registers the resource with the process-global set of resources.
17951 // Once a resource is registered the files in it can be accessed
17952 // with the global resource lookup functions like g_resources_lookup_data().
17953 void _register()() {
17954 g_resources_register(&this);
17957 // VERSION: 2.32
17958 // Unregisters the resource from the process-global set of resources.
17959 void _unregister()() {
17960 g_resources_unregister(&this);
17963 // VERSION: 2.32
17964 // Returns all the names of children at the specified @path in the resource.
17965 // The return result is a %NULL terminated list of strings which should
17966 // be released with g_strfreev().
17968 // @lookup_flags controls the behaviour of the lookup.
17969 // RETURNS: an array of constant strings
17970 // <path>: A pathname inside the resource.
17971 // <lookup_flags>: A #GResourceLookupFlags.
17972 char** /*new*/ enumerate_children()(char* path, ResourceLookupFlags lookup_flags, GLib2.Error** error=null) {
17973 return g_resource_enumerate_children(&this, path, lookup_flags, error);
17976 // VERSION: 2.32
17977 // Looks for a file at the specified @path in the resource and
17978 // if found returns information about it.
17980 // @lookup_flags controls the behaviour of the lookup.
17981 // RETURNS: %TRUE if the file was found. %FALSE if there were errors.
17982 // <path>: A pathname inside the resource.
17983 // <lookup_flags>: A #GResourceLookupFlags.
17984 // <size>: a location to place the length of the contents of the file, or %NULL if the length is not needed
17985 // <flags>: a location to place the flags about the file, or %NULL if the length is not needed
17986 int get_info()(char* path, ResourceLookupFlags lookup_flags, /*out*/ size_t* size, /*out*/ uint* flags, GLib2.Error** error=null) {
17987 return g_resource_get_info(&this, path, lookup_flags, size, flags, error);
17990 // VERSION: 2.32
17991 // Looks for a file at the specified @path in the resource and
17992 // returns a #GBytes that lets you directly access the data in
17993 // memory.
17995 // The data is always followed by a zero byte, so you
17996 // can safely use the data as a C string. However, that byte
17997 // is not included in the size of the GBytes.
17999 // For uncompressed resource files this is a pointer directly into
18000 // the resource bundle, which is typically in some readonly data section
18001 // in the program binary. For compressed files we allocate memory on
18002 // the heap and automatically uncompress the data.
18004 // @lookup_flags controls the behaviour of the lookup.
18006 // Free the returned object with g_bytes_unref().
18007 // RETURNS: #GBytes or %NULL on error.
18008 // <path>: A pathname inside the resource.
18009 // <lookup_flags>: A #GResourceLookupFlags.
18010 GLib2.Bytes* /*new*/ lookup_data()(char* path, ResourceLookupFlags lookup_flags, GLib2.Error** error=null) {
18011 return g_resource_lookup_data(&this, path, lookup_flags, error);
18014 // VERSION: 2.32
18015 // Looks for a file at the specified @path in the resource and
18016 // returns a #GInputStream that lets you read the data.
18018 // @lookup_flags controls the behaviour of the lookup.
18020 // Free the returned object with g_object_unref().
18021 // RETURNS: #GInputStream or %NULL on error.
18022 // <path>: A pathname inside the resource.
18023 // <lookup_flags>: A #GResourceLookupFlags.
18024 InputStream* /*new*/ open_stream()(char* path, ResourceLookupFlags lookup_flags, GLib2.Error** error=null) {
18025 return g_resource_open_stream(&this, path, lookup_flags, error);
18028 // VERSION: 2.32
18029 // Atomically increments the reference count of @array by one. This
18030 // function is MT-safe and may be called from any thread.
18031 // RETURNS: The passed in #GResource.
18032 Resource* /*new*/ ref_()() {
18033 return g_resource_ref(&this);
18036 // VERSION: 2.32
18037 // Atomically decrements the reference count of @resource by one. If the
18038 // reference count drops to 0, all memory allocated by the array is
18039 // released. This function is MT-safe and may be called from any
18040 // thread.
18041 void unref()() {
18042 g_resource_unref(&this);
18045 // VERSION: 2.32
18046 // Loads a binary resource bundle and creates a #GResource representation of it, allowing
18047 // you to query it for data.
18049 // If you want to use this resource in the global resource namespace you need
18050 // to register it with g_resources_register().
18051 // RETURNS: a new #GResource, or %NULL on error.
18052 // <filename>: the path of a filename to load, in the GLib filename encoding.
18053 static Resource* /*new*/ load()(char* filename, GLib2.Error** error=null) {
18054 return g_resource_load(filename, error);
18059 // An error code used with %G_RESOURCE_ERROR in a #GError returned
18060 // from a #GResource routine.
18061 enum ResourceError /* Version 2.32 */ {
18062 NOT_FOUND = 0,
18063 INTERNAL = 1
18066 // GResourceFlags give information about a particular file inside a resource
18067 // bundle.
18068 enum ResourceFlags /* Version 2.32 */ {
18069 NONE = 0,
18070 COMPRESSED = 1
18072 // GResourceLookupFlags determine how resource path lookups are handled.
18073 enum ResourceLookupFlags /* Version 2.32 */ {
18074 NONE = 0
18077 // #GSeekable is implemented by streams (implementations of
18078 // #GInputStream or #GOutputStream) that support seeking.
18079 struct Seekable /* Interface */ {
18080 mixin template __interface__() {
18081 // Tests if the stream supports the #GSeekableIface.
18082 // RETURNS: %TRUE if @seekable can be seeked. %FALSE otherwise.
18083 int can_seek()() {
18084 return g_seekable_can_seek(cast(Seekable*)&this);
18087 // Tests if the stream can be truncated.
18088 // RETURNS: %TRUE if the stream can be truncated, %FALSE otherwise.
18089 int can_truncate()() {
18090 return g_seekable_can_truncate(cast(Seekable*)&this);
18093 // Seeks in the stream by the given @offset, modified by @type.
18095 // If @cancellable is not %NULL, then the operation can be cancelled by
18096 // triggering the cancellable object from another thread. If the operation
18097 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
18099 // has occurred, this function will return %FALSE and set @error
18100 // appropriately if present.
18101 // RETURNS: %TRUE if successful. If an error
18102 // <offset>: a #goffset.
18103 // <type>: a #GSeekType.
18104 // <cancellable>: optional #GCancellable object, %NULL to ignore.
18105 int seek()(long offset, GLib2.SeekType type, Cancellable* cancellable, GLib2.Error** error=null) {
18106 return g_seekable_seek(cast(Seekable*)&this, offset, type, cancellable, error);
18109 // Tells the current position within the stream.
18110 // RETURNS: the offset from the beginning of the buffer.
18111 long tell()() {
18112 return g_seekable_tell(cast(Seekable*)&this);
18115 // Truncates a stream with a given #offset.
18117 // If @cancellable is not %NULL, then the operation can be cancelled by
18118 // triggering the cancellable object from another thread. If the operation
18119 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
18120 // operation was partially finished when the operation was cancelled the
18121 // partial result will be returned, without an error.
18123 // has occurred, this function will return %FALSE and set @error
18124 // appropriately if present.
18125 // RETURNS: %TRUE if successful. If an error
18126 // <offset>: a #goffset.
18127 // <cancellable>: optional #GCancellable object, %NULL to ignore.
18128 int truncate()(long offset, Cancellable* cancellable, GLib2.Error** error=null) {
18129 return g_seekable_truncate(cast(Seekable*)&this, offset, cancellable, error);
18132 mixin __interface__;
18135 // Provides an interface for implementing seekable functionality on I/O Streams.
18136 struct SeekableIface {
18137 GObject2.TypeInterface g_iface;
18138 // RETURNS: the offset from the beginning of the buffer.
18139 extern (C) long function (Seekable* seekable) tell;
18140 // RETURNS: %TRUE if @seekable can be seeked. %FALSE otherwise.
18141 extern (C) int function (Seekable* seekable) can_seek;
18143 // RETURNS: %TRUE if successful. If an error
18144 // <offset>: a #goffset.
18145 // <type>: a #GSeekType.
18146 // <cancellable>: optional #GCancellable object, %NULL to ignore.
18147 extern (C) int function (Seekable* seekable, long offset, GLib2.SeekType type, Cancellable* cancellable, GLib2.Error** error=null) seek;
18148 // RETURNS: %TRUE if the stream can be truncated, %FALSE otherwise.
18149 extern (C) int function (Seekable* seekable) can_truncate;
18151 // RETURNS: %TRUE if successful. If an error
18152 // <offset>: a #goffset.
18153 // <cancellable>: optional #GCancellable object, %NULL to ignore.
18154 extern (C) int function (Seekable* seekable, long offset, Cancellable* cancellable, GLib2.Error** error=null) truncate_fn;
18158 // The #GSettings class provides a convenient API for storing and retrieving
18159 // application settings.
18161 // Reads and writes can be considered to be non-blocking. Reading
18162 // settings with #GSettings is typically extremely fast: on
18163 // approximately the same order of magnitude (but slower than) a
18164 // #GHashTable lookup. Writing settings is also extremely fast in terms
18165 // of time to return to your application, but can be extremely expensive
18166 // for other threads and other processes. Many settings backends
18167 // (including dconf) have lazy initialisation which means in the common
18168 // case of the user using their computer without modifying any settings
18169 // a lot of work can be avoided. For dconf, the D-Bus service doesn't
18170 // even need to be started in this case. For this reason, you should
18171 // only ever modify #GSettings keys in response to explicit user action.
18172 // Particular care should be paid to ensure that modifications are not
18173 // made during startup -- for example, when setting the initial value
18174 // of preferences widgets. The built-in g_settings_bind() functionality
18175 // is careful not to write settings in response to notify signals as a
18176 // result of modifications that it makes to widgets.
18178 // When creating a GSettings instance, you have to specify a schema
18179 // that describes the keys in your settings and their types and default
18180 // values, as well as some other information.
18182 // Normally, a schema has as fixed path that determines where the settings
18183 // are stored in the conceptual global tree of settings. However, schemas
18184 // can also be 'relocatable', i.e. not equipped with a fixed path. This is
18185 // useful e.g. when the schema describes an 'account', and you want to be
18186 // able to store a arbitrary number of accounts.
18188 // Unlike other configuration systems (like GConf), GSettings does not
18189 // restrict keys to basic types like strings and numbers. GSettings stores
18190 // values as #GVariant, and allows any #GVariantType for keys. Key names
18191 // are restricted to lowercase characters, numbers and '-'. Furthermore,
18192 // the names must begin with a lowercase character, must not end
18193 // with a '-', and must not contain consecutive dashes.
18195 // Similar to GConf, the default values in GSettings schemas can be
18196 // localized, but the localized values are stored in gettext catalogs
18197 // and looked up with the domain that is specified in the
18198 // <tag class="attribute">gettext-domain</tag> attribute of the
18199 // <tag class="starttag">schemalist</tag> or <tag class="starttag">schema</tag>
18200 // elements and the category that is specified in the l10n attribute of the
18201 // <tag class="starttag">key</tag> element.
18203 // GSettings uses schemas in a compact binary form that is created
18204 // by the <link linkend="glib-compile-schemas">glib-compile-schemas</link>
18205 // utility. The input is a schema description in an XML format that can be
18206 // described by the following DTD:
18207 // |[<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>]|
18209 // glib-compile-schemas expects schema files to have the extension <filename>.gschema.xml</filename>
18211 // At runtime, schemas are identified by their id (as specified
18212 // in the <tag class="attribute">id</tag> attribute of the
18213 // <tag class="starttag">schema</tag> element). The
18214 // convention for schema ids is to use a dotted name, similar in
18215 // style to a D-Bus bus name, e.g. "org.gnome.SessionManager". In particular,
18216 // if the settings are for a specific service that owns a D-Bus bus name,
18217 // the D-Bus bus name and schema id should match. For schemas which deal
18218 // with settings not associated with one named application, the id should
18219 // not use StudlyCaps, e.g. "org.gnome.font-rendering".
18221 // In addition to #GVariant types, keys can have types that have enumerated
18222 // types. These can be described by a <tag class="starttag">choice</tag>,
18223 // <tag class="starttag">enum</tag> or <tag class="starttag">flags</tag> element, see
18224 // <xref linkend="schema-enumerated"/>. The underlying type of
18225 // such a key is string, but you can use g_settings_get_enum(),
18226 // g_settings_set_enum(), g_settings_get_flags(), g_settings_set_flags()
18227 // access the numeric values corresponding to the string value of enum
18228 // and flags keys.
18230 // <example id="schema-default-values"><title>Default values</title>
18231 // <programlisting><![CDATA[
18232 // <schemalist>
18233 // <schema id="org.gtk.Test" path="/tests/" gettext-domain="test">
18235 // <key name="greeting" type="s">
18236 // <default l10n="messages">"Hello, earthlings"</default>
18237 // <summary>A greeting</summary>
18238 // <description>
18239 // Greeting of the invading martians
18240 // </description>
18241 // </key>
18243 // <key name="box" type="(ii)">
18244 // <default>(20,30)</default>
18245 // </key>
18247 // </schema>
18248 // </schemalist>
18249 // ]]></programlisting></example>
18251 // <example id="schema-enumerated"><title>Ranges, choices and enumerated types</title>
18252 // <programlisting><![CDATA[
18253 // <schemalist>
18255 // <enum id="org.gtk.Test.myenum">
18256 // <value nick="first" value="1"/>
18257 // <value nick="second" value="2"/>
18258 // </enum>
18260 // <flags id="org.gtk.Test.myflags">
18261 // <value nick="flag1" value="1"/>
18262 // <value nick="flag2" value="2"/>
18263 // <value nick="flag3" value="4"/>
18264 // </flags>
18266 // <schema id="org.gtk.Test">
18268 // <key name="key-with-range" type="i">
18269 // <range min="1" max="100"/>
18270 // <default>10</default>
18271 // </key>
18273 // <key name="key-with-choices" type="s">
18274 // <choices>
18275 // <choice value='Elisabeth'/>
18276 // <choice value='Annabeth'/>
18277 // <choice value='Joe'/>
18278 // </choices>
18279 // <aliases>
18280 // <alias value='Anna' target='Annabeth'/>
18281 // <alias value='Beth' target='Elisabeth'/>
18282 // </aliases>
18283 // <default>'Joe'</default>
18284 // </key>
18286 // <key name='enumerated-key' enum='org.gtk.Test.myenum'>
18287 // <default>'first'</default>
18288 // </key>
18290 // <key name='flags-key' flags='org.gtk.Test.myflags'>
18291 // <default>["flag1",flag2"]</default>
18292 // </key>
18293 // </schema>
18294 // </schemalist>
18295 // ]]></programlisting></example>
18297 // <refsect2>
18298 // <title>Vendor overrides</title>
18299 // <para>
18300 // Default values are defined in the schemas that get installed by
18301 // an application. Sometimes, it is necessary for a vendor or distributor
18302 // to adjust these defaults. Since patching the XML source for the schema
18303 // is inconvenient and error-prone,
18304 // <link linkend="glib-compile-schemas">glib-compile-schemas</link> reads
18305 // so-called 'vendor override' files. These are keyfiles in the same
18306 // directory as the XML schema sources which can override default values.
18307 // The schema id serves as the group name in the key file, and the values
18308 // are expected in serialized GVariant form, as in the following example:
18309 // <informalexample><programlisting>
18310 // [org.gtk.Example]
18311 // key1='string'
18312 // key2=1.5
18313 // </programlisting></informalexample>
18314 // </para>
18315 // <para>
18316 // glib-compile-schemas expects schema files to have the extension
18317 // <filename>.gschema.override</filename>
18318 // </para>
18319 // </refsect2>
18321 // <refsect2>
18322 // <title>Binding</title>
18323 // <para>
18324 // A very convenient feature of GSettings lets you bind #GObject properties
18325 // directly to settings, using g_settings_bind(). Once a GObject property
18326 // has been bound to a setting, changes on either side are automatically
18327 // propagated to the other side. GSettings handles details like
18328 // mapping between GObject and GVariant types, and preventing infinite
18329 // cycles.
18330 // </para>
18331 // <para>
18332 // This makes it very easy to hook up a preferences dialog to the
18333 // underlying settings. To make this even more convenient, GSettings
18334 // looks for a boolean property with the name "sensitivity" and
18335 // automatically binds it to the writability of the bound setting.
18336 // If this 'magic' gets in the way, it can be suppressed with the
18337 // #G_SETTINGS_BIND_NO_SENSITIVITY flag.
18338 // </para>
18339 // </refsect2>
18340 struct Settings /* : GObject.Object */ {
18341 alias parent_instance this;
18342 alias parent_instance super_;
18343 alias parent_instance object;
18344 GObject2.Object parent_instance;
18345 SettingsPrivate* priv;
18348 // VERSION: 2.26
18349 // Creates a new #GSettings object with the schema specified by
18350 // @schema_id.
18352 // Signals on the newly created #GSettings object will be dispatched
18353 // via the thread-default #GMainContext in effect at the time of the
18354 // call to g_settings_new(). The new #GSettings will hold a reference
18355 // on the context. See g_main_context_push_thread_default().
18356 // RETURNS: a new #GSettings object
18357 // <schema_id>: the id of the schema
18358 static Settings* /*new*/ new_()(char* schema_id) {
18359 return g_settings_new(schema_id);
18362 // VERSION: 2.32
18363 // Creates a new #GSettings object with a given schema, backend and
18364 // path.
18366 // It should be extremely rare that you ever want to use this function.
18367 // It is made available for advanced use-cases (such as plugin systems
18368 // that want to provide access to schemas loaded from custom locations,
18369 // etc).
18371 // At the most basic level, a #GSettings object is a pure composition of
18372 // 4 things: a #GSettingsSchema, a #GSettingsBackend, a path within that
18373 // backend, and a #GMainContext to which signals are dispatched.
18375 // This constructor therefore gives you full control over constructing
18376 // #GSettings instances. The first 4 parameters are given directly as
18377 // @schema, @backend and @path, and the main context is taken from the
18378 // thread-default (as per g_settings_new()).
18380 // If @backend is %NULL then the default backend is used.
18382 // If @path is %NULL then the path from the schema is used. It is an
18383 // error f @path is %NULL and the schema has no path of its own or if
18384 // @path is non-%NULL and not equal to the path that the schema does
18385 // have.
18386 // RETURNS: a new #GSettings object
18387 // <schema>: a #GSettingsSchema
18388 // <backend>: a #GSettingsBackend
18389 // <path>: the path to use
18390 static Settings* /*new*/ new_full()(SettingsSchema* schema, SettingsBackend* backend=null, char* path=null) {
18391 return g_settings_new_full(schema, backend, path);
18394 // VERSION: 2.26
18395 // Creates a new #GSettings object with the schema specified by
18396 // @schema_id and a given #GSettingsBackend.
18398 // Creating a #GSettings object with a different backend allows accessing
18399 // settings from a database other than the usual one. For example, it may make
18400 // sense to pass a backend corresponding to the "defaults" settings database on
18401 // the system to get a settings object that modifies the system default
18402 // settings instead of the settings for this user.
18403 // RETURNS: a new #GSettings object
18404 // <schema_id>: the id of the schema
18405 // <backend>: the #GSettingsBackend to use
18406 static Settings* /*new*/ new_with_backend()(char* schema_id, SettingsBackend* backend) {
18407 return g_settings_new_with_backend(schema_id, backend);
18410 // VERSION: 2.26
18411 // Creates a new #GSettings object with the schema specified by
18412 // @schema_id and a given #GSettingsBackend and path.
18414 // This is a mix of g_settings_new_with_backend() and
18415 // g_settings_new_with_path().
18416 // RETURNS: a new #GSettings object
18417 // <schema_id>: the id of the schema
18418 // <backend>: the #GSettingsBackend to use
18419 // <path>: the path to use
18420 static Settings* /*new*/ new_with_backend_and_path()(char* schema_id, SettingsBackend* backend, char* path) {
18421 return g_settings_new_with_backend_and_path(schema_id, backend, path);
18424 // VERSION: 2.26
18425 // Creates a new #GSettings object with the relocatable schema specified
18426 // by @schema_id and a given path.
18428 // You only need to do this if you want to directly create a settings
18429 // object with a schema that doesn't have a specified path of its own.
18430 // That's quite rare.
18432 // It is a programmer error to call this function for a schema that
18433 // has an explicitly specified path.
18434 // RETURNS: a new #GSettings object
18435 // <schema_id>: the id of the schema
18436 // <path>: the path to use
18437 static Settings* /*new*/ new_with_path()(char* schema_id, char* path) {
18438 return g_settings_new_with_path(schema_id, path);
18441 // VERSION: 2.28
18442 // Gets a list of the relocatable #GSettings schemas installed on the
18443 // system. These are schemas that do not provide their own path. It is
18444 // usual to instantiate these schemas directly, but if you want to you
18445 // can use g_settings_new_with_path() to specify the path.
18447 // The output of this function, taken together with the output of
18448 // g_settings_list_schemas() represents the complete list of all
18449 // installed schemas.
18451 // #GSettings schemas that are available. The list must not be
18452 // modified or freed.
18453 // RETURNS: a list of relocatable
18454 static char** list_relocatable_schemas()() {
18455 return g_settings_list_relocatable_schemas();
18458 // VERSION: 2.26
18459 // Gets a list of the #GSettings schemas installed on the system. The
18460 // returned list is exactly the list of schemas for which you may call
18461 // g_settings_new() without adverse effects.
18463 // This function does not list the schemas that do not provide their own
18464 // paths (ie: schemas for which you must use
18465 // g_settings_new_with_path()). See
18466 // g_settings_list_relocatable_schemas() for that.
18468 // schemas that are available. The list must not be modified or
18469 // freed.
18470 // RETURNS: a list of #GSettings
18471 static char** list_schemas()() {
18472 return g_settings_list_schemas();
18475 // Ensures that all pending operations for the given are complete for
18476 // the default backend.
18478 // Writes made to a #GSettings are handled asynchronously. For this
18479 // reason, it is very unlikely that the changes have it to disk by the
18480 // time g_settings_set() returns.
18482 // This call will block until all of the writes have made it to the
18483 // backend. Since the mainloop is not running, no change notifications
18484 // will be dispatched during this call (but some may be queued by the
18485 // time the call is done).
18486 static void sync()() {
18487 g_settings_sync();
18490 // VERSION: 2.26
18491 // Removes an existing binding for @property on @object.
18493 // Note that bindings are automatically removed when the
18494 // object is finalized, so it is rarely necessary to call this
18495 // function.
18496 // <object>: the object
18497 // <property>: the property whose binding is removed
18498 static void unbind()(void* object, char* property) {
18499 g_settings_unbind(object, property);
18502 // Applies any changes that have been made to the settings. This
18503 // function does nothing unless @settings is in 'delay-apply' mode;
18504 // see g_settings_delay(). In the normal case settings are always
18505 // applied immediately.
18506 void apply()() {
18507 g_settings_apply(&this);
18510 // VERSION: 2.26
18511 // Create a binding between the @key in the @settings object
18512 // and the property @property of @object.
18514 // The binding uses the default GIO mapping functions to map
18515 // between the settings and property values. These functions
18516 // handle booleans, numeric types and string types in a
18517 // straightforward way. Use g_settings_bind_with_mapping() if
18518 // you need a custom mapping, or map between types that are not
18519 // supported by the default mapping functions.
18521 // Unless the @flags include %G_SETTINGS_BIND_NO_SENSITIVITY, this
18522 // function also establishes a binding between the writability of
18523 // @key and the "sensitive" property of @object (if @object has
18524 // a boolean property by that name). See g_settings_bind_writable()
18525 // for more details about writable bindings.
18527 // Note that the lifecycle of the binding is tied to the object,
18528 // and that you can have only one binding per object property.
18529 // If you bind the same property twice on the same object, the second
18530 // binding overrides the first one.
18531 // <key>: the key to bind
18532 // <object>: a #GObject
18533 // <property>: the name of the property to bind
18534 // <flags>: flags for the binding
18535 void bind()(char* key, GObject2.Object* object, char* property, SettingsBindFlags flags) {
18536 g_settings_bind(&this, key, object, property, flags);
18539 // Unintrospectable method: bind_with_mapping() / g_settings_bind_with_mapping()
18540 // VERSION: 2.26
18541 // Create a binding between the @key in the @settings object
18542 // and the property @property of @object.
18544 // The binding uses the provided mapping functions to map between
18545 // settings and property values.
18547 // Note that the lifecycle of the binding is tied to the object,
18548 // and that you can have only one binding per object property.
18549 // If you bind the same property twice on the same object, the second
18550 // binding overrides the first one.
18551 // <key>: the key to bind
18552 // <object>: a #GObject
18553 // <property>: the name of the property to bind
18554 // <flags>: flags for the binding
18555 // <get_mapping>: a function that gets called to convert values from @settings to @object, or %NULL to use the default GIO mapping
18556 // <set_mapping>: a function that gets called to convert values from @object to @settings, or %NULL to use the default GIO mapping
18557 // <user_data>: data that gets passed to @get_mapping and @set_mapping
18558 // <destroy>: #GDestroyNotify function for @user_data
18559 void bind_with_mapping()(char* key, GObject2.Object* object, char* property, SettingsBindFlags flags, SettingsBindGetMapping get_mapping, SettingsBindSetMapping set_mapping, void* user_data, GLib2.DestroyNotify destroy) {
18560 g_settings_bind_with_mapping(&this, key, object, property, flags, get_mapping, set_mapping, user_data, destroy);
18563 // VERSION: 2.26
18564 // Create a binding between the writability of @key in the
18565 // @settings object and the property @property of @object.
18566 // The property must be boolean; "sensitive" or "visible"
18567 // properties of widgets are the most likely candidates.
18569 // Writable bindings are always uni-directional; changes of the
18570 // writability of the setting will be propagated to the object
18571 // property, not the other way.
18573 // When the @inverted argument is %TRUE, the binding inverts the
18574 // value as it passes from the setting to the object, i.e. @property
18575 // will be set to %TRUE if the key is <emphasis>not</emphasis>
18576 // writable.
18578 // Note that the lifecycle of the binding is tied to the object,
18579 // and that you can have only one binding per object property.
18580 // If you bind the same property twice on the same object, the second
18581 // binding overrides the first one.
18582 // <key>: the key to bind
18583 // <object>: a #GObject
18584 // <property>: the name of a boolean property to bind
18585 // <inverted>: whether to 'invert' the value
18586 void bind_writable()(char* key, GObject2.Object* object, char* property, int inverted) {
18587 g_settings_bind_writable(&this, key, object, property, inverted);
18589 // Unintrospectable method: create_action() / g_settings_create_action()
18590 Action* create_action()(char* key) {
18591 return g_settings_create_action(&this, key);
18594 // VERSION: 2.26
18595 // Changes the #GSettings object into 'delay-apply' mode. In this
18596 // mode, changes to @settings are not immediately propagated to the
18597 // backend, but kept locally until g_settings_apply() is called.
18598 void delay()() {
18599 g_settings_delay(&this);
18602 // Unintrospectable method: get() / g_settings_get()
18603 // VERSION: 2.26
18604 // Gets the value that is stored at @key in @settings.
18606 // A convenience function that combines g_settings_get_value() with
18607 // g_variant_get().
18609 // It is a programmer error to give a @key that isn't contained in the
18610 // schema for @settings or for the #GVariantType of @format to mismatch
18611 // the type given in the schema.
18612 // <key>: the key to get the value for
18613 // <format>: a #GVariant format string
18614 /+ Not available -- variadic methods unsupported - use the C function directly.
18615 alias g_settings_get get; // Variadic
18618 // VERSION: 2.26
18619 // Gets the value that is stored at @key in @settings.
18621 // A convenience variant of g_settings_get() for booleans.
18623 // It is a programmer error to give a @key that isn't specified as
18624 // having a boolean type in the schema for @settings.
18625 // RETURNS: a boolean
18626 // <key>: the key to get the value for
18627 int get_boolean()(char* key) {
18628 return g_settings_get_boolean(&this, key);
18631 // VERSION: 2.26
18632 // Creates a 'child' settings object which has a base path of
18633 // <replaceable>base-path</replaceable>/@name, where
18634 // <replaceable>base-path</replaceable> is the base path of @settings.
18636 // The schema for the child settings object must have been declared
18637 // in the schema of @settings using a <tag class="starttag">child</tag> element.
18638 // RETURNS: a 'child' settings object
18639 // <name>: the name of the 'child' schema
18640 Settings* /*new*/ get_child()(char* name) {
18641 return g_settings_get_child(&this, name);
18644 // VERSION: 2.26
18645 // Gets the value that is stored at @key in @settings.
18647 // A convenience variant of g_settings_get() for doubles.
18649 // It is a programmer error to give a @key that isn't specified as
18650 // having a 'double' type in the schema for @settings.
18651 // RETURNS: a double
18652 // <key>: the key to get the value for
18653 double get_double()(char* key) {
18654 return g_settings_get_double(&this, key);
18657 // VERSION: 2.26
18658 // Gets the value that is stored in @settings for @key and converts it
18659 // to the enum value that it represents.
18661 // In order to use this function the type of the value must be a string
18662 // and it must be marked in the schema file as an enumerated type.
18664 // It is a programmer error to give a @key that isn't contained in the
18665 // schema for @settings or is not marked as an enumerated type.
18667 // If the value stored in the configuration database is not a valid
18668 // value for the enumerated type then this function will return the
18669 // default value.
18670 // RETURNS: the enum value
18671 // <key>: the key to get the value for
18672 int get_enum()(char* key) {
18673 return g_settings_get_enum(&this, key);
18676 // VERSION: 2.26
18677 // Gets the value that is stored in @settings for @key and converts it
18678 // to the flags value that it represents.
18680 // In order to use this function the type of the value must be an array
18681 // of strings and it must be marked in the schema file as an flags type.
18683 // It is a programmer error to give a @key that isn't contained in the
18684 // schema for @settings or is not marked as a flags type.
18686 // If the value stored in the configuration database is not a valid
18687 // value for the flags type then this function will return the default
18688 // value.
18689 // RETURNS: the flags value
18690 // <key>: the key to get the value for
18691 uint get_flags()(char* key) {
18692 return g_settings_get_flags(&this, key);
18695 // VERSION: 2.26
18696 // Returns whether the #GSettings object has any unapplied
18697 // changes. This can only be the case if it is in 'delayed-apply' mode.
18698 // RETURNS: %TRUE if @settings has unapplied changes
18699 int get_has_unapplied()() {
18700 return g_settings_get_has_unapplied(&this);
18703 // VERSION: 2.26
18704 // Gets the value that is stored at @key in @settings.
18706 // A convenience variant of g_settings_get() for 32-bit integers.
18708 // It is a programmer error to give a @key that isn't specified as
18709 // having a int32 type in the schema for @settings.
18710 // RETURNS: an integer
18711 // <key>: the key to get the value for
18712 int get_int()(char* key) {
18713 return g_settings_get_int(&this, key);
18716 // Gets the value that is stored at @key in @settings, subject to
18717 // application-level validation/mapping.
18719 // You should use this function when the application needs to perform
18720 // some processing on the value of the key (for example, parsing). The
18721 // @mapping function performs that processing. If the function
18722 // indicates that the processing was unsuccessful (due to a parse error,
18723 // for example) then the mapping is tried again with another value.
18725 // This allows a robust 'fall back to defaults' behaviour to be
18726 // implemented somewhat automatically.
18728 // The first value that is tried is the user's setting for the key. If
18729 // the mapping function fails to map this value, other values may be
18730 // tried in an unspecified order (system or site defaults, translated
18731 // schema default values, untranslated schema default values, etc).
18733 // If the mapping function fails for all possible values, one additional
18734 // attempt is made: the mapping function is called with a %NULL value.
18735 // If the mapping function still indicates failure at this point then
18736 // the application will be aborted.
18738 // The result parameter for the @mapping function is pointed to a
18739 // #gpointer which is initially set to %NULL. The same pointer is given
18740 // to each invocation of @mapping. The final value of that #gpointer is
18741 // what is returned by this function. %NULL is valid; it is returned
18742 // just as any other value would be.
18743 // RETURNS: the result, which may be %NULL
18744 // <key>: the key to get the value for
18745 // <mapping>: the function to map the value in the settings database to the value used by the application
18746 // <user_data>: user data for @mapping
18747 void* /*new*/ get_mapped()(char* key, SettingsGetMapping mapping, void* user_data) {
18748 return g_settings_get_mapped(&this, key, mapping, user_data);
18751 // VERSION: 2.28
18752 // Queries the range of a key.
18754 // This function will return a #GVariant that fully describes the range
18755 // of values that are valid for @key.
18757 // The type of #GVariant returned is <literal>(sv)</literal>. The
18758 // string describes the type of range restriction in effect. The type
18759 // and meaning of the value contained in the variant depends on the
18760 // string.
18762 // If the string is <literal>'type'</literal> then the variant contains
18763 // an empty array. The element type of that empty array is the expected
18764 // type of value and all values of that type are valid.
18766 // If the string is <literal>'enum'</literal> then the variant contains
18767 // an array enumerating the possible values. Each item in the array is
18768 // a possible valid value and no other values are valid.
18770 // If the string is <literal>'flags'</literal> then the variant contains
18771 // an array. Each item in the array is a value that may appear zero or
18772 // one times in an array to be used as the value for this key. For
18773 // example, if the variant contained the array <literal>['x',
18774 // 'y']</literal> then the valid values for the key would be
18775 // <literal>[]</literal>, <literal>['x']</literal>,
18776 // <literal>['y']</literal>, <literal>['x', 'y']</literal> and
18777 // <literal>['y', 'x']</literal>.
18779 // Finally, if the string is <literal>'range'</literal> then the variant
18780 // contains a pair of like-typed values -- the minimum and maximum
18781 // permissible values for this key.
18783 // This information should not be used by normal programs. It is
18784 // considered to be a hint for introspection purposes. Normal programs
18785 // should already know what is permitted by their own schema. The
18786 // format may change in any way in the future -- but particularly, new
18787 // forms may be added to the possibilities described above.
18789 // It is a programmer error to give a @key that isn't contained in the
18790 // schema for @settings.
18792 // You should free the returned value with g_variant_unref() when it is
18793 // no longer needed.
18794 // RETURNS: a #GVariant describing the range
18795 // <key>: the key to query the range of
18796 GLib2.Variant* /*new*/ get_range()(char* key) {
18797 return g_settings_get_range(&this, key);
18800 // VERSION: 2.26
18801 // Gets the value that is stored at @key in @settings.
18803 // A convenience variant of g_settings_get() for strings.
18805 // It is a programmer error to give a @key that isn't specified as
18806 // having a string type in the schema for @settings.
18807 // RETURNS: a newly-allocated string
18808 // <key>: the key to get the value for
18809 char* /*new*/ get_string()(char* key) {
18810 return g_settings_get_string(&this, key);
18813 // VERSION: 2.26
18814 // A convenience variant of g_settings_get() for string arrays.
18816 // It is a programmer error to give a @key that isn't specified as
18817 // having an array of strings type in the schema for @settings.
18819 // newly-allocated, %NULL-terminated array of strings, the value that
18820 // is stored at @key in @settings.
18821 // RETURNS: a
18822 // <key>: the key to get the value for
18823 char** /*new*/ get_strv()(char* key) {
18824 return g_settings_get_strv(&this, key);
18827 // VERSION: 2.30
18828 // Gets the value that is stored at @key in @settings.
18830 // A convenience variant of g_settings_get() for 32-bit unsigned
18831 // integers.
18833 // It is a programmer error to give a @key that isn't specified as
18834 // having a uint32 type in the schema for @settings.
18835 // RETURNS: an unsigned integer
18836 // <key>: the key to get the value for
18837 uint get_uint()(char* key) {
18838 return g_settings_get_uint(&this, key);
18841 // VERSION: 2.26
18842 // Gets the value that is stored in @settings for @key.
18844 // It is a programmer error to give a @key that isn't contained in the
18845 // schema for @settings.
18846 // RETURNS: a new #GVariant
18847 // <key>: the key to get the value for
18848 GLib2.Variant* /*new*/ get_value()(char* key) {
18849 return g_settings_get_value(&this, key);
18852 // VERSION: 2.26
18853 // Finds out if a key can be written or not
18854 // RETURNS: %TRUE if the key @name is writable
18855 // <name>: the name of a key
18856 int is_writable()(char* name) {
18857 return g_settings_is_writable(&this, name);
18860 // Gets the list of children on @settings.
18862 // The list is exactly the list of strings for which it is not an error
18863 // to call g_settings_get_child().
18865 // For GSettings objects that are lists, this value can change at any
18866 // time and you should connect to the "children-changed" signal to watch
18867 // for those changes. Note that there is a race condition here: you may
18868 // request a child after listing it only for it to have been destroyed
18869 // in the meantime. For this reason, g_settings_get_child() may return
18870 // %NULL even for a child that was listed by this function.
18872 // For GSettings objects that are not lists, you should probably not be
18873 // calling this function from "normal" code (since you should already
18874 // know what children are in your schema). This function may still be
18875 // useful there for introspection reasons, however.
18877 // You should free the return value with g_strfreev() when you are done
18878 // with it.
18879 // RETURNS: a list of the children on @settings
18880 char** /*new*/ list_children()() {
18881 return g_settings_list_children(&this);
18884 // Introspects the list of keys on @settings.
18886 // You should probably not be calling this function from "normal" code
18887 // (since you should already know what keys are in your schema). This
18888 // function is intended for introspection reasons.
18890 // You should free the return value with g_strfreev() when you are done
18891 // with it.
18892 // RETURNS: a list of the keys on @settings
18893 char** /*new*/ list_keys()() {
18894 return g_settings_list_keys(&this);
18897 // VERSION: 2.28
18898 // Checks if the given @value is of the correct type and within the
18899 // permitted range for @key.
18901 // This API is not intended to be used by normal programs -- they should
18902 // already know what is permitted by their own schemas. This API is
18903 // meant to be used by programs such as editors or commandline tools.
18905 // It is a programmer error to give a @key that isn't contained in the
18906 // schema for @settings.
18907 // RETURNS: %TRUE if @value is valid for @key
18908 // <key>: the key to check
18909 // <value>: the value to check
18910 int range_check()(char* key, GLib2.Variant* value) {
18911 return g_settings_range_check(&this, key, value);
18914 // Resets @key to its default value.
18916 // This call resets the key, as much as possible, to its default value.
18917 // That might the value specified in the schema or the one set by the
18918 // administrator.
18919 // <key>: the name of a key
18920 void reset()(char* key) {
18921 g_settings_reset(&this, key);
18924 // Reverts all non-applied changes to the settings. This function
18925 // does nothing unless @settings is in 'delay-apply' mode; see
18926 // g_settings_delay(). In the normal case settings are always applied
18927 // immediately.
18929 // Change notifications will be emitted for affected keys.
18930 void revert()() {
18931 g_settings_revert(&this);
18934 // Unintrospectable method: set() / g_settings_set()
18935 // VERSION: 2.26
18936 // Sets @key in @settings to @value.
18938 // A convenience function that combines g_settings_set_value() with
18939 // g_variant_new().
18941 // It is a programmer error to give a @key that isn't contained in the
18942 // schema for @settings or for the #GVariantType of @format to mismatch
18943 // the type given in the schema.
18945 // %FALSE if the key was not writable
18946 // RETURNS: %TRUE if setting the key succeeded,
18947 // <key>: the name of the key to set
18948 // <format>: a #GVariant format string
18949 /+ Not available -- variadic methods unsupported - use the C function directly.
18950 alias g_settings_set set; // Variadic
18953 // VERSION: 2.26
18954 // Sets @key in @settings to @value.
18956 // A convenience variant of g_settings_set() for booleans.
18958 // It is a programmer error to give a @key that isn't specified as
18959 // having a boolean type in the schema for @settings.
18961 // %FALSE if the key was not writable
18962 // RETURNS: %TRUE if setting the key succeeded,
18963 // <key>: the name of the key to set
18964 // <value>: the value to set it to
18965 int set_boolean()(char* key, int value) {
18966 return g_settings_set_boolean(&this, key, value);
18969 // VERSION: 2.26
18970 // Sets @key in @settings to @value.
18972 // A convenience variant of g_settings_set() for doubles.
18974 // It is a programmer error to give a @key that isn't specified as
18975 // having a 'double' type in the schema for @settings.
18977 // %FALSE if the key was not writable
18978 // RETURNS: %TRUE if setting the key succeeded,
18979 // <key>: the name of the key to set
18980 // <value>: the value to set it to
18981 int set_double()(char* key, double value) {
18982 return g_settings_set_double(&this, key, value);
18985 // Looks up the enumerated type nick for @value and writes it to @key,
18986 // within @settings.
18988 // It is a programmer error to give a @key that isn't contained in the
18989 // schema for @settings or is not marked as an enumerated type, or for
18990 // @value not to be a valid value for the named type.
18992 // After performing the write, accessing @key directly with
18993 // g_settings_get_string() will return the 'nick' associated with
18994 // @value.
18995 // RETURNS: %TRUE, if the set succeeds
18996 // <key>: a key, within @settings
18997 // <value>: an enumerated value
18998 int set_enum()(char* key, int value) {
18999 return g_settings_set_enum(&this, key, value);
19002 // Looks up the flags type nicks for the bits specified by @value, puts
19003 // them in an array of strings and writes the array to @key, within
19004 // @settings.
19006 // It is a programmer error to give a @key that isn't contained in the
19007 // schema for @settings or is not marked as a flags type, or for @value
19008 // to contain any bits that are not value for the named type.
19010 // After performing the write, accessing @key directly with
19011 // g_settings_get_strv() will return an array of 'nicks'; one for each
19012 // bit in @value.
19013 // RETURNS: %TRUE, if the set succeeds
19014 // <key>: a key, within @settings
19015 // <value>: a flags value
19016 int set_flags()(char* key, uint value) {
19017 return g_settings_set_flags(&this, key, value);
19020 // VERSION: 2.26
19021 // Sets @key in @settings to @value.
19023 // A convenience variant of g_settings_set() for 32-bit integers.
19025 // It is a programmer error to give a @key that isn't specified as
19026 // having a int32 type in the schema for @settings.
19028 // %FALSE if the key was not writable
19029 // RETURNS: %TRUE if setting the key succeeded,
19030 // <key>: the name of the key to set
19031 // <value>: the value to set it to
19032 int set_int()(char* key, int value) {
19033 return g_settings_set_int(&this, key, value);
19036 // VERSION: 2.26
19037 // Sets @key in @settings to @value.
19039 // A convenience variant of g_settings_set() for strings.
19041 // It is a programmer error to give a @key that isn't specified as
19042 // having a string type in the schema for @settings.
19044 // %FALSE if the key was not writable
19045 // RETURNS: %TRUE if setting the key succeeded,
19046 // <key>: the name of the key to set
19047 // <value>: the value to set it to
19048 int set_string()(char* key, char* value) {
19049 return g_settings_set_string(&this, key, value);
19052 // VERSION: 2.26
19053 // Sets @key in @settings to @value.
19055 // A convenience variant of g_settings_set() for string arrays. If
19056 // @value is %NULL, then @key is set to be the empty array.
19058 // It is a programmer error to give a @key that isn't specified as
19059 // having an array of strings type in the schema for @settings.
19061 // %FALSE if the key was not writable
19062 // RETURNS: %TRUE if setting the key succeeded,
19063 // <key>: the name of the key to set
19064 // <value>: the value to set it to, or %NULL
19065 int set_strv()(char* key, char** value=null) {
19066 return g_settings_set_strv(&this, key, value);
19069 // VERSION: 2.30
19070 // Sets @key in @settings to @value.
19072 // A convenience variant of g_settings_set() for 32-bit unsigned
19073 // integers.
19075 // It is a programmer error to give a @key that isn't specified as
19076 // having a uint32 type in the schema for @settings.
19078 // %FALSE if the key was not writable
19079 // RETURNS: %TRUE if setting the key succeeded,
19080 // <key>: the name of the key to set
19081 // <value>: the value to set it to
19082 int set_uint()(char* key, uint value) {
19083 return g_settings_set_uint(&this, key, value);
19086 // VERSION: 2.26
19087 // Sets @key in @settings to @value.
19089 // It is a programmer error to give a @key that isn't contained in the
19090 // schema for @settings or for @value to have the incorrect type, per
19091 // the schema.
19093 // If @value is floating then this function consumes the reference.
19095 // %FALSE if the key was not writable
19096 // RETURNS: %TRUE if setting the key succeeded,
19097 // <key>: the name of the key to set
19098 // <value>: a #GVariant of the correct type
19099 int set_value()(char* key, GLib2.Variant* value) {
19100 return g_settings_set_value(&this, key, value);
19103 // The "change-event" signal is emitted once per change event that
19104 // affects this settings object. You should connect to this signal
19105 // only if you are interested in viewing groups of changes before they
19106 // are split out into multiple emissions of the "changed" signal.
19107 // For most use cases it is more appropriate to use the "changed" signal.
19109 // In the event that the change event applies to one or more specified
19110 // keys, @keys will be an array of #GQuark of length @n_keys. In the
19111 // event that the change event applies to the #GSettings object as a
19112 // whole (ie: potentially every key has been changed) then @keys will
19113 // be %NULL and @n_keys will be 0.
19115 // The default handler for this signal invokes the "changed" signal
19116 // for each affected key. If any other connected handler returns
19117 // %TRUE then this default functionality will be suppressed.
19119 // event. FALSE to propagate the event further.
19120 // RETURNS: %TRUE to stop other handlers from being invoked for the
19121 // <keys>: an array of #GQuark<!-- -->s for the changed keys, or %NULL
19122 // <n_keys>: the length of the @keys array, or 0
19123 extern (C) alias static c_int function (Settings* this_, GLib2.Quark* keys, int n_keys, void* user_data=null) signal_change_event;
19125 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
19126 return super_.signal_connect!name(cb, data, cf);
19129 ulong signal_connect(string name:"change-event", CB:signal_change_event)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
19130 return signal_connect_data!()(&this, cast(char*)"change-event",
19131 cast(GObject2.Callback)cb, data, null, cf);
19134 // The "changed" signal is emitted when a key has potentially changed.
19135 // You should call one of the g_settings_get() calls to check the new
19136 // value.
19138 // This signal supports detailed connections. You can connect to the
19139 // detailed signal "changed::x" in order to only receive callbacks
19140 // when key "x" changes.
19141 // <key>: the name of the key that changed
19142 extern (C) alias static void function (Settings* this_, char* key, void* user_data=null) signal_changed;
19143 ulong signal_connect(string name:"changed", CB:signal_changed)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
19144 return signal_connect_data!()(&this, cast(char*)"changed",
19145 cast(GObject2.Callback)cb, data, null, cf);
19148 // The "writable-change-event" signal is emitted once per writability
19149 // change event that affects this settings object. You should connect
19150 // to this signal if you are interested in viewing groups of changes
19151 // before they are split out into multiple emissions of the
19152 // "writable-changed" signal. For most use cases it is more
19153 // appropriate to use the "writable-changed" signal.
19155 // In the event that the writability change applies only to a single
19156 // key, @key will be set to the #GQuark for that key. In the event
19157 // that the writability change affects the entire settings object,
19158 // @key will be 0.
19160 // The default handler for this signal invokes the "writable-changed"
19161 // and "changed" signals for each affected key. This is done because
19162 // changes in writability might also imply changes in value (if for
19163 // example, a new mandatory setting is introduced). If any other
19164 // connected handler returns %TRUE then this default functionality
19165 // will be suppressed.
19167 // event. FALSE to propagate the event further.
19168 // RETURNS: %TRUE to stop other handlers from being invoked for the
19169 // <key>: the quark of the key, or 0
19170 extern (C) alias static c_int function (Settings* this_, c_uint key, void* user_data=null) signal_writable_change_event;
19171 ulong signal_connect(string name:"writable-change-event", CB:signal_writable_change_event)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
19172 return signal_connect_data!()(&this, cast(char*)"writable-change-event",
19173 cast(GObject2.Callback)cb, data, null, cf);
19176 // The "writable-changed" signal is emitted when the writability of a
19177 // key has potentially changed. You should call
19178 // g_settings_is_writable() in order to determine the new status.
19180 // This signal supports detailed connections. You can connect to the
19181 // detailed signal "writable-changed::x" in order to only receive
19182 // callbacks when the writability of "x" changes.
19183 // <key>: the key
19184 extern (C) alias static void function (Settings* this_, char* key, void* user_data=null) signal_writable_changed;
19185 ulong signal_connect(string name:"writable-changed", CB:signal_writable_changed)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
19186 return signal_connect_data!()(&this, cast(char*)"writable-changed",
19187 cast(GObject2.Callback)cb, data, null, cf);
19192 // The #GSettingsBackend interface defines a generic interface for
19193 // non-strictly-typed data that is stored in a hierarchy. To implement
19194 // an alternative storage backend for #GSettings, you need to implement
19195 // the #GSettingsBackend interface and then make it implement the
19196 // extension point #G_SETTINGS_BACKEND_EXTENSION_POINT_NAME.
19198 // The interface defines methods for reading and writing values, a
19199 // method for determining if writing of certain values will fail
19200 // (lockdown) and a change notification mechanism.
19202 // The semantics of the interface are very precisely defined and
19203 // implementations must carefully adhere to the expectations of
19204 // callers that are documented on each of the interface methods.
19206 // Some of the GSettingsBackend functions accept or return a #GTree.
19207 // These trees always have strings as keys and #GVariant as values.
19208 // g_settings_backend_create_tree() is a convenience function to create
19209 // suitable trees.
19211 // <note><para>
19212 // The #GSettingsBackend API is exported to allow third-party
19213 // implementations, but does not carry the same stability guarantees
19214 // as the public GIO API. For this reason, you have to define the
19215 // C preprocessor symbol #G_SETTINGS_ENABLE_BACKEND before including
19216 // <filename>gio/gsettingsbackend.h</filename>
19217 // </para></note>
19218 struct SettingsBackend {
19222 // Flags used when creating a binding. These flags determine in which
19223 // direction the binding works. The default is to synchronize in both
19224 // directions.
19225 enum SettingsBindFlags {
19226 DEFAULT = 0,
19227 GET = 1,
19228 SET = 2,
19229 NO_SENSITIVITY = 4,
19230 GET_NO_CHANGES = 8,
19231 INVERT_BOOLEAN = 16
19234 // The type for the function that is used to convert from #GSettings to
19235 // an object property. The @value is already initialized to hold values
19236 // of the appropriate type.
19237 // RETURNS: %TRUE if the conversion succeeded, %FALSE in case of an error
19238 // <value>: return location for the property value
19239 // <variant>: the #GVariant
19240 // <user_data>: user data that was specified when the binding was created
19241 extern (C) alias int function (GObject2.Value* value, GLib2.Variant* variant, void* user_data) SettingsBindGetMapping;
19244 // The type for the function that is used to convert an object property
19245 // value to a #GVariant for storing it in #GSettings.
19247 // or %NULL in case of an error
19248 // RETURNS: a new #GVariant holding the data from @value,
19249 // <value>: a #GValue containing the property value to map
19250 // <expected_type>: the #GVariantType to create
19251 // <user_data>: user data that was specified when the binding was created
19252 extern (C) alias GLib2.Variant* /*new*/ function (GObject2.Value* value, GLib2.VariantType* expected_type, void* user_data) SettingsBindSetMapping;
19254 struct SettingsClass {
19255 GObject2.ObjectClass parent_class;
19256 extern (C) void function (Settings* settings, char* key) writable_changed;
19257 extern (C) void function (Settings* settings, char* key) changed;
19258 extern (C) int function (Settings* settings, GLib2.Quark key) writable_change_event;
19259 extern (C) int function (Settings* settings, GLib2.Quark* keys, int n_keys) change_event;
19260 void*[20] padding;
19264 // The type of the function that is used to convert from a value stored
19265 // in a #GSettings to a value that is useful to the application.
19267 // If the value is successfully mapped, the result should be stored at
19268 // @result and %TRUE returned. If mapping fails (for example, if @value
19269 // is not in the right format) then %FALSE should be returned.
19271 // If @value is %NULL then it means that the mapping function is being
19272 // given a "last chance" to successfully return a valid value. %TRUE
19273 // must be returned in this case.
19274 // RETURNS: %TRUE if the conversion succeeded, %FALSE in case of an error
19275 // <value>: the #GVariant to map, or %NULL
19276 // <result>: the result of the mapping
19277 // <user_data>: the user data that was passed to g_settings_get_mapped()
19278 extern (C) alias int function (GLib2.Variant* value, /*out*/ void** result, void* user_data) SettingsGetMapping;
19280 struct SettingsPrivate {
19284 // The #GSettingsSchemaSource and #GSettingsSchema APIs provide a
19285 // mechanism for advanced control over the loading of schemas and a
19286 // mechanism for introspecting their content.
19288 // Plugin loading systems that wish to provide plugins a way to access
19289 // settings face the problem of how to make the schemas for these
19290 // settings visible to GSettings. Typically, a plugin will want to ship
19291 // the schema along with itself and it won't be installed into the
19292 // standard system directories for schemas.
19294 // #GSettingsSchemaSource provides a mechanism for dealing with this by
19295 // allowing the creation of a new 'schema source' from which schemas can
19296 // be acquired. This schema source can then become part of the metadata
19297 // associated with the plugin and queried whenever the plugin requires
19298 // access to some settings.
19300 // Consider the following example:
19302 // |[
19303 // typedef struct
19304 // {
19305 // ...
19306 // GSettingsSchemaSource *schema_source;
19307 // ...
19308 // } Plugin;
19310 // Plugin *
19311 // initialise_plugin (const gchar *dir)
19312 // {
19313 // Plugin *plugin;
19315 // ...
19317 // plugin->schema_source =
19318 // g_settings_new_schema_source_from_directory (dir,
19319 // g_settings_schema_source_get_default (), FALSE, NULL);
19321 // ...
19323 // return plugin;
19324 // }
19326 // ...
19328 // GSettings *
19329 // plugin_get_settings (Plugin *plugin,
19330 // const gchar *schema_id)
19331 // {
19332 // GSettingsSchema *schema;
19334 // if (schema_id == NULL)
19335 // schema_id = plugin->identifier;
19337 // schema = g_settings_schema_source_lookup (plugin->schema_source,
19338 // schema_id, FALSE);
19340 // if (schema == NULL)
19341 // {
19342 // ... disable the plugin or abort, etc ...
19343 // }
19345 // return g_settings_new_full (schema, NULL, NULL);
19346 // }
19347 // ]|
19349 // The code above shows how hooks should be added to the code that
19350 // initialises (or enables) the plugin to create the schema source and
19351 // how an API can be added to the plugin system to provide a convenient
19352 // way for the plugin to access its settings, using the schemas that it
19353 // ships.
19355 // From the standpoint of the plugin, it would need to ensure that it
19356 // ships a gschemas.compiled file as part of itself, and then simply do
19357 // the following:
19359 // |[
19360 // {
19361 // GSettings *settings;
19362 // gint some_value;
19364 // settings = plugin_get_settings (self, NULL);
19365 // some_value = g_settings_get_int (settings, "some-value");
19366 // ...
19367 // }
19368 // ]|
19370 // It's also possible that the plugin system expects the schema source
19371 // files (ie: .gschema.xml files) instead of a gschemas.compiled file.
19372 // In that case, the plugin loading system must compile the schemas for
19373 // itself before attempting to create the settings source.
19374 struct SettingsSchema /* Version 2.32 */ {
19376 // Get the ID of @schema.
19377 // RETURNS: the ID
19378 char* get_id()() {
19379 return g_settings_schema_get_id(&this);
19382 // VERSION: 2.32
19383 // Gets the path associated with @schema, or %NULL.
19385 // Schemas may be single-instance or relocatable. Single-instance
19386 // schemas correspond to exactly one set of keys in the backend
19387 // database: those located at the path returned by this function.
19389 // Relocatable schemas can be referenced by other schemas and can
19390 // threfore describe multiple sets of keys at different locations. For
19391 // relocatable schemas, this function will return %NULL.
19392 // RETURNS: the path of the schema, or %NULL
19393 char* get_path()() {
19394 return g_settings_schema_get_path(&this);
19397 // VERSION: 2.32
19398 // Increase the reference count of @schema, returning a new reference.
19399 // RETURNS: a new reference to @schema
19400 SettingsSchema* /*new*/ ref_()() {
19401 return g_settings_schema_ref(&this);
19404 // VERSION: 2.32
19405 // Decrease the reference count of @schema, possibly freeing it.
19406 void unref()() {
19407 g_settings_schema_unref(&this);
19411 // This is an opaque structure type. You may not access it directly.
19412 struct SettingsSchemaSource /* Version 2.32 */ {
19414 // VERSION: 2.32
19415 // Attempts to create a new schema source corresponding to the contents
19416 // of the given directory.
19418 // This function is not required for normal uses of #GSettings but it
19419 // may be useful to authors of plugin management systems.
19421 // The directory should contain a file called
19422 // <filename>gschemas.compiled</filename> as produced by
19423 // <command>glib-compile-schemas</command>.
19425 // If @trusted is %TRUE then <filename>gschemas.compiled</filename> is
19426 // trusted not to be corrupted. This assumption has a performance
19427 // advantage, but can result in crashes or inconsistent behaviour in the
19428 // case of a corrupted file. Generally, you should set @trusted to
19429 // %TRUE for files installed by the system and to %FALSE for files in
19430 // the home directory.
19432 // If @parent is non-%NULL then there are two effects.
19434 // First, if g_settings_schema_source_lookup() is called with the
19435 // @recursive flag set to %TRUE and the schema can not be found in the
19436 // source, the lookup will recurse to the parent.
19438 // Second, any references to other schemas specified within this
19439 // source (ie: <literal>child</literal> or <literal>extents</literal>)
19440 // references may be resolved from the @parent.
19442 // For this second reason, except in very unusual situations, the
19443 // @parent should probably be given as the default schema source, as
19444 // returned by g_settings_schema_source_get_default().
19445 // <directory>: the filename of a directory
19446 // <parent>: a #GSettingsSchemaSource, or %NULL
19447 // <trusted>: %TRUE, if the directory is trusted
19448 static SettingsSchemaSource* /*new*/ new_from_directory()(char* directory, SettingsSchemaSource* parent, int trusted, GLib2.Error** error=null) {
19449 return g_settings_schema_source_new_from_directory(directory, parent, trusted, error);
19452 // VERSION: 2.32
19453 // Looks up a schema with the identifier @schema_id in @source.
19455 // This function is not required for normal uses of #GSettings but it
19456 // may be useful to authors of plugin management systems or to those who
19457 // want to introspect the content of schemas.
19459 // If the schema isn't found directly in @source and @recursive is %TRUE
19460 // then the parent sources will also be checked.
19462 // If the schema isn't found, %NULL is returned.
19463 // RETURNS: a new #GSettingsSchema
19464 // <schema_id>: a schema ID
19465 // <recursive>: %TRUE if the lookup should be recursive
19466 SettingsSchema* /*new*/ lookup()(char* schema_id, int recursive) {
19467 return g_settings_schema_source_lookup(&this, schema_id, recursive);
19470 // VERSION: 2.32
19471 // Increase the reference count of @source, returning a new reference.
19472 // RETURNS: a new reference to @source
19473 SettingsSchemaSource* /*new*/ ref_()() {
19474 return g_settings_schema_source_ref(&this);
19477 // VERSION: 2.32
19478 // Decrease the reference count of @source, possibly freeing it.
19479 void unref()() {
19480 g_settings_schema_source_unref(&this);
19483 // VERSION: 2.32
19484 // Gets the default system schema source.
19486 // This function is not required for normal uses of #GSettings but it
19487 // may be useful to authors of plugin management systems or to those who
19488 // want to introspect the content of schemas.
19490 // If no schemas are installed, %NULL will be returned.
19492 // The returned source may actually consist of multiple schema sources
19493 // from different directories, depending on which directories were given
19494 // in <envar>XDG_DATA_DIRS</envar> and
19495 // <envar>GSETTINGS_SCHEMA_DIR</envar>. For this reason, all lookups
19496 // performed against the default source should probably be done
19497 // recursively.
19498 // RETURNS: the default schema source
19499 static SettingsSchemaSource* get_default()() {
19500 return g_settings_schema_source_get_default();
19505 // A #GSimpleAction is the obvious simple implementation of the #GAction
19506 // interface. This is the easiest way to create an action for purposes of
19507 // adding it to a #GSimpleActionGroup.
19509 // See also #GtkAction.
19510 struct SimpleAction /* : GObject.Object */ {
19511 mixin Action.__interface__;
19512 alias method_parent this;
19513 alias method_parent super_;
19514 alias method_parent object;
19515 GObject2.Object method_parent;
19518 // VERSION: 2.28
19519 // Creates a new action.
19521 // The created action is stateless. See g_simple_action_new_stateful().
19522 // RETURNS: a new #GSimpleAction
19523 // <name>: the name of the action
19524 // <parameter_type>: the type of parameter to the activate function
19525 static SimpleAction* /*new*/ new_()(char* name, GLib2.VariantType* parameter_type=null) {
19526 return g_simple_action_new(name, parameter_type);
19529 // VERSION: 2.28
19530 // Creates a new stateful action.
19532 // @state is the initial state of the action. All future state values
19533 // must have the same #GVariantType as the initial state.
19535 // If the @state GVariant is floating, it is consumed.
19536 // RETURNS: a new #GSimpleAction
19537 // <name>: the name of the action
19538 // <parameter_type>: the type of the parameter to the activate function
19539 // <state>: the initial state of the action
19540 static SimpleAction* /*new*/ new_stateful()(char* name, GLib2.VariantType* parameter_type, GLib2.Variant* state) {
19541 return g_simple_action_new_stateful(name, parameter_type, state);
19544 // VERSION: 2.28
19545 // Sets the action as enabled or not.
19547 // An action must be enabled in order to be activated or in order to
19548 // have its state changed from outside callers.
19550 // This should only be called by the implementor of the action. Users
19551 // of the action should not attempt to modify its enabled flag.
19552 // <enabled>: whether the action is enabled
19553 void set_enabled()(int enabled) {
19554 g_simple_action_set_enabled(&this, enabled);
19557 // VERSION: 2.30
19558 // Sets the state of the action.
19560 // This directly updates the 'state' property to the given value.
19562 // This should only be called by the implementor of the action. Users
19563 // of the action should not attempt to directly modify the 'state'
19564 // property. Instead, they should call g_action_change_state() to
19565 // request the change.
19566 // <value>: the new #GVariant for the state
19567 void set_state()(GLib2.Variant* value) {
19568 g_simple_action_set_state(&this, value);
19571 // VERSION: 2.28
19572 // Indicates that the action was just activated.
19574 // @parameter will always be of the expected type. In the event that
19575 // an incorrect type was given, no signal will be emitted.
19576 // <parameter>: the parameter to the activation
19577 extern (C) alias static void function (SimpleAction* this_, GLib2.Variant* parameter=null, void* user_data=null) signal_activate;
19579 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
19580 return super_.signal_connect!name(cb, data, cf);
19583 ulong signal_connect(string name:"activate", CB:signal_activate)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
19584 return signal_connect_data!()(&this, cast(char*)"activate",
19585 cast(GObject2.Callback)cb, data, null, cf);
19588 // VERSION: 2.30
19589 // Indicates that the action just received a request to change its
19590 // state.
19592 // @value will always be of the correct state type. In the event that
19593 // an incorrect type was given, no signal will be emitted.
19595 // If no handler is connected to this signal then the default
19596 // behaviour is to call g_simple_action_set_state() to set the state
19597 // to the requested value. If you connect a signal handler then no
19598 // default action is taken. If the state should change then you must
19599 // call g_simple_action_set_state() from the handler.
19601 // <example>
19602 // <title>Example 'change-state' handler</title>
19603 // <programlisting>
19604 // static void
19605 // change_volume_state (GSimpleAction *action,
19606 // GVariant *value,
19607 // gpointer user_data)
19608 // {
19609 // gint requested;
19611 // requested = g_variant_get_int32 (value);
19613 // // Volume only goes from 0 to 10
19614 // if (0 <= requested && requested <= 10)
19615 // g_simple_action_set_state (action, value);
19616 // }
19617 // </programlisting>
19618 // </example>
19620 // The handler need not set the state to the requested value. It
19621 // could set it to any value at all, or take some other action.
19622 // <value>: the requested value for the state
19623 extern (C) alias static void function (SimpleAction* this_, GLib2.Variant* value=null, void* user_data=null) signal_change_state;
19624 ulong signal_connect(string name:"change-state", CB:signal_change_state)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
19625 return signal_connect_data!()(&this, cast(char*)"change-state",
19626 cast(GObject2.Callback)cb, data, null, cf);
19631 // #GSimpleActionGroup is a hash table filled with #GAction objects,
19632 // implementing the #GActionGroup and #GActionMap interfaces.
19633 struct SimpleActionGroup /* : GObject.Object */ /* Version 2.28 */ {
19634 mixin ActionGroup.__interface__;
19635 mixin ActionMap.__interface__;
19636 alias parent_instance this;
19637 alias parent_instance super_;
19638 alias parent_instance object;
19639 GObject2.Object parent_instance;
19640 private SimpleActionGroupPrivate* priv;
19643 // VERSION: 2.28
19644 // Creates a new, empty, #GSimpleActionGroup.
19645 // RETURNS: a new #GSimpleActionGroup
19646 static SimpleActionGroup* /*new*/ new_()() {
19647 return g_simple_action_group_new();
19650 // VERSION: 2.30
19651 // A convenience function for creating multiple #GSimpleAction instances
19652 // and adding them to the action group.
19653 // <entries>: a pointer to the first item in an array of #GActionEntry structs
19654 // <n_entries>: the length of @entries, or -1
19655 // <user_data>: the user data for signal connections
19656 void add_entries()(ActionEntry* entries, int n_entries, void* user_data) {
19657 g_simple_action_group_add_entries(&this, entries, n_entries, user_data);
19660 // VERSION: 2.28
19661 // Adds an action to the action group.
19663 // If the action group already contains an action with the same name as
19664 // @action then the old action is dropped from the group.
19666 // The action group takes its own reference on @action.
19667 // <action>: a #GAction
19668 void insert()(Action* action) {
19669 g_simple_action_group_insert(&this, action);
19672 // VERSION: 2.28
19673 // Looks up the action with the name @action_name in the group.
19675 // If no such action exists, returns %NULL.
19676 // RETURNS: a #GAction, or %NULL
19677 // <action_name>: the name of an action
19678 Action* lookup()(char* action_name) {
19679 return g_simple_action_group_lookup(&this, action_name);
19682 // VERSION: 2.28
19683 // Removes the named action from the action group.
19685 // If no action of this name is in the group then nothing happens.
19686 // <action_name>: the name of the action
19687 void remove()(char* action_name) {
19688 g_simple_action_group_remove(&this, action_name);
19692 struct SimpleActionGroupClass {
19693 private GObject2.ObjectClass parent_class;
19694 private void*[12] padding;
19697 struct SimpleActionGroupPrivate {
19701 // Implements #GAsyncResult for simple cases. Most of the time, this
19702 // will be all an application needs, and will be used transparently.
19703 // Because of this, #GSimpleAsyncResult is used throughout GIO for
19704 // handling asynchronous functions.
19706 // GSimpleAsyncResult handles #GAsyncReadyCallback<!-- -->s, error
19707 // reporting, operation cancellation and the final state of an operation,
19708 // completely transparent to the application. Results can be returned
19709 // as a pointer e.g. for functions that return data that is collected
19710 // asynchronously, a boolean value for checking the success or failure
19711 // of an operation, or a #gssize for operations which return the number
19712 // of bytes modified by the operation; all of the simple return cases
19713 // are covered.
19715 // Most of the time, an application will not need to know of the details
19716 // of this API; it is handled transparently, and any necessary operations
19717 // are handled by #GAsyncResult's interface. However, if implementing a
19718 // new GIO module, for writing language bindings, or for complex
19719 // applications that need better control of how asynchronous operations
19720 // are completed, it is important to understand this functionality.
19722 // GSimpleAsyncResults are tagged with the calling function to ensure
19723 // that asynchronous functions and their finishing functions are used
19724 // together correctly.
19726 // To create a new #GSimpleAsyncResult, call g_simple_async_result_new().
19727 // If the result needs to be created for a #GError, use
19728 // g_simple_async_result_new_from_error() or
19729 // g_simple_async_result_new_take_error(). If a #GError is not available
19730 // (e.g. the asynchronous operation's doesn't take a #GError argument),
19731 // but the result still needs to be created for an error condition, use
19732 // g_simple_async_result_new_error() (or g_simple_async_result_set_error_va()
19733 // if your application or binding requires passing a variable argument list
19734 // directly), and the error can then be propagated through the use of
19735 // g_simple_async_result_propagate_error().
19737 // An asynchronous operation can be made to ignore a cancellation event by
19738 // calling g_simple_async_result_set_handle_cancellation() with a
19739 // #GSimpleAsyncResult for the operation and %FALSE. This is useful for
19740 // operations that are dangerous to cancel, such as close (which would
19741 // cause a leak if cancelled before being run).
19743 // GSimpleAsyncResult can integrate into GLib's event loop, #GMainLoop,
19744 // or it can use #GThread<!-- -->s.
19745 // g_simple_async_result_complete() will finish an I/O task directly
19746 // from the point where it is called. g_simple_async_result_complete_in_idle()
19747 // will finish it from an idle handler in the <link
19748 // linkend="g-main-context-push-thread-default">thread-default main
19749 // context</link>. g_simple_async_result_run_in_thread() will run the
19750 // job in a separate thread and then deliver the result to the
19751 // thread-default main context.
19753 // To set the results of an asynchronous function,
19754 // g_simple_async_result_set_op_res_gpointer(),
19755 // g_simple_async_result_set_op_res_gboolean(), and
19756 // g_simple_async_result_set_op_res_gssize()
19757 // are provided, setting the operation's result to a gpointer, gboolean, or
19758 // gssize, respectively.
19760 // Likewise, to get the result of an asynchronous function,
19761 // g_simple_async_result_get_op_res_gpointer(),
19762 // g_simple_async_result_get_op_res_gboolean(), and
19763 // g_simple_async_result_get_op_res_gssize() are
19764 // provided, getting the operation's result as a gpointer, gboolean, and
19765 // gssize, respectively.
19767 // For the details of the requirements implementations must respect, see
19768 // #GAsyncResult. A typical implementation of an asynchronous operation
19769 // using GSimpleAsyncResult looks something like this:
19771 // |[
19772 // static void
19773 // baked_cb (Cake *cake,
19774 // gpointer user_data)
19775 // {
19776 // /&ast; In this example, this callback is not given a reference to the cake, so
19777 // &ast; the GSimpleAsyncResult has to take a reference to it.
19778 // &ast;/
19779 // GSimpleAsyncResult *result = user_data;
19781 // if (cake == NULL)
19782 // g_simple_async_result_set_error (result,
19783 // BAKER_ERRORS,
19784 // BAKER_ERROR_NO_FLOUR,
19785 // "Go to the supermarket");
19786 // else
19787 // g_simple_async_result_set_op_res_gpointer (result,
19788 // g_object_ref (cake),
19789 // g_object_unref);
19792 // /&ast; In this example, we assume that baked_cb is called as a callback from
19793 // &ast; the mainloop, so it's safe to complete the operation synchronously here.
19794 // &ast; If, however, _baker_prepare_cake () might call its callback without
19795 // &ast; first returning to the mainloop — inadvisable, but some APIs do so —
19796 // &ast; we would need to use g_simple_async_result_complete_in_idle().
19797 // &ast;/
19798 // g_simple_async_result_complete (result);
19799 // g_object_unref (result);
19800 // }
19802 // void
19803 // baker_bake_cake_async (Baker *self,
19804 // guint radius,
19805 // GAsyncReadyCallback callback,
19806 // gpointer user_data)
19807 // {
19808 // GSimpleAsyncResult *simple;
19809 // Cake *cake;
19811 // if (radius < 3)
19812 // {
19813 // g_simple_async_report_error_in_idle (G_OBJECT (self),
19814 // callback,
19815 // user_data,
19816 // BAKER_ERRORS,
19817 // BAKER_ERROR_TOO_SMALL,
19818 // "%ucm radius cakes are silly",
19819 // radius);
19820 // return;
19821 // }
19823 // simple = g_simple_async_result_new (G_OBJECT (self),
19824 // callback,
19825 // user_data,
19826 // baker_bake_cake_async);
19827 // cake = _baker_get_cached_cake (self, radius);
19829 // if (cake != NULL)
19830 // {
19831 // g_simple_async_result_set_op_res_gpointer (simple,
19832 // g_object_ref (cake),
19833 // g_object_unref);
19834 // g_simple_async_result_complete_in_idle (simple);
19835 // g_object_unref (simple);
19836 // /&ast; Drop the reference returned by _baker_get_cached_cake(); the
19837 // &ast; GSimpleAsyncResult has taken its own reference.
19838 // &ast;/
19839 // g_object_unref (cake);
19840 // return;
19841 // }
19843 // _baker_prepare_cake (self, radius, baked_cb, simple);
19844 // }
19846 // Cake *
19847 // baker_bake_cake_finish (Baker *self,
19848 // GAsyncResult *result,
19849 // GError **error)
19850 // {
19851 // GSimpleAsyncResult *simple;
19852 // Cake *cake;
19854 // g_return_val_if_fail (g_simple_async_result_is_valid (result,
19855 // G_OBJECT (self),
19856 // baker_bake_cake_async),
19857 // NULL);
19859 // simple = (GSimpleAsyncResult *) result;
19861 // if (g_simple_async_result_propagate_error (simple, error))
19862 // return NULL;
19864 // cake = CAKE (g_simple_async_result_get_op_res_gpointer (simple));
19865 // return g_object_ref (cake);
19866 // }
19867 // ]|
19868 struct SimpleAsyncResult /* : GObject.Object */ {
19869 mixin AsyncResult.__interface__;
19870 alias method_parent this;
19871 alias method_parent super_;
19872 alias method_parent object;
19873 GObject2.Object method_parent;
19876 // Creates a #GSimpleAsyncResult.
19877 // RETURNS: a #GSimpleAsyncResult.
19878 // <source_object>: a #GObject, or %NULL.
19879 // <callback>: a #GAsyncReadyCallback.
19880 // <user_data>: user data passed to @callback.
19881 // <source_tag>: the asynchronous function.
19882 static SimpleAsyncResult* /*new*/ new_()(GObject2.Object* source_object, AsyncReadyCallback callback, void* user_data, void* source_tag) {
19883 return g_simple_async_result_new(source_object, callback, user_data, source_tag);
19886 // Unintrospectable constructor: new_error() / g_simple_async_result_new_error()
19887 // Creates a new #GSimpleAsyncResult with a set error.
19888 // RETURNS: a #GSimpleAsyncResult.
19889 // <source_object>: a #GObject, or %NULL.
19890 // <callback>: a #GAsyncReadyCallback.
19891 // <user_data>: user data passed to @callback.
19892 // <domain>: a #GQuark.
19893 // <code>: an error code.
19894 // <format>: a string with format characters.
19895 alias g_simple_async_result_new_error new_error; // Variadic
19897 // Creates a #GSimpleAsyncResult from an error condition.
19898 // RETURNS: a #GSimpleAsyncResult.
19899 // <source_object>: a #GObject, or %NULL.
19900 // <callback>: a #GAsyncReadyCallback.
19901 // <user_data>: user data passed to @callback.
19902 // <error>: a #GError
19903 static SimpleAsyncResult* /*new*/ new_from_error()(GObject2.Object* source_object, AsyncReadyCallback callback, void* user_data, GLib2.Error* error) {
19904 return g_simple_async_result_new_from_error(source_object, callback, user_data, error);
19907 // Unintrospectable constructor: new_take_error() / g_simple_async_result_new_take_error()
19908 // VERSION: 2.28
19909 // Creates a #GSimpleAsyncResult from an error condition, and takes over the
19910 // caller's ownership of @error, so the caller does not need to free it anymore.
19911 // RETURNS: a #GSimpleAsyncResult
19912 // <source_object>: a #GObject, or %NULL
19913 // <callback>: a #GAsyncReadyCallback
19914 // <user_data>: user data passed to @callback
19915 // <error>: a #GError
19916 static SimpleAsyncResult* /*new*/ new_take_error()(GObject2.Object* source_object, AsyncReadyCallback callback, void* user_data, GLib2.Error* error) {
19917 return g_simple_async_result_new_take_error(source_object, callback, user_data, error);
19920 // VERSION: 2.20
19921 // Ensures that the data passed to the _finish function of an async
19922 // operation is consistent. Three checks are performed.
19924 // First, @result is checked to ensure that it is really a
19925 // #GSimpleAsyncResult. Second, @source is checked to ensure that it
19926 // matches the source object of @result. Third, @source_tag is
19927 // checked to ensure that it is either %NULL (as it is when the result was
19928 // created by g_simple_async_report_error_in_idle() or
19929 // g_simple_async_report_gerror_in_idle()) or equal to the
19930 // @source_tag argument given to g_simple_async_result_new() (which, by
19931 // convention, is a pointer to the _async function corresponding to the
19932 // _finish function from which this function is called).
19933 // RETURNS: #TRUE if all checks passed or #FALSE if any failed.
19934 // <result>: the #GAsyncResult passed to the _finish function.
19935 // <source>: the #GObject passed to the _finish function.
19936 // <source_tag>: the asynchronous function.
19937 static int is_valid()(AsyncResult* result, GObject2.Object* source, void* source_tag) {
19938 return g_simple_async_result_is_valid(result, source, source_tag);
19941 // Completes an asynchronous I/O job immediately. Must be called in
19942 // the thread where the asynchronous result was to be delivered, as it
19943 // invokes the callback directly. If you are in a different thread use
19944 // g_simple_async_result_complete_in_idle().
19946 // Calling this function takes a reference to @simple for as long as
19947 // is needed to complete the call.
19948 void complete()() {
19949 g_simple_async_result_complete(&this);
19952 // Completes an asynchronous function in an idle handler in the <link
19953 // linkend="g-main-context-push-thread-default">thread-default main
19954 // loop</link> of the thread that @simple was initially created in
19955 // (and re-pushes that context around the invocation of the callback).
19957 // Calling this function takes a reference to @simple for as long as
19958 // is needed to complete the call.
19959 void complete_in_idle()() {
19960 g_simple_async_result_complete_in_idle(&this);
19963 // Gets the operation result boolean from within the asynchronous result.
19965 // if the operation's result was %FALSE.
19966 // RETURNS: %TRUE if the operation's result was %TRUE, %FALSE
19967 int get_op_res_gboolean()() {
19968 return g_simple_async_result_get_op_res_gboolean(&this);
19971 // Unintrospectable method: get_op_res_gpointer() / g_simple_async_result_get_op_res_gpointer()
19972 // Gets a pointer result as returned by the asynchronous function.
19973 // RETURNS: a pointer from the result.
19974 void* get_op_res_gpointer()() {
19975 return g_simple_async_result_get_op_res_gpointer(&this);
19978 // Gets a gssize from the asynchronous result.
19979 // RETURNS: a gssize returned from the asynchronous function.
19980 ssize_t get_op_res_gssize()() {
19981 return g_simple_async_result_get_op_res_gssize(&this);
19984 // Unintrospectable method: get_source_tag() / g_simple_async_result_get_source_tag()
19985 // Gets the source tag for the #GSimpleAsyncResult.
19986 // RETURNS: a #gpointer to the source object for the #GSimpleAsyncResult.
19987 void* get_source_tag()() {
19988 return g_simple_async_result_get_source_tag(&this);
19991 // Propagates an error from within the simple asynchronous result to
19992 // a given destination.
19993 // RETURNS: %TRUE if the error was propagated to @dest. %FALSE otherwise.
19994 int propagate_error()(GLib2.Error** error=null) {
19995 return g_simple_async_result_propagate_error(&this, error);
19998 // Unintrospectable method: run_in_thread() / g_simple_async_result_run_in_thread()
19999 // Runs the asynchronous job in a separate thread and then calls
20000 // g_simple_async_result_complete_in_idle() on @simple to return
20001 // the result to the appropriate main loop.
20003 // Calling this function takes a reference to @simple for as long as
20004 // is needed to run the job and report its completion.
20005 // <func>: a #GSimpleAsyncThreadFunc.
20006 // <io_priority>: the io priority of the request.
20007 // <cancellable>: optional #GCancellable object, %NULL to ignore.
20008 void run_in_thread()(SimpleAsyncThreadFunc func, int io_priority, Cancellable* cancellable=null) {
20009 g_simple_async_result_run_in_thread(&this, func, io_priority, cancellable);
20012 // Unintrospectable method: set_error() / g_simple_async_result_set_error()
20013 // Sets an error within the asynchronous result without a #GError.
20014 // <domain>: a #GQuark (usually #G_IO_ERROR).
20015 // <code>: an error code.
20016 // <format>: a formatted error reporting string.
20017 /+ Not available -- variadic methods unsupported - use the C function directly.
20018 alias g_simple_async_result_set_error set_error; // Variadic
20021 // Unintrospectable method: set_error_va() / g_simple_async_result_set_error_va()
20022 // Sets an error within the asynchronous result without a #GError.
20023 // Unless writing a binding, see g_simple_async_result_set_error().
20024 // <domain>: a #GQuark (usually #G_IO_ERROR).
20025 // <code>: an error code.
20026 // <format>: a formatted error reporting string.
20027 // <args>: va_list of arguments.
20028 void set_error_va()(GLib2.Quark domain, int code, char* format, va_list args) {
20029 g_simple_async_result_set_error_va(&this, domain, code, format, args);
20032 // Sets the result from a #GError.
20033 // <error>: #GError.
20034 void set_from_error()(GLib2.Error* error) {
20035 g_simple_async_result_set_from_error(&this, error);
20038 // Sets whether to handle cancellation within the asynchronous operation.
20039 // <handle_cancellation>: a #gboolean.
20040 void set_handle_cancellation()(int handle_cancellation) {
20041 g_simple_async_result_set_handle_cancellation(&this, handle_cancellation);
20044 // Sets the operation result to a boolean within the asynchronous result.
20045 // <op_res>: a #gboolean.
20046 void set_op_res_gboolean()(int op_res) {
20047 g_simple_async_result_set_op_res_gboolean(&this, op_res);
20050 // Unintrospectable method: set_op_res_gpointer() / g_simple_async_result_set_op_res_gpointer()
20051 // Sets the operation result within the asynchronous result to a pointer.
20052 // <op_res>: a pointer result from an asynchronous function.
20053 // <destroy_op_res>: a #GDestroyNotify function.
20054 void set_op_res_gpointer()(void* op_res, GLib2.DestroyNotify destroy_op_res) {
20055 g_simple_async_result_set_op_res_gpointer(&this, op_res, destroy_op_res);
20058 // Sets the operation result within the asynchronous result to
20059 // the given @op_res.
20060 // <op_res>: a #gssize.
20061 void set_op_res_gssize()(ssize_t op_res) {
20062 g_simple_async_result_set_op_res_gssize(&this, op_res);
20065 // Unintrospectable method: take_error() / g_simple_async_result_take_error()
20066 // VERSION: 2.28
20067 // Sets the result from @error, and takes over the caller's ownership
20068 // of @error, so the caller does not need to free it any more.
20069 // <error>: a #GError
20070 void take_error()(GLib2.Error* error) {
20071 g_simple_async_result_take_error(&this, error);
20075 struct SimpleAsyncResultClass {
20079 // Simple thread function that runs an asynchronous operation and
20080 // checks for cancellation.
20081 // <res>: a #GSimpleAsyncResult.
20082 // <object>: a #GObject.
20083 // <cancellable>: optional #GCancellable object, %NULL to ignore.
20084 extern (C) alias void function (SimpleAsyncResult* res, GObject2.Object* object, Cancellable* cancellable=null) SimpleAsyncThreadFunc;
20087 // #GSimplePermission is a trivial implementation of #GPermission that
20088 // represents a permission that is either always or never allowed. The
20089 // value is given at construction and doesn't change.
20091 // Calling request or release will result in errors.
20092 struct SimplePermission /* : Permission */ {
20093 alias method_parent this;
20094 alias method_parent super_;
20095 alias method_parent permission;
20096 Permission method_parent;
20099 // VERSION: 2.26
20100 // Creates a new #GPermission instance that represents an action that is
20101 // either always or never allowed.
20102 // RETURNS: the #GSimplePermission, as a #GPermission
20103 // <allowed>: %TRUE if the action is allowed
20104 static SimplePermission* /*new*/ new_()(int allowed) {
20105 return g_simple_permission_new(allowed);
20110 // A #GSocket is a low-level networking primitive. It is a more or less
20111 // direct mapping of the BSD socket API in a portable GObject based API.
20112 // It supports both the UNIX socket implementations and winsock2 on Windows.
20114 // #GSocket is the platform independent base upon which the higher level
20115 // network primitives are based. Applications are not typically meant to
20116 // use it directly, but rather through classes like #GSocketClient,
20117 // #GSocketService and #GSocketConnection. However there may be cases where
20118 // direct use of #GSocket is useful.
20120 // #GSocket implements the #GInitable interface, so if it is manually constructed
20121 // by e.g. g_object_new() you must call g_initable_init() and check the
20122 // results before using the object. This is done automatically in
20123 // g_socket_new() and g_socket_new_from_fd(), so these functions can return
20124 // %NULL.
20126 // Sockets operate in two general modes, blocking or non-blocking. When
20127 // in blocking mode all operations block until the requested operation
20128 // is finished or there is an error. In non-blocking mode all calls that
20129 // would block return immediately with a %G_IO_ERROR_WOULD_BLOCK error.
20130 // To know when a call would successfully run you can call g_socket_condition_check(),
20131 // or g_socket_condition_wait(). You can also use g_socket_create_source() and
20132 // attach it to a #GMainContext to get callbacks when I/O is possible.
20133 // Note that all sockets are always set to non blocking mode in the system, and
20134 // blocking mode is emulated in GSocket.
20136 // When working in non-blocking mode applications should always be able to
20137 // handle getting a %G_IO_ERROR_WOULD_BLOCK error even when some other
20138 // function said that I/O was possible. This can easily happen in case
20139 // of a race condition in the application, but it can also happen for other
20140 // reasons. For instance, on Windows a socket is always seen as writable
20141 // until a write returns %G_IO_ERROR_WOULD_BLOCK.
20143 // #GSocket<!-- -->s can be either connection oriented or datagram based.
20144 // For connection oriented types you must first establish a connection by
20145 // either connecting to an address or accepting a connection from another
20146 // address. For connectionless socket types the target/source address is
20147 // specified or received in each I/O operation.
20149 // All socket file descriptors are set to be close-on-exec.
20151 // Note that creating a #GSocket causes the signal %SIGPIPE to be
20152 // ignored for the remainder of the program. If you are writing a
20153 // command-line utility that uses #GSocket, you may need to take into
20154 // account the fact that your program will not automatically be killed
20155 // if it tries to write to %stdout after it has been closed.
20156 struct Socket /* : GObject.Object */ /* Version 2.22 */ {
20157 mixin Initable.__interface__;
20158 alias parent_instance this;
20159 alias parent_instance super_;
20160 alias parent_instance object;
20161 GObject2.Object parent_instance;
20162 SocketPrivate* priv;
20165 // VERSION: 2.22
20166 // Creates a new #GSocket with the defined family, type and protocol.
20167 // If @protocol is 0 (%G_SOCKET_PROTOCOL_DEFAULT) the default protocol type
20168 // for the family and type is used.
20170 // The @protocol is a family and type specific int that specifies what
20171 // kind of protocol to use. #GSocketProtocol lists several common ones.
20172 // Many families only support one protocol, and use 0 for this, others
20173 // support several and using 0 means to use the default protocol for
20174 // the family and type.
20176 // The protocol id is passed directly to the operating
20177 // system, so you can use protocols not listed in #GSocketProtocol if you
20178 // know the protocol number used for it.
20180 // Free the returned object with g_object_unref().
20181 // RETURNS: a #GSocket or %NULL on error.
20182 // <family>: the socket family to use, e.g. %G_SOCKET_FAMILY_IPV4.
20183 // <type>: the socket type to use.
20184 // <protocol>: the id of the protocol to use, or 0 for default.
20185 static Socket* /*new*/ new_()(SocketFamily family, SocketType type, SocketProtocol protocol, GLib2.Error** error=null) {
20186 return g_socket_new(family, type, protocol, error);
20189 // VERSION: 2.22
20190 // Creates a new #GSocket from a native file descriptor
20191 // or winsock SOCKET handle.
20193 // This reads all the settings from the file descriptor so that
20194 // all properties should work. Note that the file descriptor
20195 // will be set to non-blocking mode, independent on the blocking
20196 // mode of the #GSocket.
20198 // Free the returned object with g_object_unref().
20199 // RETURNS: a #GSocket or %NULL on error.
20200 // <fd>: a native socket file descriptor.
20201 static Socket* /*new*/ new_from_fd()(int fd, GLib2.Error** error=null) {
20202 return g_socket_new_from_fd(fd, error);
20205 // VERSION: 2.22
20206 // Accept incoming connections on a connection-based socket. This removes
20207 // the first outstanding connection request from the listening socket and
20208 // creates a #GSocket object for it.
20210 // The @socket must be bound to a local address with g_socket_bind() and
20211 // must be listening for incoming connections (g_socket_listen()).
20213 // If there are no outstanding connections then the operation will block
20214 // or return %G_IO_ERROR_WOULD_BLOCK if non-blocking I/O is enabled.
20215 // To be notified of an incoming connection, wait for the %G_IO_IN condition.
20217 // Free the returned object with g_object_unref().
20218 // RETURNS: a new #GSocket, or %NULL on error.
20219 // <cancellable>: a %GCancellable or %NULL
20220 Socket* /*new*/ accept()(Cancellable* cancellable, GLib2.Error** error=null) {
20221 return g_socket_accept(&this, cancellable, error);
20224 // VERSION: 2.22
20225 // When a socket is created it is attached to an address family, but it
20226 // doesn't have an address in this family. g_socket_bind() assigns the
20227 // address (sometimes called name) of the socket.
20229 // It is generally required to bind to a local address before you can
20230 // receive connections. (See g_socket_listen() and g_socket_accept() ).
20231 // In certain situations, you may also want to bind a socket that will be
20232 // used to initiate connections, though this is not normally required.
20234 // @allow_reuse should be %TRUE for server sockets (sockets that you will
20235 // eventually call g_socket_accept() on), and %FALSE for client sockets.
20236 // (Specifically, if it is %TRUE, then g_socket_bind() will set the
20237 // %SO_REUSEADDR flag on the socket, allowing it to bind @address even if
20238 // that address was previously used by another socket that has not yet been
20239 // fully cleaned-up by the kernel. Failing to set this flag on a server
20240 // socket may cause the bind call to return %G_IO_ERROR_ADDRESS_IN_USE if
20241 // the server program is stopped and then immediately restarted.)
20242 // RETURNS: %TRUE on success, %FALSE on error.
20243 // <address>: a #GSocketAddress specifying the local address.
20244 // <allow_reuse>: whether to allow reusing this address
20245 int bind()(SocketAddress* address, int allow_reuse, GLib2.Error** error=null) {
20246 return g_socket_bind(&this, address, allow_reuse, error);
20249 // VERSION: 2.22
20250 // Checks and resets the pending connect error for the socket.
20251 // This is used to check for errors when g_socket_connect() is
20252 // used in non-blocking mode.
20253 // RETURNS: %TRUE if no error, %FALSE otherwise, setting @error to the error
20254 int check_connect_result()(GLib2.Error** error=null) {
20255 return g_socket_check_connect_result(&this, error);
20258 // VERSION: 2.22
20259 // Closes the socket, shutting down any active connection.
20261 // Closing a socket does not wait for all outstanding I/O operations
20262 // to finish, so the caller should not rely on them to be guaranteed
20263 // to complete even if the close returns with no error.
20265 // Once the socket is closed, all other operations will return
20266 // %G_IO_ERROR_CLOSED. Closing a socket multiple times will not
20267 // return an error.
20269 // Sockets will be automatically closed when the last reference
20270 // is dropped, but you might want to call this function to make sure
20271 // resources are released as early as possible.
20273 // Beware that due to the way that TCP works, it is possible for
20274 // recently-sent data to be lost if either you close a socket while the
20275 // %G_IO_IN condition is set, or else if the remote connection tries to
20276 // send something to you after you close the socket but before it has
20277 // finished reading all of the data you sent. There is no easy generic
20278 // way to avoid this problem; the easiest fix is to design the network
20279 // protocol such that the client will never send data "out of turn".
20280 // Another solution is for the server to half-close the connection by
20281 // calling g_socket_shutdown() with only the @shutdown_write flag set,
20282 // and then wait for the client to notice this and close its side of the
20283 // connection, after which the server can safely call g_socket_close().
20284 // (This is what #GTcpConnection does if you call
20285 // g_tcp_connection_set_graceful_disconnect(). But of course, this
20286 // only works if the client will close its connection after the server
20287 // does.)
20288 // RETURNS: %TRUE on success, %FALSE on error
20289 int close()(GLib2.Error** error=null) {
20290 return g_socket_close(&this, error);
20293 // VERSION: 2.22
20294 // Checks on the readiness of @socket to perform operations.
20295 // The operations specified in @condition are checked for and masked
20296 // against the currently-satisfied conditions on @socket. The result
20297 // is returned.
20299 // Note that on Windows, it is possible for an operation to return
20300 // %G_IO_ERROR_WOULD_BLOCK even immediately after
20301 // g_socket_condition_check() has claimed that the socket is ready for
20302 // writing. Rather than calling g_socket_condition_check() and then
20303 // writing to the socket if it succeeds, it is generally better to
20304 // simply try writing to the socket right away, and try again later if
20305 // the initial attempt returns %G_IO_ERROR_WOULD_BLOCK.
20307 // It is meaningless to specify %G_IO_ERR or %G_IO_HUP in condition;
20308 // these conditions will always be set in the output if they are true.
20310 // This call never blocks.
20311 // RETURNS: the @GIOCondition mask of the current state
20312 // <condition>: a #GIOCondition mask to check
20313 GLib2.IOCondition condition_check()(GLib2.IOCondition condition) {
20314 return g_socket_condition_check(&this, condition);
20317 // VERSION: 2.22
20318 // Waits for @condition to become true on @socket. When the condition
20319 // is met, %TRUE is returned.
20321 // If @cancellable is cancelled before the condition is met, or if the
20322 // socket has a timeout set and it is reached before the condition is
20323 // met, then %FALSE is returned and @error, if non-%NULL, is set to
20324 // the appropriate value (%G_IO_ERROR_CANCELLED or
20325 // %G_IO_ERROR_TIMED_OUT).
20326 // RETURNS: %TRUE if the condition was met, %FALSE otherwise
20327 // <condition>: a #GIOCondition mask to wait for
20328 // <cancellable>: a #GCancellable, or %NULL
20329 int condition_wait()(GLib2.IOCondition condition, Cancellable* cancellable, GLib2.Error** error=null) {
20330 return g_socket_condition_wait(&this, condition, cancellable, error);
20333 // VERSION: 2.22
20334 // Connect the socket to the specified remote address.
20336 // For connection oriented socket this generally means we attempt to make
20337 // a connection to the @address. For a connection-less socket it sets
20338 // the default address for g_socket_send() and discards all incoming datagrams
20339 // from other sources.
20341 // Generally connection oriented sockets can only connect once, but
20342 // connection-less sockets can connect multiple times to change the
20343 // default address.
20345 // If the connect call needs to do network I/O it will block, unless
20346 // non-blocking I/O is enabled. Then %G_IO_ERROR_PENDING is returned
20347 // and the user can be notified of the connection finishing by waiting
20348 // for the G_IO_OUT condition. The result of the connection must then be
20349 // checked with g_socket_check_connect_result().
20350 // RETURNS: %TRUE if connected, %FALSE on error.
20351 // <address>: a #GSocketAddress specifying the remote address.
20352 // <cancellable>: a %GCancellable or %NULL
20353 int connect()(SocketAddress* address, Cancellable* cancellable, GLib2.Error** error=null) {
20354 return g_socket_connect(&this, address, cancellable, error);
20357 // VERSION: 2.22
20358 // Creates a #GSocketConnection subclass of the right type for
20359 // @socket.
20360 // RETURNS: a #GSocketConnection
20361 SocketConnection* /*new*/ connection_factory_create_connection()() {
20362 return g_socket_connection_factory_create_connection(&this);
20365 // Unintrospectable method: create_source() / g_socket_create_source()
20366 // VERSION: 2.22
20367 // Creates a %GSource that can be attached to a %GMainContext to monitor
20368 // for the availibility of the specified @condition on the socket.
20370 // The callback on the source is of the #GSocketSourceFunc type.
20372 // It is meaningless to specify %G_IO_ERR or %G_IO_HUP in @condition;
20373 // these conditions will always be reported output if they are true.
20375 // @cancellable if not %NULL can be used to cancel the source, which will
20376 // cause the source to trigger, reporting the current condition (which
20377 // is likely 0 unless cancellation happened at the same time as a
20378 // condition change). You can check for this in the callback using
20379 // g_cancellable_is_cancelled().
20381 // If @socket has a timeout set, and it is reached before @condition
20382 // occurs, the source will then trigger anyway, reporting %G_IO_IN or
20383 // %G_IO_OUT depending on @condition. However, @socket will have been
20384 // marked as having had a timeout, and so the next #GSocket I/O method
20385 // you call will then fail with a %G_IO_ERROR_TIMED_OUT.
20386 // RETURNS: a newly allocated %GSource, free with g_source_unref().
20387 // <condition>: a #GIOCondition mask to monitor
20388 // <cancellable>: a %GCancellable or %NULL
20389 GLib2.Source* /*new*/ create_source()(GLib2.IOCondition condition, Cancellable* cancellable=null) {
20390 return g_socket_create_source(&this, condition, cancellable);
20393 // VERSION: 2.32
20394 // Get the amount of data pending in the OS input buffer.
20396 // without blocking or -1 on error.
20397 // RETURNS: the number of bytes that can be read from the socket
20398 ssize_t get_available_bytes()() {
20399 return g_socket_get_available_bytes(&this);
20402 // VERSION: 2.22
20403 // Gets the blocking mode of the socket. For details on blocking I/O,
20404 // see g_socket_set_blocking().
20405 // RETURNS: %TRUE if blocking I/O is used, %FALSE otherwise.
20406 int get_blocking()() {
20407 return g_socket_get_blocking(&this);
20410 // VERSION: 2.32
20411 // Gets the broadcast setting on @socket; if %TRUE,
20412 // it is possible to send packets to broadcast
20413 // addresses or receive from broadcast addresses.
20414 // RETURNS: the broadcast setting on @socket
20415 int get_broadcast()() {
20416 return g_socket_get_broadcast(&this);
20419 // VERSION: 2.26
20420 // Returns the credentials of the foreign process connected to this
20421 // socket, if any (e.g. it is only supported for %G_SOCKET_FAMILY_UNIX
20422 // sockets).
20424 // If this operation isn't supported on the OS, the method fails with
20425 // the %G_IO_ERROR_NOT_SUPPORTED error. On Linux this is implemented
20426 // by reading the %SO_PEERCRED option on the underlying socket.
20428 // Other ways to obtain credentials from a foreign peer includes the
20429 // #GUnixCredentialsMessage type and
20430 // g_unix_connection_send_credentials() /
20431 // g_unix_connection_receive_credentials() functions.
20433 // that must be freed with g_object_unref().
20434 // RETURNS: %NULL if @error is set, otherwise a #GCredentials object
20435 Credentials* /*new*/ get_credentials()(GLib2.Error** error=null) {
20436 return g_socket_get_credentials(&this, error);
20439 // VERSION: 2.22
20440 // Gets the socket family of the socket.
20441 // RETURNS: a #GSocketFamily
20442 SocketFamily get_family()() {
20443 return g_socket_get_family(&this);
20446 // VERSION: 2.22
20447 // Returns the underlying OS socket object. On unix this
20448 // is a socket file descriptor, and on windows this is
20449 // a Winsock2 SOCKET handle. This may be useful for
20450 // doing platform specific or otherwise unusual operations
20451 // on the socket.
20452 // RETURNS: the file descriptor of the socket.
20453 int get_fd()() {
20454 return g_socket_get_fd(&this);
20457 // VERSION: 2.22
20458 // Gets the keepalive mode of the socket. For details on this,
20459 // see g_socket_set_keepalive().
20460 // RETURNS: %TRUE if keepalive is active, %FALSE otherwise.
20461 int get_keepalive()() {
20462 return g_socket_get_keepalive(&this);
20465 // VERSION: 2.22
20466 // Gets the listen backlog setting of the socket. For details on this,
20467 // see g_socket_set_listen_backlog().
20468 // RETURNS: the maximum number of pending connections.
20469 int get_listen_backlog()() {
20470 return g_socket_get_listen_backlog(&this);
20473 // VERSION: 2.22
20474 // Try to get the local address of a bound socket. This is only
20475 // useful if the socket has been bound to a local address,
20476 // either explicitly or implicitly when connecting.
20478 // Free the returned object with g_object_unref().
20479 // RETURNS: a #GSocketAddress or %NULL on error.
20480 SocketAddress* /*new*/ get_local_address()(GLib2.Error** error=null) {
20481 return g_socket_get_local_address(&this, error);
20484 // VERSION: 2.32
20485 // Gets the multicast loopback setting on @socket; if %TRUE (the
20486 // default), outgoing multicast packets will be looped back to
20487 // multicast listeners on the same host.
20488 // RETURNS: the multicast loopback setting on @socket
20489 int get_multicast_loopback()() {
20490 return g_socket_get_multicast_loopback(&this);
20493 // VERSION: 2.32
20494 // Gets the multicast time-to-live setting on @socket; see
20495 // g_socket_set_multicast_ttl() for more details.
20496 // RETURNS: the multicast time-to-live setting on @socket
20497 uint get_multicast_ttl()() {
20498 return g_socket_get_multicast_ttl(&this);
20501 // VERSION: 2.22
20502 // Gets the socket protocol id the socket was created with.
20503 // In case the protocol is unknown, -1 is returned.
20504 // RETURNS: a protocol id, or -1 if unknown
20505 SocketProtocol get_protocol()() {
20506 return g_socket_get_protocol(&this);
20509 // VERSION: 2.22
20510 // Try to get the remove address of a connected socket. This is only
20511 // useful for connection oriented sockets that have been connected.
20513 // Free the returned object with g_object_unref().
20514 // RETURNS: a #GSocketAddress or %NULL on error.
20515 SocketAddress* /*new*/ get_remote_address()(GLib2.Error** error=null) {
20516 return g_socket_get_remote_address(&this, error);
20519 // VERSION: 2.22
20520 // Gets the socket type of the socket.
20521 // RETURNS: a #GSocketType
20522 SocketType get_socket_type()() {
20523 return g_socket_get_socket_type(&this);
20526 // VERSION: 2.26
20527 // Gets the timeout setting of the socket. For details on this, see
20528 // g_socket_set_timeout().
20529 // RETURNS: the timeout in seconds
20530 uint get_timeout()() {
20531 return g_socket_get_timeout(&this);
20534 // VERSION: 2.32
20535 // Gets the unicast time-to-live setting on @socket; see
20536 // g_socket_set_ttl() for more details.
20537 // RETURNS: the time-to-live setting on @socket
20538 uint get_ttl()() {
20539 return g_socket_get_ttl(&this);
20542 // VERSION: 2.22
20543 // Checks whether a socket is closed.
20544 // RETURNS: %TRUE if socket is closed, %FALSE otherwise
20545 int is_closed()() {
20546 return g_socket_is_closed(&this);
20549 // VERSION: 2.22
20550 // Check whether the socket is connected. This is only useful for
20551 // connection-oriented sockets.
20552 // RETURNS: %TRUE if socket is connected, %FALSE otherwise.
20553 int is_connected()() {
20554 return g_socket_is_connected(&this);
20557 // VERSION: 2.32
20558 // Registers @socket to receive multicast messages sent to @group.
20559 // @socket must be a %G_SOCKET_TYPE_DATAGRAM socket, and must have
20560 // been bound to an appropriate interface and port with
20561 // g_socket_bind().
20563 // If @source_specific is %TRUE, source-specific multicast as defined
20564 // in RFC 4604 is used.
20565 // RETURNS: %TRUE on success, %FALSE on error.
20566 // <group>: a #GInetAddress specifying the group address to join.
20567 // <source_specific>: %TRUE if source-specific multicast should be used
20568 // <iface>: Interface to use
20569 int join_multicast_group()(InetAddress* group, int source_specific, char* iface, GLib2.Error** error=null) {
20570 return g_socket_join_multicast_group(&this, group, source_specific, iface, error);
20573 // VERSION: 2.32
20574 // Removes @socket from the multicast group @group (while still
20575 // allowing it to receive unicast messages).
20577 // If @source_specific is %TRUE, source-specific multicast as defined
20578 // in RFC 4604 is used.
20579 // RETURNS: %TRUE on success, %FALSE on error.
20580 // <group>: a #GInetAddress specifying the group address to leave.
20581 // <source_specific>: %TRUE if source-specific multicast should be used
20582 // <iface>: Interface to use
20583 int leave_multicast_group()(InetAddress* group, int source_specific, char* iface, GLib2.Error** error=null) {
20584 return g_socket_leave_multicast_group(&this, group, source_specific, iface, error);
20587 // VERSION: 2.22
20588 // Marks the socket as a server socket, i.e. a socket that is used
20589 // to accept incoming requests using g_socket_accept().
20591 // Before calling this the socket must be bound to a local address using
20592 // g_socket_bind().
20594 // To set the maximum amount of outstanding clients, use
20595 // g_socket_set_listen_backlog().
20596 // RETURNS: %TRUE on success, %FALSE on error.
20597 int listen()(GLib2.Error** error=null) {
20598 return g_socket_listen(&this, error);
20601 // VERSION: 2.22
20602 // Receive data (up to @size bytes) from a socket. This is mainly used by
20603 // connection-oriented sockets; it is identical to g_socket_receive_from()
20604 // with @address set to %NULL.
20606 // For %G_SOCKET_TYPE_DATAGRAM and %G_SOCKET_TYPE_SEQPACKET sockets,
20607 // g_socket_receive() will always read either 0 or 1 complete messages from
20608 // the socket. If the received message is too large to fit in @buffer, then
20609 // the data beyond @size bytes will be discarded, without any explicit
20610 // indication that this has occurred.
20612 // For %G_SOCKET_TYPE_STREAM sockets, g_socket_receive() can return any
20613 // number of bytes, up to @size. If more than @size bytes have been
20614 // received, the additional data will be returned in future calls to
20615 // g_socket_receive().
20617 // If the socket is in blocking mode the call will block until there
20618 // is some data to receive, the connection is closed, or there is an
20619 // error. If there is no data available and the socket is in
20620 // non-blocking mode, a %G_IO_ERROR_WOULD_BLOCK error will be
20621 // returned. To be notified when data is available, wait for the
20622 // %G_IO_IN condition.
20624 // On error -1 is returned and @error is set accordingly.
20626 // the peer, or -1 on error
20627 // RETURNS: Number of bytes read, or 0 if the connection was closed by
20628 // <buffer>: a buffer to read data into (which should be at least @size bytes long).
20629 // <size>: the number of bytes you want to read from the socket
20630 // <cancellable>: a %GCancellable or %NULL
20631 ssize_t receive()(char* buffer, size_t size, Cancellable* cancellable, GLib2.Error** error=null) {
20632 return g_socket_receive(&this, buffer, size, cancellable, error);
20635 // VERSION: 2.22
20636 // Receive data (up to @size bytes) from a socket.
20638 // If @address is non-%NULL then @address will be set equal to the
20639 // source address of the received packet.
20640 // @address is owned by the caller.
20642 // See g_socket_receive() for additional information.
20644 // the peer, or -1 on error
20645 // RETURNS: Number of bytes read, or 0 if the connection was closed by
20646 // <address>: a pointer to a #GSocketAddress pointer, or %NULL
20647 // <buffer>: a buffer to read data into (which should be at least @size bytes long).
20648 // <size>: the number of bytes you want to read from the socket
20649 // <cancellable>: a %GCancellable or %NULL
20650 ssize_t receive_from()(/*out*/ SocketAddress** address, ubyte* buffer, size_t size, Cancellable* cancellable, GLib2.Error** error=null) {
20651 return g_socket_receive_from(&this, address, buffer, size, cancellable, error);
20654 // VERSION: 2.22
20655 // Receive data from a socket. This is the most complicated and
20656 // fully-featured version of this call. For easier use, see
20657 // g_socket_receive() and g_socket_receive_from().
20659 // If @address is non-%NULL then @address will be set equal to the
20660 // source address of the received packet.
20661 // @address is owned by the caller.
20663 // @vector must point to an array of #GInputVector structs and
20664 // @num_vectors must be the length of this array. These structs
20665 // describe the buffers that received data will be scattered into.
20666 // If @num_vectors is -1, then @vectors is assumed to be terminated
20667 // by a #GInputVector with a %NULL buffer pointer.
20669 // As a special case, if @num_vectors is 0 (in which case, @vectors
20670 // may of course be %NULL), then a single byte is received and
20671 // discarded. This is to facilitate the common practice of sending a
20672 // single '\0' byte for the purposes of transferring ancillary data.
20674 // @messages, if non-%NULL, will be set to point to a newly-allocated
20675 // array of #GSocketControlMessage instances or %NULL if no such
20676 // messages was received. These correspond to the control messages
20677 // received from the kernel, one #GSocketControlMessage per message
20678 // from the kernel. This array is %NULL-terminated and must be freed
20679 // by the caller using g_free() after calling g_object_unref() on each
20680 // element. If @messages is %NULL, any control messages received will
20681 // be discarded.
20683 // @num_messages, if non-%NULL, will be set to the number of control
20684 // messages received.
20686 // If both @messages and @num_messages are non-%NULL, then
20687 // @num_messages gives the number of #GSocketControlMessage instances
20688 // in @messages (ie: not including the %NULL terminator).
20690 // @flags is an in/out parameter. The commonly available arguments
20691 // for this are available in the #GSocketMsgFlags enum, but the
20692 // values there are the same as the system values, and the flags
20693 // are passed in as-is, so you can pass in system-specific flags too
20694 // (and g_socket_receive_message() may pass system-specific flags out).
20696 // As with g_socket_receive(), data may be discarded if @socket is
20697 // %G_SOCKET_TYPE_DATAGRAM or %G_SOCKET_TYPE_SEQPACKET and you do not
20698 // provide enough buffer space to read a complete message. You can pass
20699 // %G_SOCKET_MSG_PEEK in @flags to peek at the current message without
20700 // removing it from the receive queue, but there is no portable way to find
20701 // out the length of the message other than by reading it into a
20702 // sufficiently-large buffer.
20704 // If the socket is in blocking mode the call will block until there
20705 // is some data to receive, the connection is closed, or there is an
20706 // error. If there is no data available and the socket is in
20707 // non-blocking mode, a %G_IO_ERROR_WOULD_BLOCK error will be
20708 // returned. To be notified when data is available, wait for the
20709 // %G_IO_IN condition.
20711 // On error -1 is returned and @error is set accordingly.
20713 // the peer, or -1 on error
20714 // RETURNS: Number of bytes read, or 0 if the connection was closed by
20715 // <address>: a pointer to a #GSocketAddress pointer, or %NULL
20716 // <vectors>: an array of #GInputVector structs
20717 // <num_vectors>: the number of elements in @vectors, or -1
20718 // <messages>: a pointer which may be filled with an array of #GSocketControlMessages, or %NULL
20719 // <num_messages>: a pointer which will be filled with the number of elements in @messages, or %NULL
20720 // <flags>: a pointer to an int containing #GSocketMsgFlags flags
20721 // <cancellable>: a %GCancellable or %NULL
20722 ssize_t receive_message()(/*out*/ SocketAddress** address, InputVector* vectors, int num_vectors, SocketControlMessage*** messages, int* num_messages, int* flags, Cancellable* cancellable, GLib2.Error** error=null) {
20723 return g_socket_receive_message(&this, address, vectors, num_vectors, messages, num_messages, flags, cancellable, error);
20726 // VERSION: 2.26
20727 // This behaves exactly the same as g_socket_receive(), except that
20728 // the choice of blocking or non-blocking behavior is determined by
20729 // the @blocking argument rather than by @socket's properties.
20731 // the peer, or -1 on error
20732 // RETURNS: Number of bytes read, or 0 if the connection was closed by
20733 // <buffer>: a buffer to read data into (which should be at least @size bytes long).
20734 // <size>: the number of bytes you want to read from the socket
20735 // <blocking>: whether to do blocking or non-blocking I/O
20736 // <cancellable>: a %GCancellable or %NULL
20737 ssize_t receive_with_blocking()(char* buffer, size_t size, int blocking, Cancellable* cancellable, GLib2.Error** error=null) {
20738 return g_socket_receive_with_blocking(&this, buffer, size, blocking, cancellable, error);
20741 // VERSION: 2.22
20742 // Tries to send @size bytes from @buffer on the socket. This is
20743 // mainly used by connection-oriented sockets; it is identical to
20744 // g_socket_send_to() with @address set to %NULL.
20746 // If the socket is in blocking mode the call will block until there is
20747 // space for the data in the socket queue. If there is no space available
20748 // and the socket is in non-blocking mode a %G_IO_ERROR_WOULD_BLOCK error
20749 // will be returned. To be notified when space is available, wait for the
20750 // %G_IO_OUT condition. Note though that you may still receive
20751 // %G_IO_ERROR_WOULD_BLOCK from g_socket_send() even if you were previously
20752 // notified of a %G_IO_OUT condition. (On Windows in particular, this is
20753 // very common due to the way the underlying APIs work.)
20755 // On error -1 is returned and @error is set accordingly.
20757 // on error
20758 // RETURNS: Number of bytes written (which may be less than @size), or -1
20759 // <buffer>: the buffer containing the data to send.
20760 // <size>: the number of bytes to send
20761 // <cancellable>: a %GCancellable or %NULL
20762 ssize_t send()(ubyte* buffer, size_t size, Cancellable* cancellable, GLib2.Error** error=null) {
20763 return g_socket_send(&this, buffer, size, cancellable, error);
20766 // VERSION: 2.22
20767 // Send data to @address on @socket. This is the most complicated and
20768 // fully-featured version of this call. For easier use, see
20769 // g_socket_send() and g_socket_send_to().
20771 // If @address is %NULL then the message is sent to the default receiver
20772 // (set by g_socket_connect()).
20774 // @vectors must point to an array of #GOutputVector structs and
20775 // @num_vectors must be the length of this array. (If @num_vectors is -1,
20776 // then @vectors is assumed to be terminated by a #GOutputVector with a
20777 // %NULL buffer pointer.) The #GOutputVector structs describe the buffers
20778 // that the sent data will be gathered from. Using multiple
20779 // #GOutputVector<!-- -->s is more memory-efficient than manually copying
20780 // data from multiple sources into a single buffer, and more
20781 // network-efficient than making multiple calls to g_socket_send().
20783 // @messages, if non-%NULL, is taken to point to an array of @num_messages
20784 // #GSocketControlMessage instances. These correspond to the control
20785 // messages to be sent on the socket.
20786 // If @num_messages is -1 then @messages is treated as a %NULL-terminated
20787 // array.
20789 // @flags modify how the message is sent. The commonly available arguments
20790 // for this are available in the #GSocketMsgFlags enum, but the
20791 // values there are the same as the system values, and the flags
20792 // are passed in as-is, so you can pass in system-specific flags too.
20794 // If the socket is in blocking mode the call will block until there is
20795 // space for the data in the socket queue. If there is no space available
20796 // and the socket is in non-blocking mode a %G_IO_ERROR_WOULD_BLOCK error
20797 // will be returned. To be notified when space is available, wait for the
20798 // %G_IO_OUT condition. Note though that you may still receive
20799 // %G_IO_ERROR_WOULD_BLOCK from g_socket_send() even if you were previously
20800 // notified of a %G_IO_OUT condition. (On Windows in particular, this is
20801 // very common due to the way the underlying APIs work.)
20803 // On error -1 is returned and @error is set accordingly.
20805 // on error
20806 // RETURNS: Number of bytes written (which may be less than @size), or -1
20807 // <address>: a #GSocketAddress, or %NULL
20808 // <vectors>: an array of #GOutputVector structs
20809 // <num_vectors>: the number of elements in @vectors, or -1
20810 // <messages>: a pointer to an array of #GSocketControlMessages, or %NULL.
20811 // <num_messages>: number of elements in @messages, or -1.
20812 // <flags>: an int containing #GSocketMsgFlags flags
20813 // <cancellable>: a %GCancellable or %NULL
20814 ssize_t send_message()(SocketAddress* address, OutputVector* vectors, int num_vectors, SocketControlMessage** messages, int num_messages, int flags, Cancellable* cancellable, GLib2.Error** error=null) {
20815 return g_socket_send_message(&this, address, vectors, num_vectors, messages, num_messages, flags, cancellable, error);
20818 // VERSION: 2.22
20819 // Tries to send @size bytes from @buffer to @address. If @address is
20820 // %NULL then the message is sent to the default receiver (set by
20821 // g_socket_connect()).
20823 // See g_socket_send() for additional information.
20825 // on error
20826 // RETURNS: Number of bytes written (which may be less than @size), or -1
20827 // <address>: a #GSocketAddress, or %NULL
20828 // <buffer>: the buffer containing the data to send.
20829 // <size>: the number of bytes to send
20830 // <cancellable>: a %GCancellable or %NULL
20831 ssize_t send_to()(SocketAddress* address, ubyte* buffer, size_t size, Cancellable* cancellable, GLib2.Error** error=null) {
20832 return g_socket_send_to(&this, address, buffer, size, cancellable, error);
20835 // VERSION: 2.26
20836 // This behaves exactly the same as g_socket_send(), except that
20837 // the choice of blocking or non-blocking behavior is determined by
20838 // the @blocking argument rather than by @socket's properties.
20840 // on error
20841 // RETURNS: Number of bytes written (which may be less than @size), or -1
20842 // <buffer>: the buffer containing the data to send.
20843 // <size>: the number of bytes to send
20844 // <blocking>: whether to do blocking or non-blocking I/O
20845 // <cancellable>: a %GCancellable or %NULL
20846 ssize_t send_with_blocking()(ubyte* buffer, size_t size, int blocking, Cancellable* cancellable, GLib2.Error** error=null) {
20847 return g_socket_send_with_blocking(&this, buffer, size, blocking, cancellable, error);
20850 // VERSION: 2.22
20851 // Sets the blocking mode of the socket. In blocking mode
20852 // all operations block until they succeed or there is an error. In
20853 // non-blocking mode all functions return results immediately or
20854 // with a %G_IO_ERROR_WOULD_BLOCK error.
20856 // All sockets are created in blocking mode. However, note that the
20857 // platform level socket is always non-blocking, and blocking mode
20858 // is a GSocket level feature.
20859 // <blocking>: Whether to use blocking I/O or not.
20860 void set_blocking()(int blocking) {
20861 g_socket_set_blocking(&this, blocking);
20864 // VERSION: 2.32
20865 // Sets whether @socket should allow sending to and receiving from
20866 // broadcast addresses. This is %FALSE by default.
20867 void set_broadcast()(int broadcast) {
20868 g_socket_set_broadcast(&this, broadcast);
20871 // VERSION: 2.22
20872 // Sets or unsets the %SO_KEEPALIVE flag on the underlying socket. When
20873 // this flag is set on a socket, the system will attempt to verify that the
20874 // remote socket endpoint is still present if a sufficiently long period of
20875 // time passes with no data being exchanged. If the system is unable to
20876 // verify the presence of the remote endpoint, it will automatically close
20877 // the connection.
20879 // This option is only functional on certain kinds of sockets. (Notably,
20880 // %G_SOCKET_PROTOCOL_TCP sockets.)
20882 // The exact time between pings is system- and protocol-dependent, but will
20883 // normally be at least two hours. Most commonly, you would set this flag
20884 // on a server socket if you want to allow clients to remain idle for long
20885 // periods of time, but also want to ensure that connections are eventually
20886 // garbage-collected if clients crash or become unreachable.
20887 // <keepalive>: Value for the keepalive flag
20888 void set_keepalive()(int keepalive) {
20889 g_socket_set_keepalive(&this, keepalive);
20892 // VERSION: 2.22
20893 // Sets the maximum number of outstanding connections allowed
20894 // when listening on this socket. If more clients than this are
20895 // connecting to the socket and the application is not handling them
20896 // on time then the new connections will be refused.
20898 // Note that this must be called before g_socket_listen() and has no
20899 // effect if called after that.
20900 // <backlog>: the maximum number of pending connections.
20901 void set_listen_backlog()(int backlog) {
20902 g_socket_set_listen_backlog(&this, backlog);
20905 // VERSION: 2.32
20906 // Sets whether outgoing multicast packets will be received by sockets
20907 // listening on that multicast address on the same host. This is %TRUE
20908 // by default.
20909 // <loopback>: whether @socket should receive messages sent to its multicast groups from the local host
20910 void set_multicast_loopback()(int loopback) {
20911 g_socket_set_multicast_loopback(&this, loopback);
20914 // VERSION: 2.32
20915 // Sets the time-to-live for outgoing multicast datagrams on @socket.
20916 // By default, this is 1, meaning that multicast packets will not leave
20917 // the local network.
20918 // <ttl>: the time-to-live value for all multicast datagrams on @socket
20919 void set_multicast_ttl()(uint ttl) {
20920 g_socket_set_multicast_ttl(&this, ttl);
20923 // VERSION: 2.26
20924 // Sets the time in seconds after which I/O operations on @socket will
20925 // time out if they have not yet completed.
20927 // On a blocking socket, this means that any blocking #GSocket
20928 // operation will time out after @timeout seconds of inactivity,
20929 // returning %G_IO_ERROR_TIMED_OUT.
20931 // On a non-blocking socket, calls to g_socket_condition_wait() will
20932 // also fail with %G_IO_ERROR_TIMED_OUT after the given time. Sources
20933 // created with g_socket_create_source() will trigger after
20934 // @timeout seconds of inactivity, with the requested condition
20935 // set, at which point calling g_socket_receive(), g_socket_send(),
20936 // g_socket_check_connect_result(), etc, will fail with
20937 // %G_IO_ERROR_TIMED_OUT.
20939 // If @timeout is 0 (the default), operations will never time out
20940 // on their own.
20942 // Note that if an I/O operation is interrupted by a signal, this may
20943 // cause the timeout to be reset.
20944 // <timeout>: the timeout for @socket, in seconds, or 0 for none
20945 void set_timeout()(uint timeout) {
20946 g_socket_set_timeout(&this, timeout);
20949 // VERSION: 2.32
20950 // Sets the time-to-live for outgoing unicast packets on @socket.
20951 // By default the platform-specific default value is used.
20952 // <ttl>: the time-to-live value for all unicast packets on @socket
20953 void set_ttl()(uint ttl) {
20954 g_socket_set_ttl(&this, ttl);
20957 // VERSION: 2.22
20958 // Shut down part of a full-duplex connection.
20960 // If @shutdown_read is %TRUE then the receiving side of the connection
20961 // is shut down, and further reading is disallowed.
20963 // If @shutdown_write is %TRUE then the sending side of the connection
20964 // is shut down, and further writing is disallowed.
20966 // It is allowed for both @shutdown_read and @shutdown_write to be %TRUE.
20968 // One example where this is used is graceful disconnect for TCP connections
20969 // where you close the sending side, then wait for the other side to close
20970 // the connection, thus ensuring that the other side saw all sent data.
20971 // RETURNS: %TRUE on success, %FALSE on error
20972 // <shutdown_read>: whether to shut down the read side
20973 // <shutdown_write>: whether to shut down the write side
20974 int shutdown()(int shutdown_read, int shutdown_write, GLib2.Error** error=null) {
20975 return g_socket_shutdown(&this, shutdown_read, shutdown_write, error);
20978 // VERSION: 2.22
20979 // Checks if a socket is capable of speaking IPv4.
20981 // IPv4 sockets are capable of speaking IPv4. On some operating systems
20982 // and under some combinations of circumstances IPv6 sockets are also
20983 // capable of speaking IPv4. See RFC 3493 section 3.7 for more
20984 // information.
20986 // No other types of sockets are currently considered as being capable
20987 // of speaking IPv4.
20988 // RETURNS: %TRUE if this socket can be used with IPv4.
20989 int speaks_ipv4()() {
20990 return g_socket_speaks_ipv4(&this);
20995 // #GSocketAddress is the equivalent of <type>struct sockaddr</type>
20996 // in the BSD sockets API. This is an abstract class; use
20997 // #GInetSocketAddress for internet sockets, or #GUnixSocketAddress
20998 // for UNIX domain sockets.
20999 struct SocketAddress /* : GObject.Object */ {
21000 mixin SocketConnectable.__interface__;
21001 alias parent_instance this;
21002 alias parent_instance super_;
21003 alias parent_instance object;
21004 GObject2.Object parent_instance;
21007 // VERSION: 2.22
21008 // Creates a #GSocketAddress subclass corresponding to the native
21009 // <type>struct sockaddr</type> @native.
21011 // otherwise %NULL.
21012 // RETURNS: a new #GSocketAddress if @native could successfully be converted,
21013 // <native>: a pointer to a <type>struct sockaddr</type>
21014 // <len>: the size of the memory location pointed to by @native
21015 static SocketAddress* /*new*/ new_from_native()(void* native, size_t len) {
21016 return g_socket_address_new_from_native(native, len);
21019 // VERSION: 2.22
21020 // Gets the socket family type of @address.
21021 // RETURNS: the socket family type of @address.
21022 SocketFamily get_family()() {
21023 return g_socket_address_get_family(&this);
21026 // VERSION: 2.22
21027 // Gets the size of @address's native <type>struct sockaddr</type>.
21028 // You can use this to allocate memory to pass to
21029 // g_socket_address_to_native().
21031 // @address represents
21032 // RETURNS: the size of the native <type>struct sockaddr</type> that
21033 ssize_t get_native_size()() {
21034 return g_socket_address_get_native_size(&this);
21037 // VERSION: 2.22
21038 // Converts a #GSocketAddress to a native <type>struct
21039 // sockaddr</type>, which can be passed to low-level functions like
21040 // connect() or bind().
21042 // If not enough space is available, a %G_IO_ERROR_NO_SPACE error is
21043 // returned. If the address type is not known on the system
21044 // then a %G_IO_ERROR_NOT_SUPPORTED error is returned.
21045 // RETURNS: %TRUE if @dest was filled in, %FALSE on error
21046 // <dest>: a pointer to a memory location that will contain the native <type>struct sockaddr</type>.
21047 // <destlen>: the size of @dest. Must be at least as large as g_socket_address_get_native_size().
21048 int to_native()(void* dest, size_t destlen, GLib2.Error** error=null) {
21049 return g_socket_address_to_native(&this, dest, destlen, error);
21053 struct SocketAddressClass {
21054 GObject2.ObjectClass parent_class;
21055 // RETURNS: the socket family type of @address.
21056 extern (C) SocketFamily function (SocketAddress* address) get_family;
21057 // RETURNS: the size of the native <type>struct sockaddr</type> that
21058 extern (C) ssize_t function (SocketAddress* address) get_native_size;
21060 // RETURNS: %TRUE if @dest was filled in, %FALSE on error
21061 // <dest>: a pointer to a memory location that will contain the native <type>struct sockaddr</type>.
21062 // <destlen>: the size of @dest. Must be at least as large as g_socket_address_get_native_size().
21063 extern (C) int function (SocketAddress* address, void* dest, size_t destlen, GLib2.Error** error=null) to_native;
21067 // Enumerator type for objects that contain or generate
21068 // #GSocketAddress<!-- -->es.
21069 struct SocketAddressEnumerator /* : GObject.Object */ {
21070 alias parent_instance this;
21071 alias parent_instance super_;
21072 alias parent_instance object;
21073 GObject2.Object parent_instance;
21076 // Retrieves the next #GSocketAddress from @enumerator. Note that this
21077 // may block for some amount of time. (Eg, a #GNetworkAddress may need
21078 // to do a DNS lookup before it can return an address.) Use
21079 // g_socket_address_enumerator_next_async() if you need to avoid
21080 // blocking.
21082 // If @enumerator is expected to yield addresses, but for some reason
21083 // is unable to (eg, because of a DNS error), then the first call to
21084 // g_socket_address_enumerator_next() will return an appropriate error
21085 // in *@error. However, if the first call to
21086 // g_socket_address_enumerator_next() succeeds, then any further
21087 // internal errors (other than @cancellable being triggered) will be
21088 // ignored.
21090 // error (in which case *@error will be set) or if there are no
21091 // more addresses.
21092 // RETURNS: a #GSocketAddress (owned by the caller), or %NULL on
21093 // <cancellable>: optional #GCancellable object, %NULL to ignore.
21094 SocketAddress* /*new*/ next()(Cancellable* cancellable, GLib2.Error** error=null) {
21095 return g_socket_address_enumerator_next(&this, cancellable, error);
21098 // Asynchronously retrieves the next #GSocketAddress from @enumerator
21099 // and then calls @callback, which must call
21100 // g_socket_address_enumerator_next_finish() to get the result.
21101 // <cancellable>: optional #GCancellable object, %NULL to ignore.
21102 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
21103 // <user_data>: the data to pass to callback function
21104 void next_async()(Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
21105 g_socket_address_enumerator_next_async(&this, cancellable, callback, user_data);
21108 // Retrieves the result of a completed call to
21109 // g_socket_address_enumerator_next_async(). See
21110 // g_socket_address_enumerator_next() for more information about
21111 // error handling.
21113 // error (in which case *@error will be set) or if there are no
21114 // more addresses.
21115 // RETURNS: a #GSocketAddress (owned by the caller), or %NULL on
21116 // <result>: a #GAsyncResult
21117 SocketAddress* /*new*/ next_finish()(AsyncResult* result, GLib2.Error** error=null) {
21118 return g_socket_address_enumerator_next_finish(&this, result, error);
21122 struct SocketAddressEnumeratorClass {
21123 GObject2.ObjectClass parent_class;
21125 // RETURNS: a #GSocketAddress (owned by the caller), or %NULL on
21126 // <cancellable>: optional #GCancellable object, %NULL to ignore.
21127 extern (C) SocketAddress* /*new*/ function (SocketAddressEnumerator* enumerator, Cancellable* cancellable, GLib2.Error** error=null) next;
21129 // <cancellable>: optional #GCancellable object, %NULL to ignore.
21130 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
21131 // <user_data>: the data to pass to callback function
21132 extern (C) void function (SocketAddressEnumerator* enumerator, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) next_async;
21134 // RETURNS: a #GSocketAddress (owned by the caller), or %NULL on
21135 // <result>: a #GAsyncResult
21136 extern (C) SocketAddress* /*new*/ function (SocketAddressEnumerator* enumerator, AsyncResult* result, GLib2.Error** error=null) next_finish;
21139 struct SocketClass {
21140 GObject2.ObjectClass parent_class;
21141 extern (C) void function () _g_reserved1;
21142 extern (C) void function () _g_reserved2;
21143 extern (C) void function () _g_reserved3;
21144 extern (C) void function () _g_reserved4;
21145 extern (C) void function () _g_reserved5;
21146 extern (C) void function () _g_reserved6;
21147 extern (C) void function () _g_reserved7;
21148 extern (C) void function () _g_reserved8;
21149 extern (C) void function () _g_reserved9;
21150 extern (C) void function () _g_reserved10;
21154 // #GSocketClient is a high-level utility class for connecting to a
21155 // network host using a connection oriented socket type.
21157 // You create a #GSocketClient object, set any options you want, and then
21158 // call a sync or async connect operation, which returns a #GSocketConnection
21159 // subclass on success.
21161 // The type of the #GSocketConnection object returned depends on the type of
21162 // the underlying socket that is in use. For instance, for a TCP/IP connection
21163 // it will be a #GTcpConnection.
21164 struct SocketClient /* : GObject.Object */ /* Version 2.22 */ {
21165 alias parent_instance this;
21166 alias parent_instance super_;
21167 alias parent_instance object;
21168 GObject2.Object parent_instance;
21169 SocketClientPrivate* priv;
21172 // VERSION: 2.22
21173 // Creates a new #GSocketClient with the default options.
21175 // Free the returned object with g_object_unref().
21176 // RETURNS: a #GSocketClient.
21177 static SocketClient* /*new*/ new_()() {
21178 return g_socket_client_new();
21181 // Enable proxy protocols to be handled by the application. When the
21182 // indicated proxy protocol is returned by the #GProxyResolver,
21183 // #GSocketClient will consider this protocol as supported but will
21184 // not try to find a #GProxy instance to handle handshaking. The
21185 // application must check for this case by calling
21186 // g_socket_connection_get_remote_address() on the returned
21187 // #GSocketConnection, and seeing if it's a #GProxyAddress of the
21188 // appropriate type, to determine whether or not it needs to handle
21189 // the proxy handshaking itself.
21191 // This should be used for proxy protocols that are dialects of
21192 // another protocol such as HTTP proxy. It also allows cohabitation of
21193 // proxy protocols that are reused between protocols. A good example
21194 // is HTTP. It can be used to proxy HTTP, FTP and Gopher and can also
21195 // be use as generic socket proxy through the HTTP CONNECT method.
21197 // When the proxy is detected as being an application proxy, TLS handshake
21198 // will be skipped. This is required to let the application do the proxy
21199 // specific handshake.
21200 // <protocol>: The proxy protocol
21201 void add_application_proxy()(char* protocol) {
21202 g_socket_client_add_application_proxy(&this, protocol);
21205 // VERSION: 2.22
21206 // Tries to resolve the @connectable and make a network connection to it.
21208 // Upon a successful connection, a new #GSocketConnection is constructed
21209 // and returned. The caller owns this new object and must drop their
21210 // reference to it when finished with it.
21212 // The type of the #GSocketConnection object returned depends on the type of
21213 // the underlying socket that is used. For instance, for a TCP/IP connection
21214 // it will be a #GTcpConnection.
21216 // The socket created will be the same family as the address that the
21217 // @connectable resolves to, unless family is set with g_socket_client_set_family()
21218 // or indirectly via g_socket_client_set_local_address(). The socket type
21219 // defaults to %G_SOCKET_TYPE_STREAM but can be set with
21220 // g_socket_client_set_socket_type().
21222 // If a local address is specified with g_socket_client_set_local_address() the
21223 // socket will be bound to this address before connecting.
21224 // RETURNS: a #GSocketConnection on success, %NULL on error.
21225 // <connectable>: a #GSocketConnectable specifying the remote address.
21226 // <cancellable>: optional #GCancellable object, %NULL to ignore.
21227 SocketConnection* /*new*/ connect()(SocketConnectable* connectable, Cancellable* cancellable, GLib2.Error** error=null) {
21228 return g_socket_client_connect(&this, connectable, cancellable, error);
21231 // VERSION: 2.22
21232 // This is the asynchronous version of g_socket_client_connect().
21234 // When the operation is finished @callback will be
21235 // called. You can then call g_socket_client_connect_finish() to get
21236 // the result of the operation.
21237 // <connectable>: a #GSocketConnectable specifying the remote address.
21238 // <cancellable>: a #GCancellable, or %NULL
21239 // <callback>: a #GAsyncReadyCallback
21240 // <user_data>: user data for the callback
21241 void connect_async()(SocketConnectable* connectable, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
21242 g_socket_client_connect_async(&this, connectable, cancellable, callback, user_data);
21245 // VERSION: 2.22
21246 // Finishes an async connect operation. See g_socket_client_connect_async()
21247 // RETURNS: a #GSocketConnection on success, %NULL on error.
21248 // <result>: a #GAsyncResult.
21249 SocketConnection* /*new*/ connect_finish()(AsyncResult* result, GLib2.Error** error=null) {
21250 return g_socket_client_connect_finish(&this, result, error);
21253 // VERSION: 2.22
21254 // This is a helper function for g_socket_client_connect().
21256 // Attempts to create a TCP connection to the named host.
21258 // @host_and_port may be in any of a number of recognized formats; an IPv6
21259 // address, an IPv4 address, or a domain name (in which case a DNS
21260 // lookup is performed). Quoting with [] is supported for all address
21261 // types. A port override may be specified in the usual way with a
21262 // colon. Ports may be given as decimal numbers or symbolic names (in
21263 // which case an /etc/services lookup is performed).
21265 // If no port override is given in @host_and_port then @default_port will be
21266 // used as the port number to connect to.
21268 // In general, @host_and_port is expected to be provided by the user (allowing
21269 // them to give the hostname, and a port override if necessary) and
21270 // @default_port is expected to be provided by the application.
21272 // In the case that an IP address is given, a single connection
21273 // attempt is made. In the case that a name is given, multiple
21274 // connection attempts may be made, in turn and according to the
21275 // number of address records in DNS, until a connection succeeds.
21277 // Upon a successful connection, a new #GSocketConnection is constructed
21278 // and returned. The caller owns this new object and must drop their
21279 // reference to it when finished with it.
21281 // In the event of any failure (DNS error, service not found, no hosts
21282 // connectable) %NULL is returned and @error (if non-%NULL) is set
21283 // accordingly.
21284 // RETURNS: a #GSocketConnection on success, %NULL on error.
21285 // <host_and_port>: the name and optionally port of the host to connect to
21286 // <default_port>: the default port to connect to
21287 // <cancellable>: a #GCancellable, or %NULL
21288 SocketConnection* /*new*/ connect_to_host()(char* host_and_port, ushort default_port, Cancellable* cancellable, GLib2.Error** error=null) {
21289 return g_socket_client_connect_to_host(&this, host_and_port, default_port, cancellable, error);
21292 // VERSION: 2.22
21293 // This is the asynchronous version of g_socket_client_connect_to_host().
21295 // When the operation is finished @callback will be
21296 // called. You can then call g_socket_client_connect_to_host_finish() to get
21297 // the result of the operation.
21298 // <host_and_port>: the name and optionally the port of the host to connect to
21299 // <default_port>: the default port to connect to
21300 // <cancellable>: a #GCancellable, or %NULL
21301 // <callback>: a #GAsyncReadyCallback
21302 // <user_data>: user data for the callback
21303 void connect_to_host_async()(char* host_and_port, ushort default_port, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
21304 g_socket_client_connect_to_host_async(&this, host_and_port, default_port, cancellable, callback, user_data);
21307 // VERSION: 2.22
21308 // Finishes an async connect operation. See g_socket_client_connect_to_host_async()
21309 // RETURNS: a #GSocketConnection on success, %NULL on error.
21310 // <result>: a #GAsyncResult.
21311 SocketConnection* /*new*/ connect_to_host_finish()(AsyncResult* result, GLib2.Error** error=null) {
21312 return g_socket_client_connect_to_host_finish(&this, result, error);
21315 // Attempts to create a TCP connection to a service.
21317 // This call looks up the SRV record for @service at @domain for the
21318 // "tcp" protocol. It then attempts to connect, in turn, to each of
21319 // the hosts providing the service until either a connection succeeds
21320 // or there are no hosts remaining.
21322 // Upon a successful connection, a new #GSocketConnection is constructed
21323 // and returned. The caller owns this new object and must drop their
21324 // reference to it when finished with it.
21326 // In the event of any failure (DNS error, service not found, no hosts
21327 // connectable) %NULL is returned and @error (if non-%NULL) is set
21328 // accordingly.
21329 // RETURNS: a #GSocketConnection if successful, or %NULL on error
21330 // <domain>: a domain name
21331 // <service>: the name of the service to connect to
21332 // <cancellable>: a #GCancellable, or %NULL
21333 SocketConnection* /*new*/ connect_to_service()(char* domain, char* service, Cancellable* cancellable, GLib2.Error** error=null) {
21334 return g_socket_client_connect_to_service(&this, domain, service, cancellable, error);
21337 // VERSION: 2.22
21338 // This is the asynchronous version of
21339 // g_socket_client_connect_to_service().
21340 // <domain>: a domain name
21341 // <service>: the name of the service to connect to
21342 // <cancellable>: a #GCancellable, or %NULL
21343 // <callback>: a #GAsyncReadyCallback
21344 // <user_data>: user data for the callback
21345 void connect_to_service_async()(char* domain, char* service, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
21346 g_socket_client_connect_to_service_async(&this, domain, service, cancellable, callback, user_data);
21349 // VERSION: 2.22
21350 // Finishes an async connect operation. See g_socket_client_connect_to_service_async()
21351 // RETURNS: a #GSocketConnection on success, %NULL on error.
21352 // <result>: a #GAsyncResult.
21353 SocketConnection* /*new*/ connect_to_service_finish()(AsyncResult* result, GLib2.Error** error=null) {
21354 return g_socket_client_connect_to_service_finish(&this, result, error);
21357 // VERSION: 2.26
21358 // This is a helper function for g_socket_client_connect().
21360 // Attempts to create a TCP connection with a network URI.
21362 // @uri may be any valid URI containing an "authority" (hostname/port)
21363 // component. If a port is not specified in the URI, @default_port
21364 // will be used. TLS will be negotiated if #GSocketClient:tls is %TRUE.
21365 // (#GSocketClient does not know to automatically assume TLS for
21366 // certain URI schemes.)
21368 // Using this rather than g_socket_client_connect() or
21369 // g_socket_client_connect_to_host() allows #GSocketClient to
21370 // determine when to use application-specific proxy protocols.
21372 // Upon a successful connection, a new #GSocketConnection is constructed
21373 // and returned. The caller owns this new object and must drop their
21374 // reference to it when finished with it.
21376 // In the event of any failure (DNS error, service not found, no hosts
21377 // connectable) %NULL is returned and @error (if non-%NULL) is set
21378 // accordingly.
21379 // RETURNS: a #GSocketConnection on success, %NULL on error.
21380 // <uri>: A network URI
21381 // <default_port>: the default port to connect to
21382 // <cancellable>: a #GCancellable, or %NULL
21383 SocketConnection* /*new*/ connect_to_uri()(char* uri, ushort default_port, Cancellable* cancellable, GLib2.Error** error=null) {
21384 return g_socket_client_connect_to_uri(&this, uri, default_port, cancellable, error);
21387 // VERSION: 2.26
21388 // This is the asynchronous version of g_socket_client_connect_to_uri().
21390 // When the operation is finished @callback will be
21391 // called. You can then call g_socket_client_connect_to_uri_finish() to get
21392 // the result of the operation.
21393 // <uri>: a network uri
21394 // <default_port>: the default port to connect to
21395 // <cancellable>: a #GCancellable, or %NULL
21396 // <callback>: a #GAsyncReadyCallback
21397 // <user_data>: user data for the callback
21398 void connect_to_uri_async()(char* uri, ushort default_port, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
21399 g_socket_client_connect_to_uri_async(&this, uri, default_port, cancellable, callback, user_data);
21402 // VERSION: 2.26
21403 // Finishes an async connect operation. See g_socket_client_connect_to_uri_async()
21404 // RETURNS: a #GSocketConnection on success, %NULL on error.
21405 // <result>: a #GAsyncResult.
21406 SocketConnection* /*new*/ connect_to_uri_finish()(AsyncResult* result, GLib2.Error** error=null) {
21407 return g_socket_client_connect_to_uri_finish(&this, result, error);
21410 // VERSION: 2.26
21411 // Gets the proxy enable state; see g_socket_client_set_enable_proxy()
21412 // RETURNS: whether proxying is enabled
21413 int get_enable_proxy()() {
21414 return g_socket_client_get_enable_proxy(&this);
21417 // VERSION: 2.22
21418 // Gets the socket family of the socket client.
21420 // See g_socket_client_set_family() for details.
21421 // RETURNS: a #GSocketFamily
21422 SocketFamily get_family()() {
21423 return g_socket_client_get_family(&this);
21426 // VERSION: 2.22
21427 // Gets the local address of the socket client.
21429 // See g_socket_client_set_local_address() for details.
21430 // RETURNS: a #GSocketAddress or %NULL. Do not free.
21431 SocketAddress* get_local_address()() {
21432 return g_socket_client_get_local_address(&this);
21435 // VERSION: 2.22
21436 // Gets the protocol name type of the socket client.
21438 // See g_socket_client_set_protocol() for details.
21439 // RETURNS: a #GSocketProtocol
21440 SocketProtocol get_protocol()() {
21441 return g_socket_client_get_protocol(&this);
21444 // VERSION: 2.22
21445 // Gets the socket type of the socket client.
21447 // See g_socket_client_set_socket_type() for details.
21448 // RETURNS: a #GSocketFamily
21449 SocketType get_socket_type()() {
21450 return g_socket_client_get_socket_type(&this);
21453 // VERSION: 2.26
21454 // Gets the I/O timeout time for sockets created by @client.
21456 // See g_socket_client_set_timeout() for details.
21457 // RETURNS: the timeout in seconds
21458 uint get_timeout()() {
21459 return g_socket_client_get_timeout(&this);
21462 // VERSION: 2.28
21463 // Gets whether @client creates TLS connections. See
21464 // g_socket_client_set_tls() for details.
21465 // RETURNS: whether @client uses TLS
21466 int get_tls()() {
21467 return g_socket_client_get_tls(&this);
21470 // VERSION: 2.28
21471 // Gets the TLS validation flags used creating TLS connections via
21472 // @client.
21473 // RETURNS: the TLS validation flags
21474 TlsCertificateFlags get_tls_validation_flags()() {
21475 return g_socket_client_get_tls_validation_flags(&this);
21478 // VERSION: 2.26
21479 // Sets whether or not @client attempts to make connections via a
21480 // proxy server. When enabled (the default), #GSocketClient will use a
21481 // #GProxyResolver to determine if a proxy protocol such as SOCKS is
21482 // needed, and automatically do the necessary proxy negotiation.
21483 // <enable>: whether to enable proxies
21484 void set_enable_proxy()(int enable) {
21485 g_socket_client_set_enable_proxy(&this, enable);
21488 // VERSION: 2.22
21489 // Sets the socket family of the socket client.
21490 // If this is set to something other than %G_SOCKET_FAMILY_INVALID
21491 // then the sockets created by this object will be of the specified
21492 // family.
21494 // This might be useful for instance if you want to force the local
21495 // connection to be an ipv4 socket, even though the address might
21496 // be an ipv6 mapped to ipv4 address.
21497 // <family>: a #GSocketFamily
21498 void set_family()(SocketFamily family) {
21499 g_socket_client_set_family(&this, family);
21502 // VERSION: 2.22
21503 // Sets the local address of the socket client.
21504 // The sockets created by this object will bound to the
21505 // specified address (if not %NULL) before connecting.
21507 // This is useful if you want to ensure that the local
21508 // side of the connection is on a specific port, or on
21509 // a specific interface.
21510 // <address>: a #GSocketAddress, or %NULL
21511 void set_local_address()(SocketAddress* address) {
21512 g_socket_client_set_local_address(&this, address);
21515 // VERSION: 2.22
21516 // Sets the protocol of the socket client.
21517 // The sockets created by this object will use of the specified
21518 // protocol.
21520 // If @protocol is %0 that means to use the default
21521 // protocol for the socket family and type.
21522 // <protocol>: a #GSocketProtocol
21523 void set_protocol()(SocketProtocol protocol) {
21524 g_socket_client_set_protocol(&this, protocol);
21527 // VERSION: 2.22
21528 // Sets the socket type of the socket client.
21529 // The sockets created by this object will be of the specified
21530 // type.
21532 // It doesn't make sense to specify a type of %G_SOCKET_TYPE_DATAGRAM,
21533 // as GSocketClient is used for connection oriented services.
21534 // <type>: a #GSocketType
21535 void set_socket_type()(SocketType type) {
21536 g_socket_client_set_socket_type(&this, type);
21539 // VERSION: 2.26
21540 // Sets the I/O timeout for sockets created by @client. @timeout is a
21541 // time in seconds, or 0 for no timeout (the default).
21543 // The timeout value affects the initial connection attempt as well,
21544 // so setting this may cause calls to g_socket_client_connect(), etc,
21545 // to fail with %G_IO_ERROR_TIMED_OUT.
21546 // <timeout>: the timeout
21547 void set_timeout()(uint timeout) {
21548 g_socket_client_set_timeout(&this, timeout);
21551 // VERSION: 2.28
21552 // Sets whether @client creates TLS (aka SSL) connections. If @tls is
21553 // %TRUE, @client will wrap its connections in a #GTlsClientConnection
21554 // and perform a TLS handshake when connecting.
21556 // Note that since #GSocketClient must return a #GSocketConnection,
21557 // but #GTlsClientConnection is not a #GSocketConnection, this
21558 // actually wraps the resulting #GTlsClientConnection in a
21559 // #GTcpWrapperConnection when returning it. You can use
21560 // g_tcp_wrapper_connection_get_base_io_stream() on the return value
21561 // to extract the #GTlsClientConnection.
21563 // If you need to modify the behavior of the TLS handshake (eg, by
21564 // setting a client-side certificate to use, or connecting to the
21565 // #GTlsConnection::accept-certificate signal), you can connect to
21566 // @client's #GSocketClient::event signal and wait for it to be
21567 // emitted with %G_SOCKET_CLIENT_TLS_HANDSHAKING, which will give you
21568 // a chance to see the #GTlsClientConnection before the handshake
21569 // starts.
21570 // <tls>: whether to use TLS
21571 void set_tls()(int tls) {
21572 g_socket_client_set_tls(&this, tls);
21575 // VERSION: 2.28
21576 // Sets the TLS validation flags used when creating TLS connections
21577 // via @client. The default value is %G_TLS_CERTIFICATE_VALIDATE_ALL.
21578 // <flags>: the validation flags
21579 void set_tls_validation_flags()(TlsCertificateFlags flags) {
21580 g_socket_client_set_tls_validation_flags(&this, flags);
21583 // VERSION: 2.32
21584 // Emitted when @client's activity on @connectable changes state.
21585 // Among other things, this can be used to provide progress
21586 // information about a network connection in the UI. The meanings of
21587 // the different @event values are as follows:
21589 // <variablelist>
21590 // <varlistentry>
21591 // <term>%G_SOCKET_CLIENT_RESOLVING:</term>
21592 // <listitem><para>
21593 // @client is about to look up @connectable in DNS.
21594 // @connection will be %NULL.
21595 // </para></listitem>
21596 // </varlistentry>
21597 // <varlistentry>
21598 // <term>%G_SOCKET_CLIENT_RESOLVED:</term>
21599 // <listitem><para>
21600 // @client has successfully resolved @connectable in DNS.
21601 // @connection will be %NULL.
21602 // </para></listitem>
21603 // </varlistentry>
21604 // <varlistentry>
21605 // <term>%G_SOCKET_CLIENT_CONNECTING:</term>
21606 // <listitem><para>
21607 // @client is about to make a connection to a remote host;
21608 // either a proxy server or the destination server itself.
21609 // @connection is the #GSocketConnection, which is not yet
21610 // connected.
21611 // </para></listitem>
21612 // </varlistentry>
21613 // <varlistentry>
21614 // <term>%G_SOCKET_CLIENT_CONNECTED:</term>
21615 // <listitem><para>
21616 // @client has successfully connected to a remote host.
21617 // @connection is the connected #GSocketConnection.
21618 // </para></listitem>
21619 // </varlistentry>
21620 // <varlistentry>
21621 // <term>%G_SOCKET_CLIENT_PROXY_NEGOTIATING:</term>
21622 // <listitem><para>
21623 // @client is about to negotiate with a proxy to get it to
21624 // connect to @connectable. @connection is the
21625 // #GSocketConnection to the proxy server.
21626 // </para></listitem>
21627 // </varlistentry>
21628 // <varlistentry>
21629 // <term>%G_SOCKET_CLIENT_PROXY_NEGOTIATED:</term>
21630 // <listitem><para>
21631 // @client has negotiated a connection to @connectable through
21632 // a proxy server. @connection is the stream returned from
21633 // g_proxy_connect(), which may or may not be a
21634 // #GSocketConnection.
21635 // </para></listitem>
21636 // </varlistentry>
21637 // <varlistentry>
21638 // <term>%G_SOCKET_CLIENT_TLS_HANDSHAKING:</term>
21639 // <listitem><para>
21640 // @client is about to begin a TLS handshake. @connection is a
21641 // #GTlsClientConnection.
21642 // </para></listitem>
21643 // </varlistentry>
21644 // <varlistentry>
21645 // <term>%G_SOCKET_CLIENT_TLS_HANDSHAKED:</term>
21646 // <listitem><para>
21647 // @client has successfully completed the TLS handshake.
21648 // @connection is a #GTlsClientConnection.
21649 // </para></listitem>
21650 // </varlistentry>
21651 // <varlistentry>
21652 // <term>%G_SOCKET_CLIENT_COMPLETE:</term>
21653 // <listitem><para>
21654 // @client has either successfully connected to @connectable
21655 // (in which case @connection is the #GSocketConnection that
21656 // it will be returning to the caller) or has failed (in which
21657 // case @connection is %NULL and the client is about to return
21658 // an error).
21659 // </para></listitem>
21660 // </varlistentry>
21661 // </variablelist>
21663 // Each event except %G_SOCKET_CLIENT_COMPLETE may be emitted
21664 // multiple times (or not at all) for a given connectable (in
21665 // particular, if @client ends up attempting to connect to more than
21666 // one address). However, if @client emits the #GSocketClient:event
21667 // signal at all for a given connectable, that it will always emit
21668 // it with %G_SOCKET_CLIENT_COMPLETE when it is done.
21670 // Note that there may be additional #GSocketClientEvent values in
21671 // the future; unrecognized @event values should be ignored.
21672 // <event>: the event that is occurring
21673 // <connectable>: the #GSocketConnectable that @event is occurring on
21674 // <connection>: the current representation of the connection
21675 extern (C) alias static void function (SocketClient* this_, SocketClientEvent* event, SocketConnectable* connectable, IOStream* connection, void* user_data=null) signal_event;
21677 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
21678 return super_.signal_connect!name(cb, data, cf);
21681 ulong signal_connect(string name:"event", CB:signal_event)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
21682 return signal_connect_data!()(&this, cast(char*)"event",
21683 cast(GObject2.Callback)cb, data, null, cf);
21687 struct SocketClientClass {
21688 GObject2.ObjectClass parent_class;
21689 extern (C) void function (SocketClient* client, SocketClientEvent event, SocketConnectable* connectable, IOStream* connection) event;
21690 extern (C) void function () _g_reserved1;
21691 extern (C) void function () _g_reserved2;
21692 extern (C) void function () _g_reserved3;
21693 extern (C) void function () _g_reserved4;
21697 // Describes an event occurring on a #GSocketClient. See the
21698 // #GSocketClient::event signal for more details.
21700 // Additional values may be added to this type in the future.
21701 enum SocketClientEvent /* Version 2.32 */ {
21702 RESOLVING = 0,
21703 RESOLVED = 1,
21704 CONNECTING = 2,
21705 CONNECTED = 3,
21706 PROXY_NEGOTIATING = 4,
21707 PROXY_NEGOTIATED = 5,
21708 TLS_HANDSHAKING = 6,
21709 TLS_HANDSHAKED = 7,
21710 COMPLETE = 8
21712 struct SocketClientPrivate {
21716 // Objects that describe one or more potential socket endpoints
21717 // implement #GSocketConnectable. Callers can then use
21718 // g_socket_connectable_enumerate() to get a #GSocketAddressEnumerator
21719 // to try out each socket address in turn until one succeeds, as shown
21720 // in the sample code below.
21722 // |[
21723 // MyConnectionType *
21724 // connect_to_host (const char *hostname,
21725 // guint16 port,
21726 // GCancellable *cancellable,
21727 // GError **error)
21728 // {
21729 // MyConnection *conn = NULL;
21730 // GSocketConnectable *addr;
21731 // GSocketAddressEnumerator *enumerator;
21732 // GSocketAddress *sockaddr;
21733 // GError *conn_error = NULL;
21735 // addr = g_network_address_new ("www.gnome.org", 80);
21736 // enumerator = g_socket_connectable_enumerate (addr);
21737 // g_object_unref (addr);
21739 // /<!-- -->* Try each sockaddr until we succeed. Record the first
21740 // * connection error, but not any further ones (since they'll probably
21741 // * be basically the same as the first).
21742 // *<!-- -->/
21743 // while (!conn && (sockaddr = g_socket_address_enumerator_next (enumerator, cancellable, error))
21744 // {
21745 // conn = connect_to_sockaddr (sockaddr, conn_error ? NULL : &conn_error);
21746 // g_object_unref (sockaddr);
21747 // }
21748 // g_object_unref (enumerator);
21750 // if (conn)
21751 // {
21752 // if (conn_error)
21753 // {
21754 // /<!-- -->* We couldn't connect to the first address, but we succeeded
21755 // * in connecting to a later address.
21756 // *<!-- -->/
21757 // g_error_free (conn_error);
21758 // }
21759 // return conn;
21760 // }
21761 // else if (error)
21762 // {
21763 // /<!-- -->* Either the initial lookup failed, or else the caller
21764 // * cancelled us.
21765 // *<!-- -->/
21766 // if (conn_error)
21767 // g_error_free (conn_error);
21768 // return NULL;
21769 // }
21770 // else
21771 // {
21772 // g_error_propagate (error, conn_error);
21773 // return NULL;
21774 // }
21775 // }
21776 // ]|
21777 struct SocketConnectable /* Interface */ {
21778 mixin template __interface__() {
21779 // VERSION: 2.22
21780 // Creates a #GSocketAddressEnumerator for @connectable.
21781 // RETURNS: a new #GSocketAddressEnumerator.
21782 SocketAddressEnumerator* /*new*/ enumerate()() {
21783 return g_socket_connectable_enumerate(cast(SocketConnectable*)&this);
21786 // VERSION: 2.26
21787 // Creates a #GSocketAddressEnumerator for @connectable that will
21788 // return #GProxyAddress<!-- -->es for addresses that you must connect
21789 // to via a proxy.
21791 // If @connectable does not implement
21792 // g_socket_connectable_proxy_enumerate(), this will fall back to
21793 // calling g_socket_connectable_enumerate().
21794 // RETURNS: a new #GSocketAddressEnumerator.
21795 SocketAddressEnumerator* /*new*/ proxy_enumerate()() {
21796 return g_socket_connectable_proxy_enumerate(cast(SocketConnectable*)&this);
21799 mixin __interface__;
21803 // Provides an interface for returning a #GSocketAddressEnumerator
21804 // and #GProxyAddressEnumerator
21805 struct SocketConnectableIface {
21806 GObject2.TypeInterface g_iface;
21807 // RETURNS: a new #GSocketAddressEnumerator.
21808 extern (C) SocketAddressEnumerator* /*new*/ function (SocketConnectable* connectable) enumerate;
21809 // RETURNS: a new #GSocketAddressEnumerator.
21810 extern (C) SocketAddressEnumerator* /*new*/ function (SocketConnectable* connectable) proxy_enumerate;
21814 // #GSocketConnection is a #GIOStream for a connected socket. They
21815 // can be created either by #GSocketClient when connecting to a host,
21816 // or by #GSocketListener when accepting a new client.
21818 // The type of the #GSocketConnection object returned from these calls
21819 // depends on the type of the underlying socket that is in use. For
21820 // instance, for a TCP/IP connection it will be a #GTcpConnection.
21822 // Choosing what type of object to construct is done with the socket
21823 // connection factory, and it is possible for 3rd parties to register
21824 // custom socket connection types for specific combination of socket
21825 // family/type/protocol using g_socket_connection_factory_register_type().
21826 struct SocketConnection /* : IOStream */ /* Version 2.22 */ {
21827 alias parent_instance this;
21828 alias parent_instance super_;
21829 alias parent_instance iostream;
21830 IOStream parent_instance;
21831 SocketConnectionPrivate* priv;
21834 // VERSION: 2.22
21835 // Looks up the #GType to be used when creating socket connections on
21836 // sockets with the specified @family, @type and @protocol_id.
21838 // If no type is registered, the #GSocketConnection base type is returned.
21839 // RETURNS: a #GType
21840 // <family>: a #GSocketFamily
21841 // <type>: a #GSocketType
21842 // <protocol_id>: a protocol id
21843 static Type factory_lookup_type()(SocketFamily family, SocketType type, int protocol_id) {
21844 return g_socket_connection_factory_lookup_type(family, type, protocol_id);
21847 // VERSION: 2.22
21848 // Looks up the #GType to be used when creating socket connections on
21849 // sockets with the specified @family, @type and @protocol.
21851 // If no type is registered, the #GSocketConnection base type is returned.
21852 // <g_type>: a #GType, inheriting from %G_TYPE_SOCKET_CONNECTION
21853 // <family>: a #GSocketFamily
21854 // <type>: a #GSocketType
21855 // <protocol>: a protocol id
21856 static void factory_register_type()(Type g_type, SocketFamily family, SocketType type, int protocol) {
21857 g_socket_connection_factory_register_type(g_type, family, type, protocol);
21860 // VERSION: 2.32
21861 // Connect @connection to the specified remote address.
21862 // RETURNS: %TRUE if the connection succeeded, %FALSE on error
21863 // <address>: a #GSocketAddress specifying the remote address.
21864 // <cancellable>: a %GCancellable or %NULL
21865 int connect()(SocketAddress* address, Cancellable* cancellable, GLib2.Error** error=null) {
21866 return g_socket_connection_connect(&this, address, cancellable, error);
21869 // VERSION: 2.32
21870 // Asynchronously connect @connection to the specified remote address.
21872 // This clears the #GSocket:blocking flag on @connection's underlying
21873 // socket if it is currently set.
21875 // Use g_socket_connection_connect_finish() to retrieve the result.
21876 // <address>: a #GSocketAddress specifying the remote address.
21877 // <cancellable>: a %GCancellable or %NULL
21878 // <callback>: a #GAsyncReadyCallback
21879 // <user_data>: user data for the callback
21880 void connect_async()(SocketAddress* address, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
21881 g_socket_connection_connect_async(&this, address, cancellable, callback, user_data);
21884 // VERSION: 2.32
21885 // Gets the result of a g_socket_connection_connect_async() call.
21886 // RETURNS: %TRUE if the connection succeeded, %FALSE on error
21887 // <result>: the #GAsyncResult
21888 int connect_finish()(AsyncResult* result, GLib2.Error** error=null) {
21889 return g_socket_connection_connect_finish(&this, result, error);
21892 // VERSION: 2.22
21893 // Try to get the local address of a socket connection.
21895 // Free the returned object with g_object_unref().
21896 // RETURNS: a #GSocketAddress or %NULL on error.
21897 SocketAddress* /*new*/ get_local_address()(GLib2.Error** error=null) {
21898 return g_socket_connection_get_local_address(&this, error);
21901 // VERSION: 2.22
21902 // Try to get the remote address of a socket connection.
21904 // Free the returned object with g_object_unref().
21905 // RETURNS: a #GSocketAddress or %NULL on error.
21906 SocketAddress* /*new*/ get_remote_address()(GLib2.Error** error=null) {
21907 return g_socket_connection_get_remote_address(&this, error);
21910 // VERSION: 2.22
21911 // Gets the underlying #GSocket object of the connection.
21912 // This can be useful if you want to do something unusual on it
21913 // not supported by the #GSocketConnection APIs.
21914 // RETURNS: a #GSocketAddress or %NULL on error.
21915 Socket* get_socket()() {
21916 return g_socket_connection_get_socket(&this);
21919 // VERSION: 2.32
21920 // Checks if @connection is connected. This is equivalent to calling
21921 // g_socket_is_connected() on @connection's underlying #GSocket.
21922 // RETURNS: whether @connection is connected
21923 int is_connected()() {
21924 return g_socket_connection_is_connected(&this);
21928 struct SocketConnectionClass {
21929 IOStreamClass parent_class;
21930 extern (C) void function () _g_reserved1;
21931 extern (C) void function () _g_reserved2;
21932 extern (C) void function () _g_reserved3;
21933 extern (C) void function () _g_reserved4;
21934 extern (C) void function () _g_reserved5;
21935 extern (C) void function () _g_reserved6;
21938 struct SocketConnectionPrivate {
21942 // A #GSocketControlMessage is a special-purpose utility message that
21943 // can be sent to or received from a #GSocket. These types of
21944 // messages are often called "ancillary data".
21946 // The message can represent some sort of special instruction to or
21947 // information from the socket or can represent a special kind of
21948 // transfer to the peer (for example, sending a file description over
21949 // a UNIX socket).
21951 // These messages are sent with g_socket_send_message() and received
21952 // with g_socket_receive_message().
21954 // To extend the set of control message that can be sent, subclass this
21955 // class and override the get_size, get_level, get_type and serialize
21956 // methods.
21958 // To extend the set of control messages that can be received, subclass
21959 // this class and implement the deserialize method. Also, make sure your
21960 // class is registered with the GType typesystem before calling
21961 // g_socket_receive_message() to read such a message.
21962 struct SocketControlMessage /* : GObject.Object */ {
21963 alias parent_instance this;
21964 alias parent_instance super_;
21965 alias parent_instance object;
21966 GObject2.Object parent_instance;
21967 SocketControlMessagePrivate* priv;
21970 // VERSION: 2.22
21971 // Tries to deserialize a socket control message of a given
21972 // @level and @type. This will ask all known (to GType) subclasses
21973 // of #GSocketControlMessage if they can understand this kind
21974 // of message and if so deserialize it into a #GSocketControlMessage.
21976 // If there is no implementation for this kind of control message, %NULL
21977 // will be returned.
21978 // RETURNS: the deserialized message or %NULL
21979 // <level>: a socket level
21980 // <type>: a socket control message type for the given @level
21981 // <size>: the size of the data in bytes
21982 // <data>: pointer to the message data
21983 static SocketControlMessage* /*new*/ deserialize()(int level, int type, size_t size, void* data) {
21984 return g_socket_control_message_deserialize(level, type, size, data);
21987 // VERSION: 2.22
21988 // Returns the "level" (i.e. the originating protocol) of the control message.
21989 // This is often SOL_SOCKET.
21990 // RETURNS: an integer describing the level
21991 int get_level()() {
21992 return g_socket_control_message_get_level(&this);
21995 // VERSION: 2.22
21996 // Returns the protocol specific type of the control message.
21997 // For instance, for UNIX fd passing this would be SCM_RIGHTS.
21998 // RETURNS: an integer describing the type of control message
21999 int get_msg_type()() {
22000 return g_socket_control_message_get_msg_type(&this);
22003 // VERSION: 2.22
22004 // Returns the space required for the control message, not including
22005 // headers or alignment.
22006 // RETURNS: The number of bytes required.
22007 size_t get_size()() {
22008 return g_socket_control_message_get_size(&this);
22011 // VERSION: 2.22
22012 // Converts the data in the message to bytes placed in the
22013 // message.
22015 // @data is guaranteed to have enough space to fit the size
22016 // returned by g_socket_control_message_get_size() on this
22017 // object.
22018 // <data>: A buffer to write data to
22019 void serialize()(void* data) {
22020 g_socket_control_message_serialize(&this, data);
22024 struct SocketControlMessageClass {
22025 GObject2.ObjectClass parent_class;
22026 // RETURNS: The number of bytes required.
22027 extern (C) size_t function (SocketControlMessage* message) get_size;
22028 // RETURNS: an integer describing the level
22029 extern (C) int function (SocketControlMessage* message) get_level;
22030 extern (C) int function (SocketControlMessage* message) get_type;
22031 // <data>: A buffer to write data to
22032 extern (C) void function (SocketControlMessage* message, void* data) serialize;
22033 // Unintrospectable functionp: deserialize() / ()
22034 extern (C) SocketControlMessage* function (int level, int type, size_t size, void* data) deserialize;
22035 extern (C) void function () _g_reserved1;
22036 extern (C) void function () _g_reserved2;
22037 extern (C) void function () _g_reserved3;
22038 extern (C) void function () _g_reserved4;
22039 extern (C) void function () _g_reserved5;
22042 struct SocketControlMessagePrivate {
22046 // The protocol family of a #GSocketAddress. (These values are
22047 // identical to the system defines %AF_INET, %AF_INET6 and %AF_UNIX,
22048 // if available.)
22049 enum SocketFamily /* Version 2.22 */ {
22050 INVALID = 0,
22051 UNIX = 1,
22052 IPV4 = 2,
22053 IPV6 = 10
22056 // A #GSocketListener is an object that keeps track of a set
22057 // of server sockets and helps you accept sockets from any of the
22058 // socket, either sync or async.
22060 // If you want to implement a network server, also look at #GSocketService
22061 // and #GThreadedSocketService which are subclass of #GSocketListener
22062 // that makes this even easier.
22063 struct SocketListener /* : GObject.Object */ {
22064 alias parent_instance this;
22065 alias parent_instance super_;
22066 alias parent_instance object;
22067 GObject2.Object parent_instance;
22068 SocketListenerPrivate* priv;
22071 // VERSION: 2.22
22072 // Creates a new #GSocketListener with no sockets to listen for.
22073 // New listeners can be added with e.g. g_socket_listener_add_address()
22074 // or g_socket_listener_add_inet_port().
22075 // RETURNS: a new #GSocketListener.
22076 static SocketListener* /*new*/ new_()() {
22077 return g_socket_listener_new();
22080 // VERSION: 2.22
22081 // Blocks waiting for a client to connect to any of the sockets added
22082 // to the listener. Returns a #GSocketConnection for the socket that was
22083 // accepted.
22085 // If @source_object is not %NULL it will be filled out with the source
22086 // object specified when the corresponding socket or address was added
22087 // to the listener.
22089 // If @cancellable is not %NULL, then the operation can be cancelled by
22090 // triggering the cancellable object from another thread. If the operation
22091 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
22092 // RETURNS: a #GSocketConnection on success, %NULL on error.
22093 // <source_object>: location where #GObject pointer will be stored, or %NULL
22094 // <cancellable>: optional #GCancellable object, %NULL to ignore.
22095 SocketConnection* /*new*/ accept()(/*out*/ GObject2.Object** source_object, Cancellable* cancellable, GLib2.Error** error=null) {
22096 return g_socket_listener_accept(&this, source_object, cancellable, error);
22099 // VERSION: 2.22
22100 // This is the asynchronous version of g_socket_listener_accept().
22102 // When the operation is finished @callback will be
22103 // called. You can then call g_socket_listener_accept_socket()
22104 // to get the result of the operation.
22105 // <cancellable>: a #GCancellable, or %NULL
22106 // <callback>: a #GAsyncReadyCallback
22107 // <user_data>: user data for the callback
22108 void accept_async()(Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
22109 g_socket_listener_accept_async(&this, cancellable, callback, user_data);
22112 // VERSION: 2.22
22113 // Finishes an async accept operation. See g_socket_listener_accept_async()
22114 // RETURNS: a #GSocketConnection on success, %NULL on error.
22115 // <result>: a #GAsyncResult.
22116 // <source_object>: Optional #GObject identifying this source
22117 SocketConnection* /*new*/ accept_finish()(AsyncResult* result, /*out*/ GObject2.Object** source_object, GLib2.Error** error=null) {
22118 return g_socket_listener_accept_finish(&this, result, source_object, error);
22121 // VERSION: 2.22
22122 // Blocks waiting for a client to connect to any of the sockets added
22123 // to the listener. Returns the #GSocket that was accepted.
22125 // If you want to accept the high-level #GSocketConnection, not a #GSocket,
22126 // which is often the case, then you should use g_socket_listener_accept()
22127 // instead.
22129 // If @source_object is not %NULL it will be filled out with the source
22130 // object specified when the corresponding socket or address was added
22131 // to the listener.
22133 // If @cancellable is not %NULL, then the operation can be cancelled by
22134 // triggering the cancellable object from another thread. If the operation
22135 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
22136 // RETURNS: a #GSocket on success, %NULL on error.
22137 // <source_object>: location where #GObject pointer will be stored, or %NULL.
22138 // <cancellable>: optional #GCancellable object, %NULL to ignore.
22139 Socket* /*new*/ accept_socket()(/*out*/ GObject2.Object** source_object, Cancellable* cancellable, GLib2.Error** error=null) {
22140 return g_socket_listener_accept_socket(&this, source_object, cancellable, error);
22143 // VERSION: 2.22
22144 // This is the asynchronous version of g_socket_listener_accept_socket().
22146 // When the operation is finished @callback will be
22147 // called. You can then call g_socket_listener_accept_socket_finish()
22148 // to get the result of the operation.
22149 // <cancellable>: a #GCancellable, or %NULL
22150 // <callback>: a #GAsyncReadyCallback
22151 // <user_data>: user data for the callback
22152 void accept_socket_async()(Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
22153 g_socket_listener_accept_socket_async(&this, cancellable, callback, user_data);
22156 // VERSION: 2.22
22157 // Finishes an async accept operation. See g_socket_listener_accept_socket_async()
22158 // RETURNS: a #GSocket on success, %NULL on error.
22159 // <result>: a #GAsyncResult.
22160 // <source_object>: Optional #GObject identifying this source
22161 Socket* /*new*/ accept_socket_finish()(AsyncResult* result, /*out*/ GObject2.Object** source_object, GLib2.Error** error=null) {
22162 return g_socket_listener_accept_socket_finish(&this, result, source_object, error);
22165 // VERSION: 2.22
22166 // Creates a socket of type @type and protocol @protocol, binds
22167 // it to @address and adds it to the set of sockets we're accepting
22168 // sockets from.
22170 // Note that adding an IPv6 address, depending on the platform,
22171 // may or may not result in a listener that also accepts IPv4
22172 // connections. For more deterministic behavior, see
22173 // g_socket_listener_add_inet_port().
22175 // @source_object will be passed out in the various calls
22176 // to accept to identify this particular source, which is
22177 // useful if you're listening on multiple addresses and do
22178 // different things depending on what address is connected to.
22180 // If successful and @effective_address is non-%NULL then it will
22181 // be set to the address that the binding actually occurred at. This
22182 // is helpful for determining the port number that was used for when
22183 // requesting a binding to port 0 (ie: "any port"). This address, if
22184 // requested, belongs to the caller and must be freed.
22185 // RETURNS: %TRUE on success, %FALSE on error.
22186 // <address>: a #GSocketAddress
22187 // <type>: a #GSocketType
22188 // <protocol>: a #GSocketProtocol
22189 // <source_object>: Optional #GObject identifying this source
22190 // <effective_address>: location to store the address that was bound to, or %NULL.
22191 int add_address()(SocketAddress* address, SocketType type, SocketProtocol protocol, GObject2.Object* source_object, /*out*/ SocketAddress** effective_address, GLib2.Error** error=null) {
22192 return g_socket_listener_add_address(&this, address, type, protocol, source_object, effective_address, error);
22195 // VERSION: 2.24
22196 // Listens for TCP connections on any available port number for both
22197 // IPv6 and IPv4 (if each is available).
22199 // This is useful if you need to have a socket for incoming connections
22200 // but don't care about the specific port number.
22202 // @source_object will be passed out in the various calls
22203 // to accept to identify this particular source, which is
22204 // useful if you're listening on multiple addresses and do
22205 // different things depending on what address is connected to.
22206 // RETURNS: the port number, or 0 in case of failure.
22207 // <source_object>: Optional #GObject identifying this source
22208 ushort add_any_inet_port()(GObject2.Object* source_object, GLib2.Error** error=null) {
22209 return g_socket_listener_add_any_inet_port(&this, source_object, error);
22212 // VERSION: 2.22
22213 // Helper function for g_socket_listener_add_address() that
22214 // creates a TCP/IP socket listening on IPv4 and IPv6 (if
22215 // supported) on the specified port on all interfaces.
22217 // @source_object will be passed out in the various calls
22218 // to accept to identify this particular source, which is
22219 // useful if you're listening on multiple addresses and do
22220 // different things depending on what address is connected to.
22221 // RETURNS: %TRUE on success, %FALSE on error.
22222 // <port>: an IP port number (non-zero)
22223 // <source_object>: Optional #GObject identifying this source
22224 int add_inet_port()(ushort port, GObject2.Object* source_object, GLib2.Error** error=null) {
22225 return g_socket_listener_add_inet_port(&this, port, source_object, error);
22228 // VERSION: 2.22
22229 // Adds @socket to the set of sockets that we try to accept
22230 // new clients from. The socket must be bound to a local
22231 // address and listened to.
22233 // @source_object will be passed out in the various calls
22234 // to accept to identify this particular source, which is
22235 // useful if you're listening on multiple addresses and do
22236 // different things depending on what address is connected to.
22237 // RETURNS: %TRUE on success, %FALSE on error.
22238 // <socket>: a listening #GSocket
22239 // <source_object>: Optional #GObject identifying this source
22240 int add_socket()(Socket* socket, GObject2.Object* source_object, GLib2.Error** error=null) {
22241 return g_socket_listener_add_socket(&this, socket, source_object, error);
22244 // VERSION: 2.22
22245 // Closes all the sockets in the listener.
22246 void close()() {
22247 g_socket_listener_close(&this);
22250 // VERSION: 2.22
22251 // Sets the listen backlog on the sockets in the listener.
22253 // See g_socket_set_listen_backlog() for details
22254 // <listen_backlog>: an integer
22255 void set_backlog()(int listen_backlog) {
22256 g_socket_listener_set_backlog(&this, listen_backlog);
22260 struct SocketListenerClass {
22261 GObject2.ObjectClass parent_class;
22262 extern (C) void function (SocketListener* listener) changed;
22263 extern (C) void function () _g_reserved1;
22264 extern (C) void function () _g_reserved2;
22265 extern (C) void function () _g_reserved3;
22266 extern (C) void function () _g_reserved4;
22267 extern (C) void function () _g_reserved5;
22268 extern (C) void function () _g_reserved6;
22271 struct SocketListenerPrivate {
22275 // Flags used in g_socket_receive_message() and g_socket_send_message().
22276 // The flags listed in the enum are some commonly available flags, but the
22277 // values used for them are the same as on the platform, and any other flags
22278 // are passed in/out as is. So to use a platform specific flag, just include
22279 // the right system header and pass in the flag.
22280 enum SocketMsgFlags /* Version 2.22 */ {
22281 NONE = 0,
22282 OOB = 1,
22283 PEEK = 2,
22284 DONTROUTE = 4
22286 struct SocketPrivate {
22290 // A protocol identifier is specified when creating a #GSocket, which is a
22291 // family/type specific identifier, where 0 means the default protocol for
22292 // the particular family/type.
22294 // This enum contains a set of commonly available and used protocols. You
22295 // can also pass any other identifiers handled by the platform in order to
22296 // use protocols not listed here.
22297 enum SocketProtocol /* Version 2.22 */ {
22298 UNKNOWN = -1,
22299 DEFAULT = 0,
22300 TCP = 6,
22301 UDP = 17,
22302 SCTP = 132
22305 // A #GSocketService is an object that represents a service that
22306 // is provided to the network or over local sockets. When a new
22307 // connection is made to the service the #GSocketService::incoming
22308 // signal is emitted.
22310 // A #GSocketService is a subclass of #GSocketListener and you need
22311 // to add the addresses you want to accept connections on with the
22312 // #GSocketListener APIs.
22314 // There are two options for implementing a network service based on
22315 // #GSocketService. The first is to create the service using
22316 // g_socket_service_new() and to connect to the #GSocketService::incoming
22317 // signal. The second is to subclass #GSocketService and override the
22318 // default signal handler implementation.
22320 // In either case, the handler must immediately return, or else it
22321 // will block additional incoming connections from being serviced.
22322 // If you are interested in writing connection handlers that contain
22323 // blocking code then see #GThreadedSocketService.
22325 // The socket service runs on the main loop of the <link
22326 // linkend="g-main-context-push-thread-default-context">thread-default
22327 // context</link> of the thread it is created in, and is not
22328 // threadsafe in general. However, the calls to start and stop the
22329 // service are thread-safe so these can be used from threads that
22330 // handle incoming clients.
22331 struct SocketService /* : SocketListener */ /* Version 2.22 */ {
22332 alias parent_instance this;
22333 alias parent_instance super_;
22334 alias parent_instance socketlistener;
22335 SocketListener parent_instance;
22336 SocketServicePrivate* priv;
22339 // VERSION: 2.22
22340 // Creates a new #GSocketService with no sockets to listen for.
22341 // New listeners can be added with e.g. g_socket_listener_add_address()
22342 // or g_socket_listener_add_inet_port().
22343 // RETURNS: a new #GSocketService.
22344 static SocketService* /*new*/ new_()() {
22345 return g_socket_service_new();
22348 // VERSION: 2.22
22349 // Check whether the service is active or not. An active
22350 // service will accept new clients that connect, while
22351 // a non-active service will let connecting clients queue
22352 // up until the service is started.
22353 // RETURNS: %TRUE if the service is active, %FALSE otherwise
22354 int is_active()() {
22355 return g_socket_service_is_active(&this);
22358 // VERSION: 2.22
22359 // Starts the service, i.e. start accepting connections
22360 // from the added sockets when the mainloop runs.
22362 // This call is thread-safe, so it may be called from a thread
22363 // handling an incoming client request.
22364 void start()() {
22365 g_socket_service_start(&this);
22368 // VERSION: 2.22
22369 // Stops the service, i.e. stops accepting connections
22370 // from the added sockets when the mainloop runs.
22372 // This call is thread-safe, so it may be called from a thread
22373 // handling an incoming client request.
22374 void stop()() {
22375 g_socket_service_stop(&this);
22378 // VERSION: 2.22
22379 // The ::incoming signal is emitted when a new incoming connection
22380 // to @service needs to be handled. The handler must initiate the
22381 // handling of @connection, but may not block; in essence,
22382 // asynchronous operations must be used.
22384 // @connection will be unreffed once the signal handler returns,
22385 // so you need to ref it yourself if you are planning to use it.
22386 // RETURNS: %TRUE to stop other handlers from being called
22387 // <connection>: a new #GSocketConnection object
22388 // <source_object>: the source_object passed to g_socket_listener_add_address()
22389 extern (C) alias static c_int function (SocketService* this_, SocketConnection* connection, GObject2.Object* source_object=null, void* user_data=null) signal_incoming;
22391 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
22392 return super_.signal_connect!name(cb, data, cf);
22395 ulong signal_connect(string name:"incoming", CB:signal_incoming)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
22396 return signal_connect_data!()(&this, cast(char*)"incoming",
22397 cast(GObject2.Callback)cb, data, null, cf);
22401 struct SocketServiceClass {
22402 SocketListenerClass parent_class;
22403 extern (C) int function (SocketService* service, SocketConnection* connection, GObject2.Object* source_object) incoming;
22404 extern (C) void function () _g_reserved1;
22405 extern (C) void function () _g_reserved2;
22406 extern (C) void function () _g_reserved3;
22407 extern (C) void function () _g_reserved4;
22408 extern (C) void function () _g_reserved5;
22409 extern (C) void function () _g_reserved6;
22412 struct SocketServicePrivate {
22416 // VERSION: 2.22
22417 // This is the function type of the callback used for the #GSource
22418 // returned by g_socket_create_source().
22419 // RETURNS: it should return %FALSE if the source should be removed.
22420 // <socket>: the #GSocket
22421 // <condition>: the current condition at the source fired.
22422 // <user_data>: data passed in by the user.
22423 extern (C) alias int function (Socket* socket, GLib2.IOCondition condition, void* user_data) SocketSourceFunc;
22426 // Flags used when creating a #GSocket. Some protocols may not implement
22427 // all the socket types.
22428 enum SocketType /* Version 2.22 */ {
22429 INVALID = 0,
22430 STREAM = 1,
22431 DATAGRAM = 2,
22432 SEQPACKET = 3
22435 // SRV (service) records are used by some network protocols to provide
22436 // service-specific aliasing and load-balancing. For example, XMPP
22437 // (Jabber) uses SRV records to locate the XMPP server for a domain;
22438 // rather than connecting directly to "example.com" or assuming a
22439 // specific server hostname like "xmpp.example.com", an XMPP client
22440 // would look up the "xmpp-client" SRV record for "example.com", and
22441 // then connect to whatever host was pointed to by that record.
22443 // You can use g_resolver_lookup_service() or
22444 // g_resolver_lookup_service_async() to find the #GSrvTarget<!-- -->s
22445 // for a given service. However, if you are simply planning to connect
22446 // to the remote service, you can use #GNetworkService's
22447 // #GSocketConnectable interface and not need to worry about
22448 // #GSrvTarget at all.
22449 struct SrvTarget {
22451 // VERSION: 2.22
22452 // Creates a new #GSrvTarget with the given parameters.
22454 // You should not need to use this; normally #GSrvTarget<!-- -->s are
22455 // created by #GResolver.
22456 // RETURNS: a new #GSrvTarget.
22457 // <hostname>: the host that the service is running on
22458 // <port>: the port that the service is running on
22459 // <priority>: the target's priority
22460 // <weight>: the target's weight
22461 static SrvTarget* /*new*/ new_()(char* hostname, ushort port, ushort priority, ushort weight) {
22462 return g_srv_target_new(hostname, port, priority, weight);
22465 // VERSION: 2.22
22466 // Copies @target
22467 // RETURNS: a copy of @target
22468 SrvTarget* /*new*/ copy()() {
22469 return g_srv_target_copy(&this);
22472 // VERSION: 2.22
22473 // Frees @target
22474 void free()() {
22475 g_srv_target_free(&this);
22478 // VERSION: 2.22
22479 // Gets @target's hostname (in ASCII form; if you are going to present
22480 // this to the user, you should use g_hostname_is_ascii_encoded() to
22481 // check if it contains encoded Unicode segments, and use
22482 // g_hostname_to_unicode() to convert it if it does.)
22483 // RETURNS: @target's hostname
22484 char* get_hostname()() {
22485 return g_srv_target_get_hostname(&this);
22488 // VERSION: 2.22
22489 // Gets @target's port
22490 // RETURNS: @target's port
22491 ushort get_port()() {
22492 return g_srv_target_get_port(&this);
22495 // VERSION: 2.22
22496 // Gets @target's priority. You should not need to look at this;
22497 // #GResolver already sorts the targets according to the algorithm in
22498 // RFC 2782.
22499 // RETURNS: @target's priority
22500 ushort get_priority()() {
22501 return g_srv_target_get_priority(&this);
22504 // VERSION: 2.22
22505 // Gets @target's weight. You should not need to look at this;
22506 // #GResolver already sorts the targets according to the algorithm in
22507 // RFC 2782.
22508 // RETURNS: @target's weight
22509 ushort get_weight()() {
22510 return g_srv_target_get_weight(&this);
22513 // Unintrospectable function: list_sort() / g_srv_target_list_sort()
22514 // VERSION: 2.22
22515 // Sorts @targets in place according to the algorithm in RFC 2782.
22516 // RETURNS: the head of the sorted list.
22517 // <targets>: a #GList of #GSrvTarget
22518 static GLib2.List* /*new*/ list_sort()(GLib2.List* targets) {
22519 return g_srv_target_list_sort(targets);
22523 struct StaticResource {
22524 ubyte* data;
22525 size_t data_len;
22526 Resource* resource;
22527 StaticResource* next;
22528 void* padding;
22530 void fini()() {
22531 g_static_resource_fini(&this);
22533 Resource* /*new*/ get_resource()() {
22534 return g_static_resource_get_resource(&this);
22536 void init()() {
22537 g_static_resource_init(&this);
22541 enum TLS_BACKEND_EXTENSION_POINT_NAME = "gio-tls-backend";
22542 enum TLS_DATABASE_PURPOSE_AUTHENTICATE_CLIENT = "1.3.6.1.5.5.7.3.2";
22543 enum TLS_DATABASE_PURPOSE_AUTHENTICATE_SERVER = "1.3.6.1.5.5.7.3.1";
22545 // This is the subclass of #GSocketConnection that is created
22546 // for TCP/IP sockets.
22547 struct TcpConnection /* : SocketConnection */ /* Version 2.22 */ {
22548 alias parent_instance this;
22549 alias parent_instance super_;
22550 alias parent_instance socketconnection;
22551 SocketConnection parent_instance;
22552 TcpConnectionPrivate* priv;
22555 // VERSION: 2.22
22556 // Checks if graceful disconnects are used. See
22557 // g_tcp_connection_set_graceful_disconnect().
22558 // RETURNS: %TRUE if graceful disconnect is used on close, %FALSE otherwise
22559 int get_graceful_disconnect()() {
22560 return g_tcp_connection_get_graceful_disconnect(&this);
22563 // VERSION: 2.22
22564 // This enabled graceful disconnects on close. A graceful disconnect
22565 // means that we signal the receiving end that the connection is terminated
22566 // and wait for it to close the connection before closing the connection.
22568 // A graceful disconnect means that we can be sure that we successfully sent
22569 // all the outstanding data to the other end, or get an error reported.
22570 // However, it also means we have to wait for all the data to reach the
22571 // other side and for it to acknowledge this by closing the socket, which may
22572 // take a while. For this reason it is disabled by default.
22573 // <graceful_disconnect>: Whether to do graceful disconnects or not
22574 void set_graceful_disconnect()(int graceful_disconnect) {
22575 g_tcp_connection_set_graceful_disconnect(&this, graceful_disconnect);
22579 struct TcpConnectionClass {
22580 SocketConnectionClass parent_class;
22583 struct TcpConnectionPrivate {
22587 // A #GTcpWrapperConnection can be used to wrap a #GIOStream that is
22588 // based on a #GSocket, but which is not actually a
22589 // #GSocketConnection. This is used by #GSocketClient so that it can
22590 // always return a #GSocketConnection, even when the connection it has
22591 // actually created is not directly a #GSocketConnection.
22592 struct TcpWrapperConnection /* : TcpConnection */ {
22593 alias parent_instance this;
22594 alias parent_instance super_;
22595 alias parent_instance tcpconnection;
22596 TcpConnection parent_instance;
22597 TcpWrapperConnectionPrivate* priv;
22600 // VERSION: 2.28
22601 // Wraps @base_io_stream and @socket together as a #GSocketConnection.
22602 // RETURNS: the new #GSocketConnection.
22603 // <base_io_stream>: the #GIOStream to wrap
22604 // <socket>: the #GSocket associated with @base_io_stream
22605 static TcpWrapperConnection* /*new*/ new_()(IOStream* base_io_stream, Socket* socket) {
22606 return g_tcp_wrapper_connection_new(base_io_stream, socket);
22609 // Get's @conn's base #GIOStream
22610 // RETURNS: @conn's base #GIOStream
22611 IOStream* get_base_io_stream()() {
22612 return g_tcp_wrapper_connection_get_base_io_stream(&this);
22616 struct TcpWrapperConnectionClass {
22617 TcpConnectionClass parent_class;
22620 struct TcpWrapperConnectionPrivate {
22624 // #GThemedIcon is an implementation of #GIcon that supports icon themes.
22625 // #GThemedIcon contains a list of all of the icons present in an icon
22626 // theme, so that icons can be looked up quickly. #GThemedIcon does
22627 // not provide actual pixmaps for icons, just the icon names.
22628 // Ideally something like gtk_icon_theme_choose_icon() should be used to
22629 // resolve the list of names so that fallback icons work nicely with
22630 // themes that inherit other themes.
22631 struct ThemedIcon /* : GObject.Object */ {
22632 mixin Icon.__interface__;
22633 alias method_parent this;
22634 alias method_parent super_;
22635 alias method_parent object;
22636 GObject2.Object method_parent;
22639 // Creates a new themed icon for @iconname.
22640 // RETURNS: a new #GThemedIcon.
22641 // <iconname>: a string containing an icon name.
22642 static ThemedIcon* /*new*/ new_()(char* iconname) {
22643 return g_themed_icon_new(iconname);
22646 // Creates a new themed icon for @iconnames.
22647 // RETURNS: a new #GThemedIcon
22648 // <iconnames>: an array of strings containing icon names.
22649 // <len>: the length of the @iconnames array, or -1 if @iconnames is %NULL-terminated
22650 static ThemedIcon* /*new*/ new_from_names()(char** iconnames, int len) {
22651 return g_themed_icon_new_from_names(iconnames, len);
22654 // Creates a new themed icon for @iconname, and all the names
22655 // that can be created by shortening @iconname at '-' characters.
22657 // In the following example, @icon1 and @icon2 are equivalent:
22658 // |[
22659 // const char *names[] = {
22660 // "gnome-dev-cdrom-audio",
22661 // "gnome-dev-cdrom",
22662 // "gnome-dev",
22663 // "gnome"
22664 // };
22666 // icon1 = g_themed_icon_new_from_names (names, 4);
22667 // icon2 = g_themed_icon_new_with_default_fallbacks ("gnome-dev-cdrom-audio");
22668 // ]|
22669 // RETURNS: a new #GThemedIcon.
22670 // <iconname>: a string containing an icon name
22671 static ThemedIcon* /*new*/ new_with_default_fallbacks()(char* iconname) {
22672 return g_themed_icon_new_with_default_fallbacks(iconname);
22675 // Append a name to the list of icons from within @icon.
22677 // <note><para>
22678 // Note that doing so invalidates the hash computed by prior calls
22679 // to g_icon_hash().
22680 // </para></note>
22681 // <iconname>: name of icon to append to list of icons from within @icon.
22682 void append_name()(char* iconname) {
22683 g_themed_icon_append_name(&this, iconname);
22686 // Gets the names of icons from within @icon.
22687 // RETURNS: a list of icon names.
22688 char** get_names()() {
22689 return g_themed_icon_get_names(&this);
22692 // VERSION: 2.18
22693 // Prepend a name to the list of icons from within @icon.
22695 // <note><para>
22696 // Note that doing so invalidates the hash computed by prior calls
22697 // to g_icon_hash().
22698 // </para></note>
22699 // <iconname>: name of icon to prepend to list of icons from within @icon.
22700 void prepend_name()(char* iconname) {
22701 g_themed_icon_prepend_name(&this, iconname);
22705 struct ThemedIconClass {
22709 // A #GThreadedSocketService is a simple subclass of #GSocketService
22710 // that handles incoming connections by creating a worker thread and
22711 // dispatching the connection to it by emitting the
22712 // #GThreadedSocketService::run signal in the new thread.
22714 // The signal handler may perform blocking IO and need not return
22715 // until the connection is closed.
22717 // The service is implemented using a thread pool, so there is a
22718 // limited amount of threads available to serve incoming requests.
22719 // The service automatically stops the #GSocketService from accepting
22720 // new connections when all threads are busy.
22722 // As with #GSocketService, you may connect to #GThreadedSocketService::run,
22723 // or subclass and override the default handler.
22724 struct ThreadedSocketService /* : SocketService */ /* Version 2.22 */ {
22725 alias parent_instance this;
22726 alias parent_instance super_;
22727 alias parent_instance socketservice;
22728 SocketService parent_instance;
22729 ThreadedSocketServicePrivate* priv;
22732 // VERSION: 2.22
22733 // Creates a new #GThreadedSocketService with no listeners. Listeners
22734 // must be added with one of the #GSocketListener "add" methods.
22735 // RETURNS: a new #GSocketService.
22736 // <max_threads>: the maximal number of threads to execute concurrently handling incoming clients, -1 means no limit
22737 static ThreadedSocketService* /*new*/ new_()(int max_threads) {
22738 return g_threaded_socket_service_new(max_threads);
22741 // The ::run signal is emitted in a worker thread in response to an
22742 // incoming connection. This thread is dedicated to handling
22743 // @connection and may perform blocking IO. The signal handler need
22744 // not return until the connection is closed.
22745 // RETURNS: %TRUE to stop further signal handlers from being called
22746 // <connection>: a new #GSocketConnection object.
22747 // <source_object>: the source_object passed to g_socket_listener_add_address().
22748 extern (C) alias static c_int function (ThreadedSocketService* this_, SocketConnection* connection, GObject2.Object* source_object, void* user_data=null) signal_run;
22750 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
22751 return super_.signal_connect!name(cb, data, cf);
22754 ulong signal_connect(string name:"run", CB:signal_run)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
22755 return signal_connect_data!()(&this, cast(char*)"run",
22756 cast(GObject2.Callback)cb, data, null, cf);
22760 struct ThreadedSocketServiceClass {
22761 SocketServiceClass parent_class;
22762 extern (C) int function (ThreadedSocketService* service, SocketConnection* connection, GObject2.Object* source_object) run;
22763 extern (C) void function () _g_reserved1;
22764 extern (C) void function () _g_reserved2;
22765 extern (C) void function () _g_reserved3;
22766 extern (C) void function () _g_reserved4;
22767 extern (C) void function () _g_reserved5;
22770 struct ThreadedSocketServicePrivate {
22773 // The client authentication mode for a #GTlsServerConnection.
22774 enum TlsAuthenticationMode /* Version 2.28 */ {
22775 NONE = 0,
22776 REQUESTED = 1,
22777 REQUIRED = 2
22779 struct TlsBackend /* Interface */ /* Version 2.28 */ {
22780 mixin template __interface__() {
22781 // VERSION: 2.28
22782 // Gets the default #GTlsBackend for the system.
22783 // RETURNS: a #GTlsBackend
22784 static TlsBackend* get_default()() {
22785 return g_tls_backend_get_default();
22788 // VERSION: 2.28
22789 // Gets the #GType of @backend's #GTlsCertificate implementation.
22791 // implementation.
22792 // RETURNS: the #GType of @backend's #GTlsCertificate
22793 Type get_certificate_type()() {
22794 return g_tls_backend_get_certificate_type(cast(TlsBackend*)&this);
22797 // VERSION: 2.28
22798 // Gets the #GType of @backend's #GTlsClientConnection implementation.
22800 // implementation.
22801 // RETURNS: the #GType of @backend's #GTlsClientConnection
22802 Type get_client_connection_type()() {
22803 return g_tls_backend_get_client_connection_type(cast(TlsBackend*)&this);
22806 // VERSION: 2.30
22807 // Gets the default #GTlsDatabase used to verify TLS connections.
22809 // unreffed when done.
22810 // RETURNS: the default database, which should be
22811 TlsDatabase* /*new*/ get_default_database()() {
22812 return g_tls_backend_get_default_database(cast(TlsBackend*)&this);
22815 // VERSION: 2.30
22816 // Gets the #GTyep of @backend's #GTlsFileDatabase implementation.
22817 // RETURNS: the #GType of backend's #GTlsFileDatabase implementation.
22818 Type get_file_database_type()() {
22819 return g_tls_backend_get_file_database_type(cast(TlsBackend*)&this);
22822 // VERSION: 2.28
22823 // Gets the #GType of @backend's #GTlsServerConnection implementation.
22825 // implementation.
22826 // RETURNS: the #GType of @backend's #GTlsServerConnection
22827 Type get_server_connection_type()() {
22828 return g_tls_backend_get_server_connection_type(cast(TlsBackend*)&this);
22831 // VERSION: 2.28
22832 // Checks if TLS is supported; if this returns %FALSE for the default
22833 // #GTlsBackend, it means no "real" TLS backend is available.
22834 // RETURNS: whether or not TLS is supported
22835 int supports_tls()() {
22836 return g_tls_backend_supports_tls(cast(TlsBackend*)&this);
22839 mixin __interface__;
22842 // Provides an interface for describing TLS-related types.
22843 struct TlsBackendInterface /* Version 2.28 */ {
22844 GObject2.TypeInterface g_iface;
22845 // RETURNS: whether or not TLS is supported
22846 extern (C) int function (TlsBackend* backend) supports_tls;
22847 extern (C) Type function () get_certificate_type;
22848 extern (C) Type function () get_client_connection_type;
22849 extern (C) Type function () get_server_connection_type;
22850 extern (C) Type function () get_file_database_type;
22851 // RETURNS: the default database, which should be
22852 extern (C) TlsDatabase* /*new*/ function (TlsBackend* backend) get_default_database;
22856 // A certificate used for TLS authentication and encryption.
22857 // This can represent either a public key only (eg, the certificate
22858 // received by a client from a server), or the combination of
22859 // a public key and a private key (which is needed when acting as a
22860 // #GTlsServerConnection).
22861 struct TlsCertificate /* : GObject.Object */ /* Version 2.28 */ {
22862 alias parent_instance this;
22863 alias parent_instance super_;
22864 alias parent_instance object;
22865 GObject2.Object parent_instance;
22866 TlsCertificatePrivate* priv;
22869 // VERSION: 2.28
22870 // Creates a #GTlsCertificate from the PEM-encoded data in @file. If
22871 // @file cannot be read or parsed, the function will return %NULL and
22872 // set @error. Otherwise, this behaves like
22873 // g_tls_certificate_new_from_pem().
22874 // RETURNS: the new certificate, or %NULL on error
22875 // <file>: file containing a PEM-encoded certificate to import
22876 static TlsCertificate* /*new*/ new_from_file()(char* file, GLib2.Error** error=null) {
22877 return g_tls_certificate_new_from_file(file, error);
22880 // VERSION: 2.28
22881 // Creates a #GTlsCertificate from the PEM-encoded data in @cert_file
22882 // and @key_file. If either file cannot be read or parsed, the
22883 // function will return %NULL and set @error. Otherwise, this behaves
22884 // like g_tls_certificate_new_from_pem().
22885 // RETURNS: the new certificate, or %NULL on error
22886 // <cert_file>: file containing a PEM-encoded certificate to import
22887 // <key_file>: file containing a PEM-encoded private key to import
22888 static TlsCertificate* /*new*/ new_from_files()(char* cert_file, char* key_file, GLib2.Error** error=null) {
22889 return g_tls_certificate_new_from_files(cert_file, key_file, error);
22892 // VERSION: 2.28
22893 // Creates a new #GTlsCertificate from the PEM-encoded data in @data.
22894 // If @data includes both a certificate and a private key, then the
22895 // returned certificate will include the private key data as well. (See
22896 // the #GTlsCertificate:private-key-pem property for information about
22897 // supported formats.)
22899 // If @data includes multiple certificates, only the first one will be
22900 // parsed.
22901 // RETURNS: the new certificate, or %NULL if @data is invalid
22902 // <data>: PEM-encoded certificate data
22903 // <length>: the length of @data, or -1 if it's 0-terminated.
22904 static TlsCertificate* /*new*/ new_from_pem()(char* data, ssize_t length, GLib2.Error** error=null) {
22905 return g_tls_certificate_new_from_pem(data, length, error);
22908 // VERSION: 2.28
22909 // Creates one or more #GTlsCertificate<!-- -->s from the PEM-encoded
22910 // data in @file. If @file cannot be read or parsed, the function will
22911 // return %NULL and set @error. If @file does not contain any
22912 // PEM-encoded certificates, this will return an empty list and not
22913 // set @error.
22915 // #GList containing #GTlsCertificate objects. You must free the list
22916 // and its contents when you are done with it.
22917 // RETURNS: a
22918 // <file>: file containing PEM-encoded certificates to import
22919 static GLib2.List* /*new*/ list_new_from_file()(char* file, GLib2.Error** error=null) {
22920 return g_tls_certificate_list_new_from_file(file, error);
22923 // VERSION: 2.28
22924 // Gets the #GTlsCertificate representing @cert's issuer, if known
22926 // or %NULL if @cert is self-signed or signed with an unknown
22927 // certificate.
22928 // RETURNS: The certificate of @cert's issuer,
22929 TlsCertificate* get_issuer()() {
22930 return g_tls_certificate_get_issuer(&this);
22933 // VERSION: 2.28
22934 // This verifies @cert and returns a set of #GTlsCertificateFlags
22935 // indicating any problems found with it. This can be used to verify a
22936 // certificate outside the context of making a connection, or to
22937 // check a certificate against a CA that is not part of the system
22938 // CA database.
22940 // If @identity is not %NULL, @cert's name(s) will be compared against
22941 // it, and %G_TLS_CERTIFICATE_BAD_IDENTITY will be set in the return
22942 // value if it does not match. If @identity is %NULL, that bit will
22943 // never be set in the return value.
22945 // If @trusted_ca is not %NULL, then @cert (or one of the certificates
22946 // in its chain) must be signed by it, or else
22947 // %G_TLS_CERTIFICATE_UNKNOWN_CA will be set in the return value. If
22948 // @trusted_ca is %NULL, that bit will never be set in the return
22949 // value.
22951 // (All other #GTlsCertificateFlags values will always be set or unset
22952 // as appropriate.)
22953 // RETURNS: the appropriate #GTlsCertificateFlags
22954 // <identity>: the expected peer identity
22955 // <trusted_ca>: the certificate of a trusted authority
22956 TlsCertificateFlags verify()(SocketConnectable* identity=null, TlsCertificate* trusted_ca=null) {
22957 return g_tls_certificate_verify(&this, identity, trusted_ca);
22961 struct TlsCertificateClass {
22962 GObject2.ObjectClass parent_class;
22964 // RETURNS: the appropriate #GTlsCertificateFlags
22965 // <identity>: the expected peer identity
22966 // <trusted_ca>: the certificate of a trusted authority
22967 extern (C) TlsCertificateFlags function (TlsCertificate* cert, SocketConnectable* identity=null, TlsCertificate* trusted_ca=null) verify;
22968 private void*[8] padding;
22972 // A set of flags describing TLS certification validation. This can be
22973 // used to set which validation steps to perform (eg, with
22974 // g_tls_client_connection_set_validation_flags()), or to describe why
22975 // a particular certificate was rejected (eg, in
22976 // #GTlsConnection::accept-certificate).
22977 enum TlsCertificateFlags /* Version 2.28 */ {
22978 UNKNOWN_CA = 1,
22979 BAD_IDENTITY = 2,
22980 NOT_ACTIVATED = 4,
22981 EXPIRED = 8,
22982 REVOKED = 16,
22983 INSECURE = 32,
22984 GENERIC_ERROR = 64,
22985 VALIDATE_ALL = 127
22987 struct TlsCertificatePrivate {
22991 // #GTlsClientConnection is the client-side subclass of
22992 // #GTlsConnection, representing a client-side TLS connection.
22993 struct TlsClientConnection /* Interface */ /* Version 2.28 */ {
22994 mixin template __interface__() {
22995 // VERSION: 2.28
22996 // Creates a new #GTlsClientConnection wrapping @base_io_stream (which
22997 // must have pollable input and output streams) which is assumed to
22998 // communicate with the server identified by @server_identity.
23000 // #GTlsClientConnection, or %NULL on error
23001 // RETURNS: the new
23002 // <base_io_stream>: the #GIOStream to wrap
23003 // <server_identity>: the expected identity of the server
23004 static TlsClientConnection* /*new*/ new_()(IOStream* base_io_stream, SocketConnectable* server_identity, GLib2.Error** error=null) {
23005 return g_tls_client_connection_new(base_io_stream, server_identity, error);
23008 // VERSION: 2.28
23009 // Gets the list of distinguished names of the Certificate Authorities
23010 // that the server will accept certificates from. This will be set
23011 // during the TLS handshake if the server requests a certificate.
23012 // Otherwise, it will be %NULL.
23014 // Each item in the list is a #GByteArray which contains the complete
23015 // subject DN of the certificate authority.
23017 // CA DNs. You should unref each element with g_byte_array_unref() and then
23018 // the free the list with g_list_free().
23019 // RETURNS: the list of
23020 GLib2.List* /*new*/ get_accepted_cas()() {
23021 return g_tls_client_connection_get_accepted_cas(cast(TlsClientConnection*)&this);
23024 // VERSION: 2.28
23025 // Gets @conn's expected server identity
23027 // expected server identity, or %NULL if the expected identity is not
23028 // known.
23029 // RETURNS: a #GSocketConnectable describing the
23030 SocketConnectable* get_server_identity()() {
23031 return g_tls_client_connection_get_server_identity(cast(TlsClientConnection*)&this);
23034 // VERSION: 2.28
23035 // Gets whether @conn will use SSL 3.0 rather than the
23036 // highest-supported version of TLS; see
23037 // g_tls_client_connection_set_use_ssl3().
23038 // RETURNS: whether @conn will use SSL 3.0
23039 int get_use_ssl3()() {
23040 return g_tls_client_connection_get_use_ssl3(cast(TlsClientConnection*)&this);
23043 // VERSION: 2.28
23044 // Gets @conn's validation flags
23045 // RETURNS: the validation flags
23046 TlsCertificateFlags get_validation_flags()() {
23047 return g_tls_client_connection_get_validation_flags(cast(TlsClientConnection*)&this);
23050 // VERSION: 2.28
23051 // Sets @conn's expected server identity, which is used both to tell
23052 // servers on virtual hosts which certificate to present, and also
23053 // to let @conn know what name to look for in the certificate when
23054 // performing %G_TLS_CERTIFICATE_BAD_IDENTITY validation, if enabled.
23055 // <identity>: a #GSocketConnectable describing the expected server identity
23056 void set_server_identity()(SocketConnectable* identity) {
23057 g_tls_client_connection_set_server_identity(cast(TlsClientConnection*)&this, identity);
23060 // VERSION: 2.28
23061 // If @use_ssl3 is %TRUE, this forces @conn to use SSL 3.0 rather than
23062 // trying to properly negotiate the right version of TLS or SSL to use.
23063 // This can be used when talking to servers that do not implement the
23064 // fallbacks correctly and which will therefore fail to handshake with
23065 // a "modern" TLS handshake attempt.
23066 // <use_ssl3>: whether to use SSL 3.0
23067 void set_use_ssl3()(int use_ssl3) {
23068 g_tls_client_connection_set_use_ssl3(cast(TlsClientConnection*)&this, use_ssl3);
23071 // VERSION: 2.28
23072 // Sets @conn's validation flags, to override the default set of
23073 // checks performed when validating a server certificate. By default,
23074 // %G_TLS_CERTIFICATE_VALIDATE_ALL is used.
23075 // <flags>: the #GTlsCertificateFlags to use
23076 void set_validation_flags()(TlsCertificateFlags flags) {
23077 g_tls_client_connection_set_validation_flags(cast(TlsClientConnection*)&this, flags);
23080 mixin __interface__;
23083 struct TlsClientConnectionInterface {
23084 GObject2.TypeInterface g_iface;
23088 // #GTlsConnection is the base TLS connection class type, which wraps
23089 // a #GIOStream and provides TLS encryption on top of it. Its
23090 // subclasses, #GTlsClientConnection and #GTlsServerConnection,
23091 // implement client-side and server-side TLS, respectively.
23092 struct TlsConnection /* : IOStream */ /* Version 2.28 */ {
23093 alias parent_instance this;
23094 alias parent_instance super_;
23095 alias parent_instance iostream;
23096 IOStream parent_instance;
23097 TlsConnectionPrivate* priv;
23100 // VERSION: 2.28
23101 // Used by #GTlsConnection implementations to emit the
23102 // #GTlsConnection::accept-certificate signal.
23104 // %TRUE to accept @peer_cert
23105 // RETURNS: %TRUE if one of the signal handlers has returned
23106 // <peer_cert>: the peer's #GTlsCertificate
23107 // <errors>: the problems with @peer_cert
23108 int emit_accept_certificate()(TlsCertificate* peer_cert, TlsCertificateFlags errors) {
23109 return g_tls_connection_emit_accept_certificate(&this, peer_cert, errors);
23112 // VERSION: 2.28
23113 // Gets @conn's certificate, as set by
23114 // g_tls_connection_set_certificate().
23115 // RETURNS: @conn's certificate, or %NULL
23116 TlsCertificate* get_certificate()() {
23117 return g_tls_connection_get_certificate(&this);
23120 // VERSION: 2.30
23121 // Gets the certificate database that @conn uses to verify
23122 // peer certificates. See g_tls_connection_set_database().
23123 // RETURNS: the certificate database that @conn uses or %NULL
23124 TlsDatabase* get_database()() {
23125 return g_tls_connection_get_database(&this);
23128 // VERSION: 2.30
23129 // Get the object that will be used to interact with the user. It will be used
23130 // for things like prompting the user for passwords. If %NULL is returned, then
23131 // no user interaction will occur for this connection.
23132 // RETURNS: The interaction object.
23133 TlsInteraction* get_interaction()() {
23134 return g_tls_connection_get_interaction(&this);
23137 // VERSION: 2.28
23138 // Gets @conn's peer's certificate after the handshake has completed.
23139 // (It is not set during the emission of
23140 // #GTlsConnection::accept-certificate.)
23141 // RETURNS: @conn's peer's certificate, or %NULL
23142 TlsCertificate* get_peer_certificate()() {
23143 return g_tls_connection_get_peer_certificate(&this);
23146 // VERSION: 2.28
23147 // Gets the errors associated with validating @conn's peer's
23148 // certificate, after the handshake has completed. (It is not set
23149 // during the emission of #GTlsConnection::accept-certificate.)
23150 // RETURNS: @conn's peer's certificate errors
23151 TlsCertificateFlags get_peer_certificate_errors()() {
23152 return g_tls_connection_get_peer_certificate_errors(&this);
23155 // VERSION: 2.28
23156 // Gets @conn rehandshaking mode. See
23157 // g_tls_connection_set_rehandshake_mode() for details.
23158 // RETURNS: @conn's rehandshaking mode
23159 TlsRehandshakeMode get_rehandshake_mode()() {
23160 return g_tls_connection_get_rehandshake_mode(&this);
23163 // VERSION: 2.28
23164 // Tests whether or not @conn expects a proper TLS close notification
23165 // when the connection is closed. See
23166 // g_tls_connection_set_require_close_notify() for details.
23168 // notification.
23169 // RETURNS: %TRUE if @conn requires a proper TLS close
23170 int get_require_close_notify()() {
23171 return g_tls_connection_get_require_close_notify(&this);
23174 // DEPRECATED (v2.30) method: get_use_system_certdb - Use g_tls_connection_get_database() instead
23175 // Gets whether @conn uses the system certificate database to verify
23176 // peer certificates. See g_tls_connection_set_use_system_certdb().
23177 // RETURNS: whether @conn uses the system certificate database
23178 int get_use_system_certdb()() {
23179 return g_tls_connection_get_use_system_certdb(&this);
23182 // VERSION: 2.28
23183 // Attempts a TLS handshake on @conn.
23185 // On the client side, it is never necessary to call this method;
23186 // although the connection needs to perform a handshake after
23187 // connecting (or after sending a "STARTTLS"-type command) and may
23188 // need to rehandshake later if the server requests it,
23189 // #GTlsConnection will handle this for you automatically when you try
23190 // to send or receive data on the connection. However, you can call
23191 // g_tls_connection_handshake() manually if you want to know for sure
23192 // whether the initial handshake succeeded or failed (as opposed to
23193 // just immediately trying to write to @conn's output stream, in which
23194 // case if it fails, it may not be possible to tell if it failed
23195 // before or after completing the handshake).
23197 // Likewise, on the server side, although a handshake is necessary at
23198 // the beginning of the communication, you do not need to call this
23199 // function explicitly unless you want clearer error reporting.
23200 // However, you may call g_tls_connection_handshake() later on to
23201 // renegotiate parameters (encryption methods, etc) with the client.
23203 // #GTlsConnection::accept_certificate may be emitted during the
23204 // handshake.
23205 // RETURNS: success or failure
23206 // <cancellable>: a #GCancellable, or %NULL
23207 int handshake()(Cancellable* cancellable, GLib2.Error** error=null) {
23208 return g_tls_connection_handshake(&this, cancellable, error);
23211 // VERSION: 2.28
23212 // Asynchronously performs a TLS handshake on @conn. See
23213 // g_tls_connection_handshake() for more information.
23214 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
23215 // <cancellable>: a #GCancellable, or %NULL
23216 // <callback>: callback to call when the handshake is complete
23217 // <user_data>: the data to pass to the callback function
23218 void handshake_async()(int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
23219 g_tls_connection_handshake_async(&this, io_priority, cancellable, callback, user_data);
23222 // VERSION: 2.28
23223 // Finish an asynchronous TLS handshake operation. See
23224 // g_tls_connection_handshake() for more information.
23226 // case @error will be set.
23227 // RETURNS: %TRUE on success, %FALSE on failure, in which
23228 // <result>: a #GAsyncResult.
23229 int handshake_finish()(AsyncResult* result, GLib2.Error** error=null) {
23230 return g_tls_connection_handshake_finish(&this, result, error);
23233 // VERSION: 2.28
23234 // This sets the certificate that @conn will present to its peer
23235 // during the TLS handshake. For a #GTlsServerConnection, it is
23236 // mandatory to set this, and that will normally be done at construct
23237 // time.
23239 // For a #GTlsClientConnection, this is optional. If a handshake fails
23240 // with %G_TLS_ERROR_CERTIFICATE_REQUIRED, that means that the server
23241 // requires a certificate, and if you try connecting again, you should
23242 // call this method first. You can call
23243 // g_tls_client_connection_get_accepted_cas() on the failed connection
23244 // to get a list of Certificate Authorities that the server will
23245 // accept certificates from.
23247 // (It is also possible that a server will allow the connection with
23248 // or without a certificate; in that case, if you don't provide a
23249 // certificate, you can tell that the server requested one by the fact
23250 // that g_tls_client_connection_get_accepted_cas() will return
23251 // non-%NULL.)
23252 // <certificate>: the certificate to use for @conn
23253 void set_certificate()(TlsCertificate* certificate) {
23254 g_tls_connection_set_certificate(&this, certificate);
23257 // VERSION: 2.30
23258 // Sets the certificate database that is used to verify peer certificates.
23259 // This is set to the default database by default. See
23260 // g_tls_backend_get_default_database(). If set to %NULL, then
23261 // peer certificate validation will always set the
23262 // %G_TLS_CERTIFICATE_UNKNOWN_CA error (meaning
23263 // #GTlsConnection::accept-certificate will always be emitted on
23264 // client-side connections, unless that bit is not set in
23265 // #GTlsClientConnection:validation-flags).
23266 // <database>: a #GTlsDatabase
23267 void set_database()(TlsDatabase* database) {
23268 g_tls_connection_set_database(&this, database);
23271 // VERSION: 2.30
23272 // Set the object that will be used to interact with the user. It will be used
23273 // for things like prompting the user for passwords.
23275 // The @interaction argument will normally be a derived subclass of
23276 // #GTlsInteraction. %NULL can also be provided if no user interaction
23277 // should occur for this connection.
23278 // <interaction>: an interaction object, or %NULL
23279 void set_interaction()(TlsInteraction* interaction=null) {
23280 g_tls_connection_set_interaction(&this, interaction);
23283 // VERSION: 2.28
23284 // Sets how @conn behaves with respect to rehandshaking requests.
23286 // %G_TLS_REHANDSHAKE_NEVER means that it will never agree to
23287 // rehandshake after the initial handshake is complete. (For a client,
23288 // this means it will refuse rehandshake requests from the server, and
23289 // for a server, this means it will close the connection with an error
23290 // if the client attempts to rehandshake.)
23292 // %G_TLS_REHANDSHAKE_SAFELY means that the connection will allow a
23293 // rehandshake only if the other end of the connection supports the
23294 // TLS <literal>renegotiation_info</literal> extension. This is the
23295 // default behavior, but means that rehandshaking will not work
23296 // against older implementations that do not support that extension.
23298 // %G_TLS_REHANDSHAKE_UNSAFELY means that the connection will allow
23299 // rehandshaking even without the
23300 // <literal>renegotiation_info</literal> extension. On the server side
23301 // in particular, this is not recommended, since it leaves the server
23302 // open to certain attacks. However, this mode is necessary if you
23303 // need to allow renegotiation with older client software.
23304 // <mode>: the rehandshaking mode
23305 void set_rehandshake_mode()(TlsRehandshakeMode mode) {
23306 g_tls_connection_set_rehandshake_mode(&this, mode);
23309 // VERSION: 2.28
23310 // Sets whether or not @conn expects a proper TLS close notification
23311 // before the connection is closed. If this is %TRUE (the default),
23312 // then @conn will expect to receive a TLS close notification from its
23313 // peer before the connection is closed, and will return a
23314 // %G_TLS_ERROR_EOF error if the connection is closed without proper
23315 // notification (since this may indicate a network error, or
23316 // man-in-the-middle attack).
23318 // In some protocols, the application will know whether or not the
23319 // connection was closed cleanly based on application-level data
23320 // (because the application-level data includes a length field, or is
23321 // somehow self-delimiting); in this case, the close notify is
23322 // redundant and sometimes omitted. (TLS 1.1 explicitly allows this;
23323 // in TLS 1.0 it is technically an error, but often done anyway.) You
23324 // can use g_tls_connection_set_require_close_notify() to tell @conn
23325 // to allow an "unannounced" connection close, in which case the close
23326 // will show up as a 0-length read, as in a non-TLS
23327 // #GSocketConnection, and it is up to the application to check that
23328 // the data has been fully received.
23330 // Note that this only affects the behavior when the peer closes the
23331 // connection; when the application calls g_io_stream_close() itself
23332 // on @conn, this will send a close notification regardless of the
23333 // setting of this property. If you explicitly want to do an unclean
23334 // close, you can close @conn's #GTlsConnection:base-io-stream rather
23335 // than closing @conn itself.
23336 // <require_close_notify>: whether or not to require close notification
23337 void set_require_close_notify()(int require_close_notify) {
23338 g_tls_connection_set_require_close_notify(&this, require_close_notify);
23341 // DEPRECATED (v2.30) method: set_use_system_certdb - Use g_tls_connection_set_database() instead
23342 // Sets whether @conn uses the system certificate database to verify
23343 // peer certificates. This is %TRUE by default. If set to %FALSE, then
23344 // peer certificate validation will always set the
23345 // %G_TLS_CERTIFICATE_UNKNOWN_CA error (meaning
23346 // #GTlsConnection::accept-certificate will always be emitted on
23347 // client-side connections, unless that bit is not set in
23348 // #GTlsClientConnection:validation-flags).
23349 // <use_system_certdb>: whether to use the system certificate database
23350 void set_use_system_certdb()(int use_system_certdb) {
23351 g_tls_connection_set_use_system_certdb(&this, use_system_certdb);
23354 // VERSION: 2.28
23355 // Emitted during the TLS handshake after the peer certificate has
23356 // been received. You can examine @peer_cert's certification path by
23357 // calling g_tls_certificate_get_issuer() on it.
23359 // For a client-side connection, @peer_cert is the server's
23360 // certificate, and the signal will only be emitted if the
23361 // certificate was not acceptable according to @conn's
23362 // #GTlsClientConnection:validation_flags. If you would like the
23363 // certificate to be accepted despite @errors, return %TRUE from the
23364 // signal handler. Otherwise, if no handler accepts the certificate,
23365 // the handshake will fail with %G_TLS_ERROR_BAD_CERTIFICATE.
23367 // For a server-side connection, @peer_cert is the certificate
23368 // presented by the client, if this was requested via the server's
23369 // #GTlsServerConnection:authentication_mode. On the server side,
23370 // the signal is always emitted when the client presents a
23371 // certificate, and the certificate will only be accepted if a
23372 // handler returns %TRUE.
23374 // Note that if this signal is emitted as part of asynchronous I/O
23375 // in the main thread, then you should not attempt to interact with
23376 // the user before returning from the signal handler. If you want to
23377 // let the user decide whether or not to accept the certificate, you
23378 // would have to return %FALSE from the signal handler on the first
23379 // attempt, and then after the connection attempt returns a
23380 // %G_TLS_ERROR_HANDSHAKE, you can interact with the user, and if
23381 // the user decides to accept the certificate, remember that fact,
23382 // create a new connection, and return %TRUE from the signal handler
23383 // the next time.
23385 // If you are doing I/O in another thread, you do not
23386 // need to worry about this, and can simply block in the signal
23387 // handler until the UI thread returns an answer.
23389 // immediately end the signal emission). %FALSE to allow the signal
23390 // emission to continue, which will cause the handshake to fail if
23391 // no one else overrides it.
23392 // RETURNS: %TRUE to accept @peer_cert (which will also
23393 // <peer_cert>: the peer's #GTlsCertificate
23394 // <errors>: the problems with @peer_cert.
23395 extern (C) alias static c_int function (TlsConnection* this_, TlsCertificate* peer_cert, TlsCertificateFlags* errors, void* user_data=null) signal_accept_certificate;
23397 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
23398 return super_.signal_connect!name(cb, data, cf);
23401 ulong signal_connect(string name:"accept-certificate", CB:signal_accept_certificate)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
23402 return signal_connect_data!()(&this, cast(char*)"accept-certificate",
23403 cast(GObject2.Callback)cb, data, null, cf);
23407 struct TlsConnectionClass {
23408 IOStreamClass parent_class;
23409 extern (C) int function (TlsConnection* connection, TlsCertificate* peer_cert, TlsCertificateFlags errors) accept_certificate;
23411 // RETURNS: success or failure
23412 // <cancellable>: a #GCancellable, or %NULL
23413 extern (C) int function (TlsConnection* conn, Cancellable* cancellable, GLib2.Error** error=null) handshake;
23415 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
23416 // <cancellable>: a #GCancellable, or %NULL
23417 // <callback>: callback to call when the handshake is complete
23418 // <user_data>: the data to pass to the callback function
23419 extern (C) void function (TlsConnection* conn, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) handshake_async;
23421 // RETURNS: %TRUE on success, %FALSE on failure, in which
23422 // <result>: a #GAsyncResult.
23423 extern (C) int function (TlsConnection* conn, AsyncResult* result, GLib2.Error** error=null) handshake_finish;
23424 private void*[8] padding;
23427 struct TlsConnectionPrivate {
23431 // #GTlsDatabase is used to lookup certificates and other information
23432 // from a certificate or key store. It is an abstract base class which
23433 // TLS library specific subtypes override.
23435 // Most common client applications will not directly interact with
23436 // #GTlsDatabase. It is used internally by #GTlsConnection.
23437 struct TlsDatabase /* : GObject.Object */ /* Version 2.30 */ {
23438 alias parent_instance this;
23439 alias parent_instance super_;
23440 alias parent_instance object;
23441 GObject2.Object parent_instance;
23442 TlsDatabasePrivate* priv;
23445 // VERSION: 2.30
23446 // Create a handle string for the certificate. The database will only be able
23447 // to create a handle for certificates that originate from the database. In
23448 // cases where the database cannot create a handle for a certificate, %NULL
23449 // will be returned.
23451 // This handle should be stable across various instances of the application,
23452 // and between applications. If a certificate is modified in the database,
23453 // then it is not guaranteed that this handle will continue to point to it.
23454 // RETURNS: a newly allocated string containing the handle.
23455 // <certificate>: certificate for which to create a handle.
23456 char* /*new*/ create_certificate_handle()(TlsCertificate* certificate) {
23457 return g_tls_database_create_certificate_handle(&this, certificate);
23460 // VERSION: 2.30
23461 // Lookup a certificate by its handle.
23463 // The handle should have been created by calling g_tls_database_create_handle()
23464 // on a #GTlsDatabase object of the same TLS backend. The handle is designed
23465 // to remain valid across instantiations of the database.
23467 // If the handle is no longer valid, or does not point to a certificate in
23468 // this database, then %NULL will be returned.
23470 // This function can block, use g_tls_database_lookup_certificate_for_handle_async() to perform
23471 // the lookup operation asynchronously.
23473 // #GTlsCertificate, or %NULL. Use g_object_unref() to release the certificate.
23474 // RETURNS: a newly allocated
23475 // <handle>: a certificate handle
23476 // <interaction>: used to interact with the user if necessary
23477 // <flags>: Flags which affect the lookup.
23478 // <cancellable>: a #GCancellable, or %NULL
23479 TlsCertificate* /*new*/ lookup_certificate_for_handle()(char* handle, TlsInteraction* interaction, TlsDatabaseLookupFlags flags, Cancellable* cancellable, GLib2.Error** error=null) {
23480 return g_tls_database_lookup_certificate_for_handle(&this, handle, interaction, flags, cancellable, error);
23483 // VERSION: 2.30
23484 // Asynchronously lookup a certificate by its handle in the database. See
23485 // g_tls_database_lookup_handle() for more information.
23486 // <handle>: a certificate handle
23487 // <interaction>: used to interact with the user if necessary
23488 // <flags>: Flags which affect the lookup.
23489 // <cancellable>: a #GCancellable, or %NULL
23490 // <callback>: callback to call when the operation completes
23491 // <user_data>: the data to pass to the callback function
23492 void lookup_certificate_for_handle_async()(char* handle, TlsInteraction* interaction, TlsDatabaseLookupFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
23493 g_tls_database_lookup_certificate_for_handle_async(&this, handle, interaction, flags, cancellable, callback, user_data);
23496 // VERSION: 2.30
23497 // Finish an asynchronous lookup of a certificate by its handle. See
23498 // g_tls_database_lookup_handle() for more information.
23500 // If the handle is no longer valid, or does not point to a certificate in
23501 // this database, then %NULL will be returned.
23503 // Use g_object_unref() to release the certificate.
23504 // RETURNS: a newly allocated #GTlsCertificate object.
23505 // <result>: a #GAsyncResult.
23506 TlsCertificate* /*new*/ lookup_certificate_for_handle_finish()(AsyncResult* result, GLib2.Error** error=null) {
23507 return g_tls_database_lookup_certificate_for_handle_finish(&this, result, error);
23510 // VERSION: 2.30
23511 // Lookup the issuer of @certificate in the database.
23513 // The %issuer property
23514 // of @certificate is not modified, and the two certificates are not hooked
23515 // into a chain.
23517 // This function can block, use g_tls_database_lookup_certificate_issuer_async() to perform
23518 // the lookup operation asynchronously.
23520 // or %NULL. Use g_object_unref() to release the certificate.
23521 // RETURNS: a newly allocated issuer #GTlsCertificate,
23522 // <certificate>: a #GTlsCertificate
23523 // <interaction>: used to interact with the user if necessary
23524 // <flags>: flags which affect the lookup operation
23525 // <cancellable>: a #GCancellable, or %NULL
23526 TlsCertificate* /*new*/ lookup_certificate_issuer()(TlsCertificate* certificate, TlsInteraction* interaction, TlsDatabaseLookupFlags flags, Cancellable* cancellable, GLib2.Error** error=null) {
23527 return g_tls_database_lookup_certificate_issuer(&this, certificate, interaction, flags, cancellable, error);
23530 // VERSION: 2.30
23531 // Asynchronously lookup the issuer of @certificate in the database. See
23532 // g_tls_database_lookup_certificate_issuer() for more information.
23533 // <certificate>: a #GTlsCertificate
23534 // <interaction>: used to interact with the user if necessary
23535 // <flags>: flags which affect the lookup operation
23536 // <cancellable>: a #GCancellable, or %NULL
23537 // <callback>: callback to call when the operation completes
23538 // <user_data>: the data to pass to the callback function
23539 void lookup_certificate_issuer_async()(TlsCertificate* certificate, TlsInteraction* interaction, TlsDatabaseLookupFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
23540 g_tls_database_lookup_certificate_issuer_async(&this, certificate, interaction, flags, cancellable, callback, user_data);
23543 // VERSION: 2.30
23544 // Finish an asynchronous lookup issuer operation. See
23545 // g_tls_database_lookup_certificate_issuer() for more information.
23547 // or %NULL. Use g_object_unref() to release the certificate.
23548 // RETURNS: a newly allocated issuer #GTlsCertificate,
23549 // <result>: a #GAsyncResult.
23550 TlsCertificate* /*new*/ lookup_certificate_issuer_finish()(AsyncResult* result, GLib2.Error** error=null) {
23551 return g_tls_database_lookup_certificate_issuer_finish(&this, result, error);
23554 // VERSION: 2.30
23555 // Lookup certificates issued by this issuer in the database.
23557 // This function can block, use g_tls_database_lookup_certificates_issued_by_async() to perform
23558 // the lookup operation asynchronously.
23560 // objects. Use g_object_unref() on each certificate, and g_list_free() on the release the list.
23561 // RETURNS: a newly allocated list of #GTlsCertificate
23562 // <issuer_raw_dn>: a #GByteArray which holds the DER encoded issuer DN.
23563 // <interaction>: used to interact with the user if necessary
23564 // <flags>: Flags which affect the lookup operation.
23565 // <cancellable>: a #GCancellable, or %NULL
23566 GLib2.List* /*new*/ lookup_certificates_issued_by()(ByteArray* issuer_raw_dn, TlsInteraction* interaction, TlsDatabaseLookupFlags flags, Cancellable* cancellable, GLib2.Error** error=null) {
23567 return g_tls_database_lookup_certificates_issued_by(&this, issuer_raw_dn, interaction, flags, cancellable, error);
23570 // VERSION: 2.30
23571 // Asynchronously lookup certificates issued by this issuer in the database. See
23572 // g_tls_database_lookup_certificates_issued_by() for more information.
23574 // The database may choose to hold a reference to the issuer byte array for the duration
23575 // of of this asynchronous operation. The byte array should not be modified during
23576 // this time.
23577 // <issuer_raw_dn>: a #GByteArray which holds the DER encoded issuer DN.
23578 // <interaction>: used to interact with the user if necessary
23579 // <flags>: Flags which affect the lookup operation.
23580 // <cancellable>: a #GCancellable, or %NULL
23581 // <callback>: callback to call when the operation completes
23582 // <user_data>: the data to pass to the callback function
23583 void lookup_certificates_issued_by_async()(ByteArray* issuer_raw_dn, TlsInteraction* interaction, TlsDatabaseLookupFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
23584 g_tls_database_lookup_certificates_issued_by_async(&this, issuer_raw_dn, interaction, flags, cancellable, callback, user_data);
23587 // Unintrospectable method: lookup_certificates_issued_by_finish() / g_tls_database_lookup_certificates_issued_by_finish()
23588 // VERSION: 2.30
23589 // Finish an asynchronous lookup of certificates. See
23590 // g_tls_database_lookup_certificates_issued_by() for more information.
23592 // Use g_object_unref() on each certificate, and g_list_free() on the release the list.
23593 // RETURNS: a newly allocated list of #GTlsCertificate objects.
23594 // <result>: a #GAsyncResult.
23595 GLib2.List* /*new*/ lookup_certificates_issued_by_finish()(AsyncResult* result, GLib2.Error** error=null) {
23596 return g_tls_database_lookup_certificates_issued_by_finish(&this, result, error);
23599 // VERSION: 2.30
23600 // Verify's a certificate chain after looking up and adding any missing
23601 // certificates to the chain.
23603 // @chain is a chain of #GTlsCertificate objects each pointing to the next
23604 // certificate in the chain by its %issuer property. The chain may initially
23605 // consist of one or more certificates. After the verification process is
23606 // complete, @chain may be modified by adding missing certificates, or removing
23607 // extra certificates. If a certificate anchor was found, then it is added to
23608 // the @chain.
23610 // @purpose describes the purpose (or usage) for which the certificate
23611 // is being used. Typically @purpose will be set to #G_TLS_DATABASE_PURPOSE_AUTHENTICATE_SERVER
23612 // which means that the certificate is being used to authenticate a server
23613 // (and we are acting as the client).
23615 // The @identity is used to check for pinned certificates (trust exceptions)
23616 // in the database. These will override the normal verification process on a
23617 // host by host basis.
23619 // Currently there are no @flags, and %G_TLS_DATABASE_VERIFY_NONE should be
23620 // used.
23622 // This function can block, use g_tls_database_verify_chain_async() to perform
23623 // the verification operation asynchronously.
23625 // result of verification.
23626 // RETURNS: the appropriate #GTlsCertificateFlags which represents the
23627 // <chain>: a #GTlsCertificate chain
23628 // <purpose>: the purpose that this certificate chain will be used for.
23629 // <identity>: the expected peer identity
23630 // <interaction>: used to interact with the user if necessary
23631 // <flags>: additional verify flags
23632 // <cancellable>: a #GCancellable, or %NULL
23633 TlsCertificateFlags verify_chain()(TlsCertificate* chain, char* purpose, SocketConnectable* identity, TlsInteraction* interaction, TlsDatabaseVerifyFlags flags, Cancellable* cancellable, GLib2.Error** error=null) {
23634 return g_tls_database_verify_chain(&this, chain, purpose, identity, interaction, flags, cancellable, error);
23637 // VERSION: 2.30
23638 // Asynchronously verify's a certificate chain after looking up and adding
23639 // any missing certificates to the chain. See g_tls_database_verify_chain()
23640 // for more information.
23641 // <chain>: a #GTlsCertificate chain
23642 // <purpose>: the purpose that this certificate chain will be used for.
23643 // <identity>: the expected peer identity
23644 // <interaction>: used to interact with the user if necessary
23645 // <flags>: additional verify flags
23646 // <cancellable>: a #GCancellable, or %NULL
23647 // <callback>: callback to call when the operation completes
23648 // <user_data>: the data to pass to the callback function
23649 void verify_chain_async()(TlsCertificate* chain, char* purpose, SocketConnectable* identity, TlsInteraction* interaction, TlsDatabaseVerifyFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
23650 g_tls_database_verify_chain_async(&this, chain, purpose, identity, interaction, flags, cancellable, callback, user_data);
23653 // VERSION: 2.30
23654 // Finish an asynchronous verify chain operation. See
23655 // g_tls_database_verify_chain() for more information. *
23656 // result of verification.
23657 // RETURNS: the appropriate #GTlsCertificateFlags which represents the
23658 // <result>: a #GAsyncResult.
23659 TlsCertificateFlags verify_chain_finish()(AsyncResult* result, GLib2.Error** error=null) {
23660 return g_tls_database_verify_chain_finish(&this, result, error);
23664 struct TlsDatabaseClass {
23665 GObject2.ObjectClass parent_class;
23667 // RETURNS: the appropriate #GTlsCertificateFlags which represents the
23668 // <chain>: a #GTlsCertificate chain
23669 // <purpose>: the purpose that this certificate chain will be used for.
23670 // <identity>: the expected peer identity
23671 // <interaction>: used to interact with the user if necessary
23672 // <flags>: additional verify flags
23673 // <cancellable>: a #GCancellable, or %NULL
23674 extern (C) TlsCertificateFlags function (TlsDatabase* self, TlsCertificate* chain, char* purpose, SocketConnectable* identity, TlsInteraction* interaction, TlsDatabaseVerifyFlags flags, Cancellable* cancellable, GLib2.Error** error=null) verify_chain;
23676 // <chain>: a #GTlsCertificate chain
23677 // <purpose>: the purpose that this certificate chain will be used for.
23678 // <identity>: the expected peer identity
23679 // <interaction>: used to interact with the user if necessary
23680 // <flags>: additional verify flags
23681 // <cancellable>: a #GCancellable, or %NULL
23682 // <callback>: callback to call when the operation completes
23683 // <user_data>: the data to pass to the callback function
23684 extern (C) void function (TlsDatabase* self, TlsCertificate* chain, char* purpose, SocketConnectable* identity, TlsInteraction* interaction, TlsDatabaseVerifyFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) verify_chain_async;
23686 // RETURNS: the appropriate #GTlsCertificateFlags which represents the
23687 // <result>: a #GAsyncResult.
23688 extern (C) TlsCertificateFlags function (TlsDatabase* self, AsyncResult* result, GLib2.Error** error=null) verify_chain_finish;
23690 // RETURNS: a newly allocated string containing the handle.
23691 // <certificate>: certificate for which to create a handle.
23692 extern (C) char* /*new*/ function (TlsDatabase* self, TlsCertificate* certificate) create_certificate_handle;
23694 // RETURNS: a newly allocated
23695 // <handle>: a certificate handle
23696 // <interaction>: used to interact with the user if necessary
23697 // <flags>: Flags which affect the lookup.
23698 // <cancellable>: a #GCancellable, or %NULL
23699 extern (C) TlsCertificate* /*new*/ function (TlsDatabase* self, char* handle, TlsInteraction* interaction, TlsDatabaseLookupFlags flags, Cancellable* cancellable, GLib2.Error** error=null) lookup_certificate_for_handle;
23701 // <handle>: a certificate handle
23702 // <interaction>: used to interact with the user if necessary
23703 // <flags>: Flags which affect the lookup.
23704 // <cancellable>: a #GCancellable, or %NULL
23705 // <callback>: callback to call when the operation completes
23706 // <user_data>: the data to pass to the callback function
23707 extern (C) void function (TlsDatabase* self, char* handle, TlsInteraction* interaction, TlsDatabaseLookupFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) lookup_certificate_for_handle_async;
23709 // RETURNS: a newly allocated #GTlsCertificate object.
23710 // <result>: a #GAsyncResult.
23711 extern (C) TlsCertificate* /*new*/ function (TlsDatabase* self, AsyncResult* result, GLib2.Error** error=null) lookup_certificate_for_handle_finish;
23713 // RETURNS: a newly allocated issuer #GTlsCertificate,
23714 // <certificate>: a #GTlsCertificate
23715 // <interaction>: used to interact with the user if necessary
23716 // <flags>: flags which affect the lookup operation
23717 // <cancellable>: a #GCancellable, or %NULL
23718 extern (C) TlsCertificate* /*new*/ function (TlsDatabase* self, TlsCertificate* certificate, TlsInteraction* interaction, TlsDatabaseLookupFlags flags, Cancellable* cancellable, GLib2.Error** error=null) lookup_certificate_issuer;
23720 // <certificate>: a #GTlsCertificate
23721 // <interaction>: used to interact with the user if necessary
23722 // <flags>: flags which affect the lookup operation
23723 // <cancellable>: a #GCancellable, or %NULL
23724 // <callback>: callback to call when the operation completes
23725 // <user_data>: the data to pass to the callback function
23726 extern (C) void function (TlsDatabase* self, TlsCertificate* certificate, TlsInteraction* interaction, TlsDatabaseLookupFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) lookup_certificate_issuer_async;
23728 // RETURNS: a newly allocated issuer #GTlsCertificate,
23729 // <result>: a #GAsyncResult.
23730 extern (C) TlsCertificate* /*new*/ function (TlsDatabase* self, AsyncResult* result, GLib2.Error** error=null) lookup_certificate_issuer_finish;
23732 // RETURNS: a newly allocated list of #GTlsCertificate
23733 // <issuer_raw_dn>: a #GByteArray which holds the DER encoded issuer DN.
23734 // <interaction>: used to interact with the user if necessary
23735 // <flags>: Flags which affect the lookup operation.
23736 // <cancellable>: a #GCancellable, or %NULL
23737 extern (C) GLib2.List* /*new*/ function (TlsDatabase* self, ByteArray* issuer_raw_dn, TlsInteraction* interaction, TlsDatabaseLookupFlags flags, Cancellable* cancellable, GLib2.Error** error=null) lookup_certificates_issued_by;
23739 // <issuer_raw_dn>: a #GByteArray which holds the DER encoded issuer DN.
23740 // <interaction>: used to interact with the user if necessary
23741 // <flags>: Flags which affect the lookup operation.
23742 // <cancellable>: a #GCancellable, or %NULL
23743 // <callback>: callback to call when the operation completes
23744 // <user_data>: the data to pass to the callback function
23745 extern (C) void function (TlsDatabase* self, ByteArray* issuer_raw_dn, TlsInteraction* interaction, TlsDatabaseLookupFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) lookup_certificates_issued_by_async;
23747 // Unintrospectable functionp: lookup_certificates_issued_by_finish() / ()
23749 // RETURNS: a newly allocated list of #GTlsCertificate objects.
23750 // <result>: a #GAsyncResult.
23751 extern (C) GLib2.List* /*new*/ function (TlsDatabase* self, AsyncResult* result, GLib2.Error** error=null) lookup_certificates_issued_by_finish;
23752 private void*[16] padding;
23756 // Flags for g_tls_database_lookup_handle(), g_tls_database_lookup_issuer(),
23757 // and g_tls_database_lookup_issued().
23758 enum TlsDatabaseLookupFlags /* Version 2.30 */ {
23759 NONE = 0,
23760 KEYPAIR = 1
23762 struct TlsDatabasePrivate {
23765 // Flags for g_tls_database_verify_chain().
23766 enum TlsDatabaseVerifyFlags /* Version 2.30 */ {
23767 NONE = 0
23770 // An error code used with %G_TLS_ERROR in a #GError returned from a
23771 // TLS-related routine.
23772 enum TlsError /* Version 2.28 */ {
23773 UNAVAILABLE = 0,
23774 MISC = 1,
23775 BAD_CERTIFICATE = 2,
23776 NOT_TLS = 3,
23777 HANDSHAKE = 4,
23778 CERTIFICATE_REQUIRED = 5,
23779 EOF = 6
23782 // #GTlsFileDatabase is implemented by #GTlsDatabase objects which load
23783 // their certificate information from a file. It is in interface which
23784 // TLS library specific subtypes implement.
23785 struct TlsFileDatabase /* Interface */ /* Version 2.30 */ {
23786 mixin template __interface__() {
23787 // VERSION: 2.30
23788 // Creates a new #GTlsFileDatabase which uses anchor certificate authorities
23789 // in @anchors to verify certificate chains.
23791 // The certificates in @anchors must be PEM encoded.
23793 // #GTlsFileDatabase, or %NULL on error
23794 // RETURNS: the new
23795 // <anchors>: filename of anchor certificate authorities.
23796 static TlsFileDatabase* /*new*/ new_()(char* anchors, GLib2.Error** error=null) {
23797 return g_tls_file_database_new(anchors, error);
23800 mixin __interface__;
23803 // Provides an interface for #GTlsFileDatabase implementations.
23804 struct TlsFileDatabaseInterface {
23805 GObject2.TypeInterface g_iface;
23806 private void*[8] padding;
23810 // #GTlsInteraction provides a mechanism for the TLS connection and database
23811 // code to interact with the user. It can be used to ask the user for passwords.
23813 // To use a #GTlsInteraction with a TLS connection use
23814 // g_tls_connection_set_interaction().
23816 // Callers should instantiate a derived class that implements the various
23817 // interaction methods to show the required dialogs.
23819 // Callers should use the 'invoke' functions like
23820 // g_tls_interaction_invoke_ask_password() to run interaction methods. These
23821 // functions make sure that the interaction is invoked in the main loop
23822 // and not in the current thread, if the current thread is not running the
23823 // main loop.
23825 // Derived classes can choose to implement whichever interactions methods they'd
23826 // like to support by overriding those virtual methods in their class
23827 // initialization function. Any interactions not implemented will return
23828 // %G_TLS_INTERACTION_UNHANDLED. If a derived class implements an async method,
23829 // it must also implement the corresponding finish method.
23830 struct TlsInteraction /* : GObject.Object */ /* Version 2.30 */ {
23831 alias parent_instance this;
23832 alias parent_instance super_;
23833 alias parent_instance object;
23834 GObject2.Object parent_instance;
23835 private TlsInteractionPrivate* priv;
23838 // VERSION: 2.30
23839 // Run synchronous interaction to ask the user for a password. In general,
23840 // g_tls_interaction_invoke_ask_password() should be used instead of this
23841 // function.
23843 // Derived subclasses usually implement a password prompt, although they may
23844 // also choose to provide a password from elsewhere. The @password value will
23845 // be filled in and then @callback will be called. Alternatively the user may
23846 // abort this password request, which will usually abort the TLS connection.
23848 // If the interaction is cancelled by the cancellation object, or by the
23849 // user then %G_TLS_INTERACTION_FAILED will be returned with an error that
23850 // contains a %G_IO_ERROR_CANCELLED error code. Certain implementations may
23851 // not support immediate cancellation.
23852 // RETURNS: The status of the ask password interaction.
23853 // <password>: a #GTlsPassword object
23854 // <cancellable>: an optional #GCancellable cancellation object
23855 TlsInteractionResult ask_password()(TlsPassword* password, Cancellable* cancellable, GLib2.Error** error=null) {
23856 return g_tls_interaction_ask_password(&this, password, cancellable, error);
23859 // VERSION: 2.30
23860 // Run asynchronous interaction to ask the user for a password. In general,
23861 // g_tls_interaction_invoke_ask_password() should be used instead of this
23862 // function.
23864 // Derived subclasses usually implement a password prompt, although they may
23865 // also choose to provide a password from elsewhere. The @password value will
23866 // be filled in and then @callback will be called. Alternatively the user may
23867 // abort this password request, which will usually abort the TLS connection.
23869 // If the interaction is cancelled by the cancellation object, or by the
23870 // user then %G_TLS_INTERACTION_FAILED will be returned with an error that
23871 // contains a %G_IO_ERROR_CANCELLED error code. Certain implementations may
23872 // not support immediate cancellation.
23874 // Certain implementations may not support immediate cancellation.
23875 // <password>: a #GTlsPassword object
23876 // <cancellable>: an optional #GCancellable cancellation object
23877 // <callback>: will be called when the interaction completes
23878 // <user_data>: data to pass to the @callback
23879 void ask_password_async()(TlsPassword* password, Cancellable* cancellable=null, AsyncReadyCallback callback=null, void* user_data=null) {
23880 g_tls_interaction_ask_password_async(&this, password, cancellable, callback, user_data);
23883 // VERSION: 2.30
23884 // Complete an ask password user interaction request. This should be once
23885 // the g_tls_interaction_ask_password_async() completion callback is called.
23887 // If %G_TLS_INTERACTION_HANDLED is returned, then the #GTlsPassword passed
23888 // to g_tls_interaction_ask_password() will have its password filled in.
23890 // If the interaction is cancelled by the cancellation object, or by the
23891 // user then %G_TLS_INTERACTION_FAILED will be returned with an error that
23892 // contains a %G_IO_ERROR_CANCELLED error code.
23893 // RETURNS: The status of the ask password interaction.
23894 // <result>: the result passed to the callback
23895 TlsInteractionResult ask_password_finish()(AsyncResult* result, GLib2.Error** error=null) {
23896 return g_tls_interaction_ask_password_finish(&this, result, error);
23899 // VERSION: 2.30
23900 // Invoke the interaction to ask the user for a password. It invokes this
23901 // interaction in the main loop, specifically the #GMainContext returned by
23902 // g_main_context_get_thread_default() when the interaction is created. This
23903 // is called by called by #GTlsConnection or #GTlsDatabase to ask the user
23904 // for a password.
23906 // Derived subclasses usually implement a password prompt, although they may
23907 // also choose to provide a password from elsewhere. The @password value will
23908 // be filled in and then @callback will be called. Alternatively the user may
23909 // abort this password request, which will usually abort the TLS connection.
23911 // The implementation can either be a synchronous (eg: modal dialog) or an
23912 // asynchronous one (eg: modeless dialog). This function will take care of
23913 // calling which ever one correctly.
23915 // If the interaction is cancelled by the cancellation object, or by the
23916 // user then %G_TLS_INTERACTION_FAILED will be returned with an error that
23917 // contains a %G_IO_ERROR_CANCELLED error code. Certain implementations may
23918 // not support immediate cancellation.
23919 // RETURNS: The status of the ask password interaction.
23920 // <password>: a #GTlsPassword object
23921 // <cancellable>: an optional #GCancellable cancellation object
23922 TlsInteractionResult invoke_ask_password()(TlsPassword* password, Cancellable* cancellable, GLib2.Error** error=null) {
23923 return g_tls_interaction_invoke_ask_password(&this, password, cancellable, error);
23928 // The class for #GTlsInteraction. Derived classes implement the various
23929 // virtual interaction methods to handle TLS interactions.
23931 // Derived classes can choose to implement whichever interactions methods they'd
23932 // like to support by overriding those virtual methods in their class
23933 // initialization function. If a derived class implements an async method,
23934 // it must also implement the corresponding finish method.
23936 // The synchronous interaction methods should implement to display modal dialogs,
23937 // and the asynchronous methods to display modeless dialogs.
23939 // If the user cancels an interaction, then the result should be
23940 // %G_TLS_INTERACTION_FAILED and the error should be set with a domain of
23941 // %G_IO_ERROR and code of %G_IO_ERROR_CANCELLED.
23942 struct TlsInteractionClass /* Version 2.30 */ {
23943 private GObject2.ObjectClass parent_class;
23945 // RETURNS: The status of the ask password interaction.
23946 // <password>: a #GTlsPassword object
23947 // <cancellable>: an optional #GCancellable cancellation object
23948 extern (C) TlsInteractionResult function (TlsInteraction* interaction, TlsPassword* password, Cancellable* cancellable, GLib2.Error** error=null) ask_password;
23950 // <password>: a #GTlsPassword object
23951 // <cancellable>: an optional #GCancellable cancellation object
23952 // <callback>: will be called when the interaction completes
23953 // <user_data>: data to pass to the @callback
23954 extern (C) void function (TlsInteraction* interaction, TlsPassword* password, Cancellable* cancellable=null, AsyncReadyCallback callback=null, void* user_data=null) ask_password_async;
23956 // RETURNS: The status of the ask password interaction.
23957 // <result>: the result passed to the callback
23958 extern (C) TlsInteractionResult function (TlsInteraction* interaction, AsyncResult* result, GLib2.Error** error=null) ask_password_finish;
23959 private void*[24] padding;
23962 struct TlsInteractionPrivate {
23966 // #GTlsInteractionResult is returned by various functions in #GTlsInteraction
23967 // when finishing an interaction request.
23968 enum TlsInteractionResult /* Version 2.30 */ {
23969 UNHANDLED = 0,
23970 HANDLED = 1,
23971 FAILED = 2
23973 // Holds a password used in TLS.
23974 struct TlsPassword /* : GObject.Object */ /* Version 2.30 */ {
23975 alias parent_instance this;
23976 alias parent_instance super_;
23977 alias parent_instance object;
23978 GObject2.Object parent_instance;
23979 TlsPasswordPrivate* priv;
23982 // Create a new #GTlsPassword object.
23983 // RETURNS: The newly allocated password object
23984 // <flags>: the password flags
23985 // <description>: description of what the password is for
23986 static TlsPassword* /*new*/ new_()(TlsPasswordFlags flags, char* description) {
23987 return g_tls_password_new(flags, description);
23990 // VERSION: 2.30
23991 // Get a description string about what the password will be used for.
23992 // RETURNS: The description of the password.
23993 char* get_description()() {
23994 return g_tls_password_get_description(&this);
23997 // VERSION: 2.30
23998 // Get flags about the password.
23999 // RETURNS: The flags about the password.
24000 TlsPasswordFlags get_flags()() {
24001 return g_tls_password_get_flags(&this);
24004 // VERSION: 2.30
24005 // Get the password value. If @length is not %NULL then it will be filled
24006 // in with the length of the password value.
24007 // RETURNS: The password value owned by the password object.
24008 // <length>: location to place the length of the password.
24009 ubyte* get_value()(size_t* length=null) {
24010 return g_tls_password_get_value(&this, length);
24013 // VERSION: 2.30
24014 // Get a user readable translated warning. Usually this warning is a
24015 // representation of the password flags returned from
24016 // g_tls_password_get_flags().
24017 // RETURNS: The warning.
24018 char* get_warning()() {
24019 return g_tls_password_get_warning(&this);
24022 // VERSION: 2.30
24023 // Set a description string about what the password will be used for.
24024 // <description>: The description of the password
24025 void set_description()(char* description) {
24026 g_tls_password_set_description(&this, description);
24029 // VERSION: 2.30
24030 // Set flags about the password.
24031 // <flags>: The flags about the password
24032 void set_flags()(TlsPasswordFlags flags) {
24033 g_tls_password_set_flags(&this, flags);
24036 // VERSION: 2.30
24037 // Set the value for this password. The @value will be copied by the password
24038 // object.
24040 // Specify the @length, for a non-null-terminated password. Pass -1 as
24041 // @length if using a null-terminated password, and @length will be calculated
24042 // automatically.
24043 // <value>: the new password value
24044 // <length>: the length of the password, or -1
24045 void set_value()(ubyte* value, ssize_t length) {
24046 g_tls_password_set_value(&this, value, length);
24049 // VERSION: 2.30
24050 // Provide the value for this password.
24052 // The @value will be owned by the password object, and later freed using
24053 // the @destroy function callback.
24055 // Specify the @length, for a non-null-terminated password. Pass -1 as
24056 // @length if using a null-terminated password, and @length will be calculated
24057 // automatically.
24058 // <value>: the value for the password
24059 // <length>: the length of the password, or -1
24060 // <destroy>: a function to use to free the password.
24061 void set_value_full()(ubyte* value, ssize_t length, GLib2.DestroyNotify destroy=null) {
24062 g_tls_password_set_value_full(&this, value, length, destroy);
24065 // VERSION: 2.30
24066 // Set a user readable translated warning. Usually this warning is a
24067 // representation of the password flags returned from
24068 // g_tls_password_get_flags().
24069 // <warning>: The user readable warning
24070 void set_warning()(char* warning) {
24071 g_tls_password_set_warning(&this, warning);
24075 struct TlsPasswordClass {
24076 GObject2.ObjectClass parent_class;
24078 // RETURNS: The password value owned by the password object.
24079 // <length>: location to place the length of the password.
24080 extern (C) ubyte* function (TlsPassword* password, size_t* length=null) get_value;
24082 // <value>: the value for the password
24083 // <length>: the length of the password, or -1
24084 // <destroy>: a function to use to free the password.
24085 extern (C) void function (TlsPassword* password, ubyte* value, ssize_t length, GLib2.DestroyNotify destroy=null) set_value;
24086 extern (C) char* function (TlsPassword* password) get_default_warning;
24087 private void*[4] padding;
24090 // Various flags for the password.
24091 enum TlsPasswordFlags /* Version 2.30 */ {
24092 NONE = 0,
24093 RETRY = 2,
24094 MANY_TRIES = 4,
24095 FINAL_TRY = 8
24097 struct TlsPasswordPrivate {
24101 // When to allow rehandshaking. See
24102 // g_tls_connection_set_rehandshake_mode().
24103 enum TlsRehandshakeMode /* Version 2.28 */ {
24104 NEVER = 0,
24105 SAFELY = 1,
24106 UNSAFELY = 2
24109 // #GTlsServerConnection is the server-side subclass of #GTlsConnection,
24110 // representing a server-side TLS connection.
24111 struct TlsServerConnection /* Interface */ /* Version 2.28 */ {
24112 mixin template __interface__() {
24113 // VERSION: 2.28
24114 // Creates a new #GTlsServerConnection wrapping @base_io_stream (which
24115 // must have pollable input and output streams).
24117 // #GTlsServerConnection, or %NULL on error
24118 // RETURNS: the new
24119 // <base_io_stream>: the #GIOStream to wrap
24120 // <certificate>: the default server certificate, or %NULL
24121 static TlsServerConnection* /*new*/ new_()(IOStream* base_io_stream, TlsCertificate* certificate, GLib2.Error** error=null) {
24122 return g_tls_server_connection_new(base_io_stream, certificate, error);
24125 mixin __interface__;
24128 struct TlsServerConnectionInterface {
24129 GObject2.TypeInterface g_iface;
24133 // This is the subclass of #GSocketConnection that is created
24134 // for UNIX domain sockets.
24136 // It contains functions to do some of the UNIX socket specific
24137 // functionality like passing file descriptors.
24139 // Note that <filename>&lt;gio/gunixconnection.h&gt;</filename> belongs to
24140 // the UNIX-specific GIO interfaces, thus you have to use the
24141 // <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
24142 struct UnixConnection /* : SocketConnection */ {
24143 alias parent_instance this;
24144 alias parent_instance super_;
24145 alias parent_instance socketconnection;
24146 SocketConnection parent_instance;
24147 UnixConnectionPrivate* priv;
24150 // VERSION: 2.26
24151 // Receives credentials from the sending end of the connection. The
24152 // sending end has to call g_unix_connection_send_credentials() (or
24153 // similar) for this to work.
24155 // As well as reading the credentials this also reads (and discards) a
24156 // single byte from the stream, as this is required for credentials
24157 // passing to work on some implementations.
24159 // Other ways to exchange credentials with a foreign peer includes the
24160 // #GUnixCredentialsMessage type and g_socket_get_credentials() function.
24162 // g_object_unref()), %NULL if @error is set.
24163 // RETURNS: Received credentials on success (free with
24164 // <cancellable>: A #GCancellable or %NULL.
24165 Credentials* /*new*/ receive_credentials()(Cancellable* cancellable, GLib2.Error** error=null) {
24166 return g_unix_connection_receive_credentials(&this, cancellable, error);
24169 // VERSION: 2.32
24170 // Asynchronously receive credentials.
24172 // For more details, see g_unix_connection_receive_credentials() which is
24173 // the synchronous version of this call.
24175 // When the operation is finished, @callback will be called. You can then call
24176 // g_unix_connection_receive_credentials_finish() to get the result of the operation.
24177 // <cancellable>: optional #GCancellable object, %NULL to ignore.
24178 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
24179 // <user_data>: the data to pass to callback function
24180 void receive_credentials_async()(Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
24181 g_unix_connection_receive_credentials_async(&this, cancellable, callback, user_data);
24184 // VERSION: 2.32
24185 // Finishes an asynchronous receive credentials operation started with
24186 // g_unix_connection_receive_credentials_async().
24188 // Free the returned object with g_object_unref().
24189 // RETURNS: a #GCredentials, or %NULL on error.
24190 // <result>: a #GAsyncResult.
24191 Credentials* /*new*/ receive_credentials_finish()(AsyncResult* result, GLib2.Error** error=null) {
24192 return g_unix_connection_receive_credentials_finish(&this, result, error);
24195 // VERSION: 2.22
24196 // Receives a file descriptor from the sending end of the connection.
24197 // The sending end has to call g_unix_connection_send_fd() for this
24198 // to work.
24200 // As well as reading the fd this also reads a single byte from the
24201 // stream, as this is required for fd passing to work on some
24202 // implementations.
24203 // RETURNS: a file descriptor on success, -1 on error.
24204 // <cancellable>: optional #GCancellable object, %NULL to ignore
24205 int receive_fd()(Cancellable* cancellable, GLib2.Error** error=null) {
24206 return g_unix_connection_receive_fd(&this, cancellable, error);
24209 // VERSION: 2.26
24210 // Passes the credentials of the current user the receiving side
24211 // of the connection. The receiving end has to call
24212 // g_unix_connection_receive_credentials() (or similar) to accept the
24213 // credentials.
24215 // As well as sending the credentials this also writes a single NUL
24216 // byte to the stream, as this is required for credentials passing to
24217 // work on some implementations.
24219 // Other ways to exchange credentials with a foreign peer includes the
24220 // #GUnixCredentialsMessage type and g_socket_get_credentials() function.
24221 // RETURNS: %TRUE on success, %FALSE if @error is set.
24222 // <cancellable>: A #GCancellable or %NULL.
24223 int send_credentials()(Cancellable* cancellable, GLib2.Error** error=null) {
24224 return g_unix_connection_send_credentials(&this, cancellable, error);
24227 // VERSION: 2.32
24228 // Asynchronously send credentials.
24230 // For more details, see g_unix_connection_send_credentials() which is
24231 // the synchronous version of this call.
24233 // When the operation is finished, @callback will be called. You can then call
24234 // g_unix_connection_send_credentials_finish() to get the result of the operation.
24235 // <cancellable>: optional #GCancellable object, %NULL to ignore.
24236 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
24237 // <user_data>: the data to pass to callback function
24238 void send_credentials_async()(Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
24239 g_unix_connection_send_credentials_async(&this, cancellable, callback, user_data);
24242 // VERSION: 2.32
24243 // Finishes an asynchronous send credentials operation started with
24244 // g_unix_connection_send_credentials_async().
24245 // RETURNS: %TRUE if the operation was successful, otherwise %FALSE.
24246 // <result>: a #GAsyncResult.
24247 int send_credentials_finish()(AsyncResult* result, GLib2.Error** error=null) {
24248 return g_unix_connection_send_credentials_finish(&this, result, error);
24251 // VERSION: 2.22
24252 // Passes a file descriptor to the receiving side of the
24253 // connection. The receiving end has to call g_unix_connection_receive_fd()
24254 // to accept the file descriptor.
24256 // As well as sending the fd this also writes a single byte to the
24257 // stream, as this is required for fd passing to work on some
24258 // implementations.
24259 // RETURNS: a %TRUE on success, %NULL on error.
24260 // <fd>: a file descriptor
24261 // <cancellable>: optional #GCancellable object, %NULL to ignore.
24262 int send_fd()(int fd, Cancellable* cancellable, GLib2.Error** error=null) {
24263 return g_unix_connection_send_fd(&this, fd, cancellable, error);
24267 struct UnixConnectionClass {
24268 SocketConnectionClass parent_class;
24271 struct UnixConnectionPrivate {
24275 // This #GSocketControlMessage contains a #GCredentials instance. It
24276 // may be sent using g_socket_send_message() and received using
24277 // g_socket_receive_message() over UNIX sockets (ie: sockets in the
24278 // %G_SOCKET_FAMILY_UNIX family).
24280 // For an easier way to send and receive credentials over
24281 // stream-oriented UNIX sockets, see
24282 // g_unix_connection_send_credentials() and
24283 // g_unix_connection_receive_credentials(). To receive credentials of
24284 // a foreign process connected to a socket, use
24285 // g_socket_get_credentials().
24286 struct UnixCredentialsMessage /* : SocketControlMessage */ /* Version 2.26 */ {
24287 alias parent_instance this;
24288 alias parent_instance super_;
24289 alias parent_instance socketcontrolmessage;
24290 SocketControlMessage parent_instance;
24291 UnixCredentialsMessagePrivate* priv;
24294 // VERSION: 2.26
24295 // Creates a new #GUnixCredentialsMessage with credentials matching the current processes.
24296 // RETURNS: a new #GUnixCredentialsMessage
24297 static UnixCredentialsMessage* /*new*/ new_()() {
24298 return g_unix_credentials_message_new();
24301 // VERSION: 2.26
24302 // Creates a new #GUnixCredentialsMessage holding @credentials.
24303 // RETURNS: a new #GUnixCredentialsMessage
24304 // <credentials>: A #GCredentials object.
24305 static UnixCredentialsMessage* /*new*/ new_with_credentials()(Credentials* credentials) {
24306 return g_unix_credentials_message_new_with_credentials(credentials);
24309 // VERSION: 2.26
24310 // Checks if passing #GCredentials on a #GSocket is supported on this platform.
24311 // RETURNS: %TRUE if supported, %FALSE otherwise
24312 static int is_supported()() {
24313 return g_unix_credentials_message_is_supported();
24316 // VERSION: 2.26
24317 // Gets the credentials stored in @message.
24318 // RETURNS: A #GCredentials instance. Do not free, it is owned by @message.
24319 Credentials* get_credentials()() {
24320 return g_unix_credentials_message_get_credentials(&this);
24324 // Class structure for #GUnixCredentialsMessage.
24325 struct UnixCredentialsMessageClass /* Version 2.26 */ {
24326 SocketControlMessageClass parent_class;
24327 extern (C) void function () _g_reserved1;
24328 extern (C) void function () _g_reserved2;
24331 struct UnixCredentialsMessagePrivate {
24335 // A #GUnixFDList contains a list of file descriptors. It owns the file
24336 // descriptors that it contains, closing them when finalized.
24338 // It may be wrapped in a #GUnixFDMessage and sent over a #GSocket in
24339 // the %G_SOCKET_ADDRESS_UNIX family by using g_socket_send_message()
24340 // and received using g_socket_receive_message().
24342 // Note that <filename>&lt;gio/gunixfdlist.h&gt;</filename> belongs to
24343 // the UNIX-specific GIO interfaces, thus you have to use the
24344 // <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
24345 struct UnixFDList /* : GObject.Object */ {
24346 alias parent_instance this;
24347 alias parent_instance super_;
24348 alias parent_instance object;
24349 GObject2.Object parent_instance;
24350 UnixFDListPrivate* priv;
24353 // VERSION: 2.24
24354 // Creates a new #GUnixFDList containing no file descriptors.
24355 // RETURNS: a new #GUnixFDList
24356 static UnixFDList* /*new*/ new_()() {
24357 return g_unix_fd_list_new();
24360 // VERSION: 2.24
24361 // Creates a new #GUnixFDList containing the file descriptors given in
24362 // @fds. The file descriptors become the property of the new list and
24363 // may no longer be used by the caller. The array itself is owned by
24364 // the caller.
24366 // Each file descriptor in the array should be set to close-on-exec.
24368 // If @n_fds is -1 then @fds must be terminated with -1.
24369 // RETURNS: a new #GUnixFDList
24370 // <fds>: the initial list of file descriptors
24371 // <n_fds>: the length of #fds, or -1
24372 static UnixFDList* /*new*/ new_from_array()(int* fds, int n_fds) {
24373 return g_unix_fd_list_new_from_array(fds, n_fds);
24376 // VERSION: 2.24
24377 // Adds a file descriptor to @list.
24379 // The file descriptor is duplicated using dup(). You keep your copy
24380 // of the descriptor and the copy contained in @list will be closed
24381 // when @list is finalized.
24383 // A possible cause of failure is exceeding the per-process or
24384 // system-wide file descriptor limit.
24386 // The index of the file descriptor in the list is returned. If you use
24387 // this index with g_unix_fd_list_get() then you will receive back a
24388 // duplicated copy of the same file descriptor.
24390 // (and @error is set)
24391 // RETURNS: the index of the appended fd in case of success, else -1
24392 // <fd>: a valid open file descriptor
24393 int append()(int fd, GLib2.Error** error=null) {
24394 return g_unix_fd_list_append(&this, fd, error);
24397 // VERSION: 2.24
24398 // Gets a file descriptor out of @list.
24400 // @index_ specifies the index of the file descriptor to get. It is a
24401 // programmer error for @index_ to be out of range; see
24402 // g_unix_fd_list_get_length().
24404 // The file descriptor is duplicated using dup() and set as
24405 // close-on-exec before being returned. You must call close() on it
24406 // when you are done.
24408 // A possible cause of failure is exceeding the per-process or
24409 // system-wide file descriptor limit.
24410 // RETURNS: the file descriptor, or -1 in case of error
24411 // <index_>: the index into the list
24412 int get()(int index_, GLib2.Error** error=null) {
24413 return g_unix_fd_list_get(&this, index_, error);
24416 // VERSION: 2.24
24417 // Gets the length of @list (ie: the number of file descriptors
24418 // contained within).
24419 // RETURNS: the length of @list
24420 int get_length()() {
24421 return g_unix_fd_list_get_length(&this);
24424 // VERSION: 2.24
24425 // Returns the array of file descriptors that is contained in this
24426 // object.
24428 // After this call, the descriptors remain the property of @list. The
24429 // caller must not close them and must not free the array. The array is
24430 // valid only until @list is changed in any way.
24432 // If @length is non-%NULL then it is set to the number of file
24433 // descriptors in the returned array. The returned array is also
24434 // terminated with -1.
24436 // This function never returns %NULL. In case there are no file
24437 // descriptors contained in @list, an empty array is returned.
24439 // descriptors
24440 // RETURNS: an array of file
24441 // <length>: pointer to the length of the returned array, or %NULL
24442 int* peek_fds()(/*out*/ int* length=null) {
24443 return g_unix_fd_list_peek_fds(&this, length);
24446 // VERSION: 2.24
24447 // Returns the array of file descriptors that is contained in this
24448 // object.
24450 // After this call, the descriptors are no longer contained in
24451 // @list. Further calls will return an empty list (unless more
24452 // descriptors have been added).
24454 // The return result of this function must be freed with g_free().
24455 // The caller is also responsible for closing all of the file
24456 // descriptors. The file descriptors in the array are set to
24457 // close-on-exec.
24459 // If @length is non-%NULL then it is set to the number of file
24460 // descriptors in the returned array. The returned array is also
24461 // terminated with -1.
24463 // This function never returns %NULL. In case there are no file
24464 // descriptors contained in @list, an empty array is returned.
24466 // descriptors
24467 // RETURNS: an array of file
24468 // <length>: pointer to the length of the returned array, or %NULL
24469 int* /*new*/ steal_fds()(/*out*/ int* length=null) {
24470 return g_unix_fd_list_steal_fds(&this, length);
24474 struct UnixFDListClass {
24475 GObject2.ObjectClass parent_class;
24476 extern (C) void function () _g_reserved1;
24477 extern (C) void function () _g_reserved2;
24478 extern (C) void function () _g_reserved3;
24479 extern (C) void function () _g_reserved4;
24480 extern (C) void function () _g_reserved5;
24483 struct UnixFDListPrivate {
24487 // This #GSocketControlMessage contains a #GUnixFDList.
24488 // It may be sent using g_socket_send_message() and received using
24489 // g_socket_receive_message() over UNIX sockets (ie: sockets in the
24490 // %G_SOCKET_ADDRESS_UNIX family). The file descriptors are copied
24491 // between processes by the kernel.
24493 // For an easier way to send and receive file descriptors over
24494 // stream-oriented UNIX sockets, see g_unix_connection_send_fd() and
24495 // g_unix_connection_receive_fd().
24497 // Note that <filename>&lt;gio/gunixfdmessage.h&gt;</filename> belongs to
24498 // the UNIX-specific GIO interfaces, thus you have to use the
24499 // <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
24500 struct UnixFDMessage /* : SocketControlMessage */ {
24501 alias parent_instance this;
24502 alias parent_instance super_;
24503 alias parent_instance socketcontrolmessage;
24504 SocketControlMessage parent_instance;
24505 UnixFDMessagePrivate* priv;
24508 // VERSION: 2.22
24509 // Creates a new #GUnixFDMessage containing an empty file descriptor
24510 // list.
24511 // RETURNS: a new #GUnixFDMessage
24512 static UnixFDMessage* /*new*/ new_()() {
24513 return g_unix_fd_message_new();
24516 // VERSION: 2.24
24517 // Creates a new #GUnixFDMessage containing @list.
24518 // RETURNS: a new #GUnixFDMessage
24519 // <fd_list>: a #GUnixFDList
24520 static UnixFDMessage* /*new*/ new_with_fd_list()(UnixFDList* fd_list) {
24521 return g_unix_fd_message_new_with_fd_list(fd_list);
24524 // VERSION: 2.22
24525 // Adds a file descriptor to @message.
24527 // The file descriptor is duplicated using dup(). You keep your copy
24528 // of the descriptor and the copy contained in @message will be closed
24529 // when @message is finalized.
24531 // A possible cause of failure is exceeding the per-process or
24532 // system-wide file descriptor limit.
24533 // RETURNS: %TRUE in case of success, else %FALSE (and @error is set)
24534 // <fd>: a valid open file descriptor
24535 int append_fd()(int fd, GLib2.Error** error=null) {
24536 return g_unix_fd_message_append_fd(&this, fd, error);
24539 // VERSION: 2.24
24540 // Gets the #GUnixFDList contained in @message. This function does not
24541 // return a reference to the caller, but the returned list is valid for
24542 // the lifetime of @message.
24543 // RETURNS: the #GUnixFDList from @message
24544 UnixFDList* get_fd_list()() {
24545 return g_unix_fd_message_get_fd_list(&this);
24548 // VERSION: 2.22
24549 // Returns the array of file descriptors that is contained in this
24550 // object.
24552 // After this call, the descriptors are no longer contained in
24553 // @message. Further calls will return an empty list (unless more
24554 // descriptors have been added).
24556 // The return result of this function must be freed with g_free().
24557 // The caller is also responsible for closing all of the file
24558 // descriptors.
24560 // If @length is non-%NULL then it is set to the number of file
24561 // descriptors in the returned array. The returned array is also
24562 // terminated with -1.
24564 // This function never returns %NULL. In case there are no file
24565 // descriptors contained in @message, an empty array is returned.
24567 // descriptors
24568 // RETURNS: an array of file
24569 // <length>: pointer to the length of the returned array, or %NULL
24570 int* /*new*/ steal_fds()(/*out*/ int* length=null) {
24571 return g_unix_fd_message_steal_fds(&this, length);
24575 struct UnixFDMessageClass {
24576 SocketControlMessageClass parent_class;
24577 extern (C) void function () _g_reserved1;
24578 extern (C) void function () _g_reserved2;
24581 struct UnixFDMessagePrivate {
24585 // #GUnixInputStream implements #GInputStream for reading from a UNIX
24586 // file descriptor, including asynchronous operations. (If the file
24587 // descriptor refers to a socket or pipe, this will use poll() to do
24588 // asynchronous I/O. If it refers to a regular file, it will fall back
24589 // to doing asynchronous I/O in another thread.)
24591 // Note that <filename>&lt;gio/gunixinputstream.h&gt;</filename> belongs
24592 // to the UNIX-specific GIO interfaces, thus you have to use the
24593 // <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
24594 struct UnixInputStream /* : InputStream */ {
24595 mixin FileDescriptorBased.__interface__;
24596 mixin PollableInputStream.__interface__;
24597 alias parent_instance this;
24598 alias parent_instance super_;
24599 alias parent_instance inputstream;
24600 InputStream parent_instance;
24601 private UnixInputStreamPrivate* priv;
24604 // Creates a new #GUnixInputStream for the given @fd.
24606 // If @close_fd is %TRUE, the file descriptor will be closed
24607 // when the stream is closed.
24608 // RETURNS: a new #GUnixInputStream
24609 // <fd>: a UNIX file descriptor
24610 // <close_fd>: %TRUE to close the file descriptor when done
24611 static UnixInputStream* /*new*/ new_()(int fd, int close_fd) {
24612 return g_unix_input_stream_new(fd, close_fd);
24615 // VERSION: 2.20
24616 // Returns whether the file descriptor of @stream will be
24617 // closed when the stream is closed.
24618 // RETURNS: %TRUE if the file descriptor is closed when done
24619 int get_close_fd()() {
24620 return g_unix_input_stream_get_close_fd(&this);
24623 // VERSION: 2.20
24624 // Return the UNIX file descriptor that the stream reads from.
24625 // RETURNS: The file descriptor of @stream
24626 int get_fd()() {
24627 return g_unix_input_stream_get_fd(&this);
24630 // VERSION: 2.20
24631 // Sets whether the file descriptor of @stream shall be closed
24632 // when the stream is closed.
24633 // <close_fd>: %TRUE to close the file descriptor when done
24634 void set_close_fd()(int close_fd) {
24635 g_unix_input_stream_set_close_fd(&this, close_fd);
24639 struct UnixInputStreamClass {
24640 InputStreamClass parent_class;
24641 extern (C) void function () _g_reserved1;
24642 extern (C) void function () _g_reserved2;
24643 extern (C) void function () _g_reserved3;
24644 extern (C) void function () _g_reserved4;
24645 extern (C) void function () _g_reserved5;
24648 struct UnixInputStreamPrivate {
24652 // Defines a Unix mount entry (e.g. <filename>/media/cdrom</filename>).
24653 // This corresponds roughly to a mtab entry.
24654 struct UnixMountEntry {
24657 // Watches #GUnixMount<!-- -->s for changes.
24658 struct UnixMountMonitor /* : GObject.Object */ {
24659 alias method_parent this;
24660 alias method_parent super_;
24661 alias method_parent object;
24662 GObject2.Object method_parent;
24665 // Gets a new #GUnixMountMonitor. The default rate limit for which the
24666 // monitor will report consecutive changes for the mount and mount
24667 // point entry files is the default for a #GFileMonitor. Use
24668 // g_unix_mount_monitor_set_rate_limit() to change this.
24669 // RETURNS: a #GUnixMountMonitor.
24670 static UnixMountMonitor* /*new*/ new_()() {
24671 return g_unix_mount_monitor_new();
24674 // VERSION: 2.18
24675 // Sets the rate limit to which the @mount_monitor will report
24676 // consecutive change events to the mount and mount point entry files.
24677 // <limit_msec>: a integer with the limit in milliseconds to poll for changes.
24678 void set_rate_limit()(int limit_msec) {
24679 g_unix_mount_monitor_set_rate_limit(&this, limit_msec);
24681 // Emitted when the unix mount points have changed.
24682 extern (C) alias static void function (UnixMountMonitor* this_, void* user_data=null) signal_mountpoints_changed;
24684 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
24685 return super_.signal_connect!name(cb, data, cf);
24688 ulong signal_connect(string name:"mountpoints-changed", CB:signal_mountpoints_changed)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
24689 return signal_connect_data!()(&this, cast(char*)"mountpoints-changed",
24690 cast(GObject2.Callback)cb, data, null, cf);
24692 // Emitted when the unix mounts have changed.
24693 extern (C) alias static void function (UnixMountMonitor* this_, void* user_data=null) signal_mounts_changed;
24694 ulong signal_connect(string name:"mounts-changed", CB:signal_mounts_changed)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
24695 return signal_connect_data!()(&this, cast(char*)"mounts-changed",
24696 cast(GObject2.Callback)cb, data, null, cf);
24700 struct UnixMountMonitorClass {
24704 // Defines a Unix mount point (e.g. <filename>/dev</filename>).
24705 // This corresponds roughly to a fstab entry.
24706 struct UnixMountPoint {
24708 // Compares two unix mount points.
24710 // or less than @mount2, respectively.
24711 // RETURNS: 1, 0 or -1 if @mount1 is greater than, equal to,
24712 // <mount2>: a #GUnixMount.
24713 int compare()(UnixMountPoint* mount2) {
24714 return g_unix_mount_point_compare(&this, mount2);
24716 // Frees a unix mount point.
24717 void free()() {
24718 g_unix_mount_point_free(&this);
24721 // Gets the device path for a unix mount point.
24722 // RETURNS: a string containing the device path.
24723 char* get_device_path()() {
24724 return g_unix_mount_point_get_device_path(&this);
24727 // Gets the file system type for the mount point.
24728 // RETURNS: a string containing the file system type.
24729 char* get_fs_type()() {
24730 return g_unix_mount_point_get_fs_type(&this);
24733 // Gets the mount path for a unix mount point.
24734 // RETURNS: a string containing the mount path.
24735 char* get_mount_path()() {
24736 return g_unix_mount_point_get_mount_path(&this);
24739 // VERSION: 2.32
24740 // Gets the options for the mount point.
24741 // RETURNS: a string containing the options.
24742 char* get_options()() {
24743 return g_unix_mount_point_get_options(&this);
24746 // Guesses whether a Unix mount point can be ejected.
24747 // RETURNS: %TRUE if @mount_point is deemed to be ejectable.
24748 int guess_can_eject()() {
24749 return g_unix_mount_point_guess_can_eject(&this);
24752 // Guesses the icon of a Unix mount point.
24753 // RETURNS: a #GIcon
24754 Icon* /*new*/ guess_icon()() {
24755 return g_unix_mount_point_guess_icon(&this);
24758 // Guesses the name of a Unix mount point.
24759 // The result is a translated string.
24761 // be freed with g_free()
24762 // RETURNS: A newly allocated string that must
24763 char* /*new*/ guess_name()() {
24764 return g_unix_mount_point_guess_name(&this);
24767 // Checks if a unix mount point is a loopback device.
24768 // RETURNS: %TRUE if the mount point is a loopback. %FALSE otherwise.
24769 int is_loopback()() {
24770 return g_unix_mount_point_is_loopback(&this);
24773 // Checks if a unix mount point is read only.
24774 // RETURNS: %TRUE if a mount point is read only.
24775 int is_readonly()() {
24776 return g_unix_mount_point_is_readonly(&this);
24779 // Checks if a unix mount point is mountable by the user.
24780 // RETURNS: %TRUE if the mount point is user mountable.
24781 int is_user_mountable()() {
24782 return g_unix_mount_point_is_user_mountable(&this);
24787 // #GUnixOutputStream implements #GOutputStream for writing to a UNIX
24788 // file descriptor, including asynchronous operations. (If the file
24789 // descriptor refers to a socket or pipe, this will use poll() to do
24790 // asynchronous I/O. If it refers to a regular file, it will fall back
24791 // to doing asynchronous I/O in another thread.)
24793 // Note that <filename>&lt;gio/gunixoutputstream.h&gt;</filename> belongs
24794 // to the UNIX-specific GIO interfaces, thus you have to use the
24795 // <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
24796 struct UnixOutputStream /* : OutputStream */ {
24797 mixin FileDescriptorBased.__interface__;
24798 mixin PollableOutputStream.__interface__;
24799 alias parent_instance this;
24800 alias parent_instance super_;
24801 alias parent_instance outputstream;
24802 OutputStream parent_instance;
24803 private UnixOutputStreamPrivate* priv;
24806 // Creates a new #GUnixOutputStream for the given @fd.
24808 // If @close_fd, is %TRUE, the file descriptor will be closed when
24809 // the output stream is destroyed.
24810 // RETURNS: a new #GOutputStream
24811 // <fd>: a UNIX file descriptor
24812 // <close_fd>: %TRUE to close the file descriptor when done
24813 static UnixOutputStream* /*new*/ new_()(int fd, int close_fd) {
24814 return g_unix_output_stream_new(fd, close_fd);
24817 // VERSION: 2.20
24818 // Returns whether the file descriptor of @stream will be
24819 // closed when the stream is closed.
24820 // RETURNS: %TRUE if the file descriptor is closed when done
24821 int get_close_fd()() {
24822 return g_unix_output_stream_get_close_fd(&this);
24825 // VERSION: 2.20
24826 // Return the UNIX file descriptor that the stream writes to.
24827 // RETURNS: The file descriptor of @stream
24828 int get_fd()() {
24829 return g_unix_output_stream_get_fd(&this);
24832 // VERSION: 2.20
24833 // Sets whether the file descriptor of @stream shall be closed
24834 // when the stream is closed.
24835 // <close_fd>: %TRUE to close the file descriptor when done
24836 void set_close_fd()(int close_fd) {
24837 g_unix_output_stream_set_close_fd(&this, close_fd);
24841 struct UnixOutputStreamClass {
24842 OutputStreamClass parent_class;
24843 extern (C) void function () _g_reserved1;
24844 extern (C) void function () _g_reserved2;
24845 extern (C) void function () _g_reserved3;
24846 extern (C) void function () _g_reserved4;
24847 extern (C) void function () _g_reserved5;
24850 struct UnixOutputStreamPrivate {
24854 // Support for UNIX-domain (also known as local) sockets.
24856 // UNIX domain sockets are generally visible in the filesystem.
24857 // However, some systems support abstract socket names which are not
24858 // visible in the filesystem and not affected by the filesystem
24859 // permissions, visibility, etc. Currently this is only supported
24860 // under Linux. If you attempt to use abstract sockets on other
24861 // systems, function calls may return %G_IO_ERROR_NOT_SUPPORTED
24862 // errors. You can use g_unix_socket_address_abstract_names_supported()
24863 // to see if abstract names are supported.
24865 // Note that <filename>&lt;gio/gunixsocketaddress.h&gt;</filename> belongs to
24866 // the UNIX-specific GIO interfaces, thus you have to use the
24867 // <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
24868 struct UnixSocketAddress /* : SocketAddress */ {
24869 mixin SocketConnectable.__interface__;
24870 alias parent_instance this;
24871 alias parent_instance super_;
24872 alias parent_instance socketaddress;
24873 SocketAddress parent_instance;
24874 private UnixSocketAddressPrivate* priv;
24877 // VERSION: 2.22
24878 // Creates a new #GUnixSocketAddress for @path.
24880 // To create abstract socket addresses, on systems that support that,
24881 // use g_unix_socket_address_new_abstract().
24882 // RETURNS: a new #GUnixSocketAddress
24883 // <path>: the socket path
24884 static UnixSocketAddress* /*new*/ new_()(char* path) {
24885 return g_unix_socket_address_new(path);
24888 // DEPRECATED constructor: new_abstract - Use g_unix_socket_address_new_with_type().
24889 // Creates a new %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED
24890 // #GUnixSocketAddress for @path.
24891 // RETURNS: a new #GUnixSocketAddress
24892 // <path>: the abstract name
24893 // <path_len>: the length of @path, or -1
24894 static UnixSocketAddress* /*new*/ new_abstract()(char* path, int path_len) {
24895 return g_unix_socket_address_new_abstract(path, path_len);
24898 // VERSION: 2.26
24899 // Creates a new #GUnixSocketAddress of type @type with name @path.
24901 // If @type is %G_UNIX_SOCKET_ADDRESS_PATH, this is equivalent to
24902 // calling g_unix_socket_address_new().
24904 // If @path_type is %G_UNIX_SOCKET_ADDRESS_ABSTRACT, then @path_len
24905 // bytes of @path will be copied to the socket's path, and only those
24906 // bytes will be considered part of the name. (If @path_len is -1,
24907 // then @path is assumed to be NUL-terminated.) For example, if @path
24908 // was "test", then calling g_socket_address_get_native_size() on the
24909 // returned socket would return 7 (2 bytes of overhead, 1 byte for the
24910 // abstract-socket indicator byte, and 4 bytes for the name "test").
24912 // If @path_type is %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED, then
24913 // @path_len bytes of @path will be copied to the socket's path, the
24914 // rest of the path will be padded with 0 bytes, and the entire
24915 // zero-padded buffer will be considered the name. (As above, if
24916 // @path_len is -1, then @path is assumed to be NUL-terminated.) In
24917 // this case, g_socket_address_get_native_size() will always return
24918 // the full size of a <literal>struct sockaddr_un</literal>, although
24919 // g_unix_socket_address_get_path_len() will still return just the
24920 // length of @path.
24922 // %G_UNIX_SOCKET_ADDRESS_ABSTRACT is preferred over
24923 // %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED for new programs. Of course,
24924 // when connecting to a server created by another process, you must
24925 // use the appropriate type corresponding to how that process created
24926 // its listening socket.
24927 // RETURNS: a new #GUnixSocketAddress
24928 // <path>: the name
24929 // <path_len>: the length of @path, or -1
24930 // <type>: a #GUnixSocketAddressType
24931 static UnixSocketAddress* /*new*/ new_with_type()(char* path, int path_len, UnixSocketAddressType type) {
24932 return g_unix_socket_address_new_with_type(path, path_len, type);
24935 // VERSION: 2.22
24936 // Checks if abstract unix domain socket names are supported.
24937 // RETURNS: %TRUE if supported, %FALSE otherwise
24938 static int abstract_names_supported()() {
24939 return g_unix_socket_address_abstract_names_supported();
24942 // VERSION: 2.26
24943 // Gets @address's type.
24944 // RETURNS: a #GUnixSocketAddressType
24945 UnixSocketAddressType get_address_type()() {
24946 return g_unix_socket_address_get_address_type(&this);
24949 // VERSION: 2.22
24950 // DEPRECATED method: get_is_abstract - Use g_unix_socket_address_get_address_type()
24951 // Tests if @address is abstract.
24952 // RETURNS: %TRUE if the address is abstract, %FALSE otherwise
24953 int get_is_abstract()() {
24954 return g_unix_socket_address_get_is_abstract(&this);
24957 // VERSION: 2.22
24958 // Gets @address's path, or for abstract sockets the "name".
24960 // Guaranteed to be zero-terminated, but an abstract socket
24961 // may contain embedded zeros, and thus you should use
24962 // g_unix_socket_address_get_path_len() to get the true length
24963 // of this string.
24964 // RETURNS: the path for @address
24965 char* get_path()() {
24966 return g_unix_socket_address_get_path(&this);
24969 // VERSION: 2.22
24970 // Gets the length of @address's path.
24972 // For details, see g_unix_socket_address_get_path().
24973 // RETURNS: the length of the path
24974 size_t get_path_len()() {
24975 return g_unix_socket_address_get_path_len(&this);
24979 struct UnixSocketAddressClass {
24980 SocketAddressClass parent_class;
24983 struct UnixSocketAddressPrivate {
24987 // The type of name used by a #GUnixSocketAddress.
24988 // %G_UNIX_SOCKET_ADDRESS_PATH indicates a traditional unix domain
24989 // socket bound to a filesystem path. %G_UNIX_SOCKET_ADDRESS_ANONYMOUS
24990 // indicates a socket not bound to any name (eg, a client-side socket,
24991 // or a socket created with socketpair()).
24993 // For abstract sockets, there are two incompatible ways of naming
24994 // them; the man pages suggest using the entire <literal>struct
24995 // sockaddr_un</literal> as the name, padding the unused parts of the
24996 // %sun_path field with zeroes; this corresponds to
24997 // %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED. However, many programs
24998 // instead just use a portion of %sun_path, and pass an appropriate
24999 // smaller length to bind() or connect(). This is
25000 // %G_UNIX_SOCKET_ADDRESS_ABSTRACT.
25001 enum UnixSocketAddressType /* Version 2.26 */ {
25002 INVALID = 0,
25003 ANONYMOUS = 1,
25004 PATH = 2,
25005 ABSTRACT = 3,
25006 ABSTRACT_PADDED = 4
25008 enum VFS_EXTENSION_POINT_NAME = "gio-vfs";
25009 enum VOLUME_IDENTIFIER_KIND_HAL_UDI = "hal-udi";
25010 enum VOLUME_IDENTIFIER_KIND_LABEL = "label";
25011 enum VOLUME_IDENTIFIER_KIND_NFS_MOUNT = "nfs-mount";
25012 enum VOLUME_IDENTIFIER_KIND_UNIX_DEVICE = "unix-device";
25013 enum VOLUME_IDENTIFIER_KIND_UUID = "uuid";
25014 enum VOLUME_MONITOR_EXTENSION_POINT_NAME = "gio-volume-monitor";
25015 // Entry point for using GIO functionality.
25016 struct Vfs /* : GObject.Object */ {
25017 alias parent_instance this;
25018 alias parent_instance super_;
25019 alias parent_instance object;
25020 GObject2.Object parent_instance;
25023 // Gets the default #GVfs for the system.
25024 // RETURNS: a #GVfs.
25025 static Vfs* get_default()() {
25026 return g_vfs_get_default();
25029 // Gets the local #GVfs for the system.
25030 // RETURNS: a #GVfs.
25031 static Vfs* get_local()() {
25032 return g_vfs_get_local();
25035 // Gets a #GFile for @path.
25037 // Free the returned object with g_object_unref().
25038 // RETURNS: a #GFile.
25039 // <path>: a string containing a VFS path.
25040 File* /*new*/ get_file_for_path()(char* path) {
25041 return g_vfs_get_file_for_path(&this, path);
25044 // Gets a #GFile for @uri.
25046 // This operation never fails, but the returned object
25047 // might not support any I/O operation if the URI
25048 // is malformed or if the URI scheme is not supported.
25050 // Free the returned object with g_object_unref().
25051 // RETURNS: a #GFile.
25052 // <uri>: a string containing a URI
25053 File* /*new*/ get_file_for_uri()(char* uri) {
25054 return g_vfs_get_file_for_uri(&this, uri);
25057 // Gets a list of URI schemes supported by @vfs.
25059 // The returned array belongs to GIO and must
25060 // not be freed or modified.
25061 // RETURNS: a %NULL-terminated array of strings.
25062 char** get_supported_uri_schemes()() {
25063 return g_vfs_get_supported_uri_schemes(&this);
25066 // Checks if the VFS is active.
25067 // RETURNS: %TRUE if construction of the @vfs was successful and it is now active.
25068 int is_active()() {
25069 return g_vfs_is_active(&this);
25072 // This operation never fails, but the returned object might
25073 // not support any I/O operations if the @parse_name cannot
25074 // be parsed by the #GVfs module.
25076 // Free the returned object with g_object_unref().
25077 // RETURNS: a #GFile for the given @parse_name.
25078 // <parse_name>: a string to be parsed by the VFS module.
25079 File* /*new*/ parse_name()(char* parse_name) {
25080 return g_vfs_parse_name(&this, parse_name);
25084 struct VfsClass {
25085 GObject2.ObjectClass parent_class;
25086 // RETURNS: %TRUE if construction of the @vfs was successful and it is now active.
25087 extern (C) int function (Vfs* vfs) is_active;
25089 // RETURNS: a #GFile.
25090 // <path>: a string containing a VFS path.
25091 extern (C) File* /*new*/ function (Vfs* vfs, char* path) get_file_for_path;
25093 // RETURNS: a #GFile.
25094 // <uri>: a string containing a URI
25095 extern (C) File* /*new*/ function (Vfs* vfs, char* uri) get_file_for_uri;
25096 // RETURNS: a %NULL-terminated array of strings.
25097 extern (C) char** function (Vfs* vfs) get_supported_uri_schemes;
25099 // RETURNS: a #GFile for the given @parse_name.
25100 // <parse_name>: a string to be parsed by the VFS module.
25101 extern (C) File* /*new*/ function (Vfs* vfs, char* parse_name) parse_name;
25102 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) local_file_add_info;
25103 extern (C) void function (Vfs* vfs, FileAttributeInfoList* list) add_writable_namespaces;
25104 extern (C) int function (Vfs* vfs, char* filename, FileInfo* info, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error=null) local_file_set_attributes;
25105 extern (C) void function (Vfs* vfs, char* filename) local_file_removed;
25106 extern (C) void function (Vfs* vfs, char* source, char* dest) local_file_moved;
25107 extern (C) void function () _g_reserved1;
25108 extern (C) void function () _g_reserved2;
25109 extern (C) void function () _g_reserved3;
25110 extern (C) void function () _g_reserved4;
25111 extern (C) void function () _g_reserved5;
25112 extern (C) void function () _g_reserved6;
25113 extern (C) void function () _g_reserved7;
25117 // The #GVolume interface represents user-visible objects that can be
25118 // mounted. Note, when porting from GnomeVFS, #GVolume is the moral
25119 // equivalent of #GnomeVFSDrive.
25121 // Mounting a #GVolume instance is an asynchronous operation. For more
25122 // information about asynchronous operations, see #GAsyncReady and
25123 // #GSimpleAsyncReady. To mount a #GVolume, first call
25124 // g_volume_mount() with (at least) the #GVolume instance, optionally
25125 // a #GMountOperation object and a #GAsyncReadyCallback.
25127 // Typically, one will only want to pass %NULL for the
25128 // #GMountOperation if automounting all volumes when a desktop session
25129 // starts since it's not desirable to put up a lot of dialogs asking
25130 // for credentials.
25132 // The callback will be fired when the operation has resolved (either
25133 // with success or failure), and a #GAsyncReady structure will be
25134 // passed to the callback. That callback should then call
25135 // g_volume_mount_finish() with the #GVolume instance and the
25136 // #GAsyncReady data to see if the operation was completed
25137 // successfully. If an @error is present when g_volume_mount_finish()
25138 // is called, then it will be filled with any error information.
25140 // <para id="volume-identifier">
25141 // It is sometimes necessary to directly access the underlying
25142 // operating system object behind a volume (e.g. for passing a volume
25143 // to an application via the commandline). For this purpose, GIO
25144 // allows to obtain an 'identifier' for the volume. There can be
25145 // different kinds of identifiers, such as Hal UDIs, filesystem labels,
25146 // traditional Unix devices (e.g. <filename>/dev/sda2</filename>),
25147 // uuids. GIO uses predefind strings as names for the different kinds
25148 // of identifiers: #G_VOLUME_IDENTIFIER_KIND_HAL_UDI,
25149 // #G_VOLUME_IDENTIFIER_KIND_LABEL, etc. Use g_volume_get_identifier()
25150 // to obtain an identifier for a volume.
25151 // </para>
25153 // Note that #G_VOLUME_IDENTIFIER_KIND_HAL_UDI will only be available
25154 // when the gvfs hal volume monitor is in use. Other volume monitors
25155 // will generally be able to provide the #G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE
25156 // identifier, which can be used to obtain a hal device by means of
25157 // libhal_manger_find_device_string_match().
25158 struct Volume /* Interface */ {
25159 mixin template __interface__() {
25160 // Checks if a volume can be ejected.
25161 // RETURNS: %TRUE if the @volume can be ejected. %FALSE otherwise.
25162 int can_eject()() {
25163 return g_volume_can_eject(cast(Volume*)&this);
25166 // Checks if a volume can be mounted.
25167 // RETURNS: %TRUE if the @volume can be mounted. %FALSE otherwise.
25168 int can_mount()() {
25169 return g_volume_can_mount(cast(Volume*)&this);
25172 // DEPRECATED (v2.22) method: eject - Use g_volume_eject_with_operation() instead.
25173 // Ejects a volume. This is an asynchronous operation, and is
25174 // finished by calling g_volume_eject_finish() with the @volume
25175 // and #GAsyncResult returned in the @callback.
25176 // <flags>: flags affecting the unmount if required for eject
25177 // <cancellable>: optional #GCancellable object, %NULL to ignore.
25178 // <callback>: a #GAsyncReadyCallback, or %NULL.
25179 // <user_data>: user data that gets passed to @callback
25180 void eject()(MountUnmountFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
25181 g_volume_eject(cast(Volume*)&this, flags, cancellable, callback, user_data);
25184 // DEPRECATED (v2.22) method: eject_finish - Use g_volume_eject_with_operation_finish() instead.
25185 // Finishes ejecting a volume. If any errors occurred during the operation,
25186 // @error will be set to contain the errors and %FALSE will be returned.
25187 // RETURNS: %TRUE, %FALSE if operation failed.
25188 // <result>: a #GAsyncResult.
25189 int eject_finish()(AsyncResult* result, GLib2.Error** error=null) {
25190 return g_volume_eject_finish(cast(Volume*)&this, result, error);
25193 // VERSION: 2.22
25194 // Ejects a volume. This is an asynchronous operation, and is
25195 // finished by calling g_volume_eject_with_operation_finish() with the @volume
25196 // and #GAsyncResult data returned in the @callback.
25197 // <flags>: flags affecting the unmount if required for eject
25198 // <mount_operation>: a #GMountOperation or %NULL to avoid user interaction.
25199 // <cancellable>: optional #GCancellable object, %NULL to ignore.
25200 // <callback>: a #GAsyncReadyCallback, or %NULL.
25201 // <user_data>: user data passed to @callback.
25202 void eject_with_operation()(MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
25203 g_volume_eject_with_operation(cast(Volume*)&this, flags, mount_operation, cancellable, callback, user_data);
25206 // VERSION: 2.22
25207 // Finishes ejecting a volume. If any errors occurred during the operation,
25208 // @error will be set to contain the errors and %FALSE will be returned.
25209 // RETURNS: %TRUE if the volume was successfully ejected. %FALSE otherwise.
25210 // <result>: a #GAsyncResult.
25211 int eject_with_operation_finish()(AsyncResult* result, GLib2.Error** error=null) {
25212 return g_volume_eject_with_operation_finish(cast(Volume*)&this, result, error);
25215 // Gets the kinds of <link linkend="volume-identifier">identifiers</link>
25216 // that @volume has. Use g_volume_get_identifer() to obtain
25217 // the identifiers themselves.
25219 // of strings containing kinds of identifiers. Use g_strfreev() to free.
25220 // RETURNS: a %NULL-terminated array
25221 char** /*new*/ enumerate_identifiers()() {
25222 return g_volume_enumerate_identifiers(cast(Volume*)&this);
25225 // VERSION: 2.18
25226 // Gets the activation root for a #GVolume if it is known ahead of
25227 // mount time. Returns %NULL otherwise. If not %NULL and if @volume
25228 // is mounted, then the result of g_mount_get_root() on the
25229 // #GMount object obtained from g_volume_get_mount() will always
25230 // either be equal or a prefix of what this function returns. In
25231 // other words, in code
25233 // <programlisting>
25234 // GMount *mount;
25235 // GFile *mount_root
25236 // GFile *volume_activation_root;
25238 // mount = g_volume_get_mount (volume); /&ast; mounted, so never NULL &ast;/
25239 // mount_root = g_mount_get_root (mount);
25240 // volume_activation_root = g_volume_get_activation_root(volume); /&ast; assume not NULL &ast;/
25241 // </programlisting>
25243 // then the expression
25245 // <programlisting>
25246 // (g_file_has_prefix (volume_activation_root, mount_root) ||
25247 // </programlisting>
25249 // will always be %TRUE.
25251 // Activation roots are typically used in #GVolumeMonitor
25252 // implementations to find the underlying mount to shadow, see
25253 // g_mount_is_shadowed() for more details.
25255 // g_object_unref() to free.
25256 // RETURNS: the activation root of @volume or %NULL. Use
25257 File* /*new*/ get_activation_root()() {
25258 return g_volume_get_activation_root(cast(Volume*)&this);
25261 // Gets the drive for the @volume.
25263 // The returned object should be unreffed with g_object_unref()
25264 // when no longer needed.
25265 // RETURNS: a #GDrive or %NULL if @volume is not associated with a drive.
25266 Drive* /*new*/ get_drive()() {
25267 return g_volume_get_drive(cast(Volume*)&this);
25270 // Gets the icon for @volume.
25272 // The returned object should be unreffed with g_object_unref()
25273 // when no longer needed.
25274 // RETURNS: a #GIcon.
25275 Icon* /*new*/ get_icon()() {
25276 return g_volume_get_icon(cast(Volume*)&this);
25279 // Gets the identifier of the given kind for @volume.
25280 // See the <link linkend="volume-identifier">introduction</link>
25281 // for more information about volume identifiers.
25283 // requested identfier, or %NULL if the #GVolume
25284 // doesn't have this kind of identifier
25285 // RETURNS: a newly allocated string containing the
25286 // <kind>: the kind of identifier to return
25287 char* /*new*/ get_identifier()(char* kind) {
25288 return g_volume_get_identifier(cast(Volume*)&this, kind);
25291 // Gets the mount for the @volume.
25293 // The returned object should be unreffed with g_object_unref()
25294 // when no longer needed.
25295 // RETURNS: a #GMount or %NULL if @volume isn't mounted.
25296 Mount* /*new*/ get_mount()() {
25297 return g_volume_get_mount(cast(Volume*)&this);
25300 // Gets the name of @volume.
25302 // be freed with g_free() when no longer needed.
25303 // RETURNS: the name for the given @volume. The returned string should
25304 char* /*new*/ get_name()() {
25305 return g_volume_get_name(cast(Volume*)&this);
25308 // VERSION: 2.32
25309 // Gets the sort key for @volume, if any.
25310 // RETURNS: Sorting key for @volume or %NULL if no such key is available.
25311 char* get_sort_key()() {
25312 return g_volume_get_sort_key(cast(Volume*)&this);
25315 // Gets the UUID for the @volume. The reference is typically based on
25316 // the file system UUID for the volume in question and should be
25317 // considered an opaque string. Returns %NULL if there is no UUID
25318 // available.
25320 // The returned string should be freed with g_free()
25321 // when no longer needed.
25322 // RETURNS: the UUID for @volume or %NULL if no UUID can be computed.
25323 char* /*new*/ get_uuid()() {
25324 return g_volume_get_uuid(cast(Volume*)&this);
25327 // Mounts a volume. This is an asynchronous operation, and is
25328 // finished by calling g_volume_mount_finish() with the @volume
25329 // and #GAsyncResult returned in the @callback.
25330 // <flags>: flags affecting the operation
25331 // <mount_operation>: a #GMountOperation or %NULL to avoid user interaction.
25332 // <cancellable>: optional #GCancellable object, %NULL to ignore.
25333 // <callback>: a #GAsyncReadyCallback, or %NULL.
25334 // <user_data>: user data that gets passed to @callback
25335 void mount()(MountMountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
25336 g_volume_mount(cast(Volume*)&this, flags, mount_operation, cancellable, callback, user_data);
25339 // Finishes mounting a volume. If any errors occurred during the operation,
25340 // @error will be set to contain the errors and %FALSE will be returned.
25342 // If the mount operation succeeded, g_volume_get_mount() on @volume
25343 // is guaranteed to return the mount right after calling this
25344 // function; there's no need to listen for the 'mount-added' signal on
25345 // #GVolumeMonitor.
25346 // RETURNS: %TRUE, %FALSE if operation failed.
25347 // <result>: a #GAsyncResult
25348 int mount_finish()(AsyncResult* result, GLib2.Error** error=null) {
25349 return g_volume_mount_finish(cast(Volume*)&this, result, error);
25352 // Returns whether the volume should be automatically mounted.
25353 // RETURNS: %TRUE if the volume should be automatically mounted.
25354 int should_automount()() {
25355 return g_volume_should_automount(cast(Volume*)&this);
25357 // Emitted when the volume has been changed.
25358 extern (C) alias static void function (Volume* this_, void* user_data=null) signal_changed;
25360 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
25361 return super_.signal_connect!name(cb, data, cf);
25364 ulong signal_connect(string name:"changed", CB:signal_changed)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
25365 return signal_connect_data!()(&this, cast(char*)"changed",
25366 cast(GObject2.Callback)cb, data, null, cf);
25369 // This signal is emitted when the #GVolume have been removed. If
25370 // the recipient is holding references to the object they should
25371 // release them so the object can be finalized.
25372 extern (C) alias static void function (Volume* this_, void* user_data=null) signal_removed;
25373 ulong signal_connect(string name:"removed", CB:signal_removed)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
25374 return signal_connect_data!()(&this, cast(char*)"removed",
25375 cast(GObject2.Callback)cb, data, null, cf);
25378 mixin __interface__;
25381 // Interface for implementing operations for mountable volumes.
25382 struct VolumeIface {
25383 GObject2.TypeInterface g_iface;
25384 extern (C) void function (Volume* volume) changed;
25385 extern (C) void function (Volume* volume) removed;
25386 // RETURNS: the name for the given @volume. The returned string should
25387 extern (C) char* /*new*/ function (Volume* volume) get_name;
25388 // RETURNS: a #GIcon.
25389 extern (C) Icon* /*new*/ function (Volume* volume) get_icon;
25390 // RETURNS: the UUID for @volume or %NULL if no UUID can be computed.
25391 extern (C) char* /*new*/ function (Volume* volume) get_uuid;
25392 // RETURNS: a #GDrive or %NULL if @volume is not associated with a drive.
25393 extern (C) Drive* /*new*/ function (Volume* volume) get_drive;
25394 // RETURNS: a #GMount or %NULL if @volume isn't mounted.
25395 extern (C) Mount* /*new*/ function (Volume* volume) get_mount;
25396 // RETURNS: %TRUE if the @volume can be mounted. %FALSE otherwise.
25397 extern (C) int function (Volume* volume) can_mount;
25398 // RETURNS: %TRUE if the @volume can be ejected. %FALSE otherwise.
25399 extern (C) int function (Volume* volume) can_eject;
25401 // <flags>: flags affecting the operation
25402 // <mount_operation>: a #GMountOperation or %NULL to avoid user interaction.
25403 // <cancellable>: optional #GCancellable object, %NULL to ignore.
25404 // <callback>: a #GAsyncReadyCallback, or %NULL.
25405 // <user_data>: user data that gets passed to @callback
25406 extern (C) void function (Volume* volume, MountMountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) mount_fn;
25408 // RETURNS: %TRUE, %FALSE if operation failed.
25409 // <result>: a #GAsyncResult
25410 extern (C) int function (Volume* volume, AsyncResult* result, GLib2.Error** error=null) mount_finish;
25412 // <flags>: flags affecting the unmount if required for eject
25413 // <cancellable>: optional #GCancellable object, %NULL to ignore.
25414 // <callback>: a #GAsyncReadyCallback, or %NULL.
25415 // <user_data>: user data that gets passed to @callback
25416 extern (C) void function (Volume* volume, MountUnmountFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) eject;
25418 // RETURNS: %TRUE, %FALSE if operation failed.
25419 // <result>: a #GAsyncResult.
25420 extern (C) int function (Volume* volume, AsyncResult* result, GLib2.Error** error=null) eject_finish;
25422 // RETURNS: a newly allocated string containing the
25423 // <kind>: the kind of identifier to return
25424 extern (C) char* /*new*/ function (Volume* volume, char* kind) get_identifier;
25425 // RETURNS: a %NULL-terminated array
25426 extern (C) char** /*new*/ function (Volume* volume) enumerate_identifiers;
25427 // RETURNS: %TRUE if the volume should be automatically mounted.
25428 extern (C) int function (Volume* volume) should_automount;
25429 // RETURNS: the activation root of @volume or %NULL. Use
25430 extern (C) File* /*new*/ function (Volume* volume) get_activation_root;
25432 // <flags>: flags affecting the unmount if required for eject
25433 // <mount_operation>: a #GMountOperation or %NULL to avoid user interaction.
25434 // <cancellable>: optional #GCancellable object, %NULL to ignore.
25435 // <callback>: a #GAsyncReadyCallback, or %NULL.
25436 // <user_data>: user data passed to @callback.
25437 extern (C) void function (Volume* volume, MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) eject_with_operation;
25439 // RETURNS: %TRUE if the volume was successfully ejected. %FALSE otherwise.
25440 // <result>: a #GAsyncResult.
25441 extern (C) int function (Volume* volume, AsyncResult* result, GLib2.Error** error=null) eject_with_operation_finish;
25442 // RETURNS: Sorting key for @volume or %NULL if no such key is available.
25443 extern (C) char* function (Volume* volume) get_sort_key;
25447 // #GVolumeMonitor is for listing the user interesting devices and volumes
25448 // on the computer. In other words, what a file selector or file manager
25449 // would show in a sidebar.
25451 // #GVolumeMonitor is not <link
25452 // linkend="g-main-context-push-thread-default">thread-default-context
25453 // aware</link>, and so should not be used other than from the main
25454 // thread, with no thread-default-context active.
25455 struct VolumeMonitor /* : GObject.Object */ {
25456 alias parent_instance this;
25457 alias parent_instance super_;
25458 alias parent_instance object;
25459 GObject2.Object parent_instance;
25460 private void* priv;
25463 // DEPRECATED (v2.20) function: adopt_orphan_mount - Instead of using this function, #GVolumeMonitor
25464 // This function should be called by any #GVolumeMonitor
25465 // implementation when a new #GMount object is created that is not
25466 // associated with a #GVolume object. It must be called just before
25467 // emitting the @mount_added signal.
25469 // If the return value is not %NULL, the caller must associate the
25470 // returned #GVolume object with the #GMount. This involves returning
25471 // it in its g_mount_get_volume() implementation. The caller must
25472 // also listen for the "removed" signal on the returned object
25473 // and give up its reference when handling that signal
25475 // Similary, if implementing g_volume_monitor_adopt_orphan_mount(),
25476 // the implementor must take a reference to @mount and return it in
25477 // its g_volume_get_mount() implemented. Also, the implementor must
25478 // listen for the "unmounted" signal on @mount and give up its
25479 // reference upon handling that signal.
25481 // There are two main use cases for this function.
25483 // One is when implementing a user space file system driver that reads
25484 // blocks of a block device that is already represented by the native
25485 // volume monitor (for example a CD Audio file system driver). Such
25486 // a driver will generate its own #GMount object that needs to be
25487 // associated with the #GVolume object that represents the volume.
25489 // The other is for implementing a #GVolumeMonitor whose sole purpose
25490 // is to return #GVolume objects representing entries in the users
25491 // "favorite servers" list or similar.
25493 // if no wants to adopt the #GMount.
25495 // implementations should instead create shadow mounts with the URI of
25496 // the mount they intend to adopt. See the proxy volume monitor in
25497 // gvfs for an example of this. Also see g_mount_is_shadowed(),
25498 // g_mount_shadow() and g_mount_unshadow() functions.
25499 // RETURNS: the #GVolume object that is the parent for @mount or %NULL
25500 // <mount>: a #GMount object to find a parent for
25501 static Volume* /*new*/ adopt_orphan_mount()(Mount* mount) {
25502 return g_volume_monitor_adopt_orphan_mount(mount);
25505 // Gets the volume monitor used by gio.
25507 // g_object_unref() when done with it.
25508 // RETURNS: a reference to the #GVolumeMonitor used by gio. Call
25509 static VolumeMonitor* /*new*/ get()() {
25510 return g_volume_monitor_get();
25513 // Gets a list of drives connected to the system.
25515 // The returned list should be freed with g_list_free(), after
25516 // its elements have been unreffed with g_object_unref().
25517 // RETURNS: a #GList of connected #GDrive objects.
25518 GLib2.List* /*new*/ get_connected_drives()() {
25519 return g_volume_monitor_get_connected_drives(&this);
25522 // Finds a #GMount object by its UUID (see g_mount_get_uuid())
25524 // Free the returned object with g_object_unref().
25525 // RETURNS: a #GMount or %NULL if no such mount is available.
25526 // <uuid>: the UUID to look for
25527 Mount* /*new*/ get_mount_for_uuid()(char* uuid) {
25528 return g_volume_monitor_get_mount_for_uuid(&this, uuid);
25531 // Gets a list of the mounts on the system.
25533 // The returned list should be freed with g_list_free(), after
25534 // its elements have been unreffed with g_object_unref().
25535 // RETURNS: a #GList of #GMount objects.
25536 GLib2.List* /*new*/ get_mounts()() {
25537 return g_volume_monitor_get_mounts(&this);
25540 // Finds a #GVolume object by its UUID (see g_volume_get_uuid())
25542 // Free the returned object with g_object_unref().
25543 // RETURNS: a #GVolume or %NULL if no such volume is available.
25544 // <uuid>: the UUID to look for
25545 Volume* /*new*/ get_volume_for_uuid()(char* uuid) {
25546 return g_volume_monitor_get_volume_for_uuid(&this, uuid);
25549 // Gets a list of the volumes on the system.
25551 // The returned list should be freed with g_list_free(), after
25552 // its elements have been unreffed with g_object_unref().
25553 // RETURNS: a #GList of #GVolume objects.
25554 GLib2.List* /*new*/ get_volumes()() {
25555 return g_volume_monitor_get_volumes(&this);
25558 // Emitted when a drive changes.
25559 // <drive>: the drive that changed
25560 extern (C) alias static void function (VolumeMonitor* this_, Drive* drive, void* user_data=null) signal_drive_changed;
25562 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
25563 return super_.signal_connect!name(cb, data, cf);
25566 ulong signal_connect(string name:"drive-changed", CB:signal_drive_changed)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
25567 return signal_connect_data!()(&this, cast(char*)"drive-changed",
25568 cast(GObject2.Callback)cb, data, null, cf);
25571 // Emitted when a drive is connected to the system.
25572 // <drive>: a #GDrive that was connected.
25573 extern (C) alias static void function (VolumeMonitor* this_, Drive* drive, void* user_data=null) signal_drive_connected;
25574 ulong signal_connect(string name:"drive-connected", CB:signal_drive_connected)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
25575 return signal_connect_data!()(&this, cast(char*)"drive-connected",
25576 cast(GObject2.Callback)cb, data, null, cf);
25579 // Emitted when a drive is disconnected from the system.
25580 // <drive>: a #GDrive that was disconnected.
25581 extern (C) alias static void function (VolumeMonitor* this_, Drive* drive, void* user_data=null) signal_drive_disconnected;
25582 ulong signal_connect(string name:"drive-disconnected", CB:signal_drive_disconnected)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
25583 return signal_connect_data!()(&this, cast(char*)"drive-disconnected",
25584 cast(GObject2.Callback)cb, data, null, cf);
25587 // VERSION: 2.18
25588 // Emitted when the eject button is pressed on @drive.
25589 // <drive>: the drive where the eject button was pressed
25590 extern (C) alias static void function (VolumeMonitor* this_, Drive* drive, void* user_data=null) signal_drive_eject_button;
25591 ulong signal_connect(string name:"drive-eject-button", CB:signal_drive_eject_button)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
25592 return signal_connect_data!()(&this, cast(char*)"drive-eject-button",
25593 cast(GObject2.Callback)cb, data, null, cf);
25596 // VERSION: 2.22
25597 // Emitted when the stop button is pressed on @drive.
25598 // <drive>: the drive where the stop button was pressed
25599 extern (C) alias static void function (VolumeMonitor* this_, Drive* drive, void* user_data=null) signal_drive_stop_button;
25600 ulong signal_connect(string name:"drive-stop-button", CB:signal_drive_stop_button)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
25601 return signal_connect_data!()(&this, cast(char*)"drive-stop-button",
25602 cast(GObject2.Callback)cb, data, null, cf);
25605 // Emitted when a mount is added.
25606 // <mount>: a #GMount that was added.
25607 extern (C) alias static void function (VolumeMonitor* this_, Mount* mount, void* user_data=null) signal_mount_added;
25608 ulong signal_connect(string name:"mount-added", CB:signal_mount_added)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
25609 return signal_connect_data!()(&this, cast(char*)"mount-added",
25610 cast(GObject2.Callback)cb, data, null, cf);
25613 // Emitted when a mount changes.
25614 // <mount>: a #GMount that changed.
25615 extern (C) alias static void function (VolumeMonitor* this_, Mount* mount, void* user_data=null) signal_mount_changed;
25616 ulong signal_connect(string name:"mount-changed", CB:signal_mount_changed)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
25617 return signal_connect_data!()(&this, cast(char*)"mount-changed",
25618 cast(GObject2.Callback)cb, data, null, cf);
25621 // Emitted when a mount is about to be removed.
25622 // <mount>: a #GMount that is being unmounted.
25623 extern (C) alias static void function (VolumeMonitor* this_, Mount* mount, void* user_data=null) signal_mount_pre_unmount;
25624 ulong signal_connect(string name:"mount-pre-unmount", CB:signal_mount_pre_unmount)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
25625 return signal_connect_data!()(&this, cast(char*)"mount-pre-unmount",
25626 cast(GObject2.Callback)cb, data, null, cf);
25629 // Emitted when a mount is removed.
25630 // <mount>: a #GMount that was removed.
25631 extern (C) alias static void function (VolumeMonitor* this_, Mount* mount, void* user_data=null) signal_mount_removed;
25632 ulong signal_connect(string name:"mount-removed", CB:signal_mount_removed)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
25633 return signal_connect_data!()(&this, cast(char*)"mount-removed",
25634 cast(GObject2.Callback)cb, data, null, cf);
25637 // Emitted when a mountable volume is added to the system.
25638 // <volume>: a #GVolume that was added.
25639 extern (C) alias static void function (VolumeMonitor* this_, Volume* volume, void* user_data=null) signal_volume_added;
25640 ulong signal_connect(string name:"volume-added", CB:signal_volume_added)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
25641 return signal_connect_data!()(&this, cast(char*)"volume-added",
25642 cast(GObject2.Callback)cb, data, null, cf);
25645 // Emitted when mountable volume is changed.
25646 // <volume>: a #GVolume that changed.
25647 extern (C) alias static void function (VolumeMonitor* this_, Volume* volume, void* user_data=null) signal_volume_changed;
25648 ulong signal_connect(string name:"volume-changed", CB:signal_volume_changed)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
25649 return signal_connect_data!()(&this, cast(char*)"volume-changed",
25650 cast(GObject2.Callback)cb, data, null, cf);
25653 // Emitted when a mountable volume is removed from the system.
25654 // <volume>: a #GVolume that was removed.
25655 extern (C) alias static void function (VolumeMonitor* this_, Volume* volume, void* user_data=null) signal_volume_removed;
25656 ulong signal_connect(string name:"volume-removed", CB:signal_volume_removed)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
25657 return signal_connect_data!()(&this, cast(char*)"volume-removed",
25658 cast(GObject2.Callback)cb, data, null, cf);
25662 struct VolumeMonitorClass {
25663 GObject2.ObjectClass parent_class;
25664 extern (C) void function (VolumeMonitor* volume_monitor, Volume* volume) volume_added;
25665 extern (C) void function (VolumeMonitor* volume_monitor, Volume* volume) volume_removed;
25666 extern (C) void function (VolumeMonitor* volume_monitor, Volume* volume) volume_changed;
25667 extern (C) void function (VolumeMonitor* volume_monitor, Mount* mount) mount_added;
25668 extern (C) void function (VolumeMonitor* volume_monitor, Mount* mount) mount_removed;
25669 extern (C) void function (VolumeMonitor* volume_monitor, Mount* mount) mount_pre_unmount;
25670 extern (C) void function (VolumeMonitor* volume_monitor, Mount* mount) mount_changed;
25671 extern (C) void function (VolumeMonitor* volume_monitor, Drive* drive) drive_connected;
25672 extern (C) void function (VolumeMonitor* volume_monitor, Drive* drive) drive_disconnected;
25673 extern (C) void function (VolumeMonitor* volume_monitor, Drive* drive) drive_changed;
25674 extern (C) int function () is_supported;
25675 // RETURNS: a #GList of connected #GDrive objects.
25676 extern (C) GLib2.List* /*new*/ function (VolumeMonitor* volume_monitor) get_connected_drives;
25677 // RETURNS: a #GList of #GVolume objects.
25678 extern (C) GLib2.List* /*new*/ function (VolumeMonitor* volume_monitor) get_volumes;
25679 // RETURNS: a #GList of #GMount objects.
25680 extern (C) GLib2.List* /*new*/ function (VolumeMonitor* volume_monitor) get_mounts;
25682 // RETURNS: a #GVolume or %NULL if no such volume is available.
25683 // <uuid>: the UUID to look for
25684 extern (C) Volume* /*new*/ function (VolumeMonitor* volume_monitor, char* uuid) get_volume_for_uuid;
25686 // RETURNS: a #GMount or %NULL if no such mount is available.
25687 // <uuid>: the UUID to look for
25688 extern (C) Mount* /*new*/ function (VolumeMonitor* volume_monitor, char* uuid) get_mount_for_uuid;
25689 // Unintrospectable functionp: adopt_orphan_mount() / ()
25690 extern (C) Volume* function (Mount* mount, VolumeMonitor* volume_monitor) adopt_orphan_mount;
25691 extern (C) void function (VolumeMonitor* volume_monitor, Drive* drive) drive_eject_button;
25692 extern (C) void function (VolumeMonitor* volume_monitor, Drive* drive) drive_stop_button;
25693 extern (C) void function () _g_reserved1;
25694 extern (C) void function () _g_reserved2;
25695 extern (C) void function () _g_reserved3;
25696 extern (C) void function () _g_reserved4;
25697 extern (C) void function () _g_reserved5;
25698 extern (C) void function () _g_reserved6;
25701 // Zlib decompression
25702 struct ZlibCompressor /* : GObject.Object */ {
25703 mixin Converter.__interface__;
25704 alias method_parent this;
25705 alias method_parent super_;
25706 alias method_parent object;
25707 GObject2.Object method_parent;
25710 // VERSION: 2.24
25711 // Creates a new #GZlibCompressor.
25712 // RETURNS: a new #GZlibCompressor
25713 // <format>: The format to use for the compressed data
25714 // <level>: compression level (0-9), -1 for default
25715 static ZlibCompressor* /*new*/ new_()(ZlibCompressorFormat format, int level) {
25716 return g_zlib_compressor_new(format, level);
25719 // VERSION: 2.26
25720 // Returns the #GZlibCompressor:file-info property.
25721 // RETURNS: a #GFileInfo, or %NULL
25722 FileInfo* get_file_info()() {
25723 return g_zlib_compressor_get_file_info(&this);
25726 // VERSION: 2.26
25727 // Sets @file_info in @compressor. If non-%NULL, and @compressor's
25728 // #GZlibCompressor:format property is %G_ZLIB_COMPRESSOR_FORMAT_GZIP,
25729 // it will be used to set the file name and modification time in
25730 // the GZIP header of the compressed data.
25732 // Note: it is an error to call this function while a compression is in
25733 // progress; it may only be called immediately after creation of @compressor,
25734 // or after resetting it with g_converter_reset().
25735 // <file_info>: a #GFileInfo
25736 void set_file_info()(FileInfo* file_info=null) {
25737 g_zlib_compressor_set_file_info(&this, file_info);
25741 struct ZlibCompressorClass {
25742 GObject2.ObjectClass parent_class;
25746 // Used to select the type of data format to use for #GZlibDecompressor
25747 // and #GZlibCompressor.
25748 enum ZlibCompressorFormat /* Version 2.24 */ {
25749 ZLIB = 0,
25750 GZIP = 1,
25751 RAW = 2
25753 // Zlib decompression
25754 struct ZlibDecompressor /* : GObject.Object */ {
25755 mixin Converter.__interface__;
25756 alias method_parent this;
25757 alias method_parent super_;
25758 alias method_parent object;
25759 GObject2.Object method_parent;
25762 // VERSION: 2.24
25763 // Creates a new #GZlibDecompressor.
25764 // RETURNS: a new #GZlibDecompressor
25765 // <format>: The format to use for the compressed data
25766 static ZlibDecompressor* /*new*/ new_()(ZlibCompressorFormat format) {
25767 return g_zlib_decompressor_new(format);
25770 // VERSION: 2.26
25771 // Retrieves the #GFileInfo constructed from the GZIP header data
25772 // of compressed data processed by @compressor, or %NULL if @decompressor's
25773 // #GZlibDecompressor:format property is not %G_ZLIB_COMPRESSOR_FORMAT_GZIP,
25774 // or the header data was not fully processed yet, or it not present in the
25775 // data stream at all.
25776 // RETURNS: a #GFileInfo, or %NULL
25777 FileInfo* get_file_info()() {
25778 return g_zlib_decompressor_get_file_info(&this);
25782 struct ZlibDecompressorClass {
25783 GObject2.ObjectClass parent_class;
25787 // MOVED TO: AppInfo.create_from_commandline
25788 // Creates a new #GAppInfo from the given information.
25789 // RETURNS: new #GAppInfo for given command.
25790 // <commandline>: the commandline to use
25791 // <application_name>: the application name, or %NULL to use @commandline
25792 // <flags>: flags that can specify details of the created #GAppInfo
25793 static AppInfo* /*new*/ app_info_create_from_commandline()(char* commandline, char* application_name, AppInfoCreateFlags flags, GLib2.Error** error=null) {
25794 return g_app_info_create_from_commandline(commandline, application_name, flags, error);
25798 // MOVED TO: AppInfo.get_all
25799 // Gets a list of all of the applications currently registered
25800 // on this system.
25802 // For desktop files, this includes applications that have
25803 // <literal>NoDisplay=true</literal> set or are excluded from
25804 // display by means of <literal>OnlyShowIn</literal> or
25805 // <literal>NotShowIn</literal>. See g_app_info_should_show().
25806 // The returned list does not include applications which have
25807 // the <literal>Hidden</literal> key set.
25808 // RETURNS: a newly allocated #GList of references to #GAppInfo<!---->s.
25809 static GLib2.List* /*new*/ app_info_get_all()() {
25810 return g_app_info_get_all();
25814 // MOVED TO: AppInfo.get_all_for_type
25815 // Gets a list of all #GAppInfos for a given content type,
25816 // including the recommended and fallback #GAppInfos. See
25817 // g_app_info_get_recommended_for_type() and
25818 // g_app_info_get_fallback_for_type().
25820 // for given @content_type or %NULL on error.
25821 // RETURNS: #GList of #GAppInfos
25822 // <content_type>: the content type to find a #GAppInfo for
25823 static GLib2.List* /*new*/ app_info_get_all_for_type()(char* content_type) {
25824 return g_app_info_get_all_for_type(content_type);
25828 // MOVED TO: AppInfo.get_default_for_type
25829 // Gets the default #GAppInfo for a given content type.
25831 // %NULL on error.
25832 // RETURNS: #GAppInfo for given @content_type or
25833 // <content_type>: the content type to find a #GAppInfo for
25834 // <must_support_uris>: if %TRUE, the #GAppInfo is expected to support URIs
25835 static AppInfo* /*new*/ app_info_get_default_for_type()(char* content_type, int must_support_uris) {
25836 return g_app_info_get_default_for_type(content_type, must_support_uris);
25840 // MOVED TO: AppInfo.get_default_for_uri_scheme
25841 // Gets the default application for handling URIs with
25842 // the given URI scheme. A URI scheme is the initial part
25843 // of the URI, up to but not including the ':', e.g. "http",
25844 // "ftp" or "sip".
25845 // RETURNS: #GAppInfo for given @uri_scheme or %NULL on error.
25846 // <uri_scheme>: a string containing a URI scheme.
25847 static AppInfo* /*new*/ app_info_get_default_for_uri_scheme()(char* uri_scheme) {
25848 return g_app_info_get_default_for_uri_scheme(uri_scheme);
25852 // VERSION: 2.28
25853 // MOVED TO: AppInfo.get_fallback_for_type
25854 // Gets a list of fallback #GAppInfos for a given content type, i.e.
25855 // those applications which claim to support the given content type
25856 // by MIME type subclassing and not directly.
25858 // for given @content_type or %NULL on error.
25859 // RETURNS: #GList of #GAppInfos
25860 // <content_type>: the content type to find a #GAppInfo for
25861 static GLib2.List* /*new*/ app_info_get_fallback_for_type()(char* content_type) {
25862 return g_app_info_get_fallback_for_type(content_type);
25866 // VERSION: 2.28
25867 // MOVED TO: AppInfo.get_recommended_for_type
25868 // Gets a list of recommended #GAppInfos for a given content type, i.e.
25869 // those applications which claim to support the given content type exactly,
25870 // and not by MIME type subclassing.
25871 // Note that the first application of the list is the last used one, i.e.
25872 // the last one for which g_app_info_set_as_last_used_for_type() has been
25873 // called.
25875 // for given @content_type or %NULL on error.
25876 // RETURNS: #GList of #GAppInfos
25877 // <content_type>: the content type to find a #GAppInfo for
25878 static GLib2.List* /*new*/ app_info_get_recommended_for_type()(char* content_type) {
25879 return g_app_info_get_recommended_for_type(content_type);
25883 // MOVED TO: AppInfo.launch_default_for_uri
25884 // Utility function that launches the default application
25885 // registered to handle the specified uri. Synchronous I/O
25886 // is done on the uri to detect the type of the file if
25887 // required.
25888 // RETURNS: %TRUE on success, %FALSE on error.
25889 // <uri>: the uri to show
25890 // <launch_context>: an optional #GAppLaunchContext.
25891 static int app_info_launch_default_for_uri()(char* uri, AppLaunchContext* launch_context, GLib2.Error** error=null) {
25892 return g_app_info_launch_default_for_uri(uri, launch_context, error);
25896 // VERSION: 2.20
25897 // MOVED TO: AppInfo.reset_type_associations
25898 // Removes all changes to the type associations done by
25899 // g_app_info_set_as_default_for_type(),
25900 // g_app_info_set_as_default_for_extension(),
25901 // g_app_info_add_supports_type() or
25902 // g_app_info_remove_supports_type().
25903 // <content_type>: a content type
25904 static void app_info_reset_type_associations()(char* content_type) {
25905 g_app_info_reset_type_associations(content_type);
25909 // VERSION: 2.22
25910 // MOVED TO: AsyncInitable.newv_async
25911 // Helper function for constructing #GAsyncInitable object. This is
25912 // similar to g_object_newv() but also initializes the object asynchronously.
25914 // When the initialization is finished, @callback will be called. You can
25915 // then call g_async_initable_new_finish() to get the new object and check
25916 // for any errors.
25917 // <object_type>: a #GType supporting #GAsyncInitable.
25918 // <n_parameters>: the number of parameters in @parameters
25919 // <parameters>: the parameters to use to construct the object
25920 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the operation.
25921 // <cancellable>: optional #GCancellable object, %NULL to ignore.
25922 // <callback>: a #GAsyncReadyCallback to call when the initialization is finished
25923 // <user_data>: the data to pass to callback function
25924 static void async_initable_newv_async()(Type object_type, uint n_parameters, GObject2.Parameter* parameters, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
25925 g_async_initable_newv_async(object_type, n_parameters, parameters, io_priority, cancellable, callback, user_data);
25929 // VERSION: 2.26
25930 // Asynchronously connects to the message bus specified by @bus_type.
25932 // When the operation is finished, @callback will be invoked. You can
25933 // then call g_bus_get_finish() to get the result of the operation.
25935 // This is a asynchronous failable function. See g_bus_get_sync() for
25936 // the synchronous version.
25937 // <bus_type>: A #GBusType.
25938 // <cancellable>: A #GCancellable or %NULL.
25939 // <callback>: A #GAsyncReadyCallback to call when the request is satisfied.
25940 // <user_data>: The data to pass to @callback.
25941 static void bus_get()(BusType bus_type, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
25942 g_bus_get(bus_type, cancellable, callback, user_data);
25946 // VERSION: 2.26
25947 // Finishes an operation started with g_bus_get().
25949 // The returned object is a singleton, that is, shared with other
25950 // callers of g_bus_get() and g_bus_get_sync() for @bus_type. In the
25951 // event that you need a private message bus connection, use
25952 // g_dbus_address_get_for_bus_sync() and
25953 // g_dbus_connection_new_for_address().
25955 // Note that the returned #GDBusConnection object will (usually) have
25956 // the #GDBusConnection:exit-on-close property set to %TRUE.
25957 // RETURNS: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
25958 // <res>: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_bus_get().
25959 static DBusConnection* /*new*/ bus_get_finish()(AsyncResult* res, GLib2.Error** error=null) {
25960 return g_bus_get_finish(res, error);
25964 // VERSION: 2.26
25965 // Synchronously connects to the message bus specified by @bus_type.
25966 // Note that the returned object may shared with other callers,
25967 // e.g. if two separate parts of a process calls this function with
25968 // the same @bus_type, they will share the same object.
25970 // This is a synchronous failable function. See g_bus_get() and
25971 // g_bus_get_finish() for the asynchronous version.
25973 // The returned object is a singleton, that is, shared with other
25974 // callers of g_bus_get() and g_bus_get_sync() for @bus_type. In the
25975 // event that you need a private message bus connection, use
25976 // g_dbus_address_get_for_bus_sync() and
25977 // g_dbus_connection_new_for_address().
25979 // Note that the returned #GDBusConnection object will (usually) have
25980 // the #GDBusConnection:exit-on-close property set to %TRUE.
25981 // RETURNS: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
25982 // <bus_type>: A #GBusType.
25983 // <cancellable>: A #GCancellable or %NULL.
25984 static DBusConnection* /*new*/ bus_get_sync()(BusType bus_type, Cancellable* cancellable, GLib2.Error** error=null) {
25985 return g_bus_get_sync(bus_type, cancellable, error);
25989 // Unintrospectable function: bus_own_name() / g_bus_own_name()
25990 // VERSION: 2.26
25991 // Starts acquiring @name on the bus specified by @bus_type and calls
25992 // @name_acquired_handler and @name_lost_handler when the name is
25993 // acquired respectively lost. Callbacks will be invoked in the <link
25994 // linkend="g-main-context-push-thread-default">thread-default main
25995 // loop</link> of the thread you are calling this function from.
25997 // You are guaranteed that one of the @name_acquired_handler and @name_lost_handler
25998 // callbacks will be invoked after calling this function - there are three
25999 // possible cases:
26000 // <itemizedlist>
26001 // <listitem><para>
26002 // @name_lost_handler with a %NULL connection (if a connection to the bus can't be made).
26003 // </para></listitem>
26004 // <listitem><para>
26005 // @bus_acquired_handler then @name_lost_handler (if the name can't be obtained)
26006 // </para></listitem>
26007 // <listitem><para>
26008 // @bus_acquired_handler then @name_acquired_handler (if the name was obtained).
26009 // </para></listitem>
26010 // </itemizedlist>
26011 // When you are done owning the name, just call g_bus_unown_name()
26012 // with the owner id this function returns.
26014 // If the name is acquired or lost (for example another application
26015 // could acquire the name if you allow replacement or the application
26016 // currently owning the name exits), the handlers are also invoked. If the
26017 // #GDBusConnection that is used for attempting to own the name
26018 // closes, then @name_lost_handler is invoked since it is no
26019 // longer possible for other processes to access the process.
26021 // You cannot use g_bus_own_name() several times for the same name (unless
26022 // interleaved with calls to g_bus_unown_name()) - only the first call
26023 // will work.
26025 // Another guarantee is that invocations of @name_acquired_handler
26026 // and @name_lost_handler are guaranteed to alternate; that
26027 // is, if @name_acquired_handler is invoked then you are
26028 // guaranteed that the next time one of the handlers is invoked, it
26029 // will be @name_lost_handler. The reverse is also true.
26031 // If you plan on exporting objects (using e.g.
26032 // g_dbus_connection_register_object()), note that it is generally too late
26033 // to export the objects in @name_acquired_handler. Instead, you can do this
26034 // in @bus_acquired_handler since you are guaranteed that this will run
26035 // before @name is requested from the bus.
26037 // This behavior makes it very simple to write applications that wants
26038 // to own names and export objects, see <xref linkend="gdbus-owning-names"/>.
26039 // Simply register objects to be exported in @bus_acquired_handler and
26040 // unregister the objects (if any) in @name_lost_handler.
26042 // g_bus_unown_name() to stop owning the name.
26043 // RETURNS: An identifier (never 0) that an be used with
26044 // <bus_type>: The type of bus to own a name on.
26045 // <name>: The well-known name to own.
26046 // <flags>: A set of flags from the #GBusNameOwnerFlags enumeration.
26047 // <bus_acquired_handler>: Handler to invoke when connected to the bus of type @bus_type or %NULL.
26048 // <name_acquired_handler>: Handler to invoke when @name is acquired or %NULL.
26049 // <name_lost_handler>: Handler to invoke when @name is lost or %NULL.
26050 // <user_data>: User data to pass to handlers.
26051 // <user_data_free_func>: Function for freeing @user_data or %NULL.
26052 static uint 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) {
26053 return g_bus_own_name(bus_type, name, flags, bus_acquired_handler, name_acquired_handler, name_lost_handler, user_data, user_data_free_func);
26057 // Unintrospectable function: bus_own_name_on_connection() / g_bus_own_name_on_connection()
26058 // VERSION: 2.26
26059 // Like g_bus_own_name() but takes a #GDBusConnection instead of a
26060 // #GBusType.
26062 // g_bus_unown_name() to stop owning the name.
26063 // RETURNS: An identifier (never 0) that an be used with
26064 // <connection>: A #GDBusConnection.
26065 // <name>: The well-known name to own.
26066 // <flags>: A set of flags from the #GBusNameOwnerFlags enumeration.
26067 // <name_acquired_handler>: Handler to invoke when @name is acquired or %NULL.
26068 // <name_lost_handler>: Handler to invoke when @name is lost or %NULL.
26069 // <user_data>: User data to pass to handlers.
26070 // <user_data_free_func>: Function for freeing @user_data or %NULL.
26071 static uint 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) {
26072 return g_bus_own_name_on_connection(connection, name, flags, name_acquired_handler, name_lost_handler, user_data, user_data_free_func);
26076 // VERSION: 2.26
26077 // Version of g_bus_own_name_on_connection() using closures instead of callbacks for
26078 // easier binding in other languages.
26080 // g_bus_unown_name() to stop owning the name.
26081 // RETURNS: An identifier (never 0) that an be used with
26082 // <connection>: A #GDBusConnection.
26083 // <name>: The well-known name to own.
26084 // <flags>: A set of flags from the #GBusNameOwnerFlags enumeration.
26085 // <name_acquired_closure>: #GClosure to invoke when @name is acquired or %NULL.
26086 // <name_lost_closure>: #GClosure to invoke when @name is lost or %NULL.
26087 static uint 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) {
26088 return g_bus_own_name_on_connection_with_closures(connection, name, flags, name_acquired_closure, name_lost_closure);
26092 // VERSION: 2.26
26093 // Version of g_bus_own_name() using closures instead of callbacks for
26094 // easier binding in other languages.
26096 // g_bus_unown_name() to stop owning the name.
26097 // RETURNS: An identifier (never 0) that an be used with
26098 // <bus_type>: The type of bus to own a name on.
26099 // <name>: The well-known name to own.
26100 // <flags>: A set of flags from the #GBusNameOwnerFlags enumeration.
26101 // <bus_acquired_closure>: #GClosure to invoke when connected to the bus of type @bus_type or %NULL.
26102 // <name_acquired_closure>: #GClosure to invoke when @name is acquired or %NULL.
26103 // <name_lost_closure>: #GClosure to invoke when @name is lost or %NULL.
26104 static uint 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) {
26105 return g_bus_own_name_with_closures(bus_type, name, flags, bus_acquired_closure, name_acquired_closure, name_lost_closure);
26109 // VERSION: 2.26
26110 // Stops owning a name.
26111 // <owner_id>: An identifier obtained from g_bus_own_name()
26112 static void bus_unown_name()(uint owner_id) {
26113 g_bus_unown_name(owner_id);
26117 // VERSION: 2.26
26118 // Stops watching a name.
26119 // <watcher_id>: An identifier obtained from g_bus_watch_name()
26120 static void bus_unwatch_name()(uint watcher_id) {
26121 g_bus_unwatch_name(watcher_id);
26125 // Unintrospectable function: bus_watch_name() / g_bus_watch_name()
26126 // VERSION: 2.26
26127 // Starts watching @name on the bus specified by @bus_type and calls
26128 // @name_appeared_handler and @name_vanished_handler when the name is
26129 // known to have a owner respectively known to lose its
26130 // owner. Callbacks will be invoked in the <link
26131 // linkend="g-main-context-push-thread-default">thread-default main
26132 // loop</link> of the thread you are calling this function from.
26134 // You are guaranteed that one of the handlers will be invoked after
26135 // calling this function. When you are done watching the name, just
26136 // call g_bus_unwatch_name() with the watcher id this function
26137 // returns.
26139 // If the name vanishes or appears (for example the application owning
26140 // the name could restart), the handlers are also invoked. If the
26141 // #GDBusConnection that is used for watching the name disconnects, then
26142 // @name_vanished_handler is invoked since it is no longer
26143 // possible to access the name.
26145 // Another guarantee is that invocations of @name_appeared_handler
26146 // and @name_vanished_handler are guaranteed to alternate; that
26147 // is, if @name_appeared_handler is invoked then you are
26148 // guaranteed that the next time one of the handlers is invoked, it
26149 // will be @name_vanished_handler. The reverse is also true.
26151 // This behavior makes it very simple to write applications that wants
26152 // to take action when a certain name exists, see <xref
26153 // linkend="gdbus-watching-names"/>. Basically, the application
26154 // should create object proxies in @name_appeared_handler and destroy
26155 // them again (if any) in @name_vanished_handler.
26157 // g_bus_unwatch_name() to stop watching the name.
26158 // RETURNS: An identifier (never 0) that an be used with
26159 // <bus_type>: The type of bus to watch a name on.
26160 // <name>: The name (well-known or unique) to watch.
26161 // <flags>: Flags from the #GBusNameWatcherFlags enumeration.
26162 // <name_appeared_handler>: Handler to invoke when @name is known to exist or %NULL.
26163 // <name_vanished_handler>: Handler to invoke when @name is known to not exist or %NULL.
26164 // <user_data>: User data to pass to handlers.
26165 // <user_data_free_func>: Function for freeing @user_data or %NULL.
26166 static uint 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) {
26167 return g_bus_watch_name(bus_type, name, flags, name_appeared_handler, name_vanished_handler, user_data, user_data_free_func);
26171 // Unintrospectable function: bus_watch_name_on_connection() / g_bus_watch_name_on_connection()
26172 // VERSION: 2.26
26173 // Like g_bus_watch_name() but takes a #GDBusConnection instead of a
26174 // #GBusType.
26176 // g_bus_unwatch_name() to stop watching the name.
26177 // RETURNS: An identifier (never 0) that an be used with
26178 // <connection>: A #GDBusConnection.
26179 // <name>: The name (well-known or unique) to watch.
26180 // <flags>: Flags from the #GBusNameWatcherFlags enumeration.
26181 // <name_appeared_handler>: Handler to invoke when @name is known to exist or %NULL.
26182 // <name_vanished_handler>: Handler to invoke when @name is known to not exist or %NULL.
26183 // <user_data>: User data to pass to handlers.
26184 // <user_data_free_func>: Function for freeing @user_data or %NULL.
26185 static uint 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) {
26186 return g_bus_watch_name_on_connection(connection, name, flags, name_appeared_handler, name_vanished_handler, user_data, user_data_free_func);
26190 // VERSION: 2.26
26191 // Version of g_bus_watch_name_on_connection() using closures instead of callbacks for
26192 // easier binding in other languages.
26194 // g_bus_unwatch_name() to stop watching the name.
26195 // RETURNS: An identifier (never 0) that an be used with
26196 // <connection>: A #GDBusConnection.
26197 // <name>: The name (well-known or unique) to watch.
26198 // <flags>: Flags from the #GBusNameWatcherFlags enumeration.
26199 // <name_appeared_closure>: #GClosure to invoke when @name is known to exist or %NULL.
26200 // <name_vanished_closure>: #GClosure to invoke when @name is known to not exist or %NULL.
26201 static uint 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) {
26202 return g_bus_watch_name_on_connection_with_closures(connection, name, flags, name_appeared_closure, name_vanished_closure);
26206 // VERSION: 2.26
26207 // Version of g_bus_watch_name() using closures instead of callbacks for
26208 // easier binding in other languages.
26210 // g_bus_unwatch_name() to stop watching the name.
26211 // RETURNS: An identifier (never 0) that an be used with
26212 // <bus_type>: The type of bus to watch a name on.
26213 // <name>: The name (well-known or unique) to watch.
26214 // <flags>: Flags from the #GBusNameWatcherFlags enumeration.
26215 // <name_appeared_closure>: #GClosure to invoke when @name is known to exist or %NULL.
26216 // <name_vanished_closure>: #GClosure to invoke when @name is known to not exist or %NULL.
26217 static uint bus_watch_name_with_closures()(BusType bus_type, char* name, BusNameWatcherFlags flags, GObject2.Closure* name_appeared_closure=null, GObject2.Closure* name_vanished_closure=null) {
26218 return g_bus_watch_name_with_closures(bus_type, name, flags, name_appeared_closure, name_vanished_closure);
26222 // Checks if a content type can be executable. Note that for instance
26223 // things like text files can be executables (i.e. scripts and batch files).
26225 // can be executable, %FALSE otherwise.
26226 // RETURNS: %TRUE if the file type corresponds to a type that
26227 // <type>: a content type string
26228 static int content_type_can_be_executable()(char* type) {
26229 return g_content_type_can_be_executable(type);
26233 // Compares two content types for equality.
26235 // %FALSE otherwise.
26236 // RETURNS: %TRUE if the two strings are identical or equivalent,
26237 // <type1>: a content type string
26238 // <type2>: a content type string
26239 static int content_type_equals()(char* type1, char* type2) {
26240 return g_content_type_equals(type1, type2);
26244 // VERSION: 2.18
26245 // Tries to find a content type based on the mime type name.
26247 // or %NULL. Free with g_free()
26248 // RETURNS: Newly allocated string with content type
26249 // <mime_type>: a mime type string
26250 static char* /*new*/ content_type_from_mime_type()(char* mime_type) {
26251 return g_content_type_from_mime_type(mime_type);
26255 // Gets the human readable description of the content type.
26257 // returned string with g_free()
26258 // RETURNS: a short description of the content type @type. Free the
26259 // <type>: a content type string
26260 static char* /*new*/ content_type_get_description()(char* type) {
26261 return g_content_type_get_description(type);
26265 // Gets the icon for a content type.
26267 // object with g_object_unref()
26268 // RETURNS: #GIcon corresponding to the content type. Free the returned
26269 // <type>: a content type string
26270 static Icon* /*new*/ content_type_get_icon()(char* type) {
26271 return g_content_type_get_icon(type);
26275 // Gets the mime type for the content type, if one is registered.
26277 // or %NULL if unknown.
26278 // RETURNS: the registered mime type for the given @type,
26279 // <type>: a content type string
26280 static char* /*new*/ content_type_get_mime_type()(char* type) {
26281 return g_content_type_get_mime_type(type);
26285 // Guesses the content type based on example data. If the function is
26286 // uncertain, @result_uncertain will be set to %TRUE. Either @filename
26287 // or @data may be %NULL, in which case the guess will be based solely
26288 // on the other argument.
26290 // given data. Free with g_free()
26291 // RETURNS: a string indicating a guessed content type for the
26292 // <filename>: a string, or %NULL
26293 // <data>: a stream of data, or %NULL
26294 // <data_size>: the size of @data
26295 // <result_uncertain>: return location for the certainty of the result, or %NULL
26296 static char* /*new*/ content_type_guess()(char* filename, ubyte* data, size_t data_size, /*out*/ int* result_uncertain=null) {
26297 return g_content_type_guess(filename, data, data_size, result_uncertain);
26301 // VERSION: 2.18
26302 // Tries to guess the type of the tree with root @root, by
26303 // looking at the files it contains. The result is an array
26304 // of content types, with the best guess coming first.
26306 // The types returned all have the form x-content/foo, e.g.
26307 // x-content/audio-cdda (for audio CDs) or x-content/image-dcf
26308 // (for a camera memory card). See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
26309 // specification for more on x-content types.
26311 // This function is useful in the implementation of
26312 // g_mount_guess_content_type().
26314 // array of zero or more content types. Free with g_strfreev()
26315 // RETURNS: an %NULL-terminated
26316 // <root>: the root of the tree to guess a type for
26317 static char** /*new*/ content_type_guess_for_tree()(File* root) {
26318 return g_content_type_guess_for_tree(root);
26322 // Determines if @type is a subset of @supertype.
26324 // %FALSE otherwise.
26325 // RETURNS: %TRUE if @type is a kind of @supertype,
26326 // <type>: a content type string
26327 // <supertype>: a content type string
26328 static int content_type_is_a()(char* type, char* supertype) {
26329 return g_content_type_is_a(type, supertype);
26333 // Checks if the content type is the generic "unknown" type.
26334 // On UNIX this is the "application/octet-stream" mimetype,
26335 // while on win32 it is "*".
26336 // RETURNS: %TRUE if the type is the unknown type.
26337 // <type>: a content type string
26338 static int content_type_is_unknown()(char* type) {
26339 return g_content_type_is_unknown(type);
26343 // Gets a list of strings containing all the registered content types
26344 // known to the system. The list and its data should be freed using
26345 // <programlisting>
26346 // g_list_free_full (list, g_free);
26347 // </programlisting>
26348 // RETURNS: #GList of the registered content types
26349 static GLib2.List* /*new*/ content_types_get_registered()() {
26350 return g_content_types_get_registered();
26354 // VERSION: 2.26
26355 // Synchronously looks up the D-Bus address for the well-known message
26356 // bus instance specified by @bus_type. This may involve using various
26357 // platform specific mechanisms.
26358 // RETURNS: A valid D-Bus address string for @bus_type or %NULL if @error is set.
26359 // <bus_type>: A #GBusType.
26360 // <cancellable>: A #GCancellable or %NULL.
26361 static char* /*new*/ dbus_address_get_for_bus_sync()(BusType bus_type, Cancellable* cancellable, GLib2.Error** error=null) {
26362 return g_dbus_address_get_for_bus_sync(bus_type, cancellable, error);
26366 // VERSION: 2.26
26367 // Asynchronously connects to an endpoint specified by @address and
26368 // sets up the connection so it is in a state to run the client-side
26369 // of the D-Bus authentication conversation.
26371 // When the operation is finished, @callback will be invoked. You can
26372 // then call g_dbus_address_get_stream_finish() to get the result of
26373 // the operation.
26375 // This is an asynchronous failable function. See
26376 // g_dbus_address_get_stream_sync() for the synchronous version.
26377 // <address>: A valid D-Bus address.
26378 // <cancellable>: A #GCancellable or %NULL.
26379 // <callback>: A #GAsyncReadyCallback to call when the request is satisfied.
26380 // <user_data>: Data to pass to @callback.
26381 static void dbus_address_get_stream()(char* address, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
26382 g_dbus_address_get_stream(address, cancellable, callback, user_data);
26386 // VERSION: 2.26
26387 // Finishes an operation started with g_dbus_address_get_stream().
26388 // RETURNS: A #GIOStream or %NULL if @error is set.
26389 // <res>: A #GAsyncResult obtained from the GAsyncReadyCallback passed to g_dbus_address_get_stream().
26390 // <out_guid>: %NULL or return location to store the GUID extracted from @address, if any.
26391 static IOStream* /*new*/ dbus_address_get_stream_finish()(AsyncResult* res, char** out_guid, GLib2.Error** error=null) {
26392 return g_dbus_address_get_stream_finish(res, out_guid, error);
26396 // VERSION: 2.26
26397 // Synchronously connects to an endpoint specified by @address and
26398 // sets up the connection so it is in a state to run the client-side
26399 // of the D-Bus authentication conversation.
26401 // This is a synchronous failable function. See
26402 // g_dbus_address_get_stream() for the asynchronous version.
26403 // RETURNS: A #GIOStream or %NULL if @error is set.
26404 // <address>: A valid D-Bus address.
26405 // <out_guid>: %NULL or return location to store the GUID extracted from @address, if any.
26406 // <cancellable>: A #GCancellable or %NULL.
26407 static IOStream* /*new*/ dbus_address_get_stream_sync()(char* address, char** out_guid, Cancellable* cancellable, GLib2.Error** error=null) {
26408 return g_dbus_address_get_stream_sync(address, out_guid, cancellable, error);
26412 // VERSION: 2.26
26413 // MOVED TO: DBusAnnotationInfo.lookup
26414 // Looks up the value of an annotation.
26416 // This cost of this function is O(n) in number of annotations.
26417 // RETURNS: The value or %NULL if not found. Do not free, it is owned by @annotations.
26418 // <annotations>: A %NULL-terminated array of annotations or %NULL.
26419 // <name>: The name of the annotation to look up.
26420 static char* dbus_annotation_info_lookup()(DBusAnnotationInfo** annotations, char* name) {
26421 return g_dbus_annotation_info_lookup(annotations, name);
26425 // VERSION: 2.26
26426 // MOVED TO: DBusError.encode_gerror
26427 // Creates a D-Bus error name to use for @error. If @error matches
26428 // a registered error (cf. g_dbus_error_register_error()), the corresponding
26429 // D-Bus error name will be returned.
26431 // Otherwise the a name of the form
26432 // <literal>org.gtk.GDBus.UnmappedGError.Quark._ESCAPED_QUARK_NAME.Code_ERROR_CODE</literal>
26433 // will be used. This allows other GDBus applications to map the error
26434 // on the wire back to a #GError using g_dbus_error_new_for_dbus_error().
26436 // This function is typically only used in object mappings to put a
26437 // #GError on the wire. Regular applications should not use it.
26438 // RETURNS: A D-Bus error name (never %NULL). Free with g_free().
26439 // <error>: A #GError.
26440 static char* /*new*/ dbus_error_encode_gerror()(GLib2.Error* error) {
26441 return g_dbus_error_encode_gerror(error);
26445 // VERSION: 2.26
26446 // MOVED TO: DBusError.get_remote_error
26447 // Gets the D-Bus error name used for @error, if any.
26449 // This function is guaranteed to return a D-Bus error name for all
26450 // #GError<!-- -->s returned from functions handling remote method
26451 // calls (e.g. g_dbus_connection_call_finish()) unless
26452 // g_dbus_error_strip_remote_error() has been used on @error.
26453 // RETURNS: An allocated string or %NULL if the D-Bus error name could not be found. Free with g_free().
26454 // <error>: A #GError.
26455 static char* /*new*/ dbus_error_get_remote_error()(GLib2.Error* error) {
26456 return g_dbus_error_get_remote_error(error);
26460 // VERSION: 2.26
26461 // MOVED TO: DBusError.is_remote_error
26462 // Checks if @error represents an error received via D-Bus from a remote peer. If so,
26463 // use g_dbus_error_get_remote_error() to get the name of the error.
26465 // %FALSE otherwise.
26466 // RETURNS: %TRUE if @error represents an error from a remote peer,
26467 // <error>: A #GError.
26468 static int dbus_error_is_remote_error()(GLib2.Error* error) {
26469 return g_dbus_error_is_remote_error(error);
26473 // VERSION: 2.26
26474 // MOVED TO: DBusError.new_for_dbus_error
26475 // Creates a #GError based on the contents of @dbus_error_name and
26476 // @dbus_error_message.
26478 // Errors registered with g_dbus_error_register_error() will be looked
26479 // up using @dbus_error_name and if a match is found, the error domain
26480 // and code is used. Applications can use g_dbus_error_get_remote_error()
26481 // to recover @dbus_error_name.
26483 // If a match against a registered error is not found and the D-Bus
26484 // error name is in a form as returned by g_dbus_error_encode_gerror()
26485 // the error domain and code encoded in the name is used to
26486 // create the #GError. Also, @dbus_error_name is added to the error message
26487 // such that it can be recovered with g_dbus_error_get_remote_error().
26489 // Otherwise, a #GError with the error code %G_IO_ERROR_DBUS_ERROR
26490 // in the #G_IO_ERROR error domain is returned. Also, @dbus_error_name is
26491 // added to the error message such that it can be recovered with
26492 // g_dbus_error_get_remote_error().
26494 // In all three cases, @dbus_error_name can always be recovered from the
26495 // returned #GError using the g_dbus_error_get_remote_error() function
26496 // (unless g_dbus_error_strip_remote_error() hasn't been used on the returned error).
26498 // This function is typically only used in object mappings to prepare
26499 // #GError instances for applications. Regular applications should not use
26500 // it.
26501 // RETURNS: An allocated #GError. Free with g_error_free().
26502 // <dbus_error_name>: D-Bus error name.
26503 // <dbus_error_message>: D-Bus error message.
26504 static GLib2.Error* /*new*/ dbus_error_new_for_dbus_error()(char* dbus_error_name, char* dbus_error_message) {
26505 return g_dbus_error_new_for_dbus_error(dbus_error_name, dbus_error_message);
26508 // MOVED TO: DBusError.quark
26509 static GLib2.Quark dbus_error_quark()() {
26510 return g_dbus_error_quark();
26514 // VERSION: 2.26
26515 // MOVED TO: DBusError.register_error
26516 // Creates an association to map between @dbus_error_name and
26517 // #GError<!-- -->s specified by @error_domain and @error_code.
26519 // This is typically done in the routine that returns the #GQuark for
26520 // an error domain.
26522 // exists.
26523 // RETURNS: %TRUE if the association was created, %FALSE if it already
26524 // <error_domain>: A #GQuark for a error domain.
26525 // <error_code>: An error code.
26526 // <dbus_error_name>: A D-Bus error name.
26527 static int dbus_error_register_error()(GLib2.Quark error_domain, int error_code, char* dbus_error_name) {
26528 return g_dbus_error_register_error(error_domain, error_code, dbus_error_name);
26532 // VERSION: 2.26
26533 // MOVED TO: DBusError.register_error_domain
26534 // Helper function for associating a #GError error domain with D-Bus error names.
26535 // <error_domain_quark_name>: The error domain name.
26536 // <quark_volatile>: A pointer where to store the #GQuark.
26537 // <entries>: A pointer to @num_entries #GDBusErrorEntry struct items.
26538 // <num_entries>: Number of items to register.
26539 static void dbus_error_register_error_domain()(char* error_domain_quark_name, size_t* quark_volatile, DBusErrorEntry* entries, uint num_entries) {
26540 g_dbus_error_register_error_domain(error_domain_quark_name, quark_volatile, entries, num_entries);
26544 // VERSION: 2.26
26545 // MOVED TO: DBusError.strip_remote_error
26546 // Looks for extra information in the error message used to recover
26547 // the D-Bus error name and strips it if found. If stripped, the
26548 // message field in @error will correspond exactly to what was
26549 // received on the wire.
26551 // This is typically used when presenting errors to the end user.
26552 // RETURNS: %TRUE if information was stripped, %FALSE otherwise.
26553 // <error>: A #GError.
26554 static int dbus_error_strip_remote_error()(GLib2.Error* error) {
26555 return g_dbus_error_strip_remote_error(error);
26559 // VERSION: 2.26
26560 // MOVED TO: DBusError.unregister_error
26561 // Destroys an association previously set up with g_dbus_error_register_error().
26562 // RETURNS: %TRUE if the association was destroyed, %FALSE if it wasn't found.
26563 // <error_domain>: A #GQuark for a error domain.
26564 // <error_code>: An error code.
26565 // <dbus_error_name>: A D-Bus error name.
26566 static int dbus_error_unregister_error()(GLib2.Quark error_domain, int error_code, char* dbus_error_name) {
26567 return g_dbus_error_unregister_error(error_domain, error_code, dbus_error_name);
26571 // VERSION: 2.26
26572 // Generate a D-Bus GUID that can be used with
26573 // e.g. g_dbus_connection_new().
26575 // See the D-Bus specification regarding what strings are valid D-Bus
26576 // GUID (for example, D-Bus GUIDs are not RFC-4122 compliant).
26577 // RETURNS: A valid D-Bus GUID. Free with g_free().
26578 static char* /*new*/ dbus_generate_guid()() {
26579 return g_dbus_generate_guid();
26583 // VERSION: 2.30
26584 // Converts a #GValue to a #GVariant of the type indicated by the @type parameter.
26586 // The conversion is using the following rules:
26587 // <table frame='all'>
26588 // <title>#GValue / #GVariant conversion rules</title>
26589 // <tgroup cols='2' align='left' colsep='1' rowsep='1'>
26590 // <thead>
26591 // <row>
26592 // <entry>If the #GType for @gvalue is...</entry>
26593 // <entry>... then @type must be</entry>
26594 // </row>
26595 // </thead>
26596 // <tbody>
26597 // <row>
26598 // <entry>#G_TYPE_STRING</entry>
26599 // <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>
26600 // </row>
26601 // <row>
26602 // <entry>#G_TYPE_STRV</entry>
26603 // <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>
26604 // </row>
26605 // <row>
26606 // <entry>#G_TYPE_BOOLEAN</entry>
26607 // <entry><link linkend="G-VARIANT-TYPE-BOOLEAN:CAPS">'b'</link></entry>
26608 // </row>
26609 // <row>
26610 // <entry>#G_TYPE_UCHAR</entry>
26611 // <entry><link linkend="G-VARIANT-TYPE-BYTE:CAPS">'y'</link></entry>
26612 // </row>
26613 // <row>
26614 // <entry>#G_TYPE_INT</entry>
26615 // <entry><link linkend="G-VARIANT-TYPE-INT32:CAPS">'i'</link> or <link linkend="G-VARIANT-TYPE-INT16:CAPS">'n'</link></entry>
26616 // </row>
26617 // <row>
26618 // <entry>#G_TYPE_UINT</entry>
26619 // <entry><link linkend="G-VARIANT-TYPE-UINT32:CAPS">'u'</link> or <link linkend="G-VARIANT-TYPE-UINT16:CAPS">'q'</link></entry>
26620 // </row>
26621 // <row>
26622 // <entry>#G_TYPE_INT64</entry>
26623 // <entry><link linkend="G-VARIANT-TYPE-INT64:CAPS">'x'</link></entry>
26624 // </row>
26625 // <row>
26626 // <entry>#G_TYPE_UINT64</entry>
26627 // <entry><link linkend="G-VARIANT-TYPE-UINT64:CAPS">'t'</link></entry>
26628 // </row>
26629 // <row>
26630 // <entry>#G_TYPE_DOUBLE</entry>
26631 // <entry><link linkend="G-VARIANT-TYPE-DOUBLE:CAPS">'d'</link></entry>
26632 // </row>
26633 // <row>
26634 // <entry>#G_TYPE_VARIANT</entry>
26635 // <entry>Any #GVariantType</entry>
26636 // </row>
26637 // </tbody>
26638 // </tgroup>
26639 // </table>
26640 // This can fail if e.g. @gvalue is of type #G_TYPE_STRING and @type
26641 // is <link linkend="G-VARIANT-TYPE-INT32:CAPS">'i'</link>. It will
26642 // also fail for any #GType (including e.g. #G_TYPE_OBJECT and
26643 // #G_TYPE_BOXED derived-types) not in the table above.
26645 // Note that if @gvalue is of type #G_TYPE_VARIANT and its value is
26646 // %NULL, the <emphasis>empty</emphasis> #GVariant instance (never
26647 // %NULL) for @type is returned (e.g. 0 for scalar types, the empty
26648 // string for string types, <literal>'/'</literal> for object path
26649 // types, the empty array for any array type and so on).
26651 // See the g_dbus_gvariant_to_gvalue() function for how to convert a
26652 // #GVariant to a #GValue.
26654 // @type holding the data from @gvalue or %NULL in case of
26655 // failure. Free with g_variant_unref().
26656 // RETURNS: A #GVariant (never floating) of #GVariantType
26657 // <gvalue>: A #GValue to convert to a #GVariant.
26658 // <type>: A #GVariantType.
26659 static GLib2.Variant* /*new*/ dbus_gvalue_to_gvariant()(GObject2.Value* gvalue, GLib2.VariantType* type) {
26660 return g_dbus_gvalue_to_gvariant(gvalue, type);
26664 // VERSION: 2.30
26665 // Converts a #GVariant to a #GValue. If @value is floating, it is consumed.
26667 // The rules specified in the g_dbus_gvalue_to_gvariant() function are
26668 // used - this function is essentially its reverse form.
26670 // The conversion never fails - a valid #GValue is always returned in
26671 // @out_gvalue.
26672 // <value>: A #GVariant.
26673 // <out_gvalue>: Return location pointing to a zero-filled (uninitialized) #GValue.
26674 static void dbus_gvariant_to_gvalue()(GLib2.Variant* value, GObject2.Value* out_gvalue) {
26675 g_dbus_gvariant_to_gvalue(value, out_gvalue);
26679 // VERSION: 2.26
26680 // Checks if @string is a D-Bus address.
26682 // This doesn't check if @string is actually supported by #GDBusServer
26683 // or #GDBusConnection - use g_dbus_is_supported_address() to do more
26684 // checks.
26685 // RETURNS: %TRUE if @string is a valid D-Bus address, %FALSE otherwise.
26686 // <string>: A string.
26687 static int dbus_is_address()(char* string_) {
26688 return g_dbus_is_address(string_);
26692 // VERSION: 2.26
26693 // Checks if @string is a D-Bus GUID.
26695 // See the D-Bus specification regarding what strings are valid D-Bus
26696 // GUID (for example, D-Bus GUIDs are not RFC-4122 compliant).
26697 // RETURNS: %TRUE if @string is a guid, %FALSE otherwise.
26698 // <string>: The string to check.
26699 static int dbus_is_guid()(char* string_) {
26700 return g_dbus_is_guid(string_);
26704 // VERSION: 2.26
26705 // Checks if @string is a valid D-Bus interface name.
26706 // RETURNS: %TRUE if valid, %FALSE otherwise.
26707 // <string>: The string to check.
26708 static int dbus_is_interface_name()(char* string_) {
26709 return g_dbus_is_interface_name(string_);
26713 // VERSION: 2.26
26714 // Checks if @string is a valid D-Bus member (e.g. signal or method) name.
26715 // RETURNS: %TRUE if valid, %FALSE otherwise.
26716 // <string>: The string to check.
26717 static int dbus_is_member_name()(char* string_) {
26718 return g_dbus_is_member_name(string_);
26722 // VERSION: 2.26
26723 // Checks if @string is a valid D-Bus bus name (either unique or well-known).
26724 // RETURNS: %TRUE if valid, %FALSE otherwise.
26725 // <string>: The string to check.
26726 static int dbus_is_name()(char* string_) {
26727 return g_dbus_is_name(string_);
26731 // VERSION: 2.26
26732 // Like g_dbus_is_address() but also checks if the library suppors the
26733 // transports in @string and that key/value pairs for each transport
26734 // are valid.
26736 // supported by this library, %FALSE if @error is set.
26737 // RETURNS: %TRUE if @string is a valid D-Bus address that is
26738 // <string>: A string.
26739 static int dbus_is_supported_address()(char* string_, GLib2.Error** error=null) {
26740 return g_dbus_is_supported_address(string_, error);
26744 // VERSION: 2.26
26745 // Checks if @string is a valid D-Bus unique bus name.
26746 // RETURNS: %TRUE if valid, %FALSE otherwise.
26747 // <string>: The string to check.
26748 static int dbus_is_unique_name()(char* string_) {
26749 return g_dbus_is_unique_name(string_);
26753 // MOVED TO: File.new_for_commandline_arg
26754 // Creates a #GFile with the given argument from the command line. The value of
26755 // @arg can be either a URI, an absolute path or a relative path resolved
26756 // relative to the current working directory.
26757 // This operation never fails, but the returned object might not support any
26758 // I/O operation if @arg points to a malformed path.
26760 // Free the returned object with g_object_unref().
26761 // RETURNS: a new #GFile.
26762 // <arg>: a command line string.
26763 static File* /*new*/ file_new_for_commandline_arg()(char* arg) {
26764 return g_file_new_for_commandline_arg(arg);
26768 // MOVED TO: File.new_for_path
26769 // Constructs a #GFile for a given path. This operation never
26770 // fails, but the returned object might not support any I/O
26771 // operation if @path is malformed.
26773 // Free the returned object with g_object_unref().
26774 // RETURNS: a new #GFile for the given @path.
26775 // <path>: a string containing a relative or absolute path. The string must be encoded in the glib filename encoding.
26776 static File* /*new*/ file_new_for_path()(char* path) {
26777 return g_file_new_for_path(path);
26781 // MOVED TO: File.new_for_uri
26782 // Constructs a #GFile for a given URI. This operation never
26783 // fails, but the returned object might not support any I/O
26784 // operation if @uri is malformed or if the uri type is
26785 // not supported.
26787 // Free the returned object with g_object_unref().
26788 // RETURNS: a new #GFile for the given @uri.
26789 // <uri>: a UTF8 string containing a URI.
26790 static File* /*new*/ file_new_for_uri()(char* uri) {
26791 return g_file_new_for_uri(uri);
26795 // VERSION: 2.32
26796 // MOVED TO: File.new_tmp
26797 // Opens a file in the preferred directory for temporary files (as
26798 // returned by g_get_tmp_dir()) and returns a #GFile and
26799 // #GFileIOStream pointing to it.
26801 // @template should be a string in the GLib file name encoding
26802 // containing a sequence of six 'X' characters, and containing no
26803 // directory components. If it is %NULL, a default template is used.
26805 // Unlike the other #GFile constructors, this will return %NULL if
26806 // a temporary file could not be created.
26808 // Free the returned object with g_object_unref().
26809 // RETURNS: a new #GFile.
26810 // <tmpl>: Template for the file name, as in g_file_open_tmp(), or %NULL for a default template.
26811 // <iostream>: on return, a #GFileIOStream for the created file.
26812 static File* /*new*/ file_new_tmp()(char* tmpl, /*out*/ FileIOStream** iostream, GLib2.Error** error=null) {
26813 return g_file_new_tmp(tmpl, iostream, error);
26817 // MOVED TO: File.parse_name
26818 // Constructs a #GFile with the given @parse_name (i.e. something given by g_file_get_parse_name()).
26819 // This operation never fails, but the returned object might not support any I/O
26820 // operation if the @parse_name cannot be parsed.
26821 // RETURNS: a new #GFile.
26822 // <parse_name>: a file name or path to be parsed.
26823 static File* /*new*/ file_parse_name()(char* parse_name) {
26824 return g_file_parse_name(parse_name);
26828 // MOVED TO: Icon.hash
26829 // Gets a hash for an icon.
26831 // use in a #GHashTable or similar data structure.
26832 // RETURNS: a #guint containing a hash for the @icon, suitable for
26833 // <icon>: #gconstpointer to an icon object.
26834 static uint icon_hash()(const(void)* icon) {
26835 return g_icon_hash(icon);
26839 // VERSION: 2.20
26840 // MOVED TO: Icon.new_for_string
26841 // Generate a #GIcon instance from @str. This function can fail if
26842 // @str is not valid - see g_icon_to_string() for discussion.
26844 // If your application or library provides one or more #GIcon
26845 // implementations you need to ensure that each #GType is registered
26846 // with the type system prior to calling g_icon_new_for_string().
26848 // interface or %NULL if @error is set.
26849 // RETURNS: An object implementing the #GIcon
26850 // <str>: A string obtained via g_icon_to_string().
26851 static Icon* /*new*/ icon_new_for_string()(char* str, GLib2.Error** error=null) {
26852 return g_icon_new_for_string(str, error);
26856 // VERSION: 2.22
26857 // MOVED TO: Initable.newv
26858 // Helper function for constructing #GInitiable object. This is
26859 // similar to g_object_newv() but also initializes the object
26860 // and returns %NULL, setting an error on failure.
26861 // RETURNS: a newly allocated #GObject, or %NULL on error
26862 // <object_type>: a #GType supporting #GInitable.
26863 // <n_parameters>: the number of parameters in @parameters
26864 // <parameters>: the parameters to use to construct the object
26865 // <cancellable>: optional #GCancellable object, %NULL to ignore.
26866 static void* /*new*/ initable_newv()(Type object_type, uint n_parameters, GObject2.Parameter* parameters, Cancellable* cancellable, GLib2.Error** error=null) {
26867 return g_initable_newv(object_type, n_parameters, parameters, cancellable, error);
26871 // Converts errno.h error codes into GIO error codes.
26872 // RETURNS: #GIOErrorEnum value for the given errno.h error number.
26873 // <err_no>: Error number as defined in errno.h.
26874 static IOErrorEnum io_error_from_errno()(int err_no) {
26875 return g_io_error_from_errno(err_no);
26879 // Gets the GIO Error Quark.
26880 // RETURNS: a #GQuark.
26881 static GLib2.Quark io_error_quark()() {
26882 return g_io_error_quark();
26886 // Gets the type associated with @extension.
26887 // RETURNS: the type of @extension
26888 // <extension>: a #GIOExtension
26889 static Type io_extension_get_type()(IOExtension* extension) {
26890 return g_io_extension_get_type(extension);
26894 // MOVED TO: IOExtensionPoint.implement
26895 // Registers @type as extension for the extension point with name
26896 // @extension_point_name.
26898 // If @type has already been registered as an extension for this
26899 // extension point, the existing #GIOExtension object is returned.
26900 // RETURNS: a #GIOExtension object for #GType
26901 // <extension_point_name>: the name of the extension point
26902 // <type>: the #GType to register as extension
26903 // <extension_name>: the name for the extension
26904 // <priority>: the priority for the extension
26905 static IOExtension* io_extension_point_implement()(char* extension_point_name, Type type, char* extension_name, int priority) {
26906 return g_io_extension_point_implement(extension_point_name, type, extension_name, priority);
26910 // MOVED TO: IOExtensionPoint.lookup
26911 // Looks up an existing extension point.
26913 // is no registered extension point with the given name.
26914 // RETURNS: the #GIOExtensionPoint, or %NULL if there
26915 // <name>: the name of the extension point
26916 static IOExtensionPoint* io_extension_point_lookup()(char* name) {
26917 return g_io_extension_point_lookup(name);
26921 // MOVED TO: IOExtensionPoint.register
26922 // Registers an extension point.
26924 // owned by GIO and should not be freed.
26925 // RETURNS: the new #GIOExtensionPoint. This object is
26926 // <name>: The name of the extension point
26927 static IOExtensionPoint* io_extension_point_register()(char* name) {
26928 return g_io_extension_point_register(name);
26932 // Loads all the modules in the specified directory.
26934 // If don't require all modules to be initialized (and thus registering
26935 // all gtypes) then you can use g_io_modules_scan_all_in_directory()
26936 // which allows delayed/lazy loading of modules.
26938 // from the directory,
26939 // All the modules are loaded into memory, if you want to
26940 // unload them (enabling on-demand loading) you must call
26941 // g_type_module_unuse() on all the modules. Free the list
26942 // with g_list_free().
26943 // RETURNS: a list of #GIOModules loaded
26944 // <dirname>: pathname for a directory containing modules to load.
26945 static GLib2.List* /*new*/ io_modules_load_all_in_directory()(char* dirname) {
26946 return g_io_modules_load_all_in_directory(dirname);
26950 // VERSION: 2.30
26951 // Loads all the modules in the specified directory.
26953 // If don't require all modules to be initialized (and thus registering
26954 // all gtypes) then you can use g_io_modules_scan_all_in_directory()
26955 // which allows delayed/lazy loading of modules.
26957 // from the directory,
26958 // All the modules are loaded into memory, if you want to
26959 // unload them (enabling on-demand loading) you must call
26960 // g_type_module_unuse() on all the modules. Free the list
26961 // with g_list_free().
26962 // RETURNS: a list of #GIOModules loaded
26963 // <dirname>: pathname for a directory containing modules to load.
26964 // <scope>: a scope to use when scanning the modules.
26965 static GLib2.List* /*new*/ io_modules_load_all_in_directory_with_scope()(char* dirname, IOModuleScope* scope_) {
26966 return g_io_modules_load_all_in_directory_with_scope(dirname, scope_);
26970 // VERSION: 2.24
26971 // Scans all the modules in the specified directory, ensuring that
26972 // any extension point implemented by a module is registered.
26974 // This may not actually load and initialize all the types in each
26975 // module, some modules may be lazily loaded and initialized when
26976 // an extension point it implementes is used with e.g.
26977 // g_io_extension_point_get_extensions() or
26978 // g_io_extension_point_get_extension_by_name().
26980 // If you need to guarantee that all types are loaded in all the modules,
26981 // use g_io_modules_load_all_in_directory().
26982 // <dirname>: pathname for a directory containing modules to scan.
26983 static void io_modules_scan_all_in_directory()(char* dirname) {
26984 g_io_modules_scan_all_in_directory(dirname);
26988 // VERSION: 2.30
26989 // Scans all the modules in the specified directory, ensuring that
26990 // any extension point implemented by a module is registered.
26992 // This may not actually load and initialize all the types in each
26993 // module, some modules may be lazily loaded and initialized when
26994 // an extension point it implementes is used with e.g.
26995 // g_io_extension_point_get_extensions() or
26996 // g_io_extension_point_get_extension_by_name().
26998 // If you need to guarantee that all types are loaded in all the modules,
26999 // use g_io_modules_load_all_in_directory().
27000 // <dirname>: pathname for a directory containing modules to scan.
27001 // <scope>: a scope to use when scanning the modules
27002 static void io_modules_scan_all_in_directory_with_scope()(char* dirname, IOModuleScope* scope_) {
27003 g_io_modules_scan_all_in_directory_with_scope(dirname, scope_);
27007 // Cancels all cancellable I/O jobs.
27009 // A job is cancellable if a #GCancellable was passed into
27010 // g_io_scheduler_push_job().
27011 static void io_scheduler_cancel_all_jobs()() {
27012 g_io_scheduler_cancel_all_jobs();
27016 // Schedules the I/O job to run in another thread.
27018 // @notify will be called on @user_data after @job_func has returned,
27019 // regardless whether the job was cancelled or has run to completion.
27021 // If @cancellable is not %NULL, it can be used to cancel the I/O job
27022 // by calling g_cancellable_cancel() or by calling
27023 // g_io_scheduler_cancel_all_jobs().
27024 // <job_func>: a #GIOSchedulerJobFunc.
27025 // <user_data>: data to pass to @job_func
27026 // <notify>: a #GDestroyNotify for @user_data, or %NULL
27027 // <io_priority>: the <link linkend="gioscheduler">I/O priority</link> of the request.
27028 // <cancellable>: optional #GCancellable object, %NULL to ignore.
27029 static void io_scheduler_push_job()(IOSchedulerJobFunc job_func, void* user_data, GLib2.DestroyNotify notify, int io_priority, Cancellable* cancellable=null) {
27030 g_io_scheduler_push_job(job_func, user_data, notify, io_priority, cancellable);
27034 // VERSION: 2.32
27035 // MOVED TO: NetworkMonitor.get_default
27036 // Gets the default #GNetworkMonitor for the system.
27037 // RETURNS: a #GNetworkMonitor
27038 static NetworkMonitor* network_monitor_get_default()() {
27039 return g_network_monitor_get_default();
27043 // VERSION: 2.28
27044 // Utility method for #GPollableInputStream and #GPollableOutputStream
27045 // implementations. Creates a new #GSource that expects a callback of
27046 // type #GPollableSourceFunc. The new source does not actually do
27047 // anything on its own; use g_source_add_child_source() to add other
27048 // sources to it to cause it to trigger.
27049 // RETURNS: the new #GSource.
27050 // <pollable_stream>: the stream associated with the new source
27051 static GLib2.Source* /*new*/ pollable_source_new()(GObject2.Object* pollable_stream) {
27052 return g_pollable_source_new(pollable_stream);
27056 // VERSION: 2.26
27057 // MOVED TO: Proxy.get_default_for_protocol
27058 // Lookup "gio-proxy" extension point for a proxy implementation that supports
27059 // specified protocol.
27061 // is not supported.
27062 // RETURNS: return a #GProxy or NULL if protocol
27063 // <protocol>: the proxy protocol name (e.g. http, socks, etc)
27064 static Proxy* /*new*/ proxy_get_default_for_protocol()(char* protocol) {
27065 return g_proxy_get_default_for_protocol(protocol);
27069 // VERSION: 2.26
27070 // MOVED TO: ProxyResolver.get_default
27071 // Gets the default #GProxyResolver for the system.
27072 // RETURNS: the default #GProxyResolver.
27073 static ProxyResolver* proxy_resolver_get_default()() {
27074 return g_proxy_resolver_get_default();
27078 // VERSION: 2.22
27079 // MOVED TO: ResolverError.quark
27080 // Gets the #GResolver Error Quark.
27081 // RETURNS: a #GQuark.
27082 static GLib2.Quark resolver_error_quark()() {
27083 return g_resolver_error_quark();
27087 // VERSION: 2.32
27088 // MOVED TO: ResourceError.quark
27089 // Gets the #GResource Error Quark.
27090 // RETURNS: a #GQuark.
27091 static GLib2.Quark resource_error_quark()() {
27092 return g_resource_error_quark();
27096 // VERSION: 2.32
27097 // MOVED TO: Resource.load
27098 // Loads a binary resource bundle and creates a #GResource representation of it, allowing
27099 // you to query it for data.
27101 // If you want to use this resource in the global resource namespace you need
27102 // to register it with g_resources_register().
27103 // RETURNS: a new #GResource, or %NULL on error.
27104 // <filename>: the path of a filename to load, in the GLib filename encoding.
27105 static Resource* /*new*/ resource_load()(char* filename, GLib2.Error** error=null) {
27106 return g_resource_load(filename, error);
27110 // VERSION: 2.32
27111 // Returns all the names of children at the specified @path in the set of
27112 // globally registred resources.
27113 // The return result is a %NULL terminated list of strings which should
27114 // be released with g_strfreev().
27116 // @lookup_flags controls the behaviour of the lookup.
27117 // RETURNS: an array of constant strings
27118 // <path>: A pathname inside the resource.
27119 // <lookup_flags>: A #GResourceLookupFlags.
27120 static char** /*new*/ resources_enumerate_children()(char* path, ResourceLookupFlags lookup_flags, GLib2.Error** error=null) {
27121 return g_resources_enumerate_children(path, lookup_flags, error);
27125 // VERSION: 2.32
27126 // Looks for a file at the specified @path in the set of
27127 // globally registred resources and if found returns information about it.
27129 // @lookup_flags controls the behaviour of the lookup.
27130 // RETURNS: %TRUE if the file was found. %FALSE if there were errors.
27131 // <path>: A pathname inside the resource.
27132 // <lookup_flags>: A #GResourceLookupFlags.
27133 // <size>: a location to place the length of the contents of the file, or %NULL if the length is not needed
27134 // <flags>: a location to place the flags about the file, or %NULL if the length is not needed
27135 static int resources_get_info()(char* path, ResourceLookupFlags lookup_flags, /*out*/ size_t* size, /*out*/ uint* flags, GLib2.Error** error=null) {
27136 return g_resources_get_info(path, lookup_flags, size, flags, error);
27140 // VERSION: 2.32
27141 // Looks for a file at the specified @path in the set of
27142 // globally registred resources and returns a #GBytes that
27143 // lets you directly access the data in memory.
27145 // The data is always followed by a zero byte, so you
27146 // can safely use the data as a C string. However, that byte
27147 // is not included in the size of the GBytes.
27149 // For uncompressed resource files this is a pointer directly into
27150 // the resource bundle, which is typically in some readonly data section
27151 // in the program binary. For compressed files we allocate memory on
27152 // the heap and automatically uncompress the data.
27154 // @lookup_flags controls the behaviour of the lookup.
27156 // Free the returned object with g_bytes_unref().
27157 // RETURNS: #GBytes or %NULL on error.
27158 // <path>: A pathname inside the resource.
27159 // <lookup_flags>: A #GResourceLookupFlags.
27160 static GLib2.Bytes* /*new*/ resources_lookup_data()(char* path, ResourceLookupFlags lookup_flags, GLib2.Error** error=null) {
27161 return g_resources_lookup_data(path, lookup_flags, error);
27165 // VERSION: 2.32
27166 // Looks for a file at the specified @path in the set of
27167 // globally registred resources and returns a #GInputStream
27168 // that lets you read the data.
27170 // @lookup_flags controls the behaviour of the lookup.
27172 // Free the returned object with g_object_unref().
27173 // RETURNS: #GInputStream or %NULL on error.
27174 // <path>: A pathname inside the resource.
27175 // <lookup_flags>: A #GResourceLookupFlags.
27176 static InputStream* /*new*/ resources_open_stream()(char* path, ResourceLookupFlags lookup_flags, GLib2.Error** error=null) {
27177 return g_resources_open_stream(path, lookup_flags, error);
27181 // VERSION: 2.32
27182 // MOVED TO: SettingsSchemaSource.get_default
27183 // Gets the default system schema source.
27185 // This function is not required for normal uses of #GSettings but it
27186 // may be useful to authors of plugin management systems or to those who
27187 // want to introspect the content of schemas.
27189 // If no schemas are installed, %NULL will be returned.
27191 // The returned source may actually consist of multiple schema sources
27192 // from different directories, depending on which directories were given
27193 // in <envar>XDG_DATA_DIRS</envar> and
27194 // <envar>GSETTINGS_SCHEMA_DIR</envar>. For this reason, all lookups
27195 // performed against the default source should probably be done
27196 // recursively.
27197 // RETURNS: the default schema source
27198 static SettingsSchemaSource* settings_schema_source_get_default()() {
27199 return g_settings_schema_source_get_default();
27203 // Unintrospectable function: simple_async_report_error_in_idle() / g_simple_async_report_error_in_idle()
27204 // Reports an error in an asynchronous function in an idle function by
27205 // directly setting the contents of the #GAsyncResult with the given error
27206 // information.
27207 // <object>: a #GObject, or %NULL.
27208 // <callback>: a #GAsyncReadyCallback.
27209 // <user_data>: user data passed to @callback.
27210 // <domain>: a #GQuark containing the error domain (usually #G_IO_ERROR).
27211 // <code>: a specific error code.
27212 // <format>: a formatted error reporting string.
27213 alias g_simple_async_report_error_in_idle simple_async_report_error_in_idle; // Variadic
27216 // Reports an error in an idle function. Similar to
27217 // g_simple_async_report_error_in_idle(), but takes a #GError rather
27218 // than building a new one.
27219 // <object>: a #GObject, or %NULL
27220 // <callback>: a #GAsyncReadyCallback.
27221 // <user_data>: user data passed to @callback.
27222 // <error>: the #GError to report
27223 static void simple_async_report_gerror_in_idle()(GObject2.Object* object, AsyncReadyCallback callback, void* user_data, GLib2.Error* error) {
27224 g_simple_async_report_gerror_in_idle(object, callback, user_data, error);
27228 // Unintrospectable function: simple_async_report_take_gerror_in_idle() / g_simple_async_report_take_gerror_in_idle()
27229 // VERSION: 2.28
27230 // Reports an error in an idle function. Similar to
27231 // g_simple_async_report_gerror_in_idle(), but takes over the caller's
27232 // ownership of @error, so the caller does not have to free it any more.
27233 // <object>: a #GObject, or %NULL
27234 // <callback>: a #GAsyncReadyCallback.
27235 // <user_data>: user data passed to @callback.
27236 // <error>: the #GError to report
27237 static void simple_async_report_take_gerror_in_idle()(GObject2.Object* object, AsyncReadyCallback callback, void* user_data, GLib2.Error* error) {
27238 g_simple_async_report_take_gerror_in_idle(object, callback, user_data, error);
27242 // Unintrospectable function: srv_target_list_sort() / g_srv_target_list_sort()
27243 // VERSION: 2.22
27244 // MOVED TO: SrvTarget.list_sort
27245 // Sorts @targets in place according to the algorithm in RFC 2782.
27246 // RETURNS: the head of the sorted list.
27247 // <targets>: a #GList of #GSrvTarget
27248 static GLib2.List* /*new*/ srv_target_list_sort()(GLib2.List* targets) {
27249 return g_srv_target_list_sort(targets);
27253 // VERSION: 2.28
27254 // MOVED TO: TlsBackend.get_default
27255 // Gets the default #GTlsBackend for the system.
27256 // RETURNS: a #GTlsBackend
27257 static TlsBackend* tls_backend_get_default()() {
27258 return g_tls_backend_get_default();
27262 // VERSION: 2.28
27263 // MOVED TO: TlsClientConnection.new
27264 // Creates a new #GTlsClientConnection wrapping @base_io_stream (which
27265 // must have pollable input and output streams) which is assumed to
27266 // communicate with the server identified by @server_identity.
27268 // #GTlsClientConnection, or %NULL on error
27269 // RETURNS: the new
27270 // <base_io_stream>: the #GIOStream to wrap
27271 // <server_identity>: the expected identity of the server
27272 static TlsClientConnection* /*new*/ tls_client_connection_new()(IOStream* base_io_stream, SocketConnectable* server_identity, GLib2.Error** error=null) {
27273 return g_tls_client_connection_new(base_io_stream, server_identity, error);
27277 // VERSION: 2.28
27278 // MOVED TO: TlsError.quark
27279 // Gets the TLS error quark.
27280 // RETURNS: a #GQuark.
27281 static GLib2.Quark tls_error_quark()() {
27282 return g_tls_error_quark();
27286 // VERSION: 2.30
27287 // MOVED TO: TlsFileDatabase.new
27288 // Creates a new #GTlsFileDatabase which uses anchor certificate authorities
27289 // in @anchors to verify certificate chains.
27291 // The certificates in @anchors must be PEM encoded.
27293 // #GTlsFileDatabase, or %NULL on error
27294 // RETURNS: the new
27295 // <anchors>: filename of anchor certificate authorities.
27296 static TlsFileDatabase* /*new*/ tls_file_database_new()(char* anchors, GLib2.Error** error=null) {
27297 return g_tls_file_database_new(anchors, error);
27301 // VERSION: 2.28
27302 // MOVED TO: TlsServerConnection.new
27303 // Creates a new #GTlsServerConnection wrapping @base_io_stream (which
27304 // must have pollable input and output streams).
27306 // #GTlsServerConnection, or %NULL on error
27307 // RETURNS: the new
27308 // <base_io_stream>: the #GIOStream to wrap
27309 // <certificate>: the default server certificate, or %NULL
27310 static TlsServerConnection* /*new*/ tls_server_connection_new()(IOStream* base_io_stream, TlsCertificate* certificate, GLib2.Error** error=null) {
27311 return g_tls_server_connection_new(base_io_stream, certificate, error);
27315 // Determines if @mount_path is considered an implementation of the
27316 // OS. This is primarily used for hiding mountable and mounted volumes
27317 // that only are used in the OS and has little to no relevance to the
27318 // casual user.
27320 // of the OS.
27321 // RETURNS: %TRUE if @mount_path is considered an implementation detail
27322 // <mount_path>: a mount path, e.g. <filename>/media/disk</filename> or <filename>/usr</filename>
27323 static int unix_is_mount_path_system_internal()(char* mount_path) {
27324 return g_unix_is_mount_path_system_internal(mount_path);
27328 // Unintrospectable function: unix_mount_at() / g_unix_mount_at()
27329 // Gets a #GUnixMountEntry for a given mount path. If @time_read
27330 // is set, it will be filled with a unix timestamp for checking
27331 // if the mounts have changed since with g_unix_mounts_changed_since().
27332 // RETURNS: a #GUnixMountEntry.
27333 // <mount_path>: path for a possible unix mount.
27334 // <time_read>: guint64 to contain a timestamp.
27335 static UnixMountEntry* /*new*/ unix_mount_at()(char* mount_path, /*out*/ ulong* time_read=null) {
27336 return g_unix_mount_at(mount_path, time_read);
27340 // Compares two unix mounts.
27342 // or less than @mount2, respectively.
27343 // RETURNS: 1, 0 or -1 if @mount1 is greater than, equal to,
27344 // <mount1>: first #GUnixMountEntry to compare.
27345 // <mount2>: second #GUnixMountEntry to compare.
27346 static int unix_mount_compare()(UnixMountEntry* mount1, UnixMountEntry* mount2) {
27347 return g_unix_mount_compare(mount1, mount2);
27351 // Frees a unix mount.
27352 // <mount_entry>: a #GUnixMount.
27353 static void unix_mount_free()(UnixMountEntry* mount_entry) {
27354 g_unix_mount_free(mount_entry);
27358 // Gets the device path for a unix mount.
27359 // RETURNS: a string containing the device path.
27360 // <mount_entry>: a #GUnixMount.
27361 static char* unix_mount_get_device_path()(UnixMountEntry* mount_entry) {
27362 return g_unix_mount_get_device_path(mount_entry);
27366 // Gets the filesystem type for the unix mount.
27367 // RETURNS: a string containing the file system type.
27368 // <mount_entry>: a #GUnixMount.
27369 static char* unix_mount_get_fs_type()(UnixMountEntry* mount_entry) {
27370 return g_unix_mount_get_fs_type(mount_entry);
27374 // Gets the mount path for a unix mount.
27375 // RETURNS: the mount path for @mount_entry.
27376 // <mount_entry>: input #GUnixMountEntry to get the mount path for.
27377 static char* unix_mount_get_mount_path()(UnixMountEntry* mount_entry) {
27378 return g_unix_mount_get_mount_path(mount_entry);
27382 // Guesses whether a Unix mount can be ejected.
27383 // RETURNS: %TRUE if @mount_entry is deemed to be ejectable.
27384 // <mount_entry>: a #GUnixMountEntry
27385 static int unix_mount_guess_can_eject()(UnixMountEntry* mount_entry) {
27386 return g_unix_mount_guess_can_eject(mount_entry);
27390 // Guesses the icon of a Unix mount.
27391 // RETURNS: a #GIcon
27392 // <mount_entry>: a #GUnixMountEntry
27393 static Icon* /*new*/ unix_mount_guess_icon()(UnixMountEntry* mount_entry) {
27394 return g_unix_mount_guess_icon(mount_entry);
27398 // Guesses the name of a Unix mount.
27399 // The result is a translated string.
27401 // be freed with g_free()
27402 // RETURNS: A newly allocated string that must
27403 // <mount_entry>: a #GUnixMountEntry
27404 static char* /*new*/ unix_mount_guess_name()(UnixMountEntry* mount_entry) {
27405 return g_unix_mount_guess_name(mount_entry);
27409 // Guesses whether a Unix mount should be displayed in the UI.
27410 // RETURNS: %TRUE if @mount_entry is deemed to be displayable.
27411 // <mount_entry>: a #GUnixMountEntry
27412 static int unix_mount_guess_should_display()(UnixMountEntry* mount_entry) {
27413 return g_unix_mount_guess_should_display(mount_entry);
27417 // Checks if a unix mount is mounted read only.
27418 // RETURNS: %TRUE if @mount_entry is read only.
27419 // <mount_entry>: a #GUnixMount.
27420 static int unix_mount_is_readonly()(UnixMountEntry* mount_entry) {
27421 return g_unix_mount_is_readonly(mount_entry);
27425 // Checks if a unix mount is a system path.
27426 // RETURNS: %TRUE if the unix mount is for a system path.
27427 // <mount_entry>: a #GUnixMount.
27428 static int unix_mount_is_system_internal()(UnixMountEntry* mount_entry) {
27429 return g_unix_mount_is_system_internal(mount_entry);
27433 // Checks if the unix mount points have changed since a given unix time.
27434 // RETURNS: %TRUE if the mount points have changed since @time.
27435 // <time>: guint64 to contain a timestamp.
27436 static int unix_mount_points_changed_since()(ulong time) {
27437 return g_unix_mount_points_changed_since(time);
27441 // Unintrospectable function: unix_mount_points_get() / g_unix_mount_points_get()
27442 // Gets a #GList of #GUnixMountPoint containing the unix mount points.
27443 // If @time_read is set, it will be filled with the mount timestamp,
27444 // allowing for checking if the mounts have changed with
27445 // g_unix_mount_points_changed_since().
27447 // a #GList of the UNIX mountpoints.
27448 // <time_read>: guint64 to contain a timestamp.
27449 static GLib2.List* /*new*/ unix_mount_points_get()(/*out*/ ulong* time_read=null) {
27450 return g_unix_mount_points_get(time_read);
27454 // Checks if the unix mounts have changed since a given unix time.
27455 // RETURNS: %TRUE if the mounts have changed since @time.
27456 // <time>: guint64 to contain a timestamp.
27457 static int unix_mounts_changed_since()(ulong time) {
27458 return g_unix_mounts_changed_since(time);
27462 // Unintrospectable function: unix_mounts_get() / g_unix_mounts_get()
27463 // Gets a #GList of #GUnixMountEntry containing the unix mounts.
27464 // If @time_read is set, it will be filled with the mount
27465 // timestamp, allowing for checking if the mounts have changed
27466 // with g_unix_mounts_changed_since().
27468 // a #GList of the UNIX mounts.
27469 // <time_read>: guint64 to contain a timestamp, or %NULL
27470 static GLib2.List* /*new*/ unix_mounts_get()(/*out*/ ulong* time_read=null) {
27471 return g_unix_mounts_get(time_read);
27475 // C prototypes:
27477 extern (C) {
27478 void g_action_activate(Action* this_, GLib2.Variant* parameter=null);
27479 void g_action_change_state(Action* this_, GLib2.Variant* value);
27480 int g_action_get_enabled(Action* this_);
27481 char* g_action_get_name(Action* this_);
27482 GLib2.VariantType* g_action_get_parameter_type(Action* this_);
27483 GLib2.Variant* /*new*/ g_action_get_state(Action* this_);
27484 GLib2.Variant* /*new*/ g_action_get_state_hint(Action* this_);
27485 GLib2.VariantType* g_action_get_state_type(Action* this_);
27486 void g_action_group_action_added(ActionGroup* this_, char* action_name);
27487 void g_action_group_action_enabled_changed(ActionGroup* this_, char* action_name, int enabled);
27488 void g_action_group_action_removed(ActionGroup* this_, char* action_name);
27489 void g_action_group_action_state_changed(ActionGroup* this_, char* action_name, GLib2.Variant* state);
27490 void g_action_group_activate_action(ActionGroup* this_, char* action_name, GLib2.Variant* parameter=null);
27491 void g_action_group_change_action_state(ActionGroup* this_, char* action_name, GLib2.Variant* value);
27492 int g_action_group_get_action_enabled(ActionGroup* this_, char* action_name);
27493 GLib2.VariantType* g_action_group_get_action_parameter_type(ActionGroup* this_, char* action_name);
27494 GLib2.Variant* /*new*/ g_action_group_get_action_state(ActionGroup* this_, char* action_name);
27495 GLib2.Variant* /*new*/ g_action_group_get_action_state_hint(ActionGroup* this_, char* action_name);
27496 GLib2.VariantType* /*new*/ g_action_group_get_action_state_type(ActionGroup* this_, char* action_name);
27497 int g_action_group_has_action(ActionGroup* this_, char* action_name);
27498 char** /*new*/ g_action_group_list_actions(ActionGroup* this_);
27499 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);
27500 void g_action_map_add_action(ActionMap* this_, Action* action);
27501 void g_action_map_add_action_entries(ActionMap* this_, ActionEntry* entries, int n_entries, void* user_data);
27502 Action* g_action_map_lookup_action(ActionMap* this_, char* action_name);
27503 void g_action_map_remove_action(ActionMap* this_, char* action_name);
27504 AppInfo* /*new*/ g_app_info_create_from_commandline(char* commandline, char* application_name, AppInfoCreateFlags flags, GLib2.Error** error);
27505 GLib2.List* /*new*/ g_app_info_get_all();
27506 GLib2.List* /*new*/ g_app_info_get_all_for_type(char* content_type);
27507 AppInfo* /*new*/ g_app_info_get_default_for_type(char* content_type, int must_support_uris);
27508 AppInfo* /*new*/ g_app_info_get_default_for_uri_scheme(char* uri_scheme);
27509 GLib2.List* /*new*/ g_app_info_get_fallback_for_type(char* content_type);
27510 GLib2.List* /*new*/ g_app_info_get_recommended_for_type(char* content_type);
27511 int g_app_info_launch_default_for_uri(char* uri, AppLaunchContext* launch_context, GLib2.Error** error);
27512 void g_app_info_reset_type_associations(char* content_type);
27513 int g_app_info_add_supports_type(AppInfo* this_, char* content_type, GLib2.Error** error);
27514 int g_app_info_can_delete(AppInfo* this_);
27515 int g_app_info_can_remove_supports_type(AppInfo* this_);
27516 int g_app_info_delete(AppInfo* this_);
27517 AppInfo* /*new*/ g_app_info_dup(AppInfo* this_);
27518 int g_app_info_equal(AppInfo* this_, AppInfo* appinfo2);
27519 char* g_app_info_get_commandline(AppInfo* this_);
27520 char* g_app_info_get_description(AppInfo* this_);
27521 char* g_app_info_get_display_name(AppInfo* this_);
27522 char* g_app_info_get_executable(AppInfo* this_);
27523 Icon* g_app_info_get_icon(AppInfo* this_);
27524 char* g_app_info_get_id(AppInfo* this_);
27525 char* g_app_info_get_name(AppInfo* this_);
27526 int g_app_info_launch(AppInfo* this_, GLib2.List* files, AppLaunchContext* launch_context, GLib2.Error** error);
27527 int g_app_info_launch_uris(AppInfo* this_, GLib2.List* uris, AppLaunchContext* launch_context, GLib2.Error** error);
27528 int g_app_info_remove_supports_type(AppInfo* this_, char* content_type, GLib2.Error** error);
27529 int g_app_info_set_as_default_for_extension(AppInfo* this_, char* extension, GLib2.Error** error);
27530 int g_app_info_set_as_default_for_type(AppInfo* this_, char* content_type, GLib2.Error** error);
27531 int g_app_info_set_as_last_used_for_type(AppInfo* this_, char* content_type, GLib2.Error** error);
27532 int g_app_info_should_show(AppInfo* this_);
27533 int g_app_info_supports_files(AppInfo* this_);
27534 int g_app_info_supports_uris(AppInfo* this_);
27535 AppLaunchContext* /*new*/ g_app_launch_context_new();
27536 char* /*new*/ g_app_launch_context_get_display(AppLaunchContext* this_, AppInfo* info, GLib2.List* files);
27537 char** /*new*/ g_app_launch_context_get_environment(AppLaunchContext* this_);
27538 char* /*new*/ g_app_launch_context_get_startup_notify_id(AppLaunchContext* this_, AppInfo* info, GLib2.List* files);
27539 void g_app_launch_context_launch_failed(AppLaunchContext* this_, char* startup_notify_id);
27540 void g_app_launch_context_setenv(AppLaunchContext* this_, char* variable, char* value);
27541 void g_app_launch_context_unsetenv(AppLaunchContext* this_, char* variable);
27542 Application* /*new*/ g_application_new(char* application_id, ApplicationFlags flags);
27543 Application* g_application_get_default();
27544 int g_application_id_is_valid(char* application_id);
27545 void g_application_activate(Application* this_);
27546 char* g_application_get_application_id(Application* this_);
27547 ApplicationFlags g_application_get_flags(Application* this_);
27548 uint g_application_get_inactivity_timeout(Application* this_);
27549 int g_application_get_is_registered(Application* this_);
27550 int g_application_get_is_remote(Application* this_);
27551 void g_application_hold(Application* this_);
27552 void g_application_open(Application* this_, File** files, int n_files, char* hint);
27553 int g_application_register(Application* this_, Cancellable* cancellable, GLib2.Error** error);
27554 void g_application_release(Application* this_);
27555 int g_application_run(Application* this_, int argc, char** argv=null);
27556 void g_application_set_action_group(Application* this_, ActionGroup* action_group=null);
27557 void g_application_set_application_id(Application* this_, char* application_id);
27558 void g_application_set_default(Application* this_);
27559 void g_application_set_flags(Application* this_, ApplicationFlags flags);
27560 void g_application_set_inactivity_timeout(Application* this_, uint inactivity_timeout);
27561 char** /*new*/ g_application_command_line_get_arguments(ApplicationCommandLine* this_, /*out*/ int* argc);
27562 char* g_application_command_line_get_cwd(ApplicationCommandLine* this_);
27563 char** g_application_command_line_get_environ(ApplicationCommandLine* this_);
27564 int g_application_command_line_get_exit_status(ApplicationCommandLine* this_);
27565 int g_application_command_line_get_is_remote(ApplicationCommandLine* this_);
27566 GLib2.Variant* /*new*/ g_application_command_line_get_platform_data(ApplicationCommandLine* this_);
27567 char* g_application_command_line_getenv(ApplicationCommandLine* this_, char* name);
27568 void g_application_command_line_print(ApplicationCommandLine* this_, char* format, ...);
27569 void g_application_command_line_printerr(ApplicationCommandLine* this_, char* format, ...);
27570 void g_application_command_line_set_exit_status(ApplicationCommandLine* this_, int exit_status);
27571 void g_async_initable_new_async(Type object_type, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data, char* first_property_name, ...);
27572 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);
27573 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);
27574 void g_async_initable_init_async(AsyncInitable* this_, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
27575 int g_async_initable_init_finish(AsyncInitable* this_, AsyncResult* res, GLib2.Error** error);
27576 GObject2.Object* /*new*/ g_async_initable_new_finish(AsyncInitable* this_, AsyncResult* res, GLib2.Error** error);
27577 GObject2.Object* /*new*/ g_async_result_get_source_object(AsyncResult* this_);
27578 void* /*new*/ g_async_result_get_user_data(AsyncResult* this_);
27579 BufferedInputStream* /*new*/ g_buffered_input_stream_new(InputStream* base_stream);
27580 BufferedInputStream* /*new*/ g_buffered_input_stream_new_sized(InputStream* base_stream, size_t size);
27581 ssize_t g_buffered_input_stream_fill(BufferedInputStream* this_, ssize_t count, Cancellable* cancellable, GLib2.Error** error);
27582 void g_buffered_input_stream_fill_async(BufferedInputStream* this_, ssize_t count, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
27583 ssize_t g_buffered_input_stream_fill_finish(BufferedInputStream* this_, AsyncResult* result, GLib2.Error** error);
27584 size_t g_buffered_input_stream_get_available(BufferedInputStream* this_);
27585 size_t g_buffered_input_stream_get_buffer_size(BufferedInputStream* this_);
27586 size_t g_buffered_input_stream_peek(BufferedInputStream* this_, ubyte* buffer, size_t offset, size_t count);
27587 ubyte* g_buffered_input_stream_peek_buffer(BufferedInputStream* this_, /*out*/ size_t* count);
27588 int g_buffered_input_stream_read_byte(BufferedInputStream* this_, Cancellable* cancellable, GLib2.Error** error);
27589 void g_buffered_input_stream_set_buffer_size(BufferedInputStream* this_, size_t size);
27590 BufferedOutputStream* /*new*/ g_buffered_output_stream_new(OutputStream* base_stream);
27591 BufferedOutputStream* /*new*/ g_buffered_output_stream_new_sized(OutputStream* base_stream, size_t size);
27592 int g_buffered_output_stream_get_auto_grow(BufferedOutputStream* this_);
27593 size_t g_buffered_output_stream_get_buffer_size(BufferedOutputStream* this_);
27594 void g_buffered_output_stream_set_auto_grow(BufferedOutputStream* this_, int auto_grow);
27595 void g_buffered_output_stream_set_buffer_size(BufferedOutputStream* this_, size_t size);
27596 Cancellable* /*new*/ g_cancellable_new();
27597 Cancellable* g_cancellable_get_current();
27598 void g_cancellable_cancel(Cancellable* this_);
27599 c_ulong g_cancellable_connect(Cancellable* this_, GObject2.Callback callback, void* data, GLib2.DestroyNotify data_destroy_func);
27600 void g_cancellable_disconnect(Cancellable* this_, c_ulong handler_id);
27601 int g_cancellable_get_fd(Cancellable* this_);
27602 int g_cancellable_is_cancelled(Cancellable* this_);
27603 int g_cancellable_make_pollfd(Cancellable* this_, GLib2.PollFD* pollfd);
27604 void g_cancellable_pop_current(Cancellable* this_);
27605 void g_cancellable_push_current(Cancellable* this_);
27606 void g_cancellable_release_fd(Cancellable* this_);
27607 void g_cancellable_reset(Cancellable* this_);
27608 int g_cancellable_set_error_if_cancelled(Cancellable* this_, GLib2.Error** error);
27609 GLib2.Source* /*new*/ g_cancellable_source_new(Cancellable* this_);
27610 CharsetConverter* /*new*/ g_charset_converter_new(char* to_charset, char* from_charset, GLib2.Error** error);
27611 uint g_charset_converter_get_num_fallbacks(CharsetConverter* this_);
27612 int g_charset_converter_get_use_fallback(CharsetConverter* this_);
27613 void g_charset_converter_set_use_fallback(CharsetConverter* this_, int use_fallback);
27614 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);
27615 void g_converter_reset(Converter* this_);
27616 ConverterInputStream* /*new*/ g_converter_input_stream_new(InputStream* base_stream, Converter* converter);
27617 Converter* g_converter_input_stream_get_converter(ConverterInputStream* this_);
27618 ConverterOutputStream* /*new*/ g_converter_output_stream_new(OutputStream* base_stream, Converter* converter);
27619 Converter* g_converter_output_stream_get_converter(ConverterOutputStream* this_);
27620 Credentials* /*new*/ g_credentials_new();
27621 void* g_credentials_get_native(Credentials* this_, CredentialsType native_type);
27622 uint g_credentials_get_unix_user(Credentials* this_, GLib2.Error** error);
27623 int g_credentials_is_same_user(Credentials* this_, Credentials* other_credentials, GLib2.Error** error);
27624 void g_credentials_set_native(Credentials* this_, CredentialsType native_type, void* native);
27625 int g_credentials_set_unix_user(Credentials* this_, uint uid, GLib2.Error** error);
27626 char* /*new*/ g_credentials_to_string(Credentials* this_);
27627 DBusActionGroup* /*new*/ g_dbus_action_group_get(DBusConnection* connection, char* bus_name, char* object_path);
27628 DBusAnnotationInfo* /*new*/ g_dbus_annotation_info_ref(DBusAnnotationInfo* this_);
27629 void g_dbus_annotation_info_unref(DBusAnnotationInfo* this_);
27630 char* g_dbus_annotation_info_lookup(DBusAnnotationInfo** annotations, char* name);
27631 DBusArgInfo* /*new*/ g_dbus_arg_info_ref(DBusArgInfo* this_);
27632 void g_dbus_arg_info_unref(DBusArgInfo* this_);
27633 DBusAuthObserver* /*new*/ g_dbus_auth_observer_new();
27634 int g_dbus_auth_observer_authorize_authenticated_peer(DBusAuthObserver* this_, IOStream* stream, Credentials* credentials);
27635 DBusConnection* /*new*/ g_dbus_connection_new_finish(AsyncResult* res, GLib2.Error** error);
27636 DBusConnection* /*new*/ g_dbus_connection_new_for_address_finish(AsyncResult* res, GLib2.Error** error);
27637 DBusConnection* /*new*/ g_dbus_connection_new_for_address_sync(char* address, DBusConnectionFlags flags, DBusAuthObserver* observer, Cancellable* cancellable, GLib2.Error** error);
27638 DBusConnection* /*new*/ g_dbus_connection_new_sync(IOStream* stream, char* guid, DBusConnectionFlags flags, DBusAuthObserver* observer, Cancellable* cancellable, GLib2.Error** error);
27639 void g_dbus_connection_new(IOStream* stream, char* guid, DBusConnectionFlags flags, DBusAuthObserver* observer, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
27640 void g_dbus_connection_new_for_address(char* address, DBusConnectionFlags flags, DBusAuthObserver* observer, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
27641 uint g_dbus_connection_add_filter(DBusConnection* this_, DBusMessageFilterFunction filter_function, void* user_data, GLib2.DestroyNotify user_data_free_func);
27642 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);
27643 GLib2.Variant* /*new*/ g_dbus_connection_call_finish(DBusConnection* this_, AsyncResult* res, GLib2.Error** error);
27644 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);
27645 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);
27646 GLib2.Variant* /*new*/ g_dbus_connection_call_with_unix_fd_list_finish(DBusConnection* this_, /*out*/ UnixFDList** out_fd_list, AsyncResult* res, GLib2.Error** error);
27647 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);
27648 void g_dbus_connection_close(DBusConnection* this_, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
27649 int g_dbus_connection_close_finish(DBusConnection* this_, AsyncResult* res, GLib2.Error** error);
27650 int g_dbus_connection_close_sync(DBusConnection* this_, Cancellable* cancellable, GLib2.Error** error);
27651 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);
27652 uint g_dbus_connection_export_action_group(DBusConnection* this_, char* object_path, ActionGroup* action_group, GLib2.Error** error);
27653 uint g_dbus_connection_export_menu_model(DBusConnection* this_, char* object_path, MenuModel* menu, GLib2.Error** error);
27654 void g_dbus_connection_flush(DBusConnection* this_, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
27655 int g_dbus_connection_flush_finish(DBusConnection* this_, AsyncResult* res, GLib2.Error** error);
27656 int g_dbus_connection_flush_sync(DBusConnection* this_, Cancellable* cancellable, GLib2.Error** error);
27657 DBusCapabilityFlags g_dbus_connection_get_capabilities(DBusConnection* this_);
27658 int g_dbus_connection_get_exit_on_close(DBusConnection* this_);
27659 char* g_dbus_connection_get_guid(DBusConnection* this_);
27660 Credentials* g_dbus_connection_get_peer_credentials(DBusConnection* this_);
27661 IOStream* g_dbus_connection_get_stream(DBusConnection* this_);
27662 char* g_dbus_connection_get_unique_name(DBusConnection* this_);
27663 int g_dbus_connection_is_closed(DBusConnection* this_);
27664 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);
27665 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);
27666 void g_dbus_connection_remove_filter(DBusConnection* this_, uint filter_id);
27667 int g_dbus_connection_send_message(DBusConnection* this_, DBusMessage* message, DBusSendMessageFlags flags, /*out*/ uint* out_serial, GLib2.Error** error);
27668 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);
27669 DBusMessage* /*new*/ g_dbus_connection_send_message_with_reply_finish(DBusConnection* this_, AsyncResult* res, GLib2.Error** error);
27670 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);
27671 void g_dbus_connection_set_exit_on_close(DBusConnection* this_, int exit_on_close);
27672 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);
27673 void g_dbus_connection_signal_unsubscribe(DBusConnection* this_, uint subscription_id);
27674 void g_dbus_connection_start_message_processing(DBusConnection* this_);
27675 void g_dbus_connection_unexport_action_group(DBusConnection* this_, uint export_id);
27676 void g_dbus_connection_unexport_menu_model(DBusConnection* this_, uint export_id);
27677 int g_dbus_connection_unregister_object(DBusConnection* this_, uint registration_id);
27678 int g_dbus_connection_unregister_subtree(DBusConnection* this_, uint registration_id);
27679 DBusObject* g_dbus_interface_dup_object(DBusInterface* this_);
27680 DBusInterfaceInfo* g_dbus_interface_get_info(DBusInterface* this_);
27681 DBusObject* g_dbus_interface_get_object(DBusInterface* this_);
27682 void g_dbus_interface_set_object(DBusInterface* this_, DBusObject* object);
27683 void g_dbus_interface_info_cache_build(DBusInterfaceInfo* this_);
27684 void g_dbus_interface_info_cache_release(DBusInterfaceInfo* this_);
27685 void g_dbus_interface_info_generate_xml(DBusInterfaceInfo* this_, uint indent, /*out*/ GLib2.String* string_builder);
27686 DBusMethodInfo* g_dbus_interface_info_lookup_method(DBusInterfaceInfo* this_, char* name);
27687 DBusPropertyInfo* g_dbus_interface_info_lookup_property(DBusInterfaceInfo* this_, char* name);
27688 DBusSignalInfo* g_dbus_interface_info_lookup_signal(DBusInterfaceInfo* this_, char* name);
27689 DBusInterfaceInfo* /*new*/ g_dbus_interface_info_ref(DBusInterfaceInfo* this_);
27690 void g_dbus_interface_info_unref(DBusInterfaceInfo* this_);
27691 int g_dbus_interface_skeleton_export(DBusInterfaceSkeleton* this_, DBusConnection* connection, char* object_path, GLib2.Error** error);
27692 void g_dbus_interface_skeleton_flush(DBusInterfaceSkeleton* this_);
27693 DBusConnection* g_dbus_interface_skeleton_get_connection(DBusInterfaceSkeleton* this_);
27694 GLib2.List* /*new*/ g_dbus_interface_skeleton_get_connections(DBusInterfaceSkeleton* this_);
27695 DBusInterfaceSkeletonFlags g_dbus_interface_skeleton_get_flags(DBusInterfaceSkeleton* this_);
27696 DBusInterfaceInfo* g_dbus_interface_skeleton_get_info(DBusInterfaceSkeleton* this_);
27697 char* g_dbus_interface_skeleton_get_object_path(DBusInterfaceSkeleton* this_);
27698 GLib2.Variant* /*new*/ g_dbus_interface_skeleton_get_properties(DBusInterfaceSkeleton* this_);
27699 DBusInterfaceVTable* g_dbus_interface_skeleton_get_vtable(DBusInterfaceSkeleton* this_);
27700 int g_dbus_interface_skeleton_has_connection(DBusInterfaceSkeleton* this_, DBusConnection* connection);
27701 void g_dbus_interface_skeleton_set_flags(DBusInterfaceSkeleton* this_, DBusInterfaceSkeletonFlags flags);
27702 void g_dbus_interface_skeleton_unexport(DBusInterfaceSkeleton* this_);
27703 void g_dbus_interface_skeleton_unexport_from_connection(DBusInterfaceSkeleton* this_, DBusConnection* connection);
27704 DBusMenuModel* /*new*/ g_dbus_menu_model_get(DBusConnection* connection, char* bus_name, char* object_path);
27705 DBusMessage* /*new*/ g_dbus_message_new();
27706 DBusMessage* /*new*/ g_dbus_message_new_from_blob(ubyte* blob, size_t blob_len, DBusCapabilityFlags capabilities, GLib2.Error** error);
27707 DBusMessage* /*new*/ g_dbus_message_new_method_call(char* name, char* path, char* interface_, char* method);
27708 DBusMessage* /*new*/ g_dbus_message_new_signal(char* path, char* interface_, char* signal);
27709 ssize_t g_dbus_message_bytes_needed(ubyte* blob, size_t blob_len, GLib2.Error** error);
27710 DBusMessage* /*new*/ g_dbus_message_copy(DBusMessage* this_, GLib2.Error** error);
27711 char* g_dbus_message_get_arg0(DBusMessage* this_);
27712 GLib2.Variant* /*new*/ g_dbus_message_get_body(DBusMessage* this_);
27713 DBusMessageByteOrder g_dbus_message_get_byte_order(DBusMessage* this_);
27714 char* g_dbus_message_get_destination(DBusMessage* this_);
27715 char* g_dbus_message_get_error_name(DBusMessage* this_);
27716 DBusMessageFlags g_dbus_message_get_flags(DBusMessage* this_);
27717 GLib2.Variant* /*new*/ g_dbus_message_get_header(DBusMessage* this_, DBusMessageHeaderField header_field);
27718 ubyte* g_dbus_message_get_header_fields(DBusMessage* this_);
27719 char* g_dbus_message_get_interface(DBusMessage* this_);
27720 int g_dbus_message_get_locked(DBusMessage* this_);
27721 char* g_dbus_message_get_member(DBusMessage* this_);
27722 DBusMessageType g_dbus_message_get_message_type(DBusMessage* this_);
27723 uint g_dbus_message_get_num_unix_fds(DBusMessage* this_);
27724 char* g_dbus_message_get_path(DBusMessage* this_);
27725 uint g_dbus_message_get_reply_serial(DBusMessage* this_);
27726 char* g_dbus_message_get_sender(DBusMessage* this_);
27727 uint g_dbus_message_get_serial(DBusMessage* this_);
27728 char* g_dbus_message_get_signature(DBusMessage* this_);
27729 UnixFDList* g_dbus_message_get_unix_fd_list(DBusMessage* this_);
27730 void g_dbus_message_lock(DBusMessage* this_);
27731 DBusMessage* /*new*/ g_dbus_message_new_method_error(DBusMessage* this_, char* error_name, char* error_message_format, ...);
27732 DBusMessage* /*new*/ g_dbus_message_new_method_error_literal(DBusMessage* this_, char* error_name, char* error_message);
27733 DBusMessage* /*new*/ g_dbus_message_new_method_error_valist(DBusMessage* this_, char* error_name, char* error_message_format, va_list var_args);
27734 DBusMessage* /*new*/ g_dbus_message_new_method_reply(DBusMessage* this_);
27735 char* /*new*/ g_dbus_message_print(DBusMessage* this_, uint indent);
27736 void g_dbus_message_set_body(DBusMessage* this_, GLib2.Variant* body_);
27737 void g_dbus_message_set_byte_order(DBusMessage* this_, DBusMessageByteOrder byte_order);
27738 void g_dbus_message_set_destination(DBusMessage* this_, char* value);
27739 void g_dbus_message_set_error_name(DBusMessage* this_, char* value);
27740 void g_dbus_message_set_flags(DBusMessage* this_, DBusMessageFlags flags);
27741 void g_dbus_message_set_header(DBusMessage* this_, DBusMessageHeaderField header_field, GLib2.Variant* value);
27742 void g_dbus_message_set_interface(DBusMessage* this_, char* value);
27743 void g_dbus_message_set_member(DBusMessage* this_, char* value);
27744 void g_dbus_message_set_message_type(DBusMessage* this_, DBusMessageType type);
27745 void g_dbus_message_set_num_unix_fds(DBusMessage* this_, uint value);
27746 void g_dbus_message_set_path(DBusMessage* this_, char* value);
27747 void g_dbus_message_set_reply_serial(DBusMessage* this_, uint value);
27748 void g_dbus_message_set_sender(DBusMessage* this_, char* value);
27749 void g_dbus_message_set_serial(DBusMessage* this_, uint serial);
27750 void g_dbus_message_set_signature(DBusMessage* this_, char* value);
27751 void g_dbus_message_set_unix_fd_list(DBusMessage* this_, UnixFDList* fd_list=null);
27752 ubyte* /*new*/ g_dbus_message_to_blob(DBusMessage* this_, /*out*/ size_t* out_size, DBusCapabilityFlags capabilities, GLib2.Error** error);
27753 int g_dbus_message_to_gerror(DBusMessage* this_, GLib2.Error** error);
27754 DBusMethodInfo* /*new*/ g_dbus_method_info_ref(DBusMethodInfo* this_);
27755 void g_dbus_method_info_unref(DBusMethodInfo* this_);
27756 DBusConnection* g_dbus_method_invocation_get_connection(DBusMethodInvocation* this_);
27757 char* g_dbus_method_invocation_get_interface_name(DBusMethodInvocation* this_);
27758 DBusMessage* g_dbus_method_invocation_get_message(DBusMethodInvocation* this_);
27759 DBusMethodInfo* g_dbus_method_invocation_get_method_info(DBusMethodInvocation* this_);
27760 char* g_dbus_method_invocation_get_method_name(DBusMethodInvocation* this_);
27761 char* g_dbus_method_invocation_get_object_path(DBusMethodInvocation* this_);
27762 GLib2.Variant* g_dbus_method_invocation_get_parameters(DBusMethodInvocation* this_);
27763 char* g_dbus_method_invocation_get_sender(DBusMethodInvocation* this_);
27764 void* g_dbus_method_invocation_get_user_data(DBusMethodInvocation* this_);
27765 void g_dbus_method_invocation_return_dbus_error(DBusMethodInvocation* this_, char* error_name, char* error_message);
27766 void g_dbus_method_invocation_return_error(DBusMethodInvocation* this_, GLib2.Quark domain, int code, char* format, ...);
27767 void g_dbus_method_invocation_return_error_literal(DBusMethodInvocation* this_, GLib2.Quark domain, int code, char* message);
27768 void g_dbus_method_invocation_return_error_valist(DBusMethodInvocation* this_, GLib2.Quark domain, int code, char* format, va_list var_args);
27769 void g_dbus_method_invocation_return_gerror(DBusMethodInvocation* this_, GLib2.Error* error);
27770 void g_dbus_method_invocation_return_value(DBusMethodInvocation* this_, GLib2.Variant* parameters=null);
27771 void g_dbus_method_invocation_return_value_with_unix_fd_list(DBusMethodInvocation* this_, GLib2.Variant* parameters=null, UnixFDList* fd_list=null);
27772 void g_dbus_method_invocation_take_error(DBusMethodInvocation* this_, GLib2.Error* error);
27773 DBusNodeInfo* /*new*/ g_dbus_node_info_new_for_xml(char* xml_data, GLib2.Error** error);
27774 void g_dbus_node_info_generate_xml(DBusNodeInfo* this_, uint indent, /*out*/ GLib2.String* string_builder);
27775 DBusInterfaceInfo* g_dbus_node_info_lookup_interface(DBusNodeInfo* this_, char* name);
27776 DBusNodeInfo* /*new*/ g_dbus_node_info_ref(DBusNodeInfo* this_);
27777 void g_dbus_node_info_unref(DBusNodeInfo* this_);
27778 DBusInterface* /*new*/ g_dbus_object_get_interface(DBusObject* this_, char* interface_name);
27779 GLib2.List* /*new*/ g_dbus_object_get_interfaces(DBusObject* this_);
27780 char* g_dbus_object_get_object_path(DBusObject* this_);
27781 DBusInterface* /*new*/ g_dbus_object_manager_get_interface(DBusObjectManager* this_, char* object_path, char* interface_name);
27782 DBusObject* /*new*/ g_dbus_object_manager_get_object(DBusObjectManager* this_, char* object_path);
27783 char* g_dbus_object_manager_get_object_path(DBusObjectManager* this_);
27784 GLib2.List* /*new*/ g_dbus_object_manager_get_objects(DBusObjectManager* this_);
27785 DBusObjectManagerClient* /*new*/ g_dbus_object_manager_client_new_finish(AsyncResult* res, GLib2.Error** error);
27786 DBusObjectManagerClient* /*new*/ g_dbus_object_manager_client_new_for_bus_finish(AsyncResult* res, GLib2.Error** error);
27787 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);
27788 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);
27789 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);
27790 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);
27791 DBusConnection* g_dbus_object_manager_client_get_connection(DBusObjectManagerClient* this_);
27792 DBusObjectManagerClientFlags g_dbus_object_manager_client_get_flags(DBusObjectManagerClient* this_);
27793 char* g_dbus_object_manager_client_get_name(DBusObjectManagerClient* this_);
27794 char* /*new*/ g_dbus_object_manager_client_get_name_owner(DBusObjectManagerClient* this_);
27795 DBusObjectManagerServer* /*new*/ g_dbus_object_manager_server_new(char* object_path);
27796 void g_dbus_object_manager_server_export(DBusObjectManagerServer* this_, DBusObjectSkeleton* object);
27797 void g_dbus_object_manager_server_export_uniquely(DBusObjectManagerServer* this_, DBusObjectSkeleton* object);
27798 DBusConnection* /*new*/ g_dbus_object_manager_server_get_connection(DBusObjectManagerServer* this_);
27799 void g_dbus_object_manager_server_set_connection(DBusObjectManagerServer* this_, DBusConnection* connection=null);
27800 int g_dbus_object_manager_server_unexport(DBusObjectManagerServer* this_, char* object_path);
27801 DBusObjectProxy* /*new*/ g_dbus_object_proxy_new(DBusConnection* connection, char* object_path);
27802 DBusConnection* g_dbus_object_proxy_get_connection(DBusObjectProxy* this_);
27803 DBusObjectSkeleton* /*new*/ g_dbus_object_skeleton_new(char* object_path);
27804 void g_dbus_object_skeleton_add_interface(DBusObjectSkeleton* this_, DBusInterfaceSkeleton* interface_);
27805 void g_dbus_object_skeleton_flush(DBusObjectSkeleton* this_);
27806 void g_dbus_object_skeleton_remove_interface(DBusObjectSkeleton* this_, DBusInterfaceSkeleton* interface_);
27807 void g_dbus_object_skeleton_remove_interface_by_name(DBusObjectSkeleton* this_, char* interface_name);
27808 void g_dbus_object_skeleton_set_object_path(DBusObjectSkeleton* this_, char* object_path);
27809 DBusPropertyInfo* /*new*/ g_dbus_property_info_ref(DBusPropertyInfo* this_);
27810 void g_dbus_property_info_unref(DBusPropertyInfo* this_);
27811 DBusProxy* /*new*/ g_dbus_proxy_new_finish(AsyncResult* res, GLib2.Error** error);
27812 DBusProxy* /*new*/ g_dbus_proxy_new_for_bus_finish(AsyncResult* res, GLib2.Error** error);
27813 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);
27814 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);
27815 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);
27816 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);
27817 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);
27818 GLib2.Variant* /*new*/ g_dbus_proxy_call_finish(DBusProxy* this_, AsyncResult* res, GLib2.Error** error);
27819 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);
27820 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);
27821 GLib2.Variant* /*new*/ g_dbus_proxy_call_with_unix_fd_list_finish(DBusProxy* this_, /*out*/ UnixFDList** out_fd_list, AsyncResult* res, GLib2.Error** error);
27822 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);
27823 GLib2.Variant* /*new*/ g_dbus_proxy_get_cached_property(DBusProxy* this_, char* property_name);
27824 char** /*new*/ g_dbus_proxy_get_cached_property_names(DBusProxy* this_);
27825 DBusConnection* g_dbus_proxy_get_connection(DBusProxy* this_);
27826 int g_dbus_proxy_get_default_timeout(DBusProxy* this_);
27827 DBusProxyFlags g_dbus_proxy_get_flags(DBusProxy* this_);
27828 DBusInterfaceInfo* /*new*/ g_dbus_proxy_get_interface_info(DBusProxy* this_);
27829 char* g_dbus_proxy_get_interface_name(DBusProxy* this_);
27830 char* g_dbus_proxy_get_name(DBusProxy* this_);
27831 char* /*new*/ g_dbus_proxy_get_name_owner(DBusProxy* this_);
27832 char* g_dbus_proxy_get_object_path(DBusProxy* this_);
27833 void g_dbus_proxy_set_cached_property(DBusProxy* this_, char* property_name, GLib2.Variant* value=null);
27834 void g_dbus_proxy_set_default_timeout(DBusProxy* this_, int timeout_msec);
27835 void g_dbus_proxy_set_interface_info(DBusProxy* this_, DBusInterfaceInfo* info=null);
27836 DBusServer* /*new*/ g_dbus_server_new_sync(char* address, DBusServerFlags flags, char* guid, DBusAuthObserver* observer, Cancellable* cancellable, GLib2.Error** error);
27837 char* g_dbus_server_get_client_address(DBusServer* this_);
27838 DBusServerFlags g_dbus_server_get_flags(DBusServer* this_);
27839 char* g_dbus_server_get_guid(DBusServer* this_);
27840 int g_dbus_server_is_active(DBusServer* this_);
27841 void g_dbus_server_start(DBusServer* this_);
27842 void g_dbus_server_stop(DBusServer* this_);
27843 DBusSignalInfo* /*new*/ g_dbus_signal_info_ref(DBusSignalInfo* this_);
27844 void g_dbus_signal_info_unref(DBusSignalInfo* this_);
27845 DataInputStream* /*new*/ g_data_input_stream_new(InputStream* base_stream);
27846 DataStreamByteOrder g_data_input_stream_get_byte_order(DataInputStream* this_);
27847 DataStreamNewlineType g_data_input_stream_get_newline_type(DataInputStream* this_);
27848 ubyte g_data_input_stream_read_byte(DataInputStream* this_, Cancellable* cancellable, GLib2.Error** error);
27849 short g_data_input_stream_read_int16(DataInputStream* this_, Cancellable* cancellable, GLib2.Error** error);
27850 int g_data_input_stream_read_int32(DataInputStream* this_, Cancellable* cancellable, GLib2.Error** error);
27851 long g_data_input_stream_read_int64(DataInputStream* this_, Cancellable* cancellable, GLib2.Error** error);
27852 ubyte* /*new*/ g_data_input_stream_read_line(DataInputStream* this_, /*out*/ size_t* length, Cancellable* cancellable, GLib2.Error** error);
27853 void g_data_input_stream_read_line_async(DataInputStream* this_, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
27854 ubyte* /*new*/ g_data_input_stream_read_line_finish(DataInputStream* this_, AsyncResult* result, /*out*/ size_t* length, GLib2.Error** error);
27855 char* /*new*/ g_data_input_stream_read_line_finish_utf8(DataInputStream* this_, AsyncResult* result, /*out*/ size_t* length, GLib2.Error** error);
27856 char* /*new*/ g_data_input_stream_read_line_utf8(DataInputStream* this_, /*out*/ size_t* length, Cancellable* cancellable, GLib2.Error** error);
27857 ushort g_data_input_stream_read_uint16(DataInputStream* this_, Cancellable* cancellable, GLib2.Error** error);
27858 uint g_data_input_stream_read_uint32(DataInputStream* this_, Cancellable* cancellable, GLib2.Error** error);
27859 ulong g_data_input_stream_read_uint64(DataInputStream* this_, Cancellable* cancellable, GLib2.Error** error);
27860 char* /*new*/ g_data_input_stream_read_until(DataInputStream* this_, char* stop_chars, /*out*/ size_t* length, Cancellable* cancellable, GLib2.Error** error);
27861 void g_data_input_stream_read_until_async(DataInputStream* this_, char* stop_chars, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
27862 char* /*new*/ g_data_input_stream_read_until_finish(DataInputStream* this_, AsyncResult* result, /*out*/ size_t* length, GLib2.Error** error);
27863 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);
27864 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);
27865 char* /*new*/ g_data_input_stream_read_upto_finish(DataInputStream* this_, AsyncResult* result, /*out*/ size_t* length, GLib2.Error** error);
27866 void g_data_input_stream_set_byte_order(DataInputStream* this_, DataStreamByteOrder order);
27867 void g_data_input_stream_set_newline_type(DataInputStream* this_, DataStreamNewlineType type);
27868 DataOutputStream* /*new*/ g_data_output_stream_new(OutputStream* base_stream);
27869 DataStreamByteOrder g_data_output_stream_get_byte_order(DataOutputStream* this_);
27870 int g_data_output_stream_put_byte(DataOutputStream* this_, ubyte data, Cancellable* cancellable, GLib2.Error** error);
27871 int g_data_output_stream_put_int16(DataOutputStream* this_, short data, Cancellable* cancellable, GLib2.Error** error);
27872 int g_data_output_stream_put_int32(DataOutputStream* this_, int data, Cancellable* cancellable, GLib2.Error** error);
27873 int g_data_output_stream_put_int64(DataOutputStream* this_, long data, Cancellable* cancellable, GLib2.Error** error);
27874 int g_data_output_stream_put_string(DataOutputStream* this_, char* str, Cancellable* cancellable, GLib2.Error** error);
27875 int g_data_output_stream_put_uint16(DataOutputStream* this_, ushort data, Cancellable* cancellable, GLib2.Error** error);
27876 int g_data_output_stream_put_uint32(DataOutputStream* this_, uint data, Cancellable* cancellable, GLib2.Error** error);
27877 int g_data_output_stream_put_uint64(DataOutputStream* this_, ulong data, Cancellable* cancellable, GLib2.Error** error);
27878 void g_data_output_stream_set_byte_order(DataOutputStream* this_, DataStreamByteOrder order);
27879 DesktopAppInfo* /*new*/ g_desktop_app_info_new(char* desktop_id);
27880 DesktopAppInfo* /*new*/ g_desktop_app_info_new_from_filename(char* filename);
27881 DesktopAppInfo* /*new*/ g_desktop_app_info_new_from_keyfile(GLib2.KeyFile* key_file);
27882 void g_desktop_app_info_set_desktop_env(char* desktop_env);
27883 char* g_desktop_app_info_get_categories(DesktopAppInfo* this_);
27884 char* g_desktop_app_info_get_filename(DesktopAppInfo* this_);
27885 char* g_desktop_app_info_get_generic_name(DesktopAppInfo* this_);
27886 int g_desktop_app_info_get_is_hidden(DesktopAppInfo* this_);
27887 char** g_desktop_app_info_get_keywords(DesktopAppInfo* this_);
27888 int g_desktop_app_info_get_nodisplay(DesktopAppInfo* this_);
27889 int g_desktop_app_info_get_show_in(DesktopAppInfo* this_, char* desktop_env);
27890 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);
27891 AppInfo* /*new*/ g_desktop_app_info_lookup_get_default_for_uri_scheme(DesktopAppInfoLookup* this_, char* uri_scheme);
27892 int g_drive_can_eject(Drive* this_);
27893 int g_drive_can_poll_for_media(Drive* this_);
27894 int g_drive_can_start(Drive* this_);
27895 int g_drive_can_start_degraded(Drive* this_);
27896 int g_drive_can_stop(Drive* this_);
27897 void g_drive_eject(Drive* this_, MountUnmountFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
27898 int g_drive_eject_finish(Drive* this_, AsyncResult* result, GLib2.Error** error);
27899 void g_drive_eject_with_operation(Drive* this_, MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
27900 int g_drive_eject_with_operation_finish(Drive* this_, AsyncResult* result, GLib2.Error** error);
27901 char** /*new*/ g_drive_enumerate_identifiers(Drive* this_);
27902 Icon* /*new*/ g_drive_get_icon(Drive* this_);
27903 char* /*new*/ g_drive_get_identifier(Drive* this_, char* kind);
27904 char* /*new*/ g_drive_get_name(Drive* this_);
27905 char* g_drive_get_sort_key(Drive* this_);
27906 DriveStartStopType g_drive_get_start_stop_type(Drive* this_);
27907 GLib2.List* /*new*/ g_drive_get_volumes(Drive* this_);
27908 int g_drive_has_media(Drive* this_);
27909 int g_drive_has_volumes(Drive* this_);
27910 int g_drive_is_media_check_automatic(Drive* this_);
27911 int g_drive_is_media_removable(Drive* this_);
27912 void g_drive_poll_for_media(Drive* this_, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
27913 int g_drive_poll_for_media_finish(Drive* this_, AsyncResult* result, GLib2.Error** error);
27914 void g_drive_start(Drive* this_, DriveStartFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
27915 int g_drive_start_finish(Drive* this_, AsyncResult* result, GLib2.Error** error);
27916 void g_drive_stop(Drive* this_, MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
27917 int g_drive_stop_finish(Drive* this_, AsyncResult* result, GLib2.Error** error);
27918 Emblem* /*new*/ g_emblem_new(Icon* icon);
27919 Emblem* /*new*/ g_emblem_new_with_origin(Icon* icon, EmblemOrigin origin);
27920 Icon* g_emblem_get_icon(Emblem* this_);
27921 EmblemOrigin g_emblem_get_origin(Emblem* this_);
27922 EmblemedIcon* /*new*/ g_emblemed_icon_new(Icon* icon, Emblem* emblem=null);
27923 void g_emblemed_icon_add_emblem(EmblemedIcon* this_, Emblem* emblem);
27924 void g_emblemed_icon_clear_emblems(EmblemedIcon* this_);
27925 GLib2.List* g_emblemed_icon_get_emblems(EmblemedIcon* this_);
27926 Icon* g_emblemed_icon_get_icon(EmblemedIcon* this_);
27927 File* /*new*/ g_file_new_for_commandline_arg(char* arg);
27928 File* /*new*/ g_file_new_for_path(char* path);
27929 File* /*new*/ g_file_new_for_uri(char* uri);
27930 File* /*new*/ g_file_new_tmp(char* tmpl, /*out*/ FileIOStream** iostream, GLib2.Error** error);
27931 File* /*new*/ g_file_parse_name(char* parse_name);
27932 FileOutputStream* /*new*/ g_file_append_to(File* this_, FileCreateFlags flags, Cancellable* cancellable, GLib2.Error** error);
27933 void g_file_append_to_async(File* this_, FileCreateFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
27934 FileOutputStream* /*new*/ g_file_append_to_finish(File* this_, AsyncResult* res, GLib2.Error** error);
27935 int g_file_copy(File* this_, File* destination, FileCopyFlags flags, Cancellable* cancellable, FileProgressCallback progress_callback, void* progress_callback_data, GLib2.Error** error);
27936 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);
27937 int g_file_copy_attributes(File* this_, File* destination, FileCopyFlags flags, Cancellable* cancellable, GLib2.Error** error);
27938 int g_file_copy_finish(File* this_, AsyncResult* res, GLib2.Error** error);
27939 FileOutputStream* /*new*/ g_file_create(File* this_, FileCreateFlags flags, Cancellable* cancellable, GLib2.Error** error);
27940 void g_file_create_async(File* this_, FileCreateFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
27941 FileOutputStream* /*new*/ g_file_create_finish(File* this_, AsyncResult* res, GLib2.Error** error);
27942 FileIOStream* /*new*/ g_file_create_readwrite(File* this_, FileCreateFlags flags, Cancellable* cancellable, GLib2.Error** error);
27943 void g_file_create_readwrite_async(File* this_, FileCreateFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
27944 FileIOStream* /*new*/ g_file_create_readwrite_finish(File* this_, AsyncResult* res, GLib2.Error** error);
27945 int g_file_delete(File* this_, Cancellable* cancellable, GLib2.Error** error);
27946 File* /*new*/ g_file_dup(File* this_);
27947 void g_file_eject_mountable(File* this_, MountUnmountFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
27948 int g_file_eject_mountable_finish(File* this_, AsyncResult* result, GLib2.Error** error);
27949 void g_file_eject_mountable_with_operation(File* this_, MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
27950 int g_file_eject_mountable_with_operation_finish(File* this_, AsyncResult* result, GLib2.Error** error);
27951 FileEnumerator* /*new*/ g_file_enumerate_children(File* this_, char* attributes, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error);
27952 void g_file_enumerate_children_async(File* this_, char* attributes, FileQueryInfoFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
27953 FileEnumerator* /*new*/ g_file_enumerate_children_finish(File* this_, AsyncResult* res, GLib2.Error** error);
27954 int g_file_equal(File* this_, File* file2);
27955 Mount* /*new*/ g_file_find_enclosing_mount(File* this_, Cancellable* cancellable, GLib2.Error** error);
27956 void g_file_find_enclosing_mount_async(File* this_, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
27957 Mount* /*new*/ g_file_find_enclosing_mount_finish(File* this_, AsyncResult* res, GLib2.Error** error);
27958 char* /*new*/ g_file_get_basename(File* this_);
27959 File* /*new*/ g_file_get_child(File* this_, char* name);
27960 File* /*new*/ g_file_get_child_for_display_name(File* this_, char* display_name, GLib2.Error** error);
27961 File* /*new*/ g_file_get_parent(File* this_);
27962 char* /*new*/ g_file_get_parse_name(File* this_);
27963 char* /*new*/ g_file_get_path(File* this_);
27964 char* /*new*/ g_file_get_relative_path(File* this_, File* descendant);
27965 char* /*new*/ g_file_get_uri(File* this_);
27966 char* /*new*/ g_file_get_uri_scheme(File* this_);
27967 int g_file_has_parent(File* this_, File* parent=null);
27968 int g_file_has_prefix(File* this_, File* prefix);
27969 int g_file_has_uri_scheme(File* this_, char* uri_scheme);
27970 uint g_file_hash(File* this_);
27971 int g_file_is_native(File* this_);
27972 int g_file_load_contents(File* this_, Cancellable* cancellable, /*out*/ ubyte** contents, /*out*/ size_t* length, /*out*/ char** etag_out, GLib2.Error** error);
27973 void g_file_load_contents_async(File* this_, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
27974 int g_file_load_contents_finish(File* this_, AsyncResult* res, /*out*/ ubyte** contents, /*out*/ size_t* length, /*out*/ char** etag_out, GLib2.Error** error);
27975 void g_file_load_partial_contents_async(File* this_, Cancellable* cancellable, FileReadMoreCallback read_more_callback, AsyncReadyCallback callback, void* user_data);
27976 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);
27977 int g_file_make_directory(File* this_, Cancellable* cancellable, GLib2.Error** error);
27978 int g_file_make_directory_with_parents(File* this_, Cancellable* cancellable, GLib2.Error** error);
27979 int g_file_make_symbolic_link(File* this_, char* symlink_value, Cancellable* cancellable, GLib2.Error** error);
27980 FileMonitor* /*new*/ g_file_monitor(File* this_, FileMonitorFlags flags, Cancellable* cancellable, GLib2.Error** error);
27981 FileMonitor* /*new*/ g_file_monitor_directory(File* this_, FileMonitorFlags flags, Cancellable* cancellable, GLib2.Error** error);
27982 FileMonitor* /*new*/ g_file_monitor_file(File* this_, FileMonitorFlags flags, Cancellable* cancellable, GLib2.Error** error);
27983 void g_file_mount_enclosing_volume(File* this_, MountMountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
27984 int g_file_mount_enclosing_volume_finish(File* this_, AsyncResult* result, GLib2.Error** error);
27985 void g_file_mount_mountable(File* this_, MountMountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
27986 File* /*new*/ g_file_mount_mountable_finish(File* this_, AsyncResult* result, GLib2.Error** error);
27987 int g_file_move(File* this_, File* destination, FileCopyFlags flags, Cancellable* cancellable, FileProgressCallback progress_callback, void* progress_callback_data, GLib2.Error** error);
27988 FileIOStream* /*new*/ g_file_open_readwrite(File* this_, Cancellable* cancellable, GLib2.Error** error);
27989 void g_file_open_readwrite_async(File* this_, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
27990 FileIOStream* /*new*/ g_file_open_readwrite_finish(File* this_, AsyncResult* res, GLib2.Error** error);
27991 void g_file_poll_mountable(File* this_, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
27992 int g_file_poll_mountable_finish(File* this_, AsyncResult* result, GLib2.Error** error);
27993 AppInfo* /*new*/ g_file_query_default_handler(File* this_, Cancellable* cancellable, GLib2.Error** error);
27994 int g_file_query_exists(File* this_, Cancellable* cancellable=null);
27995 FileType g_file_query_file_type(File* this_, FileQueryInfoFlags flags, Cancellable* cancellable=null);
27996 FileInfo* /*new*/ g_file_query_filesystem_info(File* this_, char* attributes, Cancellable* cancellable, GLib2.Error** error);
27997 void g_file_query_filesystem_info_async(File* this_, char* attributes, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
27998 FileInfo* /*new*/ g_file_query_filesystem_info_finish(File* this_, AsyncResult* res, GLib2.Error** error);
27999 FileInfo* /*new*/ g_file_query_info(File* this_, char* attributes, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error);
28000 void g_file_query_info_async(File* this_, char* attributes, FileQueryInfoFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
28001 FileInfo* /*new*/ g_file_query_info_finish(File* this_, AsyncResult* res, GLib2.Error** error);
28002 FileAttributeInfoList* /*new*/ g_file_query_settable_attributes(File* this_, Cancellable* cancellable, GLib2.Error** error);
28003 FileAttributeInfoList* /*new*/ g_file_query_writable_namespaces(File* this_, Cancellable* cancellable, GLib2.Error** error);
28004 FileInputStream* /*new*/ g_file_read(File* this_, Cancellable* cancellable, GLib2.Error** error);
28005 void g_file_read_async(File* this_, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
28006 FileInputStream* /*new*/ g_file_read_finish(File* this_, AsyncResult* res, GLib2.Error** error);
28007 FileOutputStream* /*new*/ g_file_replace(File* this_, char* etag, int make_backup, FileCreateFlags flags, Cancellable* cancellable, GLib2.Error** error);
28008 void g_file_replace_async(File* this_, char* etag, int make_backup, FileCreateFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
28009 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);
28010 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);
28011 int g_file_replace_contents_finish(File* this_, AsyncResult* res, /*out*/ char** new_etag, GLib2.Error** error);
28012 FileOutputStream* /*new*/ g_file_replace_finish(File* this_, AsyncResult* res, GLib2.Error** error);
28013 FileIOStream* /*new*/ g_file_replace_readwrite(File* this_, char* etag, int make_backup, FileCreateFlags flags, Cancellable* cancellable, GLib2.Error** error);
28014 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);
28015 FileIOStream* /*new*/ g_file_replace_readwrite_finish(File* this_, AsyncResult* res, GLib2.Error** error);
28016 File* /*new*/ g_file_resolve_relative_path(File* this_, char* relative_path);
28017 int g_file_set_attribute(File* this_, char* attribute, FileAttributeType type, void* value_p, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error);
28018 int g_file_set_attribute_byte_string(File* this_, char* attribute, char* value, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error);
28019 int g_file_set_attribute_int32(File* this_, char* attribute, int value, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error);
28020 int g_file_set_attribute_int64(File* this_, char* attribute, long value, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error);
28021 int g_file_set_attribute_string(File* this_, char* attribute, char* value, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error);
28022 int g_file_set_attribute_uint32(File* this_, char* attribute, uint value, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error);
28023 int g_file_set_attribute_uint64(File* this_, char* attribute, ulong value, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error);
28024 void g_file_set_attributes_async(File* this_, FileInfo* info, FileQueryInfoFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
28025 int g_file_set_attributes_finish(File* this_, AsyncResult* result, /*out*/ FileInfo** info, GLib2.Error** error);
28026 int g_file_set_attributes_from_info(File* this_, FileInfo* info, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error);
28027 File* /*new*/ g_file_set_display_name(File* this_, char* display_name, Cancellable* cancellable, GLib2.Error** error);
28028 void g_file_set_display_name_async(File* this_, char* display_name, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
28029 File* /*new*/ g_file_set_display_name_finish(File* this_, AsyncResult* res, GLib2.Error** error);
28030 void g_file_start_mountable(File* this_, DriveStartFlags flags, MountOperation* start_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
28031 int g_file_start_mountable_finish(File* this_, AsyncResult* result, GLib2.Error** error);
28032 void g_file_stop_mountable(File* this_, MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
28033 int g_file_stop_mountable_finish(File* this_, AsyncResult* result, GLib2.Error** error);
28034 int g_file_supports_thread_contexts(File* this_);
28035 int g_file_trash(File* this_, Cancellable* cancellable, GLib2.Error** error);
28036 void g_file_unmount_mountable(File* this_, MountUnmountFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
28037 int g_file_unmount_mountable_finish(File* this_, AsyncResult* result, GLib2.Error** error);
28038 void g_file_unmount_mountable_with_operation(File* this_, MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
28039 int g_file_unmount_mountable_with_operation_finish(File* this_, AsyncResult* result, GLib2.Error** error);
28040 FileAttributeInfoList* /*new*/ g_file_attribute_info_list_new();
28041 void g_file_attribute_info_list_add(FileAttributeInfoList* this_, char* name, FileAttributeType type, FileAttributeInfoFlags flags);
28042 FileAttributeInfoList* /*new*/ g_file_attribute_info_list_dup(FileAttributeInfoList* this_);
28043 FileAttributeInfo* g_file_attribute_info_list_lookup(FileAttributeInfoList* this_, char* name);
28044 FileAttributeInfoList* /*new*/ g_file_attribute_info_list_ref(FileAttributeInfoList* this_);
28045 void g_file_attribute_info_list_unref(FileAttributeInfoList* this_);
28046 FileAttributeMatcher* /*new*/ g_file_attribute_matcher_new(char* attributes);
28047 int g_file_attribute_matcher_enumerate_namespace(FileAttributeMatcher* this_, char* ns);
28048 char* g_file_attribute_matcher_enumerate_next(FileAttributeMatcher* this_);
28049 int g_file_attribute_matcher_matches(FileAttributeMatcher* this_, char* attribute);
28050 int g_file_attribute_matcher_matches_only(FileAttributeMatcher* this_, char* attribute);
28051 FileAttributeMatcher* /*new*/ g_file_attribute_matcher_ref(FileAttributeMatcher* this_);
28052 FileAttributeMatcher* /*new*/ g_file_attribute_matcher_subtract(FileAttributeMatcher* this_, FileAttributeMatcher* subtract);
28053 char* /*new*/ g_file_attribute_matcher_to_string(FileAttributeMatcher* this_);
28054 void g_file_attribute_matcher_unref(FileAttributeMatcher* this_);
28055 int g_file_descriptor_based_get_fd(FileDescriptorBased* this_);
28056 int g_file_enumerator_close(FileEnumerator* this_, Cancellable* cancellable, GLib2.Error** error);
28057 void g_file_enumerator_close_async(FileEnumerator* this_, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
28058 int g_file_enumerator_close_finish(FileEnumerator* this_, AsyncResult* result, GLib2.Error** error);
28059 File* g_file_enumerator_get_container(FileEnumerator* this_);
28060 int g_file_enumerator_has_pending(FileEnumerator* this_);
28061 int g_file_enumerator_is_closed(FileEnumerator* this_);
28062 FileInfo* /*new*/ g_file_enumerator_next_file(FileEnumerator* this_, Cancellable* cancellable, GLib2.Error** error);
28063 void g_file_enumerator_next_files_async(FileEnumerator* this_, int num_files, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
28064 GLib2.List* /*new*/ g_file_enumerator_next_files_finish(FileEnumerator* this_, AsyncResult* result, GLib2.Error** error);
28065 void g_file_enumerator_set_pending(FileEnumerator* this_, int pending);
28066 char* /*new*/ g_file_io_stream_get_etag(FileIOStream* this_);
28067 FileInfo* /*new*/ g_file_io_stream_query_info(FileIOStream* this_, char* attributes, Cancellable* cancellable, GLib2.Error** error);
28068 void g_file_io_stream_query_info_async(FileIOStream* this_, char* attributes, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
28069 FileInfo* /*new*/ g_file_io_stream_query_info_finish(FileIOStream* this_, AsyncResult* result, GLib2.Error** error);
28070 FileIcon* /*new*/ g_file_icon_new(File* file);
28071 File* g_file_icon_get_file(FileIcon* this_);
28072 FileInfo* /*new*/ g_file_info_new();
28073 void g_file_info_clear_status(FileInfo* this_);
28074 void g_file_info_copy_into(FileInfo* this_, FileInfo* dest_info);
28075 FileInfo* /*new*/ g_file_info_dup(FileInfo* this_);
28076 char* /*new*/ g_file_info_get_attribute_as_string(FileInfo* this_, char* attribute);
28077 int g_file_info_get_attribute_boolean(FileInfo* this_, char* attribute);
28078 char* g_file_info_get_attribute_byte_string(FileInfo* this_, char* attribute);
28079 int g_file_info_get_attribute_data(FileInfo* this_, char* attribute, /*out*/ FileAttributeType* type=null, /*out*/ void** value_pp=null, /*out*/ FileAttributeStatus* status=null);
28080 int g_file_info_get_attribute_int32(FileInfo* this_, char* attribute);
28081 long g_file_info_get_attribute_int64(FileInfo* this_, char* attribute);
28082 GObject2.Object* g_file_info_get_attribute_object(FileInfo* this_, char* attribute);
28083 FileAttributeStatus g_file_info_get_attribute_status(FileInfo* this_, char* attribute);
28084 char* g_file_info_get_attribute_string(FileInfo* this_, char* attribute);
28085 char** g_file_info_get_attribute_stringv(FileInfo* this_, char* attribute);
28086 FileAttributeType g_file_info_get_attribute_type(FileInfo* this_, char* attribute);
28087 uint g_file_info_get_attribute_uint32(FileInfo* this_, char* attribute);
28088 ulong g_file_info_get_attribute_uint64(FileInfo* this_, char* attribute);
28089 char* g_file_info_get_content_type(FileInfo* this_);
28090 char* g_file_info_get_display_name(FileInfo* this_);
28091 char* g_file_info_get_edit_name(FileInfo* this_);
28092 char* g_file_info_get_etag(FileInfo* this_);
28093 FileType g_file_info_get_file_type(FileInfo* this_);
28094 Icon* g_file_info_get_icon(FileInfo* this_);
28095 int g_file_info_get_is_backup(FileInfo* this_);
28096 int g_file_info_get_is_hidden(FileInfo* this_);
28097 int g_file_info_get_is_symlink(FileInfo* this_);
28098 void g_file_info_get_modification_time(FileInfo* this_, /*out*/ GLib2.TimeVal* result);
28099 char* g_file_info_get_name(FileInfo* this_);
28100 long g_file_info_get_size(FileInfo* this_);
28101 int g_file_info_get_sort_order(FileInfo* this_);
28102 char* g_file_info_get_symlink_target(FileInfo* this_);
28103 int g_file_info_has_attribute(FileInfo* this_, char* attribute);
28104 int g_file_info_has_namespace(FileInfo* this_, char* name_space);
28105 char** /*new*/ g_file_info_list_attributes(FileInfo* this_, char* name_space);
28106 void g_file_info_remove_attribute(FileInfo* this_, char* attribute);
28107 void g_file_info_set_attribute(FileInfo* this_, char* attribute, FileAttributeType type, void* value_p);
28108 void g_file_info_set_attribute_boolean(FileInfo* this_, char* attribute, int attr_value);
28109 void g_file_info_set_attribute_byte_string(FileInfo* this_, char* attribute, char* attr_value);
28110 void g_file_info_set_attribute_int32(FileInfo* this_, char* attribute, int attr_value);
28111 void g_file_info_set_attribute_int64(FileInfo* this_, char* attribute, long attr_value);
28112 void g_file_info_set_attribute_mask(FileInfo* this_, FileAttributeMatcher* mask);
28113 void g_file_info_set_attribute_object(FileInfo* this_, char* attribute, GObject2.Object* attr_value);
28114 int g_file_info_set_attribute_status(FileInfo* this_, char* attribute, FileAttributeStatus status);
28115 void g_file_info_set_attribute_string(FileInfo* this_, char* attribute, char* attr_value);
28116 void g_file_info_set_attribute_stringv(FileInfo* this_, char* attribute, char** attr_value);
28117 void g_file_info_set_attribute_uint32(FileInfo* this_, char* attribute, uint attr_value);
28118 void g_file_info_set_attribute_uint64(FileInfo* this_, char* attribute, ulong attr_value);
28119 void g_file_info_set_content_type(FileInfo* this_, char* content_type);
28120 void g_file_info_set_display_name(FileInfo* this_, char* display_name);
28121 void g_file_info_set_edit_name(FileInfo* this_, char* edit_name);
28122 void g_file_info_set_file_type(FileInfo* this_, FileType type);
28123 void g_file_info_set_icon(FileInfo* this_, Icon* icon);
28124 void g_file_info_set_is_hidden(FileInfo* this_, int is_hidden);
28125 void g_file_info_set_is_symlink(FileInfo* this_, int is_symlink);
28126 void g_file_info_set_modification_time(FileInfo* this_, GLib2.TimeVal* mtime);
28127 void g_file_info_set_name(FileInfo* this_, char* name);
28128 void g_file_info_set_size(FileInfo* this_, long size);
28129 void g_file_info_set_sort_order(FileInfo* this_, int sort_order);
28130 void g_file_info_set_symlink_target(FileInfo* this_, char* symlink_target);
28131 void g_file_info_unset_attribute_mask(FileInfo* this_);
28132 FileInfo* /*new*/ g_file_input_stream_query_info(FileInputStream* this_, char* attributes, Cancellable* cancellable, GLib2.Error** error);
28133 void g_file_input_stream_query_info_async(FileInputStream* this_, char* attributes, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
28134 FileInfo* /*new*/ g_file_input_stream_query_info_finish(FileInputStream* this_, AsyncResult* result, GLib2.Error** error);
28135 int g_file_monitor_cancel(FileMonitor* this_);
28136 void g_file_monitor_emit_event(FileMonitor* this_, File* child, File* other_file, FileMonitorEvent event_type);
28137 int g_file_monitor_is_cancelled(FileMonitor* this_);
28138 void g_file_monitor_set_rate_limit(FileMonitor* this_, int limit_msecs);
28139 char* /*new*/ g_file_output_stream_get_etag(FileOutputStream* this_);
28140 FileInfo* /*new*/ g_file_output_stream_query_info(FileOutputStream* this_, char* attributes, Cancellable* cancellable, GLib2.Error** error);
28141 void g_file_output_stream_query_info_async(FileOutputStream* this_, char* attributes, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
28142 FileInfo* /*new*/ g_file_output_stream_query_info_finish(FileOutputStream* this_, AsyncResult* result, GLib2.Error** error);
28143 FilenameCompleter* /*new*/ g_filename_completer_new();
28144 char* /*new*/ g_filename_completer_get_completion_suffix(FilenameCompleter* this_, char* initial_text);
28145 char** /*new*/ g_filename_completer_get_completions(FilenameCompleter* this_, char* initial_text);
28146 void g_filename_completer_set_dirs_only(FilenameCompleter* this_, int dirs_only);
28147 InputStream* g_filter_input_stream_get_base_stream(FilterInputStream* this_);
28148 int g_filter_input_stream_get_close_base_stream(FilterInputStream* this_);
28149 void g_filter_input_stream_set_close_base_stream(FilterInputStream* this_, int close_base);
28150 OutputStream* g_filter_output_stream_get_base_stream(FilterOutputStream* this_);
28151 int g_filter_output_stream_get_close_base_stream(FilterOutputStream* this_);
28152 void g_filter_output_stream_set_close_base_stream(FilterOutputStream* this_, int close_base);
28153 char* g_io_extension_get_name(IOExtension* this_);
28154 int g_io_extension_get_priority(IOExtension* this_);
28155 GObject2.TypeClass* /*new*/ g_io_extension_ref_class(IOExtension* this_);
28156 IOExtension* g_io_extension_point_get_extension_by_name(IOExtensionPoint* this_, char* name);
28157 GLib2.List* g_io_extension_point_get_extensions(IOExtensionPoint* this_);
28158 Type g_io_extension_point_get_required_type(IOExtensionPoint* this_);
28159 void g_io_extension_point_set_required_type(IOExtensionPoint* this_, Type type);
28160 IOExtension* g_io_extension_point_implement(char* extension_point_name, Type type, char* extension_name, int priority);
28161 IOExtensionPoint* g_io_extension_point_lookup(char* name);
28162 IOExtensionPoint* g_io_extension_point_register(char* name);
28163 IOModule* /*new*/ g_io_module_new(char* filename);
28164 char** /*new*/ g_io_module_query();
28165 void g_io_module_load(IOModule* this_);
28166 void g_io_module_unload(IOModule* this_);
28167 void g_io_module_scope_block(IOModuleScope* this_, char* basename);
28168 void g_io_module_scope_free(IOModuleScope* this_);
28169 IOModuleScope* /*new*/ g_io_module_scope_new(IOModuleScopeFlags flags);
28170 int g_io_scheduler_job_send_to_mainloop(IOSchedulerJob* this_, GLib2.SourceFunc func, void* user_data, GLib2.DestroyNotify notify);
28171 void g_io_scheduler_job_send_to_mainloop_async(IOSchedulerJob* this_, GLib2.SourceFunc func, void* user_data, GLib2.DestroyNotify notify);
28172 int g_io_stream_splice_finish(AsyncResult* result, GLib2.Error** error);
28173 void g_io_stream_clear_pending(IOStream* this_);
28174 int g_io_stream_close(IOStream* this_, Cancellable* cancellable, GLib2.Error** error);
28175 void g_io_stream_close_async(IOStream* this_, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
28176 int g_io_stream_close_finish(IOStream* this_, AsyncResult* result, GLib2.Error** error);
28177 InputStream* g_io_stream_get_input_stream(IOStream* this_);
28178 OutputStream* g_io_stream_get_output_stream(IOStream* this_);
28179 int g_io_stream_has_pending(IOStream* this_);
28180 int g_io_stream_is_closed(IOStream* this_);
28181 int g_io_stream_set_pending(IOStream* this_, GLib2.Error** error);
28182 void g_io_stream_splice_async(IOStream* this_, IOStream* stream2, IOStreamSpliceFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
28183 uint g_icon_hash(const(void)* icon);
28184 Icon* /*new*/ g_icon_new_for_string(char* str, GLib2.Error** error);
28185 int g_icon_equal(Icon* this_, Icon* icon2=null);
28186 char* /*new*/ g_icon_to_string(Icon* this_);
28187 InetAddress* /*new*/ g_inet_address_new_any(SocketFamily family);
28188 InetAddress* /*new*/ g_inet_address_new_from_bytes(ubyte* bytes, SocketFamily family);
28189 InetAddress* /*new*/ g_inet_address_new_from_string(char* string_);
28190 InetAddress* /*new*/ g_inet_address_new_loopback(SocketFamily family);
28191 int g_inet_address_equal(InetAddress* this_, InetAddress* other_address);
28192 SocketFamily g_inet_address_get_family(InetAddress* this_);
28193 int g_inet_address_get_is_any(InetAddress* this_);
28194 int g_inet_address_get_is_link_local(InetAddress* this_);
28195 int g_inet_address_get_is_loopback(InetAddress* this_);
28196 int g_inet_address_get_is_mc_global(InetAddress* this_);
28197 int g_inet_address_get_is_mc_link_local(InetAddress* this_);
28198 int g_inet_address_get_is_mc_node_local(InetAddress* this_);
28199 int g_inet_address_get_is_mc_org_local(InetAddress* this_);
28200 int g_inet_address_get_is_mc_site_local(InetAddress* this_);
28201 int g_inet_address_get_is_multicast(InetAddress* this_);
28202 int g_inet_address_get_is_site_local(InetAddress* this_);
28203 size_t g_inet_address_get_native_size(InetAddress* this_);
28204 ubyte* g_inet_address_to_bytes(InetAddress* this_);
28205 char* /*new*/ g_inet_address_to_string(InetAddress* this_);
28206 InetAddressMask* /*new*/ g_inet_address_mask_new(InetAddress* addr, uint length, GLib2.Error** error);
28207 InetAddressMask* /*new*/ g_inet_address_mask_new_from_string(char* mask_string, GLib2.Error** error);
28208 int g_inet_address_mask_equal(InetAddressMask* this_, InetAddressMask* mask2);
28209 InetAddress* g_inet_address_mask_get_address(InetAddressMask* this_);
28210 SocketFamily g_inet_address_mask_get_family(InetAddressMask* this_);
28211 uint g_inet_address_mask_get_length(InetAddressMask* this_);
28212 int g_inet_address_mask_matches(InetAddressMask* this_, InetAddress* address);
28213 char* /*new*/ g_inet_address_mask_to_string(InetAddressMask* this_);
28214 InetSocketAddress* /*new*/ g_inet_socket_address_new(InetAddress* address, ushort port);
28215 InetAddress* g_inet_socket_address_get_address(InetSocketAddress* this_);
28216 uint g_inet_socket_address_get_flowinfo(InetSocketAddress* this_);
28217 ushort g_inet_socket_address_get_port(InetSocketAddress* this_);
28218 uint g_inet_socket_address_get_scope_id(InetSocketAddress* this_);
28219 void* /*new*/ g_initable_new(Type object_type, Cancellable* cancellable, GLib2.Error** error, char* first_property_name, ...);
28220 GObject2.Object* /*new*/ g_initable_new_valist(Type object_type, char* first_property_name, va_list var_args, Cancellable* cancellable, GLib2.Error** error);
28221 void* /*new*/ g_initable_newv(Type object_type, uint n_parameters, GObject2.Parameter* parameters, Cancellable* cancellable, GLib2.Error** error);
28222 int g_initable_init(Initable* this_, Cancellable* cancellable, GLib2.Error** error);
28223 void g_input_stream_clear_pending(InputStream* this_);
28224 int g_input_stream_close(InputStream* this_, Cancellable* cancellable, GLib2.Error** error);
28225 void g_input_stream_close_async(InputStream* this_, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
28226 int g_input_stream_close_finish(InputStream* this_, AsyncResult* result, GLib2.Error** error);
28227 int g_input_stream_has_pending(InputStream* this_);
28228 int g_input_stream_is_closed(InputStream* this_);
28229 ssize_t g_input_stream_read(InputStream* this_, void* buffer, size_t count, Cancellable* cancellable, GLib2.Error** error);
28230 int g_input_stream_read_all(InputStream* this_, void* buffer, size_t count, /*out*/ size_t* bytes_read, Cancellable* cancellable, GLib2.Error** error);
28231 void g_input_stream_read_async(InputStream* this_, void* buffer, size_t count, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
28232 ssize_t g_input_stream_read_finish(InputStream* this_, AsyncResult* result, GLib2.Error** error);
28233 int g_input_stream_set_pending(InputStream* this_, GLib2.Error** error);
28234 ssize_t g_input_stream_skip(InputStream* this_, size_t count, Cancellable* cancellable, GLib2.Error** error);
28235 void g_input_stream_skip_async(InputStream* this_, size_t count, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
28236 ssize_t g_input_stream_skip_finish(InputStream* this_, AsyncResult* result, GLib2.Error** error);
28237 InputStream* /*new*/ g_loadable_icon_load(LoadableIcon* this_, int size, /*out*/ char** type, Cancellable* cancellable, GLib2.Error** error);
28238 void g_loadable_icon_load_async(LoadableIcon* this_, int size, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
28239 InputStream* /*new*/ g_loadable_icon_load_finish(LoadableIcon* this_, AsyncResult* res, char** type, GLib2.Error** error);
28240 MemoryInputStream* /*new*/ g_memory_input_stream_new();
28241 MemoryInputStream* /*new*/ g_memory_input_stream_new_from_data(ubyte* data, ssize_t len, GLib2.DestroyNotify destroy=null);
28242 void g_memory_input_stream_add_data(MemoryInputStream* this_, ubyte* data, ssize_t len, GLib2.DestroyNotify destroy=null);
28243 MemoryOutputStream* /*new*/ g_memory_output_stream_new(void* data, size_t size, ReallocFunc realloc_function, GLib2.DestroyNotify destroy_function);
28244 void* g_memory_output_stream_get_data(MemoryOutputStream* this_);
28245 size_t g_memory_output_stream_get_data_size(MemoryOutputStream* this_);
28246 size_t g_memory_output_stream_get_size(MemoryOutputStream* this_);
28247 void* /*new*/ g_memory_output_stream_steal_data(MemoryOutputStream* this_);
28248 Menu* /*new*/ g_menu_new();
28249 void g_menu_append(Menu* this_, char* label=null, char* detailed_action=null);
28250 void g_menu_append_item(Menu* this_, MenuItem* item);
28251 void g_menu_append_section(Menu* this_, char* label, MenuModel* section);
28252 void g_menu_append_submenu(Menu* this_, char* label, MenuModel* submenu);
28253 void g_menu_freeze(Menu* this_);
28254 void g_menu_insert(Menu* this_, int position, char* label=null, char* detailed_action=null);
28255 void g_menu_insert_item(Menu* this_, int position, MenuItem* item);
28256 void g_menu_insert_section(Menu* this_, int position, char* label, MenuModel* section);
28257 void g_menu_insert_submenu(Menu* this_, int position, char* label, MenuModel* submenu);
28258 void g_menu_prepend(Menu* this_, char* label=null, char* detailed_action=null);
28259 void g_menu_prepend_item(Menu* this_, MenuItem* item);
28260 void g_menu_prepend_section(Menu* this_, char* label, MenuModel* section);
28261 void g_menu_prepend_submenu(Menu* this_, char* label, MenuModel* submenu);
28262 void g_menu_remove(Menu* this_, int position);
28263 char* g_menu_attribute_iter_get_name(MenuAttributeIter* this_);
28264 int g_menu_attribute_iter_get_next(MenuAttributeIter* this_, /*out*/ char** out_name=null, /*out*/ GLib2.Variant** value=null);
28265 GLib2.Variant* /*new*/ g_menu_attribute_iter_get_value(MenuAttributeIter* this_);
28266 int g_menu_attribute_iter_next(MenuAttributeIter* this_);
28267 MenuItem* /*new*/ g_menu_item_new(char* label=null, char* detailed_action=null);
28268 MenuItem* /*new*/ g_menu_item_new_section(char* label, MenuModel* section);
28269 MenuItem* /*new*/ g_menu_item_new_submenu(char* label, MenuModel* submenu);
28270 void g_menu_item_set_action_and_target(MenuItem* this_, char* action=null, char* format_string=null, ...);
28271 void g_menu_item_set_action_and_target_value(MenuItem* this_, char* action=null, GLib2.Variant* target_value=null);
28272 void g_menu_item_set_attribute(MenuItem* this_, char* attribute, char* format_string=null, ...);
28273 void g_menu_item_set_attribute_value(MenuItem* this_, char* attribute, GLib2.Variant* value=null);
28274 void g_menu_item_set_detailed_action(MenuItem* this_, char* detailed_action);
28275 void g_menu_item_set_label(MenuItem* this_, char* label=null);
28276 void g_menu_item_set_link(MenuItem* this_, char* link, MenuModel* model=null);
28277 void g_menu_item_set_section(MenuItem* this_, MenuModel* section=null);
28278 void g_menu_item_set_submenu(MenuItem* this_, MenuModel* submenu=null);
28279 char* g_menu_link_iter_get_name(MenuLinkIter* this_);
28280 int g_menu_link_iter_get_next(MenuLinkIter* this_, /*out*/ char** out_link=null, /*out*/ MenuModel** value=null);
28281 MenuModel* /*new*/ g_menu_link_iter_get_value(MenuLinkIter* this_);
28282 int g_menu_link_iter_next(MenuLinkIter* this_);
28283 int g_menu_model_get_item_attribute(MenuModel* this_, int item_index, char* attribute, char* format_string, ...);
28284 GLib2.Variant* /*new*/ g_menu_model_get_item_attribute_value(MenuModel* this_, int item_index, char* attribute, GLib2.VariantType* expected_type=null);
28285 MenuModel* /*new*/ g_menu_model_get_item_link(MenuModel* this_, int item_index, char* link);
28286 int g_menu_model_get_n_items(MenuModel* this_);
28287 int g_menu_model_is_mutable(MenuModel* this_);
28288 void g_menu_model_items_changed(MenuModel* this_, int position, int removed, int added);
28289 MenuAttributeIter* /*new*/ g_menu_model_iterate_item_attributes(MenuModel* this_, int item_index);
28290 MenuLinkIter* /*new*/ g_menu_model_iterate_item_links(MenuModel* this_, int item_index);
28291 int g_mount_can_eject(Mount* this_);
28292 int g_mount_can_unmount(Mount* this_);
28293 void g_mount_eject(Mount* this_, MountUnmountFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
28294 int g_mount_eject_finish(Mount* this_, AsyncResult* result, GLib2.Error** error);
28295 void g_mount_eject_with_operation(Mount* this_, MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
28296 int g_mount_eject_with_operation_finish(Mount* this_, AsyncResult* result, GLib2.Error** error);
28297 File* /*new*/ g_mount_get_default_location(Mount* this_);
28298 Drive* /*new*/ g_mount_get_drive(Mount* this_);
28299 Icon* /*new*/ g_mount_get_icon(Mount* this_);
28300 char* /*new*/ g_mount_get_name(Mount* this_);
28301 File* /*new*/ g_mount_get_root(Mount* this_);
28302 char* g_mount_get_sort_key(Mount* this_);
28303 char* /*new*/ g_mount_get_uuid(Mount* this_);
28304 Volume* /*new*/ g_mount_get_volume(Mount* this_);
28305 void g_mount_guess_content_type(Mount* this_, int force_rescan, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
28306 char** /*new*/ g_mount_guess_content_type_finish(Mount* this_, AsyncResult* result, GLib2.Error** error);
28307 char** /*new*/ g_mount_guess_content_type_sync(Mount* this_, int force_rescan, Cancellable* cancellable, GLib2.Error** error);
28308 int g_mount_is_shadowed(Mount* this_);
28309 void g_mount_remount(Mount* this_, MountMountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
28310 int g_mount_remount_finish(Mount* this_, AsyncResult* result, GLib2.Error** error);
28311 void g_mount_shadow(Mount* this_);
28312 void g_mount_unmount(Mount* this_, MountUnmountFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
28313 int g_mount_unmount_finish(Mount* this_, AsyncResult* result, GLib2.Error** error);
28314 void g_mount_unmount_with_operation(Mount* this_, MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
28315 int g_mount_unmount_with_operation_finish(Mount* this_, AsyncResult* result, GLib2.Error** error);
28316 void g_mount_unshadow(Mount* this_);
28317 MountOperation* /*new*/ g_mount_operation_new();
28318 int g_mount_operation_get_anonymous(MountOperation* this_);
28319 int g_mount_operation_get_choice(MountOperation* this_);
28320 char* g_mount_operation_get_domain(MountOperation* this_);
28321 char* g_mount_operation_get_password(MountOperation* this_);
28322 PasswordSave g_mount_operation_get_password_save(MountOperation* this_);
28323 char* g_mount_operation_get_username(MountOperation* this_);
28324 void g_mount_operation_reply(MountOperation* this_, MountOperationResult result);
28325 void g_mount_operation_set_anonymous(MountOperation* this_, int anonymous);
28326 void g_mount_operation_set_choice(MountOperation* this_, int choice);
28327 void g_mount_operation_set_domain(MountOperation* this_, char* domain);
28328 void g_mount_operation_set_password(MountOperation* this_, char* password);
28329 void g_mount_operation_set_password_save(MountOperation* this_, PasswordSave save);
28330 void g_mount_operation_set_username(MountOperation* this_, char* username);
28331 NetworkAddress* /*new*/ g_network_address_new(char* hostname, ushort port);
28332 SocketConnectable* /*new*/ g_network_address_parse(char* host_and_port, ushort default_port, GLib2.Error** error);
28333 SocketConnectable* /*new*/ g_network_address_parse_uri(char* uri, ushort default_port, GLib2.Error** error);
28334 char* g_network_address_get_hostname(NetworkAddress* this_);
28335 ushort g_network_address_get_port(NetworkAddress* this_);
28336 char* g_network_address_get_scheme(NetworkAddress* this_);
28337 NetworkMonitor* g_network_monitor_get_default();
28338 int g_network_monitor_can_reach(NetworkMonitor* this_, SocketConnectable* connectable, Cancellable* cancellable, GLib2.Error** error);
28339 void g_network_monitor_can_reach_async(NetworkMonitor* this_, SocketConnectable* connectable, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
28340 int g_network_monitor_can_reach_finish(NetworkMonitor* this_, AsyncResult* result, GLib2.Error** error);
28341 int g_network_monitor_get_network_available(NetworkMonitor* this_);
28342 NetworkService* /*new*/ g_network_service_new(char* service, char* protocol, char* domain);
28343 char* g_network_service_get_domain(NetworkService* this_);
28344 char* g_network_service_get_protocol(NetworkService* this_);
28345 char* g_network_service_get_scheme(NetworkService* this_);
28346 char* g_network_service_get_service(NetworkService* this_);
28347 void g_network_service_set_scheme(NetworkService* this_, char* scheme);
28348 void g_output_stream_clear_pending(OutputStream* this_);
28349 int g_output_stream_close(OutputStream* this_, Cancellable* cancellable, GLib2.Error** error);
28350 void g_output_stream_close_async(OutputStream* this_, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
28351 int g_output_stream_close_finish(OutputStream* this_, AsyncResult* result, GLib2.Error** error);
28352 int g_output_stream_flush(OutputStream* this_, Cancellable* cancellable, GLib2.Error** error);
28353 void g_output_stream_flush_async(OutputStream* this_, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
28354 int g_output_stream_flush_finish(OutputStream* this_, AsyncResult* result, GLib2.Error** error);
28355 int g_output_stream_has_pending(OutputStream* this_);
28356 int g_output_stream_is_closed(OutputStream* this_);
28357 int g_output_stream_is_closing(OutputStream* this_);
28358 int g_output_stream_set_pending(OutputStream* this_, GLib2.Error** error);
28359 ssize_t g_output_stream_splice(OutputStream* this_, InputStream* source, OutputStreamSpliceFlags flags, Cancellable* cancellable, GLib2.Error** error);
28360 void g_output_stream_splice_async(OutputStream* this_, InputStream* source, OutputStreamSpliceFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
28361 ssize_t g_output_stream_splice_finish(OutputStream* this_, AsyncResult* result, GLib2.Error** error);
28362 ssize_t g_output_stream_write(OutputStream* this_, ubyte* buffer, size_t count, Cancellable* cancellable, GLib2.Error** error);
28363 int g_output_stream_write_all(OutputStream* this_, ubyte* buffer, size_t count, /*out*/ size_t* bytes_written, Cancellable* cancellable, GLib2.Error** error);
28364 void g_output_stream_write_async(OutputStream* this_, ubyte* buffer, size_t count, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
28365 ssize_t g_output_stream_write_finish(OutputStream* this_, AsyncResult* result, GLib2.Error** error);
28366 int g_permission_acquire(Permission* this_, Cancellable* cancellable, GLib2.Error** error);
28367 void g_permission_acquire_async(Permission* this_, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
28368 int g_permission_acquire_finish(Permission* this_, AsyncResult* result, GLib2.Error** error);
28369 int g_permission_get_allowed(Permission* this_);
28370 int g_permission_get_can_acquire(Permission* this_);
28371 int g_permission_get_can_release(Permission* this_);
28372 void g_permission_impl_update(Permission* this_, int allowed, int can_acquire, int can_release);
28373 int g_permission_release(Permission* this_, Cancellable* cancellable, GLib2.Error** error);
28374 void g_permission_release_async(Permission* this_, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
28375 int g_permission_release_finish(Permission* this_, AsyncResult* result, GLib2.Error** error);
28376 int g_pollable_input_stream_can_poll(PollableInputStream* this_);
28377 GLib2.Source* /*new*/ g_pollable_input_stream_create_source(PollableInputStream* this_, Cancellable* cancellable=null);
28378 int g_pollable_input_stream_is_readable(PollableInputStream* this_);
28379 ssize_t g_pollable_input_stream_read_nonblocking(PollableInputStream* this_, void* buffer, size_t size, Cancellable* cancellable, GLib2.Error** error);
28380 int g_pollable_output_stream_can_poll(PollableOutputStream* this_);
28381 GLib2.Source* /*new*/ g_pollable_output_stream_create_source(PollableOutputStream* this_, Cancellable* cancellable=null);
28382 int g_pollable_output_stream_is_writable(PollableOutputStream* this_);
28383 ssize_t g_pollable_output_stream_write_nonblocking(PollableOutputStream* this_, ubyte* buffer, size_t size, Cancellable* cancellable, GLib2.Error** error);
28384 Proxy* /*new*/ g_proxy_get_default_for_protocol(char* protocol);
28385 IOStream* /*new*/ g_proxy_connect(Proxy* this_, IOStream* connection, ProxyAddress* proxy_address, Cancellable* cancellable, GLib2.Error** error);
28386 void g_proxy_connect_async(Proxy* this_, IOStream* connection, ProxyAddress* proxy_address, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
28387 IOStream* /*new*/ g_proxy_connect_finish(Proxy* this_, AsyncResult* result, GLib2.Error** error);
28388 int g_proxy_supports_hostname(Proxy* this_);
28389 ProxyAddress* /*new*/ g_proxy_address_new(InetAddress* inetaddr, ushort port, char* protocol, char* dest_hostname, ushort dest_port, char* username=null, char* password=null);
28390 char* g_proxy_address_get_destination_hostname(ProxyAddress* this_);
28391 ushort g_proxy_address_get_destination_port(ProxyAddress* this_);
28392 char* g_proxy_address_get_password(ProxyAddress* this_);
28393 char* g_proxy_address_get_protocol(ProxyAddress* this_);
28394 char* g_proxy_address_get_username(ProxyAddress* this_);
28395 ProxyResolver* g_proxy_resolver_get_default();
28396 int g_proxy_resolver_is_supported(ProxyResolver* this_);
28397 char** /*new*/ g_proxy_resolver_lookup(ProxyResolver* this_, char* uri, Cancellable* cancellable, GLib2.Error** error);
28398 void g_proxy_resolver_lookup_async(ProxyResolver* this_, char* uri, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
28399 char** /*new*/ g_proxy_resolver_lookup_finish(ProxyResolver* this_, AsyncResult* result, GLib2.Error** error);
28400 void g_remote_action_group_activate_action_full(RemoteActionGroup* this_, char* action_name, GLib2.Variant* parameter, GLib2.Variant* platform_data);
28401 void g_remote_action_group_change_action_state_full(RemoteActionGroup* this_, char* action_name, GLib2.Variant* value, GLib2.Variant* platform_data);
28402 void g_resolver_free_addresses(GLib2.List* addresses);
28403 void g_resolver_free_targets(GLib2.List* targets);
28404 Resolver* /*new*/ g_resolver_get_default();
28405 char* /*new*/ g_resolver_lookup_by_address(Resolver* this_, InetAddress* address, Cancellable* cancellable, GLib2.Error** error);
28406 void g_resolver_lookup_by_address_async(Resolver* this_, InetAddress* address, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
28407 char* /*new*/ g_resolver_lookup_by_address_finish(Resolver* this_, AsyncResult* result, GLib2.Error** error);
28408 GLib2.List* /*new*/ g_resolver_lookup_by_name(Resolver* this_, char* hostname, Cancellable* cancellable, GLib2.Error** error);
28409 void g_resolver_lookup_by_name_async(Resolver* this_, char* hostname, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
28410 GLib2.List* /*new*/ g_resolver_lookup_by_name_finish(Resolver* this_, AsyncResult* result, GLib2.Error** error);
28411 GLib2.List* /*new*/ g_resolver_lookup_service(Resolver* this_, char* service, char* protocol, char* domain, Cancellable* cancellable, GLib2.Error** error);
28412 void g_resolver_lookup_service_async(Resolver* this_, char* service, char* protocol, char* domain, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
28413 GLib2.List* /*new*/ g_resolver_lookup_service_finish(Resolver* this_, AsyncResult* result, GLib2.Error** error);
28414 void g_resolver_set_default(Resolver* this_);
28415 Resource* /*new*/ g_resource_new_from_data(GLib2.Bytes* data, GLib2.Error** error);
28416 void g_resources_register(Resource* this_);
28417 void g_resources_unregister(Resource* this_);
28418 char** /*new*/ g_resource_enumerate_children(Resource* this_, char* path, ResourceLookupFlags lookup_flags, GLib2.Error** error);
28419 int g_resource_get_info(Resource* this_, char* path, ResourceLookupFlags lookup_flags, /*out*/ size_t* size, /*out*/ uint* flags, GLib2.Error** error);
28420 GLib2.Bytes* /*new*/ g_resource_lookup_data(Resource* this_, char* path, ResourceLookupFlags lookup_flags, GLib2.Error** error);
28421 InputStream* /*new*/ g_resource_open_stream(Resource* this_, char* path, ResourceLookupFlags lookup_flags, GLib2.Error** error);
28422 Resource* /*new*/ g_resource_ref(Resource* this_);
28423 void g_resource_unref(Resource* this_);
28424 Resource* /*new*/ g_resource_load(char* filename, GLib2.Error** error);
28425 int g_seekable_can_seek(Seekable* this_);
28426 int g_seekable_can_truncate(Seekable* this_);
28427 int g_seekable_seek(Seekable* this_, long offset, GLib2.SeekType type, Cancellable* cancellable, GLib2.Error** error);
28428 long g_seekable_tell(Seekable* this_);
28429 int g_seekable_truncate(Seekable* this_, long offset, Cancellable* cancellable, GLib2.Error** error);
28430 Settings* /*new*/ g_settings_new(char* schema_id);
28431 Settings* /*new*/ g_settings_new_full(SettingsSchema* schema, SettingsBackend* backend=null, char* path=null);
28432 Settings* /*new*/ g_settings_new_with_backend(char* schema_id, SettingsBackend* backend);
28433 Settings* /*new*/ g_settings_new_with_backend_and_path(char* schema_id, SettingsBackend* backend, char* path);
28434 Settings* /*new*/ g_settings_new_with_path(char* schema_id, char* path);
28435 char** g_settings_list_relocatable_schemas();
28436 char** g_settings_list_schemas();
28437 void g_settings_sync();
28438 void g_settings_unbind(void* object, char* property);
28439 void g_settings_apply(Settings* this_);
28440 void g_settings_bind(Settings* this_, char* key, GObject2.Object* object, char* property, SettingsBindFlags flags);
28441 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);
28442 void g_settings_bind_writable(Settings* this_, char* key, GObject2.Object* object, char* property, int inverted);
28443 Action* g_settings_create_action(Settings* this_, char* key);
28444 void g_settings_delay(Settings* this_);
28445 void g_settings_get(Settings* this_, char* key, char* format, ...);
28446 int g_settings_get_boolean(Settings* this_, char* key);
28447 Settings* /*new*/ g_settings_get_child(Settings* this_, char* name);
28448 double g_settings_get_double(Settings* this_, char* key);
28449 int g_settings_get_enum(Settings* this_, char* key);
28450 uint g_settings_get_flags(Settings* this_, char* key);
28451 int g_settings_get_has_unapplied(Settings* this_);
28452 int g_settings_get_int(Settings* this_, char* key);
28453 void* /*new*/ g_settings_get_mapped(Settings* this_, char* key, SettingsGetMapping mapping, void* user_data);
28454 GLib2.Variant* /*new*/ g_settings_get_range(Settings* this_, char* key);
28455 char* /*new*/ g_settings_get_string(Settings* this_, char* key);
28456 char** /*new*/ g_settings_get_strv(Settings* this_, char* key);
28457 uint g_settings_get_uint(Settings* this_, char* key);
28458 GLib2.Variant* /*new*/ g_settings_get_value(Settings* this_, char* key);
28459 int g_settings_is_writable(Settings* this_, char* name);
28460 char** /*new*/ g_settings_list_children(Settings* this_);
28461 char** /*new*/ g_settings_list_keys(Settings* this_);
28462 int g_settings_range_check(Settings* this_, char* key, GLib2.Variant* value);
28463 void g_settings_reset(Settings* this_, char* key);
28464 void g_settings_revert(Settings* this_);
28465 int g_settings_set(Settings* this_, char* key, char* format, ...);
28466 int g_settings_set_boolean(Settings* this_, char* key, int value);
28467 int g_settings_set_double(Settings* this_, char* key, double value);
28468 int g_settings_set_enum(Settings* this_, char* key, int value);
28469 int g_settings_set_flags(Settings* this_, char* key, uint value);
28470 int g_settings_set_int(Settings* this_, char* key, int value);
28471 int g_settings_set_string(Settings* this_, char* key, char* value);
28472 int g_settings_set_strv(Settings* this_, char* key, char** value=null);
28473 int g_settings_set_uint(Settings* this_, char* key, uint value);
28474 int g_settings_set_value(Settings* this_, char* key, GLib2.Variant* value);
28475 char* g_settings_schema_get_id(SettingsSchema* this_);
28476 char* g_settings_schema_get_path(SettingsSchema* this_);
28477 SettingsSchema* /*new*/ g_settings_schema_ref(SettingsSchema* this_);
28478 void g_settings_schema_unref(SettingsSchema* this_);
28479 SettingsSchemaSource* /*new*/ g_settings_schema_source_new_from_directory(char* directory, SettingsSchemaSource* parent, int trusted, GLib2.Error** error);
28480 SettingsSchema* /*new*/ g_settings_schema_source_lookup(SettingsSchemaSource* this_, char* schema_id, int recursive);
28481 SettingsSchemaSource* /*new*/ g_settings_schema_source_ref(SettingsSchemaSource* this_);
28482 void g_settings_schema_source_unref(SettingsSchemaSource* this_);
28483 SettingsSchemaSource* g_settings_schema_source_get_default();
28484 SimpleAction* /*new*/ g_simple_action_new(char* name, GLib2.VariantType* parameter_type=null);
28485 SimpleAction* /*new*/ g_simple_action_new_stateful(char* name, GLib2.VariantType* parameter_type, GLib2.Variant* state);
28486 void g_simple_action_set_enabled(SimpleAction* this_, int enabled);
28487 void g_simple_action_set_state(SimpleAction* this_, GLib2.Variant* value);
28488 SimpleActionGroup* /*new*/ g_simple_action_group_new();
28489 void g_simple_action_group_add_entries(SimpleActionGroup* this_, ActionEntry* entries, int n_entries, void* user_data);
28490 void g_simple_action_group_insert(SimpleActionGroup* this_, Action* action);
28491 Action* g_simple_action_group_lookup(SimpleActionGroup* this_, char* action_name);
28492 void g_simple_action_group_remove(SimpleActionGroup* this_, char* action_name);
28493 SimpleAsyncResult* /*new*/ g_simple_async_result_new(GObject2.Object* source_object, AsyncReadyCallback callback, void* user_data, void* source_tag);
28494 SimpleAsyncResult* /*new*/ g_simple_async_result_new_error(GObject2.Object* source_object, AsyncReadyCallback callback, void* user_data, GLib2.Quark domain, int code, char* format, ...);
28495 SimpleAsyncResult* /*new*/ g_simple_async_result_new_from_error(GObject2.Object* source_object, AsyncReadyCallback callback, void* user_data, GLib2.Error* error);
28496 SimpleAsyncResult* /*new*/ g_simple_async_result_new_take_error(GObject2.Object* source_object, AsyncReadyCallback callback, void* user_data, GLib2.Error* error);
28497 int g_simple_async_result_is_valid(AsyncResult* result, GObject2.Object* source, void* source_tag);
28498 void g_simple_async_result_complete(SimpleAsyncResult* this_);
28499 void g_simple_async_result_complete_in_idle(SimpleAsyncResult* this_);
28500 int g_simple_async_result_get_op_res_gboolean(SimpleAsyncResult* this_);
28501 void* g_simple_async_result_get_op_res_gpointer(SimpleAsyncResult* this_);
28502 ssize_t g_simple_async_result_get_op_res_gssize(SimpleAsyncResult* this_);
28503 void* g_simple_async_result_get_source_tag(SimpleAsyncResult* this_);
28504 int g_simple_async_result_propagate_error(SimpleAsyncResult* this_, GLib2.Error** error);
28505 void g_simple_async_result_run_in_thread(SimpleAsyncResult* this_, SimpleAsyncThreadFunc func, int io_priority, Cancellable* cancellable=null);
28506 void g_simple_async_result_set_error(SimpleAsyncResult* this_, GLib2.Quark domain, int code, char* format, ...);
28507 void g_simple_async_result_set_error_va(SimpleAsyncResult* this_, GLib2.Quark domain, int code, char* format, va_list args);
28508 void g_simple_async_result_set_from_error(SimpleAsyncResult* this_, GLib2.Error* error);
28509 void g_simple_async_result_set_handle_cancellation(SimpleAsyncResult* this_, int handle_cancellation);
28510 void g_simple_async_result_set_op_res_gboolean(SimpleAsyncResult* this_, int op_res);
28511 void g_simple_async_result_set_op_res_gpointer(SimpleAsyncResult* this_, void* op_res, GLib2.DestroyNotify destroy_op_res);
28512 void g_simple_async_result_set_op_res_gssize(SimpleAsyncResult* this_, ssize_t op_res);
28513 void g_simple_async_result_take_error(SimpleAsyncResult* this_, GLib2.Error* error);
28514 SimplePermission* /*new*/ g_simple_permission_new(int allowed);
28515 Socket* /*new*/ g_socket_new(SocketFamily family, SocketType type, SocketProtocol protocol, GLib2.Error** error);
28516 Socket* /*new*/ g_socket_new_from_fd(int fd, GLib2.Error** error);
28517 Socket* /*new*/ g_socket_accept(Socket* this_, Cancellable* cancellable, GLib2.Error** error);
28518 int g_socket_bind(Socket* this_, SocketAddress* address, int allow_reuse, GLib2.Error** error);
28519 int g_socket_check_connect_result(Socket* this_, GLib2.Error** error);
28520 int g_socket_close(Socket* this_, GLib2.Error** error);
28521 GLib2.IOCondition g_socket_condition_check(Socket* this_, GLib2.IOCondition condition);
28522 int g_socket_condition_wait(Socket* this_, GLib2.IOCondition condition, Cancellable* cancellable, GLib2.Error** error);
28523 int g_socket_connect(Socket* this_, SocketAddress* address, Cancellable* cancellable, GLib2.Error** error);
28524 SocketConnection* /*new*/ g_socket_connection_factory_create_connection(Socket* this_);
28525 GLib2.Source* /*new*/ g_socket_create_source(Socket* this_, GLib2.IOCondition condition, Cancellable* cancellable=null);
28526 ssize_t g_socket_get_available_bytes(Socket* this_);
28527 int g_socket_get_blocking(Socket* this_);
28528 int g_socket_get_broadcast(Socket* this_);
28529 Credentials* /*new*/ g_socket_get_credentials(Socket* this_, GLib2.Error** error);
28530 SocketFamily g_socket_get_family(Socket* this_);
28531 int g_socket_get_fd(Socket* this_);
28532 int g_socket_get_keepalive(Socket* this_);
28533 int g_socket_get_listen_backlog(Socket* this_);
28534 SocketAddress* /*new*/ g_socket_get_local_address(Socket* this_, GLib2.Error** error);
28535 int g_socket_get_multicast_loopback(Socket* this_);
28536 uint g_socket_get_multicast_ttl(Socket* this_);
28537 SocketProtocol g_socket_get_protocol(Socket* this_);
28538 SocketAddress* /*new*/ g_socket_get_remote_address(Socket* this_, GLib2.Error** error);
28539 SocketType g_socket_get_socket_type(Socket* this_);
28540 uint g_socket_get_timeout(Socket* this_);
28541 uint g_socket_get_ttl(Socket* this_);
28542 int g_socket_is_closed(Socket* this_);
28543 int g_socket_is_connected(Socket* this_);
28544 int g_socket_join_multicast_group(Socket* this_, InetAddress* group, int source_specific, char* iface, GLib2.Error** error);
28545 int g_socket_leave_multicast_group(Socket* this_, InetAddress* group, int source_specific, char* iface, GLib2.Error** error);
28546 int g_socket_listen(Socket* this_, GLib2.Error** error);
28547 ssize_t g_socket_receive(Socket* this_, char* buffer, size_t size, Cancellable* cancellable, GLib2.Error** error);
28548 ssize_t g_socket_receive_from(Socket* this_, /*out*/ SocketAddress** address, ubyte* buffer, size_t size, Cancellable* cancellable, GLib2.Error** error);
28549 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);
28550 ssize_t g_socket_receive_with_blocking(Socket* this_, char* buffer, size_t size, int blocking, Cancellable* cancellable, GLib2.Error** error);
28551 ssize_t g_socket_send(Socket* this_, ubyte* buffer, size_t size, Cancellable* cancellable, GLib2.Error** error);
28552 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);
28553 ssize_t g_socket_send_to(Socket* this_, SocketAddress* address, ubyte* buffer, size_t size, Cancellable* cancellable, GLib2.Error** error);
28554 ssize_t g_socket_send_with_blocking(Socket* this_, ubyte* buffer, size_t size, int blocking, Cancellable* cancellable, GLib2.Error** error);
28555 void g_socket_set_blocking(Socket* this_, int blocking);
28556 void g_socket_set_broadcast(Socket* this_, int broadcast);
28557 void g_socket_set_keepalive(Socket* this_, int keepalive);
28558 void g_socket_set_listen_backlog(Socket* this_, int backlog);
28559 void g_socket_set_multicast_loopback(Socket* this_, int loopback);
28560 void g_socket_set_multicast_ttl(Socket* this_, uint ttl);
28561 void g_socket_set_timeout(Socket* this_, uint timeout);
28562 void g_socket_set_ttl(Socket* this_, uint ttl);
28563 int g_socket_shutdown(Socket* this_, int shutdown_read, int shutdown_write, GLib2.Error** error);
28564 int g_socket_speaks_ipv4(Socket* this_);
28565 SocketAddress* /*new*/ g_socket_address_new_from_native(void* native, size_t len);
28566 SocketFamily g_socket_address_get_family(SocketAddress* this_);
28567 ssize_t g_socket_address_get_native_size(SocketAddress* this_);
28568 int g_socket_address_to_native(SocketAddress* this_, void* dest, size_t destlen, GLib2.Error** error);
28569 SocketAddress* /*new*/ g_socket_address_enumerator_next(SocketAddressEnumerator* this_, Cancellable* cancellable, GLib2.Error** error);
28570 void g_socket_address_enumerator_next_async(SocketAddressEnumerator* this_, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
28571 SocketAddress* /*new*/ g_socket_address_enumerator_next_finish(SocketAddressEnumerator* this_, AsyncResult* result, GLib2.Error** error);
28572 SocketClient* /*new*/ g_socket_client_new();
28573 void g_socket_client_add_application_proxy(SocketClient* this_, char* protocol);
28574 SocketConnection* /*new*/ g_socket_client_connect(SocketClient* this_, SocketConnectable* connectable, Cancellable* cancellable, GLib2.Error** error);
28575 void g_socket_client_connect_async(SocketClient* this_, SocketConnectable* connectable, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
28576 SocketConnection* /*new*/ g_socket_client_connect_finish(SocketClient* this_, AsyncResult* result, GLib2.Error** error);
28577 SocketConnection* /*new*/ g_socket_client_connect_to_host(SocketClient* this_, char* host_and_port, ushort default_port, Cancellable* cancellable, GLib2.Error** error);
28578 void g_socket_client_connect_to_host_async(SocketClient* this_, char* host_and_port, ushort default_port, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
28579 SocketConnection* /*new*/ g_socket_client_connect_to_host_finish(SocketClient* this_, AsyncResult* result, GLib2.Error** error);
28580 SocketConnection* /*new*/ g_socket_client_connect_to_service(SocketClient* this_, char* domain, char* service, Cancellable* cancellable, GLib2.Error** error);
28581 void g_socket_client_connect_to_service_async(SocketClient* this_, char* domain, char* service, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
28582 SocketConnection* /*new*/ g_socket_client_connect_to_service_finish(SocketClient* this_, AsyncResult* result, GLib2.Error** error);
28583 SocketConnection* /*new*/ g_socket_client_connect_to_uri(SocketClient* this_, char* uri, ushort default_port, Cancellable* cancellable, GLib2.Error** error);
28584 void g_socket_client_connect_to_uri_async(SocketClient* this_, char* uri, ushort default_port, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
28585 SocketConnection* /*new*/ g_socket_client_connect_to_uri_finish(SocketClient* this_, AsyncResult* result, GLib2.Error** error);
28586 int g_socket_client_get_enable_proxy(SocketClient* this_);
28587 SocketFamily g_socket_client_get_family(SocketClient* this_);
28588 SocketAddress* g_socket_client_get_local_address(SocketClient* this_);
28589 SocketProtocol g_socket_client_get_protocol(SocketClient* this_);
28590 SocketType g_socket_client_get_socket_type(SocketClient* this_);
28591 uint g_socket_client_get_timeout(SocketClient* this_);
28592 int g_socket_client_get_tls(SocketClient* this_);
28593 TlsCertificateFlags g_socket_client_get_tls_validation_flags(SocketClient* this_);
28594 void g_socket_client_set_enable_proxy(SocketClient* this_, int enable);
28595 void g_socket_client_set_family(SocketClient* this_, SocketFamily family);
28596 void g_socket_client_set_local_address(SocketClient* this_, SocketAddress* address);
28597 void g_socket_client_set_protocol(SocketClient* this_, SocketProtocol protocol);
28598 void g_socket_client_set_socket_type(SocketClient* this_, SocketType type);
28599 void g_socket_client_set_timeout(SocketClient* this_, uint timeout);
28600 void g_socket_client_set_tls(SocketClient* this_, int tls);
28601 void g_socket_client_set_tls_validation_flags(SocketClient* this_, TlsCertificateFlags flags);
28602 SocketAddressEnumerator* /*new*/ g_socket_connectable_enumerate(SocketConnectable* this_);
28603 SocketAddressEnumerator* /*new*/ g_socket_connectable_proxy_enumerate(SocketConnectable* this_);
28604 Type g_socket_connection_factory_lookup_type(SocketFamily family, SocketType type, int protocol_id);
28605 void g_socket_connection_factory_register_type(Type g_type, SocketFamily family, SocketType type, int protocol);
28606 int g_socket_connection_connect(SocketConnection* this_, SocketAddress* address, Cancellable* cancellable, GLib2.Error** error);
28607 void g_socket_connection_connect_async(SocketConnection* this_, SocketAddress* address, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
28608 int g_socket_connection_connect_finish(SocketConnection* this_, AsyncResult* result, GLib2.Error** error);
28609 SocketAddress* /*new*/ g_socket_connection_get_local_address(SocketConnection* this_, GLib2.Error** error);
28610 SocketAddress* /*new*/ g_socket_connection_get_remote_address(SocketConnection* this_, GLib2.Error** error);
28611 Socket* g_socket_connection_get_socket(SocketConnection* this_);
28612 int g_socket_connection_is_connected(SocketConnection* this_);
28613 SocketControlMessage* /*new*/ g_socket_control_message_deserialize(int level, int type, size_t size, void* data);
28614 int g_socket_control_message_get_level(SocketControlMessage* this_);
28615 int g_socket_control_message_get_msg_type(SocketControlMessage* this_);
28616 size_t g_socket_control_message_get_size(SocketControlMessage* this_);
28617 void g_socket_control_message_serialize(SocketControlMessage* this_, void* data);
28618 SocketListener* /*new*/ g_socket_listener_new();
28619 SocketConnection* /*new*/ g_socket_listener_accept(SocketListener* this_, /*out*/ GObject2.Object** source_object, Cancellable* cancellable, GLib2.Error** error);
28620 void g_socket_listener_accept_async(SocketListener* this_, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
28621 SocketConnection* /*new*/ g_socket_listener_accept_finish(SocketListener* this_, AsyncResult* result, /*out*/ GObject2.Object** source_object, GLib2.Error** error);
28622 Socket* /*new*/ g_socket_listener_accept_socket(SocketListener* this_, /*out*/ GObject2.Object** source_object, Cancellable* cancellable, GLib2.Error** error);
28623 void g_socket_listener_accept_socket_async(SocketListener* this_, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
28624 Socket* /*new*/ g_socket_listener_accept_socket_finish(SocketListener* this_, AsyncResult* result, /*out*/ GObject2.Object** source_object, GLib2.Error** error);
28625 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);
28626 ushort g_socket_listener_add_any_inet_port(SocketListener* this_, GObject2.Object* source_object, GLib2.Error** error);
28627 int g_socket_listener_add_inet_port(SocketListener* this_, ushort port, GObject2.Object* source_object, GLib2.Error** error);
28628 int g_socket_listener_add_socket(SocketListener* this_, Socket* socket, GObject2.Object* source_object, GLib2.Error** error);
28629 void g_socket_listener_close(SocketListener* this_);
28630 void g_socket_listener_set_backlog(SocketListener* this_, int listen_backlog);
28631 SocketService* /*new*/ g_socket_service_new();
28632 int g_socket_service_is_active(SocketService* this_);
28633 void g_socket_service_start(SocketService* this_);
28634 void g_socket_service_stop(SocketService* this_);
28635 SrvTarget* /*new*/ g_srv_target_new(char* hostname, ushort port, ushort priority, ushort weight);
28636 SrvTarget* /*new*/ g_srv_target_copy(SrvTarget* this_);
28637 void g_srv_target_free(SrvTarget* this_);
28638 char* g_srv_target_get_hostname(SrvTarget* this_);
28639 ushort g_srv_target_get_port(SrvTarget* this_);
28640 ushort g_srv_target_get_priority(SrvTarget* this_);
28641 ushort g_srv_target_get_weight(SrvTarget* this_);
28642 GLib2.List* /*new*/ g_srv_target_list_sort(GLib2.List* targets);
28643 void g_static_resource_fini(StaticResource* this_);
28644 Resource* /*new*/ g_static_resource_get_resource(StaticResource* this_);
28645 void g_static_resource_init(StaticResource* this_);
28646 int g_tcp_connection_get_graceful_disconnect(TcpConnection* this_);
28647 void g_tcp_connection_set_graceful_disconnect(TcpConnection* this_, int graceful_disconnect);
28648 TcpWrapperConnection* /*new*/ g_tcp_wrapper_connection_new(IOStream* base_io_stream, Socket* socket);
28649 IOStream* g_tcp_wrapper_connection_get_base_io_stream(TcpWrapperConnection* this_);
28650 ThemedIcon* /*new*/ g_themed_icon_new(char* iconname);
28651 ThemedIcon* /*new*/ g_themed_icon_new_from_names(char** iconnames, int len);
28652 ThemedIcon* /*new*/ g_themed_icon_new_with_default_fallbacks(char* iconname);
28653 void g_themed_icon_append_name(ThemedIcon* this_, char* iconname);
28654 char** g_themed_icon_get_names(ThemedIcon* this_);
28655 void g_themed_icon_prepend_name(ThemedIcon* this_, char* iconname);
28656 ThreadedSocketService* /*new*/ g_threaded_socket_service_new(int max_threads);
28657 TlsBackend* g_tls_backend_get_default();
28658 Type g_tls_backend_get_certificate_type(TlsBackend* this_);
28659 Type g_tls_backend_get_client_connection_type(TlsBackend* this_);
28660 TlsDatabase* /*new*/ g_tls_backend_get_default_database(TlsBackend* this_);
28661 Type g_tls_backend_get_file_database_type(TlsBackend* this_);
28662 Type g_tls_backend_get_server_connection_type(TlsBackend* this_);
28663 int g_tls_backend_supports_tls(TlsBackend* this_);
28664 TlsCertificate* /*new*/ g_tls_certificate_new_from_file(char* file, GLib2.Error** error);
28665 TlsCertificate* /*new*/ g_tls_certificate_new_from_files(char* cert_file, char* key_file, GLib2.Error** error);
28666 TlsCertificate* /*new*/ g_tls_certificate_new_from_pem(char* data, ssize_t length, GLib2.Error** error);
28667 GLib2.List* /*new*/ g_tls_certificate_list_new_from_file(char* file, GLib2.Error** error);
28668 TlsCertificate* g_tls_certificate_get_issuer(TlsCertificate* this_);
28669 TlsCertificateFlags g_tls_certificate_verify(TlsCertificate* this_, SocketConnectable* identity=null, TlsCertificate* trusted_ca=null);
28670 TlsClientConnection* /*new*/ g_tls_client_connection_new(IOStream* base_io_stream, SocketConnectable* server_identity, GLib2.Error** error);
28671 GLib2.List* /*new*/ g_tls_client_connection_get_accepted_cas(TlsClientConnection* this_);
28672 SocketConnectable* g_tls_client_connection_get_server_identity(TlsClientConnection* this_);
28673 int g_tls_client_connection_get_use_ssl3(TlsClientConnection* this_);
28674 TlsCertificateFlags g_tls_client_connection_get_validation_flags(TlsClientConnection* this_);
28675 void g_tls_client_connection_set_server_identity(TlsClientConnection* this_, SocketConnectable* identity);
28676 void g_tls_client_connection_set_use_ssl3(TlsClientConnection* this_, int use_ssl3);
28677 void g_tls_client_connection_set_validation_flags(TlsClientConnection* this_, TlsCertificateFlags flags);
28678 int g_tls_connection_emit_accept_certificate(TlsConnection* this_, TlsCertificate* peer_cert, TlsCertificateFlags errors);
28679 TlsCertificate* g_tls_connection_get_certificate(TlsConnection* this_);
28680 TlsDatabase* g_tls_connection_get_database(TlsConnection* this_);
28681 TlsInteraction* g_tls_connection_get_interaction(TlsConnection* this_);
28682 TlsCertificate* g_tls_connection_get_peer_certificate(TlsConnection* this_);
28683 TlsCertificateFlags g_tls_connection_get_peer_certificate_errors(TlsConnection* this_);
28684 TlsRehandshakeMode g_tls_connection_get_rehandshake_mode(TlsConnection* this_);
28685 int g_tls_connection_get_require_close_notify(TlsConnection* this_);
28686 int g_tls_connection_get_use_system_certdb(TlsConnection* this_);
28687 int g_tls_connection_handshake(TlsConnection* this_, Cancellable* cancellable, GLib2.Error** error);
28688 void g_tls_connection_handshake_async(TlsConnection* this_, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
28689 int g_tls_connection_handshake_finish(TlsConnection* this_, AsyncResult* result, GLib2.Error** error);
28690 void g_tls_connection_set_certificate(TlsConnection* this_, TlsCertificate* certificate);
28691 void g_tls_connection_set_database(TlsConnection* this_, TlsDatabase* database);
28692 void g_tls_connection_set_interaction(TlsConnection* this_, TlsInteraction* interaction=null);
28693 void g_tls_connection_set_rehandshake_mode(TlsConnection* this_, TlsRehandshakeMode mode);
28694 void g_tls_connection_set_require_close_notify(TlsConnection* this_, int require_close_notify);
28695 void g_tls_connection_set_use_system_certdb(TlsConnection* this_, int use_system_certdb);
28696 char* /*new*/ g_tls_database_create_certificate_handle(TlsDatabase* this_, TlsCertificate* certificate);
28697 TlsCertificate* /*new*/ g_tls_database_lookup_certificate_for_handle(TlsDatabase* this_, char* handle, TlsInteraction* interaction, TlsDatabaseLookupFlags flags, Cancellable* cancellable, GLib2.Error** error);
28698 void g_tls_database_lookup_certificate_for_handle_async(TlsDatabase* this_, char* handle, TlsInteraction* interaction, TlsDatabaseLookupFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
28699 TlsCertificate* /*new*/ g_tls_database_lookup_certificate_for_handle_finish(TlsDatabase* this_, AsyncResult* result, GLib2.Error** error);
28700 TlsCertificate* /*new*/ g_tls_database_lookup_certificate_issuer(TlsDatabase* this_, TlsCertificate* certificate, TlsInteraction* interaction, TlsDatabaseLookupFlags flags, Cancellable* cancellable, GLib2.Error** error);
28701 void g_tls_database_lookup_certificate_issuer_async(TlsDatabase* this_, TlsCertificate* certificate, TlsInteraction* interaction, TlsDatabaseLookupFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
28702 TlsCertificate* /*new*/ g_tls_database_lookup_certificate_issuer_finish(TlsDatabase* this_, AsyncResult* result, GLib2.Error** error);
28703 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);
28704 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);
28705 GLib2.List* /*new*/ g_tls_database_lookup_certificates_issued_by_finish(TlsDatabase* this_, AsyncResult* result, GLib2.Error** error);
28706 TlsCertificateFlags g_tls_database_verify_chain(TlsDatabase* this_, TlsCertificate* chain, char* purpose, SocketConnectable* identity, TlsInteraction* interaction, TlsDatabaseVerifyFlags flags, Cancellable* cancellable, GLib2.Error** error);
28707 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);
28708 TlsCertificateFlags g_tls_database_verify_chain_finish(TlsDatabase* this_, AsyncResult* result, GLib2.Error** error);
28709 TlsFileDatabase* /*new*/ g_tls_file_database_new(char* anchors, GLib2.Error** error);
28710 TlsInteractionResult g_tls_interaction_ask_password(TlsInteraction* this_, TlsPassword* password, Cancellable* cancellable, GLib2.Error** error);
28711 void g_tls_interaction_ask_password_async(TlsInteraction* this_, TlsPassword* password, Cancellable* cancellable=null, AsyncReadyCallback callback=null, void* user_data=null);
28712 TlsInteractionResult g_tls_interaction_ask_password_finish(TlsInteraction* this_, AsyncResult* result, GLib2.Error** error);
28713 TlsInteractionResult g_tls_interaction_invoke_ask_password(TlsInteraction* this_, TlsPassword* password, Cancellable* cancellable, GLib2.Error** error);
28714 TlsPassword* /*new*/ g_tls_password_new(TlsPasswordFlags flags, char* description);
28715 char* g_tls_password_get_description(TlsPassword* this_);
28716 TlsPasswordFlags g_tls_password_get_flags(TlsPassword* this_);
28717 ubyte* g_tls_password_get_value(TlsPassword* this_, size_t* length=null);
28718 char* g_tls_password_get_warning(TlsPassword* this_);
28719 void g_tls_password_set_description(TlsPassword* this_, char* description);
28720 void g_tls_password_set_flags(TlsPassword* this_, TlsPasswordFlags flags);
28721 void g_tls_password_set_value(TlsPassword* this_, ubyte* value, ssize_t length);
28722 void g_tls_password_set_value_full(TlsPassword* this_, ubyte* value, ssize_t length, GLib2.DestroyNotify destroy=null);
28723 void g_tls_password_set_warning(TlsPassword* this_, char* warning);
28724 TlsServerConnection* /*new*/ g_tls_server_connection_new(IOStream* base_io_stream, TlsCertificate* certificate, GLib2.Error** error);
28725 Credentials* /*new*/ g_unix_connection_receive_credentials(UnixConnection* this_, Cancellable* cancellable, GLib2.Error** error);
28726 void g_unix_connection_receive_credentials_async(UnixConnection* this_, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
28727 Credentials* /*new*/ g_unix_connection_receive_credentials_finish(UnixConnection* this_, AsyncResult* result, GLib2.Error** error);
28728 int g_unix_connection_receive_fd(UnixConnection* this_, Cancellable* cancellable, GLib2.Error** error);
28729 int g_unix_connection_send_credentials(UnixConnection* this_, Cancellable* cancellable, GLib2.Error** error);
28730 void g_unix_connection_send_credentials_async(UnixConnection* this_, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
28731 int g_unix_connection_send_credentials_finish(UnixConnection* this_, AsyncResult* result, GLib2.Error** error);
28732 int g_unix_connection_send_fd(UnixConnection* this_, int fd, Cancellable* cancellable, GLib2.Error** error);
28733 UnixCredentialsMessage* /*new*/ g_unix_credentials_message_new();
28734 UnixCredentialsMessage* /*new*/ g_unix_credentials_message_new_with_credentials(Credentials* credentials);
28735 int g_unix_credentials_message_is_supported();
28736 Credentials* g_unix_credentials_message_get_credentials(UnixCredentialsMessage* this_);
28737 UnixFDList* /*new*/ g_unix_fd_list_new();
28738 UnixFDList* /*new*/ g_unix_fd_list_new_from_array(int* fds, int n_fds);
28739 int g_unix_fd_list_append(UnixFDList* this_, int fd, GLib2.Error** error);
28740 int g_unix_fd_list_get(UnixFDList* this_, int index_, GLib2.Error** error);
28741 int g_unix_fd_list_get_length(UnixFDList* this_);
28742 int* g_unix_fd_list_peek_fds(UnixFDList* this_, /*out*/ int* length=null);
28743 int* /*new*/ g_unix_fd_list_steal_fds(UnixFDList* this_, /*out*/ int* length=null);
28744 UnixFDMessage* /*new*/ g_unix_fd_message_new();
28745 UnixFDMessage* /*new*/ g_unix_fd_message_new_with_fd_list(UnixFDList* fd_list);
28746 int g_unix_fd_message_append_fd(UnixFDMessage* this_, int fd, GLib2.Error** error);
28747 UnixFDList* g_unix_fd_message_get_fd_list(UnixFDMessage* this_);
28748 int* /*new*/ g_unix_fd_message_steal_fds(UnixFDMessage* this_, /*out*/ int* length=null);
28749 UnixInputStream* /*new*/ g_unix_input_stream_new(int fd, int close_fd);
28750 int g_unix_input_stream_get_close_fd(UnixInputStream* this_);
28751 int g_unix_input_stream_get_fd(UnixInputStream* this_);
28752 void g_unix_input_stream_set_close_fd(UnixInputStream* this_, int close_fd);
28753 UnixMountMonitor* /*new*/ g_unix_mount_monitor_new();
28754 void g_unix_mount_monitor_set_rate_limit(UnixMountMonitor* this_, int limit_msec);
28755 int g_unix_mount_point_compare(UnixMountPoint* this_, UnixMountPoint* mount2);
28756 void g_unix_mount_point_free(UnixMountPoint* this_);
28757 char* g_unix_mount_point_get_device_path(UnixMountPoint* this_);
28758 char* g_unix_mount_point_get_fs_type(UnixMountPoint* this_);
28759 char* g_unix_mount_point_get_mount_path(UnixMountPoint* this_);
28760 char* g_unix_mount_point_get_options(UnixMountPoint* this_);
28761 int g_unix_mount_point_guess_can_eject(UnixMountPoint* this_);
28762 Icon* /*new*/ g_unix_mount_point_guess_icon(UnixMountPoint* this_);
28763 char* /*new*/ g_unix_mount_point_guess_name(UnixMountPoint* this_);
28764 int g_unix_mount_point_is_loopback(UnixMountPoint* this_);
28765 int g_unix_mount_point_is_readonly(UnixMountPoint* this_);
28766 int g_unix_mount_point_is_user_mountable(UnixMountPoint* this_);
28767 UnixOutputStream* /*new*/ g_unix_output_stream_new(int fd, int close_fd);
28768 int g_unix_output_stream_get_close_fd(UnixOutputStream* this_);
28769 int g_unix_output_stream_get_fd(UnixOutputStream* this_);
28770 void g_unix_output_stream_set_close_fd(UnixOutputStream* this_, int close_fd);
28771 UnixSocketAddress* /*new*/ g_unix_socket_address_new(char* path);
28772 UnixSocketAddress* /*new*/ g_unix_socket_address_new_abstract(char* path, int path_len);
28773 UnixSocketAddress* /*new*/ g_unix_socket_address_new_with_type(char* path, int path_len, UnixSocketAddressType type);
28774 int g_unix_socket_address_abstract_names_supported();
28775 UnixSocketAddressType g_unix_socket_address_get_address_type(UnixSocketAddress* this_);
28776 int g_unix_socket_address_get_is_abstract(UnixSocketAddress* this_);
28777 char* g_unix_socket_address_get_path(UnixSocketAddress* this_);
28778 size_t g_unix_socket_address_get_path_len(UnixSocketAddress* this_);
28779 Vfs* g_vfs_get_default();
28780 Vfs* g_vfs_get_local();
28781 File* /*new*/ g_vfs_get_file_for_path(Vfs* this_, char* path);
28782 File* /*new*/ g_vfs_get_file_for_uri(Vfs* this_, char* uri);
28783 char** g_vfs_get_supported_uri_schemes(Vfs* this_);
28784 int g_vfs_is_active(Vfs* this_);
28785 File* /*new*/ g_vfs_parse_name(Vfs* this_, char* parse_name);
28786 int g_volume_can_eject(Volume* this_);
28787 int g_volume_can_mount(Volume* this_);
28788 void g_volume_eject(Volume* this_, MountUnmountFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
28789 int g_volume_eject_finish(Volume* this_, AsyncResult* result, GLib2.Error** error);
28790 void g_volume_eject_with_operation(Volume* this_, MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
28791 int g_volume_eject_with_operation_finish(Volume* this_, AsyncResult* result, GLib2.Error** error);
28792 char** /*new*/ g_volume_enumerate_identifiers(Volume* this_);
28793 File* /*new*/ g_volume_get_activation_root(Volume* this_);
28794 Drive* /*new*/ g_volume_get_drive(Volume* this_);
28795 Icon* /*new*/ g_volume_get_icon(Volume* this_);
28796 char* /*new*/ g_volume_get_identifier(Volume* this_, char* kind);
28797 Mount* /*new*/ g_volume_get_mount(Volume* this_);
28798 char* /*new*/ g_volume_get_name(Volume* this_);
28799 char* g_volume_get_sort_key(Volume* this_);
28800 char* /*new*/ g_volume_get_uuid(Volume* this_);
28801 void g_volume_mount(Volume* this_, MountMountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
28802 int g_volume_mount_finish(Volume* this_, AsyncResult* result, GLib2.Error** error);
28803 int g_volume_should_automount(Volume* this_);
28804 Volume* /*new*/ g_volume_monitor_adopt_orphan_mount(Mount* mount);
28805 VolumeMonitor* /*new*/ g_volume_monitor_get();
28806 GLib2.List* /*new*/ g_volume_monitor_get_connected_drives(VolumeMonitor* this_);
28807 Mount* /*new*/ g_volume_monitor_get_mount_for_uuid(VolumeMonitor* this_, char* uuid);
28808 GLib2.List* /*new*/ g_volume_monitor_get_mounts(VolumeMonitor* this_);
28809 Volume* /*new*/ g_volume_monitor_get_volume_for_uuid(VolumeMonitor* this_, char* uuid);
28810 GLib2.List* /*new*/ g_volume_monitor_get_volumes(VolumeMonitor* this_);
28811 ZlibCompressor* /*new*/ g_zlib_compressor_new(ZlibCompressorFormat format, int level);
28812 FileInfo* g_zlib_compressor_get_file_info(ZlibCompressor* this_);
28813 void g_zlib_compressor_set_file_info(ZlibCompressor* this_, FileInfo* file_info=null);
28814 ZlibDecompressor* /*new*/ g_zlib_decompressor_new(ZlibCompressorFormat format);
28815 FileInfo* g_zlib_decompressor_get_file_info(ZlibDecompressor* this_);
28816 void g_bus_get(BusType bus_type, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
28817 DBusConnection* /*new*/ g_bus_get_finish(AsyncResult* res, GLib2.Error** error);
28818 DBusConnection* /*new*/ g_bus_get_sync(BusType bus_type, Cancellable* cancellable, GLib2.Error** error);
28819 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);
28820 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);
28821 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);
28822 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);
28823 void g_bus_unown_name(uint owner_id);
28824 void g_bus_unwatch_name(uint watcher_id);
28825 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);
28826 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);
28827 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);
28828 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);
28829 int g_content_type_can_be_executable(char* type);
28830 int g_content_type_equals(char* type1, char* type2);
28831 char* /*new*/ g_content_type_from_mime_type(char* mime_type);
28832 char* /*new*/ g_content_type_get_description(char* type);
28833 Icon* /*new*/ g_content_type_get_icon(char* type);
28834 char* /*new*/ g_content_type_get_mime_type(char* type);
28835 char* /*new*/ g_content_type_guess(char* filename, ubyte* data, size_t data_size, /*out*/ int* result_uncertain=null);
28836 char** /*new*/ g_content_type_guess_for_tree(File* root);
28837 int g_content_type_is_a(char* type, char* supertype);
28838 int g_content_type_is_unknown(char* type);
28839 GLib2.List* /*new*/ g_content_types_get_registered();
28840 char* /*new*/ g_dbus_address_get_for_bus_sync(BusType bus_type, Cancellable* cancellable, GLib2.Error** error);
28841 void g_dbus_address_get_stream(char* address, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
28842 IOStream* /*new*/ g_dbus_address_get_stream_finish(AsyncResult* res, char** out_guid, GLib2.Error** error);
28843 IOStream* /*new*/ g_dbus_address_get_stream_sync(char* address, char** out_guid, Cancellable* cancellable, GLib2.Error** error);
28844 char* /*new*/ g_dbus_error_encode_gerror(GLib2.Error* error);
28845 char* /*new*/ g_dbus_error_get_remote_error(GLib2.Error* error);
28846 int g_dbus_error_is_remote_error(GLib2.Error* error);
28847 GLib2.Error* /*new*/ g_dbus_error_new_for_dbus_error(char* dbus_error_name, char* dbus_error_message);
28848 GLib2.Quark g_dbus_error_quark();
28849 int g_dbus_error_register_error(GLib2.Quark error_domain, int error_code, char* dbus_error_name);
28850 void g_dbus_error_register_error_domain(char* error_domain_quark_name, size_t* quark_volatile, DBusErrorEntry* entries, uint num_entries);
28851 int g_dbus_error_strip_remote_error(GLib2.Error* error);
28852 int g_dbus_error_unregister_error(GLib2.Quark error_domain, int error_code, char* dbus_error_name);
28853 char* /*new*/ g_dbus_generate_guid();
28854 GLib2.Variant* /*new*/ g_dbus_gvalue_to_gvariant(GObject2.Value* gvalue, GLib2.VariantType* type);
28855 void g_dbus_gvariant_to_gvalue(GLib2.Variant* value, GObject2.Value* out_gvalue);
28856 int g_dbus_is_address(char* string_);
28857 int g_dbus_is_guid(char* string_);
28858 int g_dbus_is_interface_name(char* string_);
28859 int g_dbus_is_member_name(char* string_);
28860 int g_dbus_is_name(char* string_);
28861 int g_dbus_is_supported_address(char* string_, GLib2.Error** error);
28862 int g_dbus_is_unique_name(char* string_);
28863 IOErrorEnum g_io_error_from_errno(int err_no);
28864 GLib2.Quark g_io_error_quark();
28865 Type g_io_extension_get_type(IOExtension* extension);
28866 GLib2.List* /*new*/ g_io_modules_load_all_in_directory(char* dirname);
28867 GLib2.List* /*new*/ g_io_modules_load_all_in_directory_with_scope(char* dirname, IOModuleScope* scope_);
28868 void g_io_modules_scan_all_in_directory(char* dirname);
28869 void g_io_modules_scan_all_in_directory_with_scope(char* dirname, IOModuleScope* scope_);
28870 void g_io_scheduler_cancel_all_jobs();
28871 void g_io_scheduler_push_job(IOSchedulerJobFunc job_func, void* user_data, GLib2.DestroyNotify notify, int io_priority, Cancellable* cancellable=null);
28872 GLib2.Source* /*new*/ g_pollable_source_new(GObject2.Object* pollable_stream);
28873 GLib2.Quark g_resolver_error_quark();
28874 GLib2.Quark g_resource_error_quark();
28875 char** /*new*/ g_resources_enumerate_children(char* path, ResourceLookupFlags lookup_flags, GLib2.Error** error);
28876 int g_resources_get_info(char* path, ResourceLookupFlags lookup_flags, /*out*/ size_t* size, /*out*/ uint* flags, GLib2.Error** error);
28877 GLib2.Bytes* /*new*/ g_resources_lookup_data(char* path, ResourceLookupFlags lookup_flags, GLib2.Error** error);
28878 InputStream* /*new*/ g_resources_open_stream(char* path, ResourceLookupFlags lookup_flags, GLib2.Error** error);
28879 void g_simple_async_report_error_in_idle(GObject2.Object* object, AsyncReadyCallback callback, void* user_data, GLib2.Quark domain, int code, char* format, ...);
28880 void g_simple_async_report_gerror_in_idle(GObject2.Object* object, AsyncReadyCallback callback, void* user_data, GLib2.Error* error);
28881 void g_simple_async_report_take_gerror_in_idle(GObject2.Object* object, AsyncReadyCallback callback, void* user_data, GLib2.Error* error);
28882 GLib2.Quark g_tls_error_quark();
28883 int g_unix_is_mount_path_system_internal(char* mount_path);
28884 UnixMountEntry* /*new*/ g_unix_mount_at(char* mount_path, /*out*/ ulong* time_read=null);
28885 int g_unix_mount_compare(UnixMountEntry* mount1, UnixMountEntry* mount2);
28886 void g_unix_mount_free(UnixMountEntry* mount_entry);
28887 char* g_unix_mount_get_device_path(UnixMountEntry* mount_entry);
28888 char* g_unix_mount_get_fs_type(UnixMountEntry* mount_entry);
28889 char* g_unix_mount_get_mount_path(UnixMountEntry* mount_entry);
28890 int g_unix_mount_guess_can_eject(UnixMountEntry* mount_entry);
28891 Icon* /*new*/ g_unix_mount_guess_icon(UnixMountEntry* mount_entry);
28892 char* /*new*/ g_unix_mount_guess_name(UnixMountEntry* mount_entry);
28893 int g_unix_mount_guess_should_display(UnixMountEntry* mount_entry);
28894 int g_unix_mount_is_readonly(UnixMountEntry* mount_entry);
28895 int g_unix_mount_is_system_internal(UnixMountEntry* mount_entry);
28896 int g_unix_mount_points_changed_since(ulong time);
28897 GLib2.List* /*new*/ g_unix_mount_points_get(/*out*/ ulong* time_read=null);
28898 int g_unix_mounts_changed_since(ulong time);
28899 GLib2.List* /*new*/ g_unix_mounts_get(/*out*/ ulong* time_read=null);