Regenerate. Cogl works now.
[girtod.git] / gtk2 / gio2.d
blob0118d70fa2465febfc76ad4c5cd0b54c6ef9f787
1 // *** DO NOT EDIT ***
2 // Automatically generated from "/usr/share/gir-1.0/Gio-2.0.gir"
4 module Gio2;
5 public import gtk2.glib2;
6 alias gtk2.glib2 GLib2;
7 public import gtk2.gobject2;
8 alias gtk2.gobject2 GObject2;
10 // package: "gio-2.0";
12 // package: "gio-unix-2.0";
13 // C header: "/sw/x86/gtk2/glib-2.30.2/include/gio-unix-2.0/gio/gdesktopappinfo.h";
14 // C header: "/sw/x86/gtk2/glib-2.30.2/include/gio-unix-2.0/gio/gfiledescriptorbased.h";
15 // C header: "/sw/x86/gtk2/glib-2.30.2/include/gio-unix-2.0/gio/gunixconnection.h";
16 // C header: "/sw/x86/gtk2/glib-2.30.2/include/gio-unix-2.0/gio/gunixcredentialsmessage.h";
17 // C header: "/sw/x86/gtk2/glib-2.30.2/include/gio-unix-2.0/gio/gunixfdlist.h";
18 // C header: "/sw/x86/gtk2/glib-2.30.2/include/gio-unix-2.0/gio/gunixfdmessage.h";
19 // C header: "/sw/x86/gtk2/glib-2.30.2/include/gio-unix-2.0/gio/gunixinputstream.h";
20 // C header: "/sw/x86/gtk2/glib-2.30.2/include/gio-unix-2.0/gio/gunixmounts.h";
21 // C header: "/sw/x86/gtk2/glib-2.30.2/include/gio-unix-2.0/gio/gunixoutputstream.h";
22 // C header: "/sw/x86/gtk2/glib-2.30.2/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_simple_action_group_add_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_simple_action_group_add_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.
201 // Each action in the group has a unique name (which is a string). All
202 // method calls, except g_action_group_list_actions() take the name of
203 // an action as an argument.
205 // The #GActionGroup API is meant to be the 'public' API to the action
206 // group. The calls here are exactly the interaction that 'external
207 // forces' (eg: UI, incoming D-Bus messages, etc.) are supposed to have
208 // with actions. 'Internal' APIs (ie: ones meant only to be accessed by
209 // the action group implementation) are found on subclasses. This is
210 // why you will find -- for example -- g_action_group_get_action_enabled()
211 // but not an equivalent <function>set()</function> call.
213 // Signals are emitted on the action group in response to state changes
214 // on individual actions.
215 struct ActionGroup /* Interface */ {
216 mixin template __interface__() {
217 // VERSION: 2.28
218 // Emits the #GActionGroup::action-added signal on @action_group.
220 // This function should only be called by #GActionGroup implementations.
221 // <action_name>: the name of an action in the group
222 void action_added()(char* action_name) {
223 g_action_group_action_added(cast(ActionGroup*)&this, action_name);
226 // VERSION: 2.28
227 // Emits the #GActionGroup::action-enabled-changed signal on @action_group.
229 // This function should only be called by #GActionGroup implementations.
230 // <action_name>: the name of an action in the group
231 // <enabled>: whether or not the action is now enabled
232 void action_enabled_changed()(char* action_name, int enabled) {
233 g_action_group_action_enabled_changed(cast(ActionGroup*)&this, action_name, enabled);
236 // VERSION: 2.28
237 // Emits the #GActionGroup::action-removed signal on @action_group.
239 // This function should only be called by #GActionGroup implementations.
240 // <action_name>: the name of an action in the group
241 void action_removed()(char* action_name) {
242 g_action_group_action_removed(cast(ActionGroup*)&this, action_name);
245 // VERSION: 2.28
246 // Emits the #GActionGroup::action-state-changed signal on @action_group.
248 // This function should only be called by #GActionGroup implementations.
249 // <action_name>: the name of an action in the group
250 // <state>: the new state of the named action
251 void action_state_changed()(char* action_name, GLib2.Variant* state) {
252 g_action_group_action_state_changed(cast(ActionGroup*)&this, action_name, state);
255 // VERSION: 2.28
256 // Activate the named action within @action_group.
258 // If the action is expecting a parameter, then the correct type of
259 // parameter must be given as @parameter. If the action is expecting no
260 // parameters then @parameter must be %NULL. See
261 // g_action_group_get_action_parameter_type().
262 // <action_name>: the name of the action to activate
263 // <parameter>: parameters to the activation
264 void activate_action()(char* action_name, GLib2.Variant* parameter=null) {
265 g_action_group_activate_action(cast(ActionGroup*)&this, action_name, parameter);
268 // VERSION: 2.28
269 // Request for the state of the named action within @action_group to be
270 // changed to @value.
272 // The action must be stateful and @value must be of the correct type.
273 // See g_action_group_get_action_state_type().
275 // This call merely requests a change. The action may refuse to change
276 // its state or may change its state to something other than @value.
277 // See g_action_group_get_action_state_hint().
279 // If the @value GVariant is floating, it is consumed.
280 // <action_name>: the name of the action to request the change on
281 // <value>: the new state
282 void change_action_state()(char* action_name, GLib2.Variant* value) {
283 g_action_group_change_action_state(cast(ActionGroup*)&this, action_name, value);
286 // VERSION: 2.28
287 // Checks if the named action within @action_group is currently enabled.
289 // An action must be enabled in order to be activated or in order to
290 // have its state changed from outside callers.
291 // RETURNS: whether or not the action is currently enabled
292 // <action_name>: the name of the action to query
293 int get_action_enabled()(char* action_name) {
294 return g_action_group_get_action_enabled(cast(ActionGroup*)&this, action_name);
297 // VERSION: 2.28
298 // Queries the type of the parameter that must be given when activating
299 // the named action within @action_group.
301 // When activating the action using g_action_group_activate_action(),
302 // the #GVariant given to that function must be of the type returned
303 // by this function.
305 // In the case that this function returns %NULL, you must not give any
306 // #GVariant, but %NULL instead.
308 // The parameter type of a particular action will never change but it is
309 // possible for an action to be removed and for a new action to be added
310 // with the same name but a different parameter type.
311 // RETURNS: the parameter type
312 // <action_name>: the name of the action to query
313 GLib2.VariantType* get_action_parameter_type()(char* action_name) {
314 return g_action_group_get_action_parameter_type(cast(ActionGroup*)&this, action_name);
317 // VERSION: 2.28
318 // Queries the current state of the named action within @action_group.
320 // If the action is not stateful then %NULL will be returned. If the
321 // action is stateful then the type of the return value is the type
322 // given by g_action_group_get_action_state_type().
324 // The return value (if non-%NULL) should be freed with
325 // g_variant_unref() when it is no longer required.
326 // RETURNS: the current state of the action
327 // <action_name>: the name of the action to query
328 GLib2.Variant* /*new*/ get_action_state()(char* action_name) {
329 return g_action_group_get_action_state(cast(ActionGroup*)&this, action_name);
332 // VERSION: 2.28
333 // Requests a hint about the valid range of values for the state of the
334 // named action within @action_group.
336 // If %NULL is returned it either means that the action is not stateful
337 // or that there is no hint about the valid range of values for the
338 // state of the action.
340 // If a #GVariant array is returned then each item in the array is a
341 // possible value for the state. If a #GVariant pair (ie: two-tuple) is
342 // returned then the tuple specifies the inclusive lower and upper bound
343 // of valid values for the state.
345 // In any case, the information is merely a hint. It may be possible to
346 // have a state value outside of the hinted range and setting a value
347 // within the range may fail.
349 // The return value (if non-%NULL) should be freed with
350 // g_variant_unref() when it is no longer required.
351 // RETURNS: the state range hint
352 // <action_name>: the name of the action to query
353 GLib2.Variant* /*new*/ get_action_state_hint()(char* action_name) {
354 return g_action_group_get_action_state_hint(cast(ActionGroup*)&this, action_name);
357 // VERSION: 2.28
358 // Queries the type of the state of the named action within
359 // @action_group.
361 // If the action is stateful then this function returns the
362 // #GVariantType of the state. All calls to
363 // g_action_group_change_action_state() must give a #GVariant of this
364 // type and g_action_group_get_action_state() will return a #GVariant
365 // of the same type.
367 // If the action is not stateful then this function will return %NULL.
368 // In that case, g_action_group_get_action_state() will return %NULL
369 // and you must not call g_action_group_change_action_state().
371 // The state type of a particular action will never change but it is
372 // possible for an action to be removed and for a new action to be added
373 // with the same name but a different state type.
374 // RETURNS: the state type, if the action is stateful
375 // <action_name>: the name of the action to query
376 GLib2.VariantType* /*new*/ get_action_state_type()(char* action_name) {
377 return g_action_group_get_action_state_type(cast(ActionGroup*)&this, action_name);
380 // VERSION: 2.28
381 // Checks if the named action exists within @action_group.
382 // RETURNS: whether the named action exists
383 // <action_name>: the name of the action to check for
384 int has_action()(char* action_name) {
385 return g_action_group_has_action(cast(ActionGroup*)&this, action_name);
388 // VERSION: 2.28
389 // Lists the actions contained within @action_group.
391 // The caller is responsible for freeing the list with g_strfreev() when
392 // it is no longer required.
394 // actions in the groupb
395 // RETURNS: a %NULL-terminated array of the names of the
396 char** /*new*/ list_actions()() {
397 return g_action_group_list_actions(cast(ActionGroup*)&this);
400 // VERSION: 2.28
401 // Signals that a new action was just added to the group.
402 // This signal is emitted after the action has been added
403 // and is now visible.
404 // <action_name>: the name of the action in @action_group
405 extern (C) alias static void function (ActionGroup* this_, char* action_name, void* user_data=null) signal_action_added;
407 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
408 return super_.signal_connect!name(cb, data, cf);
411 ulong signal_connect(string name:"action-added", CB:signal_action_added)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
412 return signal_connect_data!()(&this, cast(char*)"action-added",
413 cast(GObject2.Callback)cb, data, null, cf);
416 // VERSION: 2.28
417 // Signals that the enabled status of the named action has changed.
418 // <action_name>: the name of the action in @action_group
419 // <enabled>: whether the action is enabled or not
420 extern (C) alias static void function (ActionGroup* this_, char* action_name, c_int enabled, void* user_data=null) signal_action_enabled_changed;
421 ulong signal_connect(string name:"action-enabled-changed", CB:signal_action_enabled_changed)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
422 return signal_connect_data!()(&this, cast(char*)"action-enabled-changed",
423 cast(GObject2.Callback)cb, data, null, cf);
426 // VERSION: 2.28
427 // Signals that an action is just about to be removed from the group.
428 // This signal is emitted before the action is removed, so the action
429 // is still visible and can be queried from the signal handler.
430 // <action_name>: the name of the action in @action_group
431 extern (C) alias static void function (ActionGroup* this_, char* action_name, void* user_data=null) signal_action_removed;
432 ulong signal_connect(string name:"action-removed", CB:signal_action_removed)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
433 return signal_connect_data!()(&this, cast(char*)"action-removed",
434 cast(GObject2.Callback)cb, data, null, cf);
437 // VERSION: 2.28
438 // Signals that the state of the named action has changed.
439 // <action_name>: the name of the action in @action_group
440 // <value>: the new value of the state
441 extern (C) alias static void function (ActionGroup* this_, char* action_name, GLib2.Variant* value, void* user_data=null) signal_action_state_changed;
442 ulong signal_connect(string name:"action-state-changed", CB:signal_action_state_changed)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
443 return signal_connect_data!()(&this, cast(char*)"action-state-changed",
444 cast(GObject2.Callback)cb, data, null, cf);
447 mixin __interface__;
450 // The virtual function table for #GActionGroup.
451 struct ActionGroupInterface /* Version 2.28 */ {
452 GObject2.TypeInterface g_iface;
454 // RETURNS: whether the named action exists
455 // <action_name>: the name of the action to check for
456 extern (C) int function (ActionGroup* action_group, char* action_name) has_action;
457 // RETURNS: a %NULL-terminated array of the names of the
458 extern (C) char** /*new*/ function (ActionGroup* action_group) list_actions;
460 // RETURNS: whether or not the action is currently enabled
461 // <action_name>: the name of the action to query
462 extern (C) int function (ActionGroup* action_group, char* action_name) get_action_enabled;
464 // RETURNS: the parameter type
465 // <action_name>: the name of the action to query
466 extern (C) GLib2.VariantType* function (ActionGroup* action_group, char* action_name) get_action_parameter_type;
468 // RETURNS: the state type, if the action is stateful
469 // <action_name>: the name of the action to query
470 extern (C) GLib2.VariantType* /*new*/ function (ActionGroup* action_group, char* action_name) get_action_state_type;
472 // RETURNS: the state range hint
473 // <action_name>: the name of the action to query
474 extern (C) GLib2.Variant* /*new*/ function (ActionGroup* action_group, char* action_name) get_action_state_hint;
476 // RETURNS: the current state of the action
477 // <action_name>: the name of the action to query
478 extern (C) GLib2.Variant* /*new*/ function (ActionGroup* action_group, char* action_name) get_action_state;
480 // <action_name>: the name of the action to request the change on
481 // <value>: the new state
482 extern (C) void function (ActionGroup* action_group, char* action_name, GLib2.Variant* value) change_action_state;
484 // <action_name>: the name of the action to activate
485 // <parameter>: parameters to the activation
486 extern (C) void function (ActionGroup* action_group, char* action_name, GLib2.Variant* parameter=null) activate_action;
487 // <action_name>: the name of an action in the group
488 extern (C) void function (ActionGroup* action_group, char* action_name) action_added;
489 // <action_name>: the name of an action in the group
490 extern (C) void function (ActionGroup* action_group, char* action_name) action_removed;
492 // <action_name>: the name of an action in the group
493 // <enabled>: whether or not the action is now enabled
494 extern (C) void function (ActionGroup* action_group, char* action_name, int enabled) action_enabled_changed;
496 // <action_name>: the name of an action in the group
497 // <state>: the new state of the named action
498 extern (C) void function (ActionGroup* action_group, char* action_name, GLib2.Variant* state) action_state_changed;
501 struct ActionInterface /* Version 2.28 */ {
502 GObject2.TypeInterface g_iface;
503 // RETURNS: the name of the action
504 extern (C) char* function (Action* action) get_name;
505 // RETURNS: the parameter type
506 extern (C) GLib2.VariantType* function (Action* action) get_parameter_type;
507 // RETURNS: the state type, if the action is stateful
508 extern (C) GLib2.VariantType* function (Action* action) get_state_type;
509 // RETURNS: the state range hint
510 extern (C) GLib2.Variant* /*new*/ function (Action* action) get_state_hint;
511 // RETURNS: whether the action is enabled
512 extern (C) int function (Action* action) get_enabled;
513 // RETURNS: the current state of the action
514 extern (C) GLib2.Variant* /*new*/ function (Action* action) get_state;
515 // <value>: the new state
516 extern (C) void function (Action* action, GLib2.Variant* value) change_state;
517 // <parameter>: the parameter to the activation
518 extern (C) void function (Action* action, GLib2.Variant* parameter=null) activate;
522 // #GAppInfo and #GAppLaunchContext are used for describing and launching
523 // applications installed on the system.
525 // As of GLib 2.20, URIs will always be converted to POSIX paths
526 // (using g_file_get_path()) when using g_app_info_launch() even if
527 // the application requested an URI and not a POSIX path. For example
528 // for an desktop-file based application with Exec key <literal>totem
529 // &percnt;U</literal> and a single URI,
530 // <literal>sftp://foo/file.avi</literal>, then
531 // <literal>/home/user/.gvfs/sftp on foo/file.avi</literal> will be
532 // passed. This will only work if a set of suitable GIO extensions
533 // (such as gvfs 2.26 compiled with FUSE support), is available and
534 // operational; if this is not the case, the URI will be passed
535 // unmodified to the application. Some URIs, such as
536 // <literal>mailto:</literal>, of course cannot be mapped to a POSIX
537 // path (in gvfs there's no FUSE mount for it); such URIs will be
538 // passed unmodified to the application.
540 // Specifically for gvfs 2.26 and later, the POSIX URI will be mapped
541 // back to the GIO URI in the #GFile constructors (since gvfs
542 // implements the #GVfs extension point). As such, if the application
543 // needs to examine the URI, it needs to use g_file_get_uri() or
544 // similar on #GFile. In other words, an application cannot assume
545 // that the URI passed to e.g. g_file_new_for_commandline_arg() is
546 // equal to the result of g_file_get_uri(). The following snippet
547 // illustrates this:
549 // <programlisting>
550 // GFile *f;
551 // char *uri;
553 // file = g_file_new_for_commandline_arg (uri_from_commandline);
555 // uri = g_file_get_uri (file);
556 // strcmp (uri, uri_from_commandline) == 0; // FALSE
557 // g_free (uri);
559 // if (g_file_has_uri_scheme (file, "cdda"))
560 // {
561 // // do something special with uri
562 // }
563 // g_object_unref (file);
564 // </programlisting>
566 // This code will work when both <literal>cdda://sr0/Track
567 // 1.wav</literal> and <literal>/home/user/.gvfs/cdda on sr0/Track
568 // 1.wav</literal> is passed to the application. It should be noted
569 // that it's generally not safe for applications to rely on the format
570 // of a particular URIs. Different launcher applications (e.g. file
571 // managers) may have different ideas of what a given URI means.
572 struct AppInfo /* Interface */ {
573 mixin template __interface__() {
574 // Creates a new #GAppInfo from the given information.
575 // RETURNS: new #GAppInfo for given command.
576 // <commandline>: the commandline to use
577 // <application_name>: the application name, or %NULL to use @commandline
578 // <flags>: flags that can specify details of the created #GAppInfo
579 static AppInfo* /*new*/ create_from_commandline()(char* commandline, char* application_name, AppInfoCreateFlags flags, GLib2.Error** error=null) {
580 return g_app_info_create_from_commandline(commandline, application_name, flags, error);
583 // Gets a list of all of the applications currently registered
584 // on this system.
586 // For desktop files, this includes applications that have
587 // <literal>NoDisplay=true</literal> set or are excluded from
588 // display by means of <literal>OnlyShowIn</literal> or
589 // <literal>NotShowIn</literal>. See g_app_info_should_show().
590 // The returned list does not include applications which have
591 // the <literal>Hidden</literal> key set.
592 // RETURNS: a newly allocated #GList of references to #GAppInfo<!---->s.
593 static GLib2.List* /*new*/ get_all()() {
594 return g_app_info_get_all();
597 // Gets a list of all #GAppInfos for a given content type.
599 // for given @content_type or %NULL on error.
600 // RETURNS: #GList of #GAppInfos
601 // <content_type>: the content type to find a #GAppInfo for
602 static GLib2.List* /*new*/ get_all_for_type()(char* content_type) {
603 return g_app_info_get_all_for_type(content_type);
606 // Gets the #GAppInfo that corresponds to a given content type.
608 // %NULL on error.
609 // RETURNS: #GAppInfo for given @content_type or
610 // <content_type>: the content type to find a #GAppInfo for
611 // <must_support_uris>: if %TRUE, the #GAppInfo is expected to support URIs
612 static AppInfo* /*new*/ get_default_for_type()(char* content_type, int must_support_uris) {
613 return g_app_info_get_default_for_type(content_type, must_support_uris);
616 // Gets the default application for launching applications
617 // using this URI scheme. A URI scheme is the initial part
618 // of the URI, up to but not including the ':', e.g. "http",
619 // "ftp" or "sip".
620 // RETURNS: #GAppInfo for given @uri_scheme or %NULL on error.
621 // <uri_scheme>: a string containing a URI scheme.
622 static AppInfo* /*new*/ get_default_for_uri_scheme()(char* uri_scheme) {
623 return g_app_info_get_default_for_uri_scheme(uri_scheme);
626 // VERSION: 2.28
627 // Gets a list of fallback #GAppInfos for a given content type, i.e.
628 // those applications which claim to support the given content type
629 // by MIME type subclassing and not directly.
631 // for given @content_type or %NULL on error.
632 // RETURNS: #GList of #GAppInfos
633 // <content_type>: the content type to find a #GAppInfo for
634 static GLib2.List* /*new*/ get_fallback_for_type()(char* content_type) {
635 return g_app_info_get_fallback_for_type(content_type);
638 // VERSION: 2.28
639 // Gets a list of recommended #GAppInfos for a given content type, i.e.
640 // those applications which claim to support the given content type exactly,
641 // and not by MIME type subclassing.
642 // Note that the first application of the list is the last used one, i.e.
643 // the last one for which #g_app_info_set_as_last_used_for_type has been
644 // called.
646 // for given @content_type or %NULL on error.
647 // RETURNS: #GList of #GAppInfos
648 // <content_type>: the content type to find a #GAppInfo for
649 static GLib2.List* /*new*/ get_recommended_for_type()(char* content_type) {
650 return g_app_info_get_recommended_for_type(content_type);
653 // Utility function that launches the default application
654 // registered to handle the specified uri. Synchronous I/O
655 // is done on the uri to detect the type of the file if
656 // required.
657 // RETURNS: %TRUE on success, %FALSE on error.
658 // <uri>: the uri to show
659 // <launch_context>: an optional #GAppLaunchContext.
660 static int launch_default_for_uri()(char* uri, AppLaunchContext* launch_context, GLib2.Error** error=null) {
661 return g_app_info_launch_default_for_uri(uri, launch_context, error);
664 // VERSION: 2.20
665 // Removes all changes to the type associations done by
666 // g_app_info_set_as_default_for_type(),
667 // g_app_info_set_as_default_for_extension(),
668 // g_app_info_add_supports_type() or g_app_info_remove_supports_type().
669 // <content_type>: a content type
670 static void reset_type_associations()(char* content_type) {
671 g_app_info_reset_type_associations(content_type);
674 // Adds a content type to the application information to indicate the
675 // application is capable of opening files with the given content type.
676 // RETURNS: %TRUE on success, %FALSE on error.
677 // <content_type>: a string.
678 int add_supports_type()(char* content_type, GLib2.Error** error=null) {
679 return g_app_info_add_supports_type(cast(AppInfo*)&this, content_type, error);
682 // VERSION: 2.20
683 // Obtains the information whether the #GAppInfo can be deleted.
684 // See g_app_info_delete().
685 // RETURNS: %TRUE if @appinfo can be deleted
686 int can_delete()() {
687 return g_app_info_can_delete(cast(AppInfo*)&this);
690 // Checks if a supported content type can be removed from an application.
692 // content types from a given @appinfo, %FALSE if not.
693 // RETURNS: %TRUE if it is possible to remove supported
694 int can_remove_supports_type()() {
695 return g_app_info_can_remove_supports_type(cast(AppInfo*)&this);
698 // VERSION: 2.20
699 // Tries to delete a #GAppInfo.
701 // On some platforms, there may be a difference between user-defined
702 // #GAppInfo<!-- -->s which can be deleted, and system-wide ones which
703 // cannot. See g_app_info_can_delete().
704 // RETURNS: %TRUE if @appinfo has been deleted
705 int delete_()() {
706 return g_app_info_delete(cast(AppInfo*)&this);
709 // Creates a duplicate of a #GAppInfo.
710 // RETURNS: a duplicate of @appinfo.
711 AppInfo* /*new*/ dup()() {
712 return g_app_info_dup(cast(AppInfo*)&this);
715 // Checks if two #GAppInfo<!-- -->s are equal.
716 // RETURNS: %TRUE if @appinfo1 is equal to @appinfo2. %FALSE otherwise.
717 // <appinfo2>: the second #GAppInfo.
718 int equal()(AppInfo* appinfo2) {
719 return g_app_info_equal(cast(AppInfo*)&this, appinfo2);
722 // VERSION: 2.20
723 // Gets the commandline with which the application will be
724 // started.
726 // or %NULL if this information is not available
727 // RETURNS: a string containing the @appinfo's commandline,
728 char* get_commandline()() {
729 return g_app_info_get_commandline(cast(AppInfo*)&this);
732 // Gets a human-readable description of an installed application.
734 // application @appinfo, or %NULL if none.
735 // RETURNS: a string containing a description of the
736 char* get_description()() {
737 return g_app_info_get_description(cast(AppInfo*)&this);
740 // VERSION: 2.24
741 // Gets the display name of the application. The display name is often more
742 // descriptive to the user than the name itself.
744 // no display name is available.
745 // RETURNS: the display name of the application for @appinfo, or the name if
746 char* get_display_name()() {
747 return g_app_info_get_display_name(cast(AppInfo*)&this);
750 // Gets the executable's name for the installed application.
752 // binaries name
753 // RETURNS: a string containing the @appinfo's application
754 char* get_executable()() {
755 return g_app_info_get_executable(cast(AppInfo*)&this);
758 // Gets the icon for the application.
759 // RETURNS: the default #GIcon for @appinfo.
760 Icon* get_icon()() {
761 return g_app_info_get_icon(cast(AppInfo*)&this);
764 // Gets the ID of an application. An id is a string that
765 // identifies the application. The exact format of the id is
766 // platform dependent. For instance, on Unix this is the
767 // desktop file id from the xdg menu specification.
769 // Note that the returned ID may be %NULL, depending on how
770 // the @appinfo has been constructed.
771 // RETURNS: a string containing the application's ID.
772 char* get_id()() {
773 return g_app_info_get_id(cast(AppInfo*)&this);
776 // Gets the installed name of the application.
777 // RETURNS: the name of the application for @appinfo.
778 char* get_name()() {
779 return g_app_info_get_name(cast(AppInfo*)&this);
782 // Launches the application. Passes @files to the launched application
783 // as arguments, using the optional @launch_context to get information
784 // about the details of the launcher (like what screen it is on).
785 // On error, @error will be set accordingly.
787 // To launch the application without arguments pass a %NULL @files list.
789 // Note that even if the launch is successful the application launched
790 // can fail to start if it runs into problems during startup. There is
791 // no way to detect this.
793 // Some URIs can be changed when passed through a GFile (for instance
794 // unsupported uris with strange formats like mailto:), so if you have
795 // a textual uri you want to pass in as argument, consider using
796 // g_app_info_launch_uris() instead.
798 // On UNIX, this function sets the <envar>GIO_LAUNCHED_DESKTOP_FILE</envar>
799 // environment variable with the path of the launched desktop file and
800 // <envar>GIO_LAUNCHED_DESKTOP_FILE_PID</envar> to the process
801 // id of the launched process. This can be used to ignore
802 // <envar>GIO_LAUNCHED_DESKTOP_FILE</envar>, should it be inherited
803 // by further processes. The <envar>DISPLAY</envar> and
804 // <envar>DESKTOP_STARTUP_ID</envar> environment variables are also
805 // set, based on information provided in @launch_context.
806 // RETURNS: %TRUE on successful launch, %FALSE otherwise.
807 // <files>: a #GList of #GFile objects
808 // <launch_context>: a #GAppLaunchContext or %NULL
809 int launch()(GLib2.List* files, AppLaunchContext* launch_context, GLib2.Error** error=null) {
810 return g_app_info_launch(cast(AppInfo*)&this, files, launch_context, error);
813 // Launches the application. This passes the @uris to the launched application
814 // as arguments, using the optional @launch_context to get information
815 // about the details of the launcher (like what screen it is on).
816 // On error, @error will be set accordingly.
818 // To launch the application without arguments pass a %NULL @uris list.
820 // Note that even if the launch is successful the application launched
821 // can fail to start if it runs into problems during startup. There is
822 // no way to detect this.
823 // RETURNS: %TRUE on successful launch, %FALSE otherwise.
824 // <uris>: a #GList containing URIs to launch.
825 // <launch_context>: a #GAppLaunchContext or %NULL
826 int launch_uris()(GLib2.List* uris, AppLaunchContext* launch_context, GLib2.Error** error=null) {
827 return g_app_info_launch_uris(cast(AppInfo*)&this, uris, launch_context, error);
830 // Removes a supported type from an application, if possible.
831 // RETURNS: %TRUE on success, %FALSE on error.
832 // <content_type>: a string.
833 int remove_supports_type()(char* content_type, GLib2.Error** error=null) {
834 return g_app_info_remove_supports_type(cast(AppInfo*)&this, content_type, error);
837 // Sets the application as the default handler for the given file extension.
838 // RETURNS: %TRUE on success, %FALSE on error.
839 // <extension>: a string containing the file extension (without the dot).
840 int set_as_default_for_extension()(char* extension, GLib2.Error** error=null) {
841 return g_app_info_set_as_default_for_extension(cast(AppInfo*)&this, extension, error);
844 // Sets the application as the default handler for a given type.
845 // RETURNS: %TRUE on success, %FALSE on error.
846 // <content_type>: the content type.
847 int set_as_default_for_type()(char* content_type, GLib2.Error** error=null) {
848 return g_app_info_set_as_default_for_type(cast(AppInfo*)&this, content_type, error);
851 // Sets the application as the last used application for a given type.
852 // This will make the application appear as first in the list returned
853 // by g_app_info_get_recommended_for_type(), regardless of the default
854 // application for that content type.
855 // RETURNS: %TRUE on success, %FALSE on error.
856 // <content_type>: the content type.
857 int set_as_last_used_for_type()(char* content_type, GLib2.Error** error=null) {
858 return g_app_info_set_as_last_used_for_type(cast(AppInfo*)&this, content_type, error);
861 // Checks if the application info should be shown in menus that
862 // list available applications.
863 // RETURNS: %TRUE if the @appinfo should be shown, %FALSE otherwise.
864 int should_show()() {
865 return g_app_info_should_show(cast(AppInfo*)&this);
868 // Checks if the application accepts files as arguments.
869 // RETURNS: %TRUE if the @appinfo supports files.
870 int supports_files()() {
871 return g_app_info_supports_files(cast(AppInfo*)&this);
874 // Checks if the application supports reading files and directories from URIs.
875 // RETURNS: %TRUE if the @appinfo supports URIs.
876 int supports_uris()() {
877 return g_app_info_supports_uris(cast(AppInfo*)&this);
880 mixin __interface__;
883 // Flags used when creating a #GAppInfo.
884 enum AppInfoCreateFlags {
885 NONE = 0,
886 NEEDS_TERMINAL = 1,
887 SUPPORTS_URIS = 2,
888 SUPPORTS_STARTUP_NOTIFICATION = 4
890 // Application Information interface, for operating system portability.
891 struct AppInfoIface {
892 GObject2.TypeInterface g_iface;
893 // RETURNS: a duplicate of @appinfo.
894 extern (C) AppInfo* /*new*/ function (AppInfo* appinfo) dup;
896 // RETURNS: %TRUE if @appinfo1 is equal to @appinfo2. %FALSE otherwise.
897 // <appinfo2>: the second #GAppInfo.
898 extern (C) int function (AppInfo* appinfo1, AppInfo* appinfo2) equal;
899 // RETURNS: a string containing the application's ID.
900 extern (C) char* function (AppInfo* appinfo) get_id;
901 // RETURNS: the name of the application for @appinfo.
902 extern (C) char* function (AppInfo* appinfo) get_name;
903 // RETURNS: a string containing a description of the
904 extern (C) char* function (AppInfo* appinfo) get_description;
905 // RETURNS: a string containing the @appinfo's application
906 extern (C) char* function (AppInfo* appinfo) get_executable;
907 // RETURNS: the default #GIcon for @appinfo.
908 extern (C) Icon* function (AppInfo* appinfo) get_icon;
910 // RETURNS: %TRUE on successful launch, %FALSE otherwise.
911 // <files>: a #GList of #GFile objects
912 // <launch_context>: a #GAppLaunchContext or %NULL
913 extern (C) int function (AppInfo* appinfo, GLib2.List* files, AppLaunchContext* launch_context, GLib2.Error** error=null) launch;
914 // RETURNS: %TRUE if the @appinfo supports URIs.
915 extern (C) int function (AppInfo* appinfo) supports_uris;
916 // RETURNS: %TRUE if the @appinfo supports files.
917 extern (C) int function (AppInfo* appinfo) supports_files;
919 // RETURNS: %TRUE on successful launch, %FALSE otherwise.
920 // <uris>: a #GList containing URIs to launch.
921 // <launch_context>: a #GAppLaunchContext or %NULL
922 extern (C) int function (AppInfo* appinfo, GLib2.List* uris, AppLaunchContext* launch_context, GLib2.Error** error=null) launch_uris;
923 // RETURNS: %TRUE if the @appinfo should be shown, %FALSE otherwise.
924 extern (C) int function (AppInfo* appinfo) should_show;
926 // RETURNS: %TRUE on success, %FALSE on error.
927 // <content_type>: the content type.
928 extern (C) int function (AppInfo* appinfo, char* content_type, GLib2.Error** error=null) set_as_default_for_type;
930 // RETURNS: %TRUE on success, %FALSE on error.
931 // <extension>: a string containing the file extension (without the dot).
932 extern (C) int function (AppInfo* appinfo, char* extension, GLib2.Error** error=null) set_as_default_for_extension;
934 // RETURNS: %TRUE on success, %FALSE on error.
935 // <content_type>: a string.
936 extern (C) int function (AppInfo* appinfo, char* content_type, GLib2.Error** error=null) add_supports_type;
937 // RETURNS: %TRUE if it is possible to remove supported
938 extern (C) int function (AppInfo* appinfo) can_remove_supports_type;
940 // RETURNS: %TRUE on success, %FALSE on error.
941 // <content_type>: a string.
942 extern (C) int function (AppInfo* appinfo, char* content_type, GLib2.Error** error=null) remove_supports_type;
943 // RETURNS: %TRUE if @appinfo can be deleted
944 extern (C) int function (AppInfo* appinfo) can_delete;
945 // RETURNS: %TRUE if @appinfo has been deleted
946 extern (C) int function (AppInfo* appinfo) do_delete;
947 // RETURNS: a string containing the @appinfo's commandline,
948 extern (C) char* function (AppInfo* appinfo) get_commandline;
949 // RETURNS: the display name of the application for @appinfo, or the name if
950 extern (C) char* function (AppInfo* appinfo) get_display_name;
952 // RETURNS: %TRUE on success, %FALSE on error.
953 // <content_type>: the content type.
954 extern (C) int function (AppInfo* appinfo, char* content_type, GLib2.Error** error=null) set_as_last_used_for_type;
958 // Integrating the launch with the launching application. This is used to
959 // handle for instance startup notification and launching the new application
960 // on the same screen as the launching window.
961 struct AppLaunchContext /* : GObject.Object */ {
962 alias parent_instance this;
963 alias parent_instance super_;
964 alias parent_instance object;
965 GObject2.Object parent_instance;
966 private AppLaunchContextPrivate* priv;
969 // Creates a new application launch context. This is not normally used,
970 // instead you instantiate a subclass of this, such as #GdkAppLaunchContext.
971 // RETURNS: a #GAppLaunchContext.
972 static AppLaunchContext* /*new*/ new_()() {
973 return g_app_launch_context_new();
976 // Gets the display string for the @context. This is used to ensure new
977 // applications are started on the same display as the launching
978 // application, by setting the <envar>DISPLAY</envar> environment variable.
979 // RETURNS: a display string for the display.
980 // <info>: a #GAppInfo
981 // <files>: a #GList of #GFile objects
982 char* /*new*/ get_display()(AppInfo* info, GLib2.List* files) {
983 return g_app_launch_context_get_display(&this, info, files);
986 // Initiates startup notification for the application and returns the
987 // <envar>DESKTOP_STARTUP_ID</envar> for the launched operation,
988 // if supported.
990 // Startup notification IDs are defined in the <ulink
991 // url="http://standards.freedesktop.org/startup-notification-spec/startup-notification-latest.txt">
992 // FreeDesktop.Org Startup Notifications standard</ulink>.
994 // not supported.
995 // RETURNS: a startup notification ID for the application, or %NULL if
996 // <info>: a #GAppInfo
997 // <files>: a #GList of of #GFile objects
998 char* /*new*/ get_startup_notify_id()(AppInfo* info, GLib2.List* files) {
999 return g_app_launch_context_get_startup_notify_id(&this, info, files);
1002 // Called when an application has failed to launch, so that it can cancel
1003 // the application startup notification started in g_app_launch_context_get_startup_notify_id().
1004 // <startup_notify_id>: the startup notification id that was returned by g_app_launch_context_get_startup_notify_id().
1005 void launch_failed()(char* startup_notify_id) {
1006 g_app_launch_context_launch_failed(&this, startup_notify_id);
1010 struct AppLaunchContextClass {
1011 GObject2.ObjectClass parent_class;
1013 // RETURNS: a display string for the display.
1014 // <info>: a #GAppInfo
1015 // <files>: a #GList of #GFile objects
1016 extern (C) char* /*new*/ function (AppLaunchContext* context, AppInfo* info, GLib2.List* files) get_display;
1018 // RETURNS: a startup notification ID for the application, or %NULL if
1019 // <info>: a #GAppInfo
1020 // <files>: a #GList of of #GFile objects
1021 extern (C) char* /*new*/ function (AppLaunchContext* context, AppInfo* info, GLib2.List* files) get_startup_notify_id;
1022 // <startup_notify_id>: the startup notification id that was returned by g_app_launch_context_get_startup_notify_id().
1023 extern (C) void function (AppLaunchContext* context, char* startup_notify_id) launch_failed;
1024 extern (C) void function () _g_reserved1;
1025 extern (C) void function () _g_reserved2;
1026 extern (C) void function () _g_reserved3;
1027 extern (C) void function () _g_reserved4;
1028 extern (C) void function () _g_reserved5;
1031 struct AppLaunchContextPrivate {
1035 // A #GApplication is the foundation of an application, unique for a
1036 // given application identifier. The GApplication class wraps some
1037 // low-level platform-specific services and is intended to act as the
1038 // foundation for higher-level application classes such as
1039 // #GtkApplication or #MxApplication. In general, you should not use
1040 // this class outside of a higher level framework.
1042 // One of the core features that GApplication provides is process
1043 // uniqueness, in the context of a "session". The session concept is
1044 // platform-dependent, but corresponds roughly to a graphical desktop
1045 // login. When your application is launched again, its arguments
1046 // are passed through platform communication to the already running
1047 // program. The already running instance of the program is called the
1048 // <firstterm>primary instance</firstterm>.
1050 // Before using GApplication, you must choose an "application identifier".
1051 // The expected form of an application identifier is very close to that of
1052 // of a <ulink url="http://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-names-interface">DBus bus name</ulink>.
1053 // Examples include: "com.example.MyApp", "org.example.internal-apps.Calculator".
1054 // For details on valid application identifiers, see
1055 // g_application_id_is_valid().
1057 // The application identifier is claimed by the application as a
1058 // well-known bus name on the user's session bus. This means that the
1059 // uniqueness of your application is scoped to the current session. It
1060 // also means that your application may provide additional services
1061 // (through registration of other object paths) at that bus name.
1063 // The registration of these object paths should be done with the shared
1064 // GDBus session bus. Note that due to the internal architecture of
1065 // GDBus, method calls can be dispatched at any time (even if a main
1066 // loop is not running). For this reason, you must ensure that any
1067 // object paths that you wish to register are registered before
1068 // #GApplication attempts to acquire the bus name of your application
1069 // (which happens in g_application_register()). Unfortunately, this
1070 // means that you cannot use g_application_get_is_remote() to decide if
1071 // you want to register object paths.
1073 // GApplication provides convenient life cycle management by maintaining
1074 // a <firstterm>use count</firstterm> for the primary application instance.
1075 // The use count can be changed using g_application_hold() and
1076 // g_application_release(). If it drops to zero, the application exits.
1078 // GApplication also implements the #GActionGroup interface and lets you
1079 // easily export actions by adding them with g_application_set_action_group().
1080 // When invoking an action by calling g_action_group_activate_action() on
1081 // the application, it is always invoked in the primary instance.
1083 // There is a number of different entry points into a #GApplication:
1084 // <itemizedlist>
1085 // <listitem>via 'Activate' (i.e. just starting the application)</listitem>
1086 // <listitem>via 'Open' (i.e. opening some files)</listitem>
1087 // <listitem>by handling a command-line</listitem>
1088 // <listitem>via activating an action</listitem>
1089 // </itemizedlist>
1090 // The #GApplication::startup signal lets you handle the application
1091 // initialization for all of these in a single place.
1093 // Regardless of which of these entry points is used to start the application,
1094 // GApplication passes some <firstterm id="platform-data">platform
1095 // data</firstterm> from the launching instance to the primary instance,
1096 // in the form of a #GVariant dictionary mapping strings to variants.
1097 // To use platform data, override the @before_emit or @after_emit virtual
1098 // functions in your #GApplication subclass. When dealing with
1099 // #GApplicationCommandline objects, the platform data is directly
1100 // available via g_application_command_line_get_cwd(),
1101 // g_application_command_line_get_environ() and
1102 // g_application_command_line_get_platform_data().
1104 // As the name indicates, the platform data may vary depending on the
1105 // operating system, but it always includes the current directory (key
1106 // "cwd"), and optionally the environment (ie the set of environment
1107 // variables and their values) of the calling process (key "environ").
1108 // The environment is only added to the platform data if the
1109 // #G_APPLICATION_SEND_ENVIONMENT flag is set. GApplication subclasses
1110 // can add their own platform data by overriding the @add_platform_data
1111 // virtual function. For instance, #GtkApplication adds startup notification
1112 // data in this way.
1114 // To parse commandline arguments you may handle the
1115 // #GApplication::command-line signal or override the local_command_line()
1116 // vfunc, to parse them in either the primary instance or the local instance,
1117 // respectively.
1119 // <example id="gapplication-example-open"><title>Opening files with a GApplication</title>
1120 // <programlisting>
1121 // <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-open.c">
1122 // <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
1123 // </xi:include>
1124 // </programlisting>
1125 // </example>
1127 // <example id="gapplication-example-actions"><title>A GApplication with actions</title>
1128 // <programlisting>
1129 // <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-actions.c">
1130 // <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
1131 // </xi:include>
1132 // </programlisting>
1133 // </example>
1134 struct Application /* : GObject.Object */ /* Version 2.28 */ {
1135 mixin ActionGroup.__interface__;
1136 alias parent_instance this;
1137 alias parent_instance super_;
1138 alias parent_instance object;
1139 GObject2.Object parent_instance;
1140 private ApplicationPrivate* priv;
1143 // Creates a new #GApplication instance.
1145 // This function calls g_type_init() for you.
1147 // The application id must be valid. See g_application_id_is_valid().
1148 // RETURNS: a new #GApplication instance
1149 // <application_id>: the application id
1150 // <flags>: the application flags
1151 static Application* /*new*/ new_()(char* application_id, ApplicationFlags flags) {
1152 return g_application_new(application_id, flags);
1155 // Checks if @application_id is a valid application identifier.
1157 // A valid ID is required for calls to g_application_new() and
1158 // g_application_set_application_id().
1160 // For convenience, the restrictions on application identifiers are
1161 // reproduced here:
1162 // <itemizedlist>
1163 // <listitem>Application identifiers must contain only the ASCII characters "[A-Z][a-z][0-9]_-." and must not begin with a digit.</listitem>
1164 // <listitem>Application identifiers must contain at least one '.' (period) character (and thus at least three elements).</listitem>
1165 // <listitem>Application identifiers must not begin or end with a '.' (period) character.</listitem>
1166 // <listitem>Application identifiers must not contain consecutive '.' (period) characters.</listitem>
1167 // <listitem>Application identifiers must not exceed 255 characters.</listitem>
1168 // </itemizedlist>
1169 // RETURNS: %TRUE if @application_id is valid
1170 // <application_id>: a potential application identifier
1171 static int id_is_valid()(char* application_id) {
1172 return g_application_id_is_valid(application_id);
1175 // VERSION: 2.28
1176 // Activates the application.
1178 // In essence, this results in the #GApplication::activate() signal being
1179 // emitted in the primary instance.
1181 // The application must be registered before calling this function.
1182 void activate()() {
1183 g_application_activate(&this);
1186 // VERSION: 2.28
1187 // Gets the unique identifier for @application.
1188 // RETURNS: the identifier for @application, owned by @application
1189 char* get_application_id()() {
1190 return g_application_get_application_id(&this);
1193 // VERSION: 2.28
1194 // Gets the flags for @application.
1196 // See #GApplicationFlags.
1197 // RETURNS: the flags for @application
1198 ApplicationFlags get_flags()() {
1199 return g_application_get_flags(&this);
1202 // VERSION: 2.28
1203 // Gets the current inactivity timeout for the application.
1205 // This is the amount of time (in milliseconds) after the last call to
1206 // g_application_release() before the application stops running.
1207 // RETURNS: the timeout, in milliseconds
1208 uint get_inactivity_timeout()() {
1209 return g_application_get_inactivity_timeout(&this);
1212 // VERSION: 2.28
1213 // Checks if @application is registered.
1215 // An application is registered if g_application_register() has been
1216 // successfully called.
1217 // RETURNS: %TRUE if @application is registered
1218 int get_is_registered()() {
1219 return g_application_get_is_registered(&this);
1222 // VERSION: 2.28
1223 // Checks if @application is remote.
1225 // If @application is remote then it means that another instance of
1226 // application already exists (the 'primary' instance). Calls to
1227 // perform actions on @application will result in the actions being
1228 // performed by the primary instance.
1230 // The value of this property cannot be accessed before
1231 // g_application_register() has been called. See
1232 // g_application_get_is_registered().
1233 // RETURNS: %TRUE if @application is remote
1234 int get_is_remote()() {
1235 return g_application_get_is_remote(&this);
1238 // Increases the use count of @application.
1240 // Use this function to indicate that the application has a reason to
1241 // continue to run. For example, g_application_hold() is called by GTK+
1242 // when a toplevel window is on the screen.
1244 // To cancel the hold, call g_application_release().
1245 void hold()() {
1246 g_application_hold(&this);
1249 // VERSION: 2.28
1250 // Opens the given files.
1252 // In essence, this results in the #GApplication::open signal being emitted
1253 // in the primary instance.
1255 // @n_files must be greater than zero.
1257 // @hint is simply passed through to the ::open signal. It is
1258 // intended to be used by applications that have multiple modes for
1259 // opening files (eg: "view" vs "edit", etc). Unless you have a need
1260 // for this functionality, you should use "".
1262 // The application must be registered before calling this function
1263 // and it must have the %G_APPLICATION_HANDLES_OPEN flag set.
1264 // <files>: an array of #GFiles to open
1265 // <n_files>: the length of the @files array
1266 // <hint>: a hint (or ""), but never %NULL
1267 void open()(File** files, int n_files, char* hint) {
1268 g_application_open(&this, files, n_files, hint);
1271 // VERSION: 2.28
1272 // Attempts registration of the application.
1274 // This is the point at which the application discovers if it is the
1275 // primary instance or merely acting as a remote for an already-existing
1276 // primary instance. This is implemented by attempting to acquire the
1277 // application identifier as a unique bus name on the session bus using
1278 // GDBus.
1280 // Due to the internal architecture of GDBus, method calls can be
1281 // dispatched at any time (even if a main loop is not running). For
1282 // this reason, you must ensure that any object paths that you wish to
1283 // register are registered before calling this function.
1285 // If the application has already been registered then %TRUE is
1286 // returned with no work performed.
1288 // The #GApplication::startup signal is emitted if registration succeeds
1289 // and @application is the primary instance.
1291 // In the event of an error (such as @cancellable being cancelled, or a
1292 // failure to connect to the session bus), %FALSE is returned and @error
1293 // is set appropriately.
1295 // Note: the return value of this function is not an indicator that this
1296 // instance is or is not the primary instance of the application. See
1297 // g_application_get_is_remote() for that.
1298 // RETURNS: %TRUE if registration succeeded
1299 // <cancellable>: a #GCancellable, or %NULL
1300 int register()(Cancellable* cancellable, GLib2.Error** error=null) {
1301 return g_application_register(&this, cancellable, error);
1304 // Decrease the use count of @application.
1306 // When the use count reaches zero, the application will stop running.
1308 // Never call this function except to cancel the effect of a previous
1309 // call to g_application_hold().
1310 void release()() {
1311 g_application_release(&this);
1314 // VERSION: 2.28
1315 // Runs the application.
1317 // This function is intended to be run from main() and its return value
1318 // is intended to be returned by main(). Although you are expected to pass
1319 // the @argc, @argv parameters from main() to this function, it is possible
1320 // to pass %NULL if @argv is not available or commandline handling is not
1321 // required.
1323 // First, the local_command_line() virtual function is invoked.
1324 // This function always runs on the local instance. It gets passed a pointer
1325 // to a %NULL-terminated copy of @argv and is expected to remove the arguments
1326 // that it handled (shifting up remaining arguments). See
1327 // <xref linkend="gapplication-example-cmdline2"/> for an example of
1328 // parsing @argv manually. Alternatively, you may use the #GOptionContext API,
1329 // after setting <literal>argc = g_strv_length (argv);</literal>.
1331 // The last argument to local_command_line() is a pointer to the @status
1332 // variable which can used to set the exit status that is returned from
1333 // g_application_run().
1335 // If local_command_line() returns %TRUE, the command line is expected
1336 // to be completely handled, including possibly registering as the primary
1337 // instance, calling g_application_activate() or g_application_open(), etc.
1339 // If local_command_line() returns %FALSE then the application is registered
1340 // and the #GApplication::command-line signal is emitted in the primary
1341 // instance (which may or may not be this instance). The signal handler
1342 // gets passed a #GApplicationCommandline object that (among other things)
1343 // contains the remaining commandline arguments that have not been handled
1344 // by local_command_line().
1346 // If the application has the %G_APPLICATION_HANDLES_COMMAND_LINE
1347 // flag set then the default implementation of local_command_line()
1348 // always returns %FALSE immediately, resulting in the commandline
1349 // always being handled in the primary instance.
1351 // Otherwise, the default implementation of local_command_line() tries
1352 // to do a couple of things that are probably reasonable for most
1353 // applications. First, g_application_register() is called to attempt
1354 // to register the application. If that works, then the command line
1355 // arguments are inspected. If no commandline arguments are given, then
1356 // g_application_activate() is called. If commandline arguments are
1357 // given and the %G_APPLICATION_HANDLES_OPEN flag is set then they
1358 // are assumed to be filenames and g_application_open() is called.
1360 // If you need to handle commandline arguments that are not filenames,
1361 // and you don't mind commandline handling to happen in the primary
1362 // instance, you should set %G_APPLICATION_HANDLED_COMMAND_LINE and
1363 // process the commandline arguments in your #GApplication::command-line
1364 // signal handler, either manually or using the #GOptionContext API.
1366 // If you are interested in doing more complicated local handling of the
1367 // commandline then you should implement your own #GApplication subclass
1368 // and override local_command_line(). In this case, you most likely want
1369 // to return %TRUE from your local_command_line() implementation to
1370 // suppress the default handling. See
1371 // <xref linkend="gapplication-example-cmdline2"/> for an example.
1373 // If, after the above is done, the use count of the application is zero
1374 // then the exit status is returned immediately. If the use count is
1375 // non-zero then the mainloop is run until the use count falls to zero,
1376 // at which point 0 is returned.
1378 // If the %G_APPLICATION_IS_SERVICE flag is set, then the exiting at
1379 // use count of zero is delayed for a while (ie: the instance stays
1380 // around to provide its <emphasis>service</emphasis> to others).
1381 // RETURNS: the exit status
1382 // <argc>: the argc from main() (or 0 if @argv is %NULL)
1383 // <argv>: the argv from main(), or %NULL
1384 int run()(int argc, char** argv=null) {
1385 return g_application_run(&this, argc, argv);
1388 // VERSION: 2.28
1389 // Sets or unsets the group of actions associated with the application.
1391 // These actions are the actions that can be remotely invoked.
1393 // It is an error to call this function after the application has been
1394 // registered.
1395 // <action_group>: a #GActionGroup, or %NULL
1396 void set_action_group()(ActionGroup* action_group=null) {
1397 g_application_set_action_group(&this, action_group);
1400 // VERSION: 2.28
1401 // Sets the unique identifier for @application.
1403 // The application id can only be modified if @application has not yet
1404 // been registered.
1406 // The application id must be valid. See g_application_id_is_valid().
1407 // <application_id>: the identifier for @application
1408 void set_application_id()(char* application_id) {
1409 g_application_set_application_id(&this, application_id);
1412 // VERSION: 2.28
1413 // Sets the flags for @application.
1415 // The flags can only be modified if @application has not yet been
1416 // registered.
1418 // See #GApplicationFlags.
1419 // <flags>: the flags for @application
1420 void set_flags()(ApplicationFlags flags) {
1421 g_application_set_flags(&this, flags);
1424 // VERSION: 2.28
1425 // Sets the current inactivity timeout for the application.
1427 // This is the amount of time (in milliseconds) after the last call to
1428 // g_application_release() before the application stops running.
1430 // This call has no side effects of its own. The value set here is only
1431 // used for next time g_application_release() drops the use count to
1432 // zero. Any timeouts currently in progress are not impacted.
1433 // RETURNS: the timeout, in milliseconds
1434 // <inactivity_timeout>: the timeout, in milliseconds
1435 void set_inactivity_timeout()(uint inactivity_timeout) {
1436 g_application_set_inactivity_timeout(&this, inactivity_timeout);
1439 // The ::activate signal is emitted on the primary instance when an
1440 // activation occurs. See g_application_activate().
1441 extern (C) alias static void function (Application* this_, void* user_data=null) signal_activate;
1443 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
1444 return super_.signal_connect!name(cb, data, cf);
1447 ulong signal_connect(string name:"activate", CB:signal_activate)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
1448 return signal_connect_data!()(&this, cast(char*)"activate",
1449 cast(GObject2.Callback)cb, data, null, cf);
1452 // The ::command-line signal is emitted on the primary instance when
1453 // a commandline is not handled locally. See g_application_run() and
1454 // the #GApplicationCommandline documentation for more information.
1456 // process. See g_application_command_line_set_exit_status().
1457 // RETURNS: An integer that is set as the exit status for the calling
1458 // <command_line>: a #GApplicationCommandLine representing the passed commandline
1459 extern (C) alias static int function (Application* this_, ApplicationCommandLine* command_line, void* user_data=null) signal_command_line;
1460 ulong signal_connect(string name:"command-line", CB:signal_command_line)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
1461 return signal_connect_data!()(&this, cast(char*)"command-line",
1462 cast(GObject2.Callback)cb, data, null, cf);
1465 // The ::open signal is emitted on the primary instance when there are
1466 // files to open. See g_application_open() for more information.
1467 // <files>: an array of #GFiles
1468 // <n_files>: the length of @files
1469 // <hint>: a hint provided by the calling instance
1470 extern (C) alias static void function (Application* this_, File* files, int n_files, char* hint, void* user_data=null) signal_open;
1471 ulong signal_connect(string name:"open", CB:signal_open)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
1472 return signal_connect_data!()(&this, cast(char*)"open",
1473 cast(GObject2.Callback)cb, data, null, cf);
1476 // The ::startup signal is emitted on the primary instance immediately
1477 // after registration. See g_application_register().
1478 extern (C) alias static void function (Application* this_, void* user_data=null) signal_startup;
1479 ulong signal_connect(string name:"startup", CB:signal_startup)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
1480 return signal_connect_data!()(&this, cast(char*)"startup",
1481 cast(GObject2.Callback)cb, data, null, cf);
1485 struct ApplicationClass /* Version 2.28 */ {
1486 private GObject2.ObjectClass parent_class;
1487 extern (C) void function (Application* application) startup;
1488 extern (C) void function (Application* application) activate;
1490 // <files>: an array of #GFiles to open
1491 // <n_files>: the length of the @files array
1492 // <hint>: a hint (or ""), but never %NULL
1493 extern (C) void function (Application* application, File** files, int n_files, char* hint) open;
1494 extern (C) int function (Application* application, ApplicationCommandLine* command_line) command_line;
1495 extern (C) int function (Application* application, char*** arguments, int* exit_status) local_command_line;
1496 extern (C) void function (Application* application, GLib2.Variant* platform_data) before_emit;
1497 extern (C) void function (Application* application, GLib2.Variant* platform_data) after_emit;
1498 extern (C) void function (Application* application, GLib2.VariantBuilder* builder) add_platform_data;
1499 extern (C) void function (Application* application) quit_mainloop;
1500 extern (C) void function (Application* application) run_mainloop;
1501 private void*[12] padding;
1505 // #GApplicationCommandLine represents a command-line invocation of
1506 // an application. It is created by #GApplication and emitted
1507 // in the #GApplication::command-line signal and virtual function.
1509 // The class contains the list of arguments that the program was invoked
1510 // with. It is also possible to query if the commandline invocation was
1511 // local (ie: the current process is running in direct response to the
1512 // invocation) or remote (ie: some other process forwarded the
1513 // commandline to this process).
1515 // The GApplicationCommandLine object can provide the @argc and @argv
1516 // parameters for use with the #GOptionContext command-line parsing API,
1517 // with the g_application_command_line_get_arguments() function. See
1518 // <xref linkend="gapplication-example-cmdline3"/> for an example.
1520 // The exit status of the originally-invoked process may be set and
1521 // messages can be printed to stdout or stderr of that process. The
1522 // lifecycle of the originally-invoked process is tied to the lifecycle
1523 // of this object (ie: the process exits when the last reference is
1524 // dropped).
1526 // The main use for #GApplicationCommandline (and the
1527 // #GApplication::command-line signal) is 'Emacs server' like use cases:
1528 // You can set the <envar>EDITOR</envar> environment variable to have
1529 // e.g. git use your favourite editor to edit commit messages, and if you
1530 // already have an instance of the editor running, the editing will happen
1531 // in the running instance, instead of opening a new one. An important
1532 // aspect of this use case is that the process that gets started by git
1533 // does not return until the editing is done.
1535 // <example id="gapplication-example-cmdline"><title>Handling commandline arguments with GApplication</title>
1536 // <para>
1537 // A simple example where the commandline is completely handled
1538 // in the #GApplication::command-line handler. The launching instance exits
1539 // once the signal handler in the primary instance has returned, and the
1540 // return value of the signal handler becomes the exit status of the launching
1541 // instance.
1542 // </para>
1543 // <programlisting>
1544 // <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-cmdline.c">
1545 // <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
1546 // </xi:include>
1547 // </programlisting>
1548 // </example>
1550 // <example id="gapplication-example-cmdline2"><title>Split commandline handling</title>
1551 // <para>
1552 // An example of split commandline handling. Options that start with
1553 // <literal>--local-</literal> are handled locally, all other options are
1554 // passed to the #GApplication::command-line handler which runs in the primary
1555 // instance.
1556 // </para>
1557 // <programlisting>
1558 // <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-cmdline2.c">
1559 // <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
1560 // </xi:include>
1561 // </programlisting>
1562 // </example>
1564 // <example id="gapplication-example-cmdline3"><title>Deferred commandline handling</title>
1565 // <para>
1566 // An example of deferred commandline handling. Here, the commandline is
1567 // not completely handled before the #GApplication::command-line handler
1568 // returns. Instead, we keep a reference to the GApplicationCommandline
1569 // object and handle it later(in this example, in an idle). Note that it
1570 // is necessary to hold the application until you are done with the
1571 // commandline.
1572 // </para>
1573 // <para>
1574 // This example also shows how to use #GOptionContext for parsing the
1575 // commandline arguments. Note that it is necessary to disable the
1576 // built-in help-handling of #GOptionContext, since it calls exit()
1577 // after printing help, which is not what you want to happen in
1578 // the primary instance.
1579 // </para>
1580 // <programlisting>
1581 // <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gio/tests/gapplication-example-cmdline3.c">
1582 // <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
1583 // </xi:include>
1584 // </programlisting>
1585 // </example>
1586 struct ApplicationCommandLine /* : GObject.Object */ /* Version 2.28 */ {
1587 alias parent_instance this;
1588 alias parent_instance super_;
1589 alias parent_instance object;
1590 GObject2.Object parent_instance;
1591 private ApplicationCommandLinePrivate* priv;
1594 // VERSION: 2.28
1595 // Gets the list of arguments that was passed on the command line.
1597 // The strings in the array may contain non-utf8 data.
1599 // The return value is %NULL-terminated and should be freed using
1600 // g_strfreev().
1602 // containing the arguments (the argv)
1603 // RETURNS: the string array
1604 // <argc>: the length of the arguments array, or %NULL
1605 char** /*new*/ get_arguments()(/*out*/ int* argc) {
1606 return g_application_command_line_get_arguments(&this, argc);
1609 // VERSION: 2.28
1610 // Gets the working directory of the command line invocation.
1611 // The string may contain non-utf8 data.
1613 // It is possible that the remote application did not send a working
1614 // directory, so this may be %NULL.
1616 // The return value should not be modified or freed and is valid for as
1617 // long as @cmdline exists.
1618 // RETURNS: the current directory, or %NULL
1619 char* get_cwd()() {
1620 return g_application_command_line_get_cwd(&this);
1623 // VERSION: 2.28
1624 // Gets the contents of the 'environ' variable of the command line
1625 // invocation, as would be returned by g_get_environ(), ie as a
1626 // %NULL-terminated list of strings in the form 'NAME=VALUE'.
1627 // The strings may contain non-utf8 data.
1629 // The remote application usually does not send an environment. Use
1630 // %G_APPLICATION_SEND_ENVIRONMENT to affect that. Even with this flag
1631 // set it is possible that the environment is still not available (due
1632 // to invocation messages from other applications).
1634 // The return value should not be modified or freed and is valid for as
1635 // long as @cmdline exists.
1637 // See g_application_command_line_getenv() if you are only interested
1638 // in the value of a single environment variable.
1640 // strings, or %NULL if they were not sent
1641 // RETURNS: the environment
1642 char** get_environ()() {
1643 return g_application_command_line_get_environ(&this);
1646 // VERSION: 2.28
1647 // Gets the exit status of @cmdline. See
1648 // g_application_command_line_set_exit_status() for more information.
1649 // RETURNS: the exit status
1650 int get_exit_status()() {
1651 return g_application_command_line_get_exit_status(&this);
1654 // VERSION: 2.28
1655 // Determines if @cmdline represents a remote invocation.
1656 // RETURNS: %TRUE if the invocation was remote
1657 int get_is_remote()() {
1658 return g_application_command_line_get_is_remote(&this);
1661 // VERSION: 2.28
1662 // Gets the platform data associated with the invocation of @cmdline.
1664 // This is a #GVariant dictionary containing information about the
1665 // context in which the invocation occurred. It typically contains
1666 // information like the current working directory and the startup
1667 // notification ID.
1669 // For local invocation, it will be %NULL.
1670 // RETURNS: the platform data, or %NULL
1671 GLib2.Variant* /*new*/ get_platform_data()() {
1672 return g_application_command_line_get_platform_data(&this);
1675 // VERSION: 2.28
1676 // Gets the value of a particular environment variable of the command
1677 // line invocation, as would be returned by g_getenv(). The strings may
1678 // contain non-utf8 data.
1680 // The remote application usually does not send an environment. Use
1681 // %G_APPLICATION_SEND_ENVIRONMENT to affect that. Even with this flag
1682 // set it is possible that the environment is still not available (due
1683 // to invocation messages from other applications).
1685 // The return value should not be modified or freed and is valid for as
1686 // long as @cmdline exists.
1687 // RETURNS: the value of the variable, or %NULL if unset or unsent
1688 // <name>: the environment variable to get
1689 char* getenv()(char* name) {
1690 return g_application_command_line_getenv(&this, name);
1693 // Unintrospectable method: print() / g_application_command_line_print()
1694 // VERSION: 2.28
1695 // Formats a message and prints it using the stdout print handler in the
1696 // invoking process.
1698 // If @cmdline is a local invocation then this is exactly equivalent to
1699 // g_print(). If @cmdline is remote then this is equivalent to calling
1700 // g_print() in the invoking process.
1701 // <format>: a printf-style format string
1702 /+ Not available -- variadic methods unsupported - use the C function directly.
1703 alias g_application_command_line_print print; // Variadic
1706 // Unintrospectable method: printerr() / g_application_command_line_printerr()
1707 // VERSION: 2.28
1708 // Formats a message and prints it using the stderr print handler in the
1709 // invoking process.
1711 // If @cmdline is a local invocation then this is exactly equivalent to
1712 // g_printerr(). If @cmdline is remote then this is equivalent to
1713 // calling g_printerr() in the invoking process.
1714 // <format>: a printf-style format string
1715 /+ Not available -- variadic methods unsupported - use the C function directly.
1716 alias g_application_command_line_printerr printerr; // Variadic
1719 // VERSION: 2.28
1720 // Sets the exit status that will be used when the invoking process
1721 // exits.
1723 // The return value of the #GApplication::command-line signal is
1724 // passed to this function when the handler returns. This is the usual
1725 // way of setting the exit status.
1727 // In the event that you want the remote invocation to continue running
1728 // and want to decide on the exit status in the future, you can use this
1729 // call. For the case of a remote invocation, the remote process will
1730 // typically exit when the last reference is dropped on @cmdline. The
1731 // exit status of the remote process will be equal to the last value
1732 // that was set with this function.
1734 // In the case that the commandline invocation is local, the situation
1735 // is slightly more complicated. If the commandline invocation results
1736 // in the mainloop running (ie: because the use-count of the application
1737 // increased to a non-zero value) then the application is considered to
1738 // have been 'successful' in a certain sense, and the exit status is
1739 // always zero. If the application use count is zero, though, the exit
1740 // status of the local #GApplicationCommandLine is used.
1741 // <exit_status>: the exit status
1742 void set_exit_status()(int exit_status) {
1743 g_application_command_line_set_exit_status(&this, exit_status);
1748 // The <structname>GApplicationCommandLineClass</structname> structure contains
1749 // private data only
1750 struct ApplicationCommandLineClass /* Version 2.28 */ {
1751 private GObject2.ObjectClass parent_class;
1752 extern (C) void function (ApplicationCommandLine* cmdline, char* message) print_literal;
1753 extern (C) void function (ApplicationCommandLine* cmdline, char* message) printerr_literal;
1754 private void*[12] padding;
1757 struct ApplicationCommandLinePrivate {
1760 // Flags used to define the behaviour of a #GApplication.
1761 enum ApplicationFlags /* Version 2.28 */ {
1762 FLAGS_NONE = 0,
1763 IS_SERVICE = 1,
1764 IS_LAUNCHER = 2,
1765 HANDLES_OPEN = 4,
1766 HANDLES_COMMAND_LINE = 8,
1767 SEND_ENVIRONMENT = 16,
1768 NON_UNIQUE = 32
1770 struct ApplicationPrivate {
1774 // #GAskPasswordFlags are used to request specific information from the
1775 // user, or to notify the user of their choices in an authentication
1776 // situation.
1777 enum AskPasswordFlags {
1778 NEED_PASSWORD = 1,
1779 NEED_USERNAME = 2,
1780 NEED_DOMAIN = 4,
1781 SAVING_SUPPORTED = 8,
1782 ANONYMOUS_SUPPORTED = 16
1785 // This is the asynchronous version of #GInitable; it behaves the same
1786 // in all ways except that initialization is asynchronous. For more details
1787 // see the descriptions on #GInitable.
1789 // A class may implement both the #GInitable and #GAsyncInitable interfaces.
1791 // Users of objects implementing this are not intended to use the interface
1792 // method directly; instead it will be used automatically in various ways.
1793 // For C applications you generally just call g_async_initable_new_async()
1794 // directly, or indirectly via a foo_thing_new_async() wrapper. This will call
1795 // g_async_initable_init_async() under the cover, calling back with %NULL and
1796 // a set %GError on failure.
1798 // A typical implementation might look something like this:
1800 // |[
1801 // enum {
1802 // NOT_INITIALIZED,
1803 // INITIALIZING,
1804 // INITIALIZED
1805 // };
1807 // static void
1808 // _foo_ready_cb (Foo *self)
1809 // {
1810 // GList *l;
1812 // self->priv->state = INITIALIZED;
1814 // for (l = self->priv->init_results; l != NULL; l = l->next)
1815 // {
1816 // GSimpleAsyncResult *simple = l->data;
1818 // if (!self->priv->success)
1819 // g_simple_async_result_set_error (simple, ...);
1821 // g_simple_async_result_complete (simple);
1822 // g_object_unref (simple);
1823 // }
1825 // g_list_free (self->priv->init_results);
1826 // self->priv->init_results = NULL;
1827 // }
1829 // static void
1830 // foo_init_async (GAsyncInitable *initable,
1831 // int io_priority,
1832 // GCancellable *cancellable,
1833 // GAsyncReadyCallback callback,
1834 // gpointer user_data)
1835 // {
1836 // Foo *self = FOO (initable);
1837 // GSimpleAsyncResult *simple;
1839 // simple = g_simple_async_result_new (G_OBJECT (initable)
1840 // callback,
1841 // user_data,
1842 // foo_init_async);
1844 // switch (self->priv->state)
1845 // {
1846 // case NOT_INITIALIZED:
1847 // _foo_get_ready (self);
1848 // self->priv->init_results = g_list_append (self->priv->init_results,
1849 // simple);
1850 // self->priv->state = INITIALIZING;
1851 // break;
1852 // case INITIALIZING:
1853 // self->priv->init_results = g_list_append (self->priv->init_results,
1854 // simple);
1855 // break;
1856 // case INITIALIZED:
1857 // if (!self->priv->success)
1858 // g_simple_async_result_set_error (simple, ...);
1860 // g_simple_async_result_complete_in_idle (simple);
1861 // g_object_unref (simple);
1862 // break;
1863 // }
1864 // }
1866 // static gboolean
1867 // foo_init_finish (GAsyncInitable *initable,
1868 // GAsyncResult *result,
1869 // GError **error)
1870 // {
1871 // g_return_val_if_fail (g_simple_async_result_is_valid (result,
1872 // G_OBJECT (initable), foo_init_async), FALSE);
1874 // if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (result),
1875 // error))
1876 // return FALSE;
1878 // return TRUE;
1879 // }
1881 // static void
1882 // foo_async_initable_iface_init (gpointer g_iface,
1883 // gpointer data)
1884 // {
1885 // GAsyncInitableIface *iface = g_iface;
1887 // iface->init_async = foo_init_async;
1888 // iface->init_finish = foo_init_finish;
1889 // }
1890 // ]|
1891 struct AsyncInitable /* Interface */ /* Version 2.22 */ {
1892 mixin template __interface__() {
1893 // Unintrospectable function: new_async() / g_async_initable_new_async()
1894 // VERSION: 2.22
1895 // Helper function for constructing #GAsyncInitable object. This is
1896 // similar to g_object_new() but also initializes the object asynchronously.
1898 // When the initialization is finished, @callback will be called. You can
1899 // then call g_async_initable_new_finish() to get the new object and check
1900 // for any errors.
1901 // <object_type>: a #GType supporting #GAsyncInitable.
1902 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the operation.
1903 // <cancellable>: optional #GCancellable object, %NULL to ignore.
1904 // <callback>: a #GAsyncReadyCallback to call when the initialization is finished
1905 // <user_data>: the data to pass to callback function
1906 // <first_property_name>: the name of the first property, or %NULL if no properties
1907 alias g_async_initable_new_async new_async; // Variadic
1909 // Unintrospectable function: new_valist_async() / g_async_initable_new_valist_async()
1910 // VERSION: 2.22
1911 // Helper function for constructing #GAsyncInitable object. This is
1912 // similar to g_object_new_valist() but also initializes the object
1913 // asynchronously.
1915 // When the initialization is finished, @callback will be called. You can
1916 // then call g_async_initable_new_finish() to get the new object and check
1917 // for any errors.
1918 // <object_type>: a #GType supporting #GAsyncInitable.
1919 // <first_property_name>: the name of the first property, followed by the value, and other property value pairs, and ended by %NULL.
1920 // <var_args>: The var args list generated from @first_property_name.
1921 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the operation.
1922 // <cancellable>: optional #GCancellable object, %NULL to ignore.
1923 // <callback>: a #GAsyncReadyCallback to call when the initialization is finished
1924 // <user_data>: the data to pass to callback function
1925 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) {
1926 g_async_initable_new_valist_async(object_type, first_property_name, var_args, io_priority, cancellable, callback, user_data);
1929 // VERSION: 2.22
1930 // Helper function for constructing #GAsyncInitable object. This is
1931 // similar to g_object_newv() but also initializes the object asynchronously.
1933 // When the initialization is finished, @callback will be called. You can
1934 // then call g_async_initable_new_finish() to get the new object and check
1935 // for any errors.
1936 // <object_type>: a #GType supporting #GAsyncInitable.
1937 // <n_parameters>: the number of parameters in @parameters
1938 // <parameters>: the parameters to use to construct the object
1939 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the operation.
1940 // <cancellable>: optional #GCancellable object, %NULL to ignore.
1941 // <callback>: a #GAsyncReadyCallback to call when the initialization is finished
1942 // <user_data>: the data to pass to callback function
1943 static void newv_async()(Type object_type, uint n_parameters, GObject2.Parameter* parameters, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
1944 g_async_initable_newv_async(object_type, n_parameters, parameters, io_priority, cancellable, callback, user_data);
1947 // VERSION: 2.22
1948 // Starts asynchronous initialization of the object implementing the
1949 // interface. This must be done before any real use of the object after
1950 // initial construction. If the object also implements #GInitable you can
1951 // optionally call g_initable_init() instead.
1953 // When the initialization is finished, @callback will be called. You can
1954 // then call g_async_initable_init_finish() to get the result of the
1955 // initialization.
1957 // Implementations may also support cancellation. If @cancellable is not
1958 // %NULL, then initialization can be cancelled by triggering the cancellable
1959 // object from another thread. If the operation was cancelled, the error
1960 // %G_IO_ERROR_CANCELLED will be returned. If @cancellable is not %NULL, and
1961 // the object doesn't support cancellable initialization, the error
1962 // %G_IO_ERROR_NOT_SUPPORTED will be returned.
1964 // If this function is not called, or returns with an error, then all
1965 // operations on the object should fail, generally returning the
1966 // error %G_IO_ERROR_NOT_INITIALIZED.
1968 // Implementations of this method must be idempotent: i.e. multiple calls
1969 // to this function with the same argument should return the same results.
1970 // Only the first call initializes the object; further calls return the result
1971 // of the first call. This is so that it's safe to implement the singleton
1972 // pattern in the GObject constructor function.
1974 // For classes that also support the #GInitable interface, the default
1975 // implementation of this method will run the g_initable_init() function
1976 // in a thread, so if you want to support asynchronous initialization via
1977 // threads, just implement the #GAsyncInitable interface without overriding
1978 // any interface methods.
1979 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the operation.
1980 // <cancellable>: optional #GCancellable object, %NULL to ignore.
1981 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
1982 // <user_data>: the data to pass to callback function
1983 void init_async()(int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
1984 g_async_initable_init_async(cast(AsyncInitable*)&this, io_priority, cancellable, callback, user_data);
1987 // VERSION: 2.22
1988 // Finishes asynchronous initialization and returns the result.
1989 // See g_async_initable_init_async().
1991 // will return %FALSE and set @error appropriately if present.
1992 // RETURNS: %TRUE if successful. If an error has occurred, this function
1993 // <res>: a #GAsyncResult.
1994 int init_finish()(AsyncResult* res, GLib2.Error** error=null) {
1995 return g_async_initable_init_finish(cast(AsyncInitable*)&this, res, error);
1998 // VERSION: 2.22
1999 // Finishes the async construction for the various g_async_initable_new
2000 // calls, returning the created object or %NULL on error.
2002 // Free with g_object_unref().
2003 // RETURNS: a newly created #GObject, or %NULL on error.
2004 // <res>: the #GAsyncResult from the callback
2005 GObject2.Object* /*new*/ new_finish()(AsyncResult* res, GLib2.Error** error=null) {
2006 return g_async_initable_new_finish(cast(AsyncInitable*)&this, res, error);
2009 mixin __interface__;
2013 // Provides an interface for asynchronous initializing object such that
2014 // initialization may fail.
2015 struct AsyncInitableIface /* Version 2.22 */ {
2016 GObject2.TypeInterface g_iface;
2018 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the operation.
2019 // <cancellable>: optional #GCancellable object, %NULL to ignore.
2020 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
2021 // <user_data>: the data to pass to callback function
2022 extern (C) void function (AsyncInitable* initable, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) init_async;
2024 // RETURNS: %TRUE if successful. If an error has occurred, this function
2025 // <res>: a #GAsyncResult.
2026 extern (C) int function (AsyncInitable* initable, AsyncResult* res, GLib2.Error** error=null) init_finish;
2030 // Type definition for a function that will be called back when an asynchronous
2031 // operation within GIO has been completed.
2032 // <source_object>: the object the asynchronous operation was started with.
2033 // <res>: a #GAsyncResult.
2034 // <user_data>: user data passed to the callback.
2035 extern (C) alias void function (GObject2.Object* source_object, AsyncResult* res, void* user_data) AsyncReadyCallback;
2038 // Provides a base class for implementing asynchronous function results.
2040 // Asynchronous operations are broken up into two separate operations
2041 // which are chained together by a #GAsyncReadyCallback. To begin
2042 // an asynchronous operation, provide a #GAsyncReadyCallback to the
2043 // asynchronous function. This callback will be triggered when the
2044 // operation has completed, and will be passed a #GAsyncResult instance
2045 // filled with the details of the operation's success or failure, the
2046 // object the asynchronous function was started for and any error codes
2047 // returned. The asynchronous callback function is then expected to call
2048 // the corresponding "_finish()" function, passing the object the
2049 // function was called for, the #GAsyncResult instance, and (optionally)
2050 // an @error to grab any error conditions that may have occurred.
2052 // The "_finish()" function for an operation takes the generic result
2053 // (of type #GAsyncResult) and returns the specific result that the
2054 // operation in question yields (e.g. a #GFileEnumerator for a
2055 // "enumerate children" operation). If the result or error status of the
2056 // operation is not needed, there is no need to call the "_finish()"
2057 // function; GIO will take care of cleaning up the result and error
2058 // information after the #GAsyncReadyCallback returns. You can pass
2059 // %NULL for the #GAsyncReadyCallback if you don't need to take any
2060 // action at all after the operation completes. Applications may also
2061 // take a reference to the #GAsyncResult and call "_finish()" later;
2062 // however, the "_finish()" function may be called at most once.
2064 // Example of a typical asynchronous operation flow:
2065 // |[
2066 // void _theoretical_frobnitz_async (Theoretical *t,
2067 // GCancellable *c,
2068 // GAsyncReadyCallback *cb,
2069 // gpointer u);
2071 // gboolean _theoretical_frobnitz_finish (Theoretical *t,
2072 // GAsyncResult *res,
2073 // GError **e);
2075 // static void
2076 // frobnitz_result_func (GObject *source_object,
2077 // GAsyncResult *res,
2078 // gpointer user_data)
2079 // {
2080 // gboolean success = FALSE;
2082 // success = _theoretical_frobnitz_finish (source_object, res, NULL);
2084 // if (success)
2085 // g_printf ("Hurray!\n");
2086 // else
2087 // g_printf ("Uh oh!\n");
2089 // /<!-- -->* ... *<!-- -->/
2091 // }
2093 // int main (int argc, void *argv[])
2094 // {
2095 // /<!-- -->* ... *<!-- -->/
2097 // _theoretical_frobnitz_async (theoretical_data,
2098 // NULL,
2099 // frobnitz_result_func,
2100 // NULL);
2102 // /<!-- -->* ... *<!-- -->/
2103 // }
2104 // ]|
2106 // The callback for an asynchronous operation is called only once, and is
2107 // always called, even in the case of a cancelled operation. On cancellation
2108 // the result is a %G_IO_ERROR_CANCELLED error.
2110 // Some asynchronous operations are implemented using synchronous calls.
2111 // These are run in a separate thread, if #GThread has been initialized, but
2112 // otherwise they are sent to the Main Event Loop and processed in an idle
2113 // function. So, if you truly need asynchronous operations, make sure to
2114 // initialize #GThread.
2115 struct AsyncResult /* Interface */ {
2116 mixin template __interface__() {
2117 // Gets the source object from a #GAsyncResult.
2119 // or %NULL if there is none.
2120 // RETURNS: a new reference to the source object for the @res,
2121 GObject2.Object* /*new*/ get_source_object()() {
2122 return g_async_result_get_source_object(cast(AsyncResult*)&this);
2125 // Gets the user data from a #GAsyncResult.
2126 // RETURNS: the user data for @res.
2127 void* /*new*/ get_user_data()() {
2128 return g_async_result_get_user_data(cast(AsyncResult*)&this);
2131 mixin __interface__;
2134 // Interface definition for #GAsyncResult.
2135 struct AsyncResultIface {
2136 GObject2.TypeInterface g_iface;
2137 // RETURNS: the user data for @res.
2138 extern (C) void* /*new*/ function (AsyncResult* res) get_user_data;
2139 // RETURNS: a new reference to the source object for the @res,
2140 extern (C) GObject2.Object* /*new*/ function (AsyncResult* res) get_source_object;
2144 // Buffered input stream implements #GFilterInputStream and provides
2145 // for buffered reads.
2147 // By default, #GBufferedInputStream's buffer size is set at 4 kilobytes.
2149 // To create a buffered input stream, use g_buffered_input_stream_new(),
2150 // or g_buffered_input_stream_new_sized() to specify the buffer's size at
2151 // construction.
2153 // To get the size of a buffer within a buffered input stream, use
2154 // g_buffered_input_stream_get_buffer_size(). To change the size of a
2155 // buffered input stream's buffer, use
2156 // g_buffered_input_stream_set_buffer_size(). Note that the buffer's size
2157 // cannot be reduced below the size of the data within the buffer.
2158 struct BufferedInputStream /* : FilterInputStream */ {
2159 alias parent_instance this;
2160 alias parent_instance super_;
2161 alias parent_instance filterinputstream;
2162 FilterInputStream parent_instance;
2163 private BufferedInputStreamPrivate* priv;
2166 // Creates a new #GInputStream from the given @base_stream, with
2167 // a buffer set to the default size (4 kilobytes).
2168 // RETURNS: a #GInputStream for the given @base_stream.
2169 // <base_stream>: a #GInputStream
2170 static BufferedInputStream* /*new*/ new_()(InputStream* base_stream) {
2171 return g_buffered_input_stream_new(base_stream);
2174 // Creates a new #GBufferedInputStream from the given @base_stream,
2175 // with a buffer set to @size.
2176 // RETURNS: a #GInputStream.
2177 // <base_stream>: a #GInputStream
2178 // <size>: a #gsize
2179 static BufferedInputStream* /*new*/ new_sized()(InputStream* base_stream, size_t size) {
2180 return g_buffered_input_stream_new_sized(base_stream, size);
2183 // Tries to read @count bytes from the stream into the buffer.
2184 // Will block during this read.
2186 // If @count is zero, returns zero and does nothing. A value of @count
2187 // larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
2189 // On success, the number of bytes read into the buffer is returned.
2190 // It is not an error if this is not the same as the requested size, as it
2191 // can happen e.g. near the end of a file. Zero is returned on end of file
2192 // (or if @count is zero), but never otherwise.
2194 // If @count is -1 then the attempted read size is equal to the number of
2195 // bytes that are required to fill the buffer.
2197 // If @cancellable is not %NULL, then the operation can be cancelled by
2198 // triggering the cancellable object from another thread. If the operation
2199 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
2200 // operation was partially finished when the operation was cancelled the
2201 // partial result will be returned, without an error.
2203 // On error -1 is returned and @error is set accordingly.
2205 // For the asynchronous, non-blocking, version of this function, see
2206 // g_buffered_input_stream_fill_async().
2208 // or -1 on error.
2209 // RETURNS: the number of bytes read into @stream's buffer, up to @count,
2210 // <count>: the number of bytes that will be read from the stream
2211 // <cancellable>: optional #GCancellable object, %NULL to ignore
2212 ssize_t fill()(ssize_t count, Cancellable* cancellable, GLib2.Error** error=null) {
2213 return g_buffered_input_stream_fill(&this, count, cancellable, error);
2216 // Reads data into @stream's buffer asynchronously, up to @count size.
2217 // @io_priority can be used to prioritize reads. For the synchronous
2218 // version of this function, see g_buffered_input_stream_fill().
2220 // If @count is -1 then the attempted read size is equal to the number
2221 // of bytes that are required to fill the buffer.
2222 // <count>: the number of bytes that will be read from the stream
2223 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request
2224 // <cancellable>: optional #GCancellable object
2225 // <callback>: a #GAsyncReadyCallback
2226 // <user_data>: a #gpointer
2227 void fill_async()(ssize_t count, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
2228 g_buffered_input_stream_fill_async(&this, count, io_priority, cancellable, callback, user_data);
2231 // Finishes an asynchronous read.
2232 // RETURNS: a #gssize of the read stream, or %-1 on an error.
2233 // <result>: a #GAsyncResult
2234 ssize_t fill_finish()(AsyncResult* result, GLib2.Error** error=null) {
2235 return g_buffered_input_stream_fill_finish(&this, result, error);
2238 // Gets the size of the available data within the stream.
2239 // RETURNS: size of the available stream.
2240 size_t get_available()() {
2241 return g_buffered_input_stream_get_available(&this);
2244 // Gets the size of the input buffer.
2245 // RETURNS: the current buffer size.
2246 size_t get_buffer_size()() {
2247 return g_buffered_input_stream_get_buffer_size(&this);
2250 // Peeks in the buffer, copying data of size @count into @buffer,
2251 // offset @offset bytes.
2252 // RETURNS: a #gsize of the number of bytes peeked, or -1 on error.
2253 // <buffer>: a pointer to an allocated chunk of memory
2254 // <offset>: a #gsize
2255 // <count>: a #gsize
2256 size_t peek()(void* buffer, size_t offset, size_t count) {
2257 return g_buffered_input_stream_peek(&this, buffer, offset, count);
2260 // Returns the buffer with the currently available bytes. The returned
2261 // buffer must not be modified and will become invalid when reading from
2262 // the stream or filling the buffer.
2264 // read-only buffer
2265 // <count>: a #gsize to get the number of bytes available in the buffer
2266 ubyte* peek_buffer()(/*out*/ size_t* count) {
2267 return g_buffered_input_stream_peek_buffer(&this, count);
2270 // Tries to read a single byte from the stream or the buffer. Will block
2271 // during this read.
2273 // On success, the byte read from the stream is returned. On end of stream
2274 // -1 is returned but it's not an exceptional error and @error is not set.
2276 // If @cancellable is not %NULL, then the operation can be cancelled by
2277 // triggering the cancellable object from another thread. If the operation
2278 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
2279 // operation was partially finished when the operation was cancelled the
2280 // partial result will be returned, without an error.
2282 // On error -1 is returned and @error is set accordingly.
2283 // RETURNS: the byte read from the @stream, or -1 on end of stream or error.
2284 // <cancellable>: optional #GCancellable object, %NULL to ignore
2285 int read_byte()(Cancellable* cancellable, GLib2.Error** error=null) {
2286 return g_buffered_input_stream_read_byte(&this, cancellable, error);
2289 // Sets the size of the internal buffer of @stream to @size, or to the
2290 // size of the contents of the buffer. The buffer can never be resized
2291 // smaller than its current contents.
2292 // <size>: a #gsize
2293 void set_buffer_size()(size_t size) {
2294 g_buffered_input_stream_set_buffer_size(&this, size);
2298 struct BufferedInputStreamClass {
2299 FilterInputStreamClass parent_class;
2301 // RETURNS: the number of bytes read into @stream's buffer, up to @count,
2302 // <count>: the number of bytes that will be read from the stream
2303 // <cancellable>: optional #GCancellable object, %NULL to ignore
2304 extern (C) ssize_t function (BufferedInputStream* stream, ssize_t count, Cancellable* cancellable, GLib2.Error** error=null) fill;
2306 // <count>: the number of bytes that will be read from the stream
2307 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request
2308 // <cancellable>: optional #GCancellable object
2309 // <callback>: a #GAsyncReadyCallback
2310 // <user_data>: a #gpointer
2311 extern (C) void function (BufferedInputStream* stream, ssize_t count, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) fill_async;
2313 // RETURNS: a #gssize of the read stream, or %-1 on an error.
2314 // <result>: a #GAsyncResult
2315 extern (C) ssize_t function (BufferedInputStream* stream, AsyncResult* result, GLib2.Error** error=null) fill_finish;
2316 extern (C) void function () _g_reserved1;
2317 extern (C) void function () _g_reserved2;
2318 extern (C) void function () _g_reserved3;
2319 extern (C) void function () _g_reserved4;
2320 extern (C) void function () _g_reserved5;
2323 struct BufferedInputStreamPrivate {
2327 // Buffered output stream implements #GFilterOutputStream and provides
2328 // for buffered writes.
2330 // By default, #GBufferedOutputStream's buffer size is set at 4 kilobytes.
2332 // To create a buffered output stream, use g_buffered_output_stream_new(),
2333 // or g_buffered_output_stream_new_sized() to specify the buffer's size
2334 // at construction.
2336 // To get the size of a buffer within a buffered input stream, use
2337 // g_buffered_output_stream_get_buffer_size(). To change the size of a
2338 // buffered output stream's buffer, use
2339 // g_buffered_output_stream_set_buffer_size(). Note that the buffer's
2340 // size cannot be reduced below the size of the data within the buffer.
2341 struct BufferedOutputStream /* : FilterOutputStream */ {
2342 alias parent_instance this;
2343 alias parent_instance super_;
2344 alias parent_instance filteroutputstream;
2345 FilterOutputStream parent_instance;
2346 BufferedOutputStreamPrivate* priv;
2349 // Creates a new buffered output stream for a base stream.
2350 // RETURNS: a #GOutputStream for the given @base_stream.
2351 // <base_stream>: a #GOutputStream.
2352 static BufferedOutputStream* /*new*/ new_()(OutputStream* base_stream) {
2353 return g_buffered_output_stream_new(base_stream);
2356 // Creates a new buffered output stream with a given buffer size.
2357 // RETURNS: a #GOutputStream with an internal buffer set to @size.
2358 // <base_stream>: a #GOutputStream.
2359 // <size>: a #gsize.
2360 static BufferedOutputStream* /*new*/ new_sized()(OutputStream* base_stream, size_t size) {
2361 return g_buffered_output_stream_new_sized(base_stream, size);
2364 // Checks if the buffer automatically grows as data is added.
2366 // %FALSE otherwise.
2367 // RETURNS: %TRUE if the @stream's buffer automatically grows,
2368 int get_auto_grow()() {
2369 return g_buffered_output_stream_get_auto_grow(&this);
2372 // Gets the size of the buffer in the @stream.
2373 // RETURNS: the current size of the buffer.
2374 size_t get_buffer_size()() {
2375 return g_buffered_output_stream_get_buffer_size(&this);
2378 // Sets whether or not the @stream's buffer should automatically grow.
2379 // If @auto_grow is true, then each write will just make the buffer
2380 // larger, and you must manually flush the buffer to actually write out
2381 // the data to the underlying stream.
2382 // <auto_grow>: a #gboolean.
2383 void set_auto_grow()(int auto_grow) {
2384 g_buffered_output_stream_set_auto_grow(&this, auto_grow);
2387 // Sets the size of the internal buffer to @size.
2388 // <size>: a #gsize.
2389 void set_buffer_size()(size_t size) {
2390 g_buffered_output_stream_set_buffer_size(&this, size);
2394 struct BufferedOutputStreamClass {
2395 FilterOutputStreamClass parent_class;
2396 extern (C) void function () _g_reserved1;
2397 extern (C) void function () _g_reserved2;
2400 struct BufferedOutputStreamPrivate {
2404 // VERSION: 2.26
2405 // Invoked when a connection to a message bus has been obtained.
2406 // <connection>: The #GDBusConnection to a message bus.
2407 // <name>: The name that is requested to be owned.
2408 // <user_data>: User data passed to g_bus_own_name().
2409 extern (C) alias void function (DBusConnection* connection, char* name, void* user_data) BusAcquiredCallback;
2412 // VERSION: 2.26
2413 // Invoked when the name is acquired.
2414 // <connection>: The #GDBusConnection on which to acquired the name.
2415 // <name>: The name being owned.
2416 // <user_data>: User data passed to g_bus_own_name() or g_bus_own_name_on_connection().
2417 extern (C) alias void function (DBusConnection* connection, char* name, void* user_data) BusNameAcquiredCallback;
2420 // VERSION: 2.26
2421 // Invoked when the name being watched is known to have to have a owner.
2422 // <connection>: The #GDBusConnection the name is being watched on.
2423 // <name>: The name being watched.
2424 // <name_owner>: Unique name of the owner of the name being watched.
2425 // <user_data>: User data passed to g_bus_watch_name().
2426 extern (C) alias void function (DBusConnection* connection, char* name, char* name_owner, void* user_data) BusNameAppearedCallback;
2429 // VERSION: 2.26
2430 // Invoked when the name is lost or @connection has been closed.
2431 // <connection>: The #GDBusConnection on which to acquire the name or %NULL if the connection was disconnected.
2432 // <name>: The name being owned.
2433 // <user_data>: User data passed to g_bus_own_name() or g_bus_own_name_on_connection().
2434 extern (C) alias void function (DBusConnection* connection, char* name, void* user_data) BusNameLostCallback;
2436 // Flags used in g_bus_own_name().
2437 enum BusNameOwnerFlags /* Version 2.26 */ {
2438 NONE = 0,
2439 ALLOW_REPLACEMENT = 1,
2440 REPLACE = 2
2443 // VERSION: 2.26
2444 // Invoked when the name being watched is known not to have to have a owner.
2445 // <connection>: The #GDBusConnection the name is being watched on.
2446 // <name>: The name being watched.
2447 // <user_data>: User data passed to g_bus_watch_name().
2448 extern (C) alias void function (DBusConnection* connection, char* name, void* user_data) BusNameVanishedCallback;
2450 // Flags used in g_bus_watch_name().
2451 enum BusNameWatcherFlags /* Version 2.26 */ {
2452 NONE = 0,
2453 AUTO_START = 1
2455 // An enumeration for well-known message buses.
2456 enum BusType /* Version 2.26 */ {
2457 STARTER = -1,
2458 NONE = 0,
2459 SYSTEM = 1,
2460 SESSION = 2
2463 // GCancellable is a thread-safe operation cancellation stack used
2464 // throughout GIO to allow for cancellation of synchronous and
2465 // asynchronous operations.
2466 struct Cancellable /* : GObject.Object */ {
2467 alias parent_instance this;
2468 alias parent_instance super_;
2469 alias parent_instance object;
2470 GObject2.Object parent_instance;
2471 private CancellablePrivate* priv;
2474 // Creates a new #GCancellable object.
2476 // Applications that want to start one or more operations
2477 // that should be cancellable should create a #GCancellable
2478 // and pass it to the operations.
2480 // One #GCancellable can be used in multiple consecutive
2481 // operations or in multiple concurrent operations.
2482 // RETURNS: a #GCancellable.
2483 static Cancellable* /*new*/ new_()() {
2484 return g_cancellable_new();
2487 // Gets the top cancellable from the stack.
2489 // if the stack is empty.
2490 // RETURNS: a #GCancellable from the top of the stack, or %NULL
2491 static Cancellable* get_current()() {
2492 return g_cancellable_get_current();
2495 // Will set @cancellable to cancelled, and will emit the
2496 // #GCancellable::cancelled signal. (However, see the warning about
2497 // race conditions in the documentation for that signal if you are
2498 // planning to connect to it.)
2500 // This function is thread-safe. In other words, you can safely call
2501 // it from a thread other than the one running the operation that was
2502 // passed the @cancellable.
2504 // The convention within gio is that cancelling an asynchronous
2505 // operation causes it to complete asynchronously. That is, if you
2506 // cancel the operation from the same thread in which it is running,
2507 // then the operation's #GAsyncReadyCallback will not be invoked until
2508 // the application returns to the main loop.
2509 void cancel()() {
2510 g_cancellable_cancel(&this);
2513 // VERSION: 2.22
2514 // Convenience function to connect to the #GCancellable::cancelled
2515 // signal. Also handles the race condition that may happen
2516 // if the cancellable is cancelled right before connecting.
2518 // @callback is called at most once, either directly at the
2519 // time of the connect if @cancellable is already cancelled,
2520 // or when @cancellable is cancelled in some thread.
2522 // @data_destroy_func will be called when the handler is
2523 // disconnected, or immediately if the cancellable is already
2524 // cancelled.
2526 // See #GCancellable::cancelled for details on how to use this.
2528 // been cancelled.
2529 // RETURNS: The id of the signal handler or 0 if @cancellable has already
2530 // <callback>: The #GCallback to connect.
2531 // <data>: Data to pass to @callback.
2532 // <data_destroy_func>: Free function for @data or %NULL.
2533 c_ulong connect()(GObject2.Callback callback, void* data, GLib2.DestroyNotify data_destroy_func) {
2534 return g_cancellable_connect(&this, callback, data, data_destroy_func);
2537 // VERSION: 2.22
2538 // Disconnects a handler from a cancellable instance similar to
2539 // g_signal_handler_disconnect(). Additionally, in the event that a
2540 // signal handler is currently running, this call will block until the
2541 // handler has finished. Calling this function from a
2542 // #GCancellable::cancelled signal handler will therefore result in a
2543 // deadlock.
2545 // This avoids a race condition where a thread cancels at the
2546 // same time as the cancellable operation is finished and the
2547 // signal handler is removed. See #GCancellable::cancelled for
2548 // details on how to use this.
2550 // If @cancellable is %NULL or @handler_id is %0 this function does
2551 // nothing.
2552 // <handler_id>: Handler id of the handler to be disconnected, or %0.
2553 void disconnect()(c_ulong handler_id) {
2554 g_cancellable_disconnect(&this, handler_id);
2557 // Gets the file descriptor for a cancellable job. This can be used to
2558 // implement cancellable operations on Unix systems. The returned fd will
2559 // turn readable when @cancellable is cancelled.
2561 // You are not supposed to read from the fd yourself, just check for
2562 // readable status. Reading to unset the readable status is done
2563 // with g_cancellable_reset().
2565 // After a successful return from this function, you should use
2566 // g_cancellable_release_fd() to free up resources allocated for
2567 // the returned file descriptor.
2569 // See also g_cancellable_make_pollfd().
2571 // is not supported, or on errors.
2572 // RETURNS: A valid file descriptor. %-1 if the file descriptor
2573 int get_fd()() {
2574 return g_cancellable_get_fd(&this);
2577 // Checks if a cancellable job has been cancelled.
2579 // FALSE if called with %NULL or if item is not cancelled.
2580 // RETURNS: %TRUE if @cancellable is cancelled,
2581 int is_cancelled()() {
2582 return g_cancellable_is_cancelled(&this);
2585 // VERSION: 2.22
2586 // Creates a #GPollFD corresponding to @cancellable; this can be passed
2587 // to g_poll() and used to poll for cancellation. This is useful both
2588 // for unix systems without a native poll and for portability to
2589 // windows.
2591 // When this function returns %TRUE, you should use
2592 // g_cancellable_release_fd() to free up resources allocated for the
2593 // @pollfd. After a %FALSE return, do not call g_cancellable_release_fd().
2595 // If this function returns %FALSE, either no @cancellable was given or
2596 // resource limits prevent this function from allocating the necessary
2597 // structures for polling. (On Linux, you will likely have reached
2598 // the maximum number of file descriptors.) The suggested way to handle
2599 // these cases is to ignore the @cancellable.
2601 // You are not supposed to read from the fd yourself, just check for
2602 // readable status. Reading to unset the readable status is done
2603 // with g_cancellable_reset().
2605 // failure to prepare the cancellable.
2606 // RETURNS: %TRUE if @pollfd was successfully initialized, %FALSE on
2607 // <pollfd>: a pointer to a #GPollFD
2608 int make_pollfd()(GLib2.PollFD* pollfd) {
2609 return g_cancellable_make_pollfd(&this, pollfd);
2612 // Pops @cancellable off the cancellable stack (verifying that @cancellable
2613 // is on the top of the stack).
2614 void pop_current()() {
2615 g_cancellable_pop_current(&this);
2618 // Pushes @cancellable onto the cancellable stack. The current
2619 // cancellable can then be received using g_cancellable_get_current().
2621 // This is useful when implementing cancellable operations in
2622 // code that does not allow you to pass down the cancellable object.
2624 // This is typically called automatically by e.g. #GFile operations,
2625 // so you rarely have to call this yourself.
2626 void push_current()() {
2627 g_cancellable_push_current(&this);
2630 // VERSION: 2.22
2631 // Releases a resources previously allocated by g_cancellable_get_fd()
2632 // or g_cancellable_make_pollfd().
2634 // For compatibility reasons with older releases, calling this function
2635 // is not strictly required, the resources will be automatically freed
2636 // when the @cancellable is finalized. However, the @cancellable will
2637 // block scarce file descriptors until it is finalized if this function
2638 // is not called. This can cause the application to run out of file
2639 // descriptors when many #GCancellables are used at the same time.
2640 void release_fd()() {
2641 g_cancellable_release_fd(&this);
2644 // Resets @cancellable to its uncancelled state.
2646 // If cancellable is currently in use by any cancellable operation
2647 // then the behavior of this function is undefined.
2648 void reset()() {
2649 g_cancellable_reset(&this);
2652 // If the @cancellable is cancelled, sets the error to notify
2653 // that the operation was cancelled.
2654 // RETURNS: %TRUE if @cancellable was cancelled, %FALSE if it was not
2655 int set_error_if_cancelled()(GLib2.Error** error=null) {
2656 return g_cancellable_set_error_if_cancelled(&this, error);
2659 // Unintrospectable method: source_new() / g_cancellable_source_new()
2660 // VERSION: 2.28
2661 // Creates a source that triggers if @cancellable is cancelled and
2662 // calls its callback of type #GCancellableSourceFunc. This is
2663 // primarily useful for attaching to another (non-cancellable) source
2664 // with g_source_add_child_source() to add cancellability to it.
2666 // For convenience, you can call this with a %NULL #GCancellable,
2667 // in which case the source will never trigger.
2668 // RETURNS: the new #GSource.
2669 GLib2.Source* /*new*/ source_new()() {
2670 return g_cancellable_source_new(&this);
2673 // Emitted when the operation has been cancelled.
2675 // Can be used by implementations of cancellable operations. If the
2676 // operation is cancelled from another thread, the signal will be
2677 // emitted in the thread that cancelled the operation, not the
2678 // thread that is running the operation.
2680 // Note that disconnecting from this signal (or any signal) in a
2681 // multi-threaded program is prone to race conditions. For instance
2682 // it is possible that a signal handler may be invoked even
2683 // <emphasis>after</emphasis> a call to
2684 // g_signal_handler_disconnect() for that handler has already
2685 // returned.
2687 // There is also a problem when cancellation happen
2688 // right before connecting to the signal. If this happens the
2689 // signal will unexpectedly not be emitted, and checking before
2690 // connecting to the signal leaves a race condition where this is
2691 // still happening.
2693 // In order to make it safe and easy to connect handlers there
2694 // are two helper functions: g_cancellable_connect() and
2695 // g_cancellable_disconnect() which protect against problems
2696 // like this.
2698 // An example of how to us this:
2699 // |[
2700 // /<!-- -->* Make sure we don't do any unnecessary work if already cancelled *<!-- -->/
2701 // if (g_cancellable_set_error_if_cancelled (cancellable))
2702 // return;
2704 // /<!-- -->* Set up all the data needed to be able to
2705 // * handle cancellation of the operation *<!-- -->/
2706 // my_data = my_data_new (...);
2708 // id = 0;
2709 // if (cancellable)
2710 // id = g_cancellable_connect (cancellable,
2711 // G_CALLBACK (cancelled_handler)
2712 // data, NULL);
2714 // /<!-- -->* cancellable operation here... *<!-- -->/
2716 // g_cancellable_disconnect (cancellable, id);
2718 // /<!-- -->* cancelled_handler is never called after this, it
2719 // * is now safe to free the data *<!-- -->/
2720 // my_data_free (my_data);
2721 // ]|
2723 // Note that the cancelled signal is emitted in the thread that
2724 // the user cancelled from, which may be the main thread. So, the
2725 // cancellable signal should not do something that can block.
2726 extern (C) alias static void function (Cancellable* this_, void* user_data=null) signal_cancelled;
2728 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
2729 return super_.signal_connect!name(cb, data, cf);
2732 ulong signal_connect(string name:"cancelled", CB:signal_cancelled)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
2733 return signal_connect_data!()(&this, cast(char*)"cancelled",
2734 cast(GObject2.Callback)cb, data, null, cf);
2738 struct CancellableClass {
2739 GObject2.ObjectClass parent_class;
2740 extern (C) void function (Cancellable* cancellable) cancelled;
2741 extern (C) void function () _g_reserved1;
2742 extern (C) void function () _g_reserved2;
2743 extern (C) void function () _g_reserved3;
2744 extern (C) void function () _g_reserved4;
2745 extern (C) void function () _g_reserved5;
2748 struct CancellablePrivate {
2752 // VERSION: 2.28
2753 // This is the function type of the callback used for the #GSource
2754 // returned by g_cancellable_source_new().
2755 // RETURNS: it should return %FALSE if the source should be removed.
2756 // <cancellable>: the #GCancellable
2757 // <user_data>: data passed in by the user.
2758 extern (C) alias int function (Cancellable* cancellable, void* user_data) CancellableSourceFunc;
2761 // #GCharsetConverter is an implementation of #GConverter based on
2762 // GIConv.
2763 struct CharsetConverter /* : GObject.Object */ {
2764 mixin Converter.__interface__;
2765 mixin Initable.__interface__;
2766 alias method_parent this;
2767 alias method_parent super_;
2768 alias method_parent object;
2769 GObject2.Object method_parent;
2772 // VERSION: 2.24
2773 // Creates a new #GCharsetConverter.
2774 // RETURNS: a new #GCharsetConverter or %NULL on error.
2775 // <to_charset>: destination charset
2776 // <from_charset>: source charset
2777 static CharsetConverter* /*new*/ new_()(char* to_charset, char* from_charset, GLib2.Error** error=null) {
2778 return g_charset_converter_new(to_charset, from_charset, error);
2781 // VERSION: 2.24
2782 // Gets the number of fallbacks that @converter has applied so far.
2783 // RETURNS: the number of fallbacks that @converter has applied
2784 uint get_num_fallbacks()() {
2785 return g_charset_converter_get_num_fallbacks(&this);
2788 // VERSION: 2.24
2789 // Gets the #GCharsetConverter:use-fallback property.
2790 // RETURNS: %TRUE if fallbacks are used by @converter
2791 int get_use_fallback()() {
2792 return g_charset_converter_get_use_fallback(&this);
2795 // VERSION: 2.24
2796 // Sets the #GCharsetConverter:use-fallback property.
2797 // <use_fallback>: %TRUE to use fallbacks
2798 void set_use_fallback()(int use_fallback) {
2799 g_charset_converter_set_use_fallback(&this, use_fallback);
2803 struct CharsetConverterClass {
2804 GObject2.ObjectClass parent_class;
2808 // #GConverter is implemented by objects that convert
2809 // binary data in various ways. The conversion can be
2810 // stateful and may fail at any place.
2812 // Some example conversions are: character set conversion,
2813 // compression, decompression and regular expression
2814 // replace.
2815 struct Converter /* Interface */ /* Version 2.24 */ {
2816 mixin template __interface__() {
2817 // VERSION: 2.24
2818 // This is the main operation used when converting data. It is to be called
2819 // multiple times in a loop, and each time it will do some work, i.e.
2820 // producing some output (in @outbuf) or consuming some input (from @inbuf) or
2821 // both. If its not possible to do any work an error is returned.
2823 // Note that a single call may not consume all input (or any input at all).
2824 // Also a call may produce output even if given no input, due to state stored
2825 // in the converter producing output.
2827 // If any data was either produced or consumed, and then an error happens, then
2828 // only the successful conversion is reported and the error is returned on the
2829 // next call.
2831 // A full conversion loop involves calling this method repeatedly, each time
2832 // giving it new input and space output space. When there is no more input
2833 // data after the data in @inbuf, the flag %G_CONVERTER_INPUT_AT_END must be set.
2834 // The loop will be (unless some error happens) returning %G_CONVERTER_CONVERTED
2835 // each time until all data is consumed and all output is produced, then
2836 // %G_CONVERTER_FINISHED is returned instead. Note, that %G_CONVERTER_FINISHED
2837 // may be returned even if %G_CONVERTER_INPUT_AT_END is not set, for instance
2838 // in a decompression converter where the end of data is detectable from the
2839 // data (and there might even be other data after the end of the compressed data).
2841 // When some data has successfully been converted @bytes_read and is set to
2842 // the number of bytes read from @inbuf, and @bytes_written is set to indicate
2843 // how many bytes was written to @outbuf. If there are more data to output
2844 // or consume (i.e. unless the %G_CONVERTER_INPUT_AT_END is specified) then
2845 // %G_CONVERTER_CONVERTED is returned, and if no more data is to be output
2846 // then %G_CONVERTER_FINISHED is returned.
2848 // On error %G_CONVERTER_ERROR is returned and @error is set accordingly.
2849 // Some errors need special handling:
2851 // %G_IO_ERROR_NO_SPACE is returned if there is not enough space
2852 // to write the resulting converted data, the application should
2853 // call the function again with a larger @outbuf to continue.
2855 // %G_IO_ERROR_PARTIAL_INPUT is returned if there is not enough
2856 // input to fully determine what the conversion should produce,
2857 // and the %G_CONVERTER_INPUT_AT_END flag is not set. This happens for
2858 // example with an incomplete multibyte sequence when converting text,
2859 // or when a regexp matches up to the end of the input (and may match
2860 // further input). It may also happen when @inbuf_size is zero and
2861 // there is no more data to produce.
2863 // When this happens the application should read more input and then
2864 // call the function again. If further input shows that there is no
2865 // more data call the function again with the same data but with
2866 // the %G_CONVERTER_INPUT_AT_END flag set. This may cause the conversion
2867 // to finish as e.g. in the regexp match case (or, to fail again with
2868 // %G_IO_ERROR_PARTIAL_INPUT in e.g. a charset conversion where the
2869 // input is actually partial).
2871 // After g_converter_convert() has returned %G_CONVERTER_FINISHED the
2872 // converter object is in an invalid state where its not allowed
2873 // to call g_converter_convert() anymore. At this time you can only
2874 // free the object or call g_converter_reset() to reset it to the
2875 // initial state.
2877 // If the flag %G_CONVERTER_FLUSH is set then conversion is modified
2878 // to try to write out all internal state to the output. The application
2879 // has to call the function multiple times with the flag set, and when
2880 // the available input has been consumed and all internal state has
2881 // been produced then %G_CONVERTER_FLUSHED (or %G_CONVERTER_FINISHED if
2882 // really at the end) is returned instead of %G_CONVERTER_CONVERTED.
2883 // This is somewhat similar to what happens at the end of the input stream,
2884 // but done in the middle of the data.
2886 // This has different meanings for different conversions. For instance
2887 // in a compression converter it would mean that we flush all the
2888 // compression state into output such that if you uncompress the
2889 // compressed data you get back all the input data. Doing this may
2890 // make the final file larger due to padding though. Another example
2891 // is a regexp conversion, where if you at the end of the flushed data
2892 // have a match, but there is also a potential longer match. In the
2893 // non-flushed case we would ask for more input, but when flushing we
2894 // treat this as the end of input and do the match.
2896 // Flushing is not always possible (like if a charset converter flushes
2897 // at a partial multibyte sequence). Converters are supposed to try
2898 // to produce as much output as possible and then return an error
2899 // (typically %G_IO_ERROR_PARTIAL_INPUT).
2900 // RETURNS: a #GConverterResult, %G_CONVERTER_ERROR on error.
2901 // <inbuf>: the buffer containing the data to convert.
2902 // <inbuf_size>: the number of bytes in @inbuf
2903 // <outbuf>: a buffer to write converted data in.
2904 // <outbuf_size>: the number of bytes in @outbuf, must be at least one
2905 // <flags>: a #GConvertFlags controlling the conversion details
2906 // <bytes_read>: will be set to the number of bytes read from @inbuf on success
2907 // <bytes_written>: will be set to the number of bytes written to @outbuf on success
2908 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) {
2909 return g_converter_convert(cast(Converter*)&this, inbuf, inbuf_size, outbuf, outbuf_size, flags, bytes_read, bytes_written, error);
2912 // VERSION: 2.24
2913 // Resets all internal state in the converter, making it behave
2914 // as if it was just created. If the converter has any internal
2915 // state that would produce output then that output is lost.
2916 void reset()() {
2917 g_converter_reset(cast(Converter*)&this);
2920 mixin __interface__;
2923 // Flags used when calling a g_converter_convert().
2924 enum ConverterFlags /* Version 2.24 */ {
2925 G_CONVERTER_NO_FLAGS = 0,
2926 INPUT_AT_END = 1,
2927 FLUSH = 2
2930 // Provides an interface for converting data from one type
2931 // to another type. The conversion can be stateful
2932 // and may fail at any place.
2933 struct ConverterIface /* Version 2.24 */ {
2934 GObject2.TypeInterface g_iface;
2936 // RETURNS: a #GConverterResult, %G_CONVERTER_ERROR on error.
2937 // <inbuf>: the buffer containing the data to convert.
2938 // <inbuf_size>: the number of bytes in @inbuf
2939 // <outbuf>: a buffer to write converted data in.
2940 // <outbuf_size>: the number of bytes in @outbuf, must be at least one
2941 // <flags>: a #GConvertFlags controlling the conversion details
2942 // <bytes_read>: will be set to the number of bytes read from @inbuf on success
2943 // <bytes_written>: will be set to the number of bytes written to @outbuf on success
2944 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;
2945 extern (C) void function (Converter* converter) reset;
2949 // Converter input stream implements #GInputStream and allows
2950 // conversion of data of various types during reading.
2951 struct ConverterInputStream /* : FilterInputStream */ {
2952 alias parent_instance this;
2953 alias parent_instance super_;
2954 alias parent_instance filterinputstream;
2955 FilterInputStream parent_instance;
2956 private ConverterInputStreamPrivate* priv;
2959 // Creates a new converter input stream for the @base_stream.
2960 // RETURNS: a new #GInputStream.
2961 // <base_stream>: a #GInputStream
2962 // <converter>: a #GConverter
2963 static ConverterInputStream* /*new*/ new_()(InputStream* base_stream, Converter* converter) {
2964 return g_converter_input_stream_new(base_stream, converter);
2967 // VERSION: 2.24
2968 // Gets the #GConverter that is used by @converter_stream.
2969 // RETURNS: the converter of the converter input stream
2970 Converter* get_converter()() {
2971 return g_converter_input_stream_get_converter(&this);
2975 struct ConverterInputStreamClass {
2976 FilterInputStreamClass parent_class;
2977 extern (C) void function () _g_reserved1;
2978 extern (C) void function () _g_reserved2;
2979 extern (C) void function () _g_reserved3;
2980 extern (C) void function () _g_reserved4;
2981 extern (C) void function () _g_reserved5;
2984 struct ConverterInputStreamPrivate {
2988 // Converter output stream implements #GOutputStream and allows
2989 // conversion of data of various types during reading.
2990 struct ConverterOutputStream /* : FilterOutputStream */ {
2991 alias parent_instance this;
2992 alias parent_instance super_;
2993 alias parent_instance filteroutputstream;
2994 FilterOutputStream parent_instance;
2995 private ConverterOutputStreamPrivate* priv;
2998 // Creates a new converter output stream for the @base_stream.
2999 // RETURNS: a new #GOutputStream.
3000 // <base_stream>: a #GOutputStream
3001 // <converter>: a #GConverter
3002 static ConverterOutputStream* /*new*/ new_()(OutputStream* base_stream, Converter* converter) {
3003 return g_converter_output_stream_new(base_stream, converter);
3006 // VERSION: 2.24
3007 // Gets the #GConverter that is used by @converter_stream.
3008 // RETURNS: the converter of the converter output stream
3009 Converter* get_converter()() {
3010 return g_converter_output_stream_get_converter(&this);
3014 struct ConverterOutputStreamClass {
3015 FilterOutputStreamClass parent_class;
3016 extern (C) void function () _g_reserved1;
3017 extern (C) void function () _g_reserved2;
3018 extern (C) void function () _g_reserved3;
3019 extern (C) void function () _g_reserved4;
3020 extern (C) void function () _g_reserved5;
3023 struct ConverterOutputStreamPrivate {
3026 // Results returned from g_converter_convert().
3027 enum ConverterResult /* Version 2.24 */ {
3028 ERROR = 0,
3029 CONVERTED = 1,
3030 FINISHED = 2,
3031 FLUSHED = 3
3034 // The #GCredentials type is a reference-counted wrapper for native
3035 // credentials. This information is typically used for identifying,
3036 // authenticating and authorizing other processes.
3038 // Some operating systems supports looking up the credentials of the
3039 // remote peer of a communication endpoint - see e.g.
3040 // g_socket_get_credentials().
3042 // Some operating systems supports securely sending and receiving
3043 // credentials over a Unix Domain Socket, see
3044 // #GUnixCredentialsMessage, g_unix_connection_send_credentials() and
3045 // g_unix_connection_receive_credentials() for details.
3047 // On Linux, the native credential type is a <type>struct ucred</type>
3048 // - see the
3049 // <citerefentry><refentrytitle>unix</refentrytitle><manvolnum>7</manvolnum></citerefentry>
3050 // man page for details. This corresponds to
3051 // %G_CREDENTIALS_TYPE_LINUX_UCRED.
3053 // On FreeBSD, the native credential type is a <type>struct cmsgcred</type>.
3054 // This corresponds to %G_CREDENTIALS_TYPE_FREEBSD_CMSGCRED.
3056 // On OpenBSD, the native credential type is a <type>struct sockpeercred</type>.
3057 // This corresponds to %G_CREDENTIALS_TYPE_OPENBSD_SOCKPEERCRED.
3058 struct Credentials /* : GObject.Object */ /* Version 2.26 */ {
3059 alias method_parent this;
3060 alias method_parent super_;
3061 alias method_parent object;
3062 GObject2.Object method_parent;
3065 // VERSION: 2.26
3066 // Creates a new #GCredentials object with credentials matching the
3067 // the current process.
3068 // RETURNS: A #GCredentials. Free with g_object_unref().
3069 static Credentials* /*new*/ new_()() {
3070 return g_credentials_new();
3073 // Unintrospectable method: get_native() / g_credentials_get_native()
3074 // VERSION: 2.26
3075 // Gets a pointer to native credentials of type @native_type from
3076 // @credentials.
3078 // It is a programming error (which will cause an warning to be
3079 // logged) to use this method if there is no #GCredentials support for
3080 // the OS or if @native_type isn't supported by the OS.
3082 // operation there is no #GCredentials support for the OS or if
3083 // @native_type isn't supported by the OS. Do not free the returned
3084 // data, it is owned by @credentials.
3085 // RETURNS: The pointer to native credentials or %NULL if the
3086 // <native_type>: The type of native credentials to get.
3087 void* get_native()(CredentialsType native_type) {
3088 return g_credentials_get_native(&this, native_type);
3091 // VERSION: 2.26
3092 // Tries to get the UNIX user identifier from @credentials. This
3093 // method is only available on UNIX platforms.
3095 // This operation can fail if #GCredentials is not supported on the
3096 // OS or if the native credentials type does not contain information
3097 // about the UNIX user.
3098 // RETURNS: The UNIX user identifier or -1 if @error is set.
3099 uint get_unix_user()(GLib2.Error** error=null) {
3100 return g_credentials_get_unix_user(&this, error);
3103 // VERSION: 2.26
3104 // Checks if @credentials and @other_credentials is the same user.
3106 // This operation can fail if #GCredentials is not supported on the
3107 // the OS.
3109 // user, %FALSE otherwise or if @error is set.
3110 // RETURNS: %TRUE if @credentials and @other_credentials has the same
3111 // <other_credentials>: A #GCredentials.
3112 int is_same_user()(Credentials* other_credentials, GLib2.Error** error=null) {
3113 return g_credentials_is_same_user(&this, other_credentials, error);
3116 // VERSION: 2.26
3117 // Copies the native credentials of type @native_type from @native
3118 // into @credentials.
3120 // It is a programming error (which will cause an warning to be
3121 // logged) to use this method if there is no #GCredentials support for
3122 // the OS or if @native_type isn't supported by the OS.
3123 // <native_type>: The type of native credentials to set.
3124 // <native>: A pointer to native credentials.
3125 void set_native()(CredentialsType native_type, void* native) {
3126 g_credentials_set_native(&this, native_type, native);
3129 // VERSION: 2.26
3130 // Tries to set the UNIX user identifier on @credentials. This method
3131 // is only available on UNIX platforms.
3133 // This operation can fail if #GCredentials is not supported on the
3134 // OS or if the native credentials type does not contain information
3135 // about the UNIX user.
3136 // RETURNS: %TRUE if @uid was set, %FALSE if error is set.
3137 // <uid>: The UNIX user identifier to set.
3138 int set_unix_user()(uint uid, GLib2.Error** error=null) {
3139 return g_credentials_set_unix_user(&this, uid, error);
3142 // VERSION: 2.26
3143 // Creates a human-readable textual representation of @credentials
3144 // that can be used in logging and debug messages. The format of the
3145 // returned string may change in future GLib release.
3146 // RETURNS: A string that should be freed with g_free().
3147 char* /*new*/ to_string()() {
3148 return g_credentials_to_string(&this);
3152 // Class structure for #GCredentials.
3153 struct CredentialsClass /* Version 2.26 */ {
3156 // Enumeration describing different kinds of native credential types.
3157 enum CredentialsType /* Version 2.26 */ {
3158 INVALID = 0,
3159 LINUX_UCRED = 1,
3160 FREEBSD_CMSGCRED = 2,
3161 OPENBSD_SOCKPEERCRED = 3
3163 // Information about an annotation.
3164 struct DBusAnnotationInfo /* Version 2.26 */ {
3165 int ref_count;
3166 char* key, value;
3167 DBusAnnotationInfo*[666] annotations;
3170 // VERSION: 2.26
3171 // If @info is statically allocated does nothing. Otherwise increases
3172 // the reference count.
3173 // RETURNS: The same @info.
3174 DBusAnnotationInfo* /*new*/ ref_()() {
3175 return g_dbus_annotation_info_ref(&this);
3178 // VERSION: 2.26
3179 // If @info is statically allocated, does nothing. Otherwise decreases
3180 // the reference count of @info. When its reference count drops to 0,
3181 // the memory used is freed.
3182 void unref()() {
3183 g_dbus_annotation_info_unref(&this);
3186 // VERSION: 2.26
3187 // Looks up the value of an annotation.
3189 // This cost of this function is O(n) in number of annotations.
3190 // RETURNS: The value or %NULL if not found. Do not free, it is owned by @annotations.
3191 // <annotations>: A %NULL-terminated array of annotations or %NULL.
3192 // <name>: The name of the annotation to look up.
3193 static char* lookup()(DBusAnnotationInfo** annotations, char* name) {
3194 return g_dbus_annotation_info_lookup(annotations, name);
3198 // Information about an argument for a method or a signal.
3199 struct DBusArgInfo /* Version 2.26 */ {
3200 int ref_count;
3201 char* name, signature;
3202 DBusAnnotationInfo*[666] annotations;
3205 // VERSION: 2.26
3206 // If @info is statically allocated does nothing. Otherwise increases
3207 // the reference count.
3208 // RETURNS: The same @info.
3209 DBusArgInfo* /*new*/ ref_()() {
3210 return g_dbus_arg_info_ref(&this);
3213 // VERSION: 2.26
3214 // If @info is statically allocated, does nothing. Otherwise decreases
3215 // the reference count of @info. When its reference count drops to 0,
3216 // the memory used is freed.
3217 void unref()() {
3218 g_dbus_arg_info_unref(&this);
3223 // The #GDBusAuthObserver type provides a mechanism for participating
3224 // in how a #GDBusServer (or a #GDBusConnection) authenticates remote
3225 // peers. Simply instantiate a #GDBusAuthObserver and connect to the
3226 // signals you are interested in. Note that new signals may be added
3227 // in the future
3229 // For example, if you only want to allow D-Bus connections from
3230 // processes owned by the same uid as the server, you would use a
3231 // signal handler like the following:
3232 // <example id="auth-observer"><title>Controlling Authentication</title><programlisting>
3233 // static gboolean
3234 // on_authorize_authenticated_peer (GDBusAuthObserver *observer,
3235 // GIOStream *stream,
3236 // GCredentials *credentials,
3237 // gpointer user_data)
3238 // {
3239 // gboolean authorized;
3241 // authorized = FALSE;
3242 // if (credentials != NULL)
3243 // {
3244 // GCredentials *own_credentials;
3245 // own_credentials = g_credentials_new ();
3246 // if (g_credentials_is_same_user (credentials, own_credentials, NULL))
3247 // authorized = TRUE;
3248 // g_object_unref (own_credentials);
3249 // }
3251 // return authorized;
3252 // }
3253 // </programlisting></example>
3254 struct DBusAuthObserver /* : GObject.Object */ /* Version 2.26 */ {
3255 alias method_parent this;
3256 alias method_parent super_;
3257 alias method_parent object;
3258 GObject2.Object method_parent;
3261 // VERSION: 2.26
3262 // Creates a new #GDBusAuthObserver object.
3263 // RETURNS: A #GDBusAuthObserver. Free with g_object_unref().
3264 static DBusAuthObserver* /*new*/ new_()() {
3265 return g_dbus_auth_observer_new();
3268 // VERSION: 2.26
3269 // Emits the #GDBusAuthObserver::authorize-authenticated-peer signal on @observer.
3270 // RETURNS: %TRUE if the peer is authorized, %FALSE if not.
3271 // <stream>: A #GIOStream for the #GDBusConnection.
3272 // <credentials>: Credentials received from the peer or %NULL.
3273 int authorize_authenticated_peer()(IOStream* stream, Credentials* credentials) {
3274 return g_dbus_auth_observer_authorize_authenticated_peer(&this, stream, credentials);
3277 // VERSION: 2.26
3278 // Emitted to check if a peer that is successfully authenticated
3279 // is authorized.
3280 // RETURNS: %TRUE if the peer is authorized, %FALSE if not.
3281 // <stream>: A #GIOStream for the #GDBusConnection.
3282 // <credentials>: Credentials received from the peer or %NULL.
3283 extern (C) alias static c_int function (DBusAuthObserver* this_, IOStream* stream, Credentials* credentials, void* user_data=null) signal_authorize_authenticated_peer;
3285 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
3286 return super_.signal_connect!name(cb, data, cf);
3289 ulong signal_connect(string name:"authorize-authenticated-peer", CB:signal_authorize_authenticated_peer)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
3290 return signal_connect_data!()(&this, cast(char*)"authorize-authenticated-peer",
3291 cast(GObject2.Callback)cb, data, null, cf);
3295 // Flags used in g_dbus_connection_call() and similar APIs.
3296 enum DBusCallFlags /* Version 2.26 */ {
3297 NONE = 0,
3298 NO_AUTO_START = 1
3300 // Capabilities negotiated with the remote peer.
3301 enum DBusCapabilityFlags /* Version 2.26 */ {
3302 NONE = 0,
3303 UNIX_FD_PASSING = 1
3306 // The #GDBusConnection type is used for D-Bus connections to remote
3307 // peers such as a message buses. It is a low-level API that offers a
3308 // lot of flexibility. For instance, it lets you establish a connection
3309 // over any transport that can by represented as an #GIOStream.
3311 // This class is rarely used directly in D-Bus clients. If you are writing
3312 // an D-Bus client, it is often easier to use the g_bus_own_name(),
3313 // g_bus_watch_name() or g_dbus_proxy_new_for_bus() APIs.
3315 // <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>
3317 // <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>
3319 // <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>
3321 // <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>
3322 struct DBusConnection /* : GObject.Object */ /* Version 2.26 */ {
3323 mixin AsyncInitable.__interface__;
3324 mixin Initable.__interface__;
3325 alias method_parent this;
3326 alias method_parent super_;
3327 alias method_parent object;
3328 GObject2.Object method_parent;
3331 // VERSION: 2.26
3332 // Finishes an operation started with g_dbus_connection_new().
3333 // RETURNS: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
3334 // <res>: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_new().
3335 static DBusConnection* /*new*/ new_finish()(AsyncResult* res, GLib2.Error** error=null) {
3336 return g_dbus_connection_new_finish(res, error);
3339 // VERSION: 2.26
3340 // Finishes an operation started with g_dbus_connection_new_for_address().
3341 // RETURNS: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
3342 // <res>: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_new().
3343 static DBusConnection* /*new*/ new_for_address_finish()(AsyncResult* res, GLib2.Error** error=null) {
3344 return g_dbus_connection_new_for_address_finish(res, error);
3347 // VERSION: 2.26
3348 // Synchronously connects and sets up a D-Bus client connection for
3349 // exchanging D-Bus messages with an endpoint specified by @address
3350 // which must be in the D-Bus address format.
3352 // This constructor can only be used to initiate client-side
3353 // connections - use g_dbus_connection_new_sync() if you need to act
3354 // as the server. In particular, @flags cannot contain the
3355 // %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER or
3356 // %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS flags.
3358 // This is a synchronous failable constructor. See
3359 // g_dbus_connection_new_for_address() for the asynchronous version.
3361 // If @observer is not %NULL it may be used to control the
3362 // authentication process.
3363 // RETURNS: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
3364 // <address>: A D-Bus address.
3365 // <flags>: Flags describing how to make the connection.
3366 // <observer>: A #GDBusAuthObserver or %NULL.
3367 // <cancellable>: A #GCancellable or %NULL.
3368 static DBusConnection* /*new*/ new_for_address_sync()(char* address, DBusConnectionFlags flags, DBusAuthObserver* observer, Cancellable* cancellable, GLib2.Error** error=null) {
3369 return g_dbus_connection_new_for_address_sync(address, flags, observer, cancellable, error);
3372 // VERSION: 2.26
3373 // Synchronously sets up a D-Bus connection for exchanging D-Bus messages
3374 // with the end represented by @stream.
3376 // If @stream is a #GSocketConnection, then the corresponding #GSocket
3377 // will be put into non-blocking mode.
3379 // If @observer is not %NULL it may be used to control the
3380 // authentication process.
3382 // This is a synchronous failable constructor. See
3383 // g_dbus_connection_new() for the asynchronous version.
3384 // RETURNS: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
3385 // <stream>: A #GIOStream.
3386 // <guid>: The GUID to use if a authenticating as a server or %NULL.
3387 // <flags>: Flags describing how to make the connection.
3388 // <observer>: A #GDBusAuthObserver or %NULL.
3389 // <cancellable>: A #GCancellable or %NULL.
3390 static DBusConnection* /*new*/ new_sync()(IOStream* stream, char* guid, DBusConnectionFlags flags, DBusAuthObserver* observer, Cancellable* cancellable, GLib2.Error** error=null) {
3391 return g_dbus_connection_new_sync(stream, guid, flags, observer, cancellable, error);
3394 // VERSION: 2.26
3395 // Asynchronously sets up a D-Bus connection for exchanging D-Bus messages
3396 // with the end represented by @stream.
3398 // If @stream is a #GSocketConnection, then the corresponding #GSocket
3399 // will be put into non-blocking mode.
3401 // If @observer is not %NULL it may be used to control the
3402 // authentication process.
3404 // When the operation is finished, @callback will be invoked. You can
3405 // then call g_dbus_connection_new_finish() to get the result of the
3406 // operation.
3408 // This is a asynchronous failable constructor. See
3409 // g_dbus_connection_new_sync() for the synchronous
3410 // version.
3411 // <stream>: A #GIOStream.
3412 // <guid>: The GUID to use if a authenticating as a server or %NULL.
3413 // <flags>: Flags describing how to make the connection.
3414 // <observer>: A #GDBusAuthObserver or %NULL.
3415 // <cancellable>: A #GCancellable or %NULL.
3416 // <callback>: A #GAsyncReadyCallback to call when the request is satisfied.
3417 // <user_data>: The data to pass to @callback.
3418 static void new_()(IOStream* stream, char* guid, DBusConnectionFlags flags, DBusAuthObserver* observer, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
3419 g_dbus_connection_new(stream, guid, flags, observer, cancellable, callback, user_data);
3422 // VERSION: 2.26
3423 // Asynchronously connects and sets up a D-Bus client connection for
3424 // exchanging D-Bus messages with an endpoint specified by @address
3425 // which must be in the D-Bus address format.
3427 // This constructor can only be used to initiate client-side
3428 // connections - use g_dbus_connection_new() if you need to act as the
3429 // server. In particular, @flags cannot contain the
3430 // %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER or
3431 // %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS flags.
3433 // When the operation is finished, @callback will be invoked. You can
3434 // then call g_dbus_connection_new_finish() to get the result of the
3435 // operation.
3437 // If @observer is not %NULL it may be used to control the
3438 // authentication process.
3440 // This is a asynchronous failable constructor. See
3441 // g_dbus_connection_new_for_address_sync() for the synchronous
3442 // version.
3443 // <address>: A D-Bus address.
3444 // <flags>: Flags describing how to make the connection.
3445 // <observer>: A #GDBusAuthObserver or %NULL.
3446 // <cancellable>: A #GCancellable or %NULL.
3447 // <callback>: A #GAsyncReadyCallback to call when the request is satisfied.
3448 // <user_data>: The data to pass to @callback.
3449 static void new_for_address()(char* address, DBusConnectionFlags flags, DBusAuthObserver* observer, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
3450 g_dbus_connection_new_for_address(address, flags, observer, cancellable, callback, user_data);
3453 // VERSION: 2.26
3454 // Adds a message filter. Filters are handlers that are run on all
3455 // incoming and outgoing messages, prior to standard dispatch. Filters
3456 // are run in the order that they were added. The same handler can be
3457 // added as a filter more than once, in which case it will be run more
3458 // than once. Filters added during a filter callback won't be run on
3459 // the message being processed. Filter functions are allowed to modify
3460 // and even drop messages.
3462 // Note that filters are run in a dedicated message handling thread so
3463 // they can't block and, generally, can't do anything but signal a
3464 // worker thread. Also note that filters are rarely needed - use API
3465 // such as g_dbus_connection_send_message_with_reply(),
3466 // g_dbus_connection_signal_subscribe() or g_dbus_connection_call() instead.
3468 // If a filter consumes an incoming message the message is not
3469 // dispatched anywhere else - not even the standard dispatch machinery
3470 // (that API such as g_dbus_connection_signal_subscribe() and
3471 // g_dbus_connection_send_message_with_reply() relies on) will see the
3472 // message. Similary, if a filter consumes an outgoing message, the
3473 // message will not be sent to the other peer.
3475 // g_dbus_connection_remove_filter().
3476 // RETURNS: A filter identifier that can be used with
3477 // <filter_function>: A filter function.
3478 // <user_data>: User data to pass to @filter_function.
3479 // <user_data_free_func>: Function to free @user_data with when filter is removed or %NULL.
3480 uint add_filter()(DBusMessageFilterFunction filter_function, void* user_data, GLib2.DestroyNotify user_data_free_func) {
3481 return g_dbus_connection_add_filter(&this, filter_function, user_data, user_data_free_func);
3484 // VERSION: 2.26
3485 // Asynchronously invokes the @method_name method on the
3486 // @interface_name D-Bus interface on the remote object at
3487 // @object_path owned by @bus_name.
3489 // If @connection is closed then the operation will fail with
3490 // %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will
3491 // fail with %G_IO_ERROR_CANCELLED. If @parameters contains a value
3492 // not compatible with the D-Bus protocol, the operation fails with
3493 // %G_IO_ERROR_INVALID_ARGUMENT.
3495 // If @reply_type is non-%NULL then the reply will be checked for having this type and an
3496 // error will be raised if it does not match. Said another way, if you give a @reply_type
3497 // then any non-%NULL return value will be of this type.
3499 // If the @parameters #GVariant is floating, it is consumed. This allows
3500 // convenient 'inline' use of g_variant_new(), e.g.:
3501 // |[
3502 // g_dbus_connection_call (connection,
3503 // "org.freedesktop.StringThings",
3504 // "/org/freedesktop/StringThings",
3505 // "org.freedesktop.StringThings",
3506 // "TwoStrings",
3507 // g_variant_new ("(ss)",
3508 // "Thing One",
3509 // "Thing Two"),
3510 // NULL,
3511 // G_DBUS_CALL_FLAGS_NONE,
3512 // -1,
3513 // NULL,
3514 // (GAsyncReadyCallback) two_strings_done,
3515 // NULL);
3516 // ]|
3518 // This is an asynchronous method. When the operation is finished, @callback will be invoked
3519 // in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
3520 // of the thread you are calling this method from. You can then call
3521 // g_dbus_connection_call_finish() to get the result of the operation.
3522 // See g_dbus_connection_call_sync() for the synchronous version of this
3523 // function.
3524 // <bus_name>: A unique or well-known bus name or %NULL if @connection is not a message bus connection.
3525 // <object_path>: Path of remote object.
3526 // <interface_name>: D-Bus interface to invoke method on.
3527 // <method_name>: The name of the method to invoke.
3528 // <parameters>: A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
3529 // <reply_type>: The expected type of the reply, or %NULL.
3530 // <flags>: Flags from the #GDBusCallFlags enumeration.
3531 // <timeout_msec>: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
3532 // <cancellable>: A #GCancellable or %NULL.
3533 // <callback>: A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't * care about the result of the method invocation.
3534 // <user_data>: The data to pass to @callback.
3535 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) {
3536 g_dbus_connection_call(&this, bus_name, object_path, interface_name, method_name, parameters, reply_type, flags, timeout_msec, cancellable, callback, user_data);
3539 // VERSION: 2.26
3540 // Finishes an operation started with g_dbus_connection_call().
3542 // return values. Free with g_variant_unref().
3543 // RETURNS: %NULL if @error is set. Otherwise a #GVariant tuple with
3544 // <res>: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_call().
3545 GLib2.Variant* /*new*/ call_finish()(AsyncResult* res, GLib2.Error** error=null) {
3546 return g_dbus_connection_call_finish(&this, res, error);
3549 // VERSION: 2.26
3550 // Synchronously invokes the @method_name method on the
3551 // @interface_name D-Bus interface on the remote object at
3552 // @object_path owned by @bus_name.
3554 // If @connection is closed then the operation will fail with
3555 // %G_IO_ERROR_CLOSED. If @cancellable is canceled, the
3556 // operation will fail with %G_IO_ERROR_CANCELLED. If @parameters
3557 // contains a value not compatible with the D-Bus protocol, the operation
3558 // fails with %G_IO_ERROR_INVALID_ARGUMENT.
3559 // If @reply_type is non-%NULL then the reply will be checked for having
3560 // this type and an error will be raised if it does not match. Said
3561 // another way, if you give a @reply_type then any non-%NULL return
3562 // value will be of this type.
3564 // If the @parameters #GVariant is floating, it is consumed.
3565 // This allows convenient 'inline' use of g_variant_new(), e.g.:
3566 // |[
3567 // g_dbus_connection_call_sync (connection,
3568 // "org.freedesktop.StringThings",
3569 // "/org/freedesktop/StringThings",
3570 // "org.freedesktop.StringThings",
3571 // "TwoStrings",
3572 // g_variant_new ("(ss)",
3573 // "Thing One",
3574 // "Thing Two"),
3575 // NULL,
3576 // G_DBUS_CALL_FLAGS_NONE,
3577 // -1,
3578 // NULL,
3579 // &amp;error);
3580 // ]|
3582 // The calling thread is blocked until a reply is received. See
3583 // g_dbus_connection_call() for the asynchronous version of
3584 // this method.
3586 // return values. Free with g_variant_unref().
3587 // RETURNS: %NULL if @error is set. Otherwise a #GVariant tuple with
3588 // <bus_name>: A unique or well-known bus name.
3589 // <object_path>: Path of remote object.
3590 // <interface_name>: D-Bus interface to invoke method on.
3591 // <method_name>: The name of the method to invoke.
3592 // <parameters>: A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
3593 // <reply_type>: The expected type of the reply, or %NULL.
3594 // <flags>: Flags from the #GDBusCallFlags enumeration.
3595 // <timeout_msec>: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
3596 // <cancellable>: A #GCancellable or %NULL.
3597 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) {
3598 return g_dbus_connection_call_sync(&this, bus_name, object_path, interface_name, method_name, parameters, reply_type, flags, timeout_msec, cancellable, error);
3601 // VERSION: 2.30
3602 // Like g_dbus_connection_call() but also takes a #GUnixFDList object.
3604 // This method is only available on UNIX.
3605 // <bus_name>: A unique or well-known bus name or %NULL if @connection is not a message bus connection.
3606 // <object_path>: Path of remote object.
3607 // <interface_name>: D-Bus interface to invoke method on.
3608 // <method_name>: The name of the method to invoke.
3609 // <parameters>: A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
3610 // <reply_type>: The expected type of the reply, or %NULL.
3611 // <flags>: Flags from the #GDBusCallFlags enumeration.
3612 // <timeout_msec>: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
3613 // <fd_list>: A #GUnixFDList or %NULL.
3614 // <cancellable>: A #GCancellable or %NULL.
3615 // <callback>: A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't * care about the result of the method invocation.
3616 // <user_data>: The data to pass to @callback.
3617 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) {
3618 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);
3621 // VERSION: 2.30
3622 // Finishes an operation started with g_dbus_connection_call_with_unix_fd_list().
3624 // return values. Free with g_variant_unref().
3625 // RETURNS: %NULL if @error is set. Otherwise a #GVariant tuple with
3626 // <out_fd_list>: Return location for a #GUnixFDList or %NULL.
3627 // <res>: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_call_with_unix_fd_list().
3628 GLib2.Variant* /*new*/ call_with_unix_fd_list_finish()(/*out*/ UnixFDList** out_fd_list, AsyncResult* res, GLib2.Error** error=null) {
3629 return g_dbus_connection_call_with_unix_fd_list_finish(&this, out_fd_list, res, error);
3632 // VERSION: 2.30
3633 // Like g_dbus_connection_call_sync() but also takes and returns #GUnixFDList objects.
3635 // This method is only available on UNIX.
3637 // return values. Free with g_variant_unref().
3638 // RETURNS: %NULL if @error is set. Otherwise a #GVariant tuple with
3639 // <bus_name>: A unique or well-known bus name.
3640 // <object_path>: Path of remote object.
3641 // <interface_name>: D-Bus interface to invoke method on.
3642 // <method_name>: The name of the method to invoke.
3643 // <parameters>: A #GVariant tuple with parameters for the method or %NULL if not passing parameters.
3644 // <reply_type>: The expected type of the reply, or %NULL.
3645 // <flags>: Flags from the #GDBusCallFlags enumeration.
3646 // <timeout_msec>: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
3647 // <fd_list>: A #GUnixFDList or %NULL.
3648 // <out_fd_list>: Return location for a #GUnixFDList or %NULL.
3649 // <cancellable>: A #GCancellable or %NULL.
3650 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) {
3651 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);
3654 // VERSION: 2.26
3655 // Closes @connection. Note that this never causes the process to
3656 // exit (this might only happen if the other end of a shared message
3657 // bus connection disconnects, see #GDBusConnection:exit-on-close).
3659 // Once the connection is closed, operations such as sending a message
3660 // will return with the error %G_IO_ERROR_CLOSED. Closing a connection
3661 // will not automatically flush the connection so queued messages may
3662 // be lost. Use g_dbus_connection_flush() if you need such guarantees.
3664 // If @connection is already closed, this method fails with
3665 // %G_IO_ERROR_CLOSED.
3667 // When @connection has been closed, the #GDBusConnection::closed
3668 // signal is emitted in the <link
3669 // linkend="g-main-context-push-thread-default">thread-default main
3670 // loop</link> of the thread that @connection was constructed in.
3672 // This is an asynchronous method. When the operation is finished,
3673 // @callback will be invoked in the <link
3674 // linkend="g-main-context-push-thread-default">thread-default main
3675 // loop</link> of the thread you are calling this method from. You can
3676 // then call g_dbus_connection_close_finish() to get the result of the
3677 // operation. See g_dbus_connection_close_sync() for the synchronous
3678 // version.
3679 // <cancellable>: A #GCancellable or %NULL.
3680 // <callback>: A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result.
3681 // <user_data>: The data to pass to @callback.
3682 void close()(Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
3683 g_dbus_connection_close(&this, cancellable, callback, user_data);
3686 // VERSION: 2.26
3687 // Finishes an operation started with g_dbus_connection_close().
3688 // RETURNS: %TRUE if the operation succeeded, %FALSE if @error is set.
3689 // <res>: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_close().
3690 int close_finish()(AsyncResult* res, GLib2.Error** error=null) {
3691 return g_dbus_connection_close_finish(&this, res, error);
3694 // VERSION: 2.26
3695 // Synchronously closees @connection. The calling thread is blocked
3696 // until this is done. See g_dbus_connection_close() for the
3697 // asynchronous version of this method and more details about what it
3698 // does.
3699 // RETURNS: %TRUE if the operation succeeded, %FALSE if @error is set.
3700 // <cancellable>: A #GCancellable or %NULL.
3701 int close_sync()(Cancellable* cancellable, GLib2.Error** error=null) {
3702 return g_dbus_connection_close_sync(&this, cancellable, error);
3705 // VERSION: 2.26
3706 // Emits a signal.
3708 // If the parameters GVariant is floating, it is consumed.
3710 // This can only fail if @parameters is not compatible with the D-Bus protocol.
3711 // RETURNS: %TRUE unless @error is set.
3712 // <destination_bus_name>: The unique bus name for the destination for the signal or %NULL to emit to all listeners.
3713 // <object_path>: Path of remote object.
3714 // <interface_name>: D-Bus interface to emit a signal on.
3715 // <signal_name>: The name of the signal to emit.
3716 // <parameters>: A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
3717 int emit_signal()(char* destination_bus_name, char* object_path, char* interface_name, char* signal_name, GLib2.Variant* parameters, GLib2.Error** error=null) {
3718 return g_dbus_connection_emit_signal(&this, destination_bus_name, object_path, interface_name, signal_name, parameters, error);
3721 // VERSION: 2.26
3722 // Asynchronously flushes @connection, that is, writes all queued
3723 // outgoing message to the transport and then flushes the transport
3724 // (using g_output_stream_flush_async()). This is useful in programs
3725 // that wants to emit a D-Bus signal and then exit
3726 // immediately. Without flushing the connection, there is no guarantee
3727 // that the message has been sent to the networking buffers in the OS
3728 // kernel.
3730 // This is an asynchronous method. When the operation is finished,
3731 // @callback will be invoked in the <link
3732 // linkend="g-main-context-push-thread-default">thread-default main
3733 // loop</link> of the thread you are calling this method from. You can
3734 // then call g_dbus_connection_flush_finish() to get the result of the
3735 // operation. See g_dbus_connection_flush_sync() for the synchronous
3736 // version.
3737 // <cancellable>: A #GCancellable or %NULL.
3738 // <callback>: A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result.
3739 // <user_data>: The data to pass to @callback.
3740 void flush()(Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
3741 g_dbus_connection_flush(&this, cancellable, callback, user_data);
3744 // VERSION: 2.26
3745 // Finishes an operation started with g_dbus_connection_flush().
3746 // RETURNS: %TRUE if the operation succeeded, %FALSE if @error is set.
3747 // <res>: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_flush().
3748 int flush_finish()(AsyncResult* res, GLib2.Error** error=null) {
3749 return g_dbus_connection_flush_finish(&this, res, error);
3752 // VERSION: 2.26
3753 // Synchronously flushes @connection. The calling thread is blocked
3754 // until this is done. See g_dbus_connection_flush() for the
3755 // asynchronous version of this method and more details about what it
3756 // does.
3757 // RETURNS: %TRUE if the operation succeeded, %FALSE if @error is set.
3758 // <cancellable>: A #GCancellable or %NULL.
3759 int flush_sync()(Cancellable* cancellable, GLib2.Error** error=null) {
3760 return g_dbus_connection_flush_sync(&this, cancellable, error);
3763 // VERSION: 2.26
3764 // Gets the capabilities negotiated with the remote peer
3765 // RETURNS: Zero or more flags from the #GDBusCapabilityFlags enumeration.
3766 DBusCapabilityFlags get_capabilities()() {
3767 return g_dbus_connection_get_capabilities(&this);
3770 // VERSION: 2.26
3771 // Gets whether the process is terminated when @connection is
3772 // closed by the remote peer. See
3773 // #GDBusConnection:exit-on-close for more details.
3775 // closed by the remote peer.
3776 // RETURNS: Whether the process is terminated when @connection is
3777 int get_exit_on_close()() {
3778 return g_dbus_connection_get_exit_on_close(&this);
3781 // VERSION: 2.26
3782 // The GUID of the peer performing the role of server when
3783 // authenticating. See #GDBusConnection:guid for more details.
3785 // @connection.
3786 // RETURNS: The GUID. Do not free this string, it is owned by
3787 char* get_guid()() {
3788 return g_dbus_connection_get_guid(&this);
3791 // VERSION: 2.26
3792 // Gets the credentials of the authenticated peer. This will always
3793 // return %NULL unless @connection acted as a server
3794 // (e.g. %G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER was passed)
3795 // when set up and the client passed credentials as part of the
3796 // authentication process.
3798 // In a message bus setup, the message bus is always the server and
3799 // each application is a client. So this method will always return
3800 // %NULL for message bus clients.
3802 // this object, it is owned by @connection.
3803 // RETURNS: A #GCredentials or %NULL if not available. Do not free
3804 Credentials* get_peer_credentials()() {
3805 return g_dbus_connection_get_peer_credentials(&this);
3808 // VERSION: 2.26
3809 // Gets the underlying stream used for IO.
3810 // RETURNS: the stream used for IO
3811 IOStream* get_stream()() {
3812 return g_dbus_connection_get_stream(&this);
3815 // VERSION: 2.26
3816 // Gets the unique name of @connection as assigned by the message
3817 // bus. This can also be used to figure out if @connection is a
3818 // message bus connection.
3820 // bus connection. Do not free this string, it is owned by
3821 // @connection.
3822 // RETURNS: The unique name or %NULL if @connection is not a message
3823 char* get_unique_name()() {
3824 return g_dbus_connection_get_unique_name(&this);
3827 // VERSION: 2.26
3828 // Gets whether @connection is closed.
3829 // RETURNS: %TRUE if the connection is closed, %FALSE otherwise.
3830 int is_closed()() {
3831 return g_dbus_connection_is_closed(&this);
3834 // VERSION: 2.26
3835 // Registers callbacks for exported objects at @object_path with the
3836 // D-Bus interface that is described in @interface_info.
3838 // Calls to functions in @vtable (and @user_data_free_func) will
3839 // happen in the <link linkend="g-main-context-push-thread-default">thread-default main
3840 // loop</link> of the thread you are calling this method from.
3842 // Note that all #GVariant values passed to functions in @vtable will match
3843 // the signature given in @interface_info - if a remote caller passes
3844 // incorrect values, the <literal>org.freedesktop.DBus.Error.InvalidArgs</literal>
3845 // is returned to the remote caller.
3847 // Additionally, if the remote caller attempts to invoke methods or
3848 // access properties not mentioned in @interface_info the
3849 // <literal>org.freedesktop.DBus.Error.UnknownMethod</literal> resp.
3850 // <literal>org.freedesktop.DBus.Error.InvalidArgs</literal> errors
3851 // are returned to the caller.
3853 // It is considered a programming error if the
3854 // #GDBusInterfaceGetPropertyFunc function in @vtable returns a
3855 // #GVariant of incorrect type.
3857 // If an existing callback is already registered at @object_path and
3858 // @interface_name, then @error is set to #G_IO_ERROR_EXISTS.
3860 // GDBus automatically implements the standard D-Bus interfaces
3861 // org.freedesktop.DBus.Properties, org.freedesktop.DBus.Introspectable
3862 // and org.freedesktop.Peer, so you don't have to implement those for
3863 // the objects you export. You <emphasis>can</emphasis> implement
3864 // org.freedesktop.DBus.Properties yourself, e.g. to handle getting
3865 // and setting of properties asynchronously.
3867 // Note that the reference count on @interface_info will be
3868 // incremented by 1 (unless allocated statically, e.g. if the
3869 // reference count is -1, see g_dbus_interface_info_ref()) for as long
3870 // as the object is exported. Also note that @vtable will be copied.
3872 // See <xref linkend="gdbus-server"/> for an example of how to use this method.
3874 // that can be used with g_dbus_connection_unregister_object() .
3875 // RETURNS: 0 if @error is set, otherwise a registration id (never 0)
3876 // <object_path>: The object path to register at.
3877 // <interface_info>: Introspection data for the interface.
3878 // <vtable>: A #GDBusInterfaceVTable to call into or %NULL.
3879 // <user_data>: Data to pass to functions in @vtable.
3880 // <user_data_free_func>: Function to call when the object path is unregistered.
3881 uint register_object()(char* object_path, DBusInterfaceInfo* interface_info, DBusInterfaceVTable* vtable, void* user_data, GLib2.DestroyNotify user_data_free_func, GLib2.Error** error=null) {
3882 return g_dbus_connection_register_object(&this, object_path, interface_info, vtable, user_data, user_data_free_func, error);
3885 // VERSION: 2.26
3886 // Registers a whole subtree of <quote>dynamic</quote> objects.
3888 // The @enumerate and @introspection functions in @vtable are used to
3889 // convey, to remote callers, what nodes exist in the subtree rooted
3890 // by @object_path.
3892 // When handling remote calls into any node in the subtree, first the
3893 // @enumerate function is used to check if the node exists. If the node exists
3894 // or the #G_DBUS_SUBTREE_FLAGS_DISPATCH_TO_UNENUMERATED_NODES flag is set
3895 // the @introspection function is used to check if the node supports the
3896 // requested method. If so, the @dispatch function is used to determine
3897 // where to dispatch the call. The collected #GDBusInterfaceVTable and
3898 // #gpointer will be used to call into the interface vtable for processing
3899 // the request.
3901 // All calls into user-provided code will be invoked in the <link
3902 // linkend="g-main-context-push-thread-default">thread-default main
3903 // loop</link> of the thread you are calling this method from.
3905 // If an existing subtree is already registered at @object_path or
3906 // then @error is set to #G_IO_ERROR_EXISTS.
3908 // Note that it is valid to register regular objects (using
3909 // g_dbus_connection_register_object()) in a subtree registered with
3910 // g_dbus_connection_register_subtree() - if so, the subtree handler
3911 // is tried as the last resort. One way to think about a subtree
3912 // handler is to consider it a <quote>fallback handler</quote>
3913 // for object paths not registered via g_dbus_connection_register_object()
3914 // or other bindings.
3916 // Note that @vtable will be copied so you cannot change it after
3917 // registration.
3919 // See <xref linkend="gdbus-subtree-server"/> for an example of how to use this method.
3921 // that can be used with g_dbus_connection_unregister_subtree() .
3922 // RETURNS: 0 if @error is set, otherwise a subtree registration id (never 0)
3923 // <object_path>: The object path to register the subtree at.
3924 // <vtable>: A #GDBusSubtreeVTable to enumerate, introspect and dispatch nodes in the subtree.
3925 // <flags>: Flags used to fine tune the behavior of the subtree.
3926 // <user_data>: Data to pass to functions in @vtable.
3927 // <user_data_free_func>: Function to call when the subtree is unregistered.
3928 uint register_subtree()(char* object_path, DBusSubtreeVTable* vtable, DBusSubtreeFlags flags, void* user_data, GLib2.DestroyNotify user_data_free_func, GLib2.Error** error=null) {
3929 return g_dbus_connection_register_subtree(&this, object_path, vtable, flags, user_data, user_data_free_func, error);
3932 // VERSION: 2.26
3933 // Removes a filter.
3934 // <filter_id>: an identifier obtained from g_dbus_connection_add_filter()
3935 void remove_filter()(uint filter_id) {
3936 g_dbus_connection_remove_filter(&this, filter_id);
3939 // VERSION: 2.26
3940 // Asynchronously sends @message to the peer represented by @connection.
3942 // Unless @flags contain the
3943 // %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number
3944 // will be assigned by @connection and set on @message via
3945 // g_dbus_message_set_serial(). If @out_serial is not %NULL, then the
3946 // serial number used will be written to this location prior to
3947 // submitting the message to the underlying transport.
3949 // If @connection is closed then the operation will fail with
3950 // %G_IO_ERROR_CLOSED. If @message is not well-formed,
3951 // the operation fails with %G_IO_ERROR_INVALID_ARGUMENT.
3953 // See <xref linkend="gdbus-server"/> and <xref
3954 // linkend="gdbus-unix-fd-client"/> for an example of how to use this
3955 // low-level API to send and receive UNIX file descriptors.
3957 // Note that @message must be unlocked, unless @flags contain the
3958 // %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
3960 // transmission, %FALSE if @error is set.
3961 // RETURNS: %TRUE if the message was well-formed and queued for
3962 // <message>: A #GDBusMessage
3963 // <flags>: Flags affecting how the message is sent.
3964 // <out_serial>: Return location for serial number assigned to @message when sending it or %NULL.
3965 int send_message()(DBusMessage* message, DBusSendMessageFlags flags, /*out*/ uint* out_serial, GLib2.Error** error=null) {
3966 return g_dbus_connection_send_message(&this, message, flags, out_serial, error);
3969 // VERSION: 2.26
3970 // Asynchronously sends @message to the peer represented by @connection.
3972 // Unless @flags contain the
3973 // %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number
3974 // will be assigned by @connection and set on @message via
3975 // g_dbus_message_set_serial(). If @out_serial is not %NULL, then the
3976 // serial number used will be written to this location prior to
3977 // submitting the message to the underlying transport.
3979 // If @connection is closed then the operation will fail with
3980 // %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will
3981 // fail with %G_IO_ERROR_CANCELLED. If @message is not well-formed,
3982 // the operation fails with %G_IO_ERROR_INVALID_ARGUMENT.
3984 // This is an asynchronous method. When the operation is finished, @callback will be invoked
3985 // in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
3986 // of the thread you are calling this method from. You can then call
3987 // g_dbus_connection_send_message_with_reply_finish() to get the result of the operation.
3988 // See g_dbus_connection_send_message_with_reply_sync() for the synchronous version.
3990 // Note that @message must be unlocked, unless @flags contain the
3991 // %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
3993 // See <xref linkend="gdbus-server"/> and <xref
3994 // linkend="gdbus-unix-fd-client"/> for an example of how to use this
3995 // low-level API to send and receive UNIX file descriptors.
3996 // <message>: A #GDBusMessage.
3997 // <flags>: Flags affecting how the message is sent.
3998 // <timeout_msec>: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
3999 // <out_serial>: Return location for serial number assigned to @message when sending it or %NULL.
4000 // <cancellable>: A #GCancellable or %NULL.
4001 // <callback>: A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result.
4002 // <user_data>: The data to pass to @callback.
4003 void send_message_with_reply()(DBusMessage* message, DBusSendMessageFlags flags, int timeout_msec, /*out*/ uint* out_serial, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
4004 g_dbus_connection_send_message_with_reply(&this, message, flags, timeout_msec, out_serial, cancellable, callback, user_data);
4007 // VERSION: 2.26
4008 // Finishes an operation started with g_dbus_connection_send_message_with_reply().
4010 // Note that @error is only set if a local in-process error
4011 // occurred. That is to say that the returned #GDBusMessage object may
4012 // be of type %G_DBUS_MESSAGE_TYPE_ERROR. Use
4013 // g_dbus_message_to_gerror() to transcode this to a #GError.
4015 // See <xref linkend="gdbus-server"/> and <xref
4016 // linkend="gdbus-unix-fd-client"/> for an example of how to use this
4017 // low-level API to send and receive UNIX file descriptors.
4018 // RETURNS: A locked #GDBusMessage or %NULL if @error is set.
4019 // <res>: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_connection_send_message_with_reply().
4020 DBusMessage* /*new*/ send_message_with_reply_finish()(AsyncResult* res, GLib2.Error** error=null) {
4021 return g_dbus_connection_send_message_with_reply_finish(&this, res, error);
4024 // VERSION: 2.26
4025 // Synchronously sends @message to the peer represented by @connection
4026 // and blocks the calling thread until a reply is received or the
4027 // timeout is reached. See g_dbus_connection_send_message_with_reply()
4028 // for the asynchronous version of this method.
4030 // Unless @flags contain the
4031 // %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag, the serial number
4032 // will be assigned by @connection and set on @message via
4033 // g_dbus_message_set_serial(). If @out_serial is not %NULL, then the
4034 // serial number used will be written to this location prior to
4035 // submitting the message to the underlying transport.
4037 // If @connection is closed then the operation will fail with
4038 // %G_IO_ERROR_CLOSED. If @cancellable is canceled, the operation will
4039 // fail with %G_IO_ERROR_CANCELLED. If @message is not well-formed,
4040 // the operation fails with %G_IO_ERROR_INVALID_ARGUMENT.
4042 // Note that @error is only set if a local in-process error
4043 // occurred. That is to say that the returned #GDBusMessage object may
4044 // be of type %G_DBUS_MESSAGE_TYPE_ERROR. Use
4045 // g_dbus_message_to_gerror() to transcode this to a #GError.
4047 // See <xref linkend="gdbus-server"/> and <xref
4048 // linkend="gdbus-unix-fd-client"/> for an example of how to use this
4049 // low-level API to send and receive UNIX file descriptors.
4051 // Note that @message must be unlocked, unless @flags contain the
4052 // %G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag.
4053 // RETURNS: A locked #GDBusMessage that is the reply to @message or %NULL if @error is set.
4054 // <message>: A #GDBusMessage.
4055 // <flags>: Flags affecting how the message is sent.
4056 // <timeout_msec>: The timeout in milliseconds, -1 to use the default timeout or %G_MAXINT for no timeout.
4057 // <out_serial>: Return location for serial number assigned to @message when sending it or %NULL.
4058 // <cancellable>: A #GCancellable or %NULL.
4059 DBusMessage* /*new*/ send_message_with_reply_sync()(DBusMessage* message, DBusSendMessageFlags flags, int timeout_msec, /*out*/ uint* out_serial, Cancellable* cancellable, GLib2.Error** error=null) {
4060 return g_dbus_connection_send_message_with_reply_sync(&this, message, flags, timeout_msec, out_serial, cancellable, error);
4063 // VERSION: 2.26
4064 // Sets whether the process should be terminated when @connection is
4065 // closed by the remote peer. See #GDBusConnection:exit-on-close for
4066 // more details.
4068 // Note that this function should be used with care. Most modern UNIX
4069 // desktops tie the notion of a user session the session bus, and expect
4070 // all of a users applications to quit when their bus connection goes away.
4071 // If you are setting @exit_on_close to %FALSE for the shared session
4072 // bus connection, you should make sure that your application exits
4073 // when the user session ends.
4074 // <exit_on_close>: Whether the process should be terminated when @connection is closed by the remote peer.
4075 void set_exit_on_close()(int exit_on_close) {
4076 g_dbus_connection_set_exit_on_close(&this, exit_on_close);
4079 // VERSION: 2.26
4080 // Subscribes to signals on @connection and invokes @callback with a
4081 // whenever the signal is received. Note that @callback
4082 // will be invoked in the <link
4083 // linkend="g-main-context-push-thread-default">thread-default main
4084 // loop</link> of the thread you are calling this method from.
4086 // If @connection is not a message bus connection, @sender must be
4087 // %NULL.
4089 // If @sender is a well-known name note that @callback is invoked with
4090 // the unique name for the owner of @sender, not the well-known name
4091 // as one would expect. This is because the message bus rewrites the
4092 // name. As such, to avoid certain race conditions, users should be
4093 // tracking the name owner of the well-known name and use that when
4094 // processing the received signal.
4095 // RETURNS: A subscription identifier that can be used with g_dbus_connection_signal_unsubscribe().
4096 // <sender>: Sender name to match on (unique or well-known name) or %NULL to listen from all senders.
4097 // <interface_name>: D-Bus interface name to match on or %NULL to match on all interfaces.
4098 // <member>: D-Bus signal name to match on or %NULL to match on all signals.
4099 // <object_path>: Object path to match on or %NULL to match on all object paths.
4100 // <arg0>: Contents of first string argument to match on or %NULL to match on all kinds of arguments.
4101 // <flags>: Flags describing how to subscribe to the signal (currently unused).
4102 // <callback>: Callback to invoke when there is a signal matching the requested data.
4103 // <user_data>: User data to pass to @callback.
4104 // <user_data_free_func>: Function to free @user_data with when subscription is removed or %NULL.
4105 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) {
4106 return g_dbus_connection_signal_subscribe(&this, sender, interface_name, member, object_path, arg0, flags, callback, user_data, user_data_free_func);
4109 // VERSION: 2.26
4110 // Unsubscribes from signals.
4111 // <subscription_id>: A subscription id obtained from g_dbus_connection_signal_subscribe().
4112 void signal_unsubscribe()(uint subscription_id) {
4113 g_dbus_connection_signal_unsubscribe(&this, subscription_id);
4116 // VERSION: 2.26
4117 // If @connection was created with
4118 // %G_DBUS_CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING, this method
4119 // starts processing messages. Does nothing on if @connection wasn't
4120 // created with this flag or if the method has already been called.
4121 void start_message_processing()() {
4122 g_dbus_connection_start_message_processing(&this);
4125 // VERSION: 2.26
4126 // Unregisters an object.
4127 // RETURNS: %TRUE if the object was unregistered, %FALSE otherwise.
4128 // <registration_id>: A registration id obtained from g_dbus_connection_register_object().
4129 int unregister_object()(uint registration_id) {
4130 return g_dbus_connection_unregister_object(&this, registration_id);
4133 // VERSION: 2.26
4134 // Unregisters a subtree.
4135 // RETURNS: %TRUE if the subtree was unregistered, %FALSE otherwise.
4136 // <registration_id>: A subtree registration id obtained from g_dbus_connection_register_subtree().
4137 int unregister_subtree()(uint registration_id) {
4138 return g_dbus_connection_unregister_subtree(&this, registration_id);
4141 // VERSION: 2.26
4142 // Emitted when the connection is closed.
4144 // The cause of this event can be
4145 // <itemizedlist>
4146 // <listitem><para>
4147 // If g_dbus_connection_close() is called. In this case
4148 // @remote_peer_vanished is set to %FALSE and @error is %NULL.
4149 // </para></listitem>
4150 // <listitem><para>
4151 // If the remote peer closes the connection. In this case
4152 // @remote_peer_vanished is set to %TRUE and @error is set.
4153 // </para></listitem>
4154 // <listitem><para>
4155 // If the remote peer sends invalid or malformed data. In this
4156 // case @remote_peer_vanished is set to %FALSE and @error
4157 // is set.
4158 // </para></listitem>
4159 // </itemizedlist>
4161 // Upon receiving this signal, you should give up your reference to
4162 // @connection. You are guaranteed that this signal is emitted only
4163 // once.
4164 // <remote_peer_vanished>: %TRUE if @connection is closed because the remote peer closed its end of the connection.
4165 // <error>: A #GError with more details about the event or %NULL.
4166 extern (C) alias static void function (DBusConnection* this_, c_int remote_peer_vanished, GLib2.Error* error, void* user_data=null) signal_closed;
4168 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
4169 return super_.signal_connect!name(cb, data, cf);
4172 ulong signal_connect(string name:"closed", CB:signal_closed)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
4173 return signal_connect_data!()(&this, cast(char*)"closed",
4174 cast(GObject2.Callback)cb, data, null, cf);
4178 // Flags used when creating a new #GDBusConnection.
4179 enum DBusConnectionFlags /* Version 2.26 */ {
4180 NONE = 0,
4181 AUTHENTICATION_CLIENT = 1,
4182 AUTHENTICATION_SERVER = 2,
4183 AUTHENTICATION_ALLOW_ANONYMOUS = 4,
4184 MESSAGE_BUS_CONNECTION = 8,
4185 DELAY_MESSAGE_PROCESSING = 16
4188 // Certain timeout errors, e.g. while starting a service. Warning: this is
4189 // Error codes for the %G_DBUS_ERROR error domain.
4190 enum DBusError /* Version 2.26 */ {
4191 FAILED = 0,
4192 NO_MEMORY = 1,
4193 SERVICE_UNKNOWN = 2,
4194 NAME_HAS_NO_OWNER = 3,
4195 NO_REPLY = 4,
4196 IO_ERROR = 5,
4197 BAD_ADDRESS = 6,
4198 NOT_SUPPORTED = 7,
4199 LIMITS_EXCEEDED = 8,
4200 ACCESS_DENIED = 9,
4201 AUTH_FAILED = 10,
4202 NO_SERVER = 11,
4203 TIMEOUT = 12,
4204 NO_NETWORK = 13,
4205 ADDRESS_IN_USE = 14,
4206 DISCONNECTED = 15,
4207 INVALID_ARGS = 16,
4208 FILE_NOT_FOUND = 17,
4209 FILE_EXISTS = 18,
4210 UNKNOWN_METHOD = 19,
4211 TIMED_OUT = 20,
4212 MATCH_RULE_NOT_FOUND = 21,
4213 MATCH_RULE_INVALID = 22,
4214 SPAWN_EXEC_FAILED = 23,
4215 SPAWN_FORK_FAILED = 24,
4216 SPAWN_CHILD_EXITED = 25,
4217 SPAWN_CHILD_SIGNALED = 26,
4218 SPAWN_FAILED = 27,
4219 SPAWN_SETUP_FAILED = 28,
4220 SPAWN_CONFIG_INVALID = 29,
4221 SPAWN_SERVICE_INVALID = 30,
4222 SPAWN_SERVICE_NOT_FOUND = 31,
4223 SPAWN_PERMISSIONS_INVALID = 32,
4224 SPAWN_FILE_INVALID = 33,
4225 SPAWN_NO_MEMORY = 34,
4226 UNIX_PROCESS_ID_UNKNOWN = 35,
4227 INVALID_SIGNATURE = 36,
4228 INVALID_FILE_CONTENT = 37,
4229 SELINUX_SECURITY_CONTEXT_UNKNOWN = 38,
4230 ADT_AUDIT_DATA_UNKNOWN = 39,
4231 OBJECT_PATH_IN_USE = 40
4233 // Struct used in g_dbus_error_register_error_domain().
4234 struct DBusErrorEntry /* Version 2.26 */ {
4235 int error_code;
4236 char* dbus_error_name;
4240 // The #GDBusInterface type is the base type for D-Bus interfaces both
4241 // on the service side (see #GDBusInterfaceSkeleton) and client side
4242 // (see #GDBusProxy).
4243 struct DBusInterface /* Interface */ /* Version 2.30 */ {
4244 mixin template __interface__() {
4245 // VERSION: 2.30
4246 // Gets D-Bus introspection information for the D-Bus interface
4247 // implemented by @interface_.
4248 // RETURNS: A #GDBusInterfaceInfo. Do not free.
4249 DBusInterfaceInfo* get_info()() {
4250 return g_dbus_interface_get_info(cast(DBusInterface*)&this);
4253 // VERSION: 2.30
4254 // Gets the #GDBusObject that @interface_ belongs to, if any.
4256 // reference belongs to @interface_ and should not be freed.
4257 // RETURNS: A #GDBusObject or %NULL. The returned
4258 DBusObject* get_object()() {
4259 return g_dbus_interface_get_object(cast(DBusInterface*)&this);
4262 // VERSION: 2.30
4263 // Sets the #GDBusObject for @interface_ to @object.
4265 // Note that @interface_ will hold a weak reference to @object.
4266 // <object>: A #GDBusObject or %NULL.
4267 void set_object()(DBusObject* object) {
4268 g_dbus_interface_set_object(cast(DBusInterface*)&this, object);
4271 mixin __interface__;
4275 // VERSION: 2.26
4276 // The type of the @get_property function in #GDBusInterfaceVTable.
4278 // @error is set. If the returned #GVariant is floating, it is
4279 // consumed - otherwise its reference count is decreased by one.
4280 // RETURNS: A #GVariant with the value for @property_name or %NULL if
4281 // <connection>: A #GDBusConnection.
4282 // <sender>: The unique bus name of the remote caller.
4283 // <object_path>: The object path that the method was invoked on.
4284 // <interface_name>: The D-Bus interface name for the property.
4285 // <property_name>: The name of the property to get the value of.
4286 // <error>: Return location for error.
4287 // <user_data>: The @user_data #gpointer passed to g_dbus_connection_register_object().
4288 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;
4290 // Base type for D-Bus interfaces.
4291 struct DBusInterfaceIface /* Version 2.30 */ {
4292 GObject2.TypeInterface parent_iface;
4293 // RETURNS: A #GDBusInterfaceInfo. Do not free.
4294 extern (C) DBusInterfaceInfo* function (DBusInterface* interface_) get_info;
4295 // RETURNS: A #GDBusObject or %NULL. The returned
4296 extern (C) DBusObject* function (DBusInterface* interface_) get_object;
4297 // <object>: A #GDBusObject or %NULL.
4298 extern (C) void function (DBusInterface* interface_, DBusObject* object) set_object;
4301 // Information about a D-Bus interface.
4302 struct DBusInterfaceInfo /* Version 2.26 */ {
4303 int ref_count;
4304 char* name;
4305 DBusMethodInfo*[666] methods;
4306 DBusSignalInfo*[666] signals;
4307 DBusPropertyInfo*[666] properties;
4308 DBusAnnotationInfo*[666] annotations;
4311 // VERSION: 2.30
4312 // Builds a lookup-cache to speed up
4313 // g_dbus_interface_info_lookup_method(),
4314 // g_dbus_interface_info_lookup_signal() and
4315 // g_dbus_interface_info_lookup_property().
4317 // If this has already been called with @info, the existing cache is
4318 // used and its use count is increased.
4320 // Note that @info cannot be modified until
4321 // g_dbus_interface_info_cache_release() is called.
4322 void cache_build()() {
4323 g_dbus_interface_info_cache_build(&this);
4326 // VERSION: 2.30
4327 // Decrements the usage count for the cache for @info built by
4328 // g_dbus_interface_info_cache_build() (if any) and frees the
4329 // resources used by the cache if the usage count drops to zero.
4330 void cache_release()() {
4331 g_dbus_interface_info_cache_release(&this);
4334 // VERSION: 2.26
4335 // Appends an XML representation of @info (and its children) to @string_builder.
4337 // This function is typically used for generating introspection XML
4338 // documents at run-time for handling the
4339 // <literal>org.freedesktop.DBus.Introspectable.Introspect</literal>
4340 // method.
4341 // <indent>: Indentation level.
4342 // <string_builder>: A #GString to to append XML data to.
4343 void generate_xml()(uint indent, /*out*/ GLib2.String* string_builder) {
4344 g_dbus_interface_info_generate_xml(&this, indent, string_builder);
4347 // VERSION: 2.26
4348 // Looks up information about a method.
4350 // This cost of this function is O(n) in number of methods unless
4351 // g_dbus_interface_info_cache_build() has been used on @info.
4352 // RETURNS: A #GDBusMethodInfo or %NULL if not found. Do not free, it is owned by @info.
4353 // <name>: A D-Bus method name (typically in CamelCase)
4354 DBusMethodInfo* lookup_method()(char* name) {
4355 return g_dbus_interface_info_lookup_method(&this, name);
4358 // VERSION: 2.26
4359 // Looks up information about a property.
4361 // This cost of this function is O(n) in number of properties unless
4362 // g_dbus_interface_info_cache_build() has been used on @info.
4363 // RETURNS: A #GDBusPropertyInfo or %NULL if not found. Do not free, it is owned by @info.
4364 // <name>: A D-Bus property name (typically in CamelCase).
4365 DBusPropertyInfo* lookup_property()(char* name) {
4366 return g_dbus_interface_info_lookup_property(&this, name);
4369 // VERSION: 2.26
4370 // Looks up information about a signal.
4372 // This cost of this function is O(n) in number of signals unless
4373 // g_dbus_interface_info_cache_build() has been used on @info.
4374 // RETURNS: A #GDBusSignalInfo or %NULL if not found. Do not free, it is owned by @info.
4375 // <name>: A D-Bus signal name (typically in CamelCase)
4376 DBusSignalInfo* lookup_signal()(char* name) {
4377 return g_dbus_interface_info_lookup_signal(&this, name);
4380 // VERSION: 2.26
4381 // If @info is statically allocated does nothing. Otherwise increases
4382 // the reference count.
4383 // RETURNS: The same @info.
4384 DBusInterfaceInfo* /*new*/ ref_()() {
4385 return g_dbus_interface_info_ref(&this);
4388 // VERSION: 2.26
4389 // If @info is statically allocated, does nothing. Otherwise decreases
4390 // the reference count of @info. When its reference count drops to 0,
4391 // the memory used is freed.
4392 void unref()() {
4393 g_dbus_interface_info_unref(&this);
4398 // VERSION: 2.26
4399 // The type of the @method_call function in #GDBusInterfaceVTable.
4400 // <connection>: A #GDBusConnection.
4401 // <sender>: The unique bus name of the remote caller.
4402 // <object_path>: The object path that the method was invoked on.
4403 // <interface_name>: The D-Bus interface name the method was invoked on.
4404 // <method_name>: The name of the method that was invoked.
4405 // <parameters>: A #GVariant tuple with parameters.
4406 // <invocation>: A #GDBusMethodInvocation object that can be used to return a value or error.
4407 // <user_data>: The @user_data #gpointer passed to g_dbus_connection_register_object().
4408 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;
4411 // VERSION: 2.26
4412 // The type of the @set_property function in #GDBusInterfaceVTable.
4413 // RETURNS: %TRUE if the property was set to @value, %FALSE if @error is set.
4414 // <connection>: A #GDBusConnection.
4415 // <sender>: The unique bus name of the remote caller.
4416 // <object_path>: The object path that the method was invoked on.
4417 // <interface_name>: The D-Bus interface name for the property.
4418 // <property_name>: The name of the property to get the value of.
4419 // <value>: The value to set the property to.
4420 // <error>: Return location for error.
4421 // <user_data>: The @user_data #gpointer passed to g_dbus_connection_register_object().
4422 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;
4424 // Abstract base class for D-Bus interfaces on the service side.
4425 struct DBusInterfaceSkeleton /* : GObject.Object */ /* Version 2.30 */ {
4426 mixin DBusInterface.__interface__;
4427 alias parent_instance this;
4428 alias parent_instance super_;
4429 alias parent_instance object;
4430 GObject2.Object parent_instance;
4431 private DBusInterfaceSkeletonPrivate* priv;
4434 // VERSION: 2.30
4435 // Exports @interface_ at @object_path on @connection.
4437 // Use g_dbus_interface_skeleton_unexport() to unexport the object.
4439 // @error set.
4440 // RETURNS: %TRUE if the interface was exported, other %FALSE with
4441 // <connection>: A #GDBusConnection to export @interface_ on.
4442 // <object_path>: The path to export the interface at.
4443 int export_()(DBusConnection* connection, char* object_path, GLib2.Error** error=null) {
4444 return g_dbus_interface_skeleton_export(&this, connection, object_path, error);
4447 // VERSION: 2.30
4448 // If @interface_ has outstanding changes, request for these changes to be
4449 // emitted immediately.
4451 // For example, an exported D-Bus interface may queue up property
4452 // changes and emit the
4453 // <literal>org.freedesktop.DBus.Properties::PropertiesChanged</literal>
4454 // signal later (e.g. in an idle handler). This technique is useful
4455 // for collapsing multiple property changes into one.
4456 void flush()() {
4457 g_dbus_interface_skeleton_flush(&this);
4460 // VERSION: 2.30
4461 // Gets the connection that @interface_ is exported on, if any.
4463 // not exported anywhere. Do not free, the object belongs to @interface_.
4464 // RETURNS: A #GDBusConnection or %NULL if @interface_ is
4465 DBusConnection* get_connection()() {
4466 return g_dbus_interface_skeleton_get_connection(&this);
4469 // VERSION: 2.30
4470 // Gets the #GDBusInterfaceSkeletonFlags that describes what the behavior
4471 // of @interface_
4472 // RETURNS: One or more flags from the #GDBusInterfaceSkeletonFlags enumeration.
4473 DBusInterfaceSkeletonFlags get_flags()() {
4474 return g_dbus_interface_skeleton_get_flags(&this);
4477 // VERSION: 2.30
4478 // Gets D-Bus introspection information for the D-Bus interface
4479 // implemented by @interface_.
4480 // RETURNS: A #GDBusInterfaceInfo (never %NULL). Do not free.
4481 DBusInterfaceInfo* get_info()() {
4482 return g_dbus_interface_skeleton_get_info(&this);
4485 // VERSION: 2.30
4486 // Gets the object path that @interface_ is exported on, if any.
4488 // anywhere. Do not free, the string belongs to @interface_.
4489 // RETURNS: A string owned by @interface_ or %NULL if @interface_ is not exported
4490 char* get_object_path()() {
4491 return g_dbus_interface_skeleton_get_object_path(&this);
4494 // VERSION: 2.30
4495 // Gets all D-Bus properties for @interface_.
4496 // RETURNS: A #GVariant of type <link linkend="G-VARIANT-TYPE-VARDICT:CAPS">'a{sv}'</link>. Free with g_variant_unref().
4497 GLib2.Variant* /*new*/ get_properties()() {
4498 return g_dbus_interface_skeleton_get_properties(&this);
4501 // Unintrospectable method: get_vtable() / g_dbus_interface_skeleton_get_vtable()
4502 // VERSION: 2.30
4503 // Gets the interface vtable for the D-Bus interface implemented by
4504 // @interface_. The returned function pointers should expect @interface_
4505 // itself to be passed as @user_data.
4506 // RETURNS: A #GDBusInterfaceVTable (never %NULL).
4507 DBusInterfaceVTable* get_vtable()() {
4508 return g_dbus_interface_skeleton_get_vtable(&this);
4511 // VERSION: 2.30
4512 // Sets flags describing what the behavior of @skeleton should be.
4513 // <flags>: Flags from the #GDBusInterfaceSkeletonFlags enumeration.
4514 void set_flags()(DBusInterfaceSkeletonFlags flags) {
4515 g_dbus_interface_skeleton_set_flags(&this, flags);
4518 // VERSION: 2.30
4519 // Stops exporting an interface previously exported with
4520 // g_dbus_interface_skeleton_export().
4521 void unexport()() {
4522 g_dbus_interface_skeleton_unexport(&this);
4525 // VERSION: 2.30
4526 // Emitted when a method is invoked by a remote caller and used to
4527 // determine if the method call is authorized.
4529 // Note that this signal is emitted in a thread dedicated to
4530 // handling the method call so handlers are allowed to perform
4531 // blocking IO. This means that it is appropriate to call
4532 // e.g. <ulink
4533 // url="http://hal.freedesktop.org/docs/polkit/PolkitAuthority.html#polkit-authority-check-authorization-sync">polkit_authority_check_authorization_sync()</ulink>
4534 // with the <ulink
4535 // 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.
4537 // If %FALSE is returned then no further handlers are run and the
4538 // signal handler must take a reference to @invocation and finish
4539 // handling the call (e.g. return an error via
4540 // g_dbus_method_invocation_return_error()).
4542 // Otherwise, if %TRUE is returned, signal emission continues. If no
4543 // handlers return %FALSE, then the method is dispatched. If
4544 // @interface has an enclosing #GDBusObjectSkeleton, then the
4545 // #GDBusObjectSkeleton::authorize-method signal handlers run before
4546 // the handlers for this signal.
4548 // The default class handler just returns %TRUE.
4550 // Please note that the common case is optimized: if no signals
4551 // handlers are connected and the default class handler isn't
4552 // overridden (for both @interface and the enclosing
4553 // #GDBusObjectSkeleton, if any) and #GDBusInterfaceSkeleton:g-flags does
4554 // not have the
4555 // %G_DBUS_INTERFACE_SKELETON_FLAGS_HANDLE_METHOD_INVOCATIONS_IN_THREAD
4556 // flags set, no dedicated thread is ever used and the call will be
4557 // handled in the same thread as the object that @interface belongs
4558 // to was exported in.
4559 // RETURNS: %TRUE if the call is authorized, %FALSE otherwise.
4560 // <invocation>: A #GDBusMethodInvocation.
4561 extern (C) alias static c_int function (DBusInterfaceSkeleton* this_, DBusMethodInvocation* invocation, void* user_data=null) signal_g_authorize_method;
4563 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
4564 return super_.signal_connect!name(cb, data, cf);
4567 ulong signal_connect(string name:"g-authorize-method", CB:signal_g_authorize_method)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
4568 return signal_connect_data!()(&this, cast(char*)"g-authorize-method",
4569 cast(GObject2.Callback)cb, data, null, cf);
4573 // Class structure for #GDBusInterfaceSkeleton.
4574 struct DBusInterfaceSkeletonClass /* Version 2.30 */ {
4575 GObject2.ObjectClass parent_class;
4576 // RETURNS: A #GDBusInterfaceInfo (never %NULL). Do not free.
4577 extern (C) DBusInterfaceInfo* function (DBusInterfaceSkeleton* interface_) get_info;
4579 // Unintrospectable functionp: get_vtable() / ()
4581 // RETURNS: A #GDBusInterfaceVTable (never %NULL).
4582 extern (C) DBusInterfaceVTable* function (DBusInterfaceSkeleton* interface_) get_vtable;
4583 // RETURNS: A #GVariant of type <link linkend="G-VARIANT-TYPE-VARDICT:CAPS">'a{sv}'</link>. Free with g_variant_unref().
4584 extern (C) GLib2.Variant* /*new*/ function (DBusInterfaceSkeleton* interface_) get_properties;
4585 extern (C) void function (DBusInterfaceSkeleton* interface_) flush;
4586 private void*[8] vfunc_padding;
4587 extern (C) int function (DBusInterfaceSkeleton* interface_, DBusMethodInvocation* invocation) g_authorize_method;
4588 private void*[8] signal_padding;
4591 // Flags describing the behavior of a #GDBusInterfaceSkeleton instance.
4592 enum DBusInterfaceSkeletonFlags /* Version 2.30 */ {
4593 NONE = 0,
4594 HANDLE_METHOD_INVOCATIONS_IN_THREAD = 1
4596 struct DBusInterfaceSkeletonPrivate {
4600 // Virtual table for handling properties and method calls for a D-Bus
4601 // interface.
4603 // If you want to handle getting/setting D-Bus properties asynchronously, simply
4604 // register an object with the <literal>org.freedesktop.DBus.Properties</literal>
4605 // D-Bus interface using g_dbus_connection_register_object().
4606 struct DBusInterfaceVTable /* Version 2.26 */ {
4607 DBusInterfaceMethodCallFunc method_call;
4608 DBusInterfaceGetPropertyFunc get_property;
4609 DBusInterfaceSetPropertyFunc set_property;
4610 private void*[8] padding;
4614 // A type for representing D-Bus messages that can be sent or received
4615 // on a #GDBusConnection.
4616 struct DBusMessage /* : GObject.Object */ /* Version 2.26 */ {
4617 alias method_parent this;
4618 alias method_parent super_;
4619 alias method_parent object;
4620 GObject2.Object method_parent;
4623 // VERSION: 2.26
4624 // Creates a new empty #GDBusMessage.
4625 // RETURNS: A #GDBusMessage. Free with g_object_unref().
4626 static DBusMessage* /*new*/ new_()() {
4627 return g_dbus_message_new();
4630 // VERSION: 2.26
4631 // Creates a new #GDBusMessage from the data stored at @blob. The byte
4632 // order that the message was in can be retrieved using
4633 // g_dbus_message_get_byte_order().
4635 // g_object_unref().
4636 // RETURNS: A new #GDBusMessage or %NULL if @error is set. Free with
4637 // <blob>: A blob represent a binary D-Bus message.
4638 // <blob_len>: The length of @blob.
4639 // <capabilities>: A #GDBusCapabilityFlags describing what protocol features are supported.
4640 static DBusMessage* /*new*/ new_from_blob()(ubyte* blob, size_t blob_len, DBusCapabilityFlags capabilities, GLib2.Error** error=null) {
4641 return g_dbus_message_new_from_blob(blob, blob_len, capabilities, error);
4644 // VERSION: 2.26
4645 // Creates a new #GDBusMessage for a method call.
4646 // RETURNS: A #GDBusMessage. Free with g_object_unref().
4647 // <name>: A valid D-Bus name or %NULL.
4648 // <path>: A valid object path.
4649 // <interface_>: A valid D-Bus interface name or %NULL.
4650 // <method>: A valid method name.
4651 static DBusMessage* /*new*/ new_method_call()(char* name, char* path, char* interface_, char* method) {
4652 return g_dbus_message_new_method_call(name, path, interface_, method);
4655 // VERSION: 2.26
4656 // Creates a new #GDBusMessage for a signal emission.
4657 // RETURNS: A #GDBusMessage. Free with g_object_unref().
4658 // <path>: A valid object path.
4659 // <interface_>: A valid D-Bus interface name.
4660 // <signal>: A valid signal name.
4661 static DBusMessage* /*new*/ new_signal()(char* path, char* interface_, char* signal) {
4662 return g_dbus_message_new_signal(path, interface_, signal);
4665 // VERSION: 2.26
4666 // Utility function to calculate how many bytes are needed to
4667 // completely deserialize the D-Bus message stored at @blob.
4669 // @blob contains invalid data or not enough data is available to
4670 // determine the size).
4671 // RETURNS: Number of bytes needed or -1 if @error is set (e.g. if
4672 // <blob>: A blob represent a binary D-Bus message.
4673 // <blob_len>: The length of @blob (must be at least 16).
4674 static ssize_t bytes_needed()(ubyte* blob, size_t blob_len, GLib2.Error** error=null) {
4675 return g_dbus_message_bytes_needed(blob, blob_len, error);
4678 // VERSION: 2.26
4679 // Copies @message. The copy is a deep copy and the returned
4680 // #GDBusMessage is completely identical except that it is guaranteed
4681 // to not be locked.
4683 // This operation can fail if e.g. @message contains file descriptors
4684 // and the per-process or system-wide open files limit is reached.
4686 // Free with g_object_unref().
4687 // RETURNS: A new #GDBusMessage or %NULL if @error is set.
4688 DBusMessage* /*new*/ copy()(GLib2.Error** error=null) {
4689 return g_dbus_message_copy(&this, error);
4692 // VERSION: 2.26
4693 // Convenience to get the first item in the body of @message.
4695 // @message is not a string.
4696 // RETURNS: The string item or %NULL if the first item in the body of
4697 char* get_arg0()() {
4698 return g_dbus_message_get_arg0(&this);
4701 // VERSION: 2.26
4702 // Gets the body of a message.
4703 // RETURNS: A #GVariant or %NULL if the body is empty. Do not free, it is owned by @message.
4704 GLib2.Variant* /*new*/ get_body()() {
4705 return g_dbus_message_get_body(&this);
4708 // Gets the byte order of @message.
4709 // RETURNS: The byte order.
4710 DBusMessageByteOrder get_byte_order()() {
4711 return g_dbus_message_get_byte_order(&this);
4714 // VERSION: 2.26
4715 // Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION header field.
4716 // RETURNS: The value.
4717 char* get_destination()() {
4718 return g_dbus_message_get_destination(&this);
4721 // VERSION: 2.26
4722 // Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field.
4723 // RETURNS: The value.
4724 char* get_error_name()() {
4725 return g_dbus_message_get_error_name(&this);
4728 // VERSION: 2.26
4729 // Gets the flags for @message.
4730 // RETURNS: Flags that are set (typically values from the #GDBusMessageFlags enumeration bitwise ORed together).
4731 DBusMessageFlags get_flags()() {
4732 return g_dbus_message_get_flags(&this);
4735 // VERSION: 2.26
4736 // Gets a header field on @message.
4738 // otherwise. Do not free, it is owned by @message.
4739 // RETURNS: A #GVariant with the value if the header was found, %NULL
4740 // <header_field>: A 8-bit unsigned integer (typically a value from the #GDBusMessageHeaderField enumeration)
4741 GLib2.Variant* /*new*/ get_header()(DBusMessageHeaderField header_field) {
4742 return g_dbus_message_get_header(&this, header_field);
4745 // VERSION: 2.26
4746 // Gets an array of all header fields on @message that are set.
4748 // %G_DBUS_MESSAGE_HEADER_FIELD_INVALID. Each element is a
4749 // #guchar. Free with g_free().
4750 // RETURNS: An array of header fields terminated by
4751 ubyte* get_header_fields()() {
4752 return g_dbus_message_get_header_fields(&this);
4755 // VERSION: 2.26
4756 // Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE header field.
4757 // RETURNS: The value.
4758 char* get_interface()() {
4759 return g_dbus_message_get_interface(&this);
4762 // VERSION: 2.26
4763 // Checks whether @message is locked. To monitor changes to this
4764 // value, conncet to the #GObject::notify signal to listen for changes
4765 // on the #GDBusMessage:locked property.
4766 // RETURNS: %TRUE if @message is locked, %FALSE otherwise.
4767 int get_locked()() {
4768 return g_dbus_message_get_locked(&this);
4771 // VERSION: 2.26
4772 // Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_MEMBER header field.
4773 // RETURNS: The value.
4774 char* get_member()() {
4775 return g_dbus_message_get_member(&this);
4778 // VERSION: 2.26
4779 // Gets the type of @message.
4780 // RETURNS: A 8-bit unsigned integer (typically a value from the #GDBusMessageType enumeration).
4781 DBusMessageType get_message_type()() {
4782 return g_dbus_message_get_message_type(&this);
4785 // VERSION: 2.26
4786 // Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header field.
4787 // RETURNS: The value.
4788 uint get_num_unix_fds()() {
4789 return g_dbus_message_get_num_unix_fds(&this);
4792 // VERSION: 2.26
4793 // Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_PATH header field.
4794 // RETURNS: The value.
4795 char* get_path()() {
4796 return g_dbus_message_get_path(&this);
4799 // VERSION: 2.26
4800 // Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL header field.
4801 // RETURNS: The value.
4802 uint get_reply_serial()() {
4803 return g_dbus_message_get_reply_serial(&this);
4806 // VERSION: 2.26
4807 // Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_SENDER header field.
4808 // RETURNS: The value.
4809 char* get_sender()() {
4810 return g_dbus_message_get_sender(&this);
4813 // VERSION: 2.26
4814 // Gets the serial for @message.
4815 // RETURNS: A #guint32.
4816 uint get_serial()() {
4817 return g_dbus_message_get_serial(&this);
4820 // VERSION: 2.26
4821 // Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field.
4822 // RETURNS: The value.
4823 char* get_signature()() {
4824 return g_dbus_message_get_signature(&this);
4827 // VERSION: 2.26
4828 // Gets the UNIX file descriptors associated with @message, if any.
4830 // This method is only available on UNIX.
4832 // associated. Do not free, this object is owned by @message.
4833 // RETURNS: A #GUnixFDList or %NULL if no file descriptors are
4834 UnixFDList* get_unix_fd_list()() {
4835 return g_dbus_message_get_unix_fd_list(&this);
4838 // VERSION: 2.26
4839 // If @message is locked, does nothing. Otherwise locks the message.
4840 void lock()() {
4841 g_dbus_message_lock(&this);
4844 // Unintrospectable method: new_method_error() / g_dbus_message_new_method_error()
4845 // VERSION: 2.26
4846 // Creates a new #GDBusMessage that is an error reply to @method_call_message.
4847 // RETURNS: A #GDBusMessage. Free with g_object_unref().
4848 // <error_name>: A valid D-Bus error name.
4849 // <error_message_format>: The D-Bus error message in a printf() format.
4850 /+ Not available -- variadic methods unsupported - use the C function directly.
4851 alias g_dbus_message_new_method_error new_method_error; // Variadic
4854 // VERSION: 2.26
4855 // Creates a new #GDBusMessage that is an error reply to @method_call_message.
4856 // RETURNS: A #GDBusMessage. Free with g_object_unref().
4857 // <error_name>: A valid D-Bus error name.
4858 // <error_message>: The D-Bus error message.
4859 DBusMessage* /*new*/ new_method_error_literal()(char* error_name, char* error_message) {
4860 return g_dbus_message_new_method_error_literal(&this, error_name, error_message);
4863 // Unintrospectable method: new_method_error_valist() / g_dbus_message_new_method_error_valist()
4864 // VERSION: 2.26
4865 // Like g_dbus_message_new_method_error() but intended for language bindings.
4866 // RETURNS: A #GDBusMessage. Free with g_object_unref().
4867 // <error_name>: A valid D-Bus error name.
4868 // <error_message_format>: The D-Bus error message in a printf() format.
4869 // <var_args>: Arguments for @error_message_format.
4870 DBusMessage* /*new*/ new_method_error_valist()(char* error_name, char* error_message_format, va_list var_args) {
4871 return g_dbus_message_new_method_error_valist(&this, error_name, error_message_format, var_args);
4874 // VERSION: 2.26
4875 // Creates a new #GDBusMessage that is a reply to @method_call_message.
4876 // RETURNS: #GDBusMessage. Free with g_object_unref().
4877 DBusMessage* /*new*/ new_method_reply()() {
4878 return g_dbus_message_new_method_reply(&this);
4881 // VERSION: 2.26
4882 // Produces a human-readable multi-line description of @message.
4884 // The contents of the description has no ABI guarantees, the contents
4885 // and formatting is subject to change at any time. Typical output
4886 // looks something like this:
4887 // <programlisting>
4888 // Flags: none
4889 // Version: 0
4890 // Serial: 4
4891 // Headers:
4892 // path -> objectpath '/org/gtk/GDBus/TestObject'
4893 // interface -> 'org.gtk.GDBus.TestInterface'
4894 // member -> 'GimmeStdout'
4895 // destination -> ':1.146'
4896 // Body: ()
4897 // UNIX File Descriptors:
4898 // (none)
4899 // </programlisting>
4900 // or
4901 // <programlisting>
4902 // Flags: no-reply-expected
4903 // Version: 0
4904 // Serial: 477
4905 // Headers:
4906 // reply-serial -> uint32 4
4907 // destination -> ':1.159'
4908 // sender -> ':1.146'
4909 // num-unix-fds -> uint32 1
4910 // Body: ()
4911 // UNIX File Descriptors:
4912 // fd 12: dev=0:10,mode=020620,ino=5,uid=500,gid=5,rdev=136:2,size=0,atime=1273085037,mtime=1273085851,ctime=1272982635
4913 // </programlisting>
4914 // RETURNS: A string that should be freed with g_free().
4915 // <indent>: Indentation level.
4916 char* /*new*/ print()(uint indent) {
4917 return g_dbus_message_print(&this, indent);
4920 // VERSION: 2.26
4921 // Sets the body @message. As a side-effect the
4922 // %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field is set to the
4923 // type string of @body (or cleared if @body is %NULL).
4925 // If @body is floating, @message assumes ownership of @body.
4926 // <body>: Either %NULL or a #GVariant that is a tuple.
4927 void set_body()(GLib2.Variant* body_) {
4928 g_dbus_message_set_body(&this, body_);
4931 // Sets the byte order of @message.
4932 // <byte_order>: The byte order.
4933 void set_byte_order()(DBusMessageByteOrder byte_order) {
4934 g_dbus_message_set_byte_order(&this, byte_order);
4937 // VERSION: 2.26
4938 // Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION header field.
4939 // <value>: The value to set.
4940 void set_destination()(char* value) {
4941 g_dbus_message_set_destination(&this, value);
4944 // VERSION: 2.26
4945 // Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field.
4946 // <value>: The value to set.
4947 void set_error_name()(char* value) {
4948 g_dbus_message_set_error_name(&this, value);
4951 // VERSION: 2.26
4952 // Sets the flags to set on @message.
4953 // <flags>: Flags for @message that are set (typically values from the #GDBusMessageFlags enumeration bitwise ORed together).
4954 void set_flags()(DBusMessageFlags flags) {
4955 g_dbus_message_set_flags(&this, flags);
4958 // VERSION: 2.26
4959 // Sets a header field on @message.
4961 // If @value is floating, @message assumes ownership of @value.
4962 // <header_field>: A 8-bit unsigned integer (typically a value from the #GDBusMessageHeaderField enumeration)
4963 // <value>: A #GVariant to set the header field or %NULL to clear the header field.
4964 void set_header()(DBusMessageHeaderField header_field, GLib2.Variant* value) {
4965 g_dbus_message_set_header(&this, header_field, value);
4968 // VERSION: 2.26
4969 // Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE header field.
4970 // <value>: The value to set.
4971 void set_interface()(char* value) {
4972 g_dbus_message_set_interface(&this, value);
4975 // VERSION: 2.26
4976 // Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_MEMBER header field.
4977 // <value>: The value to set.
4978 void set_member()(char* value) {
4979 g_dbus_message_set_member(&this, value);
4982 // VERSION: 2.26
4983 // Sets @message to be of @type.
4984 // <type>: A 8-bit unsigned integer (typically a value from the #GDBusMessageType enumeration).
4985 void set_message_type()(DBusMessageType type) {
4986 g_dbus_message_set_message_type(&this, type);
4989 // VERSION: 2.26
4990 // Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header field.
4991 // <value>: The value to set.
4992 void set_num_unix_fds()(uint value) {
4993 g_dbus_message_set_num_unix_fds(&this, value);
4996 // VERSION: 2.26
4997 // Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_PATH header field.
4998 // <value>: The value to set.
4999 void set_path()(char* value) {
5000 g_dbus_message_set_path(&this, value);
5003 // VERSION: 2.26
5004 // Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL header field.
5005 // <value>: The value to set.
5006 void set_reply_serial()(uint value) {
5007 g_dbus_message_set_reply_serial(&this, value);
5010 // VERSION: 2.26
5011 // Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_SENDER header field.
5012 // <value>: The value to set.
5013 void set_sender()(char* value) {
5014 g_dbus_message_set_sender(&this, value);
5017 // VERSION: 2.26
5018 // Sets the serial for @message.
5019 // <serial>: A #guint32.
5020 void set_serial()(uint serial) {
5021 g_dbus_message_set_serial(&this, serial);
5024 // VERSION: 2.26
5025 // Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field.
5026 // <value>: The value to set.
5027 void set_signature()(char* value) {
5028 g_dbus_message_set_signature(&this, value);
5031 // VERSION: 2.26
5032 // Sets the UNIX file descriptors associated with @message. As a
5033 // side-effect the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header
5034 // field is set to the number of fds in @fd_list (or cleared if
5035 // @fd_list is %NULL).
5037 // This method is only available on UNIX.
5038 // <fd_list>: A #GUnixFDList or %NULL.
5039 void set_unix_fd_list()(UnixFDList* fd_list=null) {
5040 g_dbus_message_set_unix_fd_list(&this, fd_list);
5043 // VERSION: 2.26
5044 // Serializes @message to a blob. The byte order returned by
5045 // g_dbus_message_get_byte_order() will be used.
5047 // generated by @message or %NULL if @error is set. Free with g_free().
5048 // RETURNS: A pointer to a valid binary D-Bus message of @out_size bytes
5049 // <out_size>: Return location for size of generated blob.
5050 // <capabilities>: A #GDBusCapabilityFlags describing what protocol features are supported.
5051 ubyte* to_blob()(size_t* out_size, DBusCapabilityFlags capabilities, GLib2.Error** error=null) {
5052 return g_dbus_message_to_blob(&this, out_size, capabilities, error);
5055 // VERSION: 2.26
5056 // If @message is not of type %G_DBUS_MESSAGE_TYPE_ERROR does
5057 // nothing and returns %FALSE.
5059 // Otherwise this method encodes the error in @message as a #GError
5060 // using g_dbus_error_set_dbus_error() using the information in the
5061 // %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field of @message as
5062 // well as the first string item in @message's body.
5063 // RETURNS: %TRUE if @error was set, %FALSE otherwise.
5064 int to_gerror()(GLib2.Error** error=null) {
5065 return g_dbus_message_to_gerror(&this, error);
5069 // Enumeration used to describe the byte order of a D-Bus message.
5070 enum DBusMessageByteOrder /* Version 2.26 */ {
5071 BIG_ENDIAN = 66,
5072 LITTLE_ENDIAN = 108
5075 // VERSION: 2.26
5076 // Signature for function used in g_dbus_connection_add_filter().
5078 // A filter function is passed a #GDBusMessage and expected to return
5079 // a #GDBusMessage too. Passive filter functions that don't modify the
5080 // message can simply return the @message object:
5081 // |[
5082 // static GDBusMessage *
5083 // passive_filter (GDBusConnection *connection
5084 // GDBusMessage *message,
5085 // gboolean incoming,
5086 // gpointer user_data)
5087 // {
5088 // /<!-- -->* inspect @message *<!-- -->/
5089 // return message;
5090 // }
5091 // ]|
5092 // Filter functions that wants to drop a message can simply return %NULL:
5093 // |[
5094 // static GDBusMessage *
5095 // drop_filter (GDBusConnection *connection
5096 // GDBusMessage *message,
5097 // gboolean incoming,
5098 // gpointer user_data)
5099 // {
5100 // if (should_drop_message)
5101 // {
5102 // g_object_unref (message);
5103 // message = NULL;
5104 // }
5105 // return message;
5106 // }
5107 // ]|
5108 // Finally, a filter function may modify a message by copying it:
5109 // |[
5110 // static GDBusMessage *
5111 // modifying_filter (GDBusConnection *connection
5112 // GDBusMessage *message,
5113 // gboolean incoming,
5114 // gpointer user_data)
5115 // {
5116 // GDBusMessage *copy;
5117 // GError *error;
5119 // error = NULL;
5120 // copy = g_dbus_message_copy (message, &error);
5121 // /<!-- -->* handle @error being is set *<!-- -->/
5122 // g_object_unref (message);
5124 // /<!-- -->* modify @copy *<!-- -->/
5126 // return copy;
5127 // }
5128 // ]|
5129 // If the returned #GDBusMessage is different from @message and cannot
5130 // be sent on @connection (it could use features, such as file
5131 // descriptors, not compatible with @connection), then a warning is
5132 // logged to <emphasis>standard error</emphasis>. Applications can
5133 // check this ahead of time using g_dbus_message_to_blob() passing a
5134 // #GDBusCapabilityFlags value obtained from @connection.
5136 // g_object_unref() or %NULL to drop the message. Passive filter
5137 // functions can simply return the passed @message object.
5138 // RETURNS: A #GDBusMessage that will be freed with
5139 // <connection>: A #GDBusConnection.
5140 // <message>: A locked #GDBusMessage that the filter function takes ownership of.
5141 // <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.
5142 // <user_data>: User data passed when adding the filter.
5143 extern (C) alias DBusMessage* /*new*/ function (DBusConnection* connection, DBusMessage* message, int incoming, void* user_data) DBusMessageFilterFunction;
5145 // Message flags used in #GDBusMessage.
5146 enum DBusMessageFlags /* Version 2.26 */ {
5147 NONE = 0,
5148 NO_REPLY_EXPECTED = 1,
5149 NO_AUTO_START = 2
5151 // Header fields used in #GDBusMessage.
5152 enum DBusMessageHeaderField /* Version 2.26 */ {
5153 INVALID = 0,
5154 PATH = 1,
5155 INTERFACE = 2,
5156 MEMBER = 3,
5157 ERROR_NAME = 4,
5158 REPLY_SERIAL = 5,
5159 DESTINATION = 6,
5160 SENDER = 7,
5161 SIGNATURE = 8,
5162 NUM_UNIX_FDS = 9
5164 // Message types used in #GDBusMessage.
5165 enum DBusMessageType /* Version 2.26 */ {
5166 INVALID = 0,
5167 METHOD_CALL = 1,
5168 METHOD_RETURN = 2,
5169 ERROR = 3,
5170 SIGNAL = 4
5172 // Information about a method on an D-Bus interface.
5173 struct DBusMethodInfo /* Version 2.26 */ {
5174 int ref_count;
5175 char* name;
5176 DBusArgInfo*[666] in_args, out_args;
5177 DBusAnnotationInfo*[666] annotations;
5180 // VERSION: 2.26
5181 // If @info is statically allocated does nothing. Otherwise increases
5182 // the reference count.
5183 // RETURNS: The same @info.
5184 DBusMethodInfo* /*new*/ ref_()() {
5185 return g_dbus_method_info_ref(&this);
5188 // VERSION: 2.26
5189 // If @info is statically allocated, does nothing. Otherwise decreases
5190 // the reference count of @info. When its reference count drops to 0,
5191 // the memory used is freed.
5192 void unref()() {
5193 g_dbus_method_info_unref(&this);
5198 // Instances of the #GDBusMethodInvocation class are used when
5199 // handling D-Bus method calls. It provides a way to asynchronously
5200 // return results and errors.
5202 // The normal way to obtain a #GDBusMethodInvocation object is to receive
5203 // it as an argument to the handle_method_call() function in a
5204 // #GDBusInterfaceVTable that was passed to g_dbus_connection_register_object().
5205 struct DBusMethodInvocation /* : GObject.Object */ /* Version 2.26 */ {
5206 alias method_parent this;
5207 alias method_parent super_;
5208 alias method_parent object;
5209 GObject2.Object method_parent;
5212 // VERSION: 2.26
5213 // Gets the #GDBusConnection the method was invoked on.
5214 // RETURNS: A #GDBusConnection. Do not free, it is owned by @invocation.
5215 DBusConnection* get_connection()() {
5216 return g_dbus_method_invocation_get_connection(&this);
5219 // VERSION: 2.26
5220 // Gets the name of the D-Bus interface the method was invoked on.
5221 // RETURNS: A string. Do not free, it is owned by @invocation.
5222 char* get_interface_name()() {
5223 return g_dbus_method_invocation_get_interface_name(&this);
5226 // VERSION: 2.26
5227 // Gets the #GDBusMessage for the method invocation. This is useful if
5228 // you need to use low-level protocol features, such as UNIX file
5229 // descriptor passing, that cannot be properly expressed in the
5230 // #GVariant API.
5232 // See <xref linkend="gdbus-server"/> and <xref
5233 // linkend="gdbus-unix-fd-client"/> for an example of how to use this
5234 // low-level API to send and receive UNIX file descriptors.
5235 // RETURNS: #GDBusMessage. Do not free, it is owned by @invocation.
5236 DBusMessage* get_message()() {
5237 return g_dbus_method_invocation_get_message(&this);
5240 // VERSION: 2.26
5241 // Gets information about the method call, if any.
5242 // RETURNS: A #GDBusMethodInfo or %NULL. Do not free, it is owned by @invocation.
5243 DBusMethodInfo* get_method_info()() {
5244 return g_dbus_method_invocation_get_method_info(&this);
5247 // VERSION: 2.26
5248 // Gets the name of the method that was invoked.
5249 // RETURNS: A string. Do not free, it is owned by @invocation.
5250 char* get_method_name()() {
5251 return g_dbus_method_invocation_get_method_name(&this);
5254 // VERSION: 2.26
5255 // Gets the object path the method was invoked on.
5256 // RETURNS: A string. Do not free, it is owned by @invocation.
5257 char* get_object_path()() {
5258 return g_dbus_method_invocation_get_object_path(&this);
5261 // VERSION: 2.26
5262 // Gets the parameters of the method invocation. If there are no input
5263 // parameters then this will return a GVariant with 0 children rather than NULL.
5264 // RETURNS: A #GVariant tuple. Do not unref this because it is owned by @invocation.
5265 GLib2.Variant* get_parameters()() {
5266 return g_dbus_method_invocation_get_parameters(&this);
5269 // VERSION: 2.26
5270 // Gets the bus name that invoked the method.
5271 // RETURNS: A string. Do not free, it is owned by @invocation.
5272 char* get_sender()() {
5273 return g_dbus_method_invocation_get_sender(&this);
5276 // Unintrospectable method: get_user_data() / g_dbus_method_invocation_get_user_data()
5277 // VERSION: 2.26
5278 // Gets the @user_data #gpointer passed to g_dbus_connection_register_object().
5279 // RETURNS: A #gpointer.
5280 void* get_user_data()() {
5281 return g_dbus_method_invocation_get_user_data(&this);
5284 // VERSION: 2.26
5285 // Finishes handling a D-Bus method call by returning an error.
5287 // This method will free @invocation, you cannot use it afterwards.
5288 // <error_name>: A valid D-Bus error name.
5289 // <error_message>: A valid D-Bus error message.
5290 void return_dbus_error()(char* error_name, char* error_message) {
5291 g_dbus_method_invocation_return_dbus_error(&this, error_name, error_message);
5294 // Unintrospectable method: return_error() / g_dbus_method_invocation_return_error()
5295 // VERSION: 2.26
5296 // Finishes handling a D-Bus method call by returning an error.
5298 // See g_dbus_error_encode_gerror() for details about what error name
5299 // will be returned on the wire. In a nutshell, if the given error is
5300 // registered using g_dbus_error_register_error() the name given
5301 // during registration is used. Otherwise, a name of the form
5302 // <literal>org.gtk.GDBus.UnmappedGError.Quark...</literal> is
5303 // used. This provides transparent mapping of #GError between
5304 // applications using GDBus.
5306 // If you are writing an application intended to be portable,
5307 // <emphasis>always</emphasis> register errors with g_dbus_error_register_error()
5308 // or use g_dbus_method_invocation_return_dbus_error().
5310 // This method will free @invocation, you cannot use it afterwards.
5311 // <domain>: A #GQuark for the #GError error domain.
5312 // <code>: The error code.
5313 // <format>: printf()-style format.
5314 /+ Not available -- variadic methods unsupported - use the C function directly.
5315 alias g_dbus_method_invocation_return_error return_error; // Variadic
5318 // VERSION: 2.26
5319 // Like g_dbus_method_invocation_return_error() but without printf()-style formatting.
5321 // This method will free @invocation, you cannot use it afterwards.
5322 // <domain>: A #GQuark for the #GError error domain.
5323 // <code>: The error code.
5324 // <message>: The error message.
5325 void return_error_literal()(GLib2.Quark domain, int code, char* message) {
5326 g_dbus_method_invocation_return_error_literal(&this, domain, code, message);
5329 // Unintrospectable method: return_error_valist() / g_dbus_method_invocation_return_error_valist()
5330 // VERSION: 2.26
5331 // Like g_dbus_method_invocation_return_error() but intended for
5332 // language bindings.
5334 // This method will free @invocation, you cannot use it afterwards.
5335 // <domain>: A #GQuark for the #GError error domain.
5336 // <code>: The error code.
5337 // <format>: printf()-style format.
5338 // <var_args>: #va_list of parameters for @format.
5339 void return_error_valist()(GLib2.Quark domain, int code, char* format, va_list var_args) {
5340 g_dbus_method_invocation_return_error_valist(&this, domain, code, format, var_args);
5343 // VERSION: 2.26
5344 // Like g_dbus_method_invocation_return_error() but takes a #GError
5345 // instead of the error domain, error code and message.
5347 // This method will free @invocation, you cannot use it afterwards.
5348 // <error>: A #GError.
5349 void return_gerror()(GLib2.Error* error) {
5350 g_dbus_method_invocation_return_gerror(&this, error);
5353 // VERSION: 2.26
5354 // Finishes handling a D-Bus method call by returning @parameters.
5355 // If the @parameters GVariant is floating, it is consumed.
5357 // It is an error if @parameters is not of the right format.
5359 // This method will free @invocation, you cannot use it afterwards.
5360 // <parameters>: A #GVariant tuple with out parameters for the method or %NULL if not passing any parameters.
5361 void return_value()(GLib2.Variant* parameters=null) {
5362 g_dbus_method_invocation_return_value(&this, parameters);
5365 // VERSION: 2.30
5366 // Like g_dbus_method_invocation_return_value() but also takes a #GUnixFDList.
5368 // This method is only available on UNIX.
5370 // This method will free @invocation, you cannot use it afterwards.
5371 // <parameters>: A #GVariant tuple with out parameters for the method or %NULL if not passing any parameters.
5372 // <fd_list>: A #GUnixFDList or %NULL.
5373 void return_value_with_unix_fd_list()(GLib2.Variant* parameters=null, UnixFDList* fd_list=null) {
5374 g_dbus_method_invocation_return_value_with_unix_fd_list(&this, parameters, fd_list);
5377 // Unintrospectable method: take_error() / g_dbus_method_invocation_take_error()
5378 // VERSION: 2.30
5379 // Like g_dbus_method_invocation_return_gerror() but takes ownership
5380 // of @error so the caller does not need to free it.
5382 // This method will free @invocation, you cannot use it afterwards.
5383 // <error>: A #GError.
5384 void take_error()(GLib2.Error* error) {
5385 g_dbus_method_invocation_take_error(&this, error);
5389 // Information about nodes in a remote object hierarchy.
5390 struct DBusNodeInfo /* Version 2.26 */ {
5391 int ref_count;
5392 char* path;
5393 DBusInterfaceInfo*[666] interfaces;
5394 DBusNodeInfo*[666] nodes;
5395 DBusAnnotationInfo*[666] annotations;
5398 // VERSION: 2.26
5399 // Parses @xml_data and returns a #GDBusNodeInfo representing the data.
5401 // with g_dbus_node_info_unref().
5402 // RETURNS: A #GDBusNodeInfo structure or %NULL if @error is set. Free
5403 // <xml_data>: Valid D-Bus introspection XML.
5404 static DBusNodeInfo* /*new*/ new_for_xml()(char* xml_data, GLib2.Error** error=null) {
5405 return g_dbus_node_info_new_for_xml(xml_data, error);
5408 // VERSION: 2.26
5409 // Appends an XML representation of @info (and its children) to @string_builder.
5411 // This function is typically used for generating introspection XML documents at run-time for
5412 // handling the <literal>org.freedesktop.DBus.Introspectable.Introspect</literal> method.
5413 // <indent>: Indentation level.
5414 // <string_builder>: A #GString to to append XML data to.
5415 void generate_xml()(uint indent, /*out*/ GLib2.String* string_builder) {
5416 g_dbus_node_info_generate_xml(&this, indent, string_builder);
5419 // VERSION: 2.26
5420 // Looks up information about an interface.
5422 // This cost of this function is O(n) in number of interfaces.
5423 // RETURNS: A #GDBusInterfaceInfo or %NULL if not found. Do not free, it is owned by @info.
5424 // <name>: A D-Bus interface name.
5425 DBusInterfaceInfo* lookup_interface()(char* name) {
5426 return g_dbus_node_info_lookup_interface(&this, name);
5429 // VERSION: 2.26
5430 // If @info is statically allocated does nothing. Otherwise increases
5431 // the reference count.
5432 // RETURNS: The same @info.
5433 DBusNodeInfo* /*new*/ ref_()() {
5434 return g_dbus_node_info_ref(&this);
5437 // VERSION: 2.26
5438 // If @info is statically allocated, does nothing. Otherwise decreases
5439 // the reference count of @info. When its reference count drops to 0,
5440 // the memory used is freed.
5441 void unref()() {
5442 g_dbus_node_info_unref(&this);
5447 // The #GDBusObject type is the base type for D-Bus objects on both
5448 // the service side (see #GDBusObjectSkeleton) and the client side
5449 // (see #GDBusObjectProxy). It is essentially just a container of
5450 // interfaces.
5451 struct DBusObject /* Interface */ {
5452 mixin template __interface__() {
5453 // VERSION: 2.30
5454 // Gets the D-Bus interface with name @interface_name associated with
5455 // @object, if any.
5457 // #GDBusInterface that must be freed with g_object_unref().
5458 // RETURNS: %NULL if not found, otherwise a
5459 // <interface_name>: A D-Bus interface name.
5460 DBusInterface* /*new*/ get_interface()(char* interface_name) {
5461 return g_dbus_object_get_interface(cast(DBusObject*)&this, interface_name);
5464 // VERSION: 2.30
5465 // Gets the D-Bus interfaces associated with @object.
5467 // The returned list must be freed by g_list_free() after each element has been freed
5468 // with g_object_unref().
5469 // RETURNS: A list of #GDBusInterface instances.
5470 GLib2.List* /*new*/ get_interfaces()() {
5471 return g_dbus_object_get_interfaces(cast(DBusObject*)&this);
5474 // VERSION: 2.30
5475 // Gets the object path for @object.
5476 // RETURNS: A string owned by @object. Do not free.
5477 char* get_object_path()() {
5478 return g_dbus_object_get_object_path(cast(DBusObject*)&this);
5481 // VERSION: 2.30
5482 // Emitted when @interface is added to @object.
5483 // <interface>: The #GDBusInterface that was added.
5484 extern (C) alias static void function (DBusObject* this_, DBusInterface* interface_, void* user_data=null) signal_interface_added;
5486 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
5487 return super_.signal_connect!name(cb, data, cf);
5490 ulong signal_connect(string name:"interface-added", CB:signal_interface_added)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
5491 return signal_connect_data!()(&this, cast(char*)"interface-added",
5492 cast(GObject2.Callback)cb, data, null, cf);
5495 // VERSION: 2.30
5496 // Emitted when @interface is removed from @object.
5497 // <interface>: The #GDBusInterface that was removed.
5498 extern (C) alias static void function (DBusObject* this_, DBusInterface* interface_, void* user_data=null) signal_interface_removed;
5499 ulong signal_connect(string name:"interface-removed", CB:signal_interface_removed)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
5500 return signal_connect_data!()(&this, cast(char*)"interface-removed",
5501 cast(GObject2.Callback)cb, data, null, cf);
5504 mixin __interface__;
5507 // Base object type for D-Bus objects.
5508 struct DBusObjectIface /* Version 2.30 */ {
5509 GObject2.TypeInterface parent_iface;
5510 // RETURNS: A string owned by @object. Do not free.
5511 extern (C) char* function (DBusObject* object) get_object_path;
5512 // RETURNS: A list of #GDBusInterface instances.
5513 extern (C) GLib2.List* /*new*/ function (DBusObject* object) get_interfaces;
5515 // RETURNS: %NULL if not found, otherwise a
5516 // <interface_name>: A D-Bus interface name.
5517 extern (C) DBusInterface* /*new*/ function (DBusObject* object, char* interface_name) get_interface;
5518 extern (C) void function (DBusObject* object, DBusInterface* interface_) interface_added;
5519 extern (C) void function (DBusObject* object, DBusInterface* interface_) interface_removed;
5523 // The #GDBusObjectManager type is the base type for service- and
5524 // client-side implementations of the standardized <ulink
5525 // url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">org.freedesktop.DBus.ObjectManager</ulink>
5526 // interface.
5528 // See #GDBusObjectManagerClient for the client-side implementation
5529 // and #GDBusObjectManagerServer for the service-side implementation.
5530 struct DBusObjectManager /* Interface */ {
5531 mixin template __interface__() {
5532 // VERSION: 2.30
5533 // Gets the interface proxy for @interface_name at @object_path, if
5534 // any.
5536 // with g_object_unref().
5537 // RETURNS: A #GDBusInterface instance or %NULL. Free
5538 // <object_path>: Object path to lookup.
5539 // <interface_name>: D-Bus interface name to lookup.
5540 DBusInterface* /*new*/ get_interface()(char* object_path, char* interface_name) {
5541 return g_dbus_object_manager_get_interface(cast(DBusObjectManager*)&this, object_path, interface_name);
5544 // VERSION: 2.30
5545 // Gets the #GDBusObjectProxy at @object_path, if any.
5547 // g_object_unref().
5548 // RETURNS: A #GDBusObject or %NULL. Free with
5549 // <object_path>: Object path to lookup.
5550 DBusObject* /*new*/ get_object()(char* object_path) {
5551 return g_dbus_object_manager_get_object(cast(DBusObjectManager*)&this, object_path);
5554 // VERSION: 2.30
5555 // Gets the object path that @manager is for.
5556 // RETURNS: A string owned by @manager. Do not free.
5557 char* get_object_path()() {
5558 return g_dbus_object_manager_get_object_path(cast(DBusObjectManager*)&this);
5561 // VERSION: 2.30
5562 // Gets all #GDBusObject objects known to @manager.
5564 // #GDBusObject objects. The returned list should be freed with
5565 // g_list_free() after each element has been freed with
5566 // g_object_unref().
5567 // RETURNS: A list of
5568 GLib2.List* /*new*/ get_objects()() {
5569 return g_dbus_object_manager_get_objects(cast(DBusObjectManager*)&this);
5572 // VERSION: 2.30
5573 // Emitted when @interface is added to @object.
5575 // This signal exists purely as a convenience to avoid having to
5576 // connect signals to all objects managed by @manager.
5577 // <object>: The #GDBusObject on which an interface was added.
5578 // <interface>: The #GDBusInterface that was added.
5579 extern (C) alias static void function (DBusObjectManager* this_, DBusObject* object, DBusInterface* interface_, void* user_data=null) signal_interface_added;
5581 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
5582 return super_.signal_connect!name(cb, data, cf);
5585 ulong signal_connect(string name:"interface-added", CB:signal_interface_added)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
5586 return signal_connect_data!()(&this, cast(char*)"interface-added",
5587 cast(GObject2.Callback)cb, data, null, cf);
5590 // VERSION: 2.30
5591 // Emitted when @interface has been removed from @object.
5593 // This signal exists purely as a convenience to avoid having to
5594 // connect signals to all objects managed by @manager.
5595 // <object>: The #GDBusObject on which an interface was removed.
5596 // <interface>: The #GDBusInterface that was removed.
5597 extern (C) alias static void function (DBusObjectManager* this_, DBusObject* object, DBusInterface* interface_, void* user_data=null) signal_interface_removed;
5598 ulong signal_connect(string name:"interface-removed", CB:signal_interface_removed)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
5599 return signal_connect_data!()(&this, cast(char*)"interface-removed",
5600 cast(GObject2.Callback)cb, data, null, cf);
5603 // VERSION: 2.30
5604 // Emitted when @object is added to @manager.
5605 // <object>: The #GDBusObject that was added.
5606 extern (C) alias static void function (DBusObjectManager* this_, DBusObject* object, void* user_data=null) signal_object_added;
5607 ulong signal_connect(string name:"object-added", CB:signal_object_added)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
5608 return signal_connect_data!()(&this, cast(char*)"object-added",
5609 cast(GObject2.Callback)cb, data, null, cf);
5612 // VERSION: 2.30
5613 // Emitted when @object is removed from @manager.
5614 // <object>: The #GDBusObject that was removed.
5615 extern (C) alias static void function (DBusObjectManager* this_, DBusObject* object, void* user_data=null) signal_object_removed;
5616 ulong signal_connect(string name:"object-removed", CB:signal_object_removed)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
5617 return signal_connect_data!()(&this, cast(char*)"object-removed",
5618 cast(GObject2.Callback)cb, data, null, cf);
5621 mixin __interface__;
5625 // #GDBusObjectManagerClient is used to create, monitor and delete object
5626 // proxies for remote objects exported by a #GDBusObjectManagerServer (or any
5627 // code implementing the <ulink
5628 // url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">org.freedesktop.DBus.ObjectManager</ulink>
5629 // interface).
5631 // Once an instance of this type has been created, you can connect to
5632 // the #GDBusObjectManager::object-added and
5633 // #GDBusObjectManager::object-removed signals and inspect the
5634 // #GDBusObjectProxy objects returned by
5635 // g_dbus_object_manager_get_objects().
5637 // If the name for a #GDBusObjectManagerClient is not owned by anyone at
5638 // object construction time, the default behavior is to request the
5639 // message bus to launch an owner for the name. This behavior can be
5640 // disabled using the %G_DBUS_OBJECT_MANAGER_CLIENT_FLAGS_DO_NOT_AUTO_START
5641 // flag. It's also worth noting that this only works if the name of
5642 // interest is activatable in the first place. E.g. in some cases it
5643 // is not possible to launch an owner for the requested name. In this
5644 // case, #GDBusObjectManagerClient object construction still succeeds but
5645 // there will be no object proxies
5646 // (e.g. g_dbus_object_manager_get_objects() returns the empty list) and
5647 // the #GDBusObjectManagerClient:name-owner property is %NULL.
5649 // The owner of the requested name can come and go (for example
5650 // consider a system service being restarted) – #GDBusObjectManagerClient
5651 // handles this case too; simply connect to the #GObject::notify
5652 // signal to watch for changes on the #GDBusObjectManagerClient:name-owner
5653 // property. When the name owner vanishes, the behavior is that
5654 // #GDBusObjectManagerClient:name-owner is set to %NULL (this includes
5655 // emission of the #GObject::notify signal) and then
5656 // #GDBusObjectManager::object-removed signals are synthesized
5657 // for all currently existing object proxies. Since
5658 // #GDBusObjectManagerClient:name-owner is %NULL when this happens, you can
5659 // use this information to disambiguate a synthesized signal from a
5660 // genuine signal caused by object removal on the remote
5661 // #GDBusObjectManager. Similarly, when a new name owner appears,
5662 // #GDBusObjectManager::object-added signals are synthesized
5663 // while #GDBusObjectManagerClient:name-owner is still %NULL. Only when all
5664 // object proxies have been added, the #GDBusObjectManagerClient:name-owner
5665 // is set to the new name owner (this includes emission of the
5666 // #GObject::notify signal). Furthermore, you are guaranteed that
5667 // #GDBusObjectManagerClient:name-owner will alternate between a name owner
5668 // (e.g. <literal>:1.42</literal>) and %NULL even in the case where
5669 // the name of interest is atomically replaced
5671 // Ultimately, #GDBusObjectManagerClient is used to obtain #GDBusProxy
5672 // instances. All signals (including the
5673 // <literal>org.freedesktop.DBus.Properties::PropertiesChanged</literal>
5674 // signal) delivered to #GDBusProxy instances are guaranteed to
5675 // originate from the name owner. This guarantee along with the
5676 // behavior described above, means that certain race conditions
5677 // including the <emphasis><quote>half the proxy is from the old owner
5678 // and the other half is from the new owner</quote></emphasis> problem
5679 // cannot happen.
5681 // To avoid having the application connect to signals on the returned
5682 // #GDBusObjectProxy and #GDBusProxy objects, the
5683 // #GDBusObject::interface-added,
5684 // #GDBusObject::interface-removed,
5685 // #GDBusProxy::g-properties-changed and
5686 // #GDBusProxy::g-signal signals
5687 // are also emitted on the #GDBusObjectManagerClient instance managing these
5688 // objects. The signals emitted are
5689 // #GDBusObjectManager::interface-added,
5690 // #GDBusObjectManager::interface-removed,
5691 // #GDBusObjectManagerClient::interface-proxy-properties-changed and
5692 // #GDBusObjectManagerClient::interface-proxy-signal.
5694 // Note that all callbacks and signals are emitted in the
5695 // <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
5696 // that the #GDBusObjectManagerClient object was constructed
5697 // in. Additionally, the #GDBusObjectProxy and #GDBusProxy objects
5698 // originating from the #GDBusObjectManagerClient object will be created in
5699 // the same context and, consequently, will deliver signals in the
5700 // same main loop.
5701 struct DBusObjectManagerClient /* : GObject.Object */ /* Version 2.30 */ {
5702 mixin AsyncInitable.__interface__;
5703 mixin DBusObjectManager.__interface__;
5704 mixin Initable.__interface__;
5705 alias parent_instance this;
5706 alias parent_instance super_;
5707 alias parent_instance object;
5708 GObject2.Object parent_instance;
5709 private DBusObjectManagerClientPrivate* priv;
5712 // VERSION: 2.30
5713 // Finishes an operation started with g_dbus_object_manager_client_new().
5715 // #GDBusObjectManagerClient object or %NULL if @error is set. Free
5716 // with g_object_unref().
5717 // RETURNS: A
5718 // <res>: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_object_manager_client_new().
5719 static DBusObjectManagerClient* /*new*/ new_finish()(AsyncResult* res, GLib2.Error** error=null) {
5720 return g_dbus_object_manager_client_new_finish(res, error);
5723 // VERSION: 2.30
5724 // Finishes an operation started with g_dbus_object_manager_client_new_for_bus().
5726 // #GDBusObjectManagerClient object or %NULL if @error is set. Free
5727 // with g_object_unref().
5728 // RETURNS: A
5729 // <res>: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_object_manager_client_new_for_bus().
5730 static DBusObjectManagerClient* /*new*/ new_for_bus_finish()(AsyncResult* res, GLib2.Error** error=null) {
5731 return g_dbus_object_manager_client_new_for_bus_finish(res, error);
5734 // VERSION: 2.30
5735 // Like g_dbus_object_manager_client_new_sync() but takes a #GBusType instead
5736 // of a #GDBusConnection.
5738 // This is a synchronous failable constructor - the calling thread is
5739 // blocked until a reply is received. See g_dbus_object_manager_client_new_for_bus()
5740 // for the asynchronous version.
5742 // #GDBusObjectManagerClient object or %NULL if @error is set. Free
5743 // with g_object_unref().
5744 // RETURNS: A
5745 // <bus_type>: A #GBusType.
5746 // <flags>: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
5747 // <name>: The owner of the control object (unique or well-known name).
5748 // <object_path>: The object path of the control object.
5749 // <get_proxy_type_func>: A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
5750 // <get_proxy_type_user_data>: User data to pass to @get_proxy_type_func.
5751 // <get_proxy_type_destroy_notify>: Free function for @get_proxy_type_user_data or %NULL.
5752 // <cancellable>: A #GCancellable or %NULL
5753 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) {
5754 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);
5757 // VERSION: 2.30
5758 // Creates a new #GDBusObjectManagerClient object.
5760 // This is a synchronous failable constructor - the calling thread is
5761 // blocked until a reply is received. See g_dbus_object_manager_client_new()
5762 // for the asynchronous version.
5764 // #GDBusObjectManagerClient object or %NULL if @error is set. Free
5765 // with g_object_unref().
5766 // RETURNS: A
5767 // <connection>: A #GDBusConnection.
5768 // <flags>: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
5769 // <name>: The owner of the control object (unique or well-known name).
5770 // <object_path>: The object path of the control object.
5771 // <get_proxy_type_func>: A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
5772 // <get_proxy_type_user_data>: User data to pass to @get_proxy_type_func.
5773 // <get_proxy_type_destroy_notify>: Free function for @get_proxy_type_user_data or %NULL.
5774 // <cancellable>: A #GCancellable or %NULL
5775 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) {
5776 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);
5779 // VERSION: 2.30
5780 // Asynchronously creates a new #GDBusObjectManagerClient object.
5782 // This is an asynchronous failable constructor. When the result is
5783 // ready, @callback will be invoked in the
5784 // <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
5785 // of the thread you are calling this method from. You can
5786 // then call g_dbus_object_manager_client_new_finish() to get the result. See
5787 // g_dbus_object_manager_client_new_sync() for the synchronous version.
5788 // <connection>: A #GDBusConnection.
5789 // <flags>: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
5790 // <name>: The owner of the control object (unique or well-known name).
5791 // <object_path>: The object path of the control object.
5792 // <get_proxy_type_func>: A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
5793 // <get_proxy_type_user_data>: User data to pass to @get_proxy_type_func.
5794 // <get_proxy_type_destroy_notify>: Free function for @get_proxy_type_user_data or %NULL.
5795 // <cancellable>: A #GCancellable or %NULL
5796 // <callback>: A #GAsyncReadyCallback to call when the request is satisfied.
5797 // <user_data>: The data to pass to @callback.
5798 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) {
5799 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);
5802 // VERSION: 2.30
5803 // Like g_dbus_object_manager_client_new() but takes a #GBusType instead of a
5804 // #GDBusConnection.
5806 // This is an asynchronous failable constructor. When the result is
5807 // ready, @callback will be invoked in the
5808 // <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
5809 // of the thread you are calling this method from. You can
5810 // then call g_dbus_object_manager_client_new_for_bus_finish() to get the result. See
5811 // g_dbus_object_manager_client_new_for_bus_sync() for the synchronous version.
5812 // <bus_type>: A #GBusType.
5813 // <flags>: Zero or more flags from the #GDBusObjectManagerClientFlags enumeration.
5814 // <name>: The owner of the control object (unique or well-known name).
5815 // <object_path>: The object path of the control object.
5816 // <get_proxy_type_func>: A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies.
5817 // <get_proxy_type_user_data>: User data to pass to @get_proxy_type_func.
5818 // <get_proxy_type_destroy_notify>: Free function for @get_proxy_type_user_data or %NULL.
5819 // <cancellable>: A #GCancellable or %NULL
5820 // <callback>: A #GAsyncReadyCallback to call when the request is satisfied.
5821 // <user_data>: The data to pass to @callback.
5822 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) {
5823 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);
5826 // VERSION: 2.30
5827 // Gets the #GDBusConnection used by @manager.
5829 // the object belongs to @manager.
5830 // RETURNS: A #GDBusConnection object. Do not free,
5831 DBusConnection* get_connection()() {
5832 return g_dbus_object_manager_client_get_connection(&this);
5835 // VERSION: 2.30
5836 // Gets the flags that @manager was constructed with.
5838 // enumeration.
5839 // RETURNS: Zero of more flags from the #GDBusObjectManagerClientFlags
5840 DBusObjectManagerClientFlags get_flags()() {
5841 return g_dbus_object_manager_client_get_flags(&this);
5844 // VERSION: 2.30
5845 // Gets the name that @manager is for.
5847 // belongs to @manager.
5848 // RETURNS: A unique or well-known name. Do not free, the string
5849 char* get_name()() {
5850 return g_dbus_object_manager_client_get_name(&this);
5853 // VERSION: 2.30
5854 // The unique name that owns the name that @manager is for or %NULL if
5855 // no-one currently owns that name. You can connect to the
5856 // #GObject::notify signal to track changes to the
5857 // #GDBusObjectManagerClient:name-owner property.
5859 // g_free().
5860 // RETURNS: The name owner or %NULL if no name owner exists. Free with
5861 char* /*new*/ get_name_owner()() {
5862 return g_dbus_object_manager_client_get_name_owner(&this);
5865 // VERSION: 2.30
5866 // Emitted when one or more D-Bus properties on proxy changes. The
5867 // local cache has already been updated when this signal fires. Note
5868 // that both @changed_properties and @invalidated_properties are
5869 // guaranteed to never be %NULL (either may be empty though).
5871 // This signal exists purely as a convenience to avoid having to
5872 // connect signals to all interface proxies managed by @manager.
5874 // This signal is emitted in the
5875 // <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
5876 // that @manager was constructed in.
5877 // <object_proxy>: The #GDBusObjectProxy on which an interface has properties that are changing.
5878 // <interface_proxy>: The #GDBusProxy that has properties that are changing.
5879 // <changed_properties>: A #GVariant containing the properties that changed.
5880 // <invalidated_properties>: A %NULL terminated array of properties that was invalidated.
5881 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;
5883 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
5884 return super_.signal_connect!name(cb, data, cf);
5887 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) {
5888 return signal_connect_data!()(&this, cast(char*)"interface-proxy-properties-changed",
5889 cast(GObject2.Callback)cb, data, null, cf);
5892 // VERSION: 2.30
5893 // Emitted when a D-Bus signal is received on @interface_proxy.
5895 // This signal exists purely as a convenience to avoid having to
5896 // connect signals to all interface proxies managed by @manager.
5898 // This signal is emitted in the
5899 // <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
5900 // that @manager was constructed in.
5901 // <object_proxy>: The #GDBusObjectProxy on which an interface is emitting a D-Bus signal.
5902 // <interface_proxy>: The #GDBusProxy that is emitting a D-Bus signal.
5903 // <sender_name>: The sender of the signal or NULL if the connection is not a bus connection.
5904 // <signal_name>: The signal name.
5905 // <parameters>: A #GVariant tuple with parameters for the signal.
5906 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;
5907 ulong signal_connect(string name:"interface-proxy-signal", CB:signal_interface_proxy_signal)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
5908 return signal_connect_data!()(&this, cast(char*)"interface-proxy-signal",
5909 cast(GObject2.Callback)cb, data, null, cf);
5913 // Class structure for #GDBusObjectManagerClient.
5914 struct DBusObjectManagerClientClass /* Version 2.30 */ {
5915 GObject2.ObjectClass parent_class;
5916 extern (C) void function (DBusObjectManagerClient* manager, DBusObjectProxy* object_proxy, DBusProxy* interface_proxy, char* sender_name, char* signal_name, GLib2.Variant* parameters) interface_proxy_signal;
5917 extern (C) void function (DBusObjectManagerClient* manager, DBusObjectProxy* object_proxy, DBusProxy* interface_proxy, GLib2.Variant* changed_properties, char** invalidated_properties) interface_proxy_properties_changed;
5918 private void*[8] padding;
5921 // Flags used when constructing a #GDBusObjectManagerClient.
5922 enum DBusObjectManagerClientFlags /* Version 2.30 */ {
5923 NONE = 0,
5924 DO_NOT_AUTO_START = 1
5926 struct DBusObjectManagerClientPrivate {
5929 // Base type for D-Bus object managers.
5930 struct DBusObjectManagerIface /* Version 2.30 */ {
5931 GObject2.TypeInterface parent_iface;
5932 // RETURNS: A string owned by @manager. Do not free.
5933 extern (C) char* function (DBusObjectManager* manager) get_object_path;
5934 // RETURNS: A list of
5935 extern (C) GLib2.List* /*new*/ function (DBusObjectManager* manager) get_objects;
5937 // RETURNS: A #GDBusObject or %NULL. Free with
5938 // <object_path>: Object path to lookup.
5939 extern (C) DBusObject* /*new*/ function (DBusObjectManager* manager, char* object_path) get_object;
5941 // RETURNS: A #GDBusInterface instance or %NULL. Free
5942 // <object_path>: Object path to lookup.
5943 // <interface_name>: D-Bus interface name to lookup.
5944 extern (C) DBusInterface* /*new*/ function (DBusObjectManager* manager, char* object_path, char* interface_name) get_interface;
5945 extern (C) void function (DBusObjectManager* manager, DBusObject* object) object_added;
5946 extern (C) void function (DBusObjectManager* manager, DBusObject* object) object_removed;
5947 extern (C) void function (DBusObjectManager* manager, DBusObject* object, DBusInterface* interface_) interface_added;
5948 extern (C) void function (DBusObjectManager* manager, DBusObject* object, DBusInterface* interface_) interface_removed;
5952 // #GDBusObjectManagerServer is used to export #GDBusObject instances using
5953 // the standardized <ulink
5954 // url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">org.freedesktop.DBus.ObjectManager</ulink>
5955 // interface. For example, remote D-Bus clients can get all objects
5956 // and properties in a single call. Additionally, any change in the
5957 // object hierarchy is broadcast using signals. This means that D-Bus
5958 // clients can keep caches up to date by only listening to D-Bus
5959 // signals.
5961 // See #GDBusObjectManagerClient for the client-side code that is
5962 // intended to be used with #GDBusObjectManagerServer or any D-Bus
5963 // object implementing the org.freedesktop.DBus.ObjectManager
5964 // interface.
5965 struct DBusObjectManagerServer /* : GObject.Object */ /* Version 2.30 */ {
5966 mixin DBusObjectManager.__interface__;
5967 alias parent_instance this;
5968 alias parent_instance super_;
5969 alias parent_instance object;
5970 GObject2.Object parent_instance;
5971 private DBusObjectManagerServerPrivate* priv;
5974 // VERSION: 2.30
5975 // Creates a new #GDBusObjectManagerServer object.
5977 // The returned server isn't yet exported on any connection. To do so,
5978 // use g_dbus_object_manager_server_set_connection(). Normally you
5979 // want to export all of your objects before doing so to avoid <ulink
5980 // url="http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager">InterfacesAdded</ulink>
5981 // signals being emitted.
5982 // RETURNS: A #GDBusObjectManagerServer object. Free with g_object_unref().
5983 // <object_path>: The object path to export the manager object at.
5984 static DBusObjectManagerServer* /*new*/ new_()(char* object_path) {
5985 return g_dbus_object_manager_server_new(object_path);
5988 // VERSION: 2.30
5989 // Exports @object on @manager.
5991 // If there is already a #GDBusObject exported at the object path,
5992 // then the old object is removed.
5994 // The object path for @object must be in the hierarchy rooted by the
5995 // object path for @manager.
5997 // Note that @manager will take a reference on @object for as long as
5998 // it is exported.
5999 // <object>: A #GDBusObjectSkeleton.
6000 void export_()(DBusObjectSkeleton* object) {
6001 g_dbus_object_manager_server_export(&this, object);
6004 // VERSION: 2.30
6005 // Like g_dbus_object_manager_server_export() but appends a string of
6006 // the form <literal>_N</literal> (with N being a natural number) to
6007 // @object<!-- -->'s object path if an object with the given path
6008 // already exists. As such, the #GDBusObjectProxy:object-path property
6009 // of @object may be modified.
6010 // <object>: An object.
6011 void export_uniquely()(DBusObjectSkeleton* object) {
6012 g_dbus_object_manager_server_export_uniquely(&this, object);
6015 // VERSION: 2.30
6016 // Gets the #GDBusConnection used by @manager.
6018 // @manager isn't exported on a connection. The returned object should
6019 // be freed with g_object_unref().
6020 // RETURNS: A #GDBusConnection object or %NULL if
6021 DBusConnection* /*new*/ get_connection()() {
6022 return g_dbus_object_manager_server_get_connection(&this);
6025 // Exports all objects managed by @manager on @connection. If
6026 // @connection is %NULL, stops exporting objects.
6027 // <connection>: A #GDBusConnection or %NULL.
6028 void set_connection()(DBusConnection* connection=null) {
6029 g_dbus_object_manager_server_set_connection(&this, connection);
6032 // VERSION: 2.30
6033 // If @manager has an object at @path, removes the object. Otherwise
6034 // does nothing.
6036 // Note that @object_path must be in the hierarchy rooted by the
6037 // object path for @manager.
6038 // RETURNS: %TRUE if object at @object_path was removed, %FALSE otherwise.
6039 // <object_path>: An object path.
6040 int unexport()(char* object_path) {
6041 return g_dbus_object_manager_server_unexport(&this, object_path);
6045 // Class structure for #GDBusObjectManagerServer.
6046 struct DBusObjectManagerServerClass /* Version 2.30 */ {
6047 GObject2.ObjectClass parent_class;
6048 private void*[8] padding;
6051 struct DBusObjectManagerServerPrivate {
6055 // A #GDBusObjectProxy is an object used to represent a remote object
6056 // with one or more D-Bus interfaces. Normally, you don't instantiate
6057 // a #GDBusObjectProxy yourself - typically #GDBusObjectManagerClient
6058 // is used to obtain it.
6059 struct DBusObjectProxy /* : GObject.Object */ /* Version 2.30 */ {
6060 mixin DBusObject.__interface__;
6061 alias parent_instance this;
6062 alias parent_instance super_;
6063 alias parent_instance object;
6064 GObject2.Object parent_instance;
6065 private DBusObjectProxyPrivate* priv;
6068 // VERSION: 2.30
6069 // Creates a new #GDBusObjectProxy for the given connection and
6070 // object path.
6071 // RETURNS: a new #GDBusObjectProxy
6072 // <connection>: a #GDBusConnection
6073 // <object_path>: the object path
6074 static DBusObjectProxy* /*new*/ new_()(DBusConnection* connection, char* object_path) {
6075 return g_dbus_object_proxy_new(connection, object_path);
6078 // VERSION: 2.30
6079 // Gets the connection that @proxy is for.
6081 // object is owned by @proxy.
6082 // RETURNS: A #GDBusConnection. Do not free, the
6083 DBusConnection* get_connection()() {
6084 return g_dbus_object_proxy_get_connection(&this);
6088 // Class structure for #GDBusObjectProxy.
6089 struct DBusObjectProxyClass /* Version 2.30 */ {
6090 GObject2.ObjectClass parent_class;
6091 private void*[8] padding;
6094 struct DBusObjectProxyPrivate {
6098 // A #GDBusObjectSkeleton instance is essentially a group of D-Bus
6099 // interfaces. The set of exported interfaces on the object may be
6100 // dynamic and change at runtime.
6102 // This type is intended to be used with #GDBusObjectManager.
6103 struct DBusObjectSkeleton /* : GObject.Object */ /* Version 2.30 */ {
6104 mixin DBusObject.__interface__;
6105 alias parent_instance this;
6106 alias parent_instance super_;
6107 alias parent_instance object;
6108 GObject2.Object parent_instance;
6109 private DBusObjectSkeletonPrivate* priv;
6112 // VERSION: 2.30
6113 // Creates a new #GDBusObjectSkeleton.
6114 // RETURNS: A #GDBusObjectSkeleton. Free with g_object_unref().
6115 // <object_path>: An object path.
6116 static DBusObjectSkeleton* /*new*/ new_()(char* object_path) {
6117 return g_dbus_object_skeleton_new(object_path);
6120 // VERSION: 2.30
6121 // Adds @interface_ to @object.
6123 // If @object already contains a #GDBusInterfaceSkeleton with the same
6124 // interface name, it is removed before @interface_ is added.
6126 // Note that @object takes its own reference on @interface_ and holds
6127 // it until removed.
6128 // <interface_>: A #GDBusInterfaceSkeleton.
6129 void add_interface()(DBusInterfaceSkeleton* interface_) {
6130 g_dbus_object_skeleton_add_interface(&this, interface_);
6133 // VERSION: 2.30
6134 // This method simply calls g_dbus_interface_skeleton_flush() on all
6135 // interfaces belonging to @object. See that method for when flushing
6136 // is useful.
6137 void flush()() {
6138 g_dbus_object_skeleton_flush(&this);
6141 // VERSION: 2.30
6142 // Removes @interface_ from @object.
6143 // <interface_>: A #GDBusInterfaceSkeleton.
6144 void remove_interface()(DBusInterfaceSkeleton* interface_) {
6145 g_dbus_object_skeleton_remove_interface(&this, interface_);
6148 // VERSION: 2.30
6149 // Removes the #GDBusInterface with @interface_name from @object.
6151 // If no D-Bus interface of the given interface exists, this function
6152 // does nothing.
6153 // <interface_name>: A D-Bus interface name.
6154 void remove_interface_by_name()(char* interface_name) {
6155 g_dbus_object_skeleton_remove_interface_by_name(&this, interface_name);
6158 // VERSION: 2.30
6159 // Sets the object path for @object.
6160 // <object_path>: A valid D-Bus object path.
6161 void set_object_path()(char* object_path) {
6162 g_dbus_object_skeleton_set_object_path(&this, object_path);
6165 // VERSION: 2.30
6166 // Emitted when a method is invoked by a remote caller and used to
6167 // determine if the method call is authorized.
6169 // This signal is like #GDBusInterfaceSkeleton<!-- -->'s
6170 // #GDBusInterfaceSkeleton::g-authorize-method signal, except that it is
6171 // for the enclosing object.
6173 // The default class handler just returns %TRUE.
6174 // RETURNS: %TRUE if the call is authorized, %FALSE otherwise.
6175 // <interface>: The #GDBusInterfaceSkeleton that @invocation is for.
6176 // <invocation>: A #GDBusMethodInvocation.
6177 extern (C) alias static c_int function (DBusObjectSkeleton* this_, DBusInterfaceSkeleton* interface_, DBusMethodInvocation* invocation, void* user_data=null) signal_authorize_method;
6179 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
6180 return super_.signal_connect!name(cb, data, cf);
6183 ulong signal_connect(string name:"authorize-method", CB:signal_authorize_method)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
6184 return signal_connect_data!()(&this, cast(char*)"authorize-method",
6185 cast(GObject2.Callback)cb, data, null, cf);
6189 // Class structure for #GDBusObjectSkeleton.
6190 struct DBusObjectSkeletonClass /* Version 2.30 */ {
6191 GObject2.ObjectClass parent_class;
6192 extern (C) int function (DBusObjectSkeleton* object, DBusInterfaceSkeleton* interface_, DBusMethodInvocation* invocation) authorize_method;
6193 private void*[8] padding;
6196 struct DBusObjectSkeletonPrivate {
6199 // Information about a D-Bus property on a D-Bus interface.
6200 struct DBusPropertyInfo /* Version 2.26 */ {
6201 int ref_count;
6202 char* name, signature;
6203 DBusPropertyInfoFlags flags;
6204 DBusAnnotationInfo*[666] annotations;
6207 // VERSION: 2.26
6208 // If @info is statically allocated does nothing. Otherwise increases
6209 // the reference count.
6210 // RETURNS: The same @info.
6211 DBusPropertyInfo* /*new*/ ref_()() {
6212 return g_dbus_property_info_ref(&this);
6215 // VERSION: 2.26
6216 // If @info is statically allocated, does nothing. Otherwise decreases
6217 // the reference count of @info. When its reference count drops to 0,
6218 // the memory used is freed.
6219 void unref()() {
6220 g_dbus_property_info_unref(&this);
6224 // Flags describing the access control of a D-Bus property.
6225 enum DBusPropertyInfoFlags /* Version 2.26 */ {
6226 NONE = 0,
6227 READABLE = 1,
6228 WRITABLE = 2
6231 // #GDBusProxy is a base class used for proxies to access a D-Bus
6232 // interface on a remote object. A #GDBusProxy can be constructed for
6233 // both well-known and unique names.
6235 // By default, #GDBusProxy will cache all properties (and listen to
6236 // changes) of the remote object, and proxy all signals that gets
6237 // emitted. This behaviour can be changed by passing suitable
6238 // #GDBusProxyFlags when the proxy is created. If the proxy is for a
6239 // well-known name, the property cache is flushed when the name owner
6240 // vanishes and reloaded when a name owner appears.
6242 // If a #GDBusProxy is used for a well-known name, the owner of the
6243 // name is tracked and can be read from
6244 // #GDBusProxy:g-name-owner. Connect to the #GObject::notify signal to
6245 // get notified of changes. Additionally, only signals and property
6246 // changes emitted from the current name owner are considered and
6247 // calls are always sent to the current name owner. This avoids a
6248 // number of race conditions when the name is lost by one owner and
6249 // claimed by another. However, if no name owner currently exists,
6250 // then calls will be sent to the well-known name which may result in
6251 // the message bus launching an owner (unless
6252 // %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START is set).
6254 // The generic #GDBusProxy::g-properties-changed and
6255 // #GDBusProxy::g-signal signals are not very convenient to work
6256 // with. Therefore, the recommended way of working with proxies is to
6257 // subclass #GDBusProxy, and have more natural properties and signals
6258 // in your derived class. See <xref linkend="gdbus-example-gdbus-codegen"/>
6259 // for how this can easily be done using the
6260 // <command><link linkend="gdbus-codegen">gdbus-codegen</link></command>
6261 // tool.
6263 // A #GDBusProxy instance can be used from multiple threads but note
6264 // that all signals (e.g. #GDBusProxy::g-signal, #GDBusProxy::g-properties-changed
6265 // and #GObject::notify) are emitted in the
6266 // <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
6267 // of the thread where the instance was constructed.
6269 // <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>
6270 struct DBusProxy /* : GObject.Object */ /* Version 2.26 */ {
6271 mixin AsyncInitable.__interface__;
6272 mixin DBusInterface.__interface__;
6273 mixin Initable.__interface__;
6274 alias parent_instance this;
6275 alias parent_instance super_;
6276 alias parent_instance object;
6277 GObject2.Object parent_instance;
6278 private DBusProxyPrivate* priv;
6281 // VERSION: 2.26
6282 // Finishes creating a #GDBusProxy.
6283 // RETURNS: A #GDBusProxy or %NULL if @error is set. Free with g_object_unref().
6284 // <res>: A #GAsyncResult obtained from the #GAsyncReadyCallback function passed to g_dbus_proxy_new().
6285 static DBusProxy* /*new*/ new_finish()(AsyncResult* res, GLib2.Error** error=null) {
6286 return g_dbus_proxy_new_finish(res, error);
6289 // VERSION: 2.26
6290 // Finishes creating a #GDBusProxy.
6291 // RETURNS: A #GDBusProxy or %NULL if @error is set. Free with g_object_unref().
6292 // <res>: A #GAsyncResult obtained from the #GAsyncReadyCallback function passed to g_dbus_proxy_new_for_bus().
6293 static DBusProxy* /*new*/ new_for_bus_finish()(AsyncResult* res, GLib2.Error** error=null) {
6294 return g_dbus_proxy_new_for_bus_finish(res, error);
6297 // VERSION: 2.26
6298 // Like g_dbus_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
6300 // See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
6301 // RETURNS: A #GDBusProxy or %NULL if error is set. Free with g_object_unref().
6302 // <bus_type>: A #GBusType.
6303 // <flags>: Flags used when constructing the proxy.
6304 // <info>: A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
6305 // <name>: A bus name (well-known or unique).
6306 // <object_path>: An object path.
6307 // <interface_name>: A D-Bus interface name.
6308 // <cancellable>: A #GCancellable or %NULL.
6309 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) {
6310 return g_dbus_proxy_new_for_bus_sync(bus_type, flags, info, name, object_path, interface_name, cancellable, error);
6313 // VERSION: 2.26
6314 // Creates a proxy for accessing @interface_name on the remote object
6315 // at @object_path owned by @name at @connection and synchronously
6316 // loads D-Bus properties unless the
6317 // %G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES flag is used.
6319 // If the %G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS flag is not set, also sets up
6320 // match rules for signals. Connect to the #GDBusProxy::g-signal signal
6321 // to handle signals from the remote object.
6323 // If @name is a well-known name and the
6324 // %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START flag isn't set and no name
6325 // owner currently exists, the message bus will be requested to launch
6326 // a name owner for the name.
6328 // This is a synchronous failable constructor. See g_dbus_proxy_new()
6329 // and g_dbus_proxy_new_finish() for the asynchronous version.
6331 // See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
6332 // RETURNS: A #GDBusProxy or %NULL if error is set. Free with g_object_unref().
6333 // <connection>: A #GDBusConnection.
6334 // <flags>: Flags used when constructing the proxy.
6335 // <info>: A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
6336 // <name>: A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
6337 // <object_path>: An object path.
6338 // <interface_name>: A D-Bus interface name.
6339 // <cancellable>: A #GCancellable or %NULL.
6340 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) {
6341 return g_dbus_proxy_new_sync(connection, flags, info, name, object_path, interface_name, cancellable, error);
6344 // VERSION: 2.26
6345 // Creates a proxy for accessing @interface_name on the remote object
6346 // at @object_path owned by @name at @connection and asynchronously
6347 // loads D-Bus properties unless the
6348 // %G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES flag is used. Connect to
6349 // the #GDBusProxy::g-properties-changed signal to get notified about
6350 // property changes.
6352 // If the %G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS flag is not set, also sets up
6353 // match rules for signals. Connect to the #GDBusProxy::g-signal signal
6354 // to handle signals from the remote object.
6356 // If @name is a well-known name and the
6357 // %G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START flag isn't set and no name
6358 // owner currently exists, the message bus will be requested to launch
6359 // a name owner for the name.
6361 // This is a failable asynchronous constructor - when the proxy is
6362 // ready, @callback will be invoked and you can use
6363 // g_dbus_proxy_new_finish() to get the result.
6365 // See g_dbus_proxy_new_sync() and for a synchronous version of this constructor.
6367 // See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
6368 // <connection>: A #GDBusConnection.
6369 // <flags>: Flags used when constructing the proxy.
6370 // <info>: A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
6371 // <name>: A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
6372 // <object_path>: An object path.
6373 // <interface_name>: A D-Bus interface name.
6374 // <cancellable>: A #GCancellable or %NULL.
6375 // <callback>: Callback function to invoke when the proxy is ready.
6376 // <user_data>: User data to pass to @callback.
6377 static void new_()(DBusConnection* connection, DBusProxyFlags flags, DBusInterfaceInfo* info, char* name, char* object_path, char* interface_name, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
6378 g_dbus_proxy_new(connection, flags, info, name, object_path, interface_name, cancellable, callback, user_data);
6381 // VERSION: 2.26
6382 // Like g_dbus_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
6384 // See <xref linkend="gdbus-wellknown-proxy"/> for an example of how #GDBusProxy can be used.
6385 // <bus_type>: A #GBusType.
6386 // <flags>: Flags used when constructing the proxy.
6387 // <info>: A #GDBusInterfaceInfo specifying the minimal interface that @proxy conforms to or %NULL.
6388 // <name>: A bus name (well-known or unique).
6389 // <object_path>: An object path.
6390 // <interface_name>: A D-Bus interface name.
6391 // <cancellable>: A #GCancellable or %NULL.
6392 // <callback>: Callback function to invoke when the proxy is ready.
6393 // <user_data>: User data to pass to @callback.
6394 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) {
6395 g_dbus_proxy_new_for_bus(bus_type, flags, info, name, object_path, interface_name, cancellable, callback, user_data);
6398 // VERSION: 2.26
6399 // Asynchronously invokes the @method_name method on @proxy.
6401 // If @method_name contains any dots, then @name is split into interface and
6402 // method name parts. This allows using @proxy for invoking methods on
6403 // other interfaces.
6405 // If the #GDBusConnection associated with @proxy is closed then
6406 // the operation will fail with %G_IO_ERROR_CLOSED. If
6407 // @cancellable is canceled, the operation will fail with
6408 // %G_IO_ERROR_CANCELLED. If @parameters contains a value not
6409 // compatible with the D-Bus protocol, the operation fails with
6410 // %G_IO_ERROR_INVALID_ARGUMENT.
6412 // If the @parameters #GVariant is floating, it is consumed. This allows
6413 // convenient 'inline' use of g_variant_new(), e.g.:
6414 // |[
6415 // g_dbus_proxy_call (proxy,
6416 // "TwoStrings",
6417 // g_variant_new ("(ss)",
6418 // "Thing One",
6419 // "Thing Two"),
6420 // G_DBUS_CALL_FLAGS_NONE,
6421 // -1,
6422 // NULL,
6423 // (GAsyncReadyCallback) two_strings_done,
6424 // &amp;data);
6425 // ]|
6427 // This is an asynchronous method. When the operation is finished,
6428 // @callback will be invoked in the
6429 // <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
6430 // of the thread you are calling this method from.
6431 // You can then call g_dbus_proxy_call_finish() to get the result of
6432 // the operation. See g_dbus_proxy_call_sync() for the synchronous
6433 // version of this method.
6434 // <method_name>: Name of method to invoke.
6435 // <parameters>: A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
6436 // <flags>: Flags from the #GDBusCallFlags enumeration.
6437 // <timeout_msec>: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
6438 // <cancellable>: A #GCancellable or %NULL.
6439 // <callback>: A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result of the method invocation.
6440 // <user_data>: The data to pass to @callback.
6441 void call()(char* method_name, GLib2.Variant* parameters, DBusCallFlags flags, int timeout_msec, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
6442 g_dbus_proxy_call(&this, method_name, parameters, flags, timeout_msec, cancellable, callback, user_data);
6445 // VERSION: 2.26
6446 // Finishes an operation started with g_dbus_proxy_call().
6448 // return values. Free with g_variant_unref().
6449 // RETURNS: %NULL if @error is set. Otherwise a #GVariant tuple with
6450 // <res>: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_proxy_call().
6451 GLib2.Variant* /*new*/ call_finish()(AsyncResult* res, GLib2.Error** error=null) {
6452 return g_dbus_proxy_call_finish(&this, res, error);
6455 // VERSION: 2.26
6456 // Synchronously invokes the @method_name method on @proxy.
6458 // If @method_name contains any dots, then @name is split into interface and
6459 // method name parts. This allows using @proxy for invoking methods on
6460 // other interfaces.
6462 // If the #GDBusConnection associated with @proxy is disconnected then
6463 // the operation will fail with %G_IO_ERROR_CLOSED. If
6464 // @cancellable is canceled, the operation will fail with
6465 // %G_IO_ERROR_CANCELLED. If @parameters contains a value not
6466 // compatible with the D-Bus protocol, the operation fails with
6467 // %G_IO_ERROR_INVALID_ARGUMENT.
6469 // If the @parameters #GVariant is floating, it is consumed. This allows
6470 // convenient 'inline' use of g_variant_new(), e.g.:
6471 // |[
6472 // g_dbus_proxy_call_sync (proxy,
6473 // "TwoStrings",
6474 // g_variant_new ("(ss)",
6475 // "Thing One",
6476 // "Thing Two"),
6477 // G_DBUS_CALL_FLAGS_NONE,
6478 // -1,
6479 // NULL,
6480 // &amp;error);
6481 // ]|
6483 // The calling thread is blocked until a reply is received. See
6484 // g_dbus_proxy_call() for the asynchronous version of this
6485 // method.
6487 // return values. Free with g_variant_unref().
6488 // RETURNS: %NULL if @error is set. Otherwise a #GVariant tuple with
6489 // <method_name>: Name of method to invoke.
6490 // <parameters>: A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
6491 // <flags>: Flags from the #GDBusCallFlags enumeration.
6492 // <timeout_msec>: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
6493 // <cancellable>: A #GCancellable or %NULL.
6494 GLib2.Variant* /*new*/ call_sync()(char* method_name, GLib2.Variant* parameters, DBusCallFlags flags, int timeout_msec, Cancellable* cancellable, GLib2.Error** error=null) {
6495 return g_dbus_proxy_call_sync(&this, method_name, parameters, flags, timeout_msec, cancellable, error);
6498 // VERSION: 2.30
6499 // Like g_dbus_proxy_call() but also takes a #GUnixFDList object.
6501 // This method is only available on UNIX.
6502 // <method_name>: Name of method to invoke.
6503 // <parameters>: A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
6504 // <flags>: Flags from the #GDBusCallFlags enumeration.
6505 // <timeout_msec>: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
6506 // <fd_list>: A #GUnixFDList or %NULL.
6507 // <cancellable>: A #GCancellable or %NULL.
6508 // <callback>: A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result of the method invocation.
6509 // <user_data>: The data to pass to @callback.
6510 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) {
6511 g_dbus_proxy_call_with_unix_fd_list(&this, method_name, parameters, flags, timeout_msec, fd_list, cancellable, callback, user_data);
6514 // VERSION: 2.30
6515 // Finishes an operation started with g_dbus_proxy_call_with_unix_fd_list().
6517 // return values. Free with g_variant_unref().
6518 // RETURNS: %NULL if @error is set. Otherwise a #GVariant tuple with
6519 // <out_fd_list>: Return location for a #GUnixFDList or %NULL.
6520 // <res>: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_proxy_call_with_unix_fd_list().
6521 GLib2.Variant* /*new*/ call_with_unix_fd_list_finish()(/*out*/ UnixFDList** out_fd_list, AsyncResult* res, GLib2.Error** error=null) {
6522 return g_dbus_proxy_call_with_unix_fd_list_finish(&this, out_fd_list, res, error);
6525 // VERSION: 2.30
6526 // Like g_dbus_proxy_call_sync() but also takes and returns #GUnixFDList objects.
6528 // This method is only available on UNIX.
6530 // return values. Free with g_variant_unref().
6531 // RETURNS: %NULL if @error is set. Otherwise a #GVariant tuple with
6532 // <method_name>: Name of method to invoke.
6533 // <parameters>: A #GVariant tuple with parameters for the signal or %NULL if not passing parameters.
6534 // <flags>: Flags from the #GDBusCallFlags enumeration.
6535 // <timeout_msec>: The timeout in milliseconds (with %G_MAXINT meaning "infinite") or -1 to use the proxy default timeout.
6536 // <fd_list>: A #GUnixFDList or %NULL.
6537 // <out_fd_list>: Return location for a #GUnixFDList or %NULL.
6538 // <cancellable>: A #GCancellable or %NULL.
6539 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) {
6540 return g_dbus_proxy_call_with_unix_fd_list_sync(&this, method_name, parameters, flags, timeout_msec, fd_list, out_fd_list, cancellable, error);
6543 // VERSION: 2.26
6544 // Looks up the value for a property from the cache. This call does no
6545 // blocking IO.
6547 // If @proxy has an expected interface (see
6548 // #GDBusProxy:g-interface-info), then @property_name (for existence)
6549 // is checked against it.
6551 // for @property_name or %NULL if the value is not in the cache. The
6552 // returned reference must be freed with g_variant_unref().
6553 // RETURNS: A reference to the #GVariant instance that holds the value
6554 // <property_name>: Property name.
6555 GLib2.Variant* /*new*/ get_cached_property()(char* property_name) {
6556 return g_dbus_proxy_get_cached_property(&this, property_name);
6559 // VERSION: 2.26
6560 // Gets the names of all cached properties on @proxy.
6562 // @proxy has no cached properties. Free the returned array with
6563 // g_strfreev().
6564 // RETURNS: A %NULL-terminated array of strings or %NULL if
6565 char** /*new*/ get_cached_property_names()() {
6566 return g_dbus_proxy_get_cached_property_names(&this);
6569 // VERSION: 2.26
6570 // Gets the connection @proxy is for.
6571 // RETURNS: A #GDBusConnection owned by @proxy. Do not free.
6572 DBusConnection* get_connection()() {
6573 return g_dbus_proxy_get_connection(&this);
6576 // VERSION: 2.26
6577 // Gets the timeout to use if -1 (specifying default timeout) is
6578 // passed as @timeout_msec in the g_dbus_proxy_call() and
6579 // g_dbus_proxy_call_sync() functions.
6581 // See the #GDBusProxy:g-default-timeout property for more details.
6582 // RETURNS: Timeout to use for @proxy.
6583 int get_default_timeout()() {
6584 return g_dbus_proxy_get_default_timeout(&this);
6587 // VERSION: 2.26
6588 // Gets the flags that @proxy was constructed with.
6589 // RETURNS: Flags from the #GDBusProxyFlags enumeration.
6590 DBusProxyFlags get_flags()() {
6591 return g_dbus_proxy_get_flags(&this);
6594 // VERSION: 2.26
6595 // Returns the #GDBusInterfaceInfo, if any, specifying the minimal
6596 // interface that @proxy conforms to.
6598 // See the #GDBusProxy:g-interface-info property for more details.
6600 // object, it is owned by @proxy.
6601 // RETURNS: A #GDBusInterfaceInfo or %NULL. Do not unref the returned
6602 DBusInterfaceInfo* /*new*/ get_interface_info()() {
6603 return g_dbus_proxy_get_interface_info(&this);
6606 // VERSION: 2.26
6607 // Gets the D-Bus interface name @proxy is for.
6608 // RETURNS: A string owned by @proxy. Do not free.
6609 char* get_interface_name()() {
6610 return g_dbus_proxy_get_interface_name(&this);
6613 // VERSION: 2.26
6614 // Gets the name that @proxy was constructed for.
6615 // RETURNS: A string owned by @proxy. Do not free.
6616 char* get_name()() {
6617 return g_dbus_proxy_get_name(&this);
6620 // VERSION: 2.26
6621 // The unique name that owns the name that @proxy is for or %NULL if
6622 // no-one currently owns that name. You may connect to the
6623 // #GObject::notify signal to track changes to the
6624 // #GDBusProxy:g-name-owner property.
6625 // RETURNS: The name owner or %NULL if no name owner exists. Free with g_free().
6626 char* /*new*/ get_name_owner()() {
6627 return g_dbus_proxy_get_name_owner(&this);
6630 // VERSION: 2.26
6631 // Gets the object path @proxy is for.
6632 // RETURNS: A string owned by @proxy. Do not free.
6633 char* get_object_path()() {
6634 return g_dbus_proxy_get_object_path(&this);
6637 // VERSION: 2.26
6638 // If @value is not %NULL, sets the cached value for the property with
6639 // name @property_name to the value in @value.
6641 // If @value is %NULL, then the cached value is removed from the
6642 // property cache.
6644 // If @proxy has an expected interface (see
6645 // #GDBusProxy:g-interface-info), then @property_name (for existence)
6646 // and @value (for the type) is checked against it.
6648 // If the @value #GVariant is floating, it is consumed. This allows
6649 // convenient 'inline' use of g_variant_new(), e.g.
6650 // |[
6651 // g_dbus_proxy_set_cached_property (proxy,
6652 // "SomeProperty",
6653 // g_variant_new ("(si)",
6654 // "A String",
6655 // 42));
6656 // ]|
6658 // Normally you will not need to use this method since @proxy is
6659 // tracking changes using the
6660 // <literal>org.freedesktop.DBus.Properties.PropertiesChanged</literal>
6661 // D-Bus signal. However, for performance reasons an object may decide
6662 // to not use this signal for some properties and instead use a
6663 // proprietary out-of-band mechanism to transmit changes.
6665 // As a concrete example, consider an object with a property
6666 // <literal>ChatroomParticipants</literal> which is an array of
6667 // strings. Instead of transmitting the same (long) array every time
6668 // the property changes, it is more efficient to only transmit the
6669 // delta using e.g. signals <literal>ChatroomParticipantJoined(String
6670 // name)</literal> and <literal>ChatroomParticipantParted(String
6671 // name)</literal>.
6672 // <property_name>: Property name.
6673 // <value>: Value for the property or %NULL to remove it from the cache.
6674 void set_cached_property()(char* property_name, GLib2.Variant* value=null) {
6675 g_dbus_proxy_set_cached_property(&this, property_name, value);
6678 // VERSION: 2.26
6679 // Sets the timeout to use if -1 (specifying default timeout) is
6680 // passed as @timeout_msec in the g_dbus_proxy_call() and
6681 // g_dbus_proxy_call_sync() functions.
6683 // See the #GDBusProxy:g-default-timeout property for more details.
6684 // <timeout_msec>: Timeout in milliseconds.
6685 void set_default_timeout()(int timeout_msec) {
6686 g_dbus_proxy_set_default_timeout(&this, timeout_msec);
6689 // VERSION: 2.26
6690 // Ensure that interactions with @proxy conform to the given
6691 // interface. For example, when completing a method call, if the type
6692 // signature of the message isn't what's expected, the given #GError
6693 // is set. Signals that have a type signature mismatch are simply
6694 // dropped.
6696 // See the #GDBusProxy:g-interface-info property for more details.
6697 // <info>: Minimum interface this proxy conforms to or %NULL to unset.
6698 void set_interface_info()(DBusInterfaceInfo* info=null) {
6699 g_dbus_proxy_set_interface_info(&this, info);
6702 // VERSION: 2.26
6703 // Emitted when one or more D-Bus properties on @proxy changes. The
6704 // local cache has already been updated when this signal fires. Note
6705 // that both @changed_properties and @invalidated_properties are
6706 // guaranteed to never be %NULL (either may be empty though).
6708 // This signal corresponds to the
6709 // <literal>PropertiesChanged</literal> D-Bus signal on the
6710 // <literal>org.freedesktop.DBus.Properties</literal> interface.
6711 // <changed_properties>: A #GVariant containing the properties that changed
6712 // <invalidated_properties>: A %NULL terminated array of properties that was invalidated
6713 extern (C) alias static void function (DBusProxy* this_, GLib2.Variant* changed_properties, char* invalidated_properties, void* user_data=null) signal_g_properties_changed;
6715 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
6716 return super_.signal_connect!name(cb, data, cf);
6719 ulong signal_connect(string name:"g-properties-changed", CB:signal_g_properties_changed)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
6720 return signal_connect_data!()(&this, cast(char*)"g-properties-changed",
6721 cast(GObject2.Callback)cb, data, null, cf);
6724 // VERSION: 2.26
6725 // Emitted when a signal from the remote object and interface that @proxy is for, has been received.
6726 // <sender_name>: The sender of the signal or %NULL if the connection is not a bus connection.
6727 // <signal_name>: The name of the signal.
6728 // <parameters>: A #GVariant tuple with parameters for the signal.
6729 extern (C) alias static void function (DBusProxy* this_, char* sender_name, char* signal_name, GLib2.Variant* parameters, void* user_data=null) signal_g_signal;
6730 ulong signal_connect(string name:"g-signal", CB:signal_g_signal)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
6731 return signal_connect_data!()(&this, cast(char*)"g-signal",
6732 cast(GObject2.Callback)cb, data, null, cf);
6736 // Class structure for #GDBusProxy.
6737 struct DBusProxyClass /* Version 2.26 */ {
6738 private GObject2.ObjectClass parent_class;
6739 extern (C) void function (DBusProxy* proxy, GLib2.Variant* changed_properties, char** invalidated_properties) g_properties_changed;
6740 extern (C) void function (DBusProxy* proxy, char* sender_name, char* signal_name, GLib2.Variant* parameters) g_signal;
6741 private void*[32] padding;
6744 // Flags used when constructing an instance of a #GDBusProxy derived class.
6745 enum DBusProxyFlags /* Version 2.26 */ {
6746 NONE = 0,
6747 DO_NOT_LOAD_PROPERTIES = 1,
6748 DO_NOT_CONNECT_SIGNALS = 2,
6749 DO_NOT_AUTO_START = 4
6751 struct DBusProxyPrivate {
6755 // VERSION: 2.30
6756 // Function signature for a function used to determine the #GType to
6757 // use for an interface proxy (if @interface_name is not %NULL) or
6758 // object proxy (if @interface_name is %NULL).
6760 // This function is called in the
6761 // <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
6762 // that @manager was constructed in.
6764 // must be a #GDBusProxy<!-- -->- or #GDBusObjectProxy<!-- -->-derived
6765 // type.
6766 // RETURNS: A #GType to use for the remote object. The returned type
6767 // <manager>: A #GDBusObjectManagerClient.
6768 // <object_path>: The object path of the remote object.
6769 // <interface_name>: The interface name of the remote object or %NULL if a #GDBusObjectProxy #GType is requested.
6770 // <user_data>: User data.
6771 extern (C) alias Type function (DBusObjectManagerClient* manager, char* object_path, char* interface_name, void* user_data) DBusProxyTypeFunc;
6773 // Flags used when sending #GDBusMessage<!-- -->s on a #GDBusConnection.
6774 enum DBusSendMessageFlags /* Version 2.26 */ {
6775 NONE = 0,
6776 PRESERVE_SERIAL = 1
6779 // #GDBusServer is a helper for listening to and accepting D-Bus
6780 // connections. This can be used to create a new D-Bus server, allowing two
6781 // peers to use the D-Bus protocol for their own specialized communication.
6782 // A server instance provided in this way will not perform message routing or
6783 // implement the org.freedesktop.DBus interface.
6785 // To just export an object on a well-known name on a message bus, such as the
6786 // session or system bus, you should instead use g_bus_own_name().
6788 // <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>
6789 struct DBusServer /* : GObject.Object */ /* Version 2.26 */ {
6790 mixin Initable.__interface__;
6791 alias method_parent this;
6792 alias method_parent super_;
6793 alias method_parent object;
6794 GObject2.Object method_parent;
6797 // VERSION: 2.26
6798 // Creates a new D-Bus server that listens on the first address in
6799 // @address that works.
6801 // Once constructed, you can use g_dbus_server_get_client_address() to
6802 // get a D-Bus address string that clients can use to connect.
6804 // Connect to the #GDBusServer::new-connection signal to handle
6805 // incoming connections.
6807 // The returned #GDBusServer isn't active - you have to start it with
6808 // g_dbus_server_start().
6810 // See <xref linkend="gdbus-peer-to-peer"/> for how #GDBusServer can
6811 // be used.
6813 // This is a synchronous failable constructor. See
6814 // g_dbus_server_new() for the asynchronous version.
6816 // g_object_unref().
6817 // RETURNS: A #GDBusServer or %NULL if @error is set. Free with
6818 // <address>: A D-Bus address.
6819 // <flags>: Flags from the #GDBusServerFlags enumeration.
6820 // <guid>: A D-Bus GUID.
6821 // <observer>: A #GDBusAuthObserver or %NULL.
6822 // <cancellable>: A #GCancellable or %NULL.
6823 static DBusServer* /*new*/ new_sync()(char* address, DBusServerFlags flags, char* guid, DBusAuthObserver* observer, Cancellable* cancellable, GLib2.Error** error=null) {
6824 return g_dbus_server_new_sync(address, flags, guid, observer, cancellable, error);
6827 // VERSION: 2.26
6828 // Gets a D-Bus address string that can be used by clients to connect
6829 // to @server.
6831 // by @server.
6832 // RETURNS: A D-Bus address string. Do not free, the string is owned
6833 char* get_client_address()() {
6834 return g_dbus_server_get_client_address(&this);
6837 // VERSION: 2.26
6838 // Gets the flags for @server.
6839 // RETURNS: A set of flags from the #GDBusServerFlags enumeration.
6840 DBusServerFlags get_flags()() {
6841 return g_dbus_server_get_flags(&this);
6844 // VERSION: 2.26
6845 // Gets the GUID for @server.
6846 // RETURNS: A D-Bus GUID. Do not free this string, it is owned by @server.
6847 char* get_guid()() {
6848 return g_dbus_server_get_guid(&this);
6851 // VERSION: 2.26
6852 // Gets whether @server is active.
6853 // RETURNS: %TRUE if server is active, %FALSE otherwise.
6854 int is_active()() {
6855 return g_dbus_server_is_active(&this);
6858 // VERSION: 2.26
6859 // Starts @server.
6860 void start()() {
6861 g_dbus_server_start(&this);
6864 // VERSION: 2.26
6865 // Stops @server.
6866 void stop()() {
6867 g_dbus_server_stop(&this);
6870 // VERSION: 2.26
6871 // Emitted when a new authenticated connection has been made. Use
6872 // g_dbus_connection_get_peer_credentials() to figure out what
6873 // identity (if any), was authenticated.
6875 // If you want to accept the connection, take a reference to the
6876 // @connection object and return %TRUE. When you are done with the
6877 // connection call g_dbus_connection_close() and give up your
6878 // reference. Note that the other peer may disconnect at any time -
6879 // a typical thing to do when accepting a connection is to listen to
6880 // the #GDBusConnection::closed signal.
6882 // If #GDBusServer:flags contains %G_DBUS_SERVER_FLAGS_RUN_IN_THREAD
6883 // then the signal is emitted in a new thread dedicated to the
6884 // connection. Otherwise the signal is emitted in the <link
6885 // linkend="g-main-context-push-thread-default">thread-default main
6886 // loop</link> of the thread that @server was constructed in.
6888 // You are guaranteed that signal handlers for this signal runs
6889 // before incoming messages on @connection are processed. This means
6890 // that it's suitable to call g_dbus_connection_register_object() or
6891 // similar from the signal handler.
6893 // run.
6894 // RETURNS: %TRUE to claim @connection, %FALSE to let other handlers
6895 // <connection>: A #GDBusConnection for the new connection.
6896 extern (C) alias static c_int function (DBusServer* this_, DBusConnection* connection, void* user_data=null) signal_new_connection;
6898 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
6899 return super_.signal_connect!name(cb, data, cf);
6902 ulong signal_connect(string name:"new-connection", CB:signal_new_connection)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
6903 return signal_connect_data!()(&this, cast(char*)"new-connection",
6904 cast(GObject2.Callback)cb, data, null, cf);
6908 // Flags used when creating a #GDBusServer.
6909 enum DBusServerFlags /* Version 2.26 */ {
6910 NONE = 0,
6911 RUN_IN_THREAD = 1,
6912 AUTHENTICATION_ALLOW_ANONYMOUS = 2
6915 // VERSION: 2.26
6916 // Signature for callback function used in g_dbus_connection_signal_subscribe().
6917 // <connection>: A #GDBusConnection.
6918 // <sender_name>: The unique bus name of the sender of the signal.
6919 // <object_path>: The object path that the signal was emitted on.
6920 // <interface_name>: The name of the interface.
6921 // <signal_name>: The name of the signal.
6922 // <parameters>: A #GVariant tuple with parameters for the signal.
6923 // <user_data>: User data passed when subscribing to the signal.
6924 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;
6926 // Flags used when subscribing to signals via g_dbus_connection_signal_subscribe().
6927 enum DBusSignalFlags /* Version 2.26 */ {
6928 NONE = 0,
6929 NO_MATCH_RULE = 1
6931 // Information about a signal on a D-Bus interface.
6932 struct DBusSignalInfo /* Version 2.26 */ {
6933 int ref_count;
6934 char* name;
6935 DBusArgInfo*[666] args;
6936 DBusAnnotationInfo*[666] annotations;
6939 // VERSION: 2.26
6940 // If @info is statically allocated does nothing. Otherwise increases
6941 // the reference count.
6942 // RETURNS: The same @info.
6943 DBusSignalInfo* /*new*/ ref_()() {
6944 return g_dbus_signal_info_ref(&this);
6947 // VERSION: 2.26
6948 // If @info is statically allocated, does nothing. Otherwise decreases
6949 // the reference count of @info. When its reference count drops to 0,
6950 // the memory used is freed.
6951 void unref()() {
6952 g_dbus_signal_info_unref(&this);
6957 // VERSION: 2.26
6958 // The type of the @dispatch function in #GDBusSubtreeVTable.
6960 // Subtrees are flat. @node, if non-%NULL, is always exactly one
6961 // segment of the object path (ie: it never contains a slash).
6962 // RETURNS: A #GDBusInterfaceVTable or %NULL if you don't want to handle the methods.
6963 // <connection>: A #GDBusConnection.
6964 // <sender>: The unique bus name of the remote caller.
6965 // <object_path>: The object path that was registered with g_dbus_connection_register_subtree().
6966 // <interface_name>: The D-Bus interface name that the method call or property access is for.
6967 // <node>: A node that is a child of @object_path (relative to @object_path) or %NULL for the root of the subtree.
6968 // <out_user_data>: Return location for user data to pass to functions in the returned #GDBusInterfaceVTable (never %NULL).
6969 // <user_data>: The @user_data #gpointer passed to g_dbus_connection_register_subtree().
6970 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;
6973 // Unintrospectable callback: DBusSubtreeEnumerateFunc() / ()
6974 // VERSION: 2.26
6975 // The type of the @enumerate function in #GDBusSubtreeVTable.
6977 // This function is called when generating introspection data and also
6978 // when preparing to dispatch incoming messages in the event that the
6979 // %G_DBUS_SUBTREE_FLAGS_DISPATCH_TO_UNENUMERATED_NODES flag is not
6980 // specified (ie: to verify that the object path is valid).
6982 // Hierarchies are not supported; the items that you return should not
6983 // contain the '/' character.
6985 // The return value will be freed with g_strfreev().
6986 // RETURNS: A newly allocated array of strings for node names that are children of @object_path.
6987 // <connection>: A #GDBusConnection.
6988 // <sender>: The unique bus name of the remote caller.
6989 // <object_path>: The object path that was registered with g_dbus_connection_register_subtree().
6990 // <user_data>: The @user_data #gpointer passed to g_dbus_connection_register_subtree().
6991 extern (C) alias char** function (DBusConnection* connection, char* sender, char* object_path, void* user_data) DBusSubtreeEnumerateFunc;
6993 // Flags passed to g_dbus_connection_register_subtree().
6994 enum DBusSubtreeFlags /* Version 2.26 */ {
6995 NONE = 0,
6996 DISPATCH_TO_UNENUMERATED_NODES = 1
6999 // VERSION: 2.26
7000 // The type of the @introspect function in #GDBusSubtreeVTable.
7002 // Subtrees are flat. @node, if non-%NULL, is always exactly one
7003 // segment of the object path (ie: it never contains a slash).
7005 // This function should return %NULL to indicate that there is no object
7006 // at this node.
7008 // If this function returns non-%NULL, the return value is expected to
7009 // be a %NULL-terminated array of pointers to #GDBusInterfaceInfo
7010 // structures describing the interfaces implemented by @node. This
7011 // array will have g_dbus_interface_info_unref() called on each item
7012 // before being freed with g_free().
7014 // The difference between returning %NULL and an array containing zero
7015 // items is that the standard DBus interfaces will returned to the
7016 // remote introspector in the empty array case, but not in the %NULL
7017 // case.
7018 // RETURNS: A %NULL-terminated array of pointers to #GDBusInterfaceInfo, or %NULL.
7019 // <connection>: A #GDBusConnection.
7020 // <sender>: The unique bus name of the remote caller.
7021 // <object_path>: The object path that was registered with g_dbus_connection_register_subtree().
7022 // <node>: A node that is a child of @object_path (relative to @object_path) or %NULL for the root of the subtree.
7023 // <user_data>: The @user_data #gpointer passed to g_dbus_connection_register_subtree().
7024 extern (C) alias DBusInterfaceInfo** /*new*/ function (DBusConnection* connection, char* sender, char* object_path, char* node, void* user_data) DBusSubtreeIntrospectFunc;
7026 // Virtual table for handling subtrees registered with g_dbus_connection_register_subtree().
7027 struct DBusSubtreeVTable /* Version 2.26 */ {
7028 DBusSubtreeEnumerateFunc enumerate;
7029 DBusSubtreeIntrospectFunc introspect;
7030 DBusSubtreeDispatchFunc dispatch;
7031 private void*[8] padding;
7034 enum DESKTOP_APP_INFO_LOOKUP_EXTENSION_POINT_NAME = "gio-desktop-app-info-lookup";
7036 // Data input stream implements #GInputStream and includes functions for
7037 // reading structured data directly from a binary input stream.
7038 struct DataInputStream /* : BufferedInputStream */ {
7039 alias parent_instance this;
7040 alias parent_instance super_;
7041 alias parent_instance bufferedinputstream;
7042 BufferedInputStream parent_instance;
7043 private DataInputStreamPrivate* priv;
7046 // Creates a new data input stream for the @base_stream.
7047 // RETURNS: a new #GDataInputStream.
7048 // <base_stream>: a #GInputStream.
7049 static DataInputStream* /*new*/ new_()(InputStream* base_stream) {
7050 return g_data_input_stream_new(base_stream);
7053 // Gets the byte order for the data input stream.
7054 // RETURNS: the @stream's current #GDataStreamByteOrder.
7055 DataStreamByteOrder get_byte_order()() {
7056 return g_data_input_stream_get_byte_order(&this);
7059 // Gets the current newline type for the @stream.
7060 // RETURNS: #GDataStreamNewlineType for the given @stream.
7061 DataStreamNewlineType get_newline_type()() {
7062 return g_data_input_stream_get_newline_type(&this);
7065 // Reads an unsigned 8-bit/1-byte value from @stream.
7067 // if an error occurred.
7068 // RETURNS: an unsigned 8-bit/1-byte value read from the @stream or %0
7069 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7070 ubyte read_byte()(Cancellable* cancellable, GLib2.Error** error=null) {
7071 return g_data_input_stream_read_byte(&this, cancellable, error);
7074 // Reads a 16-bit/2-byte value from @stream.
7076 // In order to get the correct byte order for this read operation,
7077 // see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
7079 // an error occurred.
7080 // RETURNS: a signed 16-bit/2-byte value read from @stream or %0 if
7081 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7082 short read_int16()(Cancellable* cancellable, GLib2.Error** error=null) {
7083 return g_data_input_stream_read_int16(&this, cancellable, error);
7086 // Reads a signed 32-bit/4-byte value from @stream.
7088 // In order to get the correct byte order for this read operation,
7089 // see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
7091 // If @cancellable is not %NULL, then the operation can be cancelled by
7092 // triggering the cancellable object from another thread. If the operation
7093 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
7095 // an error occurred.
7096 // RETURNS: a signed 32-bit/4-byte value read from the @stream or %0 if
7097 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7098 int read_int32()(Cancellable* cancellable, GLib2.Error** error=null) {
7099 return g_data_input_stream_read_int32(&this, cancellable, error);
7102 // Reads a 64-bit/8-byte value from @stream.
7104 // In order to get the correct byte order for this read operation,
7105 // see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
7107 // If @cancellable is not %NULL, then the operation can be cancelled by
7108 // triggering the cancellable object from another thread. If the operation
7109 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
7111 // an error occurred.
7112 // RETURNS: a signed 64-bit/8-byte value read from @stream or %0 if
7113 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7114 long read_int64()(Cancellable* cancellable, GLib2.Error** error=null) {
7115 return g_data_input_stream_read_int64(&this, cancellable, error);
7118 // Reads a line from the data input stream. Note that no encoding
7119 // checks or conversion is performed; the input is not guaranteed to
7120 // be UTF-8, and may in fact have embedded NUL characters.
7122 // If @cancellable is not %NULL, then the operation can be cancelled by
7123 // triggering the cancellable object from another thread. If the operation
7124 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
7126 // NUL terminated byte array with the line that was read in (without
7127 // the newlines). Set @length to a #gsize to get the length of the
7128 // read line. On an error, it will return %NULL and @error will be
7129 // set. If there's no content to read, it will still return %NULL,
7130 // but @error won't be set.
7131 // RETURNS: a
7132 // <length>: a #gsize to get the length of the data read in.
7133 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7134 ubyte* /*new*/ read_line()(/*out*/ size_t* length, Cancellable* cancellable, GLib2.Error** error=null) {
7135 return g_data_input_stream_read_line(&this, length, cancellable, error);
7138 // VERSION: 2.20
7139 // The asynchronous version of g_data_input_stream_read_line(). It is
7140 // an error to have two outstanding calls to this function.
7142 // When the operation is finished, @callback will be called. You
7143 // can then call g_data_input_stream_read_line_finish() to get
7144 // the result of the operation.
7145 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
7146 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7147 // <callback>: callback to call when the request is satisfied.
7148 // <user_data>: the data to pass to callback function.
7149 void read_line_async()(int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
7150 g_data_input_stream_read_line_async(&this, io_priority, cancellable, callback, user_data);
7153 // VERSION: 2.20
7154 // Finish an asynchronous call started by
7155 // g_data_input_stream_read_line_async(). Note the warning about
7156 // string encoding in g_data_input_stream_read_line() applies here as
7157 // well.
7159 // NUL-terminated byte array with the line that was read in
7160 // (without the newlines). Set @length to a #gsize to get the
7161 // length of the read line. On an error, it will return %NULL and
7162 // @error will be set. If there's no content to read, it will
7163 // still return %NULL, but @error won't be set.
7164 // RETURNS: a
7165 // <result>: the #GAsyncResult that was provided to the callback.
7166 // <length>: a #gsize to get the length of the data read in.
7167 ubyte* /*new*/ read_line_finish()(AsyncResult* result, /*out*/ size_t* length, GLib2.Error** error=null) {
7168 return g_data_input_stream_read_line_finish(&this, result, length, error);
7171 // VERSION: 2.30
7172 // Finish an asynchronous call started by
7173 // g_data_input_stream_read_line_async().
7175 // (without the newlines). Set @length to a #gsize to get the length
7176 // of the read line. On an error, it will return %NULL and @error
7177 // will be set. For UTF-8 conversion errors, the set error domain is
7178 // %G_CONVERT_ERROR. If there's no content to read, it will still
7179 // return %NULL, but @error won't be set.
7180 // RETURNS: a string with the line that was read in
7181 // <result>: the #GAsyncResult that was provided to the callback.
7182 // <length>: a #gsize to get the length of the data read in.
7183 char* /*new*/ read_line_finish_utf8()(AsyncResult* result, /*out*/ size_t* length, GLib2.Error** error=null) {
7184 return g_data_input_stream_read_line_finish_utf8(&this, result, length, error);
7187 // VERSION: 2.30
7188 // Reads a UTF-8 encoded line from the data input stream.
7190 // If @cancellable is not %NULL, then the operation can be cancelled by
7191 // triggering the cancellable object from another thread. If the operation
7192 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
7194 // line that was read in (without the newlines). Set @length to a
7195 // #gsize to get the length of the read line. On an error, it will
7196 // return %NULL and @error will be set. For UTF-8 conversion errors,
7197 // the set error domain is %G_CONVERT_ERROR. If there's no content to
7198 // read, it will still return %NULL, but @error won't be set.
7199 // RETURNS: a NUL terminated UTF-8 string with the
7200 // <length>: a #gsize to get the length of the data read in.
7201 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7202 char* /*new*/ read_line_utf8()(/*out*/ size_t* length, Cancellable* cancellable, GLib2.Error** error=null) {
7203 return g_data_input_stream_read_line_utf8(&this, length, cancellable, error);
7206 // Reads an unsigned 16-bit/2-byte value from @stream.
7208 // In order to get the correct byte order for this read operation,
7209 // see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
7211 // an error occurred.
7212 // RETURNS: an unsigned 16-bit/2-byte value read from the @stream or %0 if
7213 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7214 ushort read_uint16()(Cancellable* cancellable, GLib2.Error** error=null) {
7215 return g_data_input_stream_read_uint16(&this, cancellable, error);
7218 // Reads an unsigned 32-bit/4-byte value from @stream.
7220 // In order to get the correct byte order for this read operation,
7221 // see g_data_input_stream_get_byte_order() and g_data_input_stream_set_byte_order().
7223 // If @cancellable is not %NULL, then the operation can be cancelled by
7224 // triggering the cancellable object from another thread. If the operation
7225 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
7227 // an error occurred.
7228 // RETURNS: an unsigned 32-bit/4-byte value read from the @stream or %0 if
7229 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7230 uint read_uint32()(Cancellable* cancellable, GLib2.Error** error=null) {
7231 return g_data_input_stream_read_uint32(&this, cancellable, error);
7234 // Reads an unsigned 64-bit/8-byte value from @stream.
7236 // In order to get the correct byte order for this read operation,
7237 // see g_data_input_stream_get_byte_order().
7239 // If @cancellable is not %NULL, then the operation can be cancelled by
7240 // triggering the cancellable object from another thread. If the operation
7241 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
7243 // an error occurred.
7244 // RETURNS: an unsigned 64-bit/8-byte read from @stream or %0 if
7245 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7246 ulong read_uint64()(Cancellable* cancellable, GLib2.Error** error=null) {
7247 return g_data_input_stream_read_uint64(&this, cancellable, error);
7250 // Reads a string from the data input stream, up to the first
7251 // occurrence of any of the stop characters.
7253 // Note that, in contrast to g_data_input_stream_read_until_async(),
7254 // this function consumes the stop character that it finds.
7256 // Don't use this function in new code. Its functionality is
7257 // inconsistent with g_data_input_stream_read_until_async(). Both
7258 // functions will be marked as deprecated in a future release. Use
7259 // g_data_input_stream_read_upto() instead, but note that that function
7260 // does not consume the stop character.
7262 // before encountering any of the stop characters. Set @length to
7263 // a #gsize to get the length of the string. This function will
7264 // return %NULL on an error.
7265 // RETURNS: a string with the data that was read
7266 // <stop_chars>: characters to terminate the read.
7267 // <length>: a #gsize to get the length of the data read in.
7268 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7269 char* /*new*/ read_until()(char* stop_chars, /*out*/ size_t* length, Cancellable* cancellable, GLib2.Error** error=null) {
7270 return g_data_input_stream_read_until(&this, stop_chars, length, cancellable, error);
7273 // VERSION: 2.20
7274 // The asynchronous version of g_data_input_stream_read_until().
7275 // It is an error to have two outstanding calls to this function.
7277 // Note that, in contrast to g_data_input_stream_read_until(),
7278 // this function does not consume the stop character that it finds. You
7279 // must read it for yourself.
7281 // When the operation is finished, @callback will be called. You
7282 // can then call g_data_input_stream_read_until_finish() to get
7283 // the result of the operation.
7285 // Don't use this function in new code. Its functionality is
7286 // inconsistent with g_data_input_stream_read_until(). Both functions
7287 // will be marked as deprecated in a future release. Use
7288 // g_data_input_stream_read_upto_async() instead.
7289 // <stop_chars>: characters to terminate the read.
7290 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
7291 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7292 // <callback>: callback to call when the request is satisfied.
7293 // <user_data>: the data to pass to callback function.
7294 void read_until_async()(char* stop_chars, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
7295 g_data_input_stream_read_until_async(&this, stop_chars, io_priority, cancellable, callback, user_data);
7298 // VERSION: 2.20
7299 // Finish an asynchronous call started by
7300 // g_data_input_stream_read_until_async().
7303 // before encountering any of the stop characters. Set @length to
7304 // a #gsize to get the length of the string. This function will
7305 // return %NULL on an error.
7306 // RETURNS: a string with the data that was read
7307 // <result>: the #GAsyncResult that was provided to the callback.
7308 // <length>: a #gsize to get the length of the data read in.
7309 char* /*new*/ read_until_finish()(AsyncResult* result, /*out*/ size_t* length, GLib2.Error** error=null) {
7310 return g_data_input_stream_read_until_finish(&this, result, length, error);
7313 // VERSION: 2.26
7314 // Reads a string from the data input stream, up to the first
7315 // occurrence of any of the stop characters.
7317 // In contrast to g_data_input_stream_read_until(), this function
7318 // does <emphasis>not</emphasis> consume the stop character. You have
7319 // to use g_data_input_stream_read_byte() to get it before calling
7320 // g_data_input_stream_read_upto() again.
7322 // Note that @stop_chars may contain '\0' if @stop_chars_len is
7323 // specified.
7325 // before encountering any of the stop characters. Set @length to
7326 // a #gsize to get the length of the string. This function will
7327 // return %NULL on an error
7328 // RETURNS: a string with the data that was read
7329 // <stop_chars>: characters to terminate the read
7330 // <stop_chars_len>: length of @stop_chars. May be -1 if @stop_chars is nul-terminated
7331 // <length>: a #gsize to get the length of the data read in
7332 // <cancellable>: optional #GCancellable object, %NULL to ignore
7333 char* /*new*/ read_upto()(char* stop_chars, ssize_t stop_chars_len, /*out*/ size_t* length, Cancellable* cancellable, GLib2.Error** error=null) {
7334 return g_data_input_stream_read_upto(&this, stop_chars, stop_chars_len, length, cancellable, error);
7337 // VERSION: 2.26
7338 // The asynchronous version of g_data_input_stream_read_upto().
7339 // It is an error to have two outstanding calls to this function.
7341 // In contrast to g_data_input_stream_read_until(), this function
7342 // does <emphasis>not</emphasis> consume the stop character. You have
7343 // to use g_data_input_stream_read_byte() to get it before calling
7344 // g_data_input_stream_read_upto() again.
7346 // Note that @stop_chars may contain '\0' if @stop_chars_len is
7347 // specified.
7349 // When the operation is finished, @callback will be called. You
7350 // can then call g_data_input_stream_read_upto_finish() to get
7351 // the result of the operation.
7352 // <stop_chars>: characters to terminate the read
7353 // <stop_chars_len>: length of @stop_chars. May be -1 if @stop_chars is nul-terminated
7354 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
7355 // <cancellable>: optional #GCancellable object, %NULL to ignore
7356 // <callback>: callback to call when the request is satisfied
7357 // <user_data>: the data to pass to callback function
7358 void read_upto_async()(char* stop_chars, ssize_t stop_chars_len, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
7359 g_data_input_stream_read_upto_async(&this, stop_chars, stop_chars_len, io_priority, cancellable, callback, user_data);
7362 // VERSION: 2.24
7363 // Finish an asynchronous call started by
7364 // g_data_input_stream_read_upto_async().
7366 // Note that this function does <emphasis>not</emphasis> consume the
7367 // stop character. You have to use g_data_input_stream_read_byte() to
7368 // get it before calling g_data_input_stream_read_upto_async() again.
7370 // before encountering any of the stop characters. Set @length to
7371 // a #gsize to get the length of the string. This function will
7372 // return %NULL on an error.
7373 // RETURNS: a string with the data that was read
7374 // <result>: the #GAsyncResult that was provided to the callback
7375 // <length>: a #gsize to get the length of the data read in
7376 char* /*new*/ read_upto_finish()(AsyncResult* result, /*out*/ size_t* length, GLib2.Error** error=null) {
7377 return g_data_input_stream_read_upto_finish(&this, result, length, error);
7380 // This function sets the byte order for the given @stream. All subsequent
7381 // reads from the @stream will be read in the given @order.
7382 // <order>: a #GDataStreamByteOrder to set.
7383 void set_byte_order()(DataStreamByteOrder order) {
7384 g_data_input_stream_set_byte_order(&this, order);
7387 // Sets the newline type for the @stream.
7389 // Note that using G_DATA_STREAM_NEWLINE_TYPE_ANY is slightly unsafe. If a read
7390 // chunk ends in "CR" we must read an additional byte to know if this is "CR" or
7391 // "CR LF", and this might block if there is no more data available.
7392 // <type>: the type of new line return as #GDataStreamNewlineType.
7393 void set_newline_type()(DataStreamNewlineType type) {
7394 g_data_input_stream_set_newline_type(&this, type);
7398 struct DataInputStreamClass {
7399 BufferedInputStreamClass parent_class;
7400 extern (C) void function () _g_reserved1;
7401 extern (C) void function () _g_reserved2;
7402 extern (C) void function () _g_reserved3;
7403 extern (C) void function () _g_reserved4;
7404 extern (C) void function () _g_reserved5;
7407 struct DataInputStreamPrivate {
7411 // Data output stream implements #GOutputStream and includes functions for
7412 // writing data directly to an output stream.
7413 struct DataOutputStream /* : FilterOutputStream */ {
7414 alias parent_instance this;
7415 alias parent_instance super_;
7416 alias parent_instance filteroutputstream;
7417 FilterOutputStream parent_instance;
7418 private DataOutputStreamPrivate* priv;
7421 // Creates a new data output stream for @base_stream.
7422 // RETURNS: #GDataOutputStream.
7423 // <base_stream>: a #GOutputStream.
7424 static DataOutputStream* /*new*/ new_()(OutputStream* base_stream) {
7425 return g_data_output_stream_new(base_stream);
7428 // Gets the byte order for the stream.
7429 // RETURNS: the #GDataStreamByteOrder for the @stream.
7430 DataStreamByteOrder get_byte_order()() {
7431 return g_data_output_stream_get_byte_order(&this);
7434 // Puts a byte into the output stream.
7435 // RETURNS: %TRUE if @data was successfully added to the @stream.
7436 // <data>: a #guchar.
7437 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7438 int put_byte()(ubyte data, Cancellable* cancellable, GLib2.Error** error=null) {
7439 return g_data_output_stream_put_byte(&this, data, cancellable, error);
7442 // Puts a signed 16-bit integer into the output stream.
7443 // RETURNS: %TRUE if @data was successfully added to the @stream.
7444 // <data>: a #gint16.
7445 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7446 int put_int16()(short data, Cancellable* cancellable, GLib2.Error** error=null) {
7447 return g_data_output_stream_put_int16(&this, data, cancellable, error);
7450 // Puts a signed 32-bit integer into the output stream.
7451 // RETURNS: %TRUE if @data was successfully added to the @stream.
7452 // <data>: a #gint32.
7453 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7454 int put_int32()(int data, Cancellable* cancellable, GLib2.Error** error=null) {
7455 return g_data_output_stream_put_int32(&this, data, cancellable, error);
7458 // Puts a signed 64-bit integer into the stream.
7459 // RETURNS: %TRUE if @data was successfully added to the @stream.
7460 // <data>: a #gint64.
7461 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7462 int put_int64()(long data, Cancellable* cancellable, GLib2.Error** error=null) {
7463 return g_data_output_stream_put_int64(&this, data, cancellable, error);
7466 // Puts a string into the output stream.
7467 // RETURNS: %TRUE if @string was successfully added to the @stream.
7468 // <str>: a string.
7469 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7470 int put_string()(char* str, Cancellable* cancellable, GLib2.Error** error=null) {
7471 return g_data_output_stream_put_string(&this, str, cancellable, error);
7474 // Puts an unsigned 16-bit integer into the output stream.
7475 // RETURNS: %TRUE if @data was successfully added to the @stream.
7476 // <data>: a #guint16.
7477 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7478 int put_uint16()(ushort data, Cancellable* cancellable, GLib2.Error** error=null) {
7479 return g_data_output_stream_put_uint16(&this, data, cancellable, error);
7482 // Puts an unsigned 32-bit integer into the stream.
7483 // RETURNS: %TRUE if @data was successfully added to the @stream.
7484 // <data>: a #guint32.
7485 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7486 int put_uint32()(uint data, Cancellable* cancellable, GLib2.Error** error=null) {
7487 return g_data_output_stream_put_uint32(&this, data, cancellable, error);
7490 // Puts an unsigned 64-bit integer into the stream.
7491 // RETURNS: %TRUE if @data was successfully added to the @stream.
7492 // <data>: a #guint64.
7493 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7494 int put_uint64()(ulong data, Cancellable* cancellable, GLib2.Error** error=null) {
7495 return g_data_output_stream_put_uint64(&this, data, cancellable, error);
7498 // Sets the byte order of the data output stream to @order.
7499 // <order>: a %GDataStreamByteOrder.
7500 void set_byte_order()(DataStreamByteOrder order) {
7501 g_data_output_stream_set_byte_order(&this, order);
7505 struct DataOutputStreamClass {
7506 FilterOutputStreamClass parent_class;
7507 extern (C) void function () _g_reserved1;
7508 extern (C) void function () _g_reserved2;
7509 extern (C) void function () _g_reserved3;
7510 extern (C) void function () _g_reserved4;
7511 extern (C) void function () _g_reserved5;
7514 struct DataOutputStreamPrivate {
7518 // #GDataStreamByteOrder is used to ensure proper endianness of streaming data sources
7519 // across various machine architectures.
7520 enum DataStreamByteOrder {
7521 BIG_ENDIAN = 0,
7522 LITTLE_ENDIAN = 1,
7523 HOST_ENDIAN = 2
7525 // #GDataStreamNewlineType is used when checking for or setting the line endings for a given file.
7526 enum DataStreamNewlineType {
7527 LF = 0,
7528 CR = 1,
7529 CR_LF = 2,
7530 ANY = 3
7533 // #GDesktopAppInfo is an implementation of #GAppInfo based on
7534 // desktop files.
7536 // Note that <filename>&lt;gio/gdesktopappinfo.h&gt;</filename> belongs to
7537 // the UNIX-specific GIO interfaces, thus you have to use the
7538 // <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
7539 struct DesktopAppInfo /* : GObject.Object */ {
7540 mixin AppInfo.__interface__;
7541 alias method_parent this;
7542 alias method_parent super_;
7543 alias method_parent object;
7544 GObject2.Object method_parent;
7547 // Creates a new #GDesktopAppInfo based on a desktop file id.
7549 // A desktop file id is the basename of the desktop file, including the
7550 // .desktop extension. GIO is looking for a desktop file with this name
7551 // in the <filename>applications</filename> subdirectories of the XDG data
7552 // directories (i.e. the directories specified in the
7553 // <envar>XDG_DATA_HOME</envar> and <envar>XDG_DATA_DIRS</envar> environment
7554 // variables). GIO also supports the prefix-to-subdirectory mapping that is
7555 // described in the <ulink url="http://standards.freedesktop.org/menu-spec/latest/">Menu Spec</ulink>
7556 // (i.e. a desktop id of kde-foo.desktop will match
7557 // <filename>/usr/share/applications/kde/foo.desktop</filename>).
7558 // RETURNS: a new #GDesktopAppInfo, or %NULL if no desktop file with that id
7559 // <desktop_id>: the desktop file id
7560 static DesktopAppInfo* /*new*/ new_()(char* desktop_id) {
7561 return g_desktop_app_info_new(desktop_id);
7564 // Creates a new #GDesktopAppInfo.
7565 // RETURNS: a new #GDesktopAppInfo or %NULL on error.
7566 // <filename>: the path of a desktop file, in the GLib filename encoding
7567 static DesktopAppInfo* /*new*/ new_from_filename()(char* filename) {
7568 return g_desktop_app_info_new_from_filename(filename);
7571 // VERSION: 2.18
7572 // Creates a new #GDesktopAppInfo.
7573 // RETURNS: a new #GDesktopAppInfo or %NULL on error.
7574 // <key_file>: an opened #GKeyFile
7575 static DesktopAppInfo* /*new*/ new_from_keyfile()(GLib2.KeyFile* key_file) {
7576 return g_desktop_app_info_new_from_keyfile(key_file);
7579 // Sets the name of the desktop that the application is running in.
7580 // This is used by g_app_info_should_show() and
7581 // g_desktop_app_info_get_show_in() to evaluate the
7582 // <literal>OnlyShowIn</literal> and <literal>NotShowIn</literal>
7583 // desktop entry fields.
7585 // The <ulink url="http://standards.freedesktop.org/menu-spec/latest/">Desktop
7586 // Menu specification</ulink> recognizes the following:
7587 // <simplelist>
7588 // <member>GNOME</member>
7589 // <member>KDE</member>
7590 // <member>ROX</member>
7591 // <member>XFCE</member>
7592 // <member>Old</member>
7593 // </simplelist>
7595 // Should be called only once; subsequent calls are ignored.
7596 // <desktop_env>: a string specifying what desktop this is
7597 static void set_desktop_env()(char* desktop_env) {
7598 g_desktop_app_info_set_desktop_env(desktop_env);
7601 // Gets the categories from the desktop file.
7603 // i.e. no attempt is made to split it by ';' or validate it.
7604 // RETURNS: The unparsed Categories key from the desktop file;
7605 char* get_categories()() {
7606 return g_desktop_app_info_get_categories(&this);
7609 // VERSION: 2.24
7610 // When @info was created from a known filename, return it. In some
7611 // situations such as the #GDesktopAppInfo returned from
7612 // g_desktop_app_info_new_from_keyfile(), this function will return %NULL.
7613 // RETURNS: The full path to the file for @info, or %NULL if not known.
7614 char* get_filename()() {
7615 return g_desktop_app_info_get_filename(&this);
7618 // Gets the generic name from the destkop file.
7619 // RETURNS: The value of the GenericName key
7620 char* get_generic_name()() {
7621 return g_desktop_app_info_get_generic_name(&this);
7624 // A desktop file is hidden if the Hidden key in it is
7625 // set to True.
7626 // RETURNS: %TRUE if hidden, %FALSE otherwise.
7627 int get_is_hidden()() {
7628 return g_desktop_app_info_get_is_hidden(&this);
7631 // VERSION: 2.30
7632 // Gets the value of the NoDisplay key, which helps determine if the
7633 // application info should be shown in menus. See
7634 // #G_KEY_FILE_DESKTOP_KEY_NO_DISPLAY and g_app_info_should_show().
7635 // RETURNS: The value of the NoDisplay key
7636 int get_nodisplay()() {
7637 return g_desktop_app_info_get_nodisplay(&this);
7640 // VERSION: 2.30
7641 // Checks if the application info should be shown in menus that list available
7642 // applications for a specific name of the desktop, based on the
7643 // <literal>OnlyShowIn</literal> and <literal>NotShowIn</literal> keys.
7645 // If @desktop_env is %NULL, then the name of the desktop set with
7646 // g_desktop_app_info_set_desktop_env() is used.
7648 // Note that g_app_info_should_show() for @info will include this check (with
7649 // %NULL for @desktop_env) as well as additional checks.
7651 // <literal>OnlyShowIn</literal> and <literal>NotShowIn</literal> keys, %FALSE
7652 // otherwise.
7653 // RETURNS: %TRUE if the @info should be shown in @desktop_env according to the
7654 // <desktop_env>: a string specifying a desktop name
7655 int get_show_in()(char* desktop_env) {
7656 return g_desktop_app_info_get_show_in(&this, desktop_env);
7659 // This function performs the equivalent of g_app_info_launch_uris(),
7660 // but is intended primarily for operating system components that
7661 // launch applications. Ordinary applications should use
7662 // g_app_info_launch_uris().
7664 // In contrast to g_app_info_launch_uris(), all processes created will
7665 // always be run directly as children as if by the UNIX fork()/exec()
7666 // calls.
7668 // This guarantee allows additional control over the exact environment
7669 // of the child processes, which is provided via a setup function
7670 // @setup, as well as the process identifier of each child process via
7671 // @pid_callback. See g_spawn_async() for more information about the
7672 // semantics of the @setup function.
7673 // RETURNS: %TRUE on successful launch, %FALSE otherwise.
7674 // <uris>: List of URIs
7675 // <launch_context>: a #GAppLaunchContext
7676 // <spawn_flags>: #GSpawnFlags, used for each process
7677 // <user_setup>: a #GSpawnChildSetupFunc, used once for each process.
7678 // <user_setup_data>: User data for @user_setup
7679 // <pid_callback>: Callback for child processes
7680 // <pid_callback_data>: User data for @callback
7681 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) {
7682 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);
7686 struct DesktopAppInfoClass {
7687 GObject2.ObjectClass parent_class;
7691 // Interface that is used by backends to associate default
7692 // handlers with URI schemes.
7693 struct DesktopAppInfoLookup /* Interface */ {
7694 mixin template __interface__() {
7695 // DEPRECATED method: get_default_for_uri_scheme - The #GDesktopAppInfoLookup interface is deprecated and unused by gio.
7696 // Gets the default application for launching applications
7697 // using this URI scheme for a particular GDesktopAppInfoLookup
7698 // implementation.
7700 // The GDesktopAppInfoLookup interface and this function is used
7701 // to implement g_app_info_get_default_for_uri_scheme() backends
7702 // in a GIO module. There is no reason for applications to use it
7703 // directly. Applications should use g_app_info_get_default_for_uri_scheme().
7704 // RETURNS: #GAppInfo for given @uri_scheme or %NULL on error.
7705 // <uri_scheme>: a string containing a URI scheme.
7706 AppInfo* /*new*/ get_default_for_uri_scheme()(char* uri_scheme) {
7707 return g_desktop_app_info_lookup_get_default_for_uri_scheme(cast(DesktopAppInfoLookup*)&this, uri_scheme);
7710 mixin __interface__;
7713 struct DesktopAppInfoLookupIface {
7714 GObject2.TypeInterface g_iface;
7716 // RETURNS: #GAppInfo for given @uri_scheme or %NULL on error.
7717 // <uri_scheme>: a string containing a URI scheme.
7718 extern (C) AppInfo* /*new*/ function (DesktopAppInfoLookup* lookup, char* uri_scheme) get_default_for_uri_scheme;
7722 // During invocation, g_desktop_app_info_launch_uris_as_manager() may
7723 // create one or more child processes. This callback is invoked once
7724 // for each, providing the process ID.
7725 // <appinfo>: a #GDesktopAppInfo
7726 // <pid>: Process identifier
7727 // <user_data>: User data
7728 extern (C) alias void function (DesktopAppInfo* appinfo, GLib2.Pid pid, void* user_data) DesktopAppLaunchCallback;
7731 // #GDrive - this represent a piece of hardware connected to the machine.
7732 // It's generally only created for removable hardware or hardware with
7733 // removable media.
7735 // #GDrive is a container class for #GVolume objects that stem from
7736 // the same piece of media. As such, #GDrive abstracts a drive with
7737 // (or without) removable media and provides operations for querying
7738 // whether media is available, determing whether media change is
7739 // automatically detected and ejecting the media.
7741 // If the #GDrive reports that media isn't automatically detected, one
7742 // can poll for media; typically one should not do this periodically
7743 // as a poll for media operation is potententially expensive and may
7744 // spin up the drive creating noise.
7746 // #GDrive supports starting and stopping drives with authentication
7747 // support for the former. This can be used to support a diverse set
7748 // of use cases including connecting/disconnecting iSCSI devices,
7749 // powering down external disk enclosures and starting/stopping
7750 // multi-disk devices such as RAID devices. Note that the actual
7751 // semantics and side-effects of starting/stopping a #GDrive may vary
7752 // according to implementation. To choose the correct verbs in e.g. a
7753 // file manager, use g_drive_get_start_stop_type().
7755 // For porting from GnomeVFS note that there is no equivalent of
7756 // #GDrive in that API.
7757 struct Drive /* Interface */ {
7758 mixin template __interface__() {
7759 // Checks if a drive can be ejected.
7760 // RETURNS: %TRUE if the @drive can be ejected, %FALSE otherwise.
7761 int can_eject()() {
7762 return g_drive_can_eject(cast(Drive*)&this);
7765 // Checks if a drive can be polled for media changes.
7767 // %FALSE otherwise.
7768 // RETURNS: %TRUE if the @drive can be polled for media changes,
7769 int can_poll_for_media()() {
7770 return g_drive_can_poll_for_media(cast(Drive*)&this);
7773 // VERSION: 2.22
7774 // Checks if a drive can be started.
7775 // RETURNS: %TRUE if the @drive can be started, %FALSE otherwise.
7776 int can_start()() {
7777 return g_drive_can_start(cast(Drive*)&this);
7780 // VERSION: 2.22
7781 // Checks if a drive can be started degraded.
7782 // RETURNS: %TRUE if the @drive can be started degraded, %FALSE otherwise.
7783 int can_start_degraded()() {
7784 return g_drive_can_start_degraded(cast(Drive*)&this);
7787 // VERSION: 2.22
7788 // Checks if a drive can be stopped.
7789 // RETURNS: %TRUE if the @drive can be stopped, %FALSE otherwise.
7790 int can_stop()() {
7791 return g_drive_can_stop(cast(Drive*)&this);
7794 // DEPRECATED (v2.22) method: eject - Use g_drive_eject_with_operation() instead.
7795 // Asynchronously ejects a drive.
7797 // When the operation is finished, @callback will be called.
7798 // You can then call g_drive_eject_finish() to obtain the
7799 // result of the operation.
7800 // <flags>: flags affecting the unmount if required for eject
7801 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7802 // <callback>: a #GAsyncReadyCallback, or %NULL.
7803 // <user_data>: user data to pass to @callback
7804 void eject()(MountUnmountFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
7805 g_drive_eject(cast(Drive*)&this, flags, cancellable, callback, user_data);
7808 // DEPRECATED (v2.22) method: eject_finish - Use g_drive_eject_with_operation_finish() instead.
7809 // Finishes ejecting a drive.
7811 // %FALSE otherwise.
7812 // RETURNS: %TRUE if the drive has been ejected successfully,
7813 // <result>: a #GAsyncResult.
7814 int eject_finish()(AsyncResult* result, GLib2.Error** error=null) {
7815 return g_drive_eject_finish(cast(Drive*)&this, result, error);
7818 // VERSION: 2.22
7819 // Ejects a drive. This is an asynchronous operation, and is
7820 // finished by calling g_drive_eject_with_operation_finish() with the @drive
7821 // and #GAsyncResult data returned in the @callback.
7822 // <flags>: flags affecting the unmount if required for eject
7823 // <mount_operation>: a #GMountOperation or %NULL to avoid user interaction.
7824 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7825 // <callback>: a #GAsyncReadyCallback, or %NULL.
7826 // <user_data>: user data passed to @callback.
7827 void eject_with_operation()(MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
7828 g_drive_eject_with_operation(cast(Drive*)&this, flags, mount_operation, cancellable, callback, user_data);
7831 // VERSION: 2.22
7832 // Finishes ejecting a drive. If any errors occurred during the operation,
7833 // @error will be set to contain the errors and %FALSE will be returned.
7834 // RETURNS: %TRUE if the drive was successfully ejected. %FALSE otherwise.
7835 // <result>: a #GAsyncResult.
7836 int eject_with_operation_finish()(AsyncResult* result, GLib2.Error** error=null) {
7837 return g_drive_eject_with_operation_finish(cast(Drive*)&this, result, error);
7840 // Gets the kinds of identifiers that @drive has.
7841 // Use g_drive_get_identifer() to obtain the identifiers
7842 // themselves.
7844 // array of strings containing kinds of identifiers. Use g_strfreev()
7845 // to free.
7846 // RETURNS: a %NULL-terminated
7847 char** /*new*/ enumerate_identifiers()() {
7848 return g_drive_enumerate_identifiers(cast(Drive*)&this);
7851 // Gets the icon for @drive.
7853 // Free the returned object with g_object_unref().
7854 // RETURNS: #GIcon for the @drive.
7855 Icon* /*new*/ get_icon()() {
7856 return g_drive_get_icon(cast(Drive*)&this);
7859 // Gets the identifier of the given kind for @drive.
7861 // requested identfier, or %NULL if the #GDrive
7862 // doesn't have this kind of identifier.
7863 // RETURNS: a newly allocated string containing the
7864 // <kind>: the kind of identifier to return
7865 char* /*new*/ get_identifier()(char* kind) {
7866 return g_drive_get_identifier(cast(Drive*)&this, kind);
7869 // Gets the name of @drive.
7871 // string should be freed when no longer needed.
7872 // RETURNS: a string containing @drive's name. The returned
7873 char* /*new*/ get_name()() {
7874 return g_drive_get_name(cast(Drive*)&this);
7877 // VERSION: 2.22
7878 // Gets a hint about how a drive can be started/stopped.
7879 // RETURNS: A value from the #GDriveStartStopType enumeration.
7880 DriveStartStopType get_start_stop_type()() {
7881 return g_drive_get_start_stop_type(cast(Drive*)&this);
7884 // Get a list of mountable volumes for @drive.
7886 // The returned list should be freed with g_list_free(), after
7887 // its elements have been unreffed with g_object_unref().
7888 // RETURNS: #GList containing any #GVolume objects on the given @drive.
7889 GLib2.List* /*new*/ get_volumes()() {
7890 return g_drive_get_volumes(cast(Drive*)&this);
7893 // Checks if the @drive has media. Note that the OS may not be polling
7894 // the drive for media changes; see g_drive_is_media_check_automatic()
7895 // for more details.
7896 // RETURNS: %TRUE if @drive has media, %FALSE otherwise.
7897 int has_media()() {
7898 return g_drive_has_media(cast(Drive*)&this);
7901 // Check if @drive has any mountable volumes.
7902 // RETURNS: %TRUE if the @drive contains volumes, %FALSE otherwise.
7903 int has_volumes()() {
7904 return g_drive_has_volumes(cast(Drive*)&this);
7907 // Checks if @drive is capabable of automatically detecting media changes.
7909 // media changes, %FALSE otherwise.
7910 // RETURNS: %TRUE if the @drive is capabable of automatically detecting
7911 int is_media_check_automatic()() {
7912 return g_drive_is_media_check_automatic(cast(Drive*)&this);
7915 // Checks if the @drive supports removable media.
7916 // RETURNS: %TRUE if @drive supports removable media, %FALSE otherwise.
7917 int is_media_removable()() {
7918 return g_drive_is_media_removable(cast(Drive*)&this);
7921 // Asynchronously polls @drive to see if media has been inserted or removed.
7923 // When the operation is finished, @callback will be called.
7924 // You can then call g_drive_poll_for_media_finish() to obtain the
7925 // result of the operation.
7926 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7927 // <callback>: a #GAsyncReadyCallback, or %NULL.
7928 // <user_data>: user data to pass to @callback
7929 void poll_for_media()(Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
7930 g_drive_poll_for_media(cast(Drive*)&this, cancellable, callback, user_data);
7933 // Finishes an operation started with g_drive_poll_for_media() on a drive.
7935 // %FALSE otherwise.
7936 // RETURNS: %TRUE if the drive has been poll_for_mediaed successfully,
7937 // <result>: a #GAsyncResult.
7938 int poll_for_media_finish()(AsyncResult* result, GLib2.Error** error=null) {
7939 return g_drive_poll_for_media_finish(cast(Drive*)&this, result, error);
7942 // VERSION: 2.22
7943 // Asynchronously starts a drive.
7945 // When the operation is finished, @callback will be called.
7946 // You can then call g_drive_start_finish() to obtain the
7947 // result of the operation.
7948 // <flags>: flags affecting the start operation.
7949 // <mount_operation>: a #GMountOperation or %NULL to avoid user interaction.
7950 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7951 // <callback>: a #GAsyncReadyCallback, or %NULL.
7952 // <user_data>: user data to pass to @callback
7953 void start()(DriveStartFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
7954 g_drive_start(cast(Drive*)&this, flags, mount_operation, cancellable, callback, user_data);
7957 // VERSION: 2.22
7958 // Finishes starting a drive.
7960 // %FALSE otherwise.
7961 // RETURNS: %TRUE if the drive has been started successfully,
7962 // <result>: a #GAsyncResult.
7963 int start_finish()(AsyncResult* result, GLib2.Error** error=null) {
7964 return g_drive_start_finish(cast(Drive*)&this, result, error);
7967 // VERSION: 2.22
7968 // Asynchronously stops a drive.
7970 // When the operation is finished, @callback will be called.
7971 // You can then call g_drive_stop_finish() to obtain the
7972 // result of the operation.
7973 // <flags>: flags affecting the unmount if required for stopping.
7974 // <mount_operation>: a #GMountOperation or %NULL to avoid user interaction.
7975 // <cancellable>: optional #GCancellable object, %NULL to ignore.
7976 // <callback>: a #GAsyncReadyCallback, or %NULL.
7977 // <user_data>: user data to pass to @callback
7978 void stop()(MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
7979 g_drive_stop(cast(Drive*)&this, flags, mount_operation, cancellable, callback, user_data);
7982 // VERSION: 2.22
7983 // Finishes stopping a drive.
7985 // %FALSE otherwise.
7986 // RETURNS: %TRUE if the drive has been stopped successfully,
7987 // <result>: a #GAsyncResult.
7988 int stop_finish()(AsyncResult* result, GLib2.Error** error=null) {
7989 return g_drive_stop_finish(cast(Drive*)&this, result, error);
7991 // Emitted when the drive's state has changed.
7992 extern (C) alias static void function (Drive* this_, void* user_data=null) signal_changed;
7994 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
7995 return super_.signal_connect!name(cb, data, cf);
7998 ulong signal_connect(string name:"changed", CB:signal_changed)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
7999 return signal_connect_data!()(&this, cast(char*)"changed",
8000 cast(GObject2.Callback)cb, data, null, cf);
8003 // This signal is emitted when the #GDrive have been
8004 // disconnected. If the recipient is holding references to the
8005 // object they should release them so the object can be
8006 // finalized.
8007 extern (C) alias static void function (Drive* this_, void* user_data=null) signal_disconnected;
8008 ulong signal_connect(string name:"disconnected", CB:signal_disconnected)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
8009 return signal_connect_data!()(&this, cast(char*)"disconnected",
8010 cast(GObject2.Callback)cb, data, null, cf);
8013 // Emitted when the physical eject button (if any) of a drive has
8014 // been pressed.
8015 extern (C) alias static void function (Drive* this_, void* user_data=null) signal_eject_button;
8016 ulong signal_connect(string name:"eject-button", CB:signal_eject_button)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
8017 return signal_connect_data!()(&this, cast(char*)"eject-button",
8018 cast(GObject2.Callback)cb, data, null, cf);
8021 // VERSION: 2.22
8022 // Emitted when the physical stop button (if any) of a drive has
8023 // been pressed.
8024 extern (C) alias static void function (Drive* this_, void* user_data=null) signal_stop_button;
8025 ulong signal_connect(string name:"stop-button", CB:signal_stop_button)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
8026 return signal_connect_data!()(&this, cast(char*)"stop-button",
8027 cast(GObject2.Callback)cb, data, null, cf);
8030 mixin __interface__;
8033 // Interface for creating #GDrive implementations.
8034 struct DriveIface {
8035 GObject2.TypeInterface g_iface;
8036 extern (C) void function (Drive* drive) changed;
8037 extern (C) void function (Drive* drive) disconnected;
8038 extern (C) void function (Drive* drive) eject_button;
8039 // RETURNS: a string containing @drive's name. The returned
8040 extern (C) char* /*new*/ function (Drive* drive) get_name;
8041 // RETURNS: #GIcon for the @drive.
8042 extern (C) Icon* /*new*/ function (Drive* drive) get_icon;
8043 // RETURNS: %TRUE if the @drive contains volumes, %FALSE otherwise.
8044 extern (C) int function (Drive* drive) has_volumes;
8045 // RETURNS: #GList containing any #GVolume objects on the given @drive.
8046 extern (C) GLib2.List* /*new*/ function (Drive* drive) get_volumes;
8047 // RETURNS: %TRUE if @drive supports removable media, %FALSE otherwise.
8048 extern (C) int function (Drive* drive) is_media_removable;
8049 // RETURNS: %TRUE if @drive has media, %FALSE otherwise.
8050 extern (C) int function (Drive* drive) has_media;
8051 // RETURNS: %TRUE if the @drive is capabable of automatically detecting
8052 extern (C) int function (Drive* drive) is_media_check_automatic;
8053 // RETURNS: %TRUE if the @drive can be ejected, %FALSE otherwise.
8054 extern (C) int function (Drive* drive) can_eject;
8055 // RETURNS: %TRUE if the @drive can be polled for media changes,
8056 extern (C) int function (Drive* drive) can_poll_for_media;
8058 // <flags>: flags affecting the unmount if required for eject
8059 // <cancellable>: optional #GCancellable object, %NULL to ignore.
8060 // <callback>: a #GAsyncReadyCallback, or %NULL.
8061 // <user_data>: user data to pass to @callback
8062 extern (C) void function (Drive* drive, MountUnmountFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) eject;
8064 // RETURNS: %TRUE if the drive has been ejected successfully,
8065 // <result>: a #GAsyncResult.
8066 extern (C) int function (Drive* drive, AsyncResult* result, GLib2.Error** error=null) eject_finish;
8068 // <cancellable>: optional #GCancellable object, %NULL to ignore.
8069 // <callback>: a #GAsyncReadyCallback, or %NULL.
8070 // <user_data>: user data to pass to @callback
8071 extern (C) void function (Drive* drive, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) poll_for_media;
8073 // RETURNS: %TRUE if the drive has been poll_for_mediaed successfully,
8074 // <result>: a #GAsyncResult.
8075 extern (C) int function (Drive* drive, AsyncResult* result, GLib2.Error** error=null) poll_for_media_finish;
8077 // RETURNS: a newly allocated string containing the
8078 // <kind>: the kind of identifier to return
8079 extern (C) char* /*new*/ function (Drive* drive, char* kind) get_identifier;
8080 // RETURNS: a %NULL-terminated
8081 extern (C) char** /*new*/ function (Drive* drive) enumerate_identifiers;
8082 // RETURNS: A value from the #GDriveStartStopType enumeration.
8083 extern (C) DriveStartStopType function (Drive* drive) get_start_stop_type;
8084 // RETURNS: %TRUE if the @drive can be started, %FALSE otherwise.
8085 extern (C) int function (Drive* drive) can_start;
8086 // RETURNS: %TRUE if the @drive can be started degraded, %FALSE otherwise.
8087 extern (C) int function (Drive* drive) can_start_degraded;
8089 // <flags>: flags affecting the start operation.
8090 // <mount_operation>: a #GMountOperation or %NULL to avoid user interaction.
8091 // <cancellable>: optional #GCancellable object, %NULL to ignore.
8092 // <callback>: a #GAsyncReadyCallback, or %NULL.
8093 // <user_data>: user data to pass to @callback
8094 extern (C) void function (Drive* drive, DriveStartFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) start;
8096 // RETURNS: %TRUE if the drive has been started successfully,
8097 // <result>: a #GAsyncResult.
8098 extern (C) int function (Drive* drive, AsyncResult* result, GLib2.Error** error=null) start_finish;
8099 // RETURNS: %TRUE if the @drive can be stopped, %FALSE otherwise.
8100 extern (C) int function (Drive* drive) can_stop;
8102 // <flags>: flags affecting the unmount if required for stopping.
8103 // <mount_operation>: a #GMountOperation or %NULL to avoid user interaction.
8104 // <cancellable>: optional #GCancellable object, %NULL to ignore.
8105 // <callback>: a #GAsyncReadyCallback, or %NULL.
8106 // <user_data>: user data to pass to @callback
8107 extern (C) void function (Drive* drive, MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) stop;
8109 // RETURNS: %TRUE if the drive has been stopped successfully,
8110 // <result>: a #GAsyncResult.
8111 extern (C) int function (Drive* drive, AsyncResult* result, GLib2.Error** error=null) stop_finish;
8112 extern (C) void function (Drive* drive) stop_button;
8114 // <flags>: flags affecting the unmount if required for eject
8115 // <mount_operation>: a #GMountOperation or %NULL to avoid user interaction.
8116 // <cancellable>: optional #GCancellable object, %NULL to ignore.
8117 // <callback>: a #GAsyncReadyCallback, or %NULL.
8118 // <user_data>: user data passed to @callback.
8119 extern (C) void function (Drive* drive, MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) eject_with_operation;
8121 // RETURNS: %TRUE if the drive was successfully ejected. %FALSE otherwise.
8122 // <result>: a #GAsyncResult.
8123 extern (C) int function (Drive* drive, AsyncResult* result, GLib2.Error** error=null) eject_with_operation_finish;
8126 // Flags used when starting a drive.
8127 enum DriveStartFlags /* Version 2.22 */ {
8128 NONE = 0
8130 // Enumeration describing how a drive can be started/stopped.
8131 enum DriveStartStopType /* Version 2.22 */ {
8132 UNKNOWN = 0,
8133 SHUTDOWN = 1,
8134 NETWORK = 2,
8135 MULTIDISK = 3,
8136 PASSWORD = 4
8139 // #GEmblem is an implementation of #GIcon that supports
8140 // having an emblem, which is an icon with additional properties.
8141 // It can than be added to a #GEmblemedIcon.
8143 // Currently, only metainformation about the emblem's origin is
8144 // supported. More may be added in the future.
8145 struct Emblem /* : GObject.Object */ {
8146 mixin Icon.__interface__;
8147 alias method_parent this;
8148 alias method_parent super_;
8149 alias method_parent object;
8150 GObject2.Object method_parent;
8153 // VERSION: 2.18
8154 // Creates a new emblem for @icon.
8155 // RETURNS: a new #GEmblem.
8156 // <icon>: a GIcon containing the icon.
8157 static Emblem* /*new*/ new_()(Icon* icon) {
8158 return g_emblem_new(icon);
8161 // VERSION: 2.18
8162 // Creates a new emblem for @icon.
8163 // RETURNS: a new #GEmblem.
8164 // <icon>: a GIcon containing the icon.
8165 // <origin>: a GEmblemOrigin enum defining the emblem's origin
8166 static Emblem* /*new*/ new_with_origin()(Icon* icon, EmblemOrigin origin) {
8167 return g_emblem_new_with_origin(icon, origin);
8170 // VERSION: 2.18
8171 // Gives back the icon from @emblem.
8173 // the emblem and should not be modified or freed.
8174 // RETURNS: a #GIcon. The returned object belongs to
8175 Icon* get_icon()() {
8176 return g_emblem_get_icon(&this);
8179 // VERSION: 2.18
8180 // Gets the origin of the emblem.
8181 // RETURNS: the origin of the emblem
8182 EmblemOrigin get_origin()() {
8183 return g_emblem_get_origin(&this);
8187 struct EmblemClass {
8191 // GEmblemOrigin is used to add information about the origin of the emblem
8192 // to #GEmblem.
8193 enum EmblemOrigin /* Version 2.18 */ {
8194 UNKNOWN = 0,
8195 DEVICE = 1,
8196 LIVEMETADATA = 2,
8197 TAG = 3
8200 // #GEmblemedIcon is an implementation of #GIcon that supports
8201 // adding an emblem to an icon. Adding multiple emblems to an
8202 // icon is ensured via g_emblemed_icon_add_emblem().
8204 // Note that #GEmblemedIcon allows no control over the position
8205 // of the emblems. See also #GEmblem for more information.
8206 struct EmblemedIcon /* : GObject.Object */ {
8207 mixin Icon.__interface__;
8208 alias parent_instance this;
8209 alias parent_instance super_;
8210 alias parent_instance object;
8211 GObject2.Object parent_instance;
8212 private EmblemedIconPrivate* priv;
8215 // VERSION: 2.18
8216 // Creates a new emblemed icon for @icon with the emblem @emblem.
8217 // RETURNS: a new #GIcon
8218 // <icon>: a #GIcon
8219 // <emblem>: a #GEmblem, or %NULL
8220 static Icon* /*new*/ new_()(Icon* icon, Emblem* emblem=null) {
8221 return g_emblemed_icon_new(icon, emblem);
8224 // VERSION: 2.18
8225 // Adds @emblem to the #GList of #GEmblem <!-- -->s.
8226 // <emblem>: a #GEmblem
8227 void add_emblem()(Emblem* emblem) {
8228 g_emblemed_icon_add_emblem(&this, emblem);
8231 // VERSION: 2.28
8232 // Removes all the emblems from @icon.
8233 void clear_emblems()() {
8234 g_emblemed_icon_clear_emblems(&this);
8237 // VERSION: 2.18
8238 // Gets the list of emblems for the @icon.
8240 // #GEmblem <!-- -->s that is owned by @emblemed
8241 // RETURNS: a #GList of
8242 GLib2.List* get_emblems()() {
8243 return g_emblemed_icon_get_emblems(&this);
8246 // VERSION: 2.18
8247 // Gets the main icon for @emblemed.
8248 // RETURNS: a #GIcon that is owned by @emblemed
8249 Icon* get_icon()() {
8250 return g_emblemed_icon_get_icon(&this);
8254 struct EmblemedIconClass {
8255 GObject2.ObjectClass parent_class;
8258 struct EmblemedIconPrivate {
8261 enum FILE_ATTRIBUTE_ACCESS_CAN_DELETE = "access::can-delete";
8262 enum FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE = "access::can-execute";
8263 enum FILE_ATTRIBUTE_ACCESS_CAN_READ = "access::can-read";
8264 enum FILE_ATTRIBUTE_ACCESS_CAN_RENAME = "access::can-rename";
8265 enum FILE_ATTRIBUTE_ACCESS_CAN_TRASH = "access::can-trash";
8266 enum FILE_ATTRIBUTE_ACCESS_CAN_WRITE = "access::can-write";
8267 enum FILE_ATTRIBUTE_DOS_IS_ARCHIVE = "dos::is-archive";
8268 enum FILE_ATTRIBUTE_DOS_IS_SYSTEM = "dos::is-system";
8269 enum FILE_ATTRIBUTE_ETAG_VALUE = "etag::value";
8270 enum FILE_ATTRIBUTE_FILESYSTEM_FREE = "filesystem::free";
8271 enum FILE_ATTRIBUTE_FILESYSTEM_READONLY = "filesystem::readonly";
8272 enum FILE_ATTRIBUTE_FILESYSTEM_SIZE = "filesystem::size";
8273 enum FILE_ATTRIBUTE_FILESYSTEM_TYPE = "filesystem::type";
8274 enum FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW = "filesystem::use-preview";
8275 enum FILE_ATTRIBUTE_GVFS_BACKEND = "gvfs::backend";
8276 enum FILE_ATTRIBUTE_ID_FILE = "id::file";
8277 enum FILE_ATTRIBUTE_ID_FILESYSTEM = "id::filesystem";
8278 enum FILE_ATTRIBUTE_MOUNTABLE_CAN_EJECT = "mountable::can-eject";
8279 enum FILE_ATTRIBUTE_MOUNTABLE_CAN_MOUNT = "mountable::can-mount";
8280 enum FILE_ATTRIBUTE_MOUNTABLE_CAN_POLL = "mountable::can-poll";
8281 enum FILE_ATTRIBUTE_MOUNTABLE_CAN_START = "mountable::can-start";
8282 enum FILE_ATTRIBUTE_MOUNTABLE_CAN_START_DEGRADED = "mountable::can-start-degraded";
8283 enum FILE_ATTRIBUTE_MOUNTABLE_CAN_STOP = "mountable::can-stop";
8284 enum FILE_ATTRIBUTE_MOUNTABLE_CAN_UNMOUNT = "mountable::can-unmount";
8285 enum FILE_ATTRIBUTE_MOUNTABLE_HAL_UDI = "mountable::hal-udi";
8286 enum FILE_ATTRIBUTE_MOUNTABLE_IS_MEDIA_CHECK_AUTOMATIC = "mountable::is-media-check-automatic";
8287 enum FILE_ATTRIBUTE_MOUNTABLE_START_STOP_TYPE = "mountable::start-stop-type";
8288 enum FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE = "mountable::unix-device";
8289 enum FILE_ATTRIBUTE_MOUNTABLE_UNIX_DEVICE_FILE = "mountable::unix-device-file";
8290 enum FILE_ATTRIBUTE_OWNER_GROUP = "owner::group";
8291 enum FILE_ATTRIBUTE_OWNER_USER = "owner::user";
8292 enum FILE_ATTRIBUTE_OWNER_USER_REAL = "owner::user-real";
8293 enum FILE_ATTRIBUTE_PREVIEW_ICON = "preview::icon";
8294 enum FILE_ATTRIBUTE_SELINUX_CONTEXT = "selinux::context";
8295 enum FILE_ATTRIBUTE_STANDARD_ALLOCATED_SIZE = "standard::allocated-size";
8296 enum FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE = "standard::content-type";
8297 enum FILE_ATTRIBUTE_STANDARD_COPY_NAME = "standard::copy-name";
8298 enum FILE_ATTRIBUTE_STANDARD_DESCRIPTION = "standard::description";
8299 enum FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME = "standard::display-name";
8300 enum FILE_ATTRIBUTE_STANDARD_EDIT_NAME = "standard::edit-name";
8301 enum FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE = "standard::fast-content-type";
8302 enum FILE_ATTRIBUTE_STANDARD_ICON = "standard::icon";
8303 enum FILE_ATTRIBUTE_STANDARD_IS_BACKUP = "standard::is-backup";
8304 enum FILE_ATTRIBUTE_STANDARD_IS_HIDDEN = "standard::is-hidden";
8305 enum FILE_ATTRIBUTE_STANDARD_IS_SYMLINK = "standard::is-symlink";
8306 enum FILE_ATTRIBUTE_STANDARD_IS_VIRTUAL = "standard::is-virtual";
8307 enum FILE_ATTRIBUTE_STANDARD_NAME = "standard::name";
8308 enum FILE_ATTRIBUTE_STANDARD_SIZE = "standard::size";
8309 enum FILE_ATTRIBUTE_STANDARD_SORT_ORDER = "standard::sort-order";
8310 enum FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET = "standard::symlink-target";
8311 enum FILE_ATTRIBUTE_STANDARD_TARGET_URI = "standard::target-uri";
8312 enum FILE_ATTRIBUTE_STANDARD_TYPE = "standard::type";
8313 enum FILE_ATTRIBUTE_THUMBNAILING_FAILED = "thumbnail::failed";
8314 enum FILE_ATTRIBUTE_THUMBNAIL_PATH = "thumbnail::path";
8315 enum FILE_ATTRIBUTE_TIME_ACCESS = "time::access";
8316 enum FILE_ATTRIBUTE_TIME_ACCESS_USEC = "time::access-usec";
8317 enum FILE_ATTRIBUTE_TIME_CHANGED = "time::changed";
8318 enum FILE_ATTRIBUTE_TIME_CHANGED_USEC = "time::changed-usec";
8319 enum FILE_ATTRIBUTE_TIME_CREATED = "time::created";
8320 enum FILE_ATTRIBUTE_TIME_CREATED_USEC = "time::created-usec";
8321 enum FILE_ATTRIBUTE_TIME_MODIFIED = "time::modified";
8322 enum FILE_ATTRIBUTE_TIME_MODIFIED_USEC = "time::modified-usec";
8323 enum FILE_ATTRIBUTE_TRASH_DELETION_DATE = "trash::deletion-date";
8324 enum FILE_ATTRIBUTE_TRASH_ITEM_COUNT = "trash::item-count";
8325 enum FILE_ATTRIBUTE_TRASH_ORIG_PATH = "trash::orig-path";
8326 enum FILE_ATTRIBUTE_UNIX_BLOCKS = "unix::blocks";
8327 enum FILE_ATTRIBUTE_UNIX_BLOCK_SIZE = "unix::block-size";
8328 enum FILE_ATTRIBUTE_UNIX_DEVICE = "unix::device";
8329 enum FILE_ATTRIBUTE_UNIX_GID = "unix::gid";
8330 enum FILE_ATTRIBUTE_UNIX_INODE = "unix::inode";
8331 enum FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT = "unix::is-mountpoint";
8332 enum FILE_ATTRIBUTE_UNIX_MODE = "unix::mode";
8333 enum FILE_ATTRIBUTE_UNIX_NLINK = "unix::nlink";
8334 enum FILE_ATTRIBUTE_UNIX_RDEV = "unix::rdev";
8335 enum FILE_ATTRIBUTE_UNIX_UID = "unix::uid";
8337 // #GFile is a high level abstraction for manipulating files on a
8338 // virtual file system. #GFile<!-- -->s are lightweight, immutable
8339 // objects that do no I/O upon creation. It is necessary to understand that
8340 // #GFile objects do not represent files, merely an identifier for a file. All
8341 // file content I/O is implemented as streaming operations (see #GInputStream and
8342 // #GOutputStream).
8344 // To construct a #GFile, you can use:
8345 // g_file_new_for_path() if you have a path.
8346 // g_file_new_for_uri() if you have a URI.
8347 // g_file_new_for_commandline_arg() for a command line argument.
8348 // g_file_parse_name() from a utf8 string gotten from g_file_get_parse_name().
8350 // One way to think of a #GFile is as an abstraction of a pathname. For normal
8351 // files the system pathname is what is stored internally, but as #GFile<!-- -->s
8352 // are extensible it could also be something else that corresponds to a pathname
8353 // in a userspace implementation of a filesystem.
8355 // #GFile<!-- -->s make up hierarchies of directories and files that correspond to the
8356 // files on a filesystem. You can move through the file system with #GFile using
8357 // g_file_get_parent() to get an identifier for the parent directory, g_file_get_child()
8358 // to get a child within a directory, g_file_resolve_relative_path() to resolve a relative
8359 // path between two #GFile<!-- -->s. There can be multiple hierarchies, so you may not
8360 // end up at the same root if you repeatedly call g_file_get_parent() on two different
8361 // files.
8363 // All #GFile<!-- -->s have a basename (get with g_file_get_basename()). These names
8364 // are byte strings that are used to identify the file on the filesystem (relative to
8365 // its parent directory) and there is no guarantees that they have any particular charset
8366 // encoding or even make any sense at all. If you want to use filenames in a user
8367 // interface you should use the display name that you can get by requesting the
8368 // %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME attribute with g_file_query_info().
8369 // This is guaranteed to be in utf8 and can be used in a user interface. But always
8370 // store the real basename or the #GFile to use to actually access the file, because
8371 // there is no way to go from a display name to the actual name.
8373 // Using #GFile as an identifier has the same weaknesses as using a path in that
8374 // there may be multiple aliases for the same file. For instance, hard or
8375 // soft links may cause two different #GFile<!-- -->s to refer to the same file.
8376 // Other possible causes for aliases are: case insensitive filesystems, short
8377 // and long names on Fat/NTFS, or bind mounts in Linux. If you want to check if
8378 // two #GFile<!-- -->s point to the same file you can query for the
8379 // %G_FILE_ATTRIBUTE_ID_FILE attribute. Note that #GFile does some trivial
8380 // canonicalization of pathnames passed in, so that trivial differences in the
8381 // path string used at creation (duplicated slashes, slash at end of path, "."
8382 // or ".." path segments, etc) does not create different #GFile<!-- -->s.
8384 // Many #GFile operations have both synchronous and asynchronous versions
8385 // to suit your application. Asynchronous versions of synchronous functions
8386 // simply have _async() appended to their function names. The asynchronous
8387 // I/O functions call a #GAsyncReadyCallback which is then used to finalize
8388 // the operation, producing a GAsyncResult which is then passed to the
8389 // function's matching _finish() operation.
8391 // Some #GFile operations do not have synchronous analogs, as they may
8392 // take a very long time to finish, and blocking may leave an application
8393 // unusable. Notable cases include:
8394 // g_file_mount_mountable() to mount a mountable file.
8395 // g_file_unmount_mountable_with_operation() to unmount a mountable file.
8396 // g_file_eject_mountable_with_operation() to eject a mountable file.
8398 // <para id="gfile-etag"><indexterm><primary>entity tag</primary></indexterm>
8399 // One notable feature of #GFile<!-- -->s are entity tags, or "etags" for
8400 // short. Entity tags are somewhat like a more abstract version of the
8401 // traditional mtime, and can be used to quickly determine if the file has
8402 // been modified from the version on the file system. See the HTTP 1.1
8403 // <ulink url="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html">specification</ulink>
8404 // for HTTP Etag headers, which are a very similar concept.
8405 // </para>
8406 struct File /* Interface */ {
8407 mixin template __interface__() {
8408 // Creates a hash value for a #GFile.
8410 // This call does no blocking i/o.
8412 // integer that can be used as hash value for the #GFile.
8413 // This function is intended for easily hashing a #GFile to
8414 // add to a #GHashTable or similar data structure.
8415 // RETURNS: 0 if @file is not a valid #GFile, otherwise an
8416 // <file>: #gconstpointer to a #GFile.
8417 static uint hash()(const(void)* file) {
8418 return g_file_hash(file);
8421 // Creates a #GFile with the given argument from the command line. The value of
8422 // @arg can be either a URI, an absolute path or a relative path resolved
8423 // relative to the current working directory.
8424 // This operation never fails, but the returned object might not support any
8425 // I/O operation if @arg points to a malformed path.
8426 // RETURNS: a new #GFile.
8427 // <arg>: a command line string.
8428 static File* /*new*/ new_for_commandline_arg()(char* arg) {
8429 return g_file_new_for_commandline_arg(arg);
8432 // Constructs a #GFile for a given path. This operation never
8433 // fails, but the returned object might not support any I/O
8434 // operation if @path is malformed.
8435 // RETURNS: a new #GFile for the given @path.
8436 // <path>: a string containing a relative or absolute path. The string must be encoded in the glib filename encoding.
8437 static File* /*new*/ new_for_path()(char* path) {
8438 return g_file_new_for_path(path);
8441 // Constructs a #GFile for a given URI. This operation never
8442 // fails, but the returned object might not support any I/O
8443 // operation if @uri is malformed or if the uri type is
8444 // not supported.
8445 // RETURNS: a #GFile for the given @uri.
8446 // <uri>: a UTF8 string containing a URI.
8447 static File* /*new*/ new_for_uri()(char* uri) {
8448 return g_file_new_for_uri(uri);
8451 // Constructs a #GFile with the given @parse_name (i.e. something given by g_file_get_parse_name()).
8452 // This operation never fails, but the returned object might not support any I/O
8453 // operation if the @parse_name cannot be parsed.
8454 // RETURNS: a new #GFile.
8455 // <parse_name>: a file name or path to be parsed.
8456 static File* /*new*/ parse_name()(char* parse_name) {
8457 return g_file_parse_name(parse_name);
8460 // Gets an output stream for appending data to the file. If
8461 // the file doesn't already exist it is created.
8463 // By default files created are generally readable by everyone,
8464 // but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
8465 // will be made readable only to the current user, to the level that
8466 // is supported on the target filesystem.
8468 // If @cancellable is not %NULL, then the operation can be cancelled by
8469 // triggering the cancellable object from another thread. If the operation
8470 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
8472 // Some file systems don't allow all file names, and may
8473 // return an %G_IO_ERROR_INVALID_FILENAME error.
8474 // If the file is a directory the %G_IO_ERROR_IS_DIRECTORY error will be
8475 // returned. Other errors are possible too, and depend on what kind of
8476 // filesystem the file is on.
8478 // Free the returned object with g_object_unref().
8479 // RETURNS: a #GFileOutputStream, or %NULL on error.
8480 // <flags>: a set of #GFileCreateFlags.
8481 // <cancellable>: optional #GCancellable object, %NULL to ignore.
8482 FileOutputStream* /*new*/ append_to()(FileCreateFlags flags, Cancellable* cancellable, GLib2.Error** error=null) {
8483 return g_file_append_to(cast(File*)&this, flags, cancellable, error);
8486 // Asynchronously opens @file for appending.
8488 // For more details, see g_file_append_to() which is
8489 // the synchronous version of this call.
8491 // When the operation is finished, @callback will be called. You can then call
8492 // g_file_append_to_finish() to get the result of the operation.
8493 // <flags>: a set of #GFileCreateFlags.
8494 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
8495 // <cancellable>: optional #GCancellable object, %NULL to ignore.
8496 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
8497 // <user_data>: the data to pass to callback function
8498 void append_to_async()(FileCreateFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
8499 g_file_append_to_async(cast(File*)&this, flags, io_priority, cancellable, callback, user_data);
8502 // Finishes an asynchronous file append operation started with
8503 // g_file_append_to_async().
8505 // Free the returned object with g_object_unref().
8506 // RETURNS: a valid #GFileOutputStream or %NULL on error.
8507 // <res>: #GAsyncResult
8508 FileOutputStream* /*new*/ append_to_finish()(AsyncResult* res, GLib2.Error** error=null) {
8509 return g_file_append_to_finish(cast(File*)&this, res, error);
8512 // Copies the file @source to the location specified by @destination.
8513 // Can not handle recursive copies of directories.
8515 // If the flag #G_FILE_COPY_OVERWRITE is specified an already
8516 // existing @destination file is overwritten.
8518 // If the flag #G_FILE_COPY_NOFOLLOW_SYMLINKS is specified then symlinks
8519 // will be copied as symlinks, otherwise the target of the
8520 // @source symlink will be copied.
8522 // If @cancellable is not %NULL, then the operation can be cancelled by
8523 // triggering the cancellable object from another thread. If the operation
8524 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
8526 // If @progress_callback is not %NULL, then the operation can be monitored by
8527 // setting this to a #GFileProgressCallback function. @progress_callback_data
8528 // will be passed to this function. It is guaranteed that this callback will
8529 // be called after all data has been transferred with the total number of bytes
8530 // copied during the operation.
8532 // If the @source file does not exist then the G_IO_ERROR_NOT_FOUND
8533 // error is returned, independent on the status of the @destination.
8535 // If #G_FILE_COPY_OVERWRITE is not specified and the target exists, then the
8536 // error G_IO_ERROR_EXISTS is returned.
8538 // If trying to overwrite a file over a directory the G_IO_ERROR_IS_DIRECTORY
8539 // error is returned. If trying to overwrite a directory with a directory the
8540 // G_IO_ERROR_WOULD_MERGE error is returned.
8542 // If the source is a directory and the target does not exist, or #G_FILE_COPY_OVERWRITE is
8543 // specified and the target is a file, then the G_IO_ERROR_WOULD_RECURSE error
8544 // is returned.
8546 // If you are interested in copying the #GFile object itself (not the on-disk
8547 // file), see g_file_dup().
8548 // RETURNS: %TRUE on success, %FALSE otherwise.
8549 // <destination>: destination #GFile
8550 // <flags>: set of #GFileCopyFlags
8551 // <cancellable>: optional #GCancellable object, %NULL to ignore.
8552 // <progress_callback>: function to callback with progress information
8553 // <progress_callback_data>: user data to pass to @progress_callback
8554 int copy()(File* destination, FileCopyFlags flags, Cancellable* cancellable, FileProgressCallback progress_callback, void* progress_callback_data, GLib2.Error** error=null) {
8555 return g_file_copy(cast(File*)&this, destination, flags, cancellable, progress_callback, progress_callback_data, error);
8558 // Unintrospectable method: copy_async() / g_file_copy_async()
8559 // Copies the file @source to the location specified by @destination
8560 // asynchronously. For details of the behaviour, see g_file_copy().
8562 // If @progress_callback is not %NULL, then that function that will be called
8563 // just like in g_file_copy(), however the callback will run in the main loop,
8564 // not in the thread that is doing the I/O operation.
8566 // When the operation is finished, @callback will be called. You can then call
8567 // g_file_copy_finish() to get the result of the operation.
8568 // <destination>: destination #GFile
8569 // <flags>: set of #GFileCopyFlags
8570 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
8571 // <cancellable>: optional #GCancellable object, %NULL to ignore.
8572 // <progress_callback>: function to callback with progress information
8573 // <progress_callback_data>: user data to pass to @progress_callback
8574 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
8575 // <user_data>: the data to pass to callback function
8576 void copy_async()(File* destination, FileCopyFlags flags, int io_priority, Cancellable* cancellable, FileProgressCallback progress_callback, void* progress_callback_data, AsyncReadyCallback callback, void* user_data) {
8577 g_file_copy_async(cast(File*)&this, destination, flags, io_priority, cancellable, progress_callback, progress_callback_data, callback, user_data);
8580 // Copies the file attributes from @source to @destination.
8582 // Normally only a subset of the file attributes are copied,
8583 // those that are copies in a normal file copy operation
8584 // (which for instance does not include e.g. owner). However
8585 // if #G_FILE_COPY_ALL_METADATA is specified in @flags, then
8586 // all the metadata that is possible to copy is copied. This
8587 // is useful when implementing move by copy + delete source.
8588 // RETURNS: %TRUE if the attributes were copied successfully, %FALSE otherwise.
8589 // <destination>: a #GFile to copy attributes to.
8590 // <flags>: a set of #GFileCopyFlags.
8591 // <cancellable>: optional #GCancellable object, %NULL to ignore.
8592 int copy_attributes()(File* destination, FileCopyFlags flags, Cancellable* cancellable, GLib2.Error** error=null) {
8593 return g_file_copy_attributes(cast(File*)&this, destination, flags, cancellable, error);
8596 // Finishes copying the file started with
8597 // g_file_copy_async().
8598 // RETURNS: a %TRUE on success, %FALSE on error.
8599 // <res>: a #GAsyncResult.
8600 int copy_finish()(AsyncResult* res, GLib2.Error** error=null) {
8601 return g_file_copy_finish(cast(File*)&this, res, error);
8604 // Creates a new file and returns an output stream for writing to it.
8605 // The file must not already exist.
8607 // By default files created are generally readable by everyone,
8608 // but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
8609 // will be made readable only to the current user, to the level that
8610 // is supported on the target filesystem.
8612 // If @cancellable is not %NULL, then the operation can be cancelled by
8613 // triggering the cancellable object from another thread. If the operation
8614 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
8616 // If a file or directory with this name already exists the G_IO_ERROR_EXISTS
8617 // error will be returned.
8618 // Some file systems don't allow all file names, and may
8619 // return an G_IO_ERROR_INVALID_FILENAME error, and if the name
8620 // is to long G_IO_ERROR_FILENAME_TOO_LONG will be returned.
8621 // Other errors are possible too, and depend on what kind of
8622 // filesystem the file is on.
8624 // %NULL on error.
8625 // Free the returned object with g_object_unref().
8626 // RETURNS: a #GFileOutputStream for the newly created file, or
8627 // <flags>: a set of #GFileCreateFlags.
8628 // <cancellable>: optional #GCancellable object, %NULL to ignore.
8629 FileOutputStream* /*new*/ create()(FileCreateFlags flags, Cancellable* cancellable, GLib2.Error** error=null) {
8630 return g_file_create(cast(File*)&this, flags, cancellable, error);
8633 // Asynchronously creates a new file and returns an output stream for writing to it.
8634 // The file must not already exist.
8636 // For more details, see g_file_create() which is
8637 // the synchronous version of this call.
8639 // When the operation is finished, @callback will be called. You can then call
8640 // g_file_create_finish() to get the result of the operation.
8641 // <flags>: a set of #GFileCreateFlags.
8642 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
8643 // <cancellable>: optional #GCancellable object, %NULL to ignore.
8644 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
8645 // <user_data>: the data to pass to callback function
8646 void create_async()(FileCreateFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
8647 g_file_create_async(cast(File*)&this, flags, io_priority, cancellable, callback, user_data);
8650 // Finishes an asynchronous file create operation started with
8651 // g_file_create_async().
8653 // Free the returned object with g_object_unref().
8654 // RETURNS: a #GFileOutputStream or %NULL on error.
8655 // <res>: a #GAsyncResult.
8656 FileOutputStream* /*new*/ create_finish()(AsyncResult* res, GLib2.Error** error=null) {
8657 return g_file_create_finish(cast(File*)&this, res, error);
8660 // VERSION: 2.22
8661 // Creates a new file and returns a stream for reading and writing to it.
8662 // The file must not already exist.
8664 // By default files created are generally readable by everyone,
8665 // but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
8666 // will be made readable only to the current user, to the level that
8667 // is supported on the target filesystem.
8669 // If @cancellable is not %NULL, then the operation can be cancelled by
8670 // triggering the cancellable object from another thread. If the operation
8671 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
8673 // If a file or directory with this name already exists the %G_IO_ERROR_EXISTS
8674 // error will be returned. Some file systems don't allow all file names,
8675 // and may return an %G_IO_ERROR_INVALID_FILENAME error, and if the name
8676 // is too long, %G_IO_ERROR_FILENAME_TOO_LONG will be returned. Other errors
8677 // are possible too, and depend on what kind of filesystem the file is on.
8679 // Note that in many non-local file cases read and write streams are not
8680 // supported, so make sure you really need to do read and write streaming,
8681 // rather than just opening for reading or writing.
8683 // Free the returned object with g_object_unref().
8684 // RETURNS: a #GFileIOStream for the newly created file, or %NULL on error.
8685 // <flags>: a set of #GFileCreateFlags
8686 // <cancellable>: optional #GCancellable object, %NULL to ignore
8687 FileIOStream* /*new*/ create_readwrite()(FileCreateFlags flags, Cancellable* cancellable, GLib2.Error** error=null) {
8688 return g_file_create_readwrite(cast(File*)&this, flags, cancellable, error);
8691 // VERSION: 2.22
8692 // Asynchronously creates a new file and returns a stream for reading and
8693 // writing to it. The file must not already exist.
8695 // For more details, see g_file_create_readwrite() which is
8696 // the synchronous version of this call.
8698 // When the operation is finished, @callback will be called. You can then
8699 // call g_file_create_readwrite_finish() to get the result of the operation.
8700 // <flags>: a set of #GFileCreateFlags
8701 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request
8702 // <cancellable>: optional #GCancellable object, %NULL to ignore
8703 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
8704 // <user_data>: the data to pass to callback function
8705 void create_readwrite_async()(FileCreateFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
8706 g_file_create_readwrite_async(cast(File*)&this, flags, io_priority, cancellable, callback, user_data);
8709 // VERSION: 2.22
8710 // Finishes an asynchronous file create operation started with
8711 // g_file_create_readwrite_async().
8713 // Free the returned object with g_object_unref().
8714 // RETURNS: a #GFileIOStream or %NULL on error.
8715 // <res>: a #GAsyncResult
8716 FileIOStream* /*new*/ create_readwrite_finish()(AsyncResult* res, GLib2.Error** error=null) {
8717 return g_file_create_readwrite_finish(cast(File*)&this, res, error);
8720 // Deletes a file. If the @file is a directory, it will only be deleted if it
8721 // is empty.
8723 // If @cancellable is not %NULL, then the operation can be cancelled by
8724 // triggering the cancellable object from another thread. If the operation
8725 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
8726 // RETURNS: %TRUE if the file was deleted. %FALSE otherwise.
8727 // <cancellable>: optional #GCancellable object, %NULL to ignore.
8728 int delete_()(Cancellable* cancellable, GLib2.Error** error=null) {
8729 return g_file_delete(cast(File*)&this, cancellable, error);
8732 // Duplicates a #GFile handle. This operation does not duplicate
8733 // the actual file or directory represented by the #GFile; see
8734 // g_file_copy() if attempting to copy a file.
8736 // This call does no blocking i/o.
8737 // RETURNS: a new #GFile that is a duplicate of the given #GFile.
8738 File* /*new*/ dup()() {
8739 return g_file_dup(cast(File*)&this);
8742 // DEPRECATED (v2.22) method: eject_mountable - Use g_file_eject_mountable_with_operation() instead.
8743 // Starts an asynchronous eject on a mountable.
8744 // When this operation has completed, @callback will be called with
8745 // @user_user data, and the operation can be finalized with
8746 // g_file_eject_mountable_finish().
8748 // If @cancellable is not %NULL, then the operation can be cancelled by
8749 // triggering the cancellable object from another thread. If the operation
8750 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
8751 // <flags>: flags affecting the operation
8752 // <cancellable>: optional #GCancellable object, %NULL to ignore.
8753 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
8754 // <user_data>: the data to pass to callback function
8755 void eject_mountable()(MountUnmountFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
8756 g_file_eject_mountable(cast(File*)&this, flags, cancellable, callback, user_data);
8759 // DEPRECATED (v2.22) method: eject_mountable_finish - Use g_file_eject_mountable_with_operation_finish() instead.
8760 // Finishes an asynchronous eject operation started by
8761 // g_file_eject_mountable().
8763 // otherwise.
8764 // RETURNS: %TRUE if the @file was ejected successfully. %FALSE
8765 // <result>: a #GAsyncResult.
8766 int eject_mountable_finish()(AsyncResult* result, GLib2.Error** error=null) {
8767 return g_file_eject_mountable_finish(cast(File*)&this, result, error);
8770 // VERSION: 2.22
8771 // Starts an asynchronous eject on a mountable.
8772 // When this operation has completed, @callback will be called with
8773 // @user_user data, and the operation can be finalized with
8774 // g_file_eject_mountable_with_operation_finish().
8776 // If @cancellable is not %NULL, then the operation can be cancelled by
8777 // triggering the cancellable object from another thread. If the operation
8778 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
8779 // <flags>: flags affecting the operation
8780 // <mount_operation>: a #GMountOperation, or %NULL to avoid user interaction.
8781 // <cancellable>: optional #GCancellable object, %NULL to ignore.
8782 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
8783 // <user_data>: the data to pass to callback function
8784 void eject_mountable_with_operation()(MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
8785 g_file_eject_mountable_with_operation(cast(File*)&this, flags, mount_operation, cancellable, callback, user_data);
8788 // VERSION: 2.22
8789 // Finishes an asynchronous eject operation started by
8790 // g_file_eject_mountable_with_operation().
8792 // otherwise.
8793 // RETURNS: %TRUE if the @file was ejected successfully. %FALSE
8794 // <result>: a #GAsyncResult.
8795 int eject_mountable_with_operation_finish()(AsyncResult* result, GLib2.Error** error=null) {
8796 return g_file_eject_mountable_with_operation_finish(cast(File*)&this, result, error);
8799 // Gets the requested information about the files in a directory. The result
8800 // is a #GFileEnumerator object that will give out #GFileInfo objects for
8801 // all the files in the directory.
8803 // The @attributes value is a string that specifies the file attributes that
8804 // should be gathered. It is not an error if it's not possible to read a particular
8805 // requested attribute from a file - it just won't be set. @attributes should
8806 // be a comma-separated list of attributes or attribute wildcards. The wildcard "*"
8807 // means all attributes, and a wildcard like "standard::*" means all attributes in the standard
8808 // namespace. An example attribute query be "standard::*,owner::user".
8809 // The standard attributes are available as defines, like #G_FILE_ATTRIBUTE_STANDARD_NAME.
8811 // If @cancellable is not %NULL, then the operation can be cancelled by
8812 // triggering the cancellable object from another thread. If the operation
8813 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
8815 // If the file does not exist, the G_IO_ERROR_NOT_FOUND error will be returned.
8816 // If the file is not a directory, the G_FILE_ERROR_NOTDIR error will be returned.
8817 // Other errors are possible too.
8819 // Free the returned object with g_object_unref().
8820 // RETURNS: A #GFileEnumerator if successful, %NULL on error.
8821 // <attributes>: an attribute query string.
8822 // <flags>: a set of #GFileQueryInfoFlags.
8823 // <cancellable>: optional #GCancellable object, %NULL to ignore.
8824 FileEnumerator* /*new*/ enumerate_children()(char* attributes, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error=null) {
8825 return g_file_enumerate_children(cast(File*)&this, attributes, flags, cancellable, error);
8828 // Asynchronously gets the requested information about the files in a directory. The result
8829 // is a #GFileEnumerator object that will give out #GFileInfo objects for
8830 // all the files in the directory.
8832 // For more details, see g_file_enumerate_children() which is
8833 // the synchronous version of this call.
8835 // When the operation is finished, @callback will be called. You can then call
8836 // g_file_enumerate_children_finish() to get the result of the operation.
8837 // <attributes>: an attribute query string.
8838 // <flags>: a set of #GFileQueryInfoFlags.
8839 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
8840 // <cancellable>: optional #GCancellable object, %NULL to ignore.
8841 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
8842 // <user_data>: the data to pass to callback function
8843 void enumerate_children_async()(char* attributes, FileQueryInfoFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
8844 g_file_enumerate_children_async(cast(File*)&this, attributes, flags, io_priority, cancellable, callback, user_data);
8847 // Finishes an async enumerate children operation.
8848 // See g_file_enumerate_children_async().
8850 // Free the returned object with g_object_unref().
8851 // RETURNS: a #GFileEnumerator or %NULL if an error occurred.
8852 // <res>: a #GAsyncResult.
8853 FileEnumerator* /*new*/ enumerate_children_finish()(AsyncResult* res, GLib2.Error** error=null) {
8854 return g_file_enumerate_children_finish(cast(File*)&this, res, error);
8857 // Checks equality of two given #GFile<!-- -->s. Note that two
8858 // #GFile<!-- -->s that differ can still refer to the same
8859 // file on the filesystem due to various forms of filename
8860 // aliasing.
8862 // This call does no blocking i/o.
8864 // %FALSE if either is not a #GFile.
8865 // RETURNS: %TRUE if @file1 and @file2 are equal.
8866 // <file2>: the second #GFile.
8867 int equal()(File* file2) {
8868 return g_file_equal(cast(File*)&this, file2);
8871 // Gets a #GMount for the #GFile.
8873 // If the #GFileIface for @file does not have a mount (e.g. possibly a
8874 // remote share), @error will be set to %G_IO_ERROR_NOT_FOUND and %NULL
8875 // will be returned.
8877 // If @cancellable is not %NULL, then the operation can be cancelled by
8878 // triggering the cancellable object from another thread. If the operation
8879 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
8881 // Free the returned object with g_object_unref().
8882 // RETURNS: a #GMount where the @file is located or %NULL on error.
8883 // <cancellable>: optional #GCancellable object, %NULL to ignore.
8884 Mount* /*new*/ find_enclosing_mount()(Cancellable* cancellable, GLib2.Error** error=null) {
8885 return g_file_find_enclosing_mount(cast(File*)&this, cancellable, error);
8888 // Asynchronously gets the mount for the file.
8890 // For more details, see g_file_find_enclosing_mount() which is
8891 // the synchronous version of this call.
8893 // When the operation is finished, @callback will be called. You can then call
8894 // g_file_find_enclosing_mount_finish() to get the result of the operation.
8895 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
8896 // <cancellable>: optional #GCancellable object, %NULL to ignore.
8897 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
8898 // <user_data>: the data to pass to callback function
8899 void find_enclosing_mount_async()(int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
8900 g_file_find_enclosing_mount_async(cast(File*)&this, io_priority, cancellable, callback, user_data);
8903 // Finishes an asynchronous find mount request.
8904 // See g_file_find_enclosing_mount_async().
8906 // Free the returned object with g_object_unref().
8907 // RETURNS: #GMount for given @file or %NULL on error.
8908 // <res>: a #GAsyncResult
8909 Mount* /*new*/ find_enclosing_mount_finish()(AsyncResult* res, GLib2.Error** error=null) {
8910 return g_file_find_enclosing_mount_finish(cast(File*)&this, res, error);
8913 // Gets the base name (the last component of the path) for a given #GFile.
8915 // If called for the top level of a system (such as the filesystem root
8916 // or a uri like sftp://host/) it will return a single directory separator
8917 // (and on Windows, possibly a drive letter).
8919 // The base name is a byte string (*not* UTF-8). It has no defined encoding
8920 // or rules other than it may not contain zero bytes. If you want to use
8921 // filenames in a user interface you should use the display name that you
8922 // can get by requesting the %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME
8923 // attribute with g_file_query_info().
8925 // This call does no blocking i/o.
8927 // if given #GFile is invalid. The returned string should be
8928 // freed with g_free() when no longer needed.
8929 // RETURNS: string containing the #GFile's base name, or %NULL
8930 char* /*new*/ get_basename()() {
8931 return g_file_get_basename(cast(File*)&this);
8934 // Gets a child of @file with basename equal to @name.
8936 // Note that the file with that specific name might not exist, but
8937 // you can still have a #GFile that points to it. You can use this
8938 // for instance to create that file.
8940 // This call does no blocking i/o.
8942 // Free the returned object with g_object_unref().
8943 // RETURNS: a #GFile to a child specified by @name.
8944 // <name>: string containing the child's basename.
8945 File* /*new*/ get_child()(char* name) {
8946 return g_file_get_child(cast(File*)&this, name);
8949 // Gets the child of @file for a given @display_name (i.e. a UTF8
8950 // version of the name). If this function fails, it returns %NULL and @error will be
8951 // set. This is very useful when constructing a GFile for a new file
8952 // and the user entered the filename in the user interface, for instance
8953 // when you select a directory and type a filename in the file selector.
8955 // This call does no blocking i/o.
8957 // %NULL if the display name couldn't be converted.
8958 // Free the returned object with g_object_unref().
8959 // RETURNS: a #GFile to the specified child, or
8960 // <display_name>: string to a possible child.
8961 File* /*new*/ get_child_for_display_name()(char* display_name, GLib2.Error** error=null) {
8962 return g_file_get_child_for_display_name(cast(File*)&this, display_name, error);
8965 // Gets the parent directory for the @file.
8966 // If the @file represents the root directory of the
8967 // file system, then %NULL will be returned.
8969 // This call does no blocking i/o.
8971 // #GFile or %NULL if there is no parent.
8972 // Free the returned object with g_object_unref().
8973 // RETURNS: a #GFile structure to the parent of the given
8974 File* /*new*/ get_parent()() {
8975 return g_file_get_parent(cast(File*)&this);
8978 // Gets the parse name of the @file.
8979 // A parse name is a UTF-8 string that describes the
8980 // file such that one can get the #GFile back using
8981 // g_file_parse_name().
8983 // This is generally used to show the #GFile as a nice
8984 // full-pathname kind of string in a user interface,
8985 // like in a location entry.
8987 // For local files with names that can safely be converted
8988 // to UTF8 the pathname is used, otherwise the IRI is used
8989 // (a form of URI that allows UTF8 characters unescaped).
8991 // This call does no blocking i/o.
8993 // string should be freed with g_free() when no longer needed.
8994 // RETURNS: a string containing the #GFile's parse name. The returned
8995 char* /*new*/ get_parse_name()() {
8996 return g_file_get_parse_name(cast(File*)&this);
8999 // Gets the local pathname for #GFile, if one exists.
9001 // This call does no blocking i/o.
9003 // no such path exists. The returned string should be
9004 // freed with g_free() when no longer needed.
9005 // RETURNS: string containing the #GFile's path, or %NULL if
9006 char* /*new*/ get_path()() {
9007 return g_file_get_path(cast(File*)&this);
9010 // Gets the path for @descendant relative to @parent.
9012 // This call does no blocking i/o.
9014 // to @parent, or %NULL if @descendant doesn't have @parent as prefix.
9015 // The returned string should be freed with g_free() when no longer needed.
9016 // RETURNS: string with the relative path from @descendant
9017 // <descendant>: input #GFile.
9018 char* /*new*/ get_relative_path()(File* descendant) {
9019 return g_file_get_relative_path(cast(File*)&this, descendant);
9022 // Gets the URI for the @file.
9024 // This call does no blocking i/o.
9026 // The returned string should be freed with g_free() when no longer needed.
9027 // RETURNS: a string containing the #GFile's URI.
9028 char* /*new*/ get_uri()() {
9029 return g_file_get_uri(cast(File*)&this);
9032 // Gets the URI scheme for a #GFile.
9033 // RFC 3986 decodes the scheme as:
9034 // <programlisting>
9035 // URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
9036 // </programlisting>
9037 // Common schemes include "file", "http", "ftp", etc.
9039 // This call does no blocking i/o.
9041 // #GFile. The returned string should be freed with g_free()
9042 // when no longer needed.
9043 // RETURNS: a string containing the URI scheme for the given
9044 char* /*new*/ get_uri_scheme()() {
9045 return g_file_get_uri_scheme(cast(File*)&this);
9048 // VERSION: 2.24
9049 // Checks if @file has a parent, and optionally, if it is @parent.
9051 // If @parent is %NULL then this function returns %TRUE if @file has any
9052 // parent at all. If @parent is non-%NULL then %TRUE is only returned
9053 // if @file is a child of @parent.
9055 // case that @parent is %NULL).
9056 // RETURNS: %TRUE if @file is a child of @parent (or any parent in the
9057 // <parent>: the parent to check for, or %NULL
9058 int has_parent()(File* parent) {
9059 return g_file_has_parent(cast(File*)&this, parent);
9062 // Checks whether @file has the prefix specified by @prefix. In other word,
9063 // if the names of initial elements of @file<!-- -->s pathname match @prefix.
9064 // Only full pathname elements are matched, so a path like /foo is not
9065 // considered a prefix of /foobar, only of /foo/bar.
9067 // This call does no i/o, as it works purely on names. As such it can
9068 // sometimes return %FALSE even if @file is inside a @prefix (from a
9069 // filesystem point of view), because the prefix of @file is an alias
9070 // of @prefix.
9072 // %FALSE otherwise.
9073 // RETURNS: %TRUE if the @files's parent, grandparent, etc is @prefix.
9074 // <prefix>: input #GFile.
9075 int has_prefix()(File* prefix) {
9076 return g_file_has_prefix(cast(File*)&this, prefix);
9079 // Checks to see if a #GFile has a given URI scheme.
9081 // This call does no blocking i/o.
9083 // given URI scheme, %FALSE if URI scheme is %NULL,
9084 // not supported, or #GFile is invalid.
9085 // RETURNS: %TRUE if #GFile's backend supports the
9086 // <uri_scheme>: a string containing a URI scheme.
9087 int has_uri_scheme()(char* uri_scheme) {
9088 return g_file_has_uri_scheme(cast(File*)&this, uri_scheme);
9091 // Creates a new icon for a file.
9092 // RETURNS: a #GIcon for the given @file, or %NULL on error.
9093 Icon* /*new*/ icon_new()() {
9094 return g_file_icon_new(cast(File*)&this);
9097 // Checks to see if a file is native to the platform.
9099 // A native file s one expressed in the platform-native filename format,
9100 // e.g. "C:\Windows" or "/usr/bin/". This does not mean the file is local,
9101 // as it might be on a locally mounted remote filesystem.
9103 // On some systems non-native files may be available using
9104 // the native filesystem via a userspace filesystem (FUSE), in
9105 // these cases this call will return %FALSE, but g_file_get_path()
9106 // will still return a native path.
9108 // This call does no blocking i/o.
9109 // RETURNS: %TRUE if file is native.
9110 int is_native()() {
9111 return g_file_is_native(cast(File*)&this);
9114 // Loads the content of the file into memory. The data is always
9115 // zero-terminated, but this is not included in the resultant @length.
9116 // The returned @content should be freed with g_free() when no longer
9117 // needed.
9119 // If @cancellable is not %NULL, then the operation can be cancelled by
9120 // triggering the cancellable object from another thread. If the operation
9121 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9123 // %FALSE if there were errors.
9124 // RETURNS: %TRUE if the @file's contents were successfully loaded.
9125 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9126 // <contents>: a location to place the contents of the file.
9127 // <length>: a location to place the length of the contents of the file, or %NULL if the length is not needed
9128 // <etag_out>: a location to place the current entity tag for the file, or %NULL if the entity tag is not needed
9129 int load_contents()(Cancellable* cancellable, /*out*/ ubyte** contents, /*out*/ size_t* length, /*out*/ char** etag_out, GLib2.Error** error=null) {
9130 return g_file_load_contents(cast(File*)&this, cancellable, contents, length, etag_out, error);
9133 // Starts an asynchronous load of the @file's contents.
9135 // For more details, see g_file_load_contents() which is
9136 // the synchronous version of this call.
9138 // When the load operation has completed, @callback will be called
9139 // with @user data. To finish the operation, call
9140 // g_file_load_contents_finish() with the #GAsyncResult returned by
9141 // the @callback.
9143 // If @cancellable is not %NULL, then the operation can be cancelled by
9144 // triggering the cancellable object from another thread. If the operation
9145 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9146 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9147 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
9148 // <user_data>: the data to pass to callback function
9149 void load_contents_async()(Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
9150 g_file_load_contents_async(cast(File*)&this, cancellable, callback, user_data);
9153 // Finishes an asynchronous load of the @file's contents.
9154 // The contents are placed in @contents, and @length is set to the
9155 // size of the @contents string. The @content should be freed with
9156 // g_free() when no longer needed. If @etag_out is present, it will be
9157 // set to the new entity tag for the @file.
9159 // present, it will be set appropriately.
9160 // RETURNS: %TRUE if the load was successful. If %FALSE and @error is
9161 // <res>: a #GAsyncResult.
9162 // <contents>: a location to place the contents of the file.
9163 // <length>: a location to place the length of the contents of the file, or %NULL if the length is not needed
9164 // <etag_out>: a location to place the current entity tag for the file, or %NULL if the entity tag is not needed
9165 int load_contents_finish()(AsyncResult* res, /*out*/ ubyte** contents, /*out*/ size_t* length, /*out*/ char** etag_out, GLib2.Error** error=null) {
9166 return g_file_load_contents_finish(cast(File*)&this, res, contents, length, etag_out, error);
9169 // Unintrospectable method: load_partial_contents_async() / g_file_load_partial_contents_async()
9170 // Reads the partial contents of a file. A #GFileReadMoreCallback should be
9171 // used to stop reading from the file when appropriate, else this function
9172 // will behave exactly as g_file_load_contents_async(). This operation
9173 // can be finished by g_file_load_partial_contents_finish().
9175 // Users of this function should be aware that @user_data is passed to
9176 // both the @read_more_callback and the @callback.
9178 // If @cancellable is not %NULL, then the operation can be cancelled by
9179 // triggering the cancellable object from another thread. If the operation
9180 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9181 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9182 // <read_more_callback>: a #GFileReadMoreCallback to receive partial data and to specify whether further data should be read.
9183 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
9184 // <user_data>: the data to pass to the callback functions.
9185 void load_partial_contents_async()(Cancellable* cancellable, FileReadMoreCallback read_more_callback, AsyncReadyCallback callback, void* user_data) {
9186 g_file_load_partial_contents_async(cast(File*)&this, cancellable, read_more_callback, callback, user_data);
9189 // Finishes an asynchronous partial load operation that was started
9190 // with g_file_load_partial_contents_async(). The data is always
9191 // zero-terminated, but this is not included in the resultant @length.
9192 // The returned @content should be freed with g_free() when no longer
9193 // needed.
9195 // present, it will be set appropriately.
9196 // RETURNS: %TRUE if the load was successful. If %FALSE and @error is
9197 // <res>: a #GAsyncResult.
9198 // <contents>: a location to place the contents of the file.
9199 // <length>: a location to place the length of the contents of the file, or %NULL if the length is not needed
9200 // <etag_out>: a location to place the current entity tag for the file, or %NULL if the entity tag is not needed
9201 int load_partial_contents_finish()(AsyncResult* res, /*out*/ ubyte** contents, /*out*/ size_t* length, /*out*/ char** etag_out, GLib2.Error** error=null) {
9202 return g_file_load_partial_contents_finish(cast(File*)&this, res, contents, length, etag_out, error);
9205 // Creates a directory. Note that this will only create a child directory of
9206 // the immediate parent directory of the path or URI given by the #GFile. To
9207 // recursively create directories, see g_file_make_directory_with_parents().
9208 // This function will fail if the parent directory does not exist, setting
9209 // @error to %G_IO_ERROR_NOT_FOUND. If the file system doesn't support creating
9210 // directories, this function will fail, setting @error to
9211 // %G_IO_ERROR_NOT_SUPPORTED.
9213 // For a local #GFile the newly created directory will have the default
9214 // (current) ownership and permissions of the current process.
9216 // If @cancellable is not %NULL, then the operation can be cancelled by
9217 // triggering the cancellable object from another thread. If the operation
9218 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9219 // RETURNS: %TRUE on successful creation, %FALSE otherwise.
9220 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9221 int make_directory()(Cancellable* cancellable, GLib2.Error** error=null) {
9222 return g_file_make_directory(cast(File*)&this, cancellable, error);
9225 // VERSION: 2.18
9226 // Creates a directory and any parent directories that may not exist similar to
9227 // 'mkdir -p'. If the file system does not support creating directories, this
9228 // function will fail, setting @error to %G_IO_ERROR_NOT_SUPPORTED.
9230 // For a local #GFile the newly created directories will have the default
9231 // (current) ownership and permissions of the current process.
9233 // If @cancellable is not %NULL, then the operation can be cancelled by
9234 // triggering the cancellable object from another thread. If the operation
9235 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9237 // otherwise.
9238 // RETURNS: %TRUE if all directories have been successfully created, %FALSE
9239 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9240 int make_directory_with_parents()(Cancellable* cancellable, GLib2.Error** error=null) {
9241 return g_file_make_directory_with_parents(cast(File*)&this, cancellable, error);
9244 // Creates a symbolic link named @file which contains the string
9245 // @symlink_value.
9247 // If @cancellable is not %NULL, then the operation can be cancelled by
9248 // triggering the cancellable object from another thread. If the operation
9249 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9250 // RETURNS: %TRUE on the creation of a new symlink, %FALSE otherwise.
9251 // <symlink_value>: a string with the path for the target of the new symlink
9252 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9253 int make_symbolic_link()(char* symlink_value, Cancellable* cancellable, GLib2.Error** error=null) {
9254 return g_file_make_symbolic_link(cast(File*)&this, symlink_value, cancellable, error);
9257 // VERSION: 2.18
9258 // Obtains a file or directory monitor for the given file, depending
9259 // on the type of the file.
9261 // If @cancellable is not %NULL, then the operation can be cancelled by
9262 // triggering the cancellable object from another thread. If the operation
9263 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9265 // Free the returned object with g_object_unref().
9266 // RETURNS: a #GFileMonitor for the given @file, or %NULL on error.
9267 // <flags>: a set of #GFileMonitorFlags
9268 // <cancellable>: optional #GCancellable object, %NULL to ignore
9269 FileMonitor* /*new*/ monitor()(FileMonitorFlags flags, Cancellable* cancellable, GLib2.Error** error=null) {
9270 return g_file_monitor(cast(File*)&this, flags, cancellable, error);
9273 // Obtains a directory monitor for the given file.
9274 // This may fail if directory monitoring is not supported.
9276 // If @cancellable is not %NULL, then the operation can be cancelled by
9277 // triggering the cancellable object from another thread. If the operation
9278 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9280 // Free the returned object with g_object_unref().
9281 // RETURNS: a #GFileMonitor for the given @file, or %NULL on error.
9282 // <flags>: a set of #GFileMonitorFlags.
9283 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9284 FileMonitor* /*new*/ monitor_directory()(FileMonitorFlags flags, Cancellable* cancellable, GLib2.Error** error=null) {
9285 return g_file_monitor_directory(cast(File*)&this, flags, cancellable, error);
9288 // Obtains a file monitor for the given file. If no file notification
9289 // mechanism exists, then regular polling of the file is used.
9291 // If @cancellable is not %NULL, then the operation can be cancelled by
9292 // triggering the cancellable object from another thread. If the operation
9293 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9295 // Free the returned object with g_object_unref().
9296 // RETURNS: a #GFileMonitor for the given @file, or %NULL on error.
9297 // <flags>: a set of #GFileMonitorFlags.
9298 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9299 FileMonitor* /*new*/ monitor_file()(FileMonitorFlags flags, Cancellable* cancellable, GLib2.Error** error=null) {
9300 return g_file_monitor_file(cast(File*)&this, flags, cancellable, error);
9303 // Starts a @mount_operation, mounting the volume that contains the file @location.
9305 // When this operation has completed, @callback will be called with
9306 // @user_user data, and the operation can be finalized with
9307 // g_file_mount_enclosing_volume_finish().
9309 // If @cancellable is not %NULL, then the operation can be cancelled by
9310 // triggering the cancellable object from another thread. If the operation
9311 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9312 // <flags>: flags affecting the operation
9313 // <mount_operation>: a #GMountOperation or %NULL to avoid user interaction.
9314 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9315 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
9316 // <user_data>: the data to pass to callback function
9317 void mount_enclosing_volume()(MountMountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
9318 g_file_mount_enclosing_volume(cast(File*)&this, flags, mount_operation, cancellable, callback, user_data);
9321 // Finishes a mount operation started by g_file_mount_enclosing_volume().
9323 // has occurred, this function will return %FALSE and set @error
9324 // appropriately if present.
9325 // RETURNS: %TRUE if successful. If an error
9326 // <result>: a #GAsyncResult.
9327 int mount_enclosing_volume_finish()(AsyncResult* result, GLib2.Error** error=null) {
9328 return g_file_mount_enclosing_volume_finish(cast(File*)&this, result, error);
9331 // Mounts a file of type G_FILE_TYPE_MOUNTABLE.
9332 // Using @mount_operation, you can request callbacks when, for instance,
9333 // passwords are needed during authentication.
9335 // If @cancellable is not %NULL, then the operation can be cancelled by
9336 // triggering the cancellable object from another thread. If the operation
9337 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9339 // When the operation is finished, @callback will be called. You can then call
9340 // g_file_mount_mountable_finish() to get the result of the operation.
9341 // <flags>: flags affecting the operation
9342 // <mount_operation>: a #GMountOperation, or %NULL to avoid user interaction.
9343 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9344 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
9345 // <user_data>: the data to pass to callback function
9346 void mount_mountable()(MountMountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
9347 g_file_mount_mountable(cast(File*)&this, flags, mount_operation, cancellable, callback, user_data);
9350 // Finishes a mount operation. See g_file_mount_mountable() for details.
9352 // Finish an asynchronous mount operation that was started
9353 // with g_file_mount_mountable().
9355 // Free the returned object with g_object_unref().
9356 // RETURNS: a #GFile or %NULL on error.
9357 // <result>: a #GAsyncResult.
9358 File* /*new*/ mount_mountable_finish()(AsyncResult* result, GLib2.Error** error=null) {
9359 return g_file_mount_mountable_finish(cast(File*)&this, result, error);
9362 // Tries to move the file or directory @source to the location specified by @destination.
9363 // If native move operations are supported then this is used, otherwise a copy + delete
9364 // fallback is used. The native implementation may support moving directories (for instance
9365 // on moves inside the same filesystem), but the fallback code does not.
9367 // If the flag #G_FILE_COPY_OVERWRITE is specified an already
9368 // existing @destination file is overwritten.
9370 // If the flag #G_FILE_COPY_NOFOLLOW_SYMLINKS is specified then symlinks
9371 // will be copied as symlinks, otherwise the target of the
9372 // @source symlink will be copied.
9374 // If @cancellable is not %NULL, then the operation can be cancelled by
9375 // triggering the cancellable object from another thread. If the operation
9376 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9378 // If @progress_callback is not %NULL, then the operation can be monitored by
9379 // setting this to a #GFileProgressCallback function. @progress_callback_data
9380 // will be passed to this function. It is guaranteed that this callback will
9381 // be called after all data has been transferred with the total number of bytes
9382 // copied during the operation.
9384 // If the @source file does not exist then the G_IO_ERROR_NOT_FOUND
9385 // error is returned, independent on the status of the @destination.
9387 // If #G_FILE_COPY_OVERWRITE is not specified and the target exists, then the
9388 // error G_IO_ERROR_EXISTS is returned.
9390 // If trying to overwrite a file over a directory the G_IO_ERROR_IS_DIRECTORY
9391 // error is returned. If trying to overwrite a directory with a directory the
9392 // G_IO_ERROR_WOULD_MERGE error is returned.
9394 // If the source is a directory and the target does not exist, or #G_FILE_COPY_OVERWRITE is
9395 // specified and the target is a file, then the G_IO_ERROR_WOULD_RECURSE error
9396 // may be returned (if the native move operation isn't available).
9397 // RETURNS: %TRUE on successful move, %FALSE otherwise.
9398 // <destination>: #GFile pointing to the destination location.
9399 // <flags>: set of #GFileCopyFlags.
9400 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9401 // <progress_callback>: #GFileProgressCallback function for updates.
9402 // <progress_callback_data>: gpointer to user data for the callback function.
9403 int move()(File* destination, FileCopyFlags flags, Cancellable* cancellable, FileProgressCallback progress_callback, void* progress_callback_data, GLib2.Error** error=null) {
9404 return g_file_move(cast(File*)&this, destination, flags, cancellable, progress_callback, progress_callback_data, error);
9407 // VERSION: 2.22
9408 // Opens an existing file for reading and writing. The result is
9409 // a #GFileIOStream that can be used to read and write the contents of the file.
9411 // If @cancellable is not %NULL, then the operation can be cancelled by
9412 // triggering the cancellable object from another thread. If the operation
9413 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9415 // If the file does not exist, the G_IO_ERROR_NOT_FOUND error will be returned.
9416 // If the file is a directory, the G_IO_ERROR_IS_DIRECTORY error will be returned.
9417 // Other errors are possible too, and depend on what kind of filesystem the file is on.
9418 // Note that in many non-local file cases read and write streams are not supported,
9419 // so make sure you really need to do read and write streaming, rather than
9420 // just opening for reading or writing.
9422 // Free the returned object with g_object_unref().
9423 // RETURNS: #GFileIOStream or %NULL on error.
9424 // <cancellable>: a #GCancellable
9425 FileIOStream* /*new*/ open_readwrite()(Cancellable* cancellable, GLib2.Error** error=null) {
9426 return g_file_open_readwrite(cast(File*)&this, cancellable, error);
9429 // VERSION: 2.22
9430 // Asynchronously opens @file for reading and writing.
9432 // For more details, see g_file_open_readwrite() which is
9433 // the synchronous version of this call.
9435 // When the operation is finished, @callback will be called. You can then call
9436 // g_file_open_readwrite_finish() to get the result of the operation.
9437 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
9438 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9439 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
9440 // <user_data>: the data to pass to callback function
9441 void open_readwrite_async()(int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
9442 g_file_open_readwrite_async(cast(File*)&this, io_priority, cancellable, callback, user_data);
9445 // VERSION: 2.22
9446 // Finishes an asynchronous file read operation started with
9447 // g_file_open_readwrite_async().
9449 // Free the returned object with g_object_unref().
9450 // RETURNS: a #GFileIOStream or %NULL on error.
9451 // <res>: a #GAsyncResult.
9452 FileIOStream* /*new*/ open_readwrite_finish()(AsyncResult* res, GLib2.Error** error=null) {
9453 return g_file_open_readwrite_finish(cast(File*)&this, res, error);
9456 // VERSION: 2.22
9457 // Polls a file of type G_FILE_TYPE_MOUNTABLE.
9459 // If @cancellable is not %NULL, then the operation can be cancelled by
9460 // triggering the cancellable object from another thread. If the operation
9461 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9463 // When the operation is finished, @callback will be called. You can then call
9464 // g_file_mount_mountable_finish() to get the result of the operation.
9465 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9466 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
9467 // <user_data>: the data to pass to callback function
9468 void poll_mountable()(Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
9469 g_file_poll_mountable(cast(File*)&this, cancellable, callback, user_data);
9472 // VERSION: 2.22
9473 // Finishes a poll operation. See g_file_poll_mountable() for details.
9475 // Finish an asynchronous poll operation that was polled
9476 // with g_file_poll_mountable().
9478 // otherwise.
9479 // RETURNS: %TRUE if the operation finished successfully. %FALSE
9480 // <result>: a #GAsyncResult.
9481 int poll_mountable_finish()(AsyncResult* result, GLib2.Error** error=null) {
9482 return g_file_poll_mountable_finish(cast(File*)&this, result, error);
9485 // Returns the #GAppInfo that is registered as the default
9486 // application to handle the file specified by @file.
9488 // If @cancellable is not %NULL, then the operation can be cancelled by
9489 // triggering the cancellable object from another thread. If the operation
9490 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9492 // When you are done with it, release it with g_object_unref()
9493 // RETURNS: a #GAppInfo if the handle was found, %NULL if there were errors.
9494 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9495 AppInfo* /*new*/ query_default_handler()(Cancellable* cancellable, GLib2.Error** error=null) {
9496 return g_file_query_default_handler(cast(File*)&this, cancellable, error);
9499 // Utility function to check if a particular file exists. This is
9500 // implemented using g_file_query_info() and as such does blocking I/O.
9502 // Note that in many cases it is racy to first check for file existence
9503 // and then execute something based on the outcome of that, because the
9504 // file might have been created or removed in between the operations. The
9505 // general approach to handling that is to not check, but just do the
9506 // operation and handle the errors as they come.
9508 // As an example of race-free checking, take the case of reading a file, and
9509 // if it doesn't exist, creating it. There are two racy versions: read it, and
9510 // on error create it; and: check if it exists, if not create it. These
9511 // can both result in two processes creating the file (with perhaps a partially
9512 // written file as the result). The correct approach is to always try to create
9513 // the file with g_file_create() which will either atomically create the file
9514 // or fail with a G_IO_ERROR_EXISTS error.
9516 // However, in many cases an existence check is useful in a user
9517 // interface, for instance to make a menu item sensitive/insensitive, so that
9518 // you don't have to fool users that something is possible and then just show
9519 // and error dialog. If you do this, you should make sure to also handle the
9520 // errors that can happen due to races when you execute the operation.
9521 // RETURNS: %TRUE if the file exists (and can be detected without error), %FALSE otherwise (or if cancelled).
9522 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9523 int query_exists()(Cancellable* cancellable=null) {
9524 return g_file_query_exists(cast(File*)&this, cancellable);
9527 // VERSION: 2.18
9528 // Utility function to inspect the #GFileType of a file. This is
9529 // implemented using g_file_query_info() and as such does blocking I/O.
9531 // The primary use case of this method is to check if a file is a regular file,
9532 // directory, or symlink.
9534 // does not exist
9535 // RETURNS: The #GFileType of the file and #G_FILE_TYPE_UNKNOWN if the file
9536 // <flags>: a set of #GFileQueryInfoFlags passed to g_file_query_info().
9537 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9538 FileType query_file_type()(FileQueryInfoFlags flags, Cancellable* cancellable=null) {
9539 return g_file_query_file_type(cast(File*)&this, flags, cancellable);
9542 // Similar to g_file_query_info(), but obtains information
9543 // about the filesystem the @file is on, rather than the file itself.
9544 // For instance the amount of space available and the type of
9545 // the filesystem.
9547 // The @attributes value is a string that specifies the file attributes that
9548 // should be gathered. It is not an error if it's not possible to read a particular
9549 // requested attribute from a file - it just won't be set. @attributes should
9550 // be a comma-separated list of attributes or attribute wildcards. The wildcard "*"
9551 // means all attributes, and a wildcard like "filesystem::*" means all attributes in the
9552 // filesystem namespace. The standard namespace for filesystem attributes is "filesystem".
9553 // Common attributes of interest are #G_FILE_ATTRIBUTE_FILESYSTEM_SIZE
9554 // (the total size of the filesystem in bytes), #G_FILE_ATTRIBUTE_FILESYSTEM_FREE (number of
9555 // bytes available), and #G_FILE_ATTRIBUTE_FILESYSTEM_TYPE (type of the filesystem).
9557 // If @cancellable is not %NULL, then the operation can be cancelled by
9558 // triggering the cancellable object from another thread. If the operation
9559 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9561 // If the file does not exist, the G_IO_ERROR_NOT_FOUND error will be returned.
9562 // Other errors are possible too, and depend on what kind of filesystem the file is on.
9564 // Free the returned object with g_object_unref().
9565 // RETURNS: a #GFileInfo or %NULL if there was an error.
9566 // <attributes>: an attribute query string.
9567 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9568 FileInfo* /*new*/ query_filesystem_info()(char* attributes, Cancellable* cancellable, GLib2.Error** error=null) {
9569 return g_file_query_filesystem_info(cast(File*)&this, attributes, cancellable, error);
9572 // Asynchronously gets the requested information about the filesystem
9573 // that the specified @file is on. The result is a #GFileInfo object
9574 // that contains key-value attributes (such as type or size for the
9575 // file).
9577 // For more details, see g_file_query_filesystem_info() which is the
9578 // synchronous version of this call.
9580 // When the operation is finished, @callback will be called. You can
9581 // then call g_file_query_info_finish() to get the result of the
9582 // operation.
9583 // <attributes>: an attribute query string.
9584 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
9585 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9586 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
9587 // <user_data>: the data to pass to callback function
9588 void query_filesystem_info_async()(char* attributes, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
9589 g_file_query_filesystem_info_async(cast(File*)&this, attributes, io_priority, cancellable, callback, user_data);
9592 // Finishes an asynchronous filesystem info query. See
9593 // g_file_query_filesystem_info_async().
9595 // Free the returned object with g_object_unref().
9596 // RETURNS: #GFileInfo for given @file or %NULL on error.
9597 // <res>: a #GAsyncResult.
9598 FileInfo* /*new*/ query_filesystem_info_finish()(AsyncResult* res, GLib2.Error** error=null) {
9599 return g_file_query_filesystem_info_finish(cast(File*)&this, res, error);
9602 // Gets the requested information about specified @file. The result
9603 // is a #GFileInfo object that contains key-value attributes (such as
9604 // the type or size of the file).
9606 // The @attributes value is a string that specifies the file attributes that
9607 // should be gathered. It is not an error if it's not possible to read a particular
9608 // requested attribute from a file - it just won't be set. @attributes should
9609 // be a comma-separated list of attributes or attribute wildcards. The wildcard "*"
9610 // means all attributes, and a wildcard like "standard::*" means all attributes in the standard
9611 // namespace. An example attribute query be "standard::*,owner::user".
9612 // The standard attributes are available as defines, like #G_FILE_ATTRIBUTE_STANDARD_NAME.
9614 // If @cancellable is not %NULL, then the operation can be cancelled by
9615 // triggering the cancellable object from another thread. If the operation
9616 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9618 // For symlinks, normally the information about the target of the
9619 // symlink is returned, rather than information about the symlink itself.
9620 // However if you pass #G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS in @flags the
9621 // information about the symlink itself will be returned. Also, for symlinks
9622 // that point to non-existing files the information about the symlink itself
9623 // will be returned.
9625 // If the file does not exist, the G_IO_ERROR_NOT_FOUND error will be returned.
9626 // Other errors are possible too, and depend on what kind of filesystem the file is on.
9628 // Free the returned object with g_object_unref().
9629 // RETURNS: a #GFileInfo for the given @file, or %NULL on error.
9630 // <attributes>: an attribute query string.
9631 // <flags>: a set of #GFileQueryInfoFlags.
9632 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9633 FileInfo* /*new*/ query_info()(char* attributes, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error=null) {
9634 return g_file_query_info(cast(File*)&this, attributes, flags, cancellable, error);
9637 // Asynchronously gets the requested information about specified @file. The result
9638 // is a #GFileInfo object that contains key-value attributes (such as type or size
9639 // for the file).
9641 // For more details, see g_file_query_info() which is
9642 // the synchronous version of this call.
9644 // When the operation is finished, @callback will be called. You can then call
9645 // g_file_query_info_finish() to get the result of the operation.
9646 // <attributes>: an attribute query string.
9647 // <flags>: a set of #GFileQueryInfoFlags.
9648 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
9649 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9650 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
9651 // <user_data>: the data to pass to callback function
9652 void query_info_async()(char* attributes, FileQueryInfoFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
9653 g_file_query_info_async(cast(File*)&this, attributes, flags, io_priority, cancellable, callback, user_data);
9656 // Finishes an asynchronous file info query.
9657 // See g_file_query_info_async().
9659 // Free the returned object with g_object_unref().
9660 // RETURNS: #GFileInfo for given @file or %NULL on error.
9661 // <res>: a #GAsyncResult.
9662 FileInfo* /*new*/ query_info_finish()(AsyncResult* res, GLib2.Error** error=null) {
9663 return g_file_query_info_finish(cast(File*)&this, res, error);
9666 // Obtain the list of settable attributes for the file.
9668 // Returns the type and full attribute name of all the attributes
9669 // that can be set on this file. This doesn't mean setting it will always
9670 // succeed though, you might get an access failure, or some specific
9671 // file may not support a specific attribute.
9673 // If @cancellable is not %NULL, then the operation can be cancelled by
9674 // triggering the cancellable object from another thread. If the operation
9675 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9677 // When you are done with it, release it with g_file_attribute_info_list_unref()
9678 // RETURNS: a #GFileAttributeInfoList describing the settable attributes.
9679 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9680 FileAttributeInfoList* /*new*/ query_settable_attributes()(Cancellable* cancellable, GLib2.Error** error=null) {
9681 return g_file_query_settable_attributes(cast(File*)&this, cancellable, error);
9684 // Obtain the list of attribute namespaces where new attributes
9685 // can be created by a user. An example of this is extended
9686 // attributes (in the "xattr" namespace).
9688 // If @cancellable is not %NULL, then the operation can be cancelled by
9689 // triggering the cancellable object from another thread. If the operation
9690 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9692 // When you are done with it, release it with g_file_attribute_info_list_unref()
9693 // RETURNS: a #GFileAttributeInfoList describing the writable namespaces.
9694 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9695 FileAttributeInfoList* /*new*/ query_writable_namespaces()(Cancellable* cancellable, GLib2.Error** error=null) {
9696 return g_file_query_writable_namespaces(cast(File*)&this, cancellable, error);
9699 // Opens a file for reading. The result is a #GFileInputStream that
9700 // can be used to read the contents of the file.
9702 // If @cancellable is not %NULL, then the operation can be cancelled by
9703 // triggering the cancellable object from another thread. If the operation
9704 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9706 // If the file does not exist, the G_IO_ERROR_NOT_FOUND error will be returned.
9707 // If the file is a directory, the G_IO_ERROR_IS_DIRECTORY error will be returned.
9708 // Other errors are possible too, and depend on what kind of filesystem the file is on.
9710 // Free the returned object with g_object_unref().
9711 // RETURNS: #GFileInputStream or %NULL on error.
9712 // <cancellable>: a #GCancellable
9713 FileInputStream* /*new*/ read()(Cancellable* cancellable, GLib2.Error** error=null) {
9714 return g_file_read(cast(File*)&this, cancellable, error);
9717 // Asynchronously opens @file for reading.
9719 // For more details, see g_file_read() which is
9720 // the synchronous version of this call.
9722 // When the operation is finished, @callback will be called. You can then call
9723 // g_file_read_finish() to get the result of the operation.
9724 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
9725 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9726 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
9727 // <user_data>: the data to pass to callback function
9728 void read_async()(int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
9729 g_file_read_async(cast(File*)&this, io_priority, cancellable, callback, user_data);
9732 // Finishes an asynchronous file read operation started with
9733 // g_file_read_async().
9735 // Free the returned object with g_object_unref().
9736 // RETURNS: a #GFileInputStream or %NULL on error.
9737 // <res>: a #GAsyncResult.
9738 FileInputStream* /*new*/ read_finish()(AsyncResult* res, GLib2.Error** error=null) {
9739 return g_file_read_finish(cast(File*)&this, res, error);
9742 // Returns an output stream for overwriting the file, possibly
9743 // creating a backup copy of the file first. If the file doesn't exist,
9744 // it will be created.
9746 // This will try to replace the file in the safest way possible so
9747 // that any errors during the writing will not affect an already
9748 // existing copy of the file. For instance, for local files it
9749 // may write to a temporary file and then atomically rename over
9750 // the destination when the stream is closed.
9752 // By default files created are generally readable by everyone,
9753 // but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
9754 // will be made readable only to the current user, to the level that
9755 // is supported on the target filesystem.
9757 // If @cancellable is not %NULL, then the operation can be cancelled by
9758 // triggering the cancellable object from another thread. If the operation
9759 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9761 // If you pass in a non-#NULL @etag value, then this value is
9762 // compared to the current entity tag of the file, and if they differ
9763 // an G_IO_ERROR_WRONG_ETAG error is returned. This generally means
9764 // that the file has been changed since you last read it. You can get
9765 // the new etag from g_file_output_stream_get_etag() after you've
9766 // finished writing and closed the #GFileOutputStream. When you load
9767 // a new file you can use g_file_input_stream_query_info() to get
9768 // the etag of the file.
9770 // If @make_backup is %TRUE, this function will attempt to make a backup
9771 // of the current file before overwriting it. If this fails a G_IO_ERROR_CANT_CREATE_BACKUP
9772 // error will be returned. If you want to replace anyway, try again with
9773 // @make_backup set to %FALSE.
9775 // If the file is a directory the G_IO_ERROR_IS_DIRECTORY error will be returned,
9776 // and if the file is some other form of non-regular file then a
9777 // G_IO_ERROR_NOT_REGULAR_FILE error will be returned.
9778 // Some file systems don't allow all file names, and may
9779 // return an G_IO_ERROR_INVALID_FILENAME error, and if the name
9780 // is to long G_IO_ERROR_FILENAME_TOO_LONG will be returned.
9781 // Other errors are possible too, and depend on what kind of
9782 // filesystem the file is on.
9784 // Free the returned object with g_object_unref().
9785 // RETURNS: a #GFileOutputStream or %NULL on error.
9786 // <etag>: an optional <link linkend="gfile-etag">entity tag</link> for the current #GFile, or #NULL to ignore.
9787 // <make_backup>: %TRUE if a backup should be created.
9788 // <flags>: a set of #GFileCreateFlags.
9789 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9790 FileOutputStream* /*new*/ replace()(char* etag, int make_backup, FileCreateFlags flags, Cancellable* cancellable, GLib2.Error** error=null) {
9791 return g_file_replace(cast(File*)&this, etag, make_backup, flags, cancellable, error);
9794 // Asynchronously overwrites the file, replacing the contents, possibly
9795 // creating a backup copy of the file first.
9797 // For more details, see g_file_replace() which is
9798 // the synchronous version of this call.
9800 // When the operation is finished, @callback will be called. You can then call
9801 // g_file_replace_finish() to get the result of the operation.
9802 // <etag>: an <link linkend="gfile-etag">entity tag</link> for the current #GFile, or NULL to ignore.
9803 // <make_backup>: %TRUE if a backup should be created.
9804 // <flags>: a set of #GFileCreateFlags.
9805 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
9806 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9807 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
9808 // <user_data>: the data to pass to callback function
9809 void replace_async()(char* etag, int make_backup, FileCreateFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
9810 g_file_replace_async(cast(File*)&this, etag, make_backup, flags, io_priority, cancellable, callback, user_data);
9813 // Replaces the contents of @file with @contents of @length bytes.
9814 // If @etag is specified (not %NULL) any existing file must have that etag, or
9815 // the error %G_IO_ERROR_WRONG_ETAG will be returned.
9817 // If @make_backup is %TRUE, this function will attempt to make a backup of @file.
9819 // If @cancellable is not %NULL, then the operation can be cancelled by
9820 // triggering the cancellable object from another thread. If the operation
9821 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9823 // The returned @new_etag can be used to verify that the file hasn't changed the
9824 // next time it is saved over.
9826 // has occurred, this function will return %FALSE and set @error
9827 // appropriately if present.
9828 // RETURNS: %TRUE if successful. If an error
9829 // <contents>: a string containing the new contents for @file.
9830 // <length>: the length of @contents in bytes.
9831 // <etag>: the old <link linkend="gfile-etag">entity tag</link> for the document, or %NULL
9832 // <make_backup>: %TRUE if a backup should be created.
9833 // <flags>: a set of #GFileCreateFlags.
9834 // <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
9835 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9836 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) {
9837 return g_file_replace_contents(cast(File*)&this, contents, length, etag, make_backup, flags, new_etag, cancellable, error);
9840 // Starts an asynchronous replacement of @file with the given
9841 // @contents of @length bytes. @etag will replace the document's
9842 // current entity tag.
9844 // When this operation has completed, @callback will be called with
9845 // @user_user data, and the operation can be finalized with
9846 // g_file_replace_contents_finish().
9848 // If @cancellable is not %NULL, then the operation can be cancelled by
9849 // triggering the cancellable object from another thread. If the operation
9850 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9852 // If @make_backup is %TRUE, this function will attempt to
9853 // make a backup of @file.
9854 // <contents>: string of contents to replace the file with.
9855 // <length>: the length of @contents in bytes.
9856 // <etag>: a new <link linkend="gfile-etag">entity tag</link> for the @file, or %NULL
9857 // <make_backup>: %TRUE if a backup should be created.
9858 // <flags>: a set of #GFileCreateFlags.
9859 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9860 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
9861 // <user_data>: the data to pass to callback function
9862 void replace_contents_async()(ubyte* contents, size_t length, char* etag, int make_backup, FileCreateFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
9863 g_file_replace_contents_async(cast(File*)&this, contents, length, etag, make_backup, flags, cancellable, callback, user_data);
9866 // Finishes an asynchronous replace of the given @file. See
9867 // g_file_replace_contents_async(). Sets @new_etag to the new entity
9868 // tag for the document, if present.
9869 // RETURNS: %TRUE on success, %FALSE on failure.
9870 // <res>: a #GAsyncResult.
9871 // <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
9872 int replace_contents_finish()(AsyncResult* res, /*out*/ char** new_etag, GLib2.Error** error=null) {
9873 return g_file_replace_contents_finish(cast(File*)&this, res, new_etag, error);
9876 // Finishes an asynchronous file replace operation started with
9877 // g_file_replace_async().
9879 // Free the returned object with g_object_unref().
9880 // RETURNS: a #GFileOutputStream, or %NULL on error.
9881 // <res>: a #GAsyncResult.
9882 FileOutputStream* /*new*/ replace_finish()(AsyncResult* res, GLib2.Error** error=null) {
9883 return g_file_replace_finish(cast(File*)&this, res, error);
9886 // VERSION: 2.22
9887 // Returns an output stream for overwriting the file in readwrite mode,
9888 // possibly creating a backup copy of the file first. If the file doesn't
9889 // exist, it will be created.
9891 // For details about the behaviour, see g_file_replace() which does the same
9892 // thing but returns an output stream only.
9894 // Note that in many non-local file cases read and write streams are not
9895 // supported, so make sure you really need to do read and write streaming,
9896 // rather than just opening for reading or writing.
9898 // Free the returned object with g_object_unref().
9899 // RETURNS: a #GFileIOStream or %NULL on error.
9900 // <etag>: an optional <link linkend="gfile-etag">entity tag</link> for the current #GFile, or #NULL to ignore
9901 // <make_backup>: %TRUE if a backup should be created
9902 // <flags>: a set of #GFileCreateFlags
9903 // <cancellable>: optional #GCancellable object, %NULL to ignore
9904 FileIOStream* /*new*/ replace_readwrite()(char* etag, int make_backup, FileCreateFlags flags, Cancellable* cancellable, GLib2.Error** error=null) {
9905 return g_file_replace_readwrite(cast(File*)&this, etag, make_backup, flags, cancellable, error);
9908 // VERSION: 2.22
9909 // Asynchronously overwrites the file in read-write mode, replacing the
9910 // contents, possibly creating a backup copy of the file first.
9912 // For more details, see g_file_replace_readwrite() which is
9913 // the synchronous version of this call.
9915 // When the operation is finished, @callback will be called. You can then
9916 // call g_file_replace_readwrite_finish() to get the result of the operation.
9917 // <etag>: an <link linkend="gfile-etag">entity tag</link> for the current #GFile, or NULL to ignore.
9918 // <make_backup>: %TRUE if a backup should be created.
9919 // <flags>: a set of #GFileCreateFlags.
9920 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
9921 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9922 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
9923 // <user_data>: the data to pass to callback function
9924 void replace_readwrite_async()(char* etag, int make_backup, FileCreateFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
9925 g_file_replace_readwrite_async(cast(File*)&this, etag, make_backup, flags, io_priority, cancellable, callback, user_data);
9928 // VERSION: 2.22
9929 // Finishes an asynchronous file replace operation started with
9930 // g_file_replace_readwrite_async().
9932 // Free the returned object with g_object_unref().
9933 // RETURNS: a #GFileIOStream, or %NULL on error.
9934 // <res>: a #GAsyncResult.
9935 FileIOStream* /*new*/ replace_readwrite_finish()(AsyncResult* res, GLib2.Error** error=null) {
9936 return g_file_replace_readwrite_finish(cast(File*)&this, res, error);
9939 // Resolves a relative path for @file to an absolute path.
9941 // This call does no blocking i/o.
9943 // is %NULL or if @file is invalid.
9944 // Free the returned object with g_object_unref().
9945 // RETURNS: #GFile to the resolved path. %NULL if @relative_path
9946 // <relative_path>: a given relative path string.
9947 File* /*new*/ resolve_relative_path()(char* relative_path) {
9948 return g_file_resolve_relative_path(cast(File*)&this, relative_path);
9951 // Sets an attribute in the file with attribute name @attribute to @value.
9953 // Some attributes can be unset by setting @attribute to
9954 // %G_FILE_ATTRIBUTE_TYPE_INVALID and @value to %NULL.
9956 // If @cancellable is not %NULL, then the operation can be cancelled by
9957 // triggering the cancellable object from another thread. If the operation
9958 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9959 // RETURNS: %TRUE if the attribute was set, %FALSE otherwise.
9960 // <attribute>: a string containing the attribute's name.
9961 // <type>: The type of the attribute
9962 // <value_p>: a pointer to the value (or the pointer itself if the type is a pointer type)
9963 // <flags>: a set of #GFileQueryInfoFlags.
9964 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9965 int set_attribute()(char* attribute, FileAttributeType type, void* value_p, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error=null) {
9966 return g_file_set_attribute(cast(File*)&this, attribute, type, value_p, flags, cancellable, error);
9969 // Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING to @value.
9970 // If @attribute is of a different type, this operation will fail,
9971 // returning %FALSE.
9973 // If @cancellable is not %NULL, then the operation can be cancelled by
9974 // triggering the cancellable object from another thread. If the operation
9975 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9977 // in the @file, %FALSE otherwise.
9978 // RETURNS: %TRUE if the @attribute was successfully set to @value
9979 // <attribute>: a string containing the attribute's name.
9980 // <value>: a string containing the attribute's new value.
9981 // <flags>: a #GFileQueryInfoFlags.
9982 // <cancellable>: optional #GCancellable object, %NULL to ignore.
9983 int set_attribute_byte_string()(char* attribute, char* value, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error=null) {
9984 return g_file_set_attribute_byte_string(cast(File*)&this, attribute, value, flags, cancellable, error);
9987 // Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_INT32 to @value.
9988 // If @attribute is of a different type, this operation will fail.
9990 // If @cancellable is not %NULL, then the operation can be cancelled by
9991 // triggering the cancellable object from another thread. If the operation
9992 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
9994 // in the @file, %FALSE otherwise.
9995 // RETURNS: %TRUE if the @attribute was successfully set to @value
9996 // <attribute>: a string containing the attribute's name.
9997 // <value>: a #gint32 containing the attribute's new value.
9998 // <flags>: a #GFileQueryInfoFlags.
9999 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10000 int set_attribute_int32()(char* attribute, int value, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error=null) {
10001 return g_file_set_attribute_int32(cast(File*)&this, attribute, value, flags, cancellable, error);
10004 // Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_INT64 to @value.
10005 // If @attribute is of a different type, this operation will fail.
10007 // If @cancellable is not %NULL, then the operation can be cancelled by
10008 // triggering the cancellable object from another thread. If the operation
10009 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10010 // RETURNS: %TRUE if the @attribute was successfully set, %FALSE otherwise.
10011 // <attribute>: a string containing the attribute's name.
10012 // <value>: a #guint64 containing the attribute's new value.
10013 // <flags>: a #GFileQueryInfoFlags.
10014 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10015 int set_attribute_int64()(char* attribute, long value, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error=null) {
10016 return g_file_set_attribute_int64(cast(File*)&this, attribute, value, flags, cancellable, error);
10019 // Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_STRING to @value.
10020 // If @attribute is of a different type, this operation will fail.
10022 // If @cancellable is not %NULL, then the operation can be cancelled by
10023 // triggering the cancellable object from another thread. If the operation
10024 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10025 // RETURNS: %TRUE if the @attribute was successfully set, %FALSE otherwise.
10026 // <attribute>: a string containing the attribute's name.
10027 // <value>: a string containing the attribute's value.
10028 // <flags>: #GFileQueryInfoFlags.
10029 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10030 int set_attribute_string()(char* attribute, char* value, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error=null) {
10031 return g_file_set_attribute_string(cast(File*)&this, attribute, value, flags, cancellable, error);
10034 // Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_UINT32 to @value.
10035 // If @attribute is of a different type, this operation will fail.
10037 // If @cancellable is not %NULL, then the operation can be cancelled by
10038 // triggering the cancellable object from another thread. If the operation
10039 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10041 // in the @file, %FALSE otherwise.
10042 // RETURNS: %TRUE if the @attribute was successfully set to @value
10043 // <attribute>: a string containing the attribute's name.
10044 // <value>: a #guint32 containing the attribute's new value.
10045 // <flags>: a #GFileQueryInfoFlags.
10046 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10047 int set_attribute_uint32()(char* attribute, uint value, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error=null) {
10048 return g_file_set_attribute_uint32(cast(File*)&this, attribute, value, flags, cancellable, error);
10051 // Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_UINT64 to @value.
10052 // If @attribute is of a different type, this operation will fail.
10054 // If @cancellable is not %NULL, then the operation can be cancelled by
10055 // triggering the cancellable object from another thread. If the operation
10056 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10058 // in the @file, %FALSE otherwise.
10059 // RETURNS: %TRUE if the @attribute was successfully set to @value
10060 // <attribute>: a string containing the attribute's name.
10061 // <value>: a #guint64 containing the attribute's new value.
10062 // <flags>: a #GFileQueryInfoFlags.
10063 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10064 int set_attribute_uint64()(char* attribute, ulong value, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error=null) {
10065 return g_file_set_attribute_uint64(cast(File*)&this, attribute, value, flags, cancellable, error);
10068 // Asynchronously sets the attributes of @file with @info.
10070 // For more details, see g_file_set_attributes_from_info() which is
10071 // the synchronous version of this call.
10073 // When the operation is finished, @callback will be called. You can then call
10074 // g_file_set_attributes_finish() to get the result of the operation.
10075 // <info>: a #GFileInfo.
10076 // <flags>: a #GFileQueryInfoFlags.
10077 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
10078 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10079 // <callback>: a #GAsyncReadyCallback.
10080 // <user_data>: a #gpointer.
10081 void set_attributes_async()(FileInfo* info, FileQueryInfoFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
10082 g_file_set_attributes_async(cast(File*)&this, info, flags, io_priority, cancellable, callback, user_data);
10085 // Finishes setting an attribute started in g_file_set_attributes_async().
10086 // RETURNS: %TRUE if the attributes were set correctly, %FALSE otherwise.
10087 // <result>: a #GAsyncResult.
10088 // <info>: a #GFileInfo.
10089 int set_attributes_finish()(AsyncResult* result, /*out*/ FileInfo** info, GLib2.Error** error=null) {
10090 return g_file_set_attributes_finish(cast(File*)&this, result, info, error);
10093 // Tries to set all attributes in the #GFileInfo on the target values,
10094 // not stopping on the first error.
10096 // If there is any error during this operation then @error will be set to
10097 // the first error. Error on particular fields are flagged by setting
10098 // the "status" field in the attribute value to
10099 // %G_FILE_ATTRIBUTE_STATUS_ERROR_SETTING, which means you can also detect
10100 // further errors.
10102 // If @cancellable is not %NULL, then the operation can be cancelled by
10103 // triggering the cancellable object from another thread. If the operation
10104 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10105 // RETURNS: %TRUE if there was any error, %FALSE otherwise.
10106 // <info>: a #GFileInfo.
10107 // <flags>: #GFileQueryInfoFlags
10108 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10109 int set_attributes_from_info()(FileInfo* info, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error=null) {
10110 return g_file_set_attributes_from_info(cast(File*)&this, info, flags, cancellable, error);
10113 // Renames @file to the specified display name.
10115 // The display name is converted from UTF8 to the correct encoding for the target
10116 // filesystem if possible and the @file is renamed to this.
10118 // If you want to implement a rename operation in the user interface the edit name
10119 // (#G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME) should be used as the initial value in the rename
10120 // widget, and then the result after editing should be passed to g_file_set_display_name().
10122 // On success the resulting converted filename is returned.
10124 // If @cancellable is not %NULL, then the operation can be cancelled by
10125 // triggering the cancellable object from another thread. If the operation
10126 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10128 // if there was an error.
10129 // Free the returned object with g_object_unref().
10130 // RETURNS: a #GFile specifying what @file was renamed to, or %NULL
10131 // <display_name>: a string.
10132 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10133 File* /*new*/ set_display_name()(char* display_name, Cancellable* cancellable, GLib2.Error** error=null) {
10134 return g_file_set_display_name(cast(File*)&this, display_name, cancellable, error);
10137 // Asynchronously sets the display name for a given #GFile.
10139 // For more details, see g_file_set_display_name() which is
10140 // the synchronous version of this call.
10142 // When the operation is finished, @callback will be called. You can then call
10143 // g_file_set_display_name_finish() to get the result of the operation.
10144 // <display_name>: a string.
10145 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
10146 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10147 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
10148 // <user_data>: the data to pass to callback function
10149 void set_display_name_async()(char* display_name, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
10150 g_file_set_display_name_async(cast(File*)&this, display_name, io_priority, cancellable, callback, user_data);
10153 // Finishes setting a display name started with
10154 // g_file_set_display_name_async().
10156 // Free the returned object with g_object_unref().
10157 // RETURNS: a #GFile or %NULL on error.
10158 // <res>: a #GAsyncResult.
10159 File* /*new*/ set_display_name_finish()(AsyncResult* res, GLib2.Error** error=null) {
10160 return g_file_set_display_name_finish(cast(File*)&this, res, error);
10163 // VERSION: 2.22
10164 // Starts a file of type G_FILE_TYPE_MOUNTABLE.
10165 // Using @start_operation, you can request callbacks when, for instance,
10166 // passwords are needed during authentication.
10168 // If @cancellable is not %NULL, then the operation can be cancelled by
10169 // triggering the cancellable object from another thread. If the operation
10170 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10172 // When the operation is finished, @callback will be called. You can then call
10173 // g_file_mount_mountable_finish() to get the result of the operation.
10174 // <flags>: flags affecting the operation
10175 // <start_operation>: a #GMountOperation, or %NULL to avoid user interaction.
10176 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10177 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
10178 // <user_data>: the data to pass to callback function
10179 void start_mountable()(DriveStartFlags flags, MountOperation* start_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
10180 g_file_start_mountable(cast(File*)&this, flags, start_operation, cancellable, callback, user_data);
10183 // VERSION: 2.22
10184 // Finishes a start operation. See g_file_start_mountable() for details.
10186 // Finish an asynchronous start operation that was started
10187 // with g_file_start_mountable().
10189 // otherwise.
10190 // RETURNS: %TRUE if the operation finished successfully. %FALSE
10191 // <result>: a #GAsyncResult.
10192 int start_mountable_finish()(AsyncResult* result, GLib2.Error** error=null) {
10193 return g_file_start_mountable_finish(cast(File*)&this, result, error);
10196 // VERSION: 2.22
10197 // Stops a file of type G_FILE_TYPE_MOUNTABLE.
10199 // If @cancellable is not %NULL, then the operation can be cancelled by
10200 // triggering the cancellable object from another thread. If the operation
10201 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10203 // When the operation is finished, @callback will be called. You can then call
10204 // g_file_stop_mountable_finish() to get the result of the operation.
10205 // <flags>: flags affecting the operation
10206 // <mount_operation>: a #GMountOperation, or %NULL to avoid user interaction.
10207 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10208 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
10209 // <user_data>: the data to pass to callback function
10210 void stop_mountable()(MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
10211 g_file_stop_mountable(cast(File*)&this, flags, mount_operation, cancellable, callback, user_data);
10214 // VERSION: 2.22
10215 // Finishes an stop operation, see g_file_stop_mountable() for details.
10217 // Finish an asynchronous stop operation that was started
10218 // with g_file_stop_mountable().
10220 // otherwise.
10221 // RETURNS: %TRUE if the operation finished successfully. %FALSE
10222 // <result>: a #GAsyncResult.
10223 int stop_mountable_finish()(AsyncResult* result, GLib2.Error** error=null) {
10224 return g_file_stop_mountable_finish(cast(File*)&this, result, error);
10227 // VERSION: 2.22
10228 // Checks if @file supports <link
10229 // linkend="g-main-context-push-thread-default-context">thread-default
10230 // contexts</link>. If this returns %FALSE, you cannot perform
10231 // asynchronous operations on @file in a thread that has a
10232 // thread-default context.
10233 // RETURNS: Whether or not @file supports thread-default contexts.
10234 int supports_thread_contexts()() {
10235 return g_file_supports_thread_contexts(cast(File*)&this);
10238 // Sends @file to the "Trashcan", if possible. This is similar to
10239 // deleting it, but the user can recover it before emptying the trashcan.
10240 // Not all file systems support trashing, so this call can return the
10241 // %G_IO_ERROR_NOT_SUPPORTED error.
10244 // If @cancellable is not %NULL, then the operation can be cancelled by
10245 // triggering the cancellable object from another thread. If the operation
10246 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10247 // RETURNS: %TRUE on successful trash, %FALSE otherwise.
10248 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10249 int trash()(Cancellable* cancellable, GLib2.Error** error=null) {
10250 return g_file_trash(cast(File*)&this, cancellable, error);
10253 // DEPRECATED (v2.22) method: unmount_mountable - Use g_file_unmount_mountable_with_operation() instead.
10254 // Unmounts a file of type G_FILE_TYPE_MOUNTABLE.
10256 // If @cancellable is not %NULL, then the operation can be cancelled by
10257 // triggering the cancellable object from another thread. If the operation
10258 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10260 // When the operation is finished, @callback will be called. You can then call
10261 // g_file_unmount_mountable_finish() to get the result of the operation.
10262 // <flags>: flags affecting the operation
10263 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10264 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
10265 // <user_data>: the data to pass to callback function
10266 void unmount_mountable()(MountUnmountFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
10267 g_file_unmount_mountable(cast(File*)&this, flags, cancellable, callback, user_data);
10270 // DEPRECATED (v2.22) method: unmount_mountable_finish - Use g_file_unmount_mountable_with_operation_finish() instead.
10271 // Finishes an unmount operation, see g_file_unmount_mountable() for details.
10273 // Finish an asynchronous unmount operation that was started
10274 // with g_file_unmount_mountable().
10276 // otherwise.
10277 // RETURNS: %TRUE if the operation finished successfully. %FALSE
10278 // <result>: a #GAsyncResult.
10279 int unmount_mountable_finish()(AsyncResult* result, GLib2.Error** error=null) {
10280 return g_file_unmount_mountable_finish(cast(File*)&this, result, error);
10283 // VERSION: 2.22
10284 // Unmounts a file of type G_FILE_TYPE_MOUNTABLE.
10286 // If @cancellable is not %NULL, then the operation can be cancelled by
10287 // triggering the cancellable object from another thread. If the operation
10288 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
10290 // When the operation is finished, @callback will be called. You can then call
10291 // g_file_unmount_mountable_finish() to get the result of the operation.
10292 // <flags>: flags affecting the operation
10293 // <mount_operation>: a #GMountOperation, or %NULL to avoid user interaction.
10294 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10295 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
10296 // <user_data>: the data to pass to callback function
10297 void unmount_mountable_with_operation()(MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
10298 g_file_unmount_mountable_with_operation(cast(File*)&this, flags, mount_operation, cancellable, callback, user_data);
10301 // VERSION: 2.22
10302 // Finishes an unmount operation, see g_file_unmount_mountable_with_operation() for details.
10304 // Finish an asynchronous unmount operation that was started
10305 // with g_file_unmount_mountable_with_operation().
10307 // otherwise.
10308 // RETURNS: %TRUE if the operation finished successfully. %FALSE
10309 // <result>: a #GAsyncResult.
10310 int unmount_mountable_with_operation_finish()(AsyncResult* result, GLib2.Error** error=null) {
10311 return g_file_unmount_mountable_with_operation_finish(cast(File*)&this, result, error);
10314 mixin __interface__;
10317 // Information about a specific attribute.
10318 struct FileAttributeInfo {
10319 char* name;
10320 FileAttributeType type;
10321 FileAttributeInfoFlags flags;
10324 // Flags specifying the behaviour of an attribute.
10325 enum FileAttributeInfoFlags {
10326 NONE = 0,
10327 COPY_WITH_FILE = 1,
10328 COPY_WHEN_MOVED = 2
10331 // Acts as a lightweight registry for possible valid file attributes.
10332 // The registry stores Key-Value pair formats as #GFileAttributeInfo<!-- -->s.
10333 struct FileAttributeInfoList {
10334 FileAttributeInfo* infos;
10335 int n_infos;
10338 // Creates a new file attribute info list.
10339 // RETURNS: a #GFileAttributeInfoList.
10340 static FileAttributeInfoList* /*new*/ new_()() {
10341 return g_file_attribute_info_list_new();
10344 // Adds a new attribute with @name to the @list, setting
10345 // its @type and @flags.
10346 // <name>: the name of the attribute to add.
10347 // <type>: the #GFileAttributeType for the attribute.
10348 // <flags>: #GFileAttributeInfoFlags for the attribute.
10349 void add()(char* name, FileAttributeType type, FileAttributeInfoFlags flags) {
10350 g_file_attribute_info_list_add(&this, name, type, flags);
10353 // Makes a duplicate of a file attribute info list.
10354 // RETURNS: a copy of the given @list.
10355 FileAttributeInfoList* /*new*/ dup()() {
10356 return g_file_attribute_info_list_dup(&this);
10359 // Gets the file attribute with the name @name from @list.
10361 // attribute isn't found.
10362 // RETURNS: a #GFileAttributeInfo for the @name, or %NULL if an
10363 // <name>: the name of the attribute to lookup.
10364 FileAttributeInfo* lookup()(char* name) {
10365 return g_file_attribute_info_list_lookup(&this, name);
10368 // References a file attribute info list.
10369 // RETURNS: #GFileAttributeInfoList or %NULL on error.
10370 FileAttributeInfoList* /*new*/ ref_()() {
10371 return g_file_attribute_info_list_ref(&this);
10374 // Removes a reference from the given @list. If the reference count
10375 // falls to zero, the @list is deleted.
10376 void unref()() {
10377 g_file_attribute_info_list_unref(&this);
10381 // Determines if a string matches a file attribute.
10382 struct FileAttributeMatcher {
10384 // Creates a new file attribute matcher, which matches attributes
10385 // against a given string. #GFileAttributeMatcher<!-- -->s are reference
10386 // counted structures, and are created with a reference count of 1. If
10387 // the number of references falls to 0, the #GFileAttributeMatcher is
10388 // automatically destroyed.
10390 // The @attribute string should be formatted with specific keys separated
10391 // from namespaces with a double colon. Several "namespace::key" strings may be
10392 // concatenated with a single comma (e.g. "standard::type,standard::is-hidden").
10393 // The wildcard "*" may be used to match all keys and namespaces, or
10394 // "namespace::*" will match all keys in a given namespace.
10396 // Examples of strings to use:
10397 // <table>
10398 // <title>File Attribute Matcher strings and results</title>
10399 // <tgroup cols='2' align='left'><thead>
10400 // <row><entry> Matcher String </entry><entry> Matches </entry></row></thead>
10401 // <tbody>
10402 // <row><entry>"*"</entry><entry>matches all attributes.</entry></row>
10403 // <row><entry>"standard::is-hidden"</entry><entry>matches only the key is-hidden in the standard namespace.</entry></row>
10404 // <row><entry>"standard::type,unix::*"</entry><entry>matches the type key in the standard namespace and
10405 // all keys in the unix namespace.</entry></row>
10406 // </tbody></tgroup>
10407 // </table>
10408 // RETURNS: a #GFileAttributeMatcher.
10409 // <attributes>: an attribute string to match.
10410 static FileAttributeMatcher* /*new*/ new_()(char* attributes) {
10411 return g_file_attribute_matcher_new(attributes);
10414 // Checks if the matcher will match all of the keys in a given namespace.
10415 // This will always return %TRUE if a wildcard character is in use (e.g. if
10416 // matcher was created with "standard::*" and @ns is "standard", or if matcher was created
10417 // using "*" and namespace is anything.)
10419 // TODO: this is awkwardly worded.
10421 // in the given @ns, %FALSE otherwise.
10422 // RETURNS: %TRUE if the matcher matches all of the entries
10423 // <ns>: a string containing a file attribute namespace.
10424 int enumerate_namespace()(char* ns) {
10425 return g_file_attribute_matcher_enumerate_namespace(&this, ns);
10428 // Gets the next matched attribute from a #GFileAttributeMatcher.
10430 // no more attribute exist.
10431 // RETURNS: a string containing the next attribute or %NULL if
10432 char* enumerate_next()() {
10433 return g_file_attribute_matcher_enumerate_next(&this);
10436 // Checks if an attribute will be matched by an attribute matcher. If
10437 // the matcher was created with the "*" matching string, this function
10438 // will always return %TRUE.
10439 // RETURNS: %TRUE if @attribute matches @matcher. %FALSE otherwise.
10440 // <attribute>: a file attribute key.
10441 int matches()(char* attribute) {
10442 return g_file_attribute_matcher_matches(&this, attribute);
10445 // Checks if a attribute matcher only matches a given attribute. Always
10446 // returns %FALSE if "*" was used when creating the matcher.
10447 // RETURNS: %TRUE if the matcher only matches @attribute. %FALSE otherwise.
10448 // <attribute>: a file attribute key.
10449 int matches_only()(char* attribute) {
10450 return g_file_attribute_matcher_matches_only(&this, attribute);
10453 // References a file attribute matcher.
10454 // RETURNS: a #GFileAttributeMatcher.
10455 FileAttributeMatcher* /*new*/ ref_()() {
10456 return g_file_attribute_matcher_ref(&this);
10459 // Unreferences @matcher. If the reference count falls below 1,
10460 // the @matcher is automatically freed.
10461 void unref()() {
10462 g_file_attribute_matcher_unref(&this);
10466 // Used by g_file_set_attributes_from_info() when setting file attributes.
10467 enum FileAttributeStatus {
10468 UNSET = 0,
10469 SET = 1,
10470 ERROR_SETTING = 2
10472 // The data types for file attributes.
10473 enum FileAttributeType {
10474 INVALID = 0,
10475 STRING = 1,
10476 BYTE_STRING = 2,
10477 BOOLEAN = 3,
10478 UINT32 = 4,
10479 INT32 = 5,
10480 UINT64 = 6,
10481 INT64 = 7,
10482 OBJECT = 8,
10483 STRINGV = 9
10485 // Flags used when copying or moving files.
10486 enum FileCopyFlags {
10487 NONE = 0,
10488 OVERWRITE = 1,
10489 BACKUP = 2,
10490 NOFOLLOW_SYMLINKS = 4,
10491 ALL_METADATA = 8,
10492 NO_FALLBACK_FOR_MOVE = 16,
10493 TARGET_DEFAULT_PERMS = 32
10495 // Flags used when an operation may create a file.
10496 enum FileCreateFlags {
10497 NONE = 0,
10498 PRIVATE = 1,
10499 REPLACE_DESTINATION = 2
10502 // #GFileDescriptorBased is implemented by streams (implementations of
10503 // #GInputStream or #GOutputStream) that are based on file descriptors.
10505 // Note that <filename>&lt;gio/gfiledescriptorbased.h&gt;</filename> belongs to
10506 // the UNIX-specific GIO interfaces, thus you have to use the
10507 // <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
10508 struct FileDescriptorBased /* Interface */ {
10509 mixin template __interface__() {
10510 // VERSION: 2.24
10511 // Gets the underlying file descriptor.
10512 // RETURNS: The file descriptor
10513 int get_fd()() {
10514 return g_file_descriptor_based_get_fd(cast(FileDescriptorBased*)&this);
10517 mixin __interface__;
10520 struct FileDescriptorBasedIface {
10521 GObject2.TypeInterface g_iface;
10522 // RETURNS: The file descriptor
10523 extern (C) int function (FileDescriptorBased* fd_based) get_fd;
10527 // #GFileEnumerator allows you to operate on a set of #GFile<!-- -->s,
10528 // returning a #GFileInfo structure for each file enumerated (e.g.
10529 // g_file_enumerate_children() will return a #GFileEnumerator for each
10530 // of the children within a directory).
10532 // To get the next file's information from a #GFileEnumerator, use
10533 // g_file_enumerator_next_file() or its asynchronous version,
10534 // g_file_enumerator_next_files_async(). Note that the asynchronous
10535 // version will return a list of #GFileInfo<!---->s, whereas the
10536 // synchronous will only return the next file in the enumerator.
10538 // To close a #GFileEnumerator, use g_file_enumerator_close(), or
10539 // its asynchronous version, g_file_enumerator_close_async(). Once
10540 // a #GFileEnumerator is closed, no further actions may be performed
10541 // on it, and it should be freed with g_object_unref().
10542 struct FileEnumerator /* : GObject.Object */ {
10543 alias parent_instance this;
10544 alias parent_instance super_;
10545 alias parent_instance object;
10546 GObject2.Object parent_instance;
10547 private FileEnumeratorPrivate* priv;
10550 // Releases all resources used by this enumerator, making the
10551 // enumerator return %G_IO_ERROR_CLOSED on all calls.
10553 // This will be automatically called when the last reference
10554 // is dropped, but you might want to call this function to make
10555 // sure resources are released as early as possible.
10556 // RETURNS: #TRUE on success or #FALSE on error.
10557 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10558 int close()(Cancellable* cancellable, GLib2.Error** error=null) {
10559 return g_file_enumerator_close(&this, cancellable, error);
10562 // Asynchronously closes the file enumerator.
10564 // If @cancellable is not %NULL, then the operation can be cancelled by
10565 // triggering the cancellable object from another thread. If the operation
10566 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned in
10567 // g_file_enumerator_close_finish().
10568 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
10569 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10570 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
10571 // <user_data>: the data to pass to callback function
10572 void close_async()(int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
10573 g_file_enumerator_close_async(&this, io_priority, cancellable, callback, user_data);
10576 // Finishes closing a file enumerator, started from g_file_enumerator_close_async().
10578 // If the file enumerator was already closed when g_file_enumerator_close_async()
10579 // was called, then this function will report %G_IO_ERROR_CLOSED in @error, and
10580 // return %FALSE. If the file enumerator had pending operation when the close
10581 // operation was started, then this function will report %G_IO_ERROR_PENDING, and
10582 // return %FALSE. If @cancellable was not %NULL, then the operation may have been
10583 // cancelled by triggering the cancellable object from another thread. If the operation
10584 // was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %FALSE will be
10585 // returned.
10586 // RETURNS: %TRUE if the close operation has finished successfully.
10587 // <result>: a #GAsyncResult.
10588 int close_finish()(AsyncResult* result, GLib2.Error** error=null) {
10589 return g_file_enumerator_close_finish(&this, result, error);
10592 // VERSION: 2.18
10593 // Get the #GFile container which is being enumerated.
10594 // RETURNS: the #GFile which is being enumerated.
10595 File* get_container()() {
10596 return g_file_enumerator_get_container(&this);
10599 // Checks if the file enumerator has pending operations.
10600 // RETURNS: %TRUE if the @enumerator has pending operations.
10601 int has_pending()() {
10602 return g_file_enumerator_has_pending(&this);
10605 // Checks if the file enumerator has been closed.
10606 // RETURNS: %TRUE if the @enumerator is closed.
10607 int is_closed()() {
10608 return g_file_enumerator_is_closed(&this);
10611 // Returns information for the next file in the enumerated object.
10612 // Will block until the information is available. The #GFileInfo
10613 // returned from this function will contain attributes that match the
10614 // attribute string that was passed when the #GFileEnumerator was created.
10616 // On error, returns %NULL and sets @error to the error. If the
10617 // enumerator is at the end, %NULL will be returned and @error will
10618 // be unset.
10620 // Free the returned object with g_object_unref() when no longer needed.
10621 // RETURNS: A #GFileInfo or %NULL on error or end of enumerator.
10622 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10623 FileInfo* /*new*/ next_file()(Cancellable* cancellable, GLib2.Error** error=null) {
10624 return g_file_enumerator_next_file(&this, cancellable, error);
10627 // Request information for a number of files from the enumerator asynchronously.
10628 // When all i/o for the operation is finished the @callback will be called with
10629 // the requested information.
10631 // The callback can be called with less than @num_files files in case of error
10632 // or at the end of the enumerator. In case of a partial error the callback will
10633 // be called with any succeeding items and no error, and on the next request the
10634 // error will be reported. If a request is cancelled the callback will be called
10635 // with %G_IO_ERROR_CANCELLED.
10637 // During an async request no other sync and async calls are allowed, and will
10638 // result in %G_IO_ERROR_PENDING errors.
10640 // Any outstanding i/o request with higher priority (lower numerical value) will
10641 // be executed before an outstanding request with lower priority. Default
10642 // priority is %G_PRIORITY_DEFAULT.
10643 // <num_files>: the number of file info objects to request
10644 // <io_priority>: the <link linkend="gioscheduler">io priority</link> of the request.
10645 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10646 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
10647 // <user_data>: the data to pass to callback function
10648 void next_files_async()(int num_files, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
10649 g_file_enumerator_next_files_async(&this, num_files, io_priority, cancellable, callback, user_data);
10652 // Finishes the asynchronous operation started with g_file_enumerator_next_files_async().
10654 // g_list_free() and unref the infos with g_object_unref() when you're
10655 // done with them.
10656 // RETURNS: a #GList of #GFileInfo<!---->s. You must free the list with
10657 // <result>: a #GAsyncResult.
10658 GLib2.List* /*new*/ next_files_finish()(AsyncResult* result, GLib2.Error** error=null) {
10659 return g_file_enumerator_next_files_finish(&this, result, error);
10662 // Sets the file enumerator as having pending operations.
10663 // <pending>: a boolean value.
10664 void set_pending()(int pending) {
10665 g_file_enumerator_set_pending(&this, pending);
10669 struct FileEnumeratorClass {
10670 GObject2.ObjectClass parent_class;
10672 // RETURNS: A #GFileInfo or %NULL on error or end of enumerator.
10673 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10674 extern (C) FileInfo* /*new*/ function (FileEnumerator* enumerator, Cancellable* cancellable, GLib2.Error** error=null) next_file;
10675 extern (C) int function (FileEnumerator* enumerator, Cancellable* cancellable, GLib2.Error** error=null) close_fn;
10677 // <num_files>: the number of file info objects to request
10678 // <io_priority>: the <link linkend="gioscheduler">io priority</link> of the request.
10679 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10680 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
10681 // <user_data>: the data to pass to callback function
10682 extern (C) void function (FileEnumerator* enumerator, int num_files, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) next_files_async;
10684 // RETURNS: a #GList of #GFileInfo<!---->s. You must free the list with
10685 // <result>: a #GAsyncResult.
10686 extern (C) GLib2.List* /*new*/ function (FileEnumerator* enumerator, AsyncResult* result, GLib2.Error** error=null) next_files_finish;
10688 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
10689 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10690 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
10691 // <user_data>: the data to pass to callback function
10692 extern (C) void function (FileEnumerator* enumerator, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) close_async;
10694 // RETURNS: %TRUE if the close operation has finished successfully.
10695 // <result>: a #GAsyncResult.
10696 extern (C) int function (FileEnumerator* enumerator, AsyncResult* result, GLib2.Error** error=null) close_finish;
10697 extern (C) void function () _g_reserved1;
10698 extern (C) void function () _g_reserved2;
10699 extern (C) void function () _g_reserved3;
10700 extern (C) void function () _g_reserved4;
10701 extern (C) void function () _g_reserved5;
10702 extern (C) void function () _g_reserved6;
10703 extern (C) void function () _g_reserved7;
10706 struct FileEnumeratorPrivate {
10710 // GFileIOStream provides io streams that both read and write to the same
10711 // file handle.
10713 // GFileIOStream implements #GSeekable, which allows the io
10714 // stream to jump to arbitrary positions in the file and to truncate
10715 // the file, provided the filesystem of the file supports these
10716 // operations.
10718 // To find the position of a file io stream, use
10719 // g_seekable_tell().
10721 // To find out if a file io stream supports seeking, use g_seekable_can_seek().
10722 // To position a file io stream, use g_seekable_seek().
10723 // To find out if a file io stream supports truncating, use
10724 // g_seekable_can_truncate(). To truncate a file io
10725 // stream, use g_seekable_truncate().
10727 // The default implementation of all the #GFileIOStream operations
10728 // and the implementation of #GSeekable just call into the same operations
10729 // on the output stream.
10730 struct FileIOStream /* : IOStream */ {
10731 mixin Seekable.__interface__;
10732 alias parent_instance this;
10733 alias parent_instance super_;
10734 alias parent_instance iostream;
10735 IOStream parent_instance;
10736 private FileIOStreamPrivate* priv;
10739 // VERSION: 2.22
10740 // Gets the entity tag for the file when it has been written.
10741 // This must be called after the stream has been written
10742 // and closed, as the etag can change while writing.
10743 // RETURNS: the entity tag for the stream.
10744 char* /*new*/ get_etag()() {
10745 return g_file_io_stream_get_etag(&this);
10748 // VERSION: 2.22
10749 // Queries a file io stream for the given @attributes.
10750 // This function blocks while querying the stream. For the asynchronous
10751 // version of this function, see g_file_io_stream_query_info_async().
10752 // While the stream is blocked, the stream will set the pending flag
10753 // internally, and any other operations on the stream will fail with
10754 // %G_IO_ERROR_PENDING.
10756 // Can fail if the stream was already closed (with @error being set to
10757 // %G_IO_ERROR_CLOSED), the stream has pending operations (with @error being
10758 // set to %G_IO_ERROR_PENDING), or if querying info is not supported for
10759 // the stream's interface (with @error being set to %G_IO_ERROR_NOT_SUPPORTED). I
10760 // all cases of failure, %NULL will be returned.
10762 // If @cancellable is not %NULL, then the operation can be cancelled by
10763 // triggering the cancellable object from another thread. If the operation
10764 // was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %NULL will
10765 // be returned.
10766 // RETURNS: a #GFileInfo for the @stream, or %NULL on error.
10767 // <attributes>: a file attribute query string.
10768 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10769 FileInfo* /*new*/ query_info()(char* attributes, Cancellable* cancellable, GLib2.Error** error=null) {
10770 return g_file_io_stream_query_info(&this, attributes, cancellable, error);
10773 // VERSION: 2.22
10774 // Asynchronously queries the @stream for a #GFileInfo. When completed,
10775 // @callback will be called with a #GAsyncResult which can be used to
10776 // finish the operation with g_file_io_stream_query_info_finish().
10778 // For the synchronous version of this function, see
10779 // g_file_io_stream_query_info().
10780 // <attributes>: a file attribute query string.
10781 // <io_priority>: the <link linkend="gio-GIOScheduler">I/O priority</link> of the request.
10782 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10783 // <callback>: callback to call when the request is satisfied
10784 // <user_data>: the data to pass to callback function
10785 void query_info_async()(char* attributes, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
10786 g_file_io_stream_query_info_async(&this, attributes, io_priority, cancellable, callback, user_data);
10789 // VERSION: 2.22
10790 // Finalizes the asynchronous query started
10791 // by g_file_io_stream_query_info_async().
10792 // RETURNS: A #GFileInfo for the finished query.
10793 // <result>: a #GAsyncResult.
10794 FileInfo* /*new*/ query_info_finish()(AsyncResult* result, GLib2.Error** error=null) {
10795 return g_file_io_stream_query_info_finish(&this, result, error);
10799 struct FileIOStreamClass {
10800 IOStreamClass parent_class;
10801 extern (C) long function (FileIOStream* stream) tell;
10802 extern (C) int function (FileIOStream* stream) can_seek;
10803 extern (C) int function (FileIOStream* stream, long offset, GLib2.SeekType type, Cancellable* cancellable, GLib2.Error** error=null) seek;
10804 extern (C) int function (FileIOStream* stream) can_truncate;
10805 extern (C) int function (FileIOStream* stream, long size, Cancellable* cancellable, GLib2.Error** error=null) truncate_fn;
10807 // RETURNS: a #GFileInfo for the @stream, or %NULL on error.
10808 // <attributes>: a file attribute query string.
10809 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10810 extern (C) FileInfo* /*new*/ function (FileIOStream* stream, char* attributes, Cancellable* cancellable, GLib2.Error** error=null) query_info;
10812 // <attributes>: a file attribute query string.
10813 // <io_priority>: the <link linkend="gio-GIOScheduler">I/O priority</link> of the request.
10814 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10815 // <callback>: callback to call when the request is satisfied
10816 // <user_data>: the data to pass to callback function
10817 extern (C) void function (FileIOStream* stream, char* attributes, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) query_info_async;
10819 // RETURNS: A #GFileInfo for the finished query.
10820 // <result>: a #GAsyncResult.
10821 extern (C) FileInfo* /*new*/ function (FileIOStream* stream, AsyncResult* result, GLib2.Error** error=null) query_info_finish;
10822 // RETURNS: the entity tag for the stream.
10823 extern (C) char* /*new*/ function (FileIOStream* stream) get_etag;
10824 extern (C) void function () _g_reserved1;
10825 extern (C) void function () _g_reserved2;
10826 extern (C) void function () _g_reserved3;
10827 extern (C) void function () _g_reserved4;
10828 extern (C) void function () _g_reserved5;
10831 struct FileIOStreamPrivate {
10835 // #GFileIcon specifies an icon by pointing to an image file
10836 // to be used as icon.
10837 struct FileIcon /* : GObject.Object */ {
10838 mixin Icon.__interface__;
10839 mixin LoadableIcon.__interface__;
10840 alias method_parent this;
10841 alias method_parent super_;
10842 alias method_parent object;
10843 GObject2.Object method_parent;
10846 // Gets the #GFile associated with the given @icon.
10847 // RETURNS: a #GFile, or %NULL.
10848 File* get_file()() {
10849 return g_file_icon_get_file(&this);
10853 struct FileIconClass {
10856 // An interface for writing VFS file handles.
10857 struct FileIface {
10858 GObject2.TypeInterface g_iface;
10859 // RETURNS: a new #GFile that is a duplicate of the given #GFile.
10860 extern (C) File* /*new*/ function (File* file) dup;
10861 // RETURNS: 0 if @file is not a valid #GFile, otherwise an
10862 extern (C) uint function (File* file) hash;
10864 // RETURNS: %TRUE if @file1 and @file2 are equal.
10865 // <file2>: the second #GFile.
10866 extern (C) int function (File* file1, File* file2) equal;
10867 // RETURNS: %TRUE if file is native.
10868 extern (C) int function (File* file) is_native;
10870 // RETURNS: %TRUE if #GFile's backend supports the
10871 // <uri_scheme>: a string containing a URI scheme.
10872 extern (C) int function (File* file, char* uri_scheme) has_uri_scheme;
10873 // RETURNS: a string containing the URI scheme for the given
10874 extern (C) char* /*new*/ function (File* file) get_uri_scheme;
10875 // RETURNS: string containing the #GFile's base name, or %NULL
10876 extern (C) char* /*new*/ function (File* file) get_basename;
10877 // RETURNS: string containing the #GFile's path, or %NULL if
10878 extern (C) char* /*new*/ function (File* file) get_path;
10879 // RETURNS: a string containing the #GFile's URI.
10880 extern (C) char* /*new*/ function (File* file) get_uri;
10881 // RETURNS: a string containing the #GFile's parse name. The returned
10882 extern (C) char* /*new*/ function (File* file) get_parse_name;
10883 // RETURNS: a #GFile structure to the parent of the given
10884 extern (C) File* /*new*/ function (File* file) get_parent;
10886 // RETURNS: %TRUE if the @files's parent, grandparent, etc is @prefix.
10887 // <file>: input #GFile.
10888 extern (C) int function (File* prefix, File* file) prefix_matches;
10890 // RETURNS: string with the relative path from @descendant
10891 // <descendant>: input #GFile.
10892 extern (C) char* /*new*/ function (File* parent, File* descendant) get_relative_path;
10894 // RETURNS: #GFile to the resolved path. %NULL if @relative_path
10895 // <relative_path>: a given relative path string.
10896 extern (C) File* /*new*/ function (File* file, char* relative_path) resolve_relative_path;
10898 // RETURNS: a #GFile to the specified child, or
10899 // <display_name>: string to a possible child.
10900 extern (C) File* /*new*/ function (File* file, char* display_name, GLib2.Error** error=null) get_child_for_display_name;
10902 // RETURNS: A #GFileEnumerator if successful, %NULL on error.
10903 // <attributes>: an attribute query string.
10904 // <flags>: a set of #GFileQueryInfoFlags.
10905 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10906 extern (C) FileEnumerator* /*new*/ function (File* file, char* attributes, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error=null) enumerate_children;
10908 // <attributes>: an attribute query string.
10909 // <flags>: a set of #GFileQueryInfoFlags.
10910 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
10911 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10912 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
10913 // <user_data>: the data to pass to callback function
10914 extern (C) void function (File* file, char* attributes, FileQueryInfoFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) enumerate_children_async;
10916 // RETURNS: a #GFileEnumerator or %NULL if an error occurred.
10917 // <res>: a #GAsyncResult.
10918 extern (C) FileEnumerator* /*new*/ function (File* file, AsyncResult* res, GLib2.Error** error=null) enumerate_children_finish;
10920 // RETURNS: a #GFileInfo for the given @file, or %NULL on error.
10921 // <attributes>: an attribute query string.
10922 // <flags>: a set of #GFileQueryInfoFlags.
10923 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10924 extern (C) FileInfo* /*new*/ function (File* file, char* attributes, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error=null) query_info;
10926 // <attributes>: an attribute query string.
10927 // <flags>: a set of #GFileQueryInfoFlags.
10928 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
10929 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10930 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
10931 // <user_data>: the data to pass to callback function
10932 extern (C) void function (File* file, char* attributes, FileQueryInfoFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) query_info_async;
10934 // RETURNS: #GFileInfo for given @file or %NULL on error.
10935 // <res>: a #GAsyncResult.
10936 extern (C) FileInfo* /*new*/ function (File* file, AsyncResult* res, GLib2.Error** error=null) query_info_finish;
10938 // RETURNS: a #GFileInfo or %NULL if there was an error.
10939 // <attributes>: an attribute query string.
10940 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10941 extern (C) FileInfo* /*new*/ function (File* file, char* attributes, Cancellable* cancellable, GLib2.Error** error=null) query_filesystem_info;
10943 // <attributes>: an attribute query string.
10944 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
10945 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10946 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
10947 // <user_data>: the data to pass to callback function
10948 extern (C) void function (File* file, char* attributes, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) query_filesystem_info_async;
10950 // RETURNS: #GFileInfo for given @file or %NULL on error.
10951 // <res>: a #GAsyncResult.
10952 extern (C) FileInfo* /*new*/ function (File* file, AsyncResult* res, GLib2.Error** error=null) query_filesystem_info_finish;
10954 // RETURNS: a #GMount where the @file is located or %NULL on error.
10955 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10956 extern (C) Mount* /*new*/ function (File* file, Cancellable* cancellable, GLib2.Error** error=null) find_enclosing_mount;
10958 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
10959 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10960 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
10961 // <user_data>: the data to pass to callback function
10962 extern (C) void function (File* file, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) find_enclosing_mount_async;
10964 // RETURNS: #GMount for given @file or %NULL on error.
10965 // <res>: a #GAsyncResult
10966 extern (C) Mount* /*new*/ function (File* file, AsyncResult* res, GLib2.Error** error=null) find_enclosing_mount_finish;
10968 // RETURNS: a #GFile specifying what @file was renamed to, or %NULL
10969 // <display_name>: a string.
10970 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10971 extern (C) File* /*new*/ function (File* file, char* display_name, Cancellable* cancellable, GLib2.Error** error=null) set_display_name;
10973 // <display_name>: a string.
10974 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
10975 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10976 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
10977 // <user_data>: the data to pass to callback function
10978 extern (C) void function (File* file, char* display_name, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) set_display_name_async;
10980 // RETURNS: a #GFile or %NULL on error.
10981 // <res>: a #GAsyncResult.
10982 extern (C) File* /*new*/ function (File* file, AsyncResult* res, GLib2.Error** error=null) set_display_name_finish;
10984 // RETURNS: a #GFileAttributeInfoList describing the settable attributes.
10985 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10986 extern (C) FileAttributeInfoList* /*new*/ function (File* file, Cancellable* cancellable, GLib2.Error** error=null) query_settable_attributes;
10987 extern (C) void function () _query_settable_attributes_async;
10988 extern (C) void function () _query_settable_attributes_finish;
10990 // RETURNS: a #GFileAttributeInfoList describing the writable namespaces.
10991 // <cancellable>: optional #GCancellable object, %NULL to ignore.
10992 extern (C) FileAttributeInfoList* /*new*/ function (File* file, Cancellable* cancellable, GLib2.Error** error=null) query_writable_namespaces;
10993 extern (C) void function () _query_writable_namespaces_async;
10994 extern (C) void function () _query_writable_namespaces_finish;
10996 // RETURNS: %TRUE if the attribute was set, %FALSE otherwise.
10997 // <attribute>: a string containing the attribute's name.
10998 // <type>: The type of the attribute
10999 // <value_p>: a pointer to the value (or the pointer itself if the type is a pointer type)
11000 // <flags>: a set of #GFileQueryInfoFlags.
11001 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11002 extern (C) int function (File* file, char* attribute, FileAttributeType type, void* value_p, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error=null) set_attribute;
11004 // RETURNS: %TRUE if there was any error, %FALSE otherwise.
11005 // <info>: a #GFileInfo.
11006 // <flags>: #GFileQueryInfoFlags
11007 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11008 extern (C) int function (File* file, FileInfo* info, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error=null) set_attributes_from_info;
11010 // <info>: a #GFileInfo.
11011 // <flags>: a #GFileQueryInfoFlags.
11012 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
11013 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11014 // <callback>: a #GAsyncReadyCallback.
11015 // <user_data>: a #gpointer.
11016 extern (C) void function (File* file, FileInfo* info, FileQueryInfoFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) set_attributes_async;
11018 // RETURNS: %TRUE if the attributes were set correctly, %FALSE otherwise.
11019 // <result>: a #GAsyncResult.
11020 // <info>: a #GFileInfo.
11021 extern (C) int function (File* file, AsyncResult* result, /*out*/ FileInfo** info, GLib2.Error** error=null) set_attributes_finish;
11023 // RETURNS: #GFileInputStream or %NULL on error.
11024 // <cancellable>: a #GCancellable
11025 extern (C) FileInputStream* /*new*/ function (File* file, Cancellable* cancellable, GLib2.Error** error=null) read_fn;
11027 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
11028 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11029 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
11030 // <user_data>: the data to pass to callback function
11031 extern (C) void function (File* file, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) read_async;
11033 // RETURNS: a #GFileInputStream or %NULL on error.
11034 // <res>: a #GAsyncResult.
11035 extern (C) FileInputStream* /*new*/ function (File* file, AsyncResult* res, GLib2.Error** error=null) read_finish;
11037 // RETURNS: a #GFileOutputStream, or %NULL on error.
11038 // <flags>: a set of #GFileCreateFlags.
11039 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11040 extern (C) FileOutputStream* /*new*/ function (File* file, FileCreateFlags flags, Cancellable* cancellable, GLib2.Error** error=null) append_to;
11042 // <flags>: a set of #GFileCreateFlags.
11043 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
11044 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11045 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
11046 // <user_data>: the data to pass to callback function
11047 extern (C) void function (File* file, FileCreateFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) append_to_async;
11049 // RETURNS: a valid #GFileOutputStream or %NULL on error.
11050 // <res>: #GAsyncResult
11051 extern (C) FileOutputStream* /*new*/ function (File* file, AsyncResult* res, GLib2.Error** error=null) append_to_finish;
11053 // RETURNS: a #GFileOutputStream for the newly created file, or
11054 // <flags>: a set of #GFileCreateFlags.
11055 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11056 extern (C) FileOutputStream* /*new*/ function (File* file, FileCreateFlags flags, Cancellable* cancellable, GLib2.Error** error=null) create;
11058 // <flags>: a set of #GFileCreateFlags.
11059 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
11060 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11061 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
11062 // <user_data>: the data to pass to callback function
11063 extern (C) void function (File* file, FileCreateFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) create_async;
11065 // RETURNS: a #GFileOutputStream or %NULL on error.
11066 // <res>: a #GAsyncResult.
11067 extern (C) FileOutputStream* /*new*/ function (File* file, AsyncResult* res, GLib2.Error** error=null) create_finish;
11069 // RETURNS: a #GFileOutputStream or %NULL on error.
11070 // <etag>: an optional <link linkend="gfile-etag">entity tag</link> for the current #GFile, or #NULL to ignore.
11071 // <make_backup>: %TRUE if a backup should be created.
11072 // <flags>: a set of #GFileCreateFlags.
11073 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11074 extern (C) FileOutputStream* /*new*/ function (File* file, char* etag, int make_backup, FileCreateFlags flags, Cancellable* cancellable, GLib2.Error** error=null) replace;
11076 // <etag>: an <link linkend="gfile-etag">entity tag</link> for the current #GFile, or NULL to ignore.
11077 // <make_backup>: %TRUE if a backup should be created.
11078 // <flags>: a set of #GFileCreateFlags.
11079 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
11080 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11081 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
11082 // <user_data>: the data to pass to callback function
11083 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;
11085 // RETURNS: a #GFileOutputStream, or %NULL on error.
11086 // <res>: a #GAsyncResult.
11087 extern (C) FileOutputStream* /*new*/ function (File* file, AsyncResult* res, GLib2.Error** error=null) replace_finish;
11089 // RETURNS: %TRUE if the file was deleted. %FALSE otherwise.
11090 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11091 extern (C) int function (File* file, Cancellable* cancellable, GLib2.Error** error=null) delete_file;
11092 extern (C) void function () _delete_file_async;
11093 extern (C) void function () _delete_file_finish;
11095 // RETURNS: %TRUE on successful trash, %FALSE otherwise.
11096 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11097 extern (C) int function (File* file, Cancellable* cancellable, GLib2.Error** error=null) trash;
11098 extern (C) void function () _trash_async;
11099 extern (C) void function () _trash_finish;
11101 // RETURNS: %TRUE on successful creation, %FALSE otherwise.
11102 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11103 extern (C) int function (File* file, Cancellable* cancellable, GLib2.Error** error=null) make_directory;
11104 extern (C) void function () _make_directory_async;
11105 extern (C) void function () _make_directory_finish;
11107 // RETURNS: %TRUE on the creation of a new symlink, %FALSE otherwise.
11108 // <symlink_value>: a string with the path for the target of the new symlink
11109 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11110 extern (C) int function (File* file, char* symlink_value, Cancellable* cancellable, GLib2.Error** error=null) make_symbolic_link;
11111 extern (C) void function () _make_symbolic_link_async;
11112 extern (C) void function () _make_symbolic_link_finish;
11114 // RETURNS: %TRUE on success, %FALSE otherwise.
11115 // <destination>: destination #GFile
11116 // <flags>: set of #GFileCopyFlags
11117 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11118 // <progress_callback>: function to callback with progress information
11119 // <progress_callback_data>: user data to pass to @progress_callback
11120 extern (C) int function (File* source, File* destination, FileCopyFlags flags, Cancellable* cancellable, FileProgressCallback progress_callback, void* progress_callback_data, GLib2.Error** error=null) copy;
11122 // Unintrospectable functionp: copy_async() / ()
11124 // <destination>: destination #GFile
11125 // <flags>: set of #GFileCopyFlags
11126 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
11127 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11128 // <progress_callback>: function to callback with progress information
11129 // <progress_callback_data>: user data to pass to @progress_callback
11130 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
11131 // <user_data>: the data to pass to callback function
11132 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;
11134 // RETURNS: a %TRUE on success, %FALSE on error.
11135 // <res>: a #GAsyncResult.
11136 extern (C) int function (File* file, AsyncResult* res, GLib2.Error** error=null) copy_finish;
11138 // RETURNS: %TRUE on successful move, %FALSE otherwise.
11139 // <destination>: #GFile pointing to the destination location.
11140 // <flags>: set of #GFileCopyFlags.
11141 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11142 // <progress_callback>: #GFileProgressCallback function for updates.
11143 // <progress_callback_data>: gpointer to user data for the callback function.
11144 extern (C) int function (File* source, File* destination, FileCopyFlags flags, Cancellable* cancellable, FileProgressCallback progress_callback, void* progress_callback_data, GLib2.Error** error=null) move;
11145 extern (C) void function () _move_async;
11146 extern (C) void function () _move_finish;
11148 // <flags>: flags affecting the operation
11149 // <mount_operation>: a #GMountOperation, or %NULL to avoid user interaction.
11150 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11151 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
11152 // <user_data>: the data to pass to callback function
11153 extern (C) void function (File* file, MountMountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) mount_mountable;
11155 // RETURNS: a #GFile or %NULL on error.
11156 // <result>: a #GAsyncResult.
11157 extern (C) File* /*new*/ function (File* file, AsyncResult* result, GLib2.Error** error=null) mount_mountable_finish;
11159 // <flags>: flags affecting the operation
11160 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11161 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
11162 // <user_data>: the data to pass to callback function
11163 extern (C) void function (File* file, MountUnmountFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) unmount_mountable;
11165 // RETURNS: %TRUE if the operation finished successfully. %FALSE
11166 // <result>: a #GAsyncResult.
11167 extern (C) int function (File* file, AsyncResult* result, GLib2.Error** error=null) unmount_mountable_finish;
11169 // <flags>: flags affecting the operation
11170 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11171 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
11172 // <user_data>: the data to pass to callback function
11173 extern (C) void function (File* file, MountUnmountFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) eject_mountable;
11175 // RETURNS: %TRUE if the @file was ejected successfully. %FALSE
11176 // <result>: a #GAsyncResult.
11177 extern (C) int function (File* file, AsyncResult* result, GLib2.Error** error=null) eject_mountable_finish;
11179 // <flags>: flags affecting the operation
11180 // <mount_operation>: a #GMountOperation or %NULL to avoid user interaction.
11181 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11182 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
11183 // <user_data>: the data to pass to callback function
11184 extern (C) void function (File* location, MountMountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) mount_enclosing_volume;
11186 // RETURNS: %TRUE if successful. If an error
11187 // <result>: a #GAsyncResult.
11188 extern (C) int function (File* location, AsyncResult* result, GLib2.Error** error=null) mount_enclosing_volume_finish;
11190 // RETURNS: a #GFileMonitor for the given @file, or %NULL on error.
11191 // <flags>: a set of #GFileMonitorFlags.
11192 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11193 extern (C) FileMonitor* /*new*/ function (File* file, FileMonitorFlags flags, Cancellable* cancellable, GLib2.Error** error=null) monitor_dir;
11195 // RETURNS: a #GFileMonitor for the given @file, or %NULL on error.
11196 // <flags>: a set of #GFileMonitorFlags.
11197 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11198 extern (C) FileMonitor* /*new*/ function (File* file, FileMonitorFlags flags, Cancellable* cancellable, GLib2.Error** error=null) monitor_file;
11200 // RETURNS: #GFileIOStream or %NULL on error.
11201 // <cancellable>: a #GCancellable
11202 extern (C) FileIOStream* /*new*/ function (File* file, Cancellable* cancellable, GLib2.Error** error=null) open_readwrite;
11204 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
11205 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11206 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
11207 // <user_data>: the data to pass to callback function
11208 extern (C) void function (File* file, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) open_readwrite_async;
11210 // RETURNS: a #GFileIOStream or %NULL on error.
11211 // <res>: a #GAsyncResult.
11212 extern (C) FileIOStream* /*new*/ function (File* file, AsyncResult* res, GLib2.Error** error=null) open_readwrite_finish;
11214 // RETURNS: a #GFileIOStream for the newly created file, or %NULL on error.
11215 // <flags>: a set of #GFileCreateFlags
11216 // <cancellable>: optional #GCancellable object, %NULL to ignore
11217 extern (C) FileIOStream* /*new*/ function (File* file, FileCreateFlags flags, Cancellable* cancellable, GLib2.Error** error=null) create_readwrite;
11219 // <flags>: a set of #GFileCreateFlags
11220 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request
11221 // <cancellable>: optional #GCancellable object, %NULL to ignore
11222 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
11223 // <user_data>: the data to pass to callback function
11224 extern (C) void function (File* file, FileCreateFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) create_readwrite_async;
11226 // RETURNS: a #GFileIOStream or %NULL on error.
11227 // <res>: a #GAsyncResult
11228 extern (C) FileIOStream* /*new*/ function (File* file, AsyncResult* res, GLib2.Error** error=null) create_readwrite_finish;
11230 // RETURNS: a #GFileIOStream or %NULL on error.
11231 // <etag>: an optional <link linkend="gfile-etag">entity tag</link> for the current #GFile, or #NULL to ignore
11232 // <make_backup>: %TRUE if a backup should be created
11233 // <flags>: a set of #GFileCreateFlags
11234 // <cancellable>: optional #GCancellable object, %NULL to ignore
11235 extern (C) FileIOStream* /*new*/ function (File* file, char* etag, int make_backup, FileCreateFlags flags, Cancellable* cancellable, GLib2.Error** error=null) replace_readwrite;
11237 // <etag>: an <link linkend="gfile-etag">entity tag</link> for the current #GFile, or NULL to ignore.
11238 // <make_backup>: %TRUE if a backup should be created.
11239 // <flags>: a set of #GFileCreateFlags.
11240 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
11241 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11242 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
11243 // <user_data>: the data to pass to callback function
11244 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;
11246 // RETURNS: a #GFileIOStream, or %NULL on error.
11247 // <res>: a #GAsyncResult.
11248 extern (C) FileIOStream* /*new*/ function (File* file, AsyncResult* res, GLib2.Error** error=null) replace_readwrite_finish;
11250 // <flags>: flags affecting the operation
11251 // <start_operation>: a #GMountOperation, or %NULL to avoid user interaction.
11252 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11253 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
11254 // <user_data>: the data to pass to callback function
11255 extern (C) void function (File* file, DriveStartFlags flags, MountOperation* start_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) start_mountable;
11257 // RETURNS: %TRUE if the operation finished successfully. %FALSE
11258 // <result>: a #GAsyncResult.
11259 extern (C) int function (File* file, AsyncResult* result, GLib2.Error** error=null) start_mountable_finish;
11261 // <flags>: flags affecting the operation
11262 // <mount_operation>: a #GMountOperation, or %NULL to avoid user interaction.
11263 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11264 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
11265 // <user_data>: the data to pass to callback function
11266 extern (C) void function (File* file, MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) stop_mountable;
11268 // RETURNS: %TRUE if the operation finished successfully. %FALSE
11269 // <result>: a #GAsyncResult.
11270 extern (C) int function (File* file, AsyncResult* result, GLib2.Error** error=null) stop_mountable_finish;
11271 int supports_thread_contexts;
11273 // <flags>: flags affecting the operation
11274 // <mount_operation>: a #GMountOperation, or %NULL to avoid user interaction.
11275 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11276 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
11277 // <user_data>: the data to pass to callback function
11278 extern (C) void function (File* file, MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) unmount_mountable_with_operation;
11280 // RETURNS: %TRUE if the operation finished successfully. %FALSE
11281 // <result>: a #GAsyncResult.
11282 extern (C) int function (File* file, AsyncResult* result, GLib2.Error** error=null) unmount_mountable_with_operation_finish;
11284 // <flags>: flags affecting the operation
11285 // <mount_operation>: a #GMountOperation, or %NULL to avoid user interaction.
11286 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11287 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
11288 // <user_data>: the data to pass to callback function
11289 extern (C) void function (File* file, MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) eject_mountable_with_operation;
11291 // RETURNS: %TRUE if the @file was ejected successfully. %FALSE
11292 // <result>: a #GAsyncResult.
11293 extern (C) int function (File* file, AsyncResult* result, GLib2.Error** error=null) eject_mountable_with_operation_finish;
11295 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11296 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied, or %NULL.
11297 // <user_data>: the data to pass to callback function
11298 extern (C) void function (File* file, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) poll_mountable;
11300 // RETURNS: %TRUE if the operation finished successfully. %FALSE
11301 // <result>: a #GAsyncResult.
11302 extern (C) int function (File* file, AsyncResult* result, GLib2.Error** error=null) poll_mountable_finish;
11306 // Functionality for manipulating basic metadata for files. #GFileInfo
11307 // implements methods for getting information that all files should
11308 // contain, and allows for manipulation of extended attributes.
11310 // See <link linkend="gio-GFileAttribute">GFileAttribute</link> for more
11311 // information on how GIO handles file attributes.
11313 // To obtain a #GFileInfo for a #GFile, use g_file_query_info() (or its
11314 // async variant). To obtain a #GFileInfo for a file input or output
11315 // stream, use g_file_input_stream_query_info() or
11316 // g_file_output_stream_query_info() (or their async variants).
11318 // To change the actual attributes of a file, you should then set the
11319 // attribute in the #GFileInfo and call g_file_set_attributes_from_info()
11320 // or g_file_set_attributes_async() on a GFile.
11322 // However, not all attributes can be changed in the file. For instance,
11323 // the actual size of a file cannot be changed via g_file_info_set_size().
11324 // You may call g_file_query_settable_attributes() and
11325 // g_file_query_writable_namespaces() to discover the settable attributes
11326 // of a particular file at runtime.
11328 // #GFileAttributeMatcher allows for searching through a #GFileInfo for
11329 // attributes.
11330 struct FileInfo /* : GObject.Object */ {
11331 alias method_parent this;
11332 alias method_parent super_;
11333 alias method_parent object;
11334 GObject2.Object method_parent;
11337 // Creates a new file info structure.
11338 // RETURNS: a #GFileInfo.
11339 static FileInfo* /*new*/ new_()() {
11340 return g_file_info_new();
11342 // Clears the status information from @info.
11343 void clear_status()() {
11344 g_file_info_clear_status(&this);
11347 // Copies all of the #GFileAttribute<!-- -->s from @src_info to @dest_info.
11348 // <dest_info>: destination to copy attributes to.
11349 void copy_into()(FileInfo* dest_info) {
11350 g_file_info_copy_into(&this, dest_info);
11353 // Duplicates a file info structure.
11354 // RETURNS: a duplicate #GFileInfo of @other.
11355 FileInfo* /*new*/ dup()() {
11356 return g_file_info_dup(&this);
11359 // Gets the value of a attribute, formated as a string.
11360 // This escapes things as needed to make the string valid
11361 // utf8.
11363 // When you're done with the string it must be freed with g_free().
11364 // RETURNS: a UTF-8 string associated with the given @attribute.
11365 // <attribute>: a file attribute key.
11366 char* /*new*/ get_attribute_as_string()(char* attribute) {
11367 return g_file_info_get_attribute_as_string(&this, attribute);
11370 // Gets the value of a boolean attribute. If the attribute does not
11371 // contain a boolean value, %FALSE will be returned.
11372 // RETURNS: the boolean value contained within the attribute.
11373 // <attribute>: a file attribute key.
11374 int get_attribute_boolean()(char* attribute) {
11375 return g_file_info_get_attribute_boolean(&this, attribute);
11378 // Gets the value of a byte string attribute. If the attribute does
11379 // not contain a byte string, %NULL will be returned.
11381 // %NULL otherwise.
11382 // RETURNS: the contents of the @attribute value as a byte string, or
11383 // <attribute>: a file attribute key.
11384 char* get_attribute_byte_string()(char* attribute) {
11385 return g_file_info_get_attribute_byte_string(&this, attribute);
11388 // Gets the attribute type, value and status for an attribute key.
11390 // %FALSE otherwise.
11391 // RETURNS: %TRUE if @info has an attribute named @attribute,
11392 // <attribute>: a file attribute key
11393 // <type>: return location for the attribute type, or %NULL
11394 // <value_pp>: return location for the attribute value, or %NULL
11395 // <status>: return location for the attribute status, or %NULL
11396 int get_attribute_data()(char* attribute, /*out*/ FileAttributeType* type=null, /*out*/ void** value_pp=null, /*out*/ FileAttributeStatus* status=null) {
11397 return g_file_info_get_attribute_data(&this, attribute, type, value_pp, status);
11400 // Gets a signed 32-bit integer contained within the attribute. If the
11401 // attribute does not contain a signed 32-bit integer, or is invalid,
11402 // 0 will be returned.
11403 // RETURNS: a signed 32-bit integer from the attribute.
11404 // <attribute>: a file attribute key.
11405 int get_attribute_int32()(char* attribute) {
11406 return g_file_info_get_attribute_int32(&this, attribute);
11409 // Gets a signed 64-bit integer contained within the attribute. If the
11410 // attribute does not contain an signed 64-bit integer, or is invalid,
11411 // 0 will be returned.
11412 // RETURNS: a signed 64-bit integer from the attribute.
11413 // <attribute>: a file attribute key.
11414 long get_attribute_int64()(char* attribute) {
11415 return g_file_info_get_attribute_int64(&this, attribute);
11418 // Gets the value of a #GObject attribute. If the attribute does
11419 // not contain a #GObject, %NULL will be returned.
11421 // %NULL otherwise.
11422 // RETURNS: a #GObject associated with the given @attribute, or
11423 // <attribute>: a file attribute key.
11424 GObject2.Object* get_attribute_object()(char* attribute) {
11425 return g_file_info_get_attribute_object(&this, attribute);
11428 // Gets the attribute status for an attribute key.
11430 // %G_FILE_ATTRIBUTE_STATUS_UNSET if the key is invalid.
11431 // RETURNS: a #GFileAttributeStatus for the given @attribute, or
11432 // <attribute>: a file attribute key
11433 FileAttributeStatus get_attribute_status()(char* attribute) {
11434 return g_file_info_get_attribute_status(&this, attribute);
11437 // Gets the value of a string attribute. If the attribute does
11438 // not contain a string, %NULL will be returned.
11440 // %NULL otherwise.
11441 // RETURNS: the contents of the @attribute value as a UTF-8 string, or
11442 // <attribute>: a file attribute key.
11443 char* get_attribute_string()(char* attribute) {
11444 return g_file_info_get_attribute_string(&this, attribute);
11447 // VERSION: 2.22
11448 // Gets the value of a stringv attribute. If the attribute does
11449 // not contain a stringv, %NULL will be returned.
11451 // %NULL otherwise. Do not free. These returned strings are UTF-8.
11452 // RETURNS: the contents of the @attribute value as a stringv, or
11453 // <attribute>: a file attribute key.
11454 char** get_attribute_stringv()(char* attribute) {
11455 return g_file_info_get_attribute_stringv(&this, attribute);
11458 // Gets the attribute type for an attribute key.
11460 // %G_FILE_ATTRIBUTE_TYPE_INVALID if the key is not set.
11461 // RETURNS: a #GFileAttributeType for the given @attribute, or
11462 // <attribute>: a file attribute key.
11463 FileAttributeType get_attribute_type()(char* attribute) {
11464 return g_file_info_get_attribute_type(&this, attribute);
11467 // Gets an unsigned 32-bit integer contained within the attribute. If the
11468 // attribute does not contain an unsigned 32-bit integer, or is invalid,
11469 // 0 will be returned.
11470 // RETURNS: an unsigned 32-bit integer from the attribute.
11471 // <attribute>: a file attribute key.
11472 uint get_attribute_uint32()(char* attribute) {
11473 return g_file_info_get_attribute_uint32(&this, attribute);
11476 // Gets a unsigned 64-bit integer contained within the attribute. If the
11477 // attribute does not contain an unsigned 64-bit integer, or is invalid,
11478 // 0 will be returned.
11479 // RETURNS: a unsigned 64-bit integer from the attribute.
11480 // <attribute>: a file attribute key.
11481 ulong get_attribute_uint64()(char* attribute) {
11482 return g_file_info_get_attribute_uint64(&this, attribute);
11485 // Gets the file's content type.
11486 // RETURNS: a string containing the file's content type.
11487 char* get_content_type()() {
11488 return g_file_info_get_content_type(&this);
11491 // Gets a display name for a file.
11492 // RETURNS: a string containing the display name.
11493 char* get_display_name()() {
11494 return g_file_info_get_display_name(&this);
11497 // Gets the edit name for a file.
11498 // RETURNS: a string containing the edit name.
11499 char* get_edit_name()() {
11500 return g_file_info_get_edit_name(&this);
11503 // Gets the <link linkend="gfile-etag">entity tag</link> for a given
11504 // #GFileInfo. See %G_FILE_ATTRIBUTE_ETAG_VALUE.
11505 // RETURNS: a string containing the value of the "etag:value" attribute.
11506 char* get_etag()() {
11507 return g_file_info_get_etag(&this);
11510 // Gets a file's type (whether it is a regular file, symlink, etc).
11511 // This is different from the file's content type, see g_file_info_get_content_type().
11512 // RETURNS: a #GFileType for the given file.
11513 FileType get_file_type()() {
11514 return g_file_info_get_file_type(&this);
11517 // Gets the icon for a file.
11518 // RETURNS: #GIcon for the given @info.
11519 Icon* get_icon()() {
11520 return g_file_info_get_icon(&this);
11523 // Checks if a file is a backup file.
11524 // RETURNS: %TRUE if file is a backup file, %FALSE otherwise.
11525 int get_is_backup()() {
11526 return g_file_info_get_is_backup(&this);
11529 // Checks if a file is hidden.
11530 // RETURNS: %TRUE if the file is a hidden file, %FALSE otherwise.
11531 int get_is_hidden()() {
11532 return g_file_info_get_is_hidden(&this);
11535 // Checks if a file is a symlink.
11536 // RETURNS: %TRUE if the given @info is a symlink.
11537 int get_is_symlink()() {
11538 return g_file_info_get_is_symlink(&this);
11541 // Gets the modification time of the current @info and sets it
11542 // in @result.
11543 // <result>: a #GTimeVal.
11544 void get_modification_time()(GLib2.TimeVal* result) {
11545 g_file_info_get_modification_time(&this, result);
11548 // Gets the name for a file.
11549 // RETURNS: a string containing the file name.
11550 char* get_name()() {
11551 return g_file_info_get_name(&this);
11554 // Gets the file's size.
11555 // RETURNS: a #goffset containing the file's size.
11556 long get_size()() {
11557 return g_file_info_get_size(&this);
11560 // Gets the value of the sort_order attribute from the #GFileInfo.
11561 // See %G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER.
11562 // RETURNS: a #gint32 containing the value of the "standard::sort_order" attribute.
11563 int get_sort_order()() {
11564 return g_file_info_get_sort_order(&this);
11567 // Gets the symlink target for a given #GFileInfo.
11568 // RETURNS: a string containing the symlink target.
11569 char* get_symlink_target()() {
11570 return g_file_info_get_symlink_target(&this);
11573 // Checks if a file info structure has an attribute named @attribute.
11575 // %FALSE otherwise.
11576 // RETURNS: %TRUE if @Ginfo has an attribute named @attribute,
11577 // <attribute>: a file attribute key.
11578 int has_attribute()(char* attribute) {
11579 return g_file_info_has_attribute(&this, attribute);
11582 // VERSION: 2.22
11583 // Checks if a file info structure has an attribute in the
11584 // specified @name_space.
11586 // %FALSE otherwise.
11587 // RETURNS: %TRUE if @Ginfo has an attribute in @name_space,
11588 // <name_space>: a file attribute namespace.
11589 int has_namespace()(char* name_space) {
11590 return g_file_info_has_namespace(&this, name_space);
11593 // Lists the file info structure's attributes.
11595 // possible attribute types for the given @name_space, or
11596 // %NULL on error.
11597 // RETURNS: a null-terminated array of strings of all of the
11598 // <name_space>: a file attribute key's namespace.
11599 char** /*new*/ list_attributes()(char* name_space) {
11600 return g_file_info_list_attributes(&this, name_space);
11603 // Removes all cases of @attribute from @info if it exists.
11604 // <attribute>: a file attribute key.
11605 void remove_attribute()(char* attribute) {
11606 g_file_info_remove_attribute(&this, attribute);
11609 // Sets the @attribute to contain the given value, if possible.
11610 // <attribute>: a file attribute key.
11611 // <type>: a #GFileAttributeType
11612 // <value_p>: pointer to the value
11613 void set_attribute()(char* attribute, FileAttributeType type, void* value_p) {
11614 g_file_info_set_attribute(&this, attribute, type, value_p);
11617 // Sets the @attribute to contain the given @attr_value,
11618 // if possible.
11619 // <attribute>: a file attribute key.
11620 // <attr_value>: a boolean value.
11621 void set_attribute_boolean()(char* attribute, int attr_value) {
11622 g_file_info_set_attribute_boolean(&this, attribute, attr_value);
11625 // Sets the @attribute to contain the given @attr_value,
11626 // if possible.
11627 // <attribute>: a file attribute key.
11628 // <attr_value>: a byte string.
11629 void set_attribute_byte_string()(char* attribute, char* attr_value) {
11630 g_file_info_set_attribute_byte_string(&this, attribute, attr_value);
11633 // Sets the @attribute to contain the given @attr_value,
11634 // if possible.
11635 // <attribute>: a file attribute key.
11636 // <attr_value>: a signed 32-bit integer
11637 void set_attribute_int32()(char* attribute, int attr_value) {
11638 g_file_info_set_attribute_int32(&this, attribute, attr_value);
11641 // Sets the @attribute to contain the given @attr_value,
11642 // if possible.
11643 // <attribute>: attribute name to set.
11644 // <attr_value>: int64 value to set attribute to.
11645 void set_attribute_int64()(char* attribute, long attr_value) {
11646 g_file_info_set_attribute_int64(&this, attribute, attr_value);
11649 // Sets @mask on @info to match specific attribute types.
11650 // <mask>: a #GFileAttributeMatcher.
11651 void set_attribute_mask()(FileAttributeMatcher* mask) {
11652 g_file_info_set_attribute_mask(&this, mask);
11655 // Sets the @attribute to contain the given @attr_value,
11656 // if possible.
11657 // <attribute>: a file attribute key.
11658 // <attr_value>: a #GObject.
11659 void set_attribute_object()(char* attribute, GObject2.Object* attr_value) {
11660 g_file_info_set_attribute_object(&this, attribute, attr_value);
11663 // VERSION: 2.22
11664 // Sets the attribute status for an attribute key. This is only
11665 // needed by external code that implement g_file_set_attributes_from_info()
11666 // or similar functions.
11668 // The attribute must exist in @info for this to work. Otherwise %FALSE
11669 // is returned and @info is unchanged.
11670 // RETURNS: %TRUE if the status was changed, %FALSE if the key was not set.
11671 // <attribute>: a file attribute key
11672 // <status>: a #GFileAttributeStatus
11673 int set_attribute_status()(char* attribute, FileAttributeStatus status) {
11674 return g_file_info_set_attribute_status(&this, attribute, status);
11677 // Sets the @attribute to contain the given @attr_value,
11678 // if possible.
11679 // <attribute>: a file attribute key.
11680 // <attr_value>: a UTF-8 string.
11681 void set_attribute_string()(char* attribute, char* attr_value) {
11682 g_file_info_set_attribute_string(&this, attribute, attr_value);
11685 // Sets the @attribute to contain the given @attr_value,
11686 // if possible.
11688 // Sinze: 2.22
11689 // <attribute>: a file attribute key
11690 // <attr_value>: a %NULL terminated array of UTF-8 strings.
11691 void set_attribute_stringv()(char* attribute, char** attr_value) {
11692 g_file_info_set_attribute_stringv(&this, attribute, attr_value);
11695 // Sets the @attribute to contain the given @attr_value,
11696 // if possible.
11697 // <attribute>: a file attribute key.
11698 // <attr_value>: an unsigned 32-bit integer.
11699 void set_attribute_uint32()(char* attribute, uint attr_value) {
11700 g_file_info_set_attribute_uint32(&this, attribute, attr_value);
11703 // Sets the @attribute to contain the given @attr_value,
11704 // if possible.
11705 // <attribute>: a file attribute key.
11706 // <attr_value>: an unsigned 64-bit integer.
11707 void set_attribute_uint64()(char* attribute, ulong attr_value) {
11708 g_file_info_set_attribute_uint64(&this, attribute, attr_value);
11711 // Sets the content type attribute for a given #GFileInfo.
11712 // See %G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE.
11713 // <content_type>: a content type. See <link linkend="gio-GContentType">GContentType</link>.
11714 void set_content_type()(char* content_type) {
11715 g_file_info_set_content_type(&this, content_type);
11718 // Sets the display name for the current #GFileInfo.
11719 // See %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME.
11720 // <display_name>: a string containing a display name.
11721 void set_display_name()(char* display_name) {
11722 g_file_info_set_display_name(&this, display_name);
11725 // Sets the edit name for the current file.
11726 // See %G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME.
11727 // <edit_name>: a string containing an edit name.
11728 void set_edit_name()(char* edit_name) {
11729 g_file_info_set_edit_name(&this, edit_name);
11732 // Sets the file type in a #GFileInfo to @type.
11733 // See %G_FILE_ATTRIBUTE_STANDARD_TYPE.
11734 // <type>: a #GFileType.
11735 void set_file_type()(FileType type) {
11736 g_file_info_set_file_type(&this, type);
11739 // Sets the icon for a given #GFileInfo.
11740 // See %G_FILE_ATTRIBUTE_STANDARD_ICON.
11741 // <icon>: a #GIcon.
11742 void set_icon()(Icon* icon) {
11743 g_file_info_set_icon(&this, icon);
11746 // Sets the "is_hidden" attribute in a #GFileInfo according to @is_symlink.
11747 // See %G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN.
11748 // <is_hidden>: a #gboolean.
11749 void set_is_hidden()(int is_hidden) {
11750 g_file_info_set_is_hidden(&this, is_hidden);
11753 // Sets the "is_symlink" attribute in a #GFileInfo according to @is_symlink.
11754 // See %G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK.
11755 // <is_symlink>: a #gboolean.
11756 void set_is_symlink()(int is_symlink) {
11757 g_file_info_set_is_symlink(&this, is_symlink);
11760 // Sets the %G_FILE_ATTRIBUTE_TIME_MODIFIED attribute in the file
11761 // info to the given time value.
11762 // <mtime>: a #GTimeVal.
11763 void set_modification_time()(GLib2.TimeVal* mtime) {
11764 g_file_info_set_modification_time(&this, mtime);
11767 // Sets the name attribute for the current #GFileInfo.
11768 // See %G_FILE_ATTRIBUTE_STANDARD_NAME.
11769 // <name>: a string containing a name.
11770 void set_name()(char* name) {
11771 g_file_info_set_name(&this, name);
11774 // Sets the %G_FILE_ATTRIBUTE_STANDARD_SIZE attribute in the file info
11775 // to the given size.
11776 // <size>: a #goffset containing the file's size.
11777 void set_size()(long size) {
11778 g_file_info_set_size(&this, size);
11781 // Sets the sort order attribute in the file info structure. See
11782 // %G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER.
11783 // <sort_order>: a sort order integer.
11784 void set_sort_order()(int sort_order) {
11785 g_file_info_set_sort_order(&this, sort_order);
11788 // Sets the %G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET attribute in the file info
11789 // to the given symlink target.
11790 // <symlink_target>: a static string containing a path to a symlink target.
11791 void set_symlink_target()(char* symlink_target) {
11792 g_file_info_set_symlink_target(&this, symlink_target);
11795 // Unsets a mask set by g_file_info_set_attribute_mask(), if one
11796 // is set.
11797 void unset_attribute_mask()() {
11798 g_file_info_unset_attribute_mask(&this);
11802 struct FileInfoClass {
11806 // GFileInputStream provides input streams that take their
11807 // content from a file.
11809 // GFileInputStream implements #GSeekable, which allows the input
11810 // stream to jump to arbitrary positions in the file, provided the
11811 // filesystem of the file allows it. To find the position of a file
11812 // input stream, use g_seekable_tell(). To find out if a file input
11813 // stream supports seeking, use g_seekable_stream_can_seek().
11814 // To position a file input stream, use g_seekable_seek().
11815 struct FileInputStream /* : InputStream */ {
11816 mixin Seekable.__interface__;
11817 alias parent_instance this;
11818 alias parent_instance super_;
11819 alias parent_instance inputstream;
11820 InputStream parent_instance;
11821 private FileInputStreamPrivate* priv;
11824 // Queries a file input stream the given @attributes. This function blocks
11825 // while querying the stream. For the asynchronous (non-blocking) version
11826 // of this function, see g_file_input_stream_query_info_async(). While the
11827 // stream is blocked, the stream will set the pending flag internally, and
11828 // any other operations on the stream will fail with %G_IO_ERROR_PENDING.
11829 // RETURNS: a #GFileInfo, or %NULL on error.
11830 // <attributes>: a file attribute query string.
11831 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11832 FileInfo* /*new*/ query_info()(char* attributes, Cancellable* cancellable, GLib2.Error** error=null) {
11833 return g_file_input_stream_query_info(&this, attributes, cancellable, error);
11836 // Queries the stream information asynchronously.
11837 // When the operation is finished @callback will be called.
11838 // You can then call g_file_input_stream_query_info_finish()
11839 // to get the result of the operation.
11841 // For the synchronous version of this function,
11842 // see g_file_input_stream_query_info().
11844 // If @cancellable is not %NULL, then the operation can be cancelled by
11845 // triggering the cancellable object from another thread. If the operation
11846 // was cancelled, the error %G_IO_ERROR_CANCELLED will be set
11847 // <attributes>: a file attribute query string.
11848 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
11849 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11850 // <callback>: callback to call when the request is satisfied
11851 // <user_data>: the data to pass to callback function
11852 void query_info_async()(char* attributes, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
11853 g_file_input_stream_query_info_async(&this, attributes, io_priority, cancellable, callback, user_data);
11856 // Finishes an asynchronous info query operation.
11857 // RETURNS: #GFileInfo.
11858 // <result>: a #GAsyncResult.
11859 FileInfo* /*new*/ query_info_finish()(AsyncResult* result, GLib2.Error** error=null) {
11860 return g_file_input_stream_query_info_finish(&this, result, error);
11864 struct FileInputStreamClass {
11865 InputStreamClass parent_class;
11866 extern (C) long function (FileInputStream* stream) tell;
11867 extern (C) int function (FileInputStream* stream) can_seek;
11868 extern (C) int function (FileInputStream* stream, long offset, GLib2.SeekType type, Cancellable* cancellable, GLib2.Error** error=null) seek;
11870 // RETURNS: a #GFileInfo, or %NULL on error.
11871 // <attributes>: a file attribute query string.
11872 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11873 extern (C) FileInfo* /*new*/ function (FileInputStream* stream, char* attributes, Cancellable* cancellable, GLib2.Error** error=null) query_info;
11875 // <attributes>: a file attribute query string.
11876 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
11877 // <cancellable>: optional #GCancellable object, %NULL to ignore.
11878 // <callback>: callback to call when the request is satisfied
11879 // <user_data>: the data to pass to callback function
11880 extern (C) void function (FileInputStream* stream, char* attributes, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) query_info_async;
11882 // RETURNS: #GFileInfo.
11883 // <result>: a #GAsyncResult.
11884 extern (C) FileInfo* /*new*/ function (FileInputStream* stream, AsyncResult* result, GLib2.Error** error=null) query_info_finish;
11885 extern (C) void function () _g_reserved1;
11886 extern (C) void function () _g_reserved2;
11887 extern (C) void function () _g_reserved3;
11888 extern (C) void function () _g_reserved4;
11889 extern (C) void function () _g_reserved5;
11892 struct FileInputStreamPrivate {
11896 // Monitors a file or directory for changes.
11898 // To obtain a #GFileMonitor for a file or directory, use
11899 // g_file_monitor(), g_file_monitor_file(), or
11900 // g_file_monitor_directory().
11902 // To get informed about changes to the file or directory you are
11903 // monitoring, connect to the #GFileMonitor::changed signal. The
11904 // signal will be emitted in the <link
11905 // linkend="g-main-context-push-thread-default">thread-default main
11906 // context</link> of the thread that the monitor was created in
11907 // (though if the global default main context is blocked, this may
11908 // cause notifications to be blocked even if the thread-default
11909 // context is still running).
11910 struct FileMonitor /* : GObject.Object */ {
11911 alias parent_instance this;
11912 alias parent_instance super_;
11913 alias parent_instance object;
11914 GObject2.Object parent_instance;
11915 private FileMonitorPrivate* priv;
11918 // Cancels a file monitor.
11919 // RETURNS: %TRUE if monitor was cancelled.
11920 int cancel()() {
11921 return g_file_monitor_cancel(&this);
11924 // Emits the #GFileMonitor::changed signal if a change
11925 // has taken place. Should be called from file monitor
11926 // implementations only.
11928 // The signal will be emitted from an idle handler (in the <link
11929 // linkend="g-main-context-push-thread-default">thread-default main
11930 // context</link>).
11931 // <child>: a #GFile.
11932 // <other_file>: a #GFile.
11933 // <event_type>: a set of #GFileMonitorEvent flags.
11934 void emit_event()(File* child, File* other_file, FileMonitorEvent event_type) {
11935 g_file_monitor_emit_event(&this, child, other_file, event_type);
11938 // Returns whether the monitor is canceled.
11939 // RETURNS: %TRUE if monitor is canceled. %FALSE otherwise.
11940 int is_cancelled()() {
11941 return g_file_monitor_is_cancelled(&this);
11944 // Sets the rate limit to which the @monitor will report
11945 // consecutive change events to the same file.
11946 // <limit_msecs>: a non-negative integer with the limit in milliseconds to poll for changes
11947 void set_rate_limit()(int limit_msecs) {
11948 g_file_monitor_set_rate_limit(&this, limit_msecs);
11951 // Emitted when @file has been changed.
11953 // If using #G_FILE_MONITOR_SEND_MOVED flag and @event_type is
11954 // #G_FILE_MONITOR_SEND_MOVED, @file will be set to a #GFile containing the
11955 // old path, and @other_file will be set to a #GFile containing the new path.
11957 // In all the other cases, @other_file will be set to #NULL.
11958 // <file>: a #GFile.
11959 // <other_file>: a #GFile or #NULL.
11960 // <event_type>: a #GFileMonitorEvent.
11961 extern (C) alias static void function (FileMonitor* this_, File* file, File* other_file, FileMonitorEvent* event_type, void* user_data=null) signal_changed;
11963 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
11964 return super_.signal_connect!name(cb, data, cf);
11967 ulong signal_connect(string name:"changed", CB:signal_changed)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
11968 return signal_connect_data!()(&this, cast(char*)"changed",
11969 cast(GObject2.Callback)cb, data, null, cf);
11973 struct FileMonitorClass {
11974 GObject2.ObjectClass parent_class;
11975 extern (C) void function (FileMonitor* monitor, File* file, File* other_file, FileMonitorEvent event_type) changed;
11976 // RETURNS: %TRUE if monitor was cancelled.
11977 extern (C) int function (FileMonitor* monitor) cancel;
11978 extern (C) void function () _g_reserved1;
11979 extern (C) void function () _g_reserved2;
11980 extern (C) void function () _g_reserved3;
11981 extern (C) void function () _g_reserved4;
11982 extern (C) void function () _g_reserved5;
11985 // Specifies what type of event a monitor event is.
11986 enum FileMonitorEvent {
11987 CHANGED = 0,
11988 CHANGES_DONE_HINT = 1,
11989 DELETED = 2,
11990 CREATED = 3,
11991 ATTRIBUTE_CHANGED = 4,
11992 PRE_UNMOUNT = 5,
11993 UNMOUNTED = 6,
11994 MOVED = 7
11996 // Flags used to set what a #GFileMonitor will watch for.
11997 enum FileMonitorFlags {
11998 NONE = 0,
11999 WATCH_MOUNTS = 1,
12000 SEND_MOVED = 2
12002 struct FileMonitorPrivate {
12006 // GFileOutputStream provides output streams that write their
12007 // content to a file.
12009 // GFileOutputStream implements #GSeekable, which allows the output
12010 // stream to jump to arbitrary positions in the file and to truncate
12011 // the file, provided the filesystem of the file supports these
12012 // operations.
12014 // To find the position of a file output stream, use g_seekable_tell().
12015 // To find out if a file output stream supports seeking, use
12016 // g_seekable_can_seek().To position a file output stream, use
12017 // g_seekable_seek(). To find out if a file output stream supports
12018 // truncating, use g_seekable_can_truncate(). To truncate a file output
12019 // stream, use g_seekable_truncate().
12020 struct FileOutputStream /* : OutputStream */ {
12021 mixin Seekable.__interface__;
12022 alias parent_instance this;
12023 alias parent_instance super_;
12024 alias parent_instance outputstream;
12025 OutputStream parent_instance;
12026 private FileOutputStreamPrivate* priv;
12029 // Gets the entity tag for the file when it has been written.
12030 // This must be called after the stream has been written
12031 // and closed, as the etag can change while writing.
12032 // RETURNS: the entity tag for the stream.
12033 char* /*new*/ get_etag()() {
12034 return g_file_output_stream_get_etag(&this);
12037 // Queries a file output stream for the given @attributes.
12038 // This function blocks while querying the stream. For the asynchronous
12039 // version of this function, see g_file_output_stream_query_info_async().
12040 // While the stream is blocked, the stream will set the pending flag
12041 // internally, and any other operations on the stream will fail with
12042 // %G_IO_ERROR_PENDING.
12044 // Can fail if the stream was already closed (with @error being set to
12045 // %G_IO_ERROR_CLOSED), the stream has pending operations (with @error being
12046 // set to %G_IO_ERROR_PENDING), or if querying info is not supported for
12047 // the stream's interface (with @error being set to %G_IO_ERROR_NOT_SUPPORTED). In
12048 // all cases of failure, %NULL will be returned.
12050 // If @cancellable is not %NULL, then the operation can be cancelled by
12051 // triggering the cancellable object from another thread. If the operation
12052 // was cancelled, the error %G_IO_ERROR_CANCELLED will be set, and %NULL will
12053 // be returned.
12054 // RETURNS: a #GFileInfo for the @stream, or %NULL on error.
12055 // <attributes>: a file attribute query string.
12056 // <cancellable>: optional #GCancellable object, %NULL to ignore.
12057 FileInfo* /*new*/ query_info()(char* attributes, Cancellable* cancellable, GLib2.Error** error=null) {
12058 return g_file_output_stream_query_info(&this, attributes, cancellable, error);
12061 // Asynchronously queries the @stream for a #GFileInfo. When completed,
12062 // @callback will be called with a #GAsyncResult which can be used to
12063 // finish the operation with g_file_output_stream_query_info_finish().
12065 // For the synchronous version of this function, see
12066 // g_file_output_stream_query_info().
12067 // <attributes>: a file attribute query string.
12068 // <io_priority>: the <link linkend="gio-GIOScheduler">I/O priority</link> of the request.
12069 // <cancellable>: optional #GCancellable object, %NULL to ignore.
12070 // <callback>: callback to call when the request is satisfied
12071 // <user_data>: the data to pass to callback function
12072 void query_info_async()(char* attributes, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
12073 g_file_output_stream_query_info_async(&this, attributes, io_priority, cancellable, callback, user_data);
12076 // Finalizes the asynchronous query started
12077 // by g_file_output_stream_query_info_async().
12078 // RETURNS: A #GFileInfo for the finished query.
12079 // <result>: a #GAsyncResult.
12080 FileInfo* /*new*/ query_info_finish()(AsyncResult* result, GLib2.Error** error=null) {
12081 return g_file_output_stream_query_info_finish(&this, result, error);
12085 struct FileOutputStreamClass {
12086 OutputStreamClass parent_class;
12087 extern (C) long function (FileOutputStream* stream) tell;
12088 extern (C) int function (FileOutputStream* stream) can_seek;
12089 extern (C) int function (FileOutputStream* stream, long offset, GLib2.SeekType type, Cancellable* cancellable, GLib2.Error** error=null) seek;
12090 extern (C) int function (FileOutputStream* stream) can_truncate;
12091 extern (C) int function (FileOutputStream* stream, long size, Cancellable* cancellable, GLib2.Error** error=null) truncate_fn;
12093 // RETURNS: a #GFileInfo for the @stream, or %NULL on error.
12094 // <attributes>: a file attribute query string.
12095 // <cancellable>: optional #GCancellable object, %NULL to ignore.
12096 extern (C) FileInfo* /*new*/ function (FileOutputStream* stream, char* attributes, Cancellable* cancellable, GLib2.Error** error=null) query_info;
12098 // <attributes>: a file attribute query string.
12099 // <io_priority>: the <link linkend="gio-GIOScheduler">I/O priority</link> of the request.
12100 // <cancellable>: optional #GCancellable object, %NULL to ignore.
12101 // <callback>: callback to call when the request is satisfied
12102 // <user_data>: the data to pass to callback function
12103 extern (C) void function (FileOutputStream* stream, char* attributes, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) query_info_async;
12105 // RETURNS: A #GFileInfo for the finished query.
12106 // <result>: a #GAsyncResult.
12107 extern (C) FileInfo* /*new*/ function (FileOutputStream* stream, AsyncResult* result, GLib2.Error** error=null) query_info_finish;
12108 // RETURNS: the entity tag for the stream.
12109 extern (C) char* /*new*/ function (FileOutputStream* stream) get_etag;
12110 extern (C) void function () _g_reserved1;
12111 extern (C) void function () _g_reserved2;
12112 extern (C) void function () _g_reserved3;
12113 extern (C) void function () _g_reserved4;
12114 extern (C) void function () _g_reserved5;
12117 struct FileOutputStreamPrivate {
12121 // When doing file operations that may take a while, such as moving
12122 // a file or copying a file, a progress callback is used to pass how
12123 // far along that operation is to the application.
12124 // <current_num_bytes>: the current number of bytes in the operation.
12125 // <total_num_bytes>: the total number of bytes in the operation.
12126 // <user_data>: user data passed to the callback.
12127 extern (C) alias void function (long current_num_bytes, long total_num_bytes, void* user_data) FileProgressCallback;
12129 // Flags used when querying a #GFileInfo.
12130 enum FileQueryInfoFlags {
12131 NONE = 0,
12132 NOFOLLOW_SYMLINKS = 1
12135 // When loading the partial contents of a file with g_file_load_partial_contents_async(),
12136 // it may become necessary to determine if any more data from the file should be loaded.
12137 // A #GFileReadMoreCallback function facilitates this by returning %TRUE if more data
12138 // should be read, or %FALSE otherwise.
12139 // RETURNS: %TRUE if more data should be read back. %FALSE otherwise.
12140 // <file_contents>: the data as currently read.
12141 // <file_size>: the size of the data currently read.
12142 // <callback_data>: data passed to the callback.
12143 extern (C) alias int function (char* file_contents, long file_size, void* callback_data) FileReadMoreCallback;
12145 // Indicates the file's on-disk type.
12146 enum FileType {
12147 UNKNOWN = 0,
12148 REGULAR = 1,
12149 DIRECTORY = 2,
12150 SYMBOLIC_LINK = 3,
12151 SPECIAL = 4,
12152 SHORTCUT = 5,
12153 MOUNTABLE = 6
12156 // Completes partial file and directory names given a partial string by
12157 // looking in the file system for clues. Can return a list of possible
12158 // completion strings for widget implementations.
12159 struct FilenameCompleter /* : GObject.Object */ {
12160 alias method_parent this;
12161 alias method_parent super_;
12162 alias method_parent object;
12163 GObject2.Object method_parent;
12166 // Creates a new filename completer.
12167 // RETURNS: a #GFilenameCompleter.
12168 static FilenameCompleter* /*new*/ new_()() {
12169 return g_filename_completer_new();
12172 // Obtains a completion for @initial_text from @completer.
12174 // This string is not owned by GIO, so remember to g_free() it
12175 // when finished.
12176 // RETURNS: a completed string, or %NULL if no completion exists.
12177 // <initial_text>: text to be completed.
12178 char* /*new*/ get_completion_suffix()(char* initial_text) {
12179 return g_filename_completer_get_completion_suffix(&this, initial_text);
12182 // Gets an array of completion strings for a given initial text.
12184 // This array must be freed by g_strfreev() when finished.
12185 // RETURNS: array of strings with possible completions for @initial_text.
12186 // <initial_text>: text to be completed.
12187 char** /*new*/ get_completions()(char* initial_text) {
12188 return g_filename_completer_get_completions(&this, initial_text);
12191 // If @dirs_only is %TRUE, @completer will only
12192 // complete directory names, and not file names.
12193 // <dirs_only>: a #gboolean.
12194 void set_dirs_only()(int dirs_only) {
12195 g_filename_completer_set_dirs_only(&this, dirs_only);
12197 // Emitted when the file name completion information comes available.
12198 extern (C) alias static void function (FilenameCompleter* this_, void* user_data=null) signal_got_completion_data;
12200 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
12201 return super_.signal_connect!name(cb, data, cf);
12204 ulong signal_connect(string name:"got-completion-data", CB:signal_got_completion_data)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
12205 return signal_connect_data!()(&this, cast(char*)"got-completion-data",
12206 cast(GObject2.Callback)cb, data, null, cf);
12210 struct FilenameCompleterClass {
12211 GObject2.ObjectClass parent_class;
12212 extern (C) void function (FilenameCompleter* filename_completer) got_completion_data;
12213 extern (C) void function () _g_reserved1;
12214 extern (C) void function () _g_reserved2;
12215 extern (C) void function () _g_reserved3;
12219 // Indicates a hint from the file system whether files should be
12220 // previewed in a file manager. Returned as the value of the key
12221 // #G_FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW.
12222 enum FilesystemPreviewType {
12223 IF_ALWAYS = 0,
12224 IF_LOCAL = 1,
12225 NEVER = 2
12228 // Base class for input stream implementations that perform some
12229 // kind of filtering operation on a base stream. Typical examples
12230 // of filtering operations are character set conversion, compression
12231 // and byte order flipping.
12232 struct FilterInputStream /* : InputStream */ {
12233 alias parent_instance this;
12234 alias parent_instance super_;
12235 alias parent_instance inputstream;
12236 InputStream parent_instance;
12237 InputStream* base_stream;
12240 // Gets the base stream for the filter stream.
12241 // RETURNS: a #GInputStream.
12242 InputStream* get_base_stream()() {
12243 return g_filter_input_stream_get_base_stream(&this);
12246 // Returns whether the base stream will be closed when @stream is
12247 // closed.
12248 // RETURNS: %TRUE if the base stream will be closed.
12249 int get_close_base_stream()() {
12250 return g_filter_input_stream_get_close_base_stream(&this);
12253 // Sets whether the base stream will be closed when @stream is closed.
12254 // <close_base>: %TRUE to close the base stream.
12255 void set_close_base_stream()(int close_base) {
12256 g_filter_input_stream_set_close_base_stream(&this, close_base);
12260 struct FilterInputStreamClass {
12261 InputStreamClass parent_class;
12262 extern (C) void function () _g_reserved1;
12263 extern (C) void function () _g_reserved2;
12264 extern (C) void function () _g_reserved3;
12268 // Base class for output stream implementations that perform some
12269 // kind of filtering operation on a base stream. Typical examples
12270 // of filtering operations are character set conversion, compression
12271 // and byte order flipping.
12272 struct FilterOutputStream /* : OutputStream */ {
12273 alias parent_instance this;
12274 alias parent_instance super_;
12275 alias parent_instance outputstream;
12276 OutputStream parent_instance;
12277 OutputStream* base_stream;
12280 // Gets the base stream for the filter stream.
12281 // RETURNS: a #GOutputStream.
12282 OutputStream* get_base_stream()() {
12283 return g_filter_output_stream_get_base_stream(&this);
12286 // Returns whether the base stream will be closed when @stream is
12287 // closed.
12288 // RETURNS: %TRUE if the base stream will be closed.
12289 int get_close_base_stream()() {
12290 return g_filter_output_stream_get_close_base_stream(&this);
12293 // Sets whether the base stream will be closed when @stream is closed.
12294 // <close_base>: %TRUE to close the base stream.
12295 void set_close_base_stream()(int close_base) {
12296 g_filter_output_stream_set_close_base_stream(&this, close_base);
12300 struct FilterOutputStreamClass {
12301 OutputStreamClass parent_class;
12302 extern (C) void function () _g_reserved1;
12303 extern (C) void function () _g_reserved2;
12304 extern (C) void function () _g_reserved3;
12307 // Error codes returned by GIO functions.
12308 enum IOErrorEnum {
12309 FAILED = 0,
12310 NOT_FOUND = 1,
12311 EXISTS = 2,
12312 IS_DIRECTORY = 3,
12313 NOT_DIRECTORY = 4,
12314 NOT_EMPTY = 5,
12315 NOT_REGULAR_FILE = 6,
12316 NOT_SYMBOLIC_LINK = 7,
12317 NOT_MOUNTABLE_FILE = 8,
12318 FILENAME_TOO_LONG = 9,
12319 INVALID_FILENAME = 10,
12320 TOO_MANY_LINKS = 11,
12321 NO_SPACE = 12,
12322 INVALID_ARGUMENT = 13,
12323 PERMISSION_DENIED = 14,
12324 NOT_SUPPORTED = 15,
12325 NOT_MOUNTED = 16,
12326 ALREADY_MOUNTED = 17,
12327 CLOSED = 18,
12328 CANCELLED = 19,
12329 PENDING = 20,
12330 READ_ONLY = 21,
12331 CANT_CREATE_BACKUP = 22,
12332 WRONG_ETAG = 23,
12333 TIMED_OUT = 24,
12334 WOULD_RECURSE = 25,
12335 BUSY = 26,
12336 WOULD_BLOCK = 27,
12337 HOST_NOT_FOUND = 28,
12338 WOULD_MERGE = 29,
12339 FAILED_HANDLED = 30,
12340 TOO_MANY_OPEN_FILES = 31,
12341 NOT_INITIALIZED = 32,
12342 ADDRESS_IN_USE = 33,
12343 PARTIAL_INPUT = 34,
12344 INVALID_DATA = 35,
12345 DBUS_ERROR = 36,
12346 HOST_UNREACHABLE = 37,
12347 NETWORK_UNREACHABLE = 38,
12348 CONNECTION_REFUSED = 39,
12349 PROXY_FAILED = 40,
12350 PROXY_AUTH_FAILED = 41,
12351 PROXY_NEED_AUTH = 42,
12352 PROXY_NOT_ALLOWED = 43
12354 struct IOExtension {
12356 // Gets the name under which @extension was registered.
12358 // Note that the same type may be registered as extension
12359 // for multiple extension points, under different names.
12360 // RETURNS: the name of @extension.
12361 char* get_name()() {
12362 return g_io_extension_get_name(&this);
12365 // Gets the priority with which @extension was registered.
12366 // RETURNS: the priority of @extension
12367 int get_priority()() {
12368 return g_io_extension_get_priority(&this);
12371 // Unintrospectable method: ref_class() / g_io_extension_ref_class()
12372 // Gets a reference to the class for the type that is
12373 // associated with @extension.
12374 // RETURNS: the #GTypeClass for the type of @extension
12375 GObject2.TypeClass* /*new*/ ref_class()() {
12376 return g_io_extension_ref_class(&this);
12380 struct IOExtensionPoint {
12382 // Finds a #GIOExtension for an extension point by name.
12384 // given name, or %NULL if there is no extension with that name
12385 // RETURNS: the #GIOExtension for @extension_point that has the
12386 // <name>: the name of the extension to get
12387 IOExtension* get_extension_by_name()(char* name) {
12388 return g_io_extension_point_get_extension_by_name(&this, name);
12391 // Gets a list of all extensions that implement this extension point.
12392 // The list is sorted by priority, beginning with the highest priority.
12394 // #GIOExtension<!-- -->s. The list is owned by GIO and should not be
12395 // modified.
12396 // RETURNS: a #GList of
12397 GLib2.List* get_extensions()() {
12398 return g_io_extension_point_get_extensions(&this);
12401 // Gets the required type for @extension_point.
12403 // or #G_TYPE_INVALID if the extension point has no required type
12404 // RETURNS: the #GType that all implementations must have,
12405 Type get_required_type()() {
12406 return g_io_extension_point_get_required_type(&this);
12409 // Sets the required type for @extension_point to @type.
12410 // All implementations must henceforth have this type.
12411 // <type>: the #GType to require
12412 void set_required_type()(Type type) {
12413 g_io_extension_point_set_required_type(&this, type);
12416 // Registers @type as extension for the extension point with name
12417 // @extension_point_name.
12419 // If @type has already been registered as an extension for this
12420 // extension point, the existing #GIOExtension object is returned.
12421 // RETURNS: a #GIOExtension object for #GType
12422 // <extension_point_name>: the name of the extension point
12423 // <type>: the #GType to register as extension
12424 // <extension_name>: the name for the extension
12425 // <priority>: the priority for the extension
12426 static IOExtension* implement()(char* extension_point_name, Type type, char* extension_name, int priority) {
12427 return g_io_extension_point_implement(extension_point_name, type, extension_name, priority);
12430 // Looks up an existing extension point.
12432 // is no registered extension point with the given name.
12433 // RETURNS: the #GIOExtensionPoint, or %NULL if there
12434 // <name>: the name of the extension point
12435 static IOExtensionPoint* lookup()(char* name) {
12436 return g_io_extension_point_lookup(name);
12439 // Registers an extension point.
12441 // owned by GIO and should not be freed.
12442 // RETURNS: the new #GIOExtensionPoint. This object is
12443 // <name>: The name of the extension point
12444 static IOExtensionPoint* register()(char* name) {
12445 return g_io_extension_point_register(name);
12450 // Provides an interface and default functions for loading and unloading
12451 // modules. This is used internally to make GIO extensible, but can also
12452 // be used by others to implement module loading.
12453 struct IOModule /* : GObject.TypeModule */ {
12454 mixin GObject2.TypePlugin.__interface__;
12455 alias method_parent this;
12456 alias method_parent super_;
12457 alias method_parent typemodule;
12458 GObject2.TypeModule method_parent;
12461 // Creates a new GIOModule that will load the specific
12462 // shared library when in use.
12464 // or %NULL on error.
12465 // RETURNS: a #GIOModule from given @filename,
12466 // <filename>: filename of the shared library module.
12467 static IOModule* /*new*/ new_()(char* filename) {
12468 return g_io_module_new(filename);
12471 // VERSION: 2.24
12472 // Optional API for GIO modules to implement.
12474 // Should return a list of all the extension points that may be
12475 // implemented in this module.
12477 // This method will not be called in normal use, however it may be
12478 // called when probing existing modules and recording which extension
12479 // points that this model is used for. This means we won't have to
12480 // load and initialze this module unless its needed.
12482 // If this function is not implemented by the module the module will
12483 // always be loaded, initialized and then unloaded on application startup
12484 // so that it can register its extension points during init.
12486 // Note that a module need not actually implement all the extension points
12487 // that g_io_module_query returns, since the exact list of extension may
12488 // depend on runtime issues. However all extension points actually implemented
12489 // must be returned by g_io_module_query() (if defined).
12491 // When installing a module that implements g_io_module_query you must
12492 // run gio-querymodules in order to build the cache files required for
12493 // lazy loading.
12495 // extension points of the module. The array must be suitable for
12496 // freeing with g_strfreev().
12497 // RETURNS: A %NULL-terminated array of strings, listing the supported
12498 static char** /*new*/ query()() {
12499 return g_io_module_query();
12502 // Required API for GIO modules to implement.
12503 // This function is ran after the module has been loaded into GIO,
12504 // to initialize the module.
12505 void load()() {
12506 g_io_module_load(&this);
12509 // Required API for GIO modules to implement.
12510 // This function is ran when the module is being unloaded from GIO,
12511 // to finalize the module.
12512 void unload()() {
12513 g_io_module_unload(&this);
12517 struct IOModuleClass {
12521 // Represents a scope for loading IO modules. A scope can be used for blocking
12522 // duplicate modules, or blocking a module you don't want to load.
12524 // The scope can be used with g_io_modules_load_all_in_directory_with_scope()
12525 // or g_io_modules_scan_all_in_directory_with_scope().
12526 struct IOModuleScope /* Version 2.30 */ {
12528 // VERSION: 2.30
12529 // Block modules with the given @basename from being loaded when
12530 // this scope is used with g_io_modules_scan_all_in_directory_with_scope()
12531 // or g_io_modules_load_all_in_directory_with_scope().
12532 // <basename>: the basename to block
12533 void block()(char* basename) {
12534 g_io_module_scope_block(&this, basename);
12537 // VERSION: 2.30
12538 // Free a module scope.
12539 void free()() {
12540 g_io_module_scope_free(&this);
12543 // Unintrospectable function: new() / g_io_module_scope_new()
12544 // VERSION: 2.30
12545 // Create a new scope for loading of IO modules. A scope can be used for
12546 // blocking duplicate modules, or blocking a module you don't want to load.
12548 // Specify the %G_IO_MODULES_SCOPE_BLOCK_DUPLICATES flag to block modules
12549 // which have the same base name as a module that has already been seen
12550 // in this scope.
12551 // RETURNS: the new module scope
12552 // <flags>: flags for the new scope
12553 static IOModuleScope* /*new*/ new_()(IOModuleScopeFlags flags) {
12554 return g_io_module_scope_new(flags);
12558 // Flags for use with g_io_module_scope_new().
12559 enum IOModuleScopeFlags /* Version 2.30 */ {
12560 NONE = 0,
12561 BLOCK_DUPLICATES = 1
12563 // Opaque class for defining and scheduling IO jobs.
12564 struct IOSchedulerJob {
12566 // Used from an I/O job to send a callback to be run in the thread
12567 // that the job was started from, waiting for the result (and thus
12568 // blocking the I/O job).
12569 // RETURNS: The return value of @func
12570 // <func>: a #GSourceFunc callback that will be called in the original thread
12571 // <user_data>: data to pass to @func
12572 // <notify>: a #GDestroyNotify for @user_data, or %NULL
12573 int send_to_mainloop()(GLib2.SourceFunc func, void* user_data, GLib2.DestroyNotify notify) {
12574 return g_io_scheduler_job_send_to_mainloop(&this, func, user_data, notify);
12577 // Used from an I/O job to send a callback to be run asynchronously in
12578 // the thread that the job was started from. The callback will be run
12579 // when the main loop is available, but at that time the I/O job might
12580 // have finished. The return value from the callback is ignored.
12582 // Note that if you are passing the @user_data from g_io_scheduler_push_job()
12583 // on to this function you have to ensure that it is not freed before
12584 // @func is called, either by passing %NULL as @notify to
12585 // g_io_scheduler_push_job() or by using refcounting for @user_data.
12586 // <func>: a #GSourceFunc callback that will be called in the original thread
12587 // <user_data>: data to pass to @func
12588 // <notify>: a #GDestroyNotify for @user_data, or %NULL
12589 void send_to_mainloop_async()(GLib2.SourceFunc func, void* user_data, GLib2.DestroyNotify notify) {
12590 g_io_scheduler_job_send_to_mainloop_async(&this, func, user_data, notify);
12595 // I/O Job function.
12597 // Note that depending on whether threads are available, the
12598 // #GIOScheduler may run jobs in separate threads or in an idle
12599 // in the mainloop.
12601 // Long-running jobs should periodically check the @cancellable
12602 // to see if they have been cancelled.
12604 // complete the job, %FALSE if the job is complete (or cancelled)
12605 // RETURNS: %TRUE if this function should be called again to
12606 // <job>: a #GIOSchedulerJob.
12607 // <cancellable>: optional #GCancellable object, %NULL to ignore.
12608 // <user_data>: the data to pass to callback function
12609 extern (C) alias int function (IOSchedulerJob* job, Cancellable* cancellable, void* user_data) IOSchedulerJobFunc;
12612 // GIOStream represents an object that has both read and write streams.
12613 // Generally the two streams acts as separate input and output streams,
12614 // but they share some common resources and state. For instance, for
12615 // seekable streams they may use the same position in both streams.
12617 // Examples of #GIOStream objects are #GSocketConnection which represents
12618 // a two-way network connection, and #GFileIOStream which represent a
12619 // file handle opened in read-write mode.
12621 // To do the actual reading and writing you need to get the substreams
12622 // with g_io_stream_get_input_stream() and g_io_stream_get_output_stream().
12624 // The #GIOStream object owns the input and the output streams, not the other
12625 // way around, so keeping the substreams alive will not keep the #GIOStream
12626 // object alive. If the #GIOStream object is freed it will be closed, thus
12627 // closing the substream, so even if the substreams stay alive they will
12628 // always just return a %G_IO_ERROR_CLOSED for all operations.
12630 // To close a stream use g_io_stream_close() which will close the common
12631 // stream object and also the individual substreams. You can also close
12632 // the substreams themselves. In most cases this only marks the
12633 // substream as closed, so further I/O on it fails. However, some streams
12634 // may support "half-closed" states where one direction of the stream
12635 // is actually shut down.
12636 struct IOStream /* : GObject.Object */ {
12637 alias parent_instance this;
12638 alias parent_instance super_;
12639 alias parent_instance object;
12640 GObject2.Object parent_instance;
12641 private IOStreamPrivate* priv;
12644 // VERSION: 2.28
12645 // Finishes an asynchronous io stream splice operation.
12646 // RETURNS: %TRUE on success, %FALSE otherwise.
12647 // <result>: a #GAsyncResult.
12648 static int splice_finish()(AsyncResult* result, GLib2.Error** error=null) {
12649 return g_io_stream_splice_finish(result, error);
12652 // VERSION: 2.22
12653 // Clears the pending flag on @stream.
12654 void clear_pending()() {
12655 g_io_stream_clear_pending(&this);
12658 // VERSION: 2.22
12659 // Closes the stream, releasing resources related to it. This will also
12660 // closes the individual input and output streams, if they are not already
12661 // closed.
12663 // Once the stream is closed, all other operations will return
12664 // %G_IO_ERROR_CLOSED. Closing a stream multiple times will not
12665 // return an error.
12667 // Closing a stream will automatically flush any outstanding buffers
12668 // in the stream.
12670 // Streams will be automatically closed when the last reference
12671 // is dropped, but you might want to call this function to make sure
12672 // resources are released as early as possible.
12674 // Some streams might keep the backing store of the stream (e.g. a file
12675 // descriptor) open after the stream is closed. See the documentation for
12676 // the individual stream for details.
12678 // On failure the first error that happened will be reported, but the
12679 // close operation will finish as much as possible. A stream that failed
12680 // to close will still return %G_IO_ERROR_CLOSED for all operations.
12681 // Still, it is important to check and report the error to the user,
12682 // otherwise there might be a loss of data as all data might not be written.
12684 // If @cancellable is not NULL, then the operation can be cancelled by
12685 // triggering the cancellable object from another thread. If the operation
12686 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
12687 // Cancelling a close will still leave the stream closed, but some streams
12688 // can use a faster close that doesn't block to e.g. check errors.
12690 // The default implementation of this method just calls close on the
12691 // individual input/output streams.
12692 // RETURNS: %TRUE on success, %FALSE on failure
12693 // <cancellable>: optional #GCancellable object, %NULL to ignore
12694 int close()(Cancellable* cancellable, GLib2.Error** error=null) {
12695 return g_io_stream_close(&this, cancellable, error);
12698 // VERSION: 2.22
12699 // Requests an asynchronous close of the stream, releasing resources
12700 // related to it. When the operation is finished @callback will be
12701 // called. You can then call g_io_stream_close_finish() to get
12702 // the result of the operation.
12704 // For behaviour details see g_io_stream_close().
12706 // The asynchronous methods have a default fallback that uses threads
12707 // to implement asynchronicity, so they are optional for inheriting
12708 // classes. However, if you override one you must override all.
12709 // <io_priority>: the io priority of the request
12710 // <cancellable>: optional cancellable object
12711 // <callback>: callback to call when the request is satisfied
12712 // <user_data>: the data to pass to callback function
12713 void close_async()(int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
12714 g_io_stream_close_async(&this, io_priority, cancellable, callback, user_data);
12717 // VERSION: 2.22
12718 // Closes a stream.
12719 // RETURNS: %TRUE if stream was successfully closed, %FALSE otherwise.
12720 // <result>: a #GAsyncResult
12721 int close_finish()(AsyncResult* result, GLib2.Error** error=null) {
12722 return g_io_stream_close_finish(&this, result, error);
12725 // VERSION: 2.22
12726 // Gets the input stream for this object. This is used
12727 // for reading.
12729 // Do not free.
12730 // RETURNS: a #GInputStream, owned by the #GIOStream.
12731 InputStream* get_input_stream()() {
12732 return g_io_stream_get_input_stream(&this);
12735 // VERSION: 2.22
12736 // Gets the output stream for this object. This is used for
12737 // writing.
12739 // Do not free.
12740 // RETURNS: a #GOutputStream, owned by the #GIOStream.
12741 OutputStream* get_output_stream()() {
12742 return g_io_stream_get_output_stream(&this);
12745 // VERSION: 2.22
12746 // Checks if a stream has pending actions.
12747 // RETURNS: %TRUE if @stream has pending actions.
12748 int has_pending()() {
12749 return g_io_stream_has_pending(&this);
12752 // VERSION: 2.22
12753 // Checks if a stream is closed.
12754 // RETURNS: %TRUE if the stream is closed.
12755 int is_closed()() {
12756 return g_io_stream_is_closed(&this);
12759 // VERSION: 2.22
12760 // Sets @stream to have actions pending. If the pending flag is
12761 // already set or @stream is closed, it will return %FALSE and set
12762 // @error.
12763 // RETURNS: %TRUE if pending was previously unset and is now set.
12764 int set_pending()(GLib2.Error** error=null) {
12765 return g_io_stream_set_pending(&this, error);
12768 // VERSION: 2.28
12769 // Asyncronously splice the output stream of @stream1 to the input stream of
12770 // @stream2, and splice the output stream of @stream2 to the input stream of
12771 // @stream1.
12773 // When the operation is finished @callback will be called.
12774 // You can then call g_io_stream_splice_finish() to get the
12775 // result of the operation.
12776 // <stream2>: a #GIOStream.
12777 // <flags>: a set of #GIOStreamSpliceFlags.
12778 // <io_priority>: the io priority of the request.
12779 // <cancellable>: optional #GCancellable object, %NULL to ignore.
12780 // <callback>: a #GAsyncReadyCallback.
12781 // <user_data>: user data passed to @callback.
12782 void splice_async()(IOStream* stream2, IOStreamSpliceFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
12783 g_io_stream_splice_async(&this, stream2, flags, io_priority, cancellable, callback, user_data);
12787 struct IOStreamAdapter {
12790 struct IOStreamClass {
12791 GObject2.ObjectClass parent_class;
12792 // RETURNS: a #GInputStream, owned by the #GIOStream.
12793 extern (C) InputStream* function (IOStream* stream) get_input_stream;
12794 // RETURNS: a #GOutputStream, owned by the #GIOStream.
12795 extern (C) OutputStream* function (IOStream* stream) get_output_stream;
12796 extern (C) int function (IOStream* stream, Cancellable* cancellable, GLib2.Error** error=null) close_fn;
12798 // <io_priority>: the io priority of the request
12799 // <cancellable>: optional cancellable object
12800 // <callback>: callback to call when the request is satisfied
12801 // <user_data>: the data to pass to callback function
12802 extern (C) void function (IOStream* stream, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) close_async;
12804 // RETURNS: %TRUE if stream was successfully closed, %FALSE otherwise.
12805 // <result>: a #GAsyncResult
12806 extern (C) int function (IOStream* stream, AsyncResult* result, GLib2.Error** error=null) close_finish;
12807 extern (C) void function () _g_reserved1;
12808 extern (C) void function () _g_reserved2;
12809 extern (C) void function () _g_reserved3;
12810 extern (C) void function () _g_reserved4;
12811 extern (C) void function () _g_reserved5;
12812 extern (C) void function () _g_reserved6;
12813 extern (C) void function () _g_reserved7;
12814 extern (C) void function () _g_reserved8;
12815 extern (C) void function () _g_reserved9;
12816 extern (C) void function () _g_reserved10;
12819 struct IOStreamPrivate {
12822 // GIOStreamSpliceFlags determine how streams should be spliced.
12823 enum IOStreamSpliceFlags /* Version 2.28 */ {
12824 NONE = 0,
12825 CLOSE_STREAM1 = 1,
12826 CLOSE_STREAM2 = 2,
12827 WAIT_FOR_BOTH = 4
12830 // #GIcon is a very minimal interface for icons. It provides functions
12831 // for checking the equality of two icons, hashing of icons and
12832 // serializing an icon to and from strings.
12834 // #GIcon does not provide the actual pixmap for the icon as this is out
12835 // of GIO's scope, however implementations of #GIcon may contain the name
12836 // of an icon (see #GThemedIcon), or the path to an icon (see #GLoadableIcon).
12838 // To obtain a hash of a #GIcon, see g_icon_hash().
12840 // To check if two #GIcons are equal, see g_icon_equal().
12842 // For serializing a #GIcon, use g_icon_to_string() and
12843 // g_icon_new_for_string().
12845 // If your application or library provides one or more #GIcon
12846 // implementations you need to ensure that each #GType is registered
12847 // with the type system prior to calling g_icon_new_for_string().
12848 struct Icon /* Interface */ {
12849 mixin template __interface__() {
12850 // Gets a hash for an icon.
12852 // use in a #GHashTable or similar data structure.
12853 // RETURNS: a #guint containing a hash for the @icon, suitable for
12854 // <icon>: #gconstpointer to an icon object.
12855 static uint hash()(const(void)* icon) {
12856 return g_icon_hash(icon);
12859 // VERSION: 2.20
12860 // Generate a #GIcon instance from @str. This function can fail if
12861 // @str is not valid - see g_icon_to_string() for discussion.
12863 // If your application or library provides one or more #GIcon
12864 // implementations you need to ensure that each #GType is registered
12865 // with the type system prior to calling g_icon_new_for_string().
12867 // interface or %NULL if @error is set.
12868 // RETURNS: An object implementing the #GIcon
12869 // <str>: A string obtained via g_icon_to_string().
12870 static Icon* /*new*/ new_for_string()(char* str, GLib2.Error** error=null) {
12871 return g_icon_new_for_string(str, error);
12874 // Checks if two icons are equal.
12875 // RETURNS: %TRUE if @icon1 is equal to @icon2. %FALSE otherwise.
12876 // <icon2>: pointer to the second #GIcon.
12877 int equal()(Icon* icon2) {
12878 return g_icon_equal(cast(Icon*)&this, icon2);
12881 // VERSION: 2.20
12882 // Generates a textual representation of @icon that can be used for
12883 // serialization such as when passing @icon to a different process or
12884 // saving it to persistent storage. Use g_icon_new_for_string() to
12885 // get @icon back from the returned string.
12887 // The encoding of the returned string is proprietary to #GIcon except
12888 // in the following two cases
12890 // <itemizedlist>
12891 // <listitem><para>
12892 // If @icon is a #GFileIcon, the returned string is a native path
12893 // (such as <literal>/path/to/my icon.png</literal>) without escaping
12894 // if the #GFile for @icon is a native file. If the file is not
12895 // native, the returned string is the result of g_file_get_uri()
12896 // (such as <literal>sftp://path/to/my&percnt;20icon.png</literal>).
12897 // </para></listitem>
12898 // <listitem><para>
12899 // If @icon is a #GThemedIcon with exactly one name, the encoding is
12900 // simply the name (such as <literal>network-server</literal>).
12901 // </para></listitem>
12902 // </itemizedlist>
12904 // be serialized. Use g_free() to free.
12905 // RETURNS: An allocated NUL-terminated UTF8 string or %NULL if @icon can't
12906 char* /*new*/ to_string()() {
12907 return g_icon_to_string(cast(Icon*)&this);
12910 mixin __interface__;
12914 // GIconIface is used to implement GIcon types for various
12915 // different systems. See #GThemedIcon and #GLoadableIcon for
12916 // examples of how to implement this interface.
12917 struct IconIface {
12918 GObject2.TypeInterface g_iface;
12919 // RETURNS: a #guint containing a hash for the @icon, suitable for
12920 extern (C) uint function (Icon* icon) hash;
12922 // RETURNS: %TRUE if @icon1 is equal to @icon2. %FALSE otherwise.
12923 // <icon2>: pointer to the second #GIcon.
12924 extern (C) int function (Icon* icon1, Icon* icon2) equal;
12925 // RETURNS: An allocated NUL-terminated UTF8 string or %NULL if @icon can't
12926 extern (C) int function (Icon* icon, PtrArray* tokens, int* out_version) to_tokens;
12927 // Unintrospectable functionp: from_tokens() / ()
12928 extern (C) Icon* function (char** tokens, int num_tokens, int version_, GLib2.Error** error=null) from_tokens;
12932 // #GInetAddress represents an IPv4 or IPv6 internet address. Use
12933 // g_resolver_lookup_by_name() or g_resolver_lookup_by_name_async() to
12934 // look up the #GInetAddress for a hostname. Use
12935 // g_resolver_lookup_by_address() or
12936 // g_resolver_lookup_by_address_async() to look up the hostname for a
12937 // #GInetAddress.
12939 // To actually connect to a remote host, you will need a
12940 // #GInetSocketAddress (which includes a #GInetAddress as well as a
12941 // port number).
12942 struct InetAddress /* : GObject.Object */ {
12943 alias parent_instance this;
12944 alias parent_instance super_;
12945 alias parent_instance object;
12946 GObject2.Object parent_instance;
12947 private InetAddressPrivate* priv;
12950 // VERSION: 2.22
12951 // Creates a #GInetAddress for the "any" address (unassigned/"don't
12952 // care") for @family.
12954 // for @family.
12955 // RETURNS: a new #GInetAddress corresponding to the "any" address
12956 // <family>: the address family
12957 static InetAddress* /*new*/ new_any()(SocketFamily family) {
12958 return g_inet_address_new_any(family);
12961 // VERSION: 2.22
12962 // Creates a new #GInetAddress from the given @family and @bytes.
12963 // @bytes should be 4 bytes for %G_INET_ADDRESS_IPV4 and 16 bytes for
12964 // %G_INET_ADDRESS_IPV6.
12965 // RETURNS: a new #GInetAddress corresponding to @family and @bytes.
12966 // <bytes>: raw address data
12967 // <family>: the address family of @bytes
12968 static InetAddress* /*new*/ new_from_bytes()(ubyte* bytes, SocketFamily family) {
12969 return g_inet_address_new_from_bytes(bytes, family);
12972 // VERSION: 2.22
12973 // Parses @string as an IP address and creates a new #GInetAddress.
12975 // @string could not be parsed.
12976 // RETURNS: a new #GInetAddress corresponding to @string, or %NULL if
12977 // <string>: a string representation of an IP address
12978 static InetAddress* /*new*/ new_from_string()(char* string_) {
12979 return g_inet_address_new_from_string(string_);
12982 // VERSION: 2.22
12983 // Creates a #GInetAddress for the loopback address for @family.
12985 // for @family.
12986 // RETURNS: a new #GInetAddress corresponding to the loopback address
12987 // <family>: the address family
12988 static InetAddress* /*new*/ new_loopback()(SocketFamily family) {
12989 return g_inet_address_new_loopback(family);
12992 // VERSION: 2.30
12993 // Checks if two #GInetAddress instances are equal, e.g. the same address.
12994 // RETURNS: %TRUE if @address and @other_address are equal, %FALSE otherwise.
12995 // <other_address>: Another #GInetAddress.
12996 int equal()(InetAddress* other_address) {
12997 return g_inet_address_equal(&this, other_address);
13000 // VERSION: 2.22
13001 // Gets @address's family
13002 // RETURNS: @address's family
13003 SocketFamily get_family()() {
13004 return g_inet_address_get_family(&this);
13007 // VERSION: 2.22
13008 // Tests whether @address is the "any" address for its family.
13009 // RETURNS: %TRUE if @address is the "any" address for its family.
13010 int get_is_any()() {
13011 return g_inet_address_get_is_any(&this);
13014 // VERSION: 2.22
13015 // Tests whether @address is a link-local address (that is, if it
13016 // identifies a host on a local network that is not connected to the
13017 // Internet).
13018 // RETURNS: %TRUE if @address is a link-local address.
13019 int get_is_link_local()() {
13020 return g_inet_address_get_is_link_local(&this);
13023 // VERSION: 2.22
13024 // Tests whether @address is the loopback address for its family.
13025 // RETURNS: %TRUE if @address is the loopback address for its family.
13026 int get_is_loopback()() {
13027 return g_inet_address_get_is_loopback(&this);
13030 // VERSION: 2.22
13031 // Tests whether @address is a global multicast address.
13032 // RETURNS: %TRUE if @address is a global multicast address.
13033 int get_is_mc_global()() {
13034 return g_inet_address_get_is_mc_global(&this);
13037 // VERSION: 2.22
13038 // Tests whether @address is a link-local multicast address.
13039 // RETURNS: %TRUE if @address is a link-local multicast address.
13040 int get_is_mc_link_local()() {
13041 return g_inet_address_get_is_mc_link_local(&this);
13044 // VERSION: 2.22
13045 // Tests whether @address is a node-local multicast address.
13046 // RETURNS: %TRUE if @address is a node-local multicast address.
13047 int get_is_mc_node_local()() {
13048 return g_inet_address_get_is_mc_node_local(&this);
13051 // VERSION: 2.22
13052 // Tests whether @address is an organization-local multicast address.
13053 // RETURNS: %TRUE if @address is an organization-local multicast address.
13054 int get_is_mc_org_local()() {
13055 return g_inet_address_get_is_mc_org_local(&this);
13058 // VERSION: 2.22
13059 // Tests whether @address is a site-local multicast address.
13060 // RETURNS: %TRUE if @address is a site-local multicast address.
13061 int get_is_mc_site_local()() {
13062 return g_inet_address_get_is_mc_site_local(&this);
13065 // VERSION: 2.22
13066 // Tests whether @address is a multicast address.
13067 // RETURNS: %TRUE if @address is a multicast address.
13068 int get_is_multicast()() {
13069 return g_inet_address_get_is_multicast(&this);
13072 // VERSION: 2.22
13073 // Tests whether @address is a site-local address such as 10.0.0.1
13074 // (that is, the address identifies a host on a local network that can
13075 // not be reached directly from the Internet, but which may have
13076 // outgoing Internet connectivity via a NAT or firewall).
13077 // RETURNS: %TRUE if @address is a site-local address.
13078 int get_is_site_local()() {
13079 return g_inet_address_get_is_site_local(&this);
13082 // VERSION: 2.22
13083 // Gets the size of the native raw binary address for @address. This
13084 // is the size of the data that you get from g_inet_address_to_bytes().
13085 // RETURNS: the number of bytes used for the native version of @address.
13086 size_t get_native_size()() {
13087 return g_inet_address_get_native_size(&this);
13090 // Unintrospectable method: to_bytes() / g_inet_address_to_bytes()
13091 // VERSION: 2.22
13092 // Gets the raw binary address data from @address.
13094 // which should not be modified, stored, or freed. The size of this
13095 // array can be gotten with g_inet_address_get_native_size().
13096 // RETURNS: a pointer to an internal array of the bytes in @address,
13097 ubyte* to_bytes()() {
13098 return g_inet_address_to_bytes(&this);
13101 // VERSION: 2.22
13102 // Converts @address to string form.
13104 // freed after use.
13105 // RETURNS: a representation of @address as a string, which should be
13106 char* /*new*/ to_string()() {
13107 return g_inet_address_to_string(&this);
13111 struct InetAddressClass {
13112 GObject2.ObjectClass parent_class;
13113 // RETURNS: a representation of @address as a string, which should be
13114 extern (C) char* /*new*/ function (InetAddress* address) to_string;
13115 // RETURNS: a pointer to an internal array of the bytes in @address,
13116 extern (C) ubyte* function (InetAddress* address) to_bytes;
13119 struct InetAddressPrivate {
13123 // An IPv4 or IPv6 socket address; that is, the combination of a
13124 // #GInetAddress and a port number.
13125 struct InetSocketAddress /* : SocketAddress */ {
13126 mixin SocketConnectable.__interface__;
13127 alias parent_instance this;
13128 alias parent_instance super_;
13129 alias parent_instance socketaddress;
13130 SocketAddress parent_instance;
13131 private InetSocketAddressPrivate* priv;
13134 // VERSION: 2.22
13135 // Creates a new #GInetSocketAddress for @address and @port.
13136 // RETURNS: a new #GInetSocketAddress
13137 // <address>: a #GInetAddress
13138 // <port>: a port number
13139 static InetSocketAddress* /*new*/ new_()(InetAddress* address, ushort port) {
13140 return g_inet_socket_address_new(address, port);
13143 // VERSION: 2.22
13144 // Gets @address's #GInetAddress.
13146 // g_object_ref()'d if it will be stored
13147 // RETURNS: the #GInetAddress for @address, which must be
13148 InetAddress* get_address()() {
13149 return g_inet_socket_address_get_address(&this);
13152 // VERSION: 2.22
13153 // Gets @address's port.
13154 // RETURNS: the port for @address
13155 ushort get_port()() {
13156 return g_inet_socket_address_get_port(&this);
13160 struct InetSocketAddressClass {
13161 SocketAddressClass parent_class;
13164 struct InetSocketAddressPrivate {
13168 // #GInitable is implemented by objects that can fail during
13169 // initialization. If an object implements this interface the
13170 // g_initable_init() function must be called as the first thing
13171 // after construction. If g_initable_init() is not called, or if
13172 // it returns an error, all further operations on the object
13173 // should fail, generally with a %G_IO_ERROR_NOT_INITIALIZED error.
13175 // Users of objects implementing this are not intended to use
13176 // the interface method directly, instead it will be used automatically
13177 // in various ways. For C applications you generally just call
13178 // g_initable_new() directly, or indirectly via a foo_thing_new() wrapper.
13179 // This will call g_initable_init() under the cover, returning %NULL and
13180 // setting a #GError on failure (at which point the instance is
13181 // unreferenced).
13183 // For bindings in languages where the native constructor supports
13184 // exceptions the binding could check for objects implemention %GInitable
13185 // during normal construction and automatically initialize them, throwing
13186 // an exception on failure.
13187 struct Initable /* Interface */ /* Version 2.22 */ {
13188 mixin template __interface__() {
13189 // Unintrospectable function: new() / g_initable_new()
13190 // VERSION: 2.22
13191 // Helper function for constructing #GInitiable object. This is
13192 // similar to g_object_new() but also initializes the object
13193 // and returns %NULL, setting an error on failure.
13194 // RETURNS: a newly allocated #GObject, or %NULL on error
13195 // <object_type>: a #GType supporting #GInitable.
13196 // <cancellable>: optional #GCancellable object, %NULL to ignore.
13197 // <error>: a #GError location to store the error occurring, or %NULL to ignore.
13198 // <first_property_name>: the name of the first property, or %NULL if no properties
13199 alias g_initable_new new_; // Variadic
13201 // Unintrospectable function: new_valist() / g_initable_new_valist()
13202 // VERSION: 2.22
13203 // Helper function for constructing #GInitiable object. This is
13204 // similar to g_object_new_valist() but also initializes the object
13205 // and returns %NULL, setting an error on failure.
13206 // RETURNS: a newly allocated #GObject, or %NULL on error
13207 // <object_type>: a #GType supporting #GInitable.
13208 // <first_property_name>: the name of the first property, followed by the value, and other property value pairs, and ended by %NULL.
13209 // <var_args>: The var args list generated from @first_property_name.
13210 // <cancellable>: optional #GCancellable object, %NULL to ignore.
13211 static GObject2.Object* /*new*/ new_valist()(Type object_type, char* first_property_name, va_list var_args, Cancellable* cancellable, GLib2.Error** error=null) {
13212 return g_initable_new_valist(object_type, first_property_name, var_args, cancellable, error);
13215 // VERSION: 2.22
13216 // Helper function for constructing #GInitiable object. This is
13217 // similar to g_object_newv() but also initializes the object
13218 // and returns %NULL, setting an error on failure.
13219 // RETURNS: a newly allocated #GObject, or %NULL on error
13220 // <object_type>: a #GType supporting #GInitable.
13221 // <n_parameters>: the number of parameters in @parameters
13222 // <parameters>: the parameters to use to construct the object
13223 // <cancellable>: optional #GCancellable object, %NULL to ignore.
13224 static void* /*new*/ newv()(Type object_type, uint n_parameters, GObject2.Parameter* parameters, Cancellable* cancellable, GLib2.Error** error=null) {
13225 return g_initable_newv(object_type, n_parameters, parameters, cancellable, error);
13228 // VERSION: 2.22
13229 // Initializes the object implementing the interface. This must be
13230 // done before any real use of the object after initial construction.
13232 // Implementations may also support cancellation. If @cancellable is not %NULL,
13233 // then initialization can be cancelled by triggering the cancellable object
13234 // from another thread. If the operation was cancelled, the error
13235 // %G_IO_ERROR_CANCELLED will be returned. If @cancellable is not %NULL and
13236 // the object doesn't support cancellable initialization the error
13237 // %G_IO_ERROR_NOT_SUPPORTED will be returned.
13239 // If this function is not called, or returns with an error then all
13240 // operations on the object should fail, generally returning the
13241 // error %G_IO_ERROR_NOT_INITIALIZED.
13243 // Implementations of this method must be idempotent, i.e. multiple calls
13244 // to this function with the same argument should return the same results.
13245 // Only the first call initializes the object, further calls return the result
13246 // of the first call. This is so that its safe to implement the singleton
13247 // pattern in the GObject constructor function.
13249 // return %FALSE and set @error appropriately if present.
13250 // RETURNS: %TRUE if successful. If an error has occurred, this function will
13251 // <cancellable>: optional #GCancellable object, %NULL to ignore.
13252 int init()(Cancellable* cancellable, GLib2.Error** error=null) {
13253 return g_initable_init(cast(Initable*)&this, cancellable, error);
13256 mixin __interface__;
13260 // Provides an interface for initializing object such that initialization
13261 // may fail.
13262 struct InitableIface /* Version 2.22 */ {
13263 GObject2.TypeInterface g_iface;
13265 // RETURNS: %TRUE if successful. If an error has occurred, this function will
13266 // <cancellable>: optional #GCancellable object, %NULL to ignore.
13267 extern (C) int function (Initable* initable, Cancellable* cancellable, GLib2.Error** error=null) init;
13271 // GInputStream has functions to read from a stream (g_input_stream_read()),
13272 // to close a stream (g_input_stream_close()) and to skip some content
13273 // (g_input_stream_skip()).
13275 // To copy the content of an input stream to an output stream without
13276 // manually handling the reads and writes, use g_output_stream_splice().
13278 // All of these functions have async variants too.
13279 struct InputStream /* : GObject.Object */ {
13280 alias parent_instance this;
13281 alias parent_instance super_;
13282 alias parent_instance object;
13283 GObject2.Object parent_instance;
13284 private InputStreamPrivate* priv;
13286 // Clears the pending flag on @stream.
13287 void clear_pending()() {
13288 g_input_stream_clear_pending(&this);
13291 // Closes the stream, releasing resources related to it.
13293 // Once the stream is closed, all other operations will return %G_IO_ERROR_CLOSED.
13294 // Closing a stream multiple times will not return an error.
13296 // Streams will be automatically closed when the last reference
13297 // is dropped, but you might want to call this function to make sure
13298 // resources are released as early as possible.
13300 // Some streams might keep the backing store of the stream (e.g. a file descriptor)
13301 // open after the stream is closed. See the documentation for the individual
13302 // stream for details.
13304 // On failure the first error that happened will be reported, but the close
13305 // operation will finish as much as possible. A stream that failed to
13306 // close will still return %G_IO_ERROR_CLOSED for all operations. Still, it
13307 // is important to check and report the error to the user.
13309 // If @cancellable is not NULL, then the operation can be cancelled by
13310 // triggering the cancellable object from another thread. If the operation
13311 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
13312 // Cancelling a close will still leave the stream closed, but some streams
13313 // can use a faster close that doesn't block to e.g. check errors.
13314 // RETURNS: %TRUE on success, %FALSE on failure
13315 // <cancellable>: optional #GCancellable object, %NULL to ignore.
13316 int close()(Cancellable* cancellable, GLib2.Error** error=null) {
13317 return g_input_stream_close(&this, cancellable, error);
13320 // Requests an asynchronous closes of the stream, releasing resources related to it.
13321 // When the operation is finished @callback will be called.
13322 // You can then call g_input_stream_close_finish() to get the result of the
13323 // operation.
13325 // For behaviour details see g_input_stream_close().
13327 // The asyncronous methods have a default fallback that uses threads to implement
13328 // asynchronicity, so they are optional for inheriting classes. However, if you
13329 // override one you must override all.
13330 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
13331 // <cancellable>: optional cancellable object
13332 // <callback>: callback to call when the request is satisfied
13333 // <user_data>: the data to pass to callback function
13334 void close_async()(int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
13335 g_input_stream_close_async(&this, io_priority, cancellable, callback, user_data);
13338 // Finishes closing a stream asynchronously, started from g_input_stream_close_async().
13339 // RETURNS: %TRUE if the stream was closed successfully.
13340 // <result>: a #GAsyncResult.
13341 int close_finish()(AsyncResult* result, GLib2.Error** error=null) {
13342 return g_input_stream_close_finish(&this, result, error);
13345 // Checks if an input stream has pending actions.
13346 // RETURNS: %TRUE if @stream has pending actions.
13347 int has_pending()() {
13348 return g_input_stream_has_pending(&this);
13351 // Checks if an input stream is closed.
13352 // RETURNS: %TRUE if the stream is closed.
13353 int is_closed()() {
13354 return g_input_stream_is_closed(&this);
13357 // Tries to read @count bytes from the stream into the buffer starting at
13358 // @buffer. Will block during this read.
13360 // If count is zero returns zero and does nothing. A value of @count
13361 // larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
13363 // On success, the number of bytes read into the buffer is returned.
13364 // It is not an error if this is not the same as the requested size, as it
13365 // can happen e.g. near the end of a file. Zero is returned on end of file
13366 // (or if @count is zero), but never otherwise.
13368 // If @cancellable is not NULL, then the operation can be cancelled by
13369 // triggering the cancellable object from another thread. If the operation
13370 // was cancelled, the error G_IO_ERROR_CANCELLED will be returned. If an
13371 // operation was partially finished when the operation was cancelled the
13372 // partial result will be returned, without an error.
13374 // On error -1 is returned and @error is set accordingly.
13375 // RETURNS: Number of bytes read, or -1 on error
13376 // <buffer>: a buffer to read data into (which should be at least count bytes long).
13377 // <count>: the number of bytes that will be read from the stream
13378 // <cancellable>: optional #GCancellable object, %NULL to ignore.
13379 ssize_t read()(void* buffer, size_t count, Cancellable* cancellable, GLib2.Error** error=null) {
13380 return g_input_stream_read(&this, buffer, count, cancellable, error);
13383 // Tries to read @count bytes from the stream into the buffer starting at
13384 // @buffer. Will block during this read.
13386 // This function is similar to g_input_stream_read(), except it tries to
13387 // read as many bytes as requested, only stopping on an error or end of stream.
13389 // On a successful read of @count bytes, or if we reached the end of the
13390 // stream, %TRUE is returned, and @bytes_read is set to the number of bytes
13391 // read into @buffer.
13393 // If there is an error during the operation %FALSE is returned and @error
13394 // is set to indicate the error status, @bytes_read is updated to contain
13395 // the number of bytes read into @buffer before the error occurred.
13396 // RETURNS: %TRUE on success, %FALSE if there was an error
13397 // <buffer>: a buffer to read data into (which should be at least count bytes long).
13398 // <count>: the number of bytes that will be read from the stream
13399 // <bytes_read>: location to store the number of bytes that was read from the stream
13400 // <cancellable>: optional #GCancellable object, %NULL to ignore.
13401 int read_all()(void* buffer, size_t count, /*out*/ size_t* bytes_read, Cancellable* cancellable, GLib2.Error** error=null) {
13402 return g_input_stream_read_all(&this, buffer, count, bytes_read, cancellable, error);
13405 // Request an asynchronous read of @count bytes from the stream into the buffer
13406 // starting at @buffer. When the operation is finished @callback will be called.
13407 // You can then call g_input_stream_read_finish() to get the result of the
13408 // operation.
13410 // During an async request no other sync and async calls are allowed on @stream, and will
13411 // result in %G_IO_ERROR_PENDING errors.
13413 // A value of @count larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
13415 // On success, the number of bytes read into the buffer will be passed to the
13416 // callback. It is not an error if this is not the same as the requested size, as it
13417 // can happen e.g. near the end of a file, but generally we try to read
13418 // as many bytes as requested. Zero is returned on end of file
13419 // (or if @count is zero), but never otherwise.
13421 // Any outstanding i/o request with higher priority (lower numerical value) will
13422 // be executed before an outstanding request with lower priority. Default
13423 // priority is %G_PRIORITY_DEFAULT.
13425 // The asyncronous methods have a default fallback that uses threads to implement
13426 // asynchronicity, so they are optional for inheriting classes. However, if you
13427 // override one you must override all.
13428 // <buffer>: a buffer to read data into (which should be at least count bytes long).
13429 // <count>: the number of bytes that will be read from the stream
13430 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
13431 // <cancellable>: optional #GCancellable object, %NULL to ignore.
13432 // <callback>: callback to call when the request is satisfied
13433 // <user_data>: the data to pass to callback function
13434 void read_async()(void* buffer, size_t count, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
13435 g_input_stream_read_async(&this, buffer, count, io_priority, cancellable, callback, user_data);
13438 // Finishes an asynchronous stream read operation.
13439 // RETURNS: number of bytes read in, or -1 on error.
13440 // <result>: a #GAsyncResult.
13441 ssize_t read_finish()(AsyncResult* result, GLib2.Error** error=null) {
13442 return g_input_stream_read_finish(&this, result, error);
13445 // Sets @stream to have actions pending. If the pending flag is
13446 // already set or @stream is closed, it will return %FALSE and set
13447 // @error.
13448 // RETURNS: %TRUE if pending was previously unset and is now set.
13449 int set_pending()(GLib2.Error** error=null) {
13450 return g_input_stream_set_pending(&this, error);
13453 // Tries to skip @count bytes from the stream. Will block during the operation.
13455 // This is identical to g_input_stream_read(), from a behaviour standpoint,
13456 // but the bytes that are skipped are not returned to the user. Some
13457 // streams have an implementation that is more efficient than reading the data.
13459 // This function is optional for inherited classes, as the default implementation
13460 // emulates it using read.
13462 // If @cancellable is not %NULL, then the operation can be cancelled by
13463 // triggering the cancellable object from another thread. If the operation
13464 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
13465 // operation was partially finished when the operation was cancelled the
13466 // partial result will be returned, without an error.
13467 // RETURNS: Number of bytes skipped, or -1 on error
13468 // <count>: the number of bytes that will be skipped from the stream
13469 // <cancellable>: optional #GCancellable object, %NULL to ignore.
13470 ssize_t skip()(size_t count, Cancellable* cancellable, GLib2.Error** error=null) {
13471 return g_input_stream_skip(&this, count, cancellable, error);
13474 // Request an asynchronous skip of @count bytes from the stream.
13475 // When the operation is finished @callback will be called.
13476 // You can then call g_input_stream_skip_finish() to get the result
13477 // of the operation.
13479 // During an async request no other sync and async calls are allowed,
13480 // and will result in %G_IO_ERROR_PENDING errors.
13482 // A value of @count larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
13484 // On success, the number of bytes skipped will be passed to the callback.
13485 // It is not an error if this is not the same as the requested size, as it
13486 // can happen e.g. near the end of a file, but generally we try to skip
13487 // as many bytes as requested. Zero is returned on end of file
13488 // (or if @count is zero), but never otherwise.
13490 // Any outstanding i/o request with higher priority (lower numerical value)
13491 // will be executed before an outstanding request with lower priority.
13492 // Default priority is %G_PRIORITY_DEFAULT.
13494 // The asynchronous methods have a default fallback that uses threads to
13495 // implement asynchronicity, so they are optional for inheriting classes.
13496 // However, if you override one, you must override all.
13497 // <count>: the number of bytes that will be skipped from the stream
13498 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
13499 // <cancellable>: optional #GCancellable object, %NULL to ignore.
13500 // <callback>: callback to call when the request is satisfied
13501 // <user_data>: the data to pass to callback function
13502 void skip_async()(size_t count, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
13503 g_input_stream_skip_async(&this, count, io_priority, cancellable, callback, user_data);
13506 // Finishes a stream skip operation.
13507 // RETURNS: the size of the bytes skipped, or %-1 on error.
13508 // <result>: a #GAsyncResult.
13509 ssize_t skip_finish()(AsyncResult* result, GLib2.Error** error=null) {
13510 return g_input_stream_skip_finish(&this, result, error);
13514 struct InputStreamClass {
13515 GObject2.ObjectClass parent_class;
13516 extern (C) ssize_t function (InputStream* stream, void* buffer, size_t count, Cancellable* cancellable, GLib2.Error** error=null) read_fn;
13518 // RETURNS: Number of bytes skipped, or -1 on error
13519 // <count>: the number of bytes that will be skipped from the stream
13520 // <cancellable>: optional #GCancellable object, %NULL to ignore.
13521 extern (C) ssize_t function (InputStream* stream, size_t count, Cancellable* cancellable, GLib2.Error** error=null) skip;
13522 extern (C) int function (InputStream* stream, Cancellable* cancellable, GLib2.Error** error=null) close_fn;
13524 // <buffer>: a buffer to read data into (which should be at least count bytes long).
13525 // <count>: the number of bytes that will be read from the stream
13526 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
13527 // <cancellable>: optional #GCancellable object, %NULL to ignore.
13528 // <callback>: callback to call when the request is satisfied
13529 // <user_data>: the data to pass to callback function
13530 extern (C) void function (InputStream* stream, void* buffer, size_t count, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) read_async;
13532 // RETURNS: number of bytes read in, or -1 on error.
13533 // <result>: a #GAsyncResult.
13534 extern (C) ssize_t function (InputStream* stream, AsyncResult* result, GLib2.Error** error=null) read_finish;
13536 // <count>: the number of bytes that will be skipped from the stream
13537 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
13538 // <cancellable>: optional #GCancellable object, %NULL to ignore.
13539 // <callback>: callback to call when the request is satisfied
13540 // <user_data>: the data to pass to callback function
13541 extern (C) void function (InputStream* stream, size_t count, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) skip_async;
13543 // RETURNS: the size of the bytes skipped, or %-1 on error.
13544 // <result>: a #GAsyncResult.
13545 extern (C) ssize_t function (InputStream* stream, AsyncResult* result, GLib2.Error** error=null) skip_finish;
13547 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
13548 // <cancellable>: optional cancellable object
13549 // <callback>: callback to call when the request is satisfied
13550 // <user_data>: the data to pass to callback function
13551 extern (C) void function (InputStream* stream, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) close_async;
13553 // RETURNS: %TRUE if the stream was closed successfully.
13554 // <result>: a #GAsyncResult.
13555 extern (C) int function (InputStream* stream, AsyncResult* result, GLib2.Error** error=null) close_finish;
13556 extern (C) void function () _g_reserved1;
13557 extern (C) void function () _g_reserved2;
13558 extern (C) void function () _g_reserved3;
13559 extern (C) void function () _g_reserved4;
13560 extern (C) void function () _g_reserved5;
13563 struct InputStreamPrivate {
13567 // Structure used for scatter/gather data input.
13568 // You generally pass in an array of #GInputVector<!-- -->s
13569 // and the operation will store the read data starting in the
13570 // first buffer, switching to the next as needed.
13571 struct InputVector /* Version 2.22 */ {
13572 void* buffer;
13573 size_t size;
13577 // Extends the #GIcon interface and adds the ability to
13578 // load icons from streams.
13579 struct LoadableIcon /* Interface */ {
13580 mixin template __interface__() {
13581 // Loads a loadable icon. For the asynchronous version of this function,
13582 // see g_loadable_icon_load_async().
13583 // RETURNS: a #GInputStream to read the icon from.
13584 // <size>: an integer.
13585 // <type>: a location to store the type of the loaded icon, %NULL to ignore.
13586 // <cancellable>: optional #GCancellable object, %NULL to ignore.
13587 InputStream* /*new*/ load()(int size, /*out*/ char** type, Cancellable* cancellable, GLib2.Error** error=null) {
13588 return g_loadable_icon_load(cast(LoadableIcon*)&this, size, type, cancellable, error);
13591 // Loads an icon asynchronously. To finish this function, see
13592 // g_loadable_icon_load_finish(). For the synchronous, blocking
13593 // version of this function, see g_loadable_icon_load().
13594 // <size>: an integer.
13595 // <cancellable>: optional #GCancellable object, %NULL to ignore.
13596 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
13597 // <user_data>: the data to pass to callback function
13598 void load_async()(int size, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
13599 g_loadable_icon_load_async(cast(LoadableIcon*)&this, size, cancellable, callback, user_data);
13602 // Finishes an asynchronous icon load started in g_loadable_icon_load_async().
13603 // RETURNS: a #GInputStream to read the icon from.
13604 // <res>: a #GAsyncResult.
13605 // <type>: a location to store the type of the loaded icon, %NULL to ignore.
13606 InputStream* /*new*/ load_finish()(AsyncResult* res, char** type, GLib2.Error** error=null) {
13607 return g_loadable_icon_load_finish(cast(LoadableIcon*)&this, res, type, error);
13610 mixin __interface__;
13613 // Interface for icons that can be loaded as a stream.
13614 struct LoadableIconIface {
13615 GObject2.TypeInterface g_iface;
13617 // RETURNS: a #GInputStream to read the icon from.
13618 // <size>: an integer.
13619 // <type>: a location to store the type of the loaded icon, %NULL to ignore.
13620 // <cancellable>: optional #GCancellable object, %NULL to ignore.
13621 extern (C) InputStream* /*new*/ function (LoadableIcon* icon, int size, /*out*/ char** type, Cancellable* cancellable, GLib2.Error** error=null) load;
13623 // <size>: an integer.
13624 // <cancellable>: optional #GCancellable object, %NULL to ignore.
13625 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
13626 // <user_data>: the data to pass to callback function
13627 extern (C) void function (LoadableIcon* icon, int size, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) load_async;
13629 // RETURNS: a #GInputStream to read the icon from.
13630 // <res>: a #GAsyncResult.
13631 // <type>: a location to store the type of the loaded icon, %NULL to ignore.
13632 extern (C) InputStream* /*new*/ function (LoadableIcon* icon, AsyncResult* res, char** type, GLib2.Error** error=null) load_finish;
13636 // #GMemoryInputStream is a class for using arbitrary
13637 // memory chunks as input for GIO streaming input operations.
13638 struct MemoryInputStream /* : InputStream */ {
13639 mixin Seekable.__interface__;
13640 alias parent_instance this;
13641 alias parent_instance super_;
13642 alias parent_instance inputstream;
13643 InputStream parent_instance;
13644 private MemoryInputStreamPrivate* priv;
13647 // Creates a new empty #GMemoryInputStream.
13648 // RETURNS: a new #GInputStream
13649 static MemoryInputStream* /*new*/ new_()() {
13650 return g_memory_input_stream_new();
13653 // Creates a new #GMemoryInputStream with data in memory of a given size.
13654 // RETURNS: new #GInputStream read from @data of @len bytes.
13655 // <data>: input data
13656 // <len>: length of the data, may be -1 if @data is a nul-terminated string
13657 // <destroy>: function that is called to free @data, or %NULL
13658 static MemoryInputStream* /*new*/ new_from_data()(ubyte* data, ssize_t len, GLib2.DestroyNotify destroy=null) {
13659 return g_memory_input_stream_new_from_data(data, len, destroy);
13662 // Appends @data to data that can be read from the input stream
13663 // <data>: input data
13664 // <len>: length of the data, may be -1 if @data is a nul-terminated string
13665 // <destroy>: function that is called to free @data, or %NULL
13666 void add_data()(ubyte* data, ssize_t len, GLib2.DestroyNotify destroy=null) {
13667 g_memory_input_stream_add_data(&this, data, len, destroy);
13671 struct MemoryInputStreamClass {
13672 InputStreamClass parent_class;
13673 extern (C) void function () _g_reserved1;
13674 extern (C) void function () _g_reserved2;
13675 extern (C) void function () _g_reserved3;
13676 extern (C) void function () _g_reserved4;
13677 extern (C) void function () _g_reserved5;
13680 struct MemoryInputStreamPrivate {
13684 // #GMemoryOutputStream is a class for using arbitrary
13685 // memory chunks as output for GIO streaming output operations.
13686 struct MemoryOutputStream /* : OutputStream */ {
13687 mixin Seekable.__interface__;
13688 alias parent_instance this;
13689 alias parent_instance super_;
13690 alias parent_instance outputstream;
13691 OutputStream parent_instance;
13692 private MemoryOutputStreamPrivate* priv;
13695 // Unintrospectable constructor: new() / g_memory_output_stream_new()
13696 // Creates a new #GMemoryOutputStream.
13698 // If @data is non-%NULL, the stream will use that for its internal storage.
13699 // If @realloc_fn is non-%NULL, it will be used for resizing the internal
13700 // storage when necessary. To construct a fixed-size output stream,
13701 // pass %NULL as @realloc_fn.
13703 // |[
13704 // /&ast; a stream that can grow &ast;/
13705 // stream = g_memory_output_stream_new (NULL, 0, realloc, free);
13707 // /&ast; another stream that can grow &ast;/
13708 // stream2 = g_memory_output_stream_new (NULL, 0, g_realloc, g_free);
13710 // /&ast; a fixed-size stream &ast;/
13711 // data = malloc (200);
13712 // stream3 = g_memory_output_stream_new (data, 200, NULL, free);
13713 // ]|
13714 // RETURNS: A newly created #GMemoryOutputStream object.
13715 // <data>: pointer to a chunk of memory to use, or %NULL
13716 // <size>: the size of @data
13717 // <realloc_function>: a function with realloc() semantics (like g_realloc()) to be called when @data needs to be grown, or %NULL
13718 // <destroy_function>: a function to be called on @data when the stream is finalized, or %NULL
13719 static MemoryOutputStream* /*new*/ new_()(void* data, size_t size, ReallocFunc realloc_function, GLib2.DestroyNotify destroy_function) {
13720 return g_memory_output_stream_new(data, size, realloc_function, destroy_function);
13723 // Gets any loaded data from the @ostream.
13725 // Note that the returned pointer may become invalid on the next
13726 // write or truncate operation on the stream.
13727 // RETURNS: pointer to the stream's data
13728 void* get_data()() {
13729 return g_memory_output_stream_get_data(&this);
13732 // VERSION: 2.18
13733 // Returns the number of bytes from the start up
13734 // to including the last byte written in the stream
13735 // that has not been truncated away.
13736 // RETURNS: the number of bytes written to the stream
13737 size_t get_data_size()() {
13738 return g_memory_output_stream_get_data_size(&this);
13741 // Gets the size of the currently allocated data area (available from
13742 // g_memory_output_stream_get_data()). If the stream isn't
13743 // growable (no realloc was passed to g_memory_output_stream_new()) then
13744 // this is the maximum size of the stream and further writes
13745 // will return %G_IO_ERROR_NO_SPACE.
13747 // Note that for growable streams the returned size may become invalid on
13748 // the next write or truncate operation on the stream.
13750 // If you want the number of bytes currently written to the stream, use
13751 // g_memory_output_stream_get_data_size().
13752 // RETURNS: the number of bytes allocated for the data buffer
13753 size_t get_size()() {
13754 return g_memory_output_stream_get_size(&this);
13757 // VERSION: 2.26
13758 // Gets any loaded data from the @ostream. Ownership of the data
13759 // is transferred to the caller; when no longer needed it must be
13760 // freed using the free function set in @ostream's
13761 // #GMemoryOutputStream:destroy-function property.
13763 // @ostream must be closed before calling this function.
13764 // RETURNS: the stream's data
13765 void* /*new*/ steal_data()() {
13766 return g_memory_output_stream_steal_data(&this);
13770 struct MemoryOutputStreamClass {
13771 OutputStreamClass parent_class;
13772 extern (C) void function () _g_reserved1;
13773 extern (C) void function () _g_reserved2;
13774 extern (C) void function () _g_reserved3;
13775 extern (C) void function () _g_reserved4;
13776 extern (C) void function () _g_reserved5;
13779 struct MemoryOutputStreamPrivate {
13783 // The #GMount interface represents user-visible mounts. Note, when
13784 // porting from GnomeVFS, #GMount is the moral equivalent of #GnomeVFSVolume.
13786 // #GMount is a "mounted" filesystem that you can access. Mounted is in
13787 // quotes because it's not the same as a unix mount, it might be a gvfs
13788 // mount, but you can still access the files on it if you use GIO. Might or
13789 // might not be related to a volume object.
13791 // Unmounting a #GMount instance is an asynchronous operation. For
13792 // more information about asynchronous operations, see #GAsyncReady
13793 // and #GSimpleAsyncReady. To unmount a #GMount instance, first call
13794 // g_mount_unmount_with_operation() with (at least) the #GMount instance and a
13795 // #GAsyncReadyCallback. The callback will be fired when the
13796 // operation has resolved (either with success or failure), and a
13797 // #GAsyncReady structure will be passed to the callback. That
13798 // callback should then call g_mount_unmount_with_operation_finish() with the #GMount
13799 // and the #GAsyncReady data to see if the operation was completed
13800 // successfully. If an @error is present when g_mount_unmount_with_operation_finish()
13801 // is called, then it will be filled with any error information.
13802 struct Mount /* Interface */ {
13803 mixin template __interface__() {
13804 // Checks if @mount can be eject.
13805 // RETURNS: %TRUE if the @mount can be ejected.
13806 int can_eject()() {
13807 return g_mount_can_eject(cast(Mount*)&this);
13810 // Checks if @mount can be mounted.
13811 // RETURNS: %TRUE if the @mount can be unmounted.
13812 int can_unmount()() {
13813 return g_mount_can_unmount(cast(Mount*)&this);
13816 // DEPRECATED (v2.22) method: eject - Use g_mount_eject_with_operation() instead.
13817 // Ejects a mount. This is an asynchronous operation, and is
13818 // finished by calling g_mount_eject_finish() with the @mount
13819 // and #GAsyncResult data returned in the @callback.
13820 // <flags>: flags affecting the unmount if required for eject
13821 // <cancellable>: optional #GCancellable object, %NULL to ignore.
13822 // <callback>: a #GAsyncReadyCallback, or %NULL.
13823 // <user_data>: user data passed to @callback.
13824 void eject()(MountUnmountFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
13825 g_mount_eject(cast(Mount*)&this, flags, cancellable, callback, user_data);
13828 // DEPRECATED (v2.22) method: eject_finish - Use g_mount_eject_with_operation_finish() instead.
13829 // Finishes ejecting a mount. If any errors occurred during the operation,
13830 // @error will be set to contain the errors and %FALSE will be returned.
13831 // RETURNS: %TRUE if the mount was successfully ejected. %FALSE otherwise.
13832 // <result>: a #GAsyncResult.
13833 int eject_finish()(AsyncResult* result, GLib2.Error** error=null) {
13834 return g_mount_eject_finish(cast(Mount*)&this, result, error);
13837 // VERSION: 2.22
13838 // Ejects a mount. This is an asynchronous operation, and is
13839 // finished by calling g_mount_eject_with_operation_finish() with the @mount
13840 // and #GAsyncResult data returned in the @callback.
13841 // <flags>: flags affecting the unmount if required for eject
13842 // <mount_operation>: a #GMountOperation or %NULL to avoid user interaction.
13843 // <cancellable>: optional #GCancellable object, %NULL to ignore.
13844 // <callback>: a #GAsyncReadyCallback, or %NULL.
13845 // <user_data>: user data passed to @callback.
13846 void eject_with_operation()(MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
13847 g_mount_eject_with_operation(cast(Mount*)&this, flags, mount_operation, cancellable, callback, user_data);
13850 // VERSION: 2.22
13851 // Finishes ejecting a mount. If any errors occurred during the operation,
13852 // @error will be set to contain the errors and %FALSE will be returned.
13853 // RETURNS: %TRUE if the mount was successfully ejected. %FALSE otherwise.
13854 // <result>: a #GAsyncResult.
13855 int eject_with_operation_finish()(AsyncResult* result, GLib2.Error** error=null) {
13856 return g_mount_eject_with_operation_finish(cast(Mount*)&this, result, error);
13859 // Gets the default location of @mount. The default location of the given
13860 // @mount is a path that reflects the main entry point for the user (e.g.
13861 // the home directory, or the root of the volume).
13863 // The returned object should be unreffed with
13864 // g_object_unref() when no longer needed.
13865 // RETURNS: a #GFile.
13866 File* /*new*/ get_default_location()() {
13867 return g_mount_get_default_location(cast(Mount*)&this);
13870 // Gets the drive for the @mount.
13872 // This is a convenience method for getting the #GVolume and then
13873 // using that object to get the #GDrive.
13875 // The returned object should be unreffed with
13876 // g_object_unref() when no longer needed.
13877 // RETURNS: a #GDrive or %NULL if @mount is not associated with a volume or a drive.
13878 Drive* /*new*/ get_drive()() {
13879 return g_mount_get_drive(cast(Mount*)&this);
13882 // Gets the icon for @mount.
13884 // The returned object should be unreffed with
13885 // g_object_unref() when no longer needed.
13886 // RETURNS: a #GIcon.
13887 Icon* /*new*/ get_icon()() {
13888 return g_mount_get_icon(cast(Mount*)&this);
13891 // Gets the name of @mount.
13893 // The returned string should be freed with g_free()
13894 // when no longer needed.
13895 // RETURNS: the name for the given @mount.
13896 char* /*new*/ get_name()() {
13897 return g_mount_get_name(cast(Mount*)&this);
13900 // Gets the root directory on @mount.
13902 // The returned object should be unreffed with
13903 // g_object_unref() when no longer needed.
13904 // RETURNS: a #GFile.
13905 File* /*new*/ get_root()() {
13906 return g_mount_get_root(cast(Mount*)&this);
13909 // Gets the UUID for the @mount. The reference is typically based on
13910 // the file system UUID for the mount in question and should be
13911 // considered an opaque string. Returns %NULL if there is no UUID
13912 // available.
13914 // The returned string should be freed with g_free()
13915 // when no longer needed.
13916 // RETURNS: the UUID for @mount or %NULL if no UUID can be computed.
13917 char* /*new*/ get_uuid()() {
13918 return g_mount_get_uuid(cast(Mount*)&this);
13921 // Gets the volume for the @mount.
13923 // The returned object should be unreffed with
13924 // g_object_unref() when no longer needed.
13925 // RETURNS: a #GVolume or %NULL if @mount is not associated with a volume.
13926 Volume* /*new*/ get_volume()() {
13927 return g_mount_get_volume(cast(Mount*)&this);
13930 // VERSION: 2.18
13931 // Tries to guess the type of content stored on @mount. Returns one or
13932 // more textual identifiers of well-known content types (typically
13933 // prefixed with "x-content/"), e.g. x-content/image-dcf for camera
13934 // memory cards. See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
13935 // specification for more on x-content types.
13937 // This is an asynchronous operation (see
13938 // g_mount_guess_content_type_sync() for the synchronous version), and
13939 // is finished by calling g_mount_guess_content_type_finish() with the
13940 // @mount and #GAsyncResult data returned in the @callback.
13941 // <force_rescan>: Whether to force a rescan of the content. Otherwise a cached result will be used if available
13942 // <cancellable>: optional #GCancellable object, %NULL to ignore
13943 // <callback>: a #GAsyncReadyCallback
13944 // <user_data>: user data passed to @callback
13945 void guess_content_type()(int force_rescan, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
13946 g_mount_guess_content_type(cast(Mount*)&this, force_rescan, cancellable, callback, user_data);
13949 // VERSION: 2.18
13950 // Finishes guessing content types of @mount. If any errors occurred
13951 // during the operation, @error will be set to contain the errors and
13952 // %FALSE will be returned. In particular, you may get an
13953 // %G_IO_ERROR_NOT_SUPPORTED if the mount does not support content
13954 // guessing.
13956 // Caller should free this array with g_strfreev() when done with it.
13957 // RETURNS: a %NULL-terminated array of content types or %NULL on error.
13958 // <result>: a #GAsyncResult
13959 char** /*new*/ guess_content_type_finish()(AsyncResult* result, GLib2.Error** error=null) {
13960 return g_mount_guess_content_type_finish(cast(Mount*)&this, result, error);
13963 // VERSION: 2.18
13964 // Tries to guess the type of content stored on @mount. Returns one or
13965 // more textual identifiers of well-known content types (typically
13966 // prefixed with "x-content/"), e.g. x-content/image-dcf for camera
13967 // memory cards. See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
13968 // specification for more on x-content types.
13970 // This is an synchronous operation and as such may block doing IO;
13971 // see g_mount_guess_content_type() for the asynchronous version.
13973 // Caller should free this array with g_strfreev() when done with it.
13974 // RETURNS: a %NULL-terminated array of content types or %NULL on error.
13975 // <force_rescan>: Whether to force a rescan of the content. Otherwise a cached result will be used if available
13976 // <cancellable>: optional #GCancellable object, %NULL to ignore
13977 char** /*new*/ guess_content_type_sync()(int force_rescan, Cancellable* cancellable, GLib2.Error** error=null) {
13978 return g_mount_guess_content_type_sync(cast(Mount*)&this, force_rescan, cancellable, error);
13981 // VERSION: 2.20
13982 // Determines if @mount is shadowed. Applications or libraries should
13983 // avoid displaying @mount in the user interface if it is shadowed.
13985 // A mount is said to be shadowed if there exists one or more user
13986 // visible objects (currently #GMount objects) with a root that is
13987 // inside the root of @mount.
13989 // One application of shadow mounts is when exposing a single file
13990 // system that is used to address several logical volumes. In this
13991 // situation, a #GVolumeMonitor implementation would create two
13992 // #GVolume objects (for example, one for the camera functionality of
13993 // the device and one for a SD card reader on the device) with
13994 // activation URIs <literal>gphoto2://[usb:001,002]/store1/</literal>
13995 // and <literal>gphoto2://[usb:001,002]/store2/</literal>. When the
13996 // underlying mount (with root
13997 // <literal>gphoto2://[usb:001,002]/</literal>) is mounted, said
13998 // #GVolumeMonitor implementation would create two #GMount objects
13999 // (each with their root matching the corresponding volume activation
14000 // root) that would shadow the original mount.
14002 // The proxy monitor in GVfs 2.26 and later, automatically creates and
14003 // manage shadow mounts (and shadows the underlying mount) if the
14004 // activation root on a #GVolume is set.
14005 // RETURNS: %TRUE if @mount is shadowed.
14006 int is_shadowed()() {
14007 return g_mount_is_shadowed(cast(Mount*)&this);
14010 // Remounts a mount. This is an asynchronous operation, and is
14011 // finished by calling g_mount_remount_finish() with the @mount
14012 // and #GAsyncResults data returned in the @callback.
14014 // Remounting is useful when some setting affecting the operation
14015 // of the volume has been changed, as these may need a remount to
14016 // take affect. While this is semantically equivalent with unmounting
14017 // and then remounting not all backends might need to actually be
14018 // unmounted.
14019 // <flags>: flags affecting the operation
14020 // <mount_operation>: a #GMountOperation or %NULL to avoid user interaction.
14021 // <cancellable>: optional #GCancellable object, %NULL to ignore.
14022 // <callback>: a #GAsyncReadyCallback, or %NULL.
14023 // <user_data>: user data passed to @callback.
14024 void remount()(MountMountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
14025 g_mount_remount(cast(Mount*)&this, flags, mount_operation, cancellable, callback, user_data);
14028 // Finishes remounting a mount. If any errors occurred during the operation,
14029 // @error will be set to contain the errors and %FALSE will be returned.
14030 // RETURNS: %TRUE if the mount was successfully remounted. %FALSE otherwise.
14031 // <result>: a #GAsyncResult.
14032 int remount_finish()(AsyncResult* result, GLib2.Error** error=null) {
14033 return g_mount_remount_finish(cast(Mount*)&this, result, error);
14036 // VERSION: 2.20
14037 // Increments the shadow count on @mount. Usually used by
14038 // #GVolumeMonitor implementations when creating a shadow mount for
14039 // @mount, see g_mount_is_shadowed() for more information. The caller
14040 // will need to emit the #GMount::changed signal on @mount manually.
14041 void shadow()() {
14042 g_mount_shadow(cast(Mount*)&this);
14045 // DEPRECATED (v2.22) method: unmount - Use g_mount_unmount_with_operation() instead.
14046 // Unmounts a mount. This is an asynchronous operation, and is
14047 // finished by calling g_mount_unmount_finish() with the @mount
14048 // and #GAsyncResult data returned in the @callback.
14049 // <flags>: flags affecting the operation
14050 // <cancellable>: optional #GCancellable object, %NULL to ignore.
14051 // <callback>: a #GAsyncReadyCallback, or %NULL.
14052 // <user_data>: user data passed to @callback.
14053 void unmount()(MountUnmountFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
14054 g_mount_unmount(cast(Mount*)&this, flags, cancellable, callback, user_data);
14057 // DEPRECATED (v2.22) method: unmount_finish - Use g_mount_unmount_with_operation_finish() instead.
14058 // Finishes unmounting a mount. If any errors occurred during the operation,
14059 // @error will be set to contain the errors and %FALSE will be returned.
14060 // RETURNS: %TRUE if the mount was successfully unmounted. %FALSE otherwise.
14061 // <result>: a #GAsyncResult.
14062 int unmount_finish()(AsyncResult* result, GLib2.Error** error=null) {
14063 return g_mount_unmount_finish(cast(Mount*)&this, result, error);
14066 // VERSION: 2.22
14067 // Unmounts a mount. This is an asynchronous operation, and is
14068 // finished by calling g_mount_unmount_with_operation_finish() with the @mount
14069 // and #GAsyncResult data returned in the @callback.
14070 // <flags>: flags affecting the operation
14071 // <mount_operation>: a #GMountOperation or %NULL to avoid user interaction.
14072 // <cancellable>: optional #GCancellable object, %NULL to ignore.
14073 // <callback>: a #GAsyncReadyCallback, or %NULL.
14074 // <user_data>: user data passed to @callback.
14075 void unmount_with_operation()(MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
14076 g_mount_unmount_with_operation(cast(Mount*)&this, flags, mount_operation, cancellable, callback, user_data);
14079 // VERSION: 2.22
14080 // Finishes unmounting a mount. If any errors occurred during the operation,
14081 // @error will be set to contain the errors and %FALSE will be returned.
14082 // RETURNS: %TRUE if the mount was successfully unmounted. %FALSE otherwise.
14083 // <result>: a #GAsyncResult.
14084 int unmount_with_operation_finish()(AsyncResult* result, GLib2.Error** error=null) {
14085 return g_mount_unmount_with_operation_finish(cast(Mount*)&this, result, error);
14088 // VERSION: 2.20
14089 // Decrements the shadow count on @mount. Usually used by
14090 // #GVolumeMonitor implementations when destroying a shadow mount for
14091 // @mount, see g_mount_is_shadowed() for more information. The caller
14092 // will need to emit the #GMount::changed signal on @mount manually.
14093 void unshadow()() {
14094 g_mount_unshadow(cast(Mount*)&this);
14096 // Emitted when the mount has been changed.
14097 extern (C) alias static void function (Mount* this_, void* user_data=null) signal_changed;
14099 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
14100 return super_.signal_connect!name(cb, data, cf);
14103 ulong signal_connect(string name:"changed", CB:signal_changed)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
14104 return signal_connect_data!()(&this, cast(char*)"changed",
14105 cast(GObject2.Callback)cb, data, null, cf);
14108 // VERSION: 2.22
14109 // This signal is emitted when the #GMount is about to be
14110 // unmounted.
14111 extern (C) alias static void function (Mount* this_, void* user_data=null) signal_pre_unmount;
14112 ulong signal_connect(string name:"pre-unmount", CB:signal_pre_unmount)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
14113 return signal_connect_data!()(&this, cast(char*)"pre-unmount",
14114 cast(GObject2.Callback)cb, data, null, cf);
14117 // This signal is emitted when the #GMount have been
14118 // unmounted. If the recipient is holding references to the
14119 // object they should release them so the object can be
14120 // finalized.
14121 extern (C) alias static void function (Mount* this_, void* user_data=null) signal_unmounted;
14122 ulong signal_connect(string name:"unmounted", CB:signal_unmounted)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
14123 return signal_connect_data!()(&this, cast(char*)"unmounted",
14124 cast(GObject2.Callback)cb, data, null, cf);
14127 mixin __interface__;
14130 // Interface for implementing operations for mounts.
14131 struct MountIface {
14132 GObject2.TypeInterface g_iface;
14133 extern (C) void function (Mount* mount) changed;
14134 extern (C) void function (Mount* mount) unmounted;
14135 // RETURNS: a #GFile.
14136 extern (C) File* /*new*/ function (Mount* mount) get_root;
14137 // RETURNS: the name for the given @mount.
14138 extern (C) char* /*new*/ function (Mount* mount) get_name;
14139 // RETURNS: a #GIcon.
14140 extern (C) Icon* /*new*/ function (Mount* mount) get_icon;
14141 // RETURNS: the UUID for @mount or %NULL if no UUID can be computed.
14142 extern (C) char* /*new*/ function (Mount* mount) get_uuid;
14143 // RETURNS: a #GVolume or %NULL if @mount is not associated with a volume.
14144 extern (C) Volume* /*new*/ function (Mount* mount) get_volume;
14145 // RETURNS: a #GDrive or %NULL if @mount is not associated with a volume or a drive.
14146 extern (C) Drive* /*new*/ function (Mount* mount) get_drive;
14147 // RETURNS: %TRUE if the @mount can be unmounted.
14148 extern (C) int function (Mount* mount) can_unmount;
14149 // RETURNS: %TRUE if the @mount can be ejected.
14150 extern (C) int function (Mount* mount) can_eject;
14152 // <flags>: flags affecting the operation
14153 // <cancellable>: optional #GCancellable object, %NULL to ignore.
14154 // <callback>: a #GAsyncReadyCallback, or %NULL.
14155 // <user_data>: user data passed to @callback.
14156 extern (C) void function (Mount* mount, MountUnmountFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) unmount;
14158 // RETURNS: %TRUE if the mount was successfully unmounted. %FALSE otherwise.
14159 // <result>: a #GAsyncResult.
14160 extern (C) int function (Mount* mount, AsyncResult* result, GLib2.Error** error=null) unmount_finish;
14162 // <flags>: flags affecting the unmount if required for eject
14163 // <cancellable>: optional #GCancellable object, %NULL to ignore.
14164 // <callback>: a #GAsyncReadyCallback, or %NULL.
14165 // <user_data>: user data passed to @callback.
14166 extern (C) void function (Mount* mount, MountUnmountFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) eject;
14168 // RETURNS: %TRUE if the mount was successfully ejected. %FALSE otherwise.
14169 // <result>: a #GAsyncResult.
14170 extern (C) int function (Mount* mount, AsyncResult* result, GLib2.Error** error=null) eject_finish;
14172 // <flags>: flags affecting the operation
14173 // <mount_operation>: a #GMountOperation or %NULL to avoid user interaction.
14174 // <cancellable>: optional #GCancellable object, %NULL to ignore.
14175 // <callback>: a #GAsyncReadyCallback, or %NULL.
14176 // <user_data>: user data passed to @callback.
14177 extern (C) void function (Mount* mount, MountMountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) remount;
14179 // RETURNS: %TRUE if the mount was successfully remounted. %FALSE otherwise.
14180 // <result>: a #GAsyncResult.
14181 extern (C) int function (Mount* mount, AsyncResult* result, GLib2.Error** error=null) remount_finish;
14183 // <force_rescan>: Whether to force a rescan of the content. Otherwise a cached result will be used if available
14184 // <cancellable>: optional #GCancellable object, %NULL to ignore
14185 // <callback>: a #GAsyncReadyCallback
14186 // <user_data>: user data passed to @callback
14187 extern (C) void function (Mount* mount, int force_rescan, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) guess_content_type;
14189 // RETURNS: a %NULL-terminated array of content types or %NULL on error.
14190 // <result>: a #GAsyncResult
14191 extern (C) char** /*new*/ function (Mount* mount, AsyncResult* result, GLib2.Error** error=null) guess_content_type_finish;
14193 // RETURNS: a %NULL-terminated array of content types or %NULL on error.
14194 // <force_rescan>: Whether to force a rescan of the content. Otherwise a cached result will be used if available
14195 // <cancellable>: optional #GCancellable object, %NULL to ignore
14196 extern (C) char** /*new*/ function (Mount* mount, int force_rescan, Cancellable* cancellable, GLib2.Error** error=null) guess_content_type_sync;
14197 extern (C) void function (Mount* mount) pre_unmount;
14199 // <flags>: flags affecting the operation
14200 // <mount_operation>: a #GMountOperation or %NULL to avoid user interaction.
14201 // <cancellable>: optional #GCancellable object, %NULL to ignore.
14202 // <callback>: a #GAsyncReadyCallback, or %NULL.
14203 // <user_data>: user data passed to @callback.
14204 extern (C) void function (Mount* mount, MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) unmount_with_operation;
14206 // RETURNS: %TRUE if the mount was successfully unmounted. %FALSE otherwise.
14207 // <result>: a #GAsyncResult.
14208 extern (C) int function (Mount* mount, AsyncResult* result, GLib2.Error** error=null) unmount_with_operation_finish;
14210 // <flags>: flags affecting the unmount if required for eject
14211 // <mount_operation>: a #GMountOperation or %NULL to avoid user interaction.
14212 // <cancellable>: optional #GCancellable object, %NULL to ignore.
14213 // <callback>: a #GAsyncReadyCallback, or %NULL.
14214 // <user_data>: user data passed to @callback.
14215 extern (C) void function (Mount* mount, MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) eject_with_operation;
14217 // RETURNS: %TRUE if the mount was successfully ejected. %FALSE otherwise.
14218 // <result>: a #GAsyncResult.
14219 extern (C) int function (Mount* mount, AsyncResult* result, GLib2.Error** error=null) eject_with_operation_finish;
14220 // RETURNS: a #GFile.
14221 extern (C) File* /*new*/ function (Mount* mount) get_default_location;
14224 // Flags used when mounting a mount.
14225 enum MountMountFlags {
14226 NONE = 0
14229 // #GMountOperation provides a mechanism for interacting with the user.
14230 // It can be used for authenticating mountable operations, such as loop
14231 // mounting files, hard drive partitions or server locations. It can
14232 // also be used to ask the user questions or show a list of applications
14233 // preventing unmount or eject operations from completing.
14235 // Note that #GMountOperation is used for more than just #GMount
14236 // objects – for example it is also used in g_drive_start() and
14237 // g_drive_stop().
14239 // Users should instantiate a subclass of this that implements all the
14240 // various callbacks to show the required dialogs, such as
14241 // #GtkMountOperation. If no user interaction is desired (for example
14242 // when automounting filesystems at login time), usually %NULL can be
14243 // passed, see each method taking a #GMountOperation for details.
14244 struct MountOperation /* : GObject.Object */ {
14245 alias parent_instance this;
14246 alias parent_instance super_;
14247 alias parent_instance object;
14248 GObject2.Object parent_instance;
14249 MountOperationPrivate* priv;
14252 // Creates a new mount operation.
14253 // RETURNS: a #GMountOperation.
14254 static MountOperation* /*new*/ new_()() {
14255 return g_mount_operation_new();
14258 // Check to see whether the mount operation is being used
14259 // for an anonymous user.
14260 // RETURNS: %TRUE if mount operation is anonymous.
14261 int get_anonymous()() {
14262 return g_mount_operation_get_anonymous(&this);
14265 // Gets a choice from the mount operation.
14267 // the choice's list, or %0.
14268 // RETURNS: an integer containing an index of the user's choice from
14269 int get_choice()() {
14270 return g_mount_operation_get_choice(&this);
14273 // Gets the domain of the mount operation.
14274 // RETURNS: a string set to the domain.
14275 char* get_domain()() {
14276 return g_mount_operation_get_domain(&this);
14279 // Gets a password from the mount operation.
14280 // RETURNS: a string containing the password within @op.
14281 char* get_password()() {
14282 return g_mount_operation_get_password(&this);
14285 // Gets the state of saving passwords for the mount operation.
14286 // RETURNS: a #GPasswordSave flag.
14287 PasswordSave get_password_save()() {
14288 return g_mount_operation_get_password_save(&this);
14291 // Get the user name from the mount operation.
14292 // RETURNS: a string containing the user name.
14293 char* get_username()() {
14294 return g_mount_operation_get_username(&this);
14297 // Emits the #GMountOperation::reply signal.
14298 // <result>: a #GMountOperationResult
14299 void reply()(MountOperationResult result) {
14300 g_mount_operation_reply(&this, result);
14303 // Sets the mount operation to use an anonymous user if @anonymous is %TRUE.
14304 // <anonymous>: boolean value.
14305 void set_anonymous()(int anonymous) {
14306 g_mount_operation_set_anonymous(&this, anonymous);
14309 // Sets a default choice for the mount operation.
14310 // <choice>: an integer.
14311 void set_choice()(int choice) {
14312 g_mount_operation_set_choice(&this, choice);
14315 // Sets the mount operation's domain.
14316 // <domain>: the domain to set.
14317 void set_domain()(char* domain) {
14318 g_mount_operation_set_domain(&this, domain);
14321 // Sets the mount operation's password to @password.
14322 // <password>: password to set.
14323 void set_password()(char* password) {
14324 g_mount_operation_set_password(&this, password);
14327 // Sets the state of saving passwords for the mount operation.
14328 // <save>: a set of #GPasswordSave flags.
14329 void set_password_save()(PasswordSave save) {
14330 g_mount_operation_set_password_save(&this, save);
14333 // Sets the user name within @op to @username.
14334 // <username>: input username.
14335 void set_username()(char* username) {
14336 g_mount_operation_set_username(&this, username);
14339 // VERSION: 2.20
14340 // Emitted by the backend when e.g. a device becomes unavailable
14341 // while a mount operation is in progress.
14343 // Implementations of GMountOperation should handle this signal
14344 // by dismissing open password dialogs.
14345 extern (C) alias static void function (MountOperation* this_, void* user_data=null) signal_aborted;
14347 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
14348 return super_.signal_connect!name(cb, data, cf);
14351 ulong signal_connect(string name:"aborted", CB:signal_aborted)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
14352 return signal_connect_data!()(&this, cast(char*)"aborted",
14353 cast(GObject2.Callback)cb, data, null, cf);
14356 // Emitted when a mount operation asks the user for a password.
14358 // If the message contains a line break, the first line should be
14359 // presented as a heading. For example, it may be used as the
14360 // primary text in a #GtkMessageDialog.
14361 // <message>: string containing a message to display to the user.
14362 // <default_user>: string containing the default user name.
14363 // <default_domain>: string containing the default domain.
14364 // <flags>: a set of #GAskPasswordFlags.
14365 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;
14366 ulong signal_connect(string name:"ask-password", CB:signal_ask_password)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
14367 return signal_connect_data!()(&this, cast(char*)"ask-password",
14368 cast(GObject2.Callback)cb, data, null, cf);
14371 // Emitted when asking the user a question and gives a list of
14372 // choices for the user to choose from.
14374 // If the message contains a line break, the first line should be
14375 // presented as a heading. For example, it may be used as the
14376 // primary text in a #GtkMessageDialog.
14377 // <message>: string containing a message to display to the user.
14378 // <choices>: an array of strings for each possible choice.
14379 extern (C) alias static void function (MountOperation* this_, char* message, char* choices, void* user_data=null) signal_ask_question;
14380 ulong signal_connect(string name:"ask-question", CB:signal_ask_question)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
14381 return signal_connect_data!()(&this, cast(char*)"ask-question",
14382 cast(GObject2.Callback)cb, data, null, cf);
14385 // Emitted when the user has replied to the mount operation.
14386 // <result>: a #GMountOperationResult indicating how the request was handled
14387 extern (C) alias static void function (MountOperation* this_, MountOperationResult* result, void* user_data=null) signal_reply;
14388 ulong signal_connect(string name:"reply", CB:signal_reply)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
14389 return signal_connect_data!()(&this, cast(char*)"reply",
14390 cast(GObject2.Callback)cb, data, null, cf);
14393 // VERSION: 2.22
14394 // Emitted when one or more processes are blocking an operation
14395 // e.g. unmounting/ejecting a #GMount or stopping a #GDrive.
14397 // Note that this signal may be emitted several times to update the
14398 // list of blocking processes as processes close files. The
14399 // application should only respond with g_mount_operation_reply() to
14400 // the latest signal (setting #GMountOperation:choice to the choice
14401 // the user made).
14403 // If the message contains a line break, the first line should be
14404 // presented as a heading. For example, it may be used as the
14405 // primary text in a #GtkMessageDialog.
14406 // <message>: string containing a message to display to the user.
14407 // <processes>: an array of #GPid for processes blocking the operation.
14408 // <choices>: an array of strings for each possible choice.
14409 extern (C) alias static void function (MountOperation* this_, char* message, void* processes, char* choices, void* user_data=null) signal_show_processes;
14410 ulong signal_connect(string name:"show-processes", CB:signal_show_processes)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
14411 return signal_connect_data!()(&this, cast(char*)"show-processes",
14412 cast(GObject2.Callback)cb, data, null, cf);
14416 struct MountOperationClass {
14417 GObject2.ObjectClass parent_class;
14418 extern (C) void function (MountOperation* op, char* message, char* default_user, char* default_domain, AskPasswordFlags flags) ask_password;
14419 extern (C) void function (MountOperation* op, char* message, char* choices) ask_question;
14420 // <result>: a #GMountOperationResult
14421 extern (C) void function (MountOperation* op, MountOperationResult result) reply;
14422 extern (C) void function (MountOperation* op) aborted;
14423 extern (C) void function (MountOperation* op, char* message, Array* processes, char* choices) show_processes;
14424 extern (C) void function () _g_reserved1;
14425 extern (C) void function () _g_reserved2;
14426 extern (C) void function () _g_reserved3;
14427 extern (C) void function () _g_reserved4;
14428 extern (C) void function () _g_reserved5;
14429 extern (C) void function () _g_reserved6;
14430 extern (C) void function () _g_reserved7;
14431 extern (C) void function () _g_reserved8;
14432 extern (C) void function () _g_reserved9;
14433 extern (C) void function () _g_reserved10;
14436 struct MountOperationPrivate {
14440 // #GMountOperationResult is returned as a result when a request for
14441 // information is send by the mounting operation.
14442 enum MountOperationResult {
14443 HANDLED = 0,
14444 ABORTED = 1,
14445 UNHANDLED = 2
14447 // Flags used when an unmounting a mount.
14448 enum MountUnmountFlags {
14449 NONE = 0,
14450 FORCE = 1
14452 enum NATIVE_VOLUME_MONITOR_EXTENSION_POINT_NAME = "gio-native-volume-monitor";
14453 struct NativeVolumeMonitor /* : VolumeMonitor */ {
14454 alias parent_instance this;
14455 alias parent_instance super_;
14456 alias parent_instance volumemonitor;
14457 VolumeMonitor parent_instance;
14460 struct NativeVolumeMonitorClass {
14461 VolumeMonitorClass parent_class;
14462 // Unintrospectable functionp: get_mount_for_mount_path() / ()
14463 extern (C) Mount* function (char* mount_path, Cancellable* cancellable) get_mount_for_mount_path;
14467 // #GNetworkAddress provides an easy way to resolve a hostname and
14468 // then attempt to connect to that host, handling the possibility of
14469 // multiple IP addresses and multiple address families.
14471 // See #GSocketConnectable for and example of using the connectable
14472 // interface.
14473 struct NetworkAddress /* : GObject.Object */ {
14474 mixin SocketConnectable.__interface__;
14475 alias parent_instance this;
14476 alias parent_instance super_;
14477 alias parent_instance object;
14478 GObject2.Object parent_instance;
14479 private NetworkAddressPrivate* priv;
14482 // VERSION: 2.22
14483 // Creates a new #GSocketConnectable for connecting to the given
14484 // @hostname and @port.
14485 // RETURNS: the new #GNetworkAddress
14486 // <hostname>: the hostname
14487 // <port>: the port
14488 static SocketConnectable* /*new*/ new_()(char* hostname, ushort port) {
14489 return g_network_address_new(hostname, port);
14492 // VERSION: 2.22
14493 // Creates a new #GSocketConnectable for connecting to the given
14494 // @hostname and @port. May fail and return %NULL in case
14495 // parsing @host_and_port fails.
14497 // @host_and_port may be in any of a number of recognised formats; an IPv6
14498 // address, an IPv4 address, or a domain name (in which case a DNS
14499 // lookup is performed). Quoting with [] is supported for all address
14500 // types. A port override may be specified in the usual way with a
14501 // colon. Ports may be given as decimal numbers or symbolic names (in
14502 // which case an /etc/services lookup is performed).
14504 // If no port is specified in @host_and_port then @default_port will be
14505 // used as the port number to connect to.
14507 // In general, @host_and_port is expected to be provided by the user
14508 // (allowing them to give the hostname, and a port overide if necessary)
14509 // and @default_port is expected to be provided by the application.
14510 // RETURNS: the new #GNetworkAddress, or %NULL on error
14511 // <host_and_port>: the hostname and optionally a port
14512 // <default_port>: the default port if not in @host_and_port
14513 static SocketConnectable* /*new*/ parse()(char* host_and_port, ushort default_port, GLib2.Error** error=null) {
14514 return g_network_address_parse(host_and_port, default_port, error);
14517 // VERSION: 2.26
14518 // Creates a new #GSocketConnectable for connecting to the given
14519 // @uri. May fail and return %NULL in case parsing @uri fails.
14521 // Using this rather than g_network_address_new() or
14522 // g_network_address_parse_host() allows #GSocketClient to determine
14523 // when to use application-specific proxy protocols.
14524 // RETURNS: the new #GNetworkAddress, or %NULL on error
14525 // <uri>: the hostname and optionally a port
14526 // <default_port>: The default port if none is found in the URI
14527 static SocketConnectable* /*new*/ parse_uri()(char* uri, ushort default_port, GLib2.Error** error=null) {
14528 return g_network_address_parse_uri(uri, default_port, error);
14531 // VERSION: 2.22
14532 // Gets @addr's hostname. This might be either UTF-8 or ASCII-encoded,
14533 // depending on what @addr was created with.
14534 // RETURNS: @addr's hostname
14535 char* get_hostname()() {
14536 return g_network_address_get_hostname(&this);
14539 // VERSION: 2.22
14540 // Gets @addr's port number
14541 // RETURNS: @addr's port (which may be 0)
14542 ushort get_port()() {
14543 return g_network_address_get_port(&this);
14546 // VERSION: 2.26
14547 // Gets @addr's scheme
14548 // RETURNS: @addr's scheme (%NULL if not built from URI)
14549 char* get_scheme()() {
14550 return g_network_address_get_scheme(&this);
14554 struct NetworkAddressClass {
14555 GObject2.ObjectClass parent_class;
14558 struct NetworkAddressPrivate {
14562 // Like #GNetworkAddress does with hostnames, #GNetworkService
14563 // provides an easy way to resolve a SRV record, and then attempt to
14564 // connect to one of the hosts that implements that service, handling
14565 // service priority/weighting, multiple IP addresses, and multiple
14566 // address families.
14568 // See #GSrvTarget for more information about SRV records, and see
14569 // #GSocketConnectable for and example of using the connectable
14570 // interface.
14571 struct NetworkService /* : GObject.Object */ {
14572 mixin SocketConnectable.__interface__;
14573 alias parent_instance this;
14574 alias parent_instance super_;
14575 alias parent_instance object;
14576 GObject2.Object parent_instance;
14577 private NetworkServicePrivate* priv;
14580 // VERSION: 2.22
14581 // Creates a new #GNetworkService representing the given @service,
14582 // @protocol, and @domain. This will initially be unresolved; use the
14583 // #GSocketConnectable interface to resolve it.
14584 // RETURNS: a new #GNetworkService
14585 // <service>: the service type to look up (eg, "ldap")
14586 // <protocol>: the networking protocol to use for @service (eg, "tcp")
14587 // <domain>: the DNS domain to look up the service in
14588 static SocketConnectable* /*new*/ new_()(char* service, char* protocol, char* domain) {
14589 return g_network_service_new(service, protocol, domain);
14592 // VERSION: 2.22
14593 // Gets the domain that @srv serves. This might be either UTF-8 or
14594 // ASCII-encoded, depending on what @srv was created with.
14595 // RETURNS: @srv's domain name
14596 char* get_domain()() {
14597 return g_network_service_get_domain(&this);
14600 // VERSION: 2.22
14601 // Gets @srv's protocol name (eg, "tcp").
14602 // RETURNS: @srv's protocol name
14603 char* get_protocol()() {
14604 return g_network_service_get_protocol(&this);
14607 // VERSION: 2.26
14608 // Get's the URI scheme used to resolve proxies. By default, the service name
14609 // is used as scheme.
14610 // RETURNS: @srv's scheme name
14611 char* get_scheme()() {
14612 return g_network_service_get_scheme(&this);
14615 // VERSION: 2.22
14616 // Gets @srv's service name (eg, "ldap").
14617 // RETURNS: @srv's service name
14618 char* get_service()() {
14619 return g_network_service_get_service(&this);
14622 // VERSION: 2.26
14623 // Set's the URI scheme used to resolve proxies. By default, the service name
14624 // is used as scheme.
14625 // <scheme>: a URI scheme
14626 void set_scheme()(char* scheme) {
14627 g_network_service_set_scheme(&this, scheme);
14631 struct NetworkServiceClass {
14632 GObject2.ObjectClass parent_class;
14635 struct NetworkServicePrivate {
14639 // GOutputStream has functions to write to a stream (g_output_stream_write()),
14640 // to close a stream (g_output_stream_close()) and to flush pending writes
14641 // (g_output_stream_flush()).
14643 // To copy the content of an input stream to an output stream without
14644 // manually handling the reads and writes, use g_output_stream_splice().
14646 // All of these functions have async variants too.
14647 struct OutputStream /* : GObject.Object */ {
14648 alias parent_instance this;
14649 alias parent_instance super_;
14650 alias parent_instance object;
14651 GObject2.Object parent_instance;
14652 private OutputStreamPrivate* priv;
14654 // Clears the pending flag on @stream.
14655 void clear_pending()() {
14656 g_output_stream_clear_pending(&this);
14659 // Closes the stream, releasing resources related to it.
14661 // Once the stream is closed, all other operations will return %G_IO_ERROR_CLOSED.
14662 // Closing a stream multiple times will not return an error.
14664 // Closing a stream will automatically flush any outstanding buffers in the
14665 // stream.
14667 // Streams will be automatically closed when the last reference
14668 // is dropped, but you might want to call this function to make sure
14669 // resources are released as early as possible.
14671 // Some streams might keep the backing store of the stream (e.g. a file descriptor)
14672 // open after the stream is closed. See the documentation for the individual
14673 // stream for details.
14675 // On failure the first error that happened will be reported, but the close
14676 // operation will finish as much as possible. A stream that failed to
14677 // close will still return %G_IO_ERROR_CLOSED for all operations. Still, it
14678 // is important to check and report the error to the user, otherwise
14679 // there might be a loss of data as all data might not be written.
14681 // If @cancellable is not NULL, then the operation can be cancelled by
14682 // triggering the cancellable object from another thread. If the operation
14683 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
14684 // Cancelling a close will still leave the stream closed, but there some streams
14685 // can use a faster close that doesn't block to e.g. check errors. On
14686 // cancellation (as with any error) there is no guarantee that all written
14687 // data will reach the target.
14688 // RETURNS: %TRUE on success, %FALSE on failure
14689 // <cancellable>: optional cancellable object
14690 int close()(Cancellable* cancellable, GLib2.Error** error=null) {
14691 return g_output_stream_close(&this, cancellable, error);
14694 // Requests an asynchronous close of the stream, releasing resources
14695 // related to it. When the operation is finished @callback will be
14696 // called. You can then call g_output_stream_close_finish() to get
14697 // the result of the operation.
14699 // For behaviour details see g_output_stream_close().
14701 // The asyncronous methods have a default fallback that uses threads
14702 // to implement asynchronicity, so they are optional for inheriting
14703 // classes. However, if you override one you must override all.
14704 // <io_priority>: the io priority of the request.
14705 // <cancellable>: optional cancellable object
14706 // <callback>: callback to call when the request is satisfied
14707 // <user_data>: the data to pass to callback function
14708 void close_async()(int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
14709 g_output_stream_close_async(&this, io_priority, cancellable, callback, user_data);
14712 // Closes an output stream.
14713 // RETURNS: %TRUE if stream was successfully closed, %FALSE otherwise.
14714 // <result>: a #GAsyncResult.
14715 int close_finish()(AsyncResult* result, GLib2.Error** error=null) {
14716 return g_output_stream_close_finish(&this, result, error);
14719 // Flushed any outstanding buffers in the stream. Will block during
14720 // the operation. Closing the stream will implicitly cause a flush.
14722 // This function is optional for inherited classes.
14724 // If @cancellable is not %NULL, then the operation can be cancelled by
14725 // triggering the cancellable object from another thread. If the operation
14726 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
14727 // RETURNS: %TRUE on success, %FALSE on error
14728 // <cancellable>: optional cancellable object
14729 int flush()(Cancellable* cancellable, GLib2.Error** error=null) {
14730 return g_output_stream_flush(&this, cancellable, error);
14733 // Flushes a stream asynchronously.
14734 // For behaviour details see g_output_stream_flush().
14736 // When the operation is finished @callback will be
14737 // called. You can then call g_output_stream_flush_finish() to get the
14738 // result of the operation.
14739 // <io_priority>: the io priority of the request.
14740 // <cancellable>: optional #GCancellable object, %NULL to ignore.
14741 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
14742 // <user_data>: the data to pass to callback function
14743 void flush_async()(int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
14744 g_output_stream_flush_async(&this, io_priority, cancellable, callback, user_data);
14747 // Finishes flushing an output stream.
14748 // RETURNS: %TRUE if flush operation succeeded, %FALSE otherwise.
14749 // <result>: a GAsyncResult.
14750 int flush_finish()(AsyncResult* result, GLib2.Error** error=null) {
14751 return g_output_stream_flush_finish(&this, result, error);
14754 // Checks if an ouput stream has pending actions.
14755 // RETURNS: %TRUE if @stream has pending actions.
14756 int has_pending()() {
14757 return g_output_stream_has_pending(&this);
14760 // Checks if an output stream has already been closed.
14761 // RETURNS: %TRUE if @stream is closed. %FALSE otherwise.
14762 int is_closed()() {
14763 return g_output_stream_is_closed(&this);
14766 // VERSION: 2.24
14767 // Checks if an output stream is being closed. This can be
14768 // used inside e.g. a flush implementation to see if the
14769 // flush (or other i/o operation) is called from within
14770 // the closing operation.
14771 // RETURNS: %TRUE if @stream is being closed. %FALSE otherwise.
14772 int is_closing()() {
14773 return g_output_stream_is_closing(&this);
14776 // Sets @stream to have actions pending. If the pending flag is
14777 // already set or @stream is closed, it will return %FALSE and set
14778 // @error.
14779 // RETURNS: %TRUE if pending was previously unset and is now set.
14780 int set_pending()(GLib2.Error** error=null) {
14781 return g_output_stream_set_pending(&this, error);
14784 // Splices an input stream into an output stream.
14786 // -1 if an error occurred. Note that if the number of bytes
14787 // spliced is greater than %G_MAXSSIZE, then that will be
14788 // returned, and there is no way to determine the actual number
14789 // of bytes spliced.
14790 // RETURNS: a #gssize containing the size of the data spliced, or
14791 // <source>: a #GInputStream.
14792 // <flags>: a set of #GOutputStreamSpliceFlags.
14793 // <cancellable>: optional #GCancellable object, %NULL to ignore.
14794 ssize_t splice()(InputStream* source, OutputStreamSpliceFlags flags, Cancellable* cancellable, GLib2.Error** error=null) {
14795 return g_output_stream_splice(&this, source, flags, cancellable, error);
14798 // Splices a stream asynchronously.
14799 // When the operation is finished @callback will be called.
14800 // You can then call g_output_stream_splice_finish() to get the
14801 // result of the operation.
14803 // For the synchronous, blocking version of this function, see
14804 // g_output_stream_splice().
14805 // <source>: a #GInputStream.
14806 // <flags>: a set of #GOutputStreamSpliceFlags.
14807 // <io_priority>: the io priority of the request.
14808 // <cancellable>: optional #GCancellable object, %NULL to ignore.
14809 // <callback>: a #GAsyncReadyCallback.
14810 // <user_data>: user data passed to @callback.
14811 void splice_async()(InputStream* source, OutputStreamSpliceFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
14812 g_output_stream_splice_async(&this, source, flags, io_priority, cancellable, callback, user_data);
14815 // Finishes an asynchronous stream splice operation.
14817 // number of bytes spliced is greater than %G_MAXSSIZE, then that
14818 // will be returned, and there is no way to determine the actual
14819 // number of bytes spliced.
14820 // RETURNS: a #gssize of the number of bytes spliced. Note that if the
14821 // <result>: a #GAsyncResult.
14822 ssize_t splice_finish()(AsyncResult* result, GLib2.Error** error=null) {
14823 return g_output_stream_splice_finish(&this, result, error);
14826 // Tries to write @count bytes from @buffer into the stream. Will block
14827 // during the operation.
14829 // If count is 0, returns 0 and does nothing. A value of @count
14830 // larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error.
14832 // On success, the number of bytes written to the stream is returned.
14833 // It is not an error if this is not the same as the requested size, as it
14834 // can happen e.g. on a partial I/O error, or if there is not enough
14835 // storage in the stream. All writes block until at least one byte
14836 // is written or an error occurs; 0 is never returned (unless
14837 // @count is 0).
14839 // If @cancellable is not NULL, then the operation can be cancelled by
14840 // triggering the cancellable object from another thread. If the operation
14841 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
14842 // operation was partially finished when the operation was cancelled the
14843 // partial result will be returned, without an error.
14845 // On error -1 is returned and @error is set accordingly.
14846 // RETURNS: Number of bytes written, or -1 on error
14847 // <buffer>: the buffer containing the data to write.
14848 // <count>: the number of bytes to write
14849 // <cancellable>: optional cancellable object
14850 ssize_t write()(ubyte* buffer, size_t count, Cancellable* cancellable, GLib2.Error** error=null) {
14851 return g_output_stream_write(&this, buffer, count, cancellable, error);
14854 // Tries to write @count bytes from @buffer into the stream. Will block
14855 // during the operation.
14857 // This function is similar to g_output_stream_write(), except it tries to
14858 // write as many bytes as requested, only stopping on an error.
14860 // On a successful write of @count bytes, %TRUE is returned, and @bytes_written
14861 // is set to @count.
14863 // If there is an error during the operation FALSE is returned and @error
14864 // is set to indicate the error status, @bytes_written is updated to contain
14865 // the number of bytes written into the stream before the error occurred.
14866 // RETURNS: %TRUE on success, %FALSE if there was an error
14867 // <buffer>: the buffer containing the data to write.
14868 // <count>: the number of bytes to write
14869 // <bytes_written>: location to store the number of bytes that was written to the stream
14870 // <cancellable>: optional #GCancellable object, %NULL to ignore.
14871 int write_all()(ubyte* buffer, size_t count, /*out*/ size_t* bytes_written, Cancellable* cancellable, GLib2.Error** error=null) {
14872 return g_output_stream_write_all(&this, buffer, count, bytes_written, cancellable, error);
14875 // Request an asynchronous write of @count bytes from @buffer into
14876 // the stream. When the operation is finished @callback will be called.
14877 // You can then call g_output_stream_write_finish() to get the result of the
14878 // operation.
14880 // During an async request no other sync and async calls are allowed,
14881 // and will result in %G_IO_ERROR_PENDING errors.
14883 // A value of @count larger than %G_MAXSSIZE will cause a
14884 // %G_IO_ERROR_INVALID_ARGUMENT error.
14886 // On success, the number of bytes written will be passed to the
14887 // @callback. It is not an error if this is not the same as the
14888 // requested size, as it can happen e.g. on a partial I/O error,
14889 // but generally we try to write as many bytes as requested.
14891 // You are guaranteed that this method will never fail with
14892 // %G_IO_ERROR_WOULD_BLOCK - if @stream can't accept more data, the
14893 // method will just wait until this changes.
14895 // Any outstanding I/O request with higher priority (lower numerical
14896 // value) will be executed before an outstanding request with lower
14897 // priority. Default priority is %G_PRIORITY_DEFAULT.
14899 // The asyncronous methods have a default fallback that uses threads
14900 // to implement asynchronicity, so they are optional for inheriting
14901 // classes. However, if you override one you must override all.
14903 // For the synchronous, blocking version of this function, see
14904 // g_output_stream_write().
14905 // <buffer>: the buffer containing the data to write.
14906 // <count>: the number of bytes to write
14907 // <io_priority>: the io priority of the request.
14908 // <cancellable>: optional #GCancellable object, %NULL to ignore.
14909 // <callback>: callback to call when the request is satisfied
14910 // <user_data>: the data to pass to callback function
14911 void write_async()(ubyte* buffer, size_t count, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
14912 g_output_stream_write_async(&this, buffer, count, io_priority, cancellable, callback, user_data);
14915 // Finishes a stream write operation.
14916 // RETURNS: a #gssize containing the number of bytes written to the stream.
14917 // <result>: a #GAsyncResult.
14918 ssize_t write_finish()(AsyncResult* result, GLib2.Error** error=null) {
14919 return g_output_stream_write_finish(&this, result, error);
14923 struct OutputStreamClass {
14924 GObject2.ObjectClass parent_class;
14925 extern (C) ssize_t function (OutputStream* stream, void* buffer, size_t count, Cancellable* cancellable, GLib2.Error** error=null) write_fn;
14927 // RETURNS: a #gssize containing the size of the data spliced, or
14928 // <source>: a #GInputStream.
14929 // <flags>: a set of #GOutputStreamSpliceFlags.
14930 // <cancellable>: optional #GCancellable object, %NULL to ignore.
14931 extern (C) ssize_t function (OutputStream* stream, InputStream* source, OutputStreamSpliceFlags flags, Cancellable* cancellable, GLib2.Error** error=null) splice;
14933 // RETURNS: %TRUE on success, %FALSE on error
14934 // <cancellable>: optional cancellable object
14935 extern (C) int function (OutputStream* stream, Cancellable* cancellable, GLib2.Error** error=null) flush;
14936 extern (C) int function (OutputStream* stream, Cancellable* cancellable, GLib2.Error** error=null) close_fn;
14938 // <buffer>: the buffer containing the data to write.
14939 // <count>: the number of bytes to write
14940 // <io_priority>: the io priority of the request.
14941 // <cancellable>: optional #GCancellable object, %NULL to ignore.
14942 // <callback>: callback to call when the request is satisfied
14943 // <user_data>: the data to pass to callback function
14944 extern (C) void function (OutputStream* stream, ubyte* buffer, size_t count, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) write_async;
14946 // RETURNS: a #gssize containing the number of bytes written to the stream.
14947 // <result>: a #GAsyncResult.
14948 extern (C) ssize_t function (OutputStream* stream, AsyncResult* result, GLib2.Error** error=null) write_finish;
14950 // <source>: a #GInputStream.
14951 // <flags>: a set of #GOutputStreamSpliceFlags.
14952 // <io_priority>: the io priority of the request.
14953 // <cancellable>: optional #GCancellable object, %NULL to ignore.
14954 // <callback>: a #GAsyncReadyCallback.
14955 // <user_data>: user data passed to @callback.
14956 extern (C) void function (OutputStream* stream, InputStream* source, OutputStreamSpliceFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) splice_async;
14958 // RETURNS: a #gssize of the number of bytes spliced. Note that if the
14959 // <result>: a #GAsyncResult.
14960 extern (C) ssize_t function (OutputStream* stream, AsyncResult* result, GLib2.Error** error=null) splice_finish;
14962 // <io_priority>: the io priority of the request.
14963 // <cancellable>: optional #GCancellable object, %NULL to ignore.
14964 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
14965 // <user_data>: the data to pass to callback function
14966 extern (C) void function (OutputStream* stream, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) flush_async;
14968 // RETURNS: %TRUE if flush operation succeeded, %FALSE otherwise.
14969 // <result>: a GAsyncResult.
14970 extern (C) int function (OutputStream* stream, AsyncResult* result, GLib2.Error** error=null) flush_finish;
14972 // <io_priority>: the io priority of the request.
14973 // <cancellable>: optional cancellable object
14974 // <callback>: callback to call when the request is satisfied
14975 // <user_data>: the data to pass to callback function
14976 extern (C) void function (OutputStream* stream, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) close_async;
14978 // RETURNS: %TRUE if stream was successfully closed, %FALSE otherwise.
14979 // <result>: a #GAsyncResult.
14980 extern (C) int function (OutputStream* stream, AsyncResult* result, GLib2.Error** error=null) close_finish;
14981 extern (C) void function () _g_reserved1;
14982 extern (C) void function () _g_reserved2;
14983 extern (C) void function () _g_reserved3;
14984 extern (C) void function () _g_reserved4;
14985 extern (C) void function () _g_reserved5;
14986 extern (C) void function () _g_reserved6;
14987 extern (C) void function () _g_reserved7;
14988 extern (C) void function () _g_reserved8;
14991 struct OutputStreamPrivate {
14994 // GOutputStreamSpliceFlags determine how streams should be spliced.
14995 enum OutputStreamSpliceFlags {
14996 NONE = 0,
14997 CLOSE_SOURCE = 1,
14998 CLOSE_TARGET = 2
15001 // Structure used for scatter/gather data output.
15002 // You generally pass in an array of #GOutputVector<!-- -->s
15003 // and the operation will use all the buffers as if they were
15004 // one buffer.
15005 struct OutputVector /* Version 2.22 */ {
15006 const(void)* buffer;
15007 size_t size;
15010 enum PROXY_EXTENSION_POINT_NAME = "gio-proxy";
15011 enum PROXY_RESOLVER_EXTENSION_POINT_NAME = "gio-proxy-resolver";
15013 // #GPasswordSave is used to indicate the lifespan of a saved password.
15015 // #Gvfs stores passwords in the Gnome keyring when this flag allows it
15016 // to, and later retrieves it again from there.
15017 enum PasswordSave {
15018 NEVER = 0,
15019 FOR_SESSION = 1,
15020 PERMANENTLY = 2
15023 // A #GPermission represents the status of the caller's permission to
15024 // perform a certain action.
15026 // You can query if the action is currently allowed and if it is
15027 // possible to acquire the permission so that the action will be allowed
15028 // in the future.
15030 // There is also an API to actually acquire the permission and one to
15031 // release it.
15033 // As an example, a #GPermission might represent the ability for the
15034 // user to write to a #GSettings object. This #GPermission object could
15035 // then be used to decide if it is appropriate to show a "Click here to
15036 // unlock" button in a dialog and to provide the mechanism to invoke
15037 // when that button is clicked.
15038 struct Permission /* : GObject.Object */ {
15039 alias parent_instance this;
15040 alias parent_instance super_;
15041 alias parent_instance object;
15042 GObject2.Object parent_instance;
15043 private PermissionPrivate* priv;
15046 // VERSION: 2.26
15047 // Attempts to acquire the permission represented by @permission.
15049 // The precise method by which this happens depends on the permission
15050 // and the underlying authentication mechanism. A simple example is
15051 // that a dialog may appear asking the user to enter their password.
15053 // You should check with g_permission_get_can_acquire() before calling
15054 // this function.
15056 // If the permission is acquired then %TRUE is returned. Otherwise,
15057 // %FALSE is returned and @error is set appropriately.
15059 // This call is blocking, likely for a very long time (in the case that
15060 // user interaction is required). See g_permission_acquire_async() for
15061 // the non-blocking version.
15062 // RETURNS: %TRUE if the permission was successfully acquired
15063 // <cancellable>: a #GCancellable, or %NULL
15064 int acquire()(Cancellable* cancellable, GLib2.Error** error=null) {
15065 return g_permission_acquire(&this, cancellable, error);
15068 // VERSION: 2.26
15069 // Attempts to acquire the permission represented by @permission.
15071 // This is the first half of the asynchronous version of
15072 // g_permission_acquire().
15073 // <cancellable>: a #GCancellable, or %NULL
15074 // <callback>: the #GAsyncReadyCallback to call when done
15075 // <user_data>: the user data to pass to @callback
15076 void acquire_async()(Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
15077 g_permission_acquire_async(&this, cancellable, callback, user_data);
15080 // VERSION: 2.26
15081 // Collects the result of attempting to acquire the permission
15082 // represented by @permission.
15084 // This is the second half of the asynchronous version of
15085 // g_permission_acquire().
15086 // RETURNS: %TRUE if the permission was successfully acquired
15087 // <result>: the #GAsyncResult given to the #GAsyncReadyCallback
15088 int acquire_finish()(AsyncResult* result, GLib2.Error** error=null) {
15089 return g_permission_acquire_finish(&this, result, error);
15092 // VERSION: 2.26
15093 // Gets the value of the 'allowed' property. This property is %TRUE if
15094 // the caller currently has permission to perform the action that
15095 // @permission represents the permission to perform.
15096 // RETURNS: the value of the 'allowed' property
15097 int get_allowed()() {
15098 return g_permission_get_allowed(&this);
15101 // VERSION: 2.26
15102 // Gets the value of the 'can-acquire' property. This property is %TRUE
15103 // if it is generally possible to acquire the permission by calling
15104 // g_permission_acquire().
15105 // RETURNS: the value of the 'can-acquire' property
15106 int get_can_acquire()() {
15107 return g_permission_get_can_acquire(&this);
15110 // VERSION: 2.26
15111 // Gets the value of the 'can-release' property. This property is %TRUE
15112 // if it is generally possible to release the permission by calling
15113 // g_permission_release().
15114 // RETURNS: the value of the 'can-release' property
15115 int get_can_release()() {
15116 return g_permission_get_can_release(&this);
15119 // VERSION: 2.26
15120 // This function is called by the #GPermission implementation to update
15121 // the properties of the permission. You should never call this
15122 // function except from a #GPermission implementation.
15124 // GObject notify signals are generated, as appropriate.
15125 // <allowed>: the new value for the 'allowed' property
15126 // <can_acquire>: the new value for the 'can-acquire' property
15127 // <can_release>: the new value for the 'can-release' property
15128 void impl_update()(int allowed, int can_acquire, int can_release) {
15129 g_permission_impl_update(&this, allowed, can_acquire, can_release);
15132 // VERSION: 2.26
15133 // Attempts to release the permission represented by @permission.
15135 // The precise method by which this happens depends on the permission
15136 // and the underlying authentication mechanism. In most cases the
15137 // permission will be dropped immediately without further action.
15139 // You should check with g_permission_get_can_release() before calling
15140 // this function.
15142 // If the permission is released then %TRUE is returned. Otherwise,
15143 // %FALSE is returned and @error is set appropriately.
15145 // This call is blocking, likely for a very long time (in the case that
15146 // user interaction is required). See g_permission_release_async() for
15147 // the non-blocking version.
15148 // RETURNS: %TRUE if the permission was successfully released
15149 // <cancellable>: a #GCancellable, or %NULL
15150 int release()(Cancellable* cancellable, GLib2.Error** error=null) {
15151 return g_permission_release(&this, cancellable, error);
15154 // VERSION: 2.26
15155 // Attempts to release the permission represented by @permission.
15157 // This is the first half of the asynchronous version of
15158 // g_permission_release().
15159 // <cancellable>: a #GCancellable, or %NULL
15160 // <callback>: the #GAsyncReadyCallback to call when done
15161 // <user_data>: the user data to pass to @callback
15162 void release_async()(Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
15163 g_permission_release_async(&this, cancellable, callback, user_data);
15166 // VERSION: 2.26
15167 // Collects the result of attempting to release the permission
15168 // represented by @permission.
15170 // This is the second half of the asynchronous version of
15171 // g_permission_release().
15172 // RETURNS: %TRUE if the permission was successfully released
15173 // <result>: the #GAsyncResult given to the #GAsyncReadyCallback
15174 int release_finish()(AsyncResult* result, GLib2.Error** error=null) {
15175 return g_permission_release_finish(&this, result, error);
15179 struct PermissionClass {
15180 GObject2.ObjectClass parent_class;
15182 // RETURNS: %TRUE if the permission was successfully acquired
15183 // <cancellable>: a #GCancellable, or %NULL
15184 extern (C) int function (Permission* permission, Cancellable* cancellable, GLib2.Error** error=null) acquire;
15186 // <cancellable>: a #GCancellable, or %NULL
15187 // <callback>: the #GAsyncReadyCallback to call when done
15188 // <user_data>: the user data to pass to @callback
15189 extern (C) void function (Permission* permission, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) acquire_async;
15191 // RETURNS: %TRUE if the permission was successfully acquired
15192 // <result>: the #GAsyncResult given to the #GAsyncReadyCallback
15193 extern (C) int function (Permission* permission, AsyncResult* result, GLib2.Error** error=null) acquire_finish;
15195 // RETURNS: %TRUE if the permission was successfully released
15196 // <cancellable>: a #GCancellable, or %NULL
15197 extern (C) int function (Permission* permission, Cancellable* cancellable, GLib2.Error** error=null) release;
15199 // <cancellable>: a #GCancellable, or %NULL
15200 // <callback>: the #GAsyncReadyCallback to call when done
15201 // <user_data>: the user data to pass to @callback
15202 extern (C) void function (Permission* permission, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) release_async;
15204 // RETURNS: %TRUE if the permission was successfully released
15205 // <result>: the #GAsyncResult given to the #GAsyncReadyCallback
15206 extern (C) int function (Permission* permission, AsyncResult* result, GLib2.Error** error=null) release_finish;
15207 void*[16] reserved;
15210 struct PermissionPrivate {
15214 // #GPollableInputStream is implemented by #GInputStream<!-- -->s that
15215 // can be polled for readiness to read. This can be used when
15216 // interfacing with a non-GIO API that expects
15217 // UNIX-file-descriptor-style asynchronous I/O rather than GIO-style.
15218 struct PollableInputStream /* Interface */ /* Version 2.28 */ {
15219 mixin template __interface__() {
15220 // VERSION: 2.28
15221 // Checks if @stream is actually pollable. Some classes may implement
15222 // #GPollableInputStream but have only certain instances of that class
15223 // be pollable. If this method returns %FALSE, then the behavior of
15224 // other #GPollableInputStream methods is undefined.
15226 // For any given stream, the value returned by this method is constant;
15227 // a stream cannot switch from pollable to non-pollable or vice versa.
15228 // RETURNS: %TRUE if @stream is pollable, %FALSE if not.
15229 int can_poll()() {
15230 return g_pollable_input_stream_can_poll(cast(PollableInputStream*)&this);
15233 // Unintrospectable method: create_source() / g_pollable_input_stream_create_source()
15234 // VERSION: 2.28
15235 // Creates a #GSource that triggers when @stream can be read, or
15236 // @cancellable is triggered or an error occurs. The callback on the
15237 // source is of the #GPollableSourceFunc type.
15239 // As with g_pollable_input_stream_is_readable(), it is possible that
15240 // the stream may not actually be readable even after the source
15241 // triggers, so you should use g_pollable_input_stream_read_nonblocking()
15242 // rather than g_input_stream_read() from the callback.
15243 // RETURNS: a new #GSource
15244 // <cancellable>: a #GCancellable, or %NULL
15245 GLib2.Source* /*new*/ create_source()(Cancellable* cancellable=null) {
15246 return g_pollable_input_stream_create_source(cast(PollableInputStream*)&this, cancellable);
15249 // VERSION: 2.28
15250 // Checks if @stream can be read.
15252 // Note that some stream types may not be able to implement this 100%
15253 // reliably, and it is possible that a call to g_input_stream_read()
15254 // after this returns %TRUE would still block. To guarantee
15255 // non-blocking behavior, you should always use
15256 // g_pollable_input_stream_read_nonblocking(), which will return a
15257 // %G_IO_ERROR_WOULD_BLOCK error rather than blocking.
15259 // has occurred on @stream, this will result in
15260 // g_pollable_input_stream_is_readable() returning %TRUE, and the
15261 // next attempt to read will return the error.
15262 // RETURNS: %TRUE if @stream is readable, %FALSE if not. If an error
15263 int is_readable()() {
15264 return g_pollable_input_stream_is_readable(cast(PollableInputStream*)&this);
15267 // Attempts to read up to @size bytes from @stream into @buffer, as
15268 // with g_input_stream_read(). If @stream is not currently readable,
15269 // this will immediately return %G_IO_ERROR_WOULD_BLOCK, and you can
15270 // use g_pollable_input_stream_create_source() to create a #GSource
15271 // that will be triggered when @stream is readable.
15273 // Note that since this method never blocks, you cannot actually
15274 // use @cancellable to cancel it. However, it will return an error
15275 // if @cancellable has already been cancelled when you call, which
15276 // may happen if you call this method after a source triggers due
15277 // to having been cancelled.
15279 // %G_IO_ERROR_WOULD_BLOCK).
15280 // RETURNS: the number of bytes read, or -1 on error (including
15281 // <buffer>: a buffer to read data into (which should be at least @size bytes long).
15282 // <size>: the number of bytes you want to read
15283 // <cancellable>: a #GCancellable, or %NULL
15284 ssize_t read_nonblocking()(void* buffer, size_t size, Cancellable* cancellable, GLib2.Error** error=null) {
15285 return g_pollable_input_stream_read_nonblocking(cast(PollableInputStream*)&this, buffer, size, cancellable, error);
15288 mixin __interface__;
15292 // The interface for pollable input streams.
15294 // The default implementation of @can_poll always returns %TRUE.
15296 // The default implementation of @read_nonblocking calls
15297 // g_pollable_input_stream_is_readable(), and then calls
15298 // g_input_stream_read() if it returns %TRUE. This means you only need
15299 // to override it if it is possible that your @is_readable
15300 // implementation may return %TRUE when the stream is not actually
15301 // readable.
15302 struct PollableInputStreamInterface /* Version 2.28 */ {
15303 GObject2.TypeInterface g_iface;
15304 // RETURNS: %TRUE if @stream is pollable, %FALSE if not.
15305 extern (C) int function (PollableInputStream* stream) can_poll;
15306 // RETURNS: %TRUE if @stream is readable, %FALSE if not. If an error
15307 extern (C) int function (PollableInputStream* stream) is_readable;
15309 // RETURNS: a new #GSource
15310 // <cancellable>: a #GCancellable, or %NULL
15311 extern (C) GLib2.Source* /*new*/ function (PollableInputStream* stream, Cancellable* cancellable=null) create_source;
15313 // RETURNS: the number of bytes read, or -1 on error (including
15314 // <buffer>: a buffer to read data into (which should be at least @size bytes long).
15315 // <size>: the number of bytes you want to read
15316 extern (C) ssize_t function (PollableInputStream* stream, void* buffer, size_t size, GLib2.Error** error=null) read_nonblocking;
15320 // #GPollableOutputStream is implemented by #GOutputStream<!-- -->s that
15321 // can be polled for readiness to write. This can be used when
15322 // interfacing with a non-GIO API that expects
15323 // UNIX-file-descriptor-style asynchronous I/O rather than GIO-style.
15324 struct PollableOutputStream /* Interface */ /* Version 2.28 */ {
15325 mixin template __interface__() {
15326 // VERSION: 2.28
15327 // Checks if @stream is actually pollable. Some classes may implement
15328 // #GPollableOutputStream but have only certain instances of that
15329 // class be pollable. If this method returns %FALSE, then the behavior
15330 // of other #GPollableOutputStream methods is undefined.
15332 // For any given stream, the value returned by this method is constant;
15333 // a stream cannot switch from pollable to non-pollable or vice versa.
15334 // RETURNS: %TRUE if @stream is pollable, %FALSE if not.
15335 int can_poll()() {
15336 return g_pollable_output_stream_can_poll(cast(PollableOutputStream*)&this);
15339 // Unintrospectable method: create_source() / g_pollable_output_stream_create_source()
15340 // VERSION: 2.28
15341 // Creates a #GSource that triggers when @stream can be written, or
15342 // @cancellable is triggered or an error occurs. The callback on the
15343 // source is of the #GPollableSourceFunc type.
15345 // As with g_pollable_output_stream_is_writable(), it is possible that
15346 // the stream may not actually be writable even after the source
15347 // triggers, so you should use g_pollable_output_stream_write_nonblocking()
15348 // rather than g_output_stream_write() from the callback.
15349 // RETURNS: a new #GSource
15350 // <cancellable>: a #GCancellable, or %NULL
15351 GLib2.Source* /*new*/ create_source()(Cancellable* cancellable=null) {
15352 return g_pollable_output_stream_create_source(cast(PollableOutputStream*)&this, cancellable);
15355 // VERSION: 2.28
15356 // Checks if @stream can be written.
15358 // Note that some stream types may not be able to implement this 100%
15359 // reliably, and it is possible that a call to g_output_stream_write()
15360 // after this returns %TRUE would still block. To guarantee
15361 // non-blocking behavior, you should always use
15362 // g_pollable_output_stream_write_nonblocking(), which will return a
15363 // %G_IO_ERROR_WOULD_BLOCK error rather than blocking.
15365 // has occurred on @stream, this will result in
15366 // g_pollable_output_stream_is_writable() returning %TRUE, and the
15367 // next attempt to write will return the error.
15368 // RETURNS: %TRUE if @stream is writable, %FALSE if not. If an error
15369 int is_writable()() {
15370 return g_pollable_output_stream_is_writable(cast(PollableOutputStream*)&this);
15373 // Attempts to write up to @size bytes from @buffer to @stream, as
15374 // with g_output_stream_write(). If @stream is not currently writable,
15375 // this will immediately return %G_IO_ERROR_WOULD_BLOCK, and you can
15376 // use g_pollable_output_stream_create_source() to create a #GSource
15377 // that will be triggered when @stream is writable.
15379 // Note that since this method never blocks, you cannot actually
15380 // use @cancellable to cancel it. However, it will return an error
15381 // if @cancellable has already been cancelled when you call, which
15382 // may happen if you call this method after a source triggers due
15383 // to having been cancelled.
15385 // %G_IO_ERROR_WOULD_BLOCK).
15386 // RETURNS: the number of bytes written, or -1 on error (including
15387 // <buffer>: a buffer to write data from
15388 // <size>: the number of bytes you want to write
15389 // <cancellable>: a #GCancellable, or %NULL
15390 ssize_t write_nonblocking()(ubyte* buffer, size_t size, Cancellable* cancellable, GLib2.Error** error=null) {
15391 return g_pollable_output_stream_write_nonblocking(cast(PollableOutputStream*)&this, buffer, size, cancellable, error);
15394 mixin __interface__;
15398 // The interface for pollable output streams.
15400 // The default implementation of @can_poll always returns %TRUE.
15402 // The default implementation of @write_nonblocking calls
15403 // g_pollable_output_stream_is_writable(), and then calls
15404 // g_output_stream_write() if it returns %TRUE. This means you only
15405 // need to override it if it is possible that your @is_writable
15406 // implementation may return %TRUE when the stream is not actually
15407 // writable.
15408 struct PollableOutputStreamInterface /* Version 2.28 */ {
15409 GObject2.TypeInterface g_iface;
15410 // RETURNS: %TRUE if @stream is pollable, %FALSE if not.
15411 extern (C) int function (PollableOutputStream* stream) can_poll;
15412 // RETURNS: %TRUE if @stream is writable, %FALSE if not. If an error
15413 extern (C) int function (PollableOutputStream* stream) is_writable;
15415 // RETURNS: a new #GSource
15416 // <cancellable>: a #GCancellable, or %NULL
15417 extern (C) GLib2.Source* /*new*/ function (PollableOutputStream* stream, Cancellable* cancellable=null) create_source;
15419 // RETURNS: the number of bytes written, or -1 on error (including
15420 // <buffer>: a buffer to write data from
15421 // <size>: the number of bytes you want to write
15422 extern (C) ssize_t function (PollableOutputStream* stream, ubyte* buffer, size_t size, GLib2.Error** error=null) write_nonblocking;
15426 // VERSION: 2.28
15427 // This is the function type of the callback used for the #GSource
15428 // returned by g_pollable_input_stream_create_source() and
15429 // g_pollable_output_stream_create_source().
15430 // RETURNS: it should return %FALSE if the source should be removed.
15431 // <pollable_stream>: the #GPollableInputStream or #GPollableOutputStream
15432 // <user_data>: data passed in by the user.
15433 extern (C) alias int function (GObject2.Object* pollable_stream, void* user_data) PollableSourceFunc;
15436 // A #GProxy handles connecting to a remote host via a given type of
15437 // proxy server. It is implemented by the 'gio-proxy' extension point.
15438 // The extensions are named after their proxy protocol name. As an
15439 // example, a SOCKS5 proxy implementation can be retrieved with the
15440 // name 'socks5' using the function
15441 // g_io_extension_point_get_extension_by_name().
15442 struct Proxy /* Interface */ /* Version 2.26 */ {
15443 mixin template __interface__() {
15444 // VERSION: 2.26
15445 // Lookup "gio-proxy" extension point for a proxy implementation that supports
15446 // specified protocol.
15448 // is not supported.
15449 // RETURNS: return a #GProxy or NULL if protocol
15450 // <protocol>: the proxy protocol name (e.g. http, socks, etc)
15451 static Proxy* /*new*/ get_default_for_protocol()(char* protocol) {
15452 return g_proxy_get_default_for_protocol(protocol);
15455 // VERSION: 2.26
15456 // Given @connection to communicate with a proxy (eg, a
15457 // #GSocketConnection that is connected to the proxy server), this
15458 // does the necessary handshake to connect to @proxy_address, and if
15459 // required, wraps the #GIOStream to handle proxy payload.
15461 // be the same as @connection, in which case a reference
15462 // will be added.
15463 // RETURNS: a #GIOStream that will replace @connection. This might
15464 // <connection>: a #GIOStream
15465 // <proxy_address>: a #GProxyAddress
15466 // <cancellable>: a #GCancellable
15467 IOStream* /*new*/ connect()(IOStream* connection, ProxyAddress* proxy_address, Cancellable* cancellable, GLib2.Error** error=null) {
15468 return g_proxy_connect(cast(Proxy*)&this, connection, proxy_address, cancellable, error);
15471 // VERSION: 2.26
15472 // Asynchronous version of g_proxy_connect().
15473 // <connection>: a #GIOStream
15474 // <proxy_address>: a #GProxyAddress
15475 // <cancellable>: a #GCancellable
15476 // <callback>: a #GAsyncReadyCallback
15477 // <user_data>: callback data
15478 void connect_async()(IOStream* connection, ProxyAddress* proxy_address, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
15479 g_proxy_connect_async(cast(Proxy*)&this, connection, proxy_address, cancellable, callback, user_data);
15482 // VERSION: 2.26
15483 // See g_proxy_connect().
15484 // RETURNS: a #GIOStream.
15485 // <result>: a #GAsyncResult
15486 IOStream* /*new*/ connect_finish()(AsyncResult* result, GLib2.Error** error=null) {
15487 return g_proxy_connect_finish(cast(Proxy*)&this, result, error);
15490 // VERSION: 2.26
15491 // Some proxy protocols expect to be passed a hostname, which they
15492 // will resolve to an IP address themselves. Others, like SOCKS4, do
15493 // not allow this. This function will return %FALSE if @proxy is
15494 // implementing such a protocol. When %FALSE is returned, the caller
15495 // should resolve the destination hostname first, and then pass a
15496 // #GProxyAddress containing the stringified IP address to
15497 // g_proxy_connect() or g_proxy_connect_async().
15498 // RETURNS: %TRUE if hostname resolution is supported.
15499 int supports_hostname()() {
15500 return g_proxy_supports_hostname(cast(Proxy*)&this);
15503 mixin __interface__;
15506 // Support for proxied #GInetSocketAddress.
15507 struct ProxyAddress /* : InetSocketAddress */ /* Version 2.26 */ {
15508 mixin SocketConnectable.__interface__;
15509 alias parent_instance this;
15510 alias parent_instance super_;
15511 alias parent_instance inetsocketaddress;
15512 InetSocketAddress parent_instance;
15513 private ProxyAddressPrivate* priv;
15516 // VERSION: 2.26
15517 // Creates a new #GProxyAddress for @inetaddr with @protocol that should
15518 // tunnel through @dest_hostname and @dest_port.
15519 // RETURNS: a new #GProxyAddress
15520 // <inetaddr>: The proxy server #GInetAddress.
15521 // <port>: The proxy server port.
15522 // <protocol>: The proxy protocol to support, in lower case (e.g. socks, http).
15523 // <dest_hostname>: The destination hostname the the proxy should tunnel to.
15524 // <dest_port>: The destination port to tunnel to.
15525 // <username>: The username to authenticate to the proxy server (or %NULL).
15526 // <password>: The password to authenticate to the proxy server (or %NULL).
15527 static ProxyAddress* /*new*/ new_()(InetAddress* inetaddr, ushort port, char* protocol, char* dest_hostname, ushort dest_port, char* username=null, char* password=null) {
15528 return g_proxy_address_new(inetaddr, port, protocol, dest_hostname, dest_port, username, password);
15531 // VERSION: 2.26
15532 // Gets @proxy's destination hostname.
15533 // RETURNS: the @proxy's destination hostname
15534 char* get_destination_hostname()() {
15535 return g_proxy_address_get_destination_hostname(&this);
15538 // VERSION: 2.26
15539 // Gets @proxy's destination port.
15540 // RETURNS: the @proxy's destination port
15541 ushort get_destination_port()() {
15542 return g_proxy_address_get_destination_port(&this);
15545 // VERSION: 2.26
15546 // Gets @proxy's password.
15547 // RETURNS: the @proxy's password
15548 char* get_password()() {
15549 return g_proxy_address_get_password(&this);
15552 // VERSION: 2.26
15553 // Gets @proxy's protocol.
15554 // RETURNS: the @proxy's protocol
15555 char* get_protocol()() {
15556 return g_proxy_address_get_protocol(&this);
15559 // VERSION: 2.26
15560 // Gets @proxy's username.
15561 // RETURNS: the @proxy's username
15562 char* get_username()() {
15563 return g_proxy_address_get_username(&this);
15567 struct ProxyAddressClass {
15568 InetSocketAddressClass parent_class;
15572 // A subclass of #GSocketAddressEnumerator that takes another address
15573 // enumerator and wraps its results in #GProxyAddress<!-- -->es as
15574 // directed by the default #GProxyResolver.
15575 struct ProxyAddressEnumerator /* : SocketAddressEnumerator */ {
15576 alias parent_instance this;
15577 alias parent_instance super_;
15578 alias parent_instance socketaddressenumerator;
15579 SocketAddressEnumerator parent_instance;
15580 ProxyAddressEnumeratorPrivate* priv;
15583 struct ProxyAddressEnumeratorClass {
15584 SocketAddressEnumeratorClass parent_class;
15585 extern (C) void function () _g_reserved1;
15586 extern (C) void function () _g_reserved2;
15587 extern (C) void function () _g_reserved3;
15588 extern (C) void function () _g_reserved4;
15589 extern (C) void function () _g_reserved5;
15590 extern (C) void function () _g_reserved6;
15591 extern (C) void function () _g_reserved7;
15594 struct ProxyAddressEnumeratorPrivate {
15597 struct ProxyAddressPrivate {
15600 // Provides an interface for handling proxy connection and payload.
15601 struct ProxyInterface /* Version 2.26 */ {
15602 GObject2.TypeInterface g_iface;
15604 // RETURNS: a #GIOStream that will replace @connection. This might
15605 // <connection>: a #GIOStream
15606 // <proxy_address>: a #GProxyAddress
15607 // <cancellable>: a #GCancellable
15608 extern (C) IOStream* /*new*/ function (Proxy* proxy, IOStream* connection, ProxyAddress* proxy_address, Cancellable* cancellable, GLib2.Error** error=null) connect;
15610 // <connection>: a #GIOStream
15611 // <proxy_address>: a #GProxyAddress
15612 // <cancellable>: a #GCancellable
15613 // <callback>: a #GAsyncReadyCallback
15614 // <user_data>: callback data
15615 extern (C) void function (Proxy* proxy, IOStream* connection, ProxyAddress* proxy_address, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) connect_async;
15617 // RETURNS: a #GIOStream.
15618 // <result>: a #GAsyncResult
15619 extern (C) IOStream* /*new*/ function (Proxy* proxy, AsyncResult* result, GLib2.Error** error=null) connect_finish;
15620 // RETURNS: %TRUE if hostname resolution is supported.
15621 extern (C) int function (Proxy* proxy) supports_hostname;
15625 // #GProxyResolver provides synchronous and asynchronous network proxy
15626 // resolution. #GProxyResolver is used within #GSocketClient through
15627 // the method g_socket_connectable_proxy_enumerate().
15628 struct ProxyResolver /* Interface */ {
15629 mixin template __interface__() {
15630 // VERSION: 2.26
15631 // Gets the default #GProxyResolver for the system.
15632 // RETURNS: the default #GProxyResolver.
15633 static ProxyResolver* get_default()() {
15634 return g_proxy_resolver_get_default();
15637 // VERSION: 2.26
15638 // Checks if @resolver can be used on this system. (This is used
15639 // internally; g_proxy_resolver_get_default() will only return a proxy
15640 // resolver that returns %TRUE for this method.)
15641 // RETURNS: %TRUE if @resolver is supported.
15642 int is_supported()() {
15643 return g_proxy_resolver_is_supported(cast(ProxyResolver*)&this);
15646 // VERSION: 2.26
15647 // Looks into the system proxy configuration to determine what proxy,
15648 // if any, to use to connect to @uri. The returned proxy URIs are of the
15649 // form <literal>&lt;protocol&gt;://[user[:password]@]host:port</literal>
15650 // or <literal>direct://</literal>, where &lt;protocol&gt; could be
15651 // http, rtsp, socks or other proxying protocol.
15653 // If you don't know what network protocol is being used on the
15654 // socket, you should use <literal>none</literal> as the URI protocol.
15655 // In this case, the resolver might still return a generic proxy type
15656 // (such as SOCKS), but would not return protocol-specific proxy types
15657 // (such as http).
15659 // <literal>direct://</literal> is used when no proxy is needed.
15660 // Direct connection should not be attempted unless it is part of the
15661 // returned array of proxies.
15663 // NULL-terminated array of proxy URIs. Must be freed
15664 // with g_strfreev().
15665 // RETURNS: A
15666 // <uri>: a URI representing the destination to connect to
15667 // <cancellable>: a #GCancellable, or %NULL
15668 char** /*new*/ lookup()(char* uri, Cancellable* cancellable, GLib2.Error** error=null) {
15669 return g_proxy_resolver_lookup(cast(ProxyResolver*)&this, uri, cancellable, error);
15672 // VERSION: 2.26
15673 // Asynchronous lookup of proxy. See g_proxy_resolver_lookup() for more
15674 // details.
15675 // <uri>: a URI representing the destination to connect to
15676 // <cancellable>: a #GCancellable, or %NULL
15677 // <callback>: callback to call after resolution completes
15678 // <user_data>: data for @callback
15679 void lookup_async()(char* uri, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
15680 g_proxy_resolver_lookup_async(cast(ProxyResolver*)&this, uri, cancellable, callback, user_data);
15683 // VERSION: 2.26
15684 // Call this function to obtain the array of proxy URIs when
15685 // g_proxy_resolver_lookup_async() is complete. See
15686 // g_proxy_resolver_lookup() for more details.
15688 // NULL-terminated array of proxy URIs. Must be freed
15689 // with g_strfreev().
15690 // RETURNS: A
15691 // <result>: the result passed to your #GAsyncReadyCallback
15692 char** /*new*/ lookup_finish()(AsyncResult* result, GLib2.Error** error=null) {
15693 return g_proxy_resolver_lookup_finish(cast(ProxyResolver*)&this, result, error);
15696 mixin __interface__;
15699 struct ProxyResolverInterface {
15700 GObject2.TypeInterface g_iface;
15701 // RETURNS: %TRUE if @resolver is supported.
15702 extern (C) int function (ProxyResolver* resolver) is_supported;
15704 // RETURNS: A
15705 // <uri>: a URI representing the destination to connect to
15706 // <cancellable>: a #GCancellable, or %NULL
15707 extern (C) char** /*new*/ function (ProxyResolver* resolver, char* uri, Cancellable* cancellable, GLib2.Error** error=null) lookup;
15709 // <uri>: a URI representing the destination to connect to
15710 // <cancellable>: a #GCancellable, or %NULL
15711 // <callback>: callback to call after resolution completes
15712 // <user_data>: data for @callback
15713 extern (C) void function (ProxyResolver* resolver, char* uri, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) lookup_async;
15715 // RETURNS: A
15716 // <result>: the result passed to your #GAsyncReadyCallback
15717 extern (C) char** /*new*/ function (ProxyResolver* resolver, AsyncResult* result, GLib2.Error** error=null) lookup_finish;
15721 // Unintrospectable callback: ReallocFunc() / ()
15722 // Changes the size of the memory block pointed to by @data to
15723 // @size bytes.
15725 // The function should have the same semantics as realloc().
15726 // RETURNS: a pointer to the reallocated memory
15727 // <data>: memory block to reallocate
15728 // <size>: size to reallocate @data to
15729 extern (C) alias void* function (void* data, size_t size) ReallocFunc;
15732 // #GResolver provides cancellable synchronous and asynchronous DNS
15733 // resolution, for hostnames (g_resolver_lookup_by_address(),
15734 // g_resolver_lookup_by_name() and their async variants) and SRV
15735 // (service) records (g_resolver_lookup_service()).
15737 // #GNetworkAddress and #GNetworkService provide wrappers around
15738 // #GResolver functionality that also implement #GSocketConnectable,
15739 // making it easy to connect to a remote host/service.
15740 struct Resolver /* : GObject.Object */ {
15741 alias parent_instance this;
15742 alias parent_instance super_;
15743 alias parent_instance object;
15744 GObject2.Object parent_instance;
15745 ResolverPrivate* priv;
15748 // Unintrospectable function: free_addresses() / g_resolver_free_addresses()
15749 // VERSION: 2.22
15750 // Frees @addresses (which should be the return value from
15751 // g_resolver_lookup_by_name() or g_resolver_lookup_by_name_finish()).
15752 // (This is a convenience method; you can also simply free the results
15753 // by hand.)
15754 // <addresses>: a #GList of #GInetAddress
15755 static void free_addresses()(GLib2.List* addresses) {
15756 g_resolver_free_addresses(addresses);
15759 // Unintrospectable function: free_targets() / g_resolver_free_targets()
15760 // VERSION: 2.22
15761 // Frees @targets (which should be the return value from
15762 // g_resolver_lookup_service() or g_resolver_lookup_service_finish()).
15763 // (This is a convenience method; you can also simply free the
15764 // results by hand.)
15765 // <targets>: a #GList of #GSrvTarget
15766 static void free_targets()(GLib2.List* targets) {
15767 g_resolver_free_targets(targets);
15770 // VERSION: 2.22
15771 // Gets the default #GResolver. You should unref it when you are done
15772 // with it. #GResolver may use its reference count as a hint about how
15773 // many threads/processes, etc it should allocate for concurrent DNS
15774 // resolutions.
15775 // RETURNS: the default #GResolver.
15776 static Resolver* /*new*/ get_default()() {
15777 return g_resolver_get_default();
15780 // VERSION: 2.22
15781 // Synchronously reverse-resolves @address to determine its
15782 // associated hostname.
15784 // If the DNS resolution fails, @error (if non-%NULL) will be set to
15785 // a value from #GResolverError.
15787 // If @cancellable is non-%NULL, it can be used to cancel the
15788 // operation, in which case @error (if non-%NULL) will be set to
15789 // %G_IO_ERROR_CANCELLED.
15791 // form), or %NULL on error.
15792 // RETURNS: a hostname (either ASCII-only, or in ASCII-encoded
15793 // <address>: the address to reverse-resolve
15794 // <cancellable>: a #GCancellable, or %NULL
15795 char* /*new*/ lookup_by_address()(InetAddress* address, Cancellable* cancellable, GLib2.Error** error=null) {
15796 return g_resolver_lookup_by_address(&this, address, cancellable, error);
15799 // VERSION: 2.22
15800 // Begins asynchronously reverse-resolving @address to determine its
15801 // associated hostname, and eventually calls @callback, which must
15802 // call g_resolver_lookup_by_address_finish() to get the final result.
15803 // <address>: the address to reverse-resolve
15804 // <cancellable>: a #GCancellable, or %NULL
15805 // <callback>: callback to call after resolution completes
15806 // <user_data>: data for @callback
15807 void lookup_by_address_async()(InetAddress* address, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
15808 g_resolver_lookup_by_address_async(&this, address, cancellable, callback, user_data);
15811 // VERSION: 2.22
15812 // Retrieves the result of a previous call to
15813 // g_resolver_lookup_by_address_async().
15815 // If the DNS resolution failed, @error (if non-%NULL) will be set to
15816 // a value from #GResolverError. If the operation was cancelled,
15817 // @error will be set to %G_IO_ERROR_CANCELLED.
15819 // form), or %NULL on error.
15820 // RETURNS: a hostname (either ASCII-only, or in ASCII-encoded
15821 // <result>: the result passed to your #GAsyncReadyCallback
15822 char* /*new*/ lookup_by_address_finish()(AsyncResult* result, GLib2.Error** error=null) {
15823 return g_resolver_lookup_by_address_finish(&this, result, error);
15826 // VERSION: 2.22
15827 // Synchronously resolves @hostname to determine its associated IP
15828 // address(es). @hostname may be an ASCII-only or UTF-8 hostname, or
15829 // the textual form of an IP address (in which case this just becomes
15830 // a wrapper around g_inet_address_new_from_string()).
15832 // On success, g_resolver_lookup_by_name() will return a #GList of
15833 // #GInetAddress, sorted in order of preference and guaranteed to not
15834 // contain duplicates. That is, if using the result to connect to
15835 // @hostname, you should attempt to connect to the first address
15836 // first, then the second if the first fails, etc. If you are using
15837 // the result to listen on a socket, it is appropriate to add each
15838 // result using e.g. g_socket_listener_add_address().
15840 // If the DNS resolution fails, @error (if non-%NULL) will be set to a
15841 // value from #GResolverError.
15843 // If @cancellable is non-%NULL, it can be used to cancel the
15844 // operation, in which case @error (if non-%NULL) will be set to
15845 // %G_IO_ERROR_CANCELLED.
15847 // If you are planning to connect to a socket on the resolved IP
15848 // address, it may be easier to create a #GNetworkAddress and use its
15849 // #GSocketConnectable interface.
15851 // of #GInetAddress, or %NULL on error. You
15852 // must unref each of the addresses and free the list when you are
15853 // done with it. (You can use g_resolver_free_addresses() to do this.)
15854 // RETURNS: a #GList
15855 // <hostname>: the hostname to look up
15856 // <cancellable>: a #GCancellable, or %NULL
15857 GLib2.List* /*new*/ lookup_by_name()(char* hostname, Cancellable* cancellable, GLib2.Error** error=null) {
15858 return g_resolver_lookup_by_name(&this, hostname, cancellable, error);
15861 // VERSION: 2.22
15862 // Begins asynchronously resolving @hostname to determine its
15863 // associated IP address(es), and eventually calls @callback, which
15864 // must call g_resolver_lookup_by_name_finish() to get the result.
15865 // See g_resolver_lookup_by_name() for more details.
15866 // <hostname>: the hostname to look up the address of
15867 // <cancellable>: a #GCancellable, or %NULL
15868 // <callback>: callback to call after resolution completes
15869 // <user_data>: data for @callback
15870 void lookup_by_name_async()(char* hostname, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
15871 g_resolver_lookup_by_name_async(&this, hostname, cancellable, callback, user_data);
15874 // VERSION: 2.22
15875 // Retrieves the result of a call to
15876 // g_resolver_lookup_by_name_async().
15878 // If the DNS resolution failed, @error (if non-%NULL) will be set to
15879 // a value from #GResolverError. If the operation was cancelled,
15880 // @error will be set to %G_IO_ERROR_CANCELLED.
15882 // of #GInetAddress, or %NULL on error. See g_resolver_lookup_by_name()
15883 // for more details.
15884 // RETURNS: a #GList
15885 // <result>: the result passed to your #GAsyncReadyCallback
15886 GLib2.List* /*new*/ lookup_by_name_finish()(AsyncResult* result, GLib2.Error** error=null) {
15887 return g_resolver_lookup_by_name_finish(&this, result, error);
15890 // VERSION: 2.22
15891 // Synchronously performs a DNS SRV lookup for the given @service and
15892 // @protocol in the given @domain and returns an array of #GSrvTarget.
15893 // @domain may be an ASCII-only or UTF-8 hostname. Note also that the
15894 // @service and @protocol arguments <emphasis>do not</emphasis>
15895 // include the leading underscore that appears in the actual DNS
15896 // entry.
15898 // On success, g_resolver_lookup_service() will return a #GList of
15899 // #GSrvTarget, sorted in order of preference. (That is, you should
15900 // attempt to connect to the first target first, then the second if
15901 // the first fails, etc.)
15903 // If the DNS resolution fails, @error (if non-%NULL) will be set to
15904 // a value from #GResolverError.
15906 // If @cancellable is non-%NULL, it can be used to cancel the
15907 // operation, in which case @error (if non-%NULL) will be set to
15908 // %G_IO_ERROR_CANCELLED.
15910 // If you are planning to connect to the service, it is usually easier
15911 // to create a #GNetworkService and use its #GSocketConnectable
15912 // interface.
15914 // or %NULL on error. You must free each of the targets and the list when you are
15915 // done with it. (You can use g_resolver_free_targets() to do this.)
15916 // RETURNS: a #GList of #GSrvTarget,
15917 // <service>: the service type to look up (eg, "ldap")
15918 // <protocol>: the networking protocol to use for @service (eg, "tcp")
15919 // <domain>: the DNS domain to look up the service in
15920 // <cancellable>: a #GCancellable, or %NULL
15921 GLib2.List* /*new*/ lookup_service()(char* service, char* protocol, char* domain, Cancellable* cancellable, GLib2.Error** error=null) {
15922 return g_resolver_lookup_service(&this, service, protocol, domain, cancellable, error);
15925 // VERSION: 2.22
15926 // Begins asynchronously performing a DNS SRV lookup for the given
15927 // @service and @protocol in the given @domain, and eventually calls
15928 // @callback, which must call g_resolver_lookup_service_finish() to
15929 // get the final result. See g_resolver_lookup_service() for more
15930 // details.
15931 // <service>: the service type to look up (eg, "ldap")
15932 // <protocol>: the networking protocol to use for @service (eg, "tcp")
15933 // <domain>: the DNS domain to look up the service in
15934 // <cancellable>: a #GCancellable, or %NULL
15935 // <callback>: callback to call after resolution completes
15936 // <user_data>: data for @callback
15937 void lookup_service_async()(char* service, char* protocol, char* domain, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
15938 g_resolver_lookup_service_async(&this, service, protocol, domain, cancellable, callback, user_data);
15941 // VERSION: 2.22
15942 // Retrieves the result of a previous call to
15943 // g_resolver_lookup_service_async().
15945 // If the DNS resolution failed, @error (if non-%NULL) will be set to
15946 // a value from #GResolverError. If the operation was cancelled,
15947 // @error will be set to %G_IO_ERROR_CANCELLED.
15949 // or %NULL on error. See g_resolver_lookup_service() for more details.
15950 // RETURNS: a #GList of #GSrvTarget,
15951 // <result>: the result passed to your #GAsyncReadyCallback
15952 GLib2.List* /*new*/ lookup_service_finish()(AsyncResult* result, GLib2.Error** error=null) {
15953 return g_resolver_lookup_service_finish(&this, result, error);
15956 // VERSION: 2.22
15957 // Sets @resolver to be the application's default resolver (reffing
15958 // @resolver, and unreffing the previous default resolver, if any).
15959 // Future calls to g_resolver_get_default() will return this resolver.
15961 // This can be used if an application wants to perform any sort of DNS
15962 // caching or "pinning"; it can implement its own #GResolver that
15963 // calls the original default resolver for DNS operations, and
15964 // implements its own cache policies on top of that, and then set
15965 // itself as the default resolver for all later code to use.
15966 void set_default()() {
15967 g_resolver_set_default(&this);
15970 // Emitted when the resolver notices that the system resolver
15971 // configuration has changed.
15972 extern (C) alias static void function (Resolver* this_, void* user_data=null) signal_reload;
15974 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
15975 return super_.signal_connect!name(cb, data, cf);
15978 ulong signal_connect(string name:"reload", CB:signal_reload)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
15979 return signal_connect_data!()(&this, cast(char*)"reload",
15980 cast(GObject2.Callback)cb, data, null, cf);
15984 struct ResolverClass {
15985 GObject2.ObjectClass parent_class;
15986 extern (C) void function (Resolver* resolver) reload;
15988 // RETURNS: a #GList
15989 // <hostname>: the hostname to look up
15990 // <cancellable>: a #GCancellable, or %NULL
15991 extern (C) GLib2.List* /*new*/ function (Resolver* resolver, char* hostname, Cancellable* cancellable, GLib2.Error** error=null) lookup_by_name;
15993 // <hostname>: the hostname to look up the address of
15994 // <cancellable>: a #GCancellable, or %NULL
15995 // <callback>: callback to call after resolution completes
15996 // <user_data>: data for @callback
15997 extern (C) void function (Resolver* resolver, char* hostname, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) lookup_by_name_async;
15999 // RETURNS: a #GList
16000 // <result>: the result passed to your #GAsyncReadyCallback
16001 extern (C) GLib2.List* /*new*/ function (Resolver* resolver, AsyncResult* result, GLib2.Error** error=null) lookup_by_name_finish;
16003 // RETURNS: a hostname (either ASCII-only, or in ASCII-encoded
16004 // <address>: the address to reverse-resolve
16005 // <cancellable>: a #GCancellable, or %NULL
16006 extern (C) char* /*new*/ function (Resolver* resolver, InetAddress* address, Cancellable* cancellable, GLib2.Error** error=null) lookup_by_address;
16008 // <address>: the address to reverse-resolve
16009 // <cancellable>: a #GCancellable, or %NULL
16010 // <callback>: callback to call after resolution completes
16011 // <user_data>: data for @callback
16012 extern (C) void function (Resolver* resolver, InetAddress* address, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) lookup_by_address_async;
16014 // RETURNS: a hostname (either ASCII-only, or in ASCII-encoded
16015 // <result>: the result passed to your #GAsyncReadyCallback
16016 extern (C) char* /*new*/ function (Resolver* resolver, AsyncResult* result, GLib2.Error** error=null) lookup_by_address_finish;
16017 // Unintrospectable functionp: lookup_service() / ()
16018 extern (C) GLib2.List* function (Resolver* resolver, char* rrname, Cancellable* cancellable, GLib2.Error** error=null) lookup_service;
16019 extern (C) void function (Resolver* resolver, char* rrname, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) lookup_service_async;
16021 // RETURNS: a #GList of #GSrvTarget,
16022 // <result>: the result passed to your #GAsyncReadyCallback
16023 extern (C) GLib2.List* /*new*/ function (Resolver* resolver, AsyncResult* result, GLib2.Error** error=null) lookup_service_finish;
16024 extern (C) void function () _g_reserved1;
16025 extern (C) void function () _g_reserved2;
16026 extern (C) void function () _g_reserved3;
16027 extern (C) void function () _g_reserved4;
16028 extern (C) void function () _g_reserved5;
16029 extern (C) void function () _g_reserved6;
16033 // An error code used with %G_RESOLVER_ERROR in a #GError returned
16034 // from a #GResolver routine.
16035 enum ResolverError /* Version 2.22 */ {
16036 NOT_FOUND = 0,
16037 TEMPORARY_FAILURE = 1,
16038 INTERNAL = 2
16040 struct ResolverPrivate {
16044 // #GSeekable is implemented by streams (implementations of
16045 // #GInputStream or #GOutputStream) that support seeking.
16046 struct Seekable /* Interface */ {
16047 mixin template __interface__() {
16048 // Tests if the stream supports the #GSeekableIface.
16049 // RETURNS: %TRUE if @seekable can be seeked. %FALSE otherwise.
16050 int can_seek()() {
16051 return g_seekable_can_seek(cast(Seekable*)&this);
16054 // Tests if the stream can be truncated.
16055 // RETURNS: %TRUE if the stream can be truncated, %FALSE otherwise.
16056 int can_truncate()() {
16057 return g_seekable_can_truncate(cast(Seekable*)&this);
16060 // Seeks in the stream by the given @offset, modified by @type.
16062 // If @cancellable is not %NULL, then the operation can be cancelled by
16063 // triggering the cancellable object from another thread. If the operation
16064 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
16066 // has occurred, this function will return %FALSE and set @error
16067 // appropriately if present.
16068 // RETURNS: %TRUE if successful. If an error
16069 // <offset>: a #goffset.
16070 // <type>: a #GSeekType.
16071 // <cancellable>: optional #GCancellable object, %NULL to ignore.
16072 int seek()(long offset, GLib2.SeekType type, Cancellable* cancellable, GLib2.Error** error=null) {
16073 return g_seekable_seek(cast(Seekable*)&this, offset, type, cancellable, error);
16076 // Tells the current position within the stream.
16077 // RETURNS: the offset from the beginning of the buffer.
16078 long tell()() {
16079 return g_seekable_tell(cast(Seekable*)&this);
16082 // Truncates a stream with a given #offset.
16084 // If @cancellable is not %NULL, then the operation can be cancelled by
16085 // triggering the cancellable object from another thread. If the operation
16086 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an
16087 // operation was partially finished when the operation was cancelled the
16088 // partial result will be returned, without an error.
16090 // has occurred, this function will return %FALSE and set @error
16091 // appropriately if present.
16092 // RETURNS: %TRUE if successful. If an error
16093 // <offset>: a #goffset.
16094 // <cancellable>: optional #GCancellable object, %NULL to ignore.
16095 int truncate()(long offset, Cancellable* cancellable, GLib2.Error** error=null) {
16096 return g_seekable_truncate(cast(Seekable*)&this, offset, cancellable, error);
16099 mixin __interface__;
16102 // Provides an interface for implementing seekable functionality on I/O Streams.
16103 struct SeekableIface {
16104 GObject2.TypeInterface g_iface;
16105 // RETURNS: the offset from the beginning of the buffer.
16106 extern (C) long function (Seekable* seekable) tell;
16107 // RETURNS: %TRUE if @seekable can be seeked. %FALSE otherwise.
16108 extern (C) int function (Seekable* seekable) can_seek;
16110 // RETURNS: %TRUE if successful. If an error
16111 // <offset>: a #goffset.
16112 // <type>: a #GSeekType.
16113 // <cancellable>: optional #GCancellable object, %NULL to ignore.
16114 extern (C) int function (Seekable* seekable, long offset, GLib2.SeekType type, Cancellable* cancellable, GLib2.Error** error=null) seek;
16115 // RETURNS: %TRUE if the stream can be truncated, %FALSE otherwise.
16116 extern (C) int function (Seekable* seekable) can_truncate;
16118 // RETURNS: %TRUE if successful. If an error
16119 // <offset>: a #goffset.
16120 // <cancellable>: optional #GCancellable object, %NULL to ignore.
16121 extern (C) int function (Seekable* seekable, long offset, Cancellable* cancellable, GLib2.Error** error=null) truncate_fn;
16125 // The #GSettings class provides a convenient API for storing and retrieving
16126 // application settings.
16128 // Reads and writes can be considered to be non-blocking. Reading
16129 // settings with #GSettings is typically extremely fast: on
16130 // approximately the same order of magnitude (but slower than) a
16131 // #GHashTable lookup. Writing settings is also extremely fast in terms
16132 // of time to return to your application, but can be extremely expensive
16133 // for other threads and other processes. Many settings backends
16134 // (including dconf) have lazy initialisation which means in the common
16135 // case of the user using their computer without modifying any settings
16136 // a lot of work can be avoided. For dconf, the D-Bus service doesn't
16137 // even need to be started in this case. For this reason, you should
16138 // only ever modify #GSettings keys in response to explicit user action.
16139 // Particular care should be paid to ensure that modifications are not
16140 // made during startup -- for example, when setting the initial value
16141 // of preferences widgets. The built-in g_settings_bind() functionality
16142 // is careful not to write settings in response to notify signals as a
16143 // result of modifications that it makes to widgets.
16145 // When creating a GSettings instance, you have to specify a schema
16146 // that describes the keys in your settings and their types and default
16147 // values, as well as some other information.
16149 // Normally, a schema has as fixed path that determines where the settings
16150 // are stored in the conceptual global tree of settings. However, schemas
16151 // can also be 'relocatable', i.e. not equipped with a fixed path. This is
16152 // useful e.g. when the schema describes an 'account', and you want to be
16153 // able to store a arbitrary number of accounts.
16155 // Unlike other configuration systems (like GConf), GSettings does not
16156 // restrict keys to basic types like strings and numbers. GSettings stores
16157 // values as #GVariant, and allows any #GVariantType for keys. Key names
16158 // are restricted to lowercase characters, numbers and '-'. Furthermore,
16159 // the names must begin with a lowercase character, must not end
16160 // with a '-', and must not contain consecutive dashes.
16162 // Similar to GConf, the default values in GSettings schemas can be
16163 // localized, but the localized values are stored in gettext catalogs
16164 // and looked up with the domain that is specified in the
16165 // <tag class="attribute">gettext-domain</tag> attribute of the
16166 // <tag class="starttag">schemalist</tag> or <tag class="starttag">schema</tag>
16167 // elements and the category that is specified in the l10n attribute of the
16168 // <tag class="starttag">key</tag> element.
16170 // GSettings uses schemas in a compact binary form that is created
16171 // by the <link linkend="glib-compile-schemas">glib-compile-schemas</link>
16172 // utility. The input is a schema description in an XML format that can be
16173 // described by the following DTD:
16174 // |[<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>]|
16176 // glib-compile-schemas expects schema files to have the extension <filename>.gschema.xml</filename>
16178 // At runtime, schemas are identified by their id (as specified
16179 // in the <tag class="attribute">id</tag> attribute of the
16180 // <tag class="starttag">schema</tag> element). The
16181 // convention for schema ids is to use a dotted name, similar in
16182 // style to a D-Bus bus name, e.g. "org.gnome.SessionManager". In particular,
16183 // if the settings are for a specific service that owns a D-Bus bus name,
16184 // the D-Bus bus name and schema id should match. For schemas which deal
16185 // with settings not associated with one named application, the id should
16186 // not use StudlyCaps, e.g. "org.gnome.font-rendering".
16188 // In addition to #GVariant types, keys can have types that have enumerated
16189 // types. These can be described by a <tag class="starttag">choice</tag>,
16190 // <tag class="starttag">enum</tag> or <tag class="starttag">flags</tag> element, see
16191 // <xref linkend="schema-enumerated"/>. The underlying type of
16192 // such a key is string, but you can use g_settings_get_enum(),
16193 // g_settings_set_enum(), g_settings_get_flags(), g_settings_set_flags()
16194 // access the numeric values corresponding to the string value of enum
16195 // and flags keys.
16197 // <example id="schema-default-values"><title>Default values</title>
16198 // <programlisting><![CDATA[
16199 // <schemalist>
16200 // <schema id="org.gtk.Test" path="/tests/" gettext-domain="test">
16202 // <key name="greeting" type="s">
16203 // <default l10n="messages">"Hello, earthlings"</default>
16204 // <summary>A greeting</summary>
16205 // <description>
16206 // Greeting of the invading martians
16207 // </description>
16208 // </key>
16210 // <key name="box" type="(ii)">
16211 // <default>(20,30)</default>
16212 // </key>
16214 // </schema>
16215 // </schemalist>
16216 // ]]></programlisting></example>
16218 // <example id="schema-enumerated"><title>Ranges, choices and enumerated types</title>
16219 // <programlisting><![CDATA[
16220 // <schemalist>
16222 // <enum id="org.gtk.Test.myenum">
16223 // <value nick="first" value="1"/>
16224 // <value nick="second" value="2"/>
16225 // </enum>
16227 // <flags id="org.gtk.Test.myflags">
16228 // <value nick="flag1" value="1"/>
16229 // <value nick="flag2" value="2"/>
16230 // <value nick="flag3" value="4"/>
16231 // </flags>
16233 // <schema id="org.gtk.Test">
16235 // <key name="key-with-range" type="i">
16236 // <range min="1" max="100"/>
16237 // <default>10</default>
16238 // </key>
16240 // <key name="key-with-choices" type="s">
16241 // <choices>
16242 // <choice value='Elisabeth'/>
16243 // <choice value='Annabeth'/>
16244 // <choice value='Joe'/>
16245 // </choices>
16246 // <aliases>
16247 // <alias value='Anna' target='Annabeth'/>
16248 // <alias value='Beth' target='Elisabeth'/>
16249 // </aliases>
16250 // <default>'Joe'</default>
16251 // </key>
16253 // <key name='enumerated-key' enum='org.gtk.Test.myenum'>
16254 // <default>'first'</default>
16255 // </key>
16257 // <key name='flags-key' flags='org.gtk.Test.myflags'>
16258 // <default>["flag1",flag2"]</default>
16259 // </key>
16260 // </schema>
16261 // </schemalist>
16262 // ]]></programlisting></example>
16264 // <refsect2>
16265 // <title>Vendor overrides</title>
16266 // <para>
16267 // Default values are defined in the schemas that get installed by
16268 // an application. Sometimes, it is necessary for a vendor or distributor
16269 // to adjust these defaults. Since patching the XML source for the schema
16270 // is inconvenient and error-prone,
16271 // <link linkend="glib-compile-schemas">glib-compile-schemas</link> reads
16272 // so-called 'vendor override' files. These are keyfiles in the same
16273 // directory as the XML schema sources which can override default values.
16274 // The schema id serves as the group name in the key file, and the values
16275 // are expected in serialized GVariant form, as in the following example:
16276 // <informalexample><programlisting>
16277 // [org.gtk.Example]
16278 // key1='string'
16279 // key2=1.5
16280 // </programlisting></informalexample>
16281 // </para>
16282 // <para>
16283 // glib-compile-schemas expects schema files to have the extension
16284 // <filename>.gschema.override</filename>
16285 // </para>
16286 // </refsect2>
16288 // <refsect2>
16289 // <title>Binding</title>
16290 // <para>
16291 // A very convenient feature of GSettings lets you bind #GObject properties
16292 // directly to settings, using g_settings_bind(). Once a GObject property
16293 // has been bound to a setting, changes on either side are automatically
16294 // propagated to the other side. GSettings handles details like
16295 // mapping between GObject and GVariant types, and preventing infinite
16296 // cycles.
16297 // </para>
16298 // <para>
16299 // This makes it very easy to hook up a preferences dialog to the
16300 // underlying settings. To make this even more convenient, GSettings
16301 // looks for a boolean property with the name "sensitivity" and
16302 // automatically binds it to the writability of the bound setting.
16303 // If this 'magic' gets in the way, it can be suppressed with the
16304 // #G_SETTINGS_BIND_NO_SENSITIVITY flag.
16305 // </para>
16306 // </refsect2>
16307 struct Settings /* : GObject.Object */ {
16308 alias parent_instance this;
16309 alias parent_instance super_;
16310 alias parent_instance object;
16311 GObject2.Object parent_instance;
16312 SettingsPrivate* priv;
16315 // VERSION: 2.26
16316 // Creates a new #GSettings object with a given schema.
16318 // Signals on the newly created #GSettings object will be dispatched
16319 // via the thread-default #GMainContext in effect at the time of the
16320 // call to g_settings_new(). The new #GSettings will hold a reference
16321 // on the context. See g_main_context_push_thread_default().
16322 // RETURNS: a new #GSettings object
16323 // <schema>: the name of the schema
16324 static Settings* /*new*/ new_()(char* schema) {
16325 return g_settings_new(schema);
16328 // VERSION: 2.26
16329 // Creates a new #GSettings object with a given schema and backend.
16331 // Creating a #GSettings object with a different backend allows accessing
16332 // settings from a database other than the usual one. For example, it may make
16333 // sense to pass a backend corresponding to the "defaults" settings database on
16334 // the system to get a settings object that modifies the system default
16335 // settings instead of the settings for this user.
16336 // RETURNS: a new #GSettings object
16337 // <schema>: the name of the schema
16338 // <backend>: the #GSettingsBackend to use
16339 static Settings* /*new*/ new_with_backend()(char* schema, SettingsBackend* backend) {
16340 return g_settings_new_with_backend(schema, backend);
16343 // VERSION: 2.26
16344 // Creates a new #GSettings object with a given schema, backend and
16345 // path.
16347 // This is a mix of g_settings_new_with_backend() and
16348 // g_settings_new_with_path().
16349 // RETURNS: a new #GSettings object
16350 // <schema>: the name of the schema
16351 // <backend>: the #GSettingsBackend to use
16352 // <path>: the path to use
16353 static Settings* /*new*/ new_with_backend_and_path()(char* schema, SettingsBackend* backend, char* path) {
16354 return g_settings_new_with_backend_and_path(schema, backend, path);
16357 // VERSION: 2.26
16358 // Creates a new #GSettings object with a given schema and path.
16360 // You only need to do this if you want to directly create a settings
16361 // object with a schema that doesn't have a specified path of its own.
16362 // That's quite rare.
16364 // It is a programmer error to call this function for a schema that
16365 // has an explicitly specified path.
16366 // RETURNS: a new #GSettings object
16367 // <schema>: the name of the schema
16368 // <path>: the path to use
16369 static Settings* /*new*/ new_with_path()(char* schema, char* path) {
16370 return g_settings_new_with_path(schema, path);
16373 // VERSION: 2.28
16374 // Gets a list of the relocatable #GSettings schemas installed on the
16375 // system. These are schemas that do not provide their own path. It is
16376 // usual to instantiate these schemas directly, but if you want to you
16377 // can use g_settings_new_with_path() to specify the path.
16379 // The output of this function, tTaken together with the output of
16380 // g_settings_list_schemas() represents the complete list of all
16381 // installed schemas.
16383 // #GSettings schemas that are available. The list must not be
16384 // modified or freed.
16385 // RETURNS: a list of relocatable
16386 static char** list_relocatable_schemas()() {
16387 return g_settings_list_relocatable_schemas();
16390 // VERSION: 2.26
16391 // Gets a list of the #GSettings schemas installed on the system. The
16392 // returned list is exactly the list of schemas for which you may call
16393 // g_settings_new() without adverse effects.
16395 // This function does not list the schemas that do not provide their own
16396 // paths (ie: schemas for which you must use
16397 // g_settings_new_with_path()). See
16398 // g_settings_list_relocatable_schemas() for that.
16400 // schemas that are available. The list must not be modified or
16401 // freed.
16402 // RETURNS: a list of #GSettings
16403 static char** list_schemas()() {
16404 return g_settings_list_schemas();
16407 // Ensures that all pending operations for the given are complete for
16408 // the default backend.
16410 // Writes made to a #GSettings are handled asynchronously. For this
16411 // reason, it is very unlikely that the changes have it to disk by the
16412 // time g_settings_set() returns.
16414 // This call will block until all of the writes have made it to the
16415 // backend. Since the mainloop is not running, no change notifications
16416 // will be dispatched during this call (but some may be queued by the
16417 // time the call is done).
16418 static void sync()() {
16419 g_settings_sync();
16422 // VERSION: 2.26
16423 // Removes an existing binding for @property on @object.
16425 // Note that bindings are automatically removed when the
16426 // object is finalized, so it is rarely necessary to call this
16427 // function.
16428 // <object>: the object
16429 // <property>: the property whose binding is removed
16430 static void unbind()(void* object, char* property) {
16431 g_settings_unbind(object, property);
16434 // Applies any changes that have been made to the settings. This
16435 // function does nothing unless @settings is in 'delay-apply' mode;
16436 // see g_settings_delay(). In the normal case settings are always
16437 // applied immediately.
16438 void apply()() {
16439 g_settings_apply(&this);
16442 // VERSION: 2.26
16443 // Create a binding between the @key in the @settings object
16444 // and the property @property of @object.
16446 // The binding uses the default GIO mapping functions to map
16447 // between the settings and property values. These functions
16448 // handle booleans, numeric types and string types in a
16449 // straightforward way. Use g_settings_bind_with_mapping() if
16450 // you need a custom mapping, or map between types that are not
16451 // supported by the default mapping functions.
16453 // Unless the @flags include %G_SETTINGS_BIND_NO_SENSITIVITY, this
16454 // function also establishes a binding between the writability of
16455 // @key and the "sensitive" property of @object (if @object has
16456 // a boolean property by that name). See g_settings_bind_writable()
16457 // for more details about writable bindings.
16459 // Note that the lifecycle of the binding is tied to the object,
16460 // and that you can have only one binding per object property.
16461 // If you bind the same property twice on the same object, the second
16462 // binding overrides the first one.
16463 // <key>: the key to bind
16464 // <object>: a #GObject
16465 // <property>: the name of the property to bind
16466 // <flags>: flags for the binding
16467 void bind()(char* key, GObject2.Object* object, char* property, SettingsBindFlags flags) {
16468 g_settings_bind(&this, key, object, property, flags);
16471 // Unintrospectable method: bind_with_mapping() / g_settings_bind_with_mapping()
16472 // VERSION: 2.26
16473 // Create a binding between the @key in the @settings object
16474 // and the property @property of @object.
16476 // The binding uses the provided mapping functions to map between
16477 // settings and property values.
16479 // Note that the lifecycle of the binding is tied to the object,
16480 // and that you can have only one binding per object property.
16481 // If you bind the same property twice on the same object, the second
16482 // binding overrides the first one.
16483 // <key>: the key to bind
16484 // <object>: a #GObject
16485 // <property>: the name of the property to bind
16486 // <flags>: flags for the binding
16487 // <get_mapping>: a function that gets called to convert values from @settings to @object, or %NULL to use the default GIO mapping
16488 // <set_mapping>: a function that gets called to convert values from @object to @settings, or %NULL to use the default GIO mapping
16489 // <user_data>: data that gets passed to @get_mapping and @set_mapping
16490 // <destroy>: #GDestroyNotify function for @user_data
16491 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) {
16492 g_settings_bind_with_mapping(&this, key, object, property, flags, get_mapping, set_mapping, user_data, destroy);
16495 // VERSION: 2.26
16496 // Create a binding between the writability of @key in the
16497 // @settings object and the property @property of @object.
16498 // The property must be boolean; "sensitive" or "visible"
16499 // properties of widgets are the most likely candidates.
16501 // Writable bindings are always uni-directional; changes of the
16502 // writability of the setting will be propagated to the object
16503 // property, not the other way.
16505 // When the @inverted argument is %TRUE, the binding inverts the
16506 // value as it passes from the setting to the object, i.e. @property
16507 // will be set to %TRUE if the key is <emphasis>not</emphasis>
16508 // writable.
16510 // Note that the lifecycle of the binding is tied to the object,
16511 // and that you can have only one binding per object property.
16512 // If you bind the same property twice on the same object, the second
16513 // binding overrides the first one.
16514 // <key>: the key to bind
16515 // <object>: a #GObject
16516 // <property>: the name of a boolean property to bind
16517 // <inverted>: whether to 'invert' the value
16518 void bind_writable()(char* key, GObject2.Object* object, char* property, int inverted) {
16519 g_settings_bind_writable(&this, key, object, property, inverted);
16522 // VERSION: 2.26
16523 // Changes the #GSettings object into 'delay-apply' mode. In this
16524 // mode, changes to @settings are not immediately propagated to the
16525 // backend, but kept locally until g_settings_apply() is called.
16526 void delay()() {
16527 g_settings_delay(&this);
16530 // Unintrospectable method: get() / g_settings_get()
16531 // VERSION: 2.26
16532 // Gets the value that is stored at @key in @settings.
16534 // A convenience function that combines g_settings_get_value() with
16535 // g_variant_get().
16537 // It is a programmer error to give a @key that isn't contained in the
16538 // schema for @settings or for the #GVariantType of @format to mismatch
16539 // the type given in the schema.
16540 // <key>: the key to get the value for
16541 // <format>: a #GVariant format string
16542 /+ Not available -- variadic methods unsupported - use the C function directly.
16543 alias g_settings_get get; // Variadic
16546 // VERSION: 2.26
16547 // Gets the value that is stored at @key in @settings.
16549 // A convenience variant of g_settings_get() for booleans.
16551 // It is a programmer error to give a @key that isn't specified as
16552 // having a boolean type in the schema for @settings.
16553 // RETURNS: a boolean
16554 // <key>: the key to get the value for
16555 int get_boolean()(char* key) {
16556 return g_settings_get_boolean(&this, key);
16559 // VERSION: 2.26
16560 // Creates a 'child' settings object which has a base path of
16561 // <replaceable>base-path</replaceable>/@name, where
16562 // <replaceable>base-path</replaceable> is the base path of @settings.
16564 // The schema for the child settings object must have been declared
16565 // in the schema of @settings using a <tag class="starttag">child</tag> element.
16566 // RETURNS: a 'child' settings object
16567 // <name>: the name of the 'child' schema
16568 Settings* /*new*/ get_child()(char* name) {
16569 return g_settings_get_child(&this, name);
16572 // VERSION: 2.26
16573 // Gets the value that is stored at @key in @settings.
16575 // A convenience variant of g_settings_get() for doubles.
16577 // It is a programmer error to give a @key that isn't specified as
16578 // having a 'double' type in the schema for @settings.
16579 // RETURNS: a double
16580 // <key>: the key to get the value for
16581 double get_double()(char* key) {
16582 return g_settings_get_double(&this, key);
16585 // VERSION: 2.26
16586 // Gets the value that is stored in @settings for @key and converts it
16587 // to the enum value that it represents.
16589 // In order to use this function the type of the value must be a string
16590 // and it must be marked in the schema file as an enumerated type.
16592 // It is a programmer error to give a @key that isn't contained in the
16593 // schema for @settings or is not marked as an enumerated type.
16595 // If the value stored in the configuration database is not a valid
16596 // value for the enumerated type then this function will return the
16597 // default value.
16598 // RETURNS: the enum value
16599 // <key>: the key to get the value for
16600 int get_enum()(char* key) {
16601 return g_settings_get_enum(&this, key);
16604 // VERSION: 2.26
16605 // Gets the value that is stored in @settings for @key and converts it
16606 // to the flags value that it represents.
16608 // In order to use this function the type of the value must be an array
16609 // of strings and it must be marked in the schema file as an flags type.
16611 // It is a programmer error to give a @key that isn't contained in the
16612 // schema for @settings or is not marked as a flags type.
16614 // If the value stored in the configuration database is not a valid
16615 // value for the flags type then this function will return the default
16616 // value.
16617 // RETURNS: the flags value
16618 // <key>: the key to get the value for
16619 uint get_flags()(char* key) {
16620 return g_settings_get_flags(&this, key);
16623 // VERSION: 2.26
16624 // Returns whether the #GSettings object has any unapplied
16625 // changes. This can only be the case if it is in 'delayed-apply' mode.
16626 // RETURNS: %TRUE if @settings has unapplied changes
16627 int get_has_unapplied()() {
16628 return g_settings_get_has_unapplied(&this);
16631 // VERSION: 2.26
16632 // Gets the value that is stored at @key in @settings.
16634 // A convenience variant of g_settings_get() for 32-bit integers.
16636 // It is a programmer error to give a @key that isn't specified as
16637 // having a int32 type in the schema for @settings.
16638 // RETURNS: an integer
16639 // <key>: the key to get the value for
16640 int get_int()(char* key) {
16641 return g_settings_get_int(&this, key);
16644 // Gets the value that is stored at @key in @settings, subject to
16645 // application-level validation/mapping.
16647 // You should use this function when the application needs to perform
16648 // some processing on the value of the key (for example, parsing). The
16649 // @mapping function performs that processing. If the function
16650 // indicates that the processing was unsuccessful (due to a parse error,
16651 // for example) then the mapping is tried again with another value.
16652 // This allows a robust 'fall back to defaults' behaviour to be
16653 // implemented somewhat automatically.
16655 // The first value that is tried is the user's setting for the key. If
16656 // the mapping function fails to map this value, other values may be
16657 // tried in an unspecified order (system or site defaults, translated
16658 // schema default values, untranslated schema default values, etc).
16660 // If the mapping function fails for all possible values, one additional
16661 // attempt is made: the mapping function is called with a %NULL value.
16662 // If the mapping function still indicates failure at this point then
16663 // the application will be aborted.
16665 // The result parameter for the @mapping function is pointed to a
16666 // #gpointer which is initially set to %NULL. The same pointer is given
16667 // to each invocation of @mapping. The final value of that #gpointer is
16668 // what is returned by this function. %NULL is valid; it is returned
16669 // just as any other value would be.
16670 // RETURNS: the result, which may be %NULL
16671 // <key>: the key to get the value for
16672 // <mapping>: the function to map the value in the settings database to the value used by the application
16673 // <user_data>: user data for @mapping
16674 void* /*new*/ get_mapped()(char* key, SettingsGetMapping mapping, void* user_data) {
16675 return g_settings_get_mapped(&this, key, mapping, user_data);
16678 // VERSION: 2.28
16679 // Queries the range of a key.
16681 // This function will return a #GVariant that fully describes the range
16682 // of values that are valid for @key.
16684 // The type of #GVariant returned is <literal>(sv)</literal>. The
16685 // string describes the type of range restriction in effect. The type
16686 // and meaning of the value contained in the variant depends on the
16687 // string.
16689 // If the string is <literal>'type'</literal> then the variant contains
16690 // an empty array. The element type of that empty array is the expected
16691 // type of value and all values of that type are valid.
16693 // If the string is <literal>'enum'</literal> then the variant contains
16694 // an array enumerating the possible values. Each item in the array is
16695 // a possible valid value and no other values are valid.
16697 // If the string is <literal>'flags'</literal> then the variant contains
16698 // an array. Each item in the array is a value that may appear zero or
16699 // one times in an array to be used as the value for this key. For
16700 // example, if the variant contained the array <literal>['x',
16701 // 'y']</literal> then the valid values for the key would be
16702 // <literal>[]</literal>, <literal>['x']</literal>,
16703 // <literal>['y']</literal>, <literal>['x', 'y']</literal> and
16704 // <literal>['y', 'x']</literal>.
16706 // Finally, if the string is <literal>'range'</literal> then the variant
16707 // contains a pair of like-typed values -- the minimum and maximum
16708 // permissible values for this key.
16710 // This information should not be used by normal programs. It is
16711 // considered to be a hint for introspection purposes. Normal programs
16712 // should already know what is permitted by their own schema. The
16713 // format may change in any way in the future -- but particularly, new
16714 // forms may be added to the possibilities described above.
16716 // It is a programmer error to give a @key that isn't contained in the
16717 // schema for @settings.
16719 // You should free the returned value with g_variant_unref() when it is
16720 // no longer needed.
16721 // RETURNS: a #GVariant describing the range
16722 // <key>: the key to query the range of
16723 GLib2.Variant* /*new*/ get_range()(char* key) {
16724 return g_settings_get_range(&this, key);
16727 // VERSION: 2.26
16728 // Gets the value that is stored at @key in @settings.
16730 // A convenience variant of g_settings_get() for strings.
16732 // It is a programmer error to give a @key that isn't specified as
16733 // having a string type in the schema for @settings.
16734 // RETURNS: a newly-allocated string
16735 // <key>: the key to get the value for
16736 char* /*new*/ get_string()(char* key) {
16737 return g_settings_get_string(&this, key);
16740 // VERSION: 2.26
16741 // A convenience variant of g_settings_get() for string arrays.
16743 // It is a programmer error to give a @key that isn't specified as
16744 // having an array of strings type in the schema for @settings.
16745 // RETURNS: a newly-allocated, %NULL-terminated array of strings, the value that is stored at @key in @settings.
16746 // <key>: the key to get the value for
16747 char** /*new*/ get_strv()(char* key) {
16748 return g_settings_get_strv(&this, key);
16751 // VERSION: 2.30
16752 // Gets the value that is stored at @key in @settings.
16754 // A convenience variant of g_settings_get() for 32-bit unsigned
16755 // integers.
16757 // It is a programmer error to give a @key that isn't specified as
16758 // having a uint32 type in the schema for @settings.
16759 // RETURNS: an unsigned integer
16760 // <key>: the key to get the value for
16761 uint get_uint()(char* key) {
16762 return g_settings_get_uint(&this, key);
16765 // VERSION: 2.26
16766 // Gets the value that is stored in @settings for @key.
16768 // It is a programmer error to give a @key that isn't contained in the
16769 // schema for @settings.
16770 // RETURNS: a new #GVariant
16771 // <key>: the key to get the value for
16772 GLib2.Variant* /*new*/ get_value()(char* key) {
16773 return g_settings_get_value(&this, key);
16776 // VERSION: 2.26
16777 // Finds out if a key can be written or not
16778 // RETURNS: %TRUE if the key @name is writable
16779 // <name>: the name of a key
16780 int is_writable()(char* name) {
16781 return g_settings_is_writable(&this, name);
16784 // Gets the list of children on @settings.
16786 // The list is exactly the list of strings for which it is not an error
16787 // to call g_settings_get_child().
16789 // For GSettings objects that are lists, this value can change at any
16790 // time and you should connect to the "children-changed" signal to watch
16791 // for those changes. Note that there is a race condition here: you may
16792 // request a child after listing it only for it to have been destroyed
16793 // in the meantime. For this reason, g_settings_get_child() may return
16794 // %NULL even for a child that was listed by this function.
16796 // For GSettings objects that are not lists, you should probably not be
16797 // calling this function from "normal" code (since you should already
16798 // know what children are in your schema). This function may still be
16799 // useful there for introspection reasons, however.
16801 // You should free the return value with g_strfreev() when you are done
16802 // with it.
16803 // RETURNS: a list of the children on @settings
16804 char** /*new*/ list_children()() {
16805 return g_settings_list_children(&this);
16808 // Introspects the list of keys on @settings.
16810 // You should probably not be calling this function from "normal" code
16811 // (since you should already know what keys are in your schema). This
16812 // function is intended for introspection reasons.
16814 // You should free the return value with g_strfreev() when you are done
16815 // with it.
16816 // RETURNS: a list of the keys on @settings
16817 char** /*new*/ list_keys()() {
16818 return g_settings_list_keys(&this);
16821 // VERSION: 2.28
16822 // Checks if the given @value is of the correct type and within the
16823 // permitted range for @key.
16825 // This API is not intended to be used by normal programs -- they should
16826 // already know what is permitted by their own schemas. This API is
16827 // meant to be used by programs such as editors or commandline tools.
16829 // It is a programmer error to give a @key that isn't contained in the
16830 // schema for @settings.
16831 // RETURNS: %TRUE if @value is valid for @key
16832 // <key>: the key to check
16833 // <value>: the value to check
16834 int range_check()(char* key, GLib2.Variant* value) {
16835 return g_settings_range_check(&this, key, value);
16838 // Resets @key to its default value.
16840 // This call resets the key, as much as possible, to its default value.
16841 // That might the value specified in the schema or the one set by the
16842 // administrator.
16843 // <key>: the name of a key
16844 void reset()(char* key) {
16845 g_settings_reset(&this, key);
16848 // Reverts all non-applied changes to the settings. This function
16849 // does nothing unless @settings is in 'delay-apply' mode; see
16850 // g_settings_delay(). In the normal case settings are always applied
16851 // immediately.
16853 // Change notifications will be emitted for affected keys.
16854 void revert()() {
16855 g_settings_revert(&this);
16858 // Unintrospectable method: set() / g_settings_set()
16859 // VERSION: 2.26
16860 // Sets @key in @settings to @value.
16862 // A convenience function that combines g_settings_set_value() with
16863 // g_variant_new().
16865 // It is a programmer error to give a @key that isn't contained in the
16866 // schema for @settings or for the #GVariantType of @format to mismatch
16867 // the type given in the schema.
16868 // RETURNS: %TRUE if setting the key succeeded, %FALSE if the key was not writable
16869 // <key>: the name of the key to set
16870 // <format>: a #GVariant format string
16871 /+ Not available -- variadic methods unsupported - use the C function directly.
16872 alias g_settings_set set; // Variadic
16875 // VERSION: 2.26
16876 // Sets @key in @settings to @value.
16878 // A convenience variant of g_settings_set() for booleans.
16880 // It is a programmer error to give a @key that isn't specified as
16881 // having a boolean type in the schema for @settings.
16882 // RETURNS: %TRUE if setting the key succeeded, %FALSE if the key was not writable
16883 // <key>: the name of the key to set
16884 // <value>: the value to set it to
16885 int set_boolean()(char* key, int value) {
16886 return g_settings_set_boolean(&this, key, value);
16889 // VERSION: 2.26
16890 // Sets @key in @settings to @value.
16892 // A convenience variant of g_settings_set() for doubles.
16894 // It is a programmer error to give a @key that isn't specified as
16895 // having a 'double' type in the schema for @settings.
16896 // RETURNS: %TRUE if setting the key succeeded, %FALSE if the key was not writable
16897 // <key>: the name of the key to set
16898 // <value>: the value to set it to
16899 int set_double()(char* key, double value) {
16900 return g_settings_set_double(&this, key, value);
16903 // Looks up the enumerated type nick for @value and writes it to @key,
16904 // within @settings.
16906 // It is a programmer error to give a @key that isn't contained in the
16907 // schema for @settings or is not marked as an enumerated type, or for
16908 // @value not to be a valid value for the named type.
16910 // After performing the write, accessing @key directly with
16911 // g_settings_get_string() will return the 'nick' associated with
16912 // @value.
16913 // RETURNS: %TRUE, if the set succeeds
16914 // <key>: a key, within @settings
16915 // <value>: an enumerated value
16916 int set_enum()(char* key, int value) {
16917 return g_settings_set_enum(&this, key, value);
16920 // Looks up the flags type nicks for the bits specified by @value, puts
16921 // them in an array of strings and writes the array to @key, within
16922 // @settings.
16924 // It is a programmer error to give a @key that isn't contained in the
16925 // schema for @settings or is not marked as a flags type, or for @value
16926 // to contain any bits that are not value for the named type.
16928 // After performing the write, accessing @key directly with
16929 // g_settings_get_strv() will return an array of 'nicks'; one for each
16930 // bit in @value.
16931 // RETURNS: %TRUE, if the set succeeds
16932 // <key>: a key, within @settings
16933 // <value>: a flags value
16934 int set_flags()(char* key, uint value) {
16935 return g_settings_set_flags(&this, key, value);
16938 // VERSION: 2.26
16939 // Sets @key in @settings to @value.
16941 // A convenience variant of g_settings_set() for 32-bit integers.
16943 // It is a programmer error to give a @key that isn't specified as
16944 // having a int32 type in the schema for @settings.
16945 // RETURNS: %TRUE if setting the key succeeded, %FALSE if the key was not writable
16946 // <key>: the name of the key to set
16947 // <value>: the value to set it to
16948 int set_int()(char* key, int value) {
16949 return g_settings_set_int(&this, key, value);
16952 // VERSION: 2.26
16953 // Sets @key in @settings to @value.
16955 // A convenience variant of g_settings_set() for strings.
16957 // It is a programmer error to give a @key that isn't specified as
16958 // having a string type in the schema for @settings.
16959 // RETURNS: %TRUE if setting the key succeeded, %FALSE if the key was not writable
16960 // <key>: the name of the key to set
16961 // <value>: the value to set it to
16962 int set_string()(char* key, char* value) {
16963 return g_settings_set_string(&this, key, value);
16966 // VERSION: 2.26
16967 // Sets @key in @settings to @value.
16969 // A convenience variant of g_settings_set() for string arrays. If
16970 // @value is %NULL, then @key is set to be the empty array.
16972 // It is a programmer error to give a @key that isn't specified as
16973 // having an array of strings type in the schema for @settings.
16974 // RETURNS: %TRUE if setting the key succeeded, %FALSE if the key was not writable
16975 // <key>: the name of the key to set
16976 // <value>: the value to set it to, or %NULL
16977 int set_strv()(char* key, char** value=null) {
16978 return g_settings_set_strv(&this, key, value);
16981 // VERSION: 2.30
16982 // Sets @key in @settings to @value.
16984 // A convenience variant of g_settings_set() for 32-bit unsigned
16985 // integers.
16987 // It is a programmer error to give a @key that isn't specified as
16988 // having a uint32 type in the schema for @settings.
16989 // RETURNS: %TRUE if setting the key succeeded, %FALSE if the key was not writable
16990 // <key>: the name of the key to set
16991 // <value>: the value to set it to
16992 int set_uint()(char* key, uint value) {
16993 return g_settings_set_uint(&this, key, value);
16996 // VERSION: 2.26
16997 // Sets @key in @settings to @value.
16999 // It is a programmer error to give a @key that isn't contained in the
17000 // schema for @settings or for @value to have the incorrect type, per
17001 // the schema.
17003 // If @value is floating then this function consumes the reference.
17004 // RETURNS: %TRUE if setting the key succeeded, %FALSE if the key was not writable
17005 // <key>: the name of the key to set
17006 // <value>: a #GVariant of the correct type
17007 int set_value()(char* key, GLib2.Variant* value) {
17008 return g_settings_set_value(&this, key, value);
17011 // The "change-event" signal is emitted once per change event that
17012 // affects this settings object. You should connect to this signal
17013 // only if you are interested in viewing groups of changes before they
17014 // are split out into multiple emissions of the "changed" signal.
17015 // For most use cases it is more appropriate to use the "changed" signal.
17017 // In the event that the change event applies to one or more specified
17018 // keys, @keys will be an array of #GQuark of length @n_keys. In the
17019 // event that the change event applies to the #GSettings object as a
17020 // whole (ie: potentially every key has been changed) then @keys will
17021 // be %NULL and @n_keys will be 0.
17023 // The default handler for this signal invokes the "changed" signal
17024 // for each affected key. If any other connected handler returns
17025 // %TRUE then this default functionality will be suppressed.
17026 // RETURNS: %TRUE to stop other handlers from being invoked for the event. FALSE to propagate the event further.
17027 // <keys>: an array of #GQuark<!-- -->s for the changed keys, or %NULL
17028 // <n_keys>: the length of the @keys array, or 0
17029 extern (C) alias static c_int function (Settings* this_, GLib2.Quark* keys, int n_keys, void* user_data=null) signal_change_event;
17031 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
17032 return super_.signal_connect!name(cb, data, cf);
17035 ulong signal_connect(string name:"change-event", CB:signal_change_event)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
17036 return signal_connect_data!()(&this, cast(char*)"change-event",
17037 cast(GObject2.Callback)cb, data, null, cf);
17040 // The "changed" signal is emitted when a key has potentially changed.
17041 // You should call one of the g_settings_get() calls to check the new
17042 // value.
17044 // This signal supports detailed connections. You can connect to the
17045 // detailed signal "changed::x" in order to only receive callbacks
17046 // when key "x" changes.
17047 // <key>: the name of the key that changed
17048 extern (C) alias static void function (Settings* this_, char* key, void* user_data=null) signal_changed;
17049 ulong signal_connect(string name:"changed", CB:signal_changed)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
17050 return signal_connect_data!()(&this, cast(char*)"changed",
17051 cast(GObject2.Callback)cb, data, null, cf);
17054 // The "writable-change-event" signal is emitted once per writability
17055 // change event that affects this settings object. You should connect
17056 // to this signal if you are interested in viewing groups of changes
17057 // before they are split out into multiple emissions of the
17058 // "writable-changed" signal. For most use cases it is more
17059 // appropriate to use the "writable-changed" signal.
17061 // In the event that the writability change applies only to a single
17062 // key, @key will be set to the #GQuark for that key. In the event
17063 // that the writability change affects the entire settings object,
17064 // @key will be 0.
17066 // The default handler for this signal invokes the "writable-changed"
17067 // and "changed" signals for each affected key. This is done because
17068 // changes in writability might also imply changes in value (if for
17069 // example, a new mandatory setting is introduced). If any other
17070 // connected handler returns %TRUE then this default functionality
17071 // will be suppressed.
17072 // RETURNS: %TRUE to stop other handlers from being invoked for the event. FALSE to propagate the event further.
17073 // <key>: the quark of the key, or 0
17074 extern (C) alias static c_int function (Settings* this_, c_uint key, void* user_data=null) signal_writable_change_event;
17075 ulong signal_connect(string name:"writable-change-event", CB:signal_writable_change_event)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
17076 return signal_connect_data!()(&this, cast(char*)"writable-change-event",
17077 cast(GObject2.Callback)cb, data, null, cf);
17080 // The "writable-changed" signal is emitted when the writability of a
17081 // key has potentially changed. You should call
17082 // g_settings_is_writable() in order to determine the new status.
17084 // This signal supports detailed connections. You can connect to the
17085 // detailed signal "writable-changed::x" in order to only receive
17086 // callbacks when the writability of "x" changes.
17087 // <key>: the key
17088 extern (C) alias static void function (Settings* this_, char* key, void* user_data=null) signal_writable_changed;
17089 ulong signal_connect(string name:"writable-changed", CB:signal_writable_changed)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
17090 return signal_connect_data!()(&this, cast(char*)"writable-changed",
17091 cast(GObject2.Callback)cb, data, null, cf);
17096 // The #GSettingsBackend interface defines a generic interface for
17097 // non-strictly-typed data that is stored in a hierarchy. To implement
17098 // an alternative storage backend for #GSettings, you need to implement
17099 // the #GSettingsBackend interface and then make it implement the
17100 // extension point #G_SETTINGS_BACKEND_EXTENSION_POINT_NAME.
17102 // The interface defines methods for reading and writing values, a
17103 // method for determining if writing of certain values will fail
17104 // (lockdown) and a change notification mechanism.
17106 // The semantics of the interface are very precisely defined and
17107 // implementations must carefully adhere to the expectations of
17108 // callers that are documented on each of the interface methods.
17110 // Some of the GSettingsBackend functions accept or return a #GTree.
17111 // These trees always have strings as keys and #GVariant as values.
17112 // g_settings_backend_create_tree() is a convenience function to create
17113 // suitable trees.
17115 // <note><para>
17116 // The #GSettingsBackend API is exported to allow third-party
17117 // implementations, but does not carry the same stability guarantees
17118 // as the public GIO API. For this reason, you have to define the
17119 // C preprocessor symbol #G_SETTINGS_ENABLE_BACKEND before including
17120 // <filename>gio/gsettingsbackend.h</filename>
17121 // </para></note>
17122 struct SettingsBackend {
17126 // Flags used when creating a binding. These flags determine in which
17127 // direction the binding works. The default is to synchronize in both
17128 // directions.
17129 enum SettingsBindFlags {
17130 DEFAULT = 0,
17131 GET = 1,
17132 SET = 2,
17133 NO_SENSITIVITY = 4,
17134 GET_NO_CHANGES = 8,
17135 INVERT_BOOLEAN = 16
17138 // The type for the function that is used to convert from #GSettings to
17139 // an object property. The @value is already initialized to hold values
17140 // of the appropriate type.
17141 // RETURNS: %TRUE if the conversion succeeded, %FALSE in case of an error
17142 // <value>: return location for the property value
17143 // <variant>: the #GVariant
17144 // <user_data>: user data that was specified when the binding was created
17145 extern (C) alias int function (GObject2.Value* value, GLib2.Variant* variant, void* user_data) SettingsBindGetMapping;
17148 // The type for the function that is used to convert an object property
17149 // value to a #GVariant for storing it in #GSettings.
17150 // RETURNS: a new #GVariant holding the data from @value, or %NULL in case of an error
17151 // <value>: a #GValue containing the property value to map
17152 // <expected_type>: the #GVariantType to create
17153 // <user_data>: user data that was specified when the binding was created
17154 extern (C) alias GLib2.Variant* /*new*/ function (GObject2.Value* value, GLib2.VariantType* expected_type, void* user_data) SettingsBindSetMapping;
17156 struct SettingsClass {
17157 GObject2.ObjectClass parent_class;
17158 extern (C) void function (Settings* settings, char* key) writable_changed;
17159 extern (C) void function (Settings* settings, char* key) changed;
17160 extern (C) int function (Settings* settings, GLib2.Quark key) writable_change_event;
17161 extern (C) int function (Settings* settings, GLib2.Quark* keys, int n_keys) change_event;
17162 void*[20] padding;
17166 // The type of the function that is used to convert from a value stored
17167 // in a #GSettings to a value that is useful to the application.
17169 // If the value is successfully mapped, the result should be stored at
17170 // @result and %TRUE returned. If mapping fails (for example, if @value
17171 // is not in the right format) then %FALSE should be returned.
17173 // If @value is %NULL then it means that the mapping function is being
17174 // given a "last chance" to successfully return a valid value. %TRUE
17175 // must be returned in this case.
17176 // RETURNS: %TRUE if the conversion succeeded, %FALSE in case of an error
17177 // <value>: the #GVariant to map, or %NULL
17178 // <result>: the result of the mapping
17179 // <user_data>: the user data that was passed to g_settings_get_mapped()
17180 extern (C) alias int function (GLib2.Variant* value, /*out*/ void** result, void* user_data) SettingsGetMapping;
17182 struct SettingsPrivate {
17186 // A #GSimpleAction is the obvious simple implementation of the #GAction
17187 // interface. This is the easiest way to create an action for purposes of
17188 // adding it to a #GSimpleActionGroup.
17190 // See also #GtkAction.
17191 struct SimpleAction /* : GObject.Object */ {
17192 mixin Action.__interface__;
17193 alias method_parent this;
17194 alias method_parent super_;
17195 alias method_parent object;
17196 GObject2.Object method_parent;
17199 // VERSION: 2.28
17200 // Creates a new action.
17202 // The created action is stateless. See g_simple_action_new_stateful().
17203 // RETURNS: a new #GSimpleAction
17204 // <name>: the name of the action
17205 // <parameter_type>: the type of parameter to the activate function
17206 static SimpleAction* /*new*/ new_()(char* name, GLib2.VariantType* parameter_type=null) {
17207 return g_simple_action_new(name, parameter_type);
17210 // VERSION: 2.28
17211 // Creates a new stateful action.
17213 // @state is the initial state of the action. All future state values
17214 // must have the same #GVariantType as the initial state.
17216 // If the @state GVariant is floating, it is consumed.
17217 // RETURNS: a new #GSimpleAction
17218 // <name>: the name of the action
17219 // <parameter_type>: the type of the parameter to the activate function
17220 // <state>: the initial state of the action
17221 static SimpleAction* /*new*/ new_stateful()(char* name, GLib2.VariantType* parameter_type, GLib2.Variant* state) {
17222 return g_simple_action_new_stateful(name, parameter_type, state);
17225 // VERSION: 2.28
17226 // Sets the action as enabled or not.
17228 // An action must be enabled in order to be activated or in order to
17229 // have its state changed from outside callers.
17231 // This should only be called by the implementor of the action. Users
17232 // of the action should not attempt to modify its enabled flag.
17233 // <enabled>: whether the action is enabled
17234 void set_enabled()(int enabled) {
17235 g_simple_action_set_enabled(&this, enabled);
17238 // VERSION: 2.30
17239 // Sets the state of the action.
17241 // This directly updates the 'state' property to the given value.
17243 // This should only be called by the implementor of the action. Users
17244 // of the action should not attempt to directly modify the 'state'
17245 // property. Instead, they should call g_action_change_state() to
17246 // request the change.
17247 // <value>: the new #GVariant for the state
17248 void set_state()(GLib2.Variant* value) {
17249 g_simple_action_set_state(&this, value);
17252 // VERSION: 2.28
17253 // Indicates that the action was just activated.
17255 // @parameter will always be of the expected type. In the event that
17256 // an incorrect type was given, no signal will be emitted.
17257 // <parameter>: the parameter to the activation
17258 extern (C) alias static void function (SimpleAction* this_, GLib2.Variant* parameter=null, void* user_data=null) signal_activate;
17260 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
17261 return super_.signal_connect!name(cb, data, cf);
17264 ulong signal_connect(string name:"activate", CB:signal_activate)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
17265 return signal_connect_data!()(&this, cast(char*)"activate",
17266 cast(GObject2.Callback)cb, data, null, cf);
17269 // VERSION: 2.30
17270 // Indicates that the action just received a request to change its
17271 // state.
17273 // @value will always be of the correct state type. In the event that
17274 // an incorrect type was given, no signal will be emitted.
17276 // If no handler is connected to this signal then the default
17277 // behaviour is to call g_simple_action_set_state() to set the state
17278 // to the requested value. If you connect a signal handler then no
17279 // default action is taken. If the state should change then you must
17280 // call g_simple_action_set_state() from the handler.
17282 // <example>
17283 // <title>Example 'change-state' handler</title>
17284 // <programlisting>
17285 // static void
17286 // change_volume_state (GSimpleAction *action,
17287 // GVariant *value,
17288 // gpointer user_data)
17289 // {
17290 // gint requested;
17292 // requested = g_variant_get_int32 (value);
17294 // // Volume only goes from 0 to 10
17295 // if (0 <= requested && requested <= 10)
17296 // g_simple_action_set_state (action, value);
17297 // }
17298 // </programlisting>
17299 // </example>
17301 // The handler need not set the state to the requested value. It
17302 // could set it to any value at all, or take some other action.
17303 // <value>: the requested value for the state
17304 extern (C) alias static void function (SimpleAction* this_, GLib2.Variant* value=null, void* user_data=null) signal_change_state;
17305 ulong signal_connect(string name:"change-state", CB:signal_change_state)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
17306 return signal_connect_data!()(&this, cast(char*)"change-state",
17307 cast(GObject2.Callback)cb, data, null, cf);
17312 // #GSimpleActionGroup is a hash table filled with #GAction objects,
17313 // implementing the #GActionGroup interface.
17314 struct SimpleActionGroup /* : GObject.Object */ /* Version 2.28 */ {
17315 mixin ActionGroup.__interface__;
17316 alias parent_instance this;
17317 alias parent_instance super_;
17318 alias parent_instance object;
17319 GObject2.Object parent_instance;
17320 private SimpleActionGroupPrivate* priv;
17323 // VERSION: 2.28
17324 // Creates a new, empty, #GSimpleActionGroup.
17325 // RETURNS: a new #GSimpleActionGroup
17326 static SimpleActionGroup* /*new*/ new_()() {
17327 return g_simple_action_group_new();
17330 // VERSION: 2.30
17331 // A convenience function for creating multiple #GSimpleAction instances
17332 // and adding them to the action group.
17334 // Each action is constructed as per one #GActionEntry.
17336 // <example>
17337 // <title>Using g_simple_action_group_add_entries()</title>
17338 // <programlisting>
17339 // static void
17340 // activate_quit (GSimpleAction *simple,
17341 // GVariant *parameter,
17342 // gpointer user_data)
17343 // {
17344 // exit (0);
17345 // }
17347 // static void
17348 // activate_print_string (GSimpleAction *simple,
17349 // GVariant *parameter,
17350 // gpointer user_data)
17351 // {
17352 // g_print ("%s\n", g_variant_get_string (parameter, NULL));
17353 // }
17355 // static GActionGroup *
17356 // create_action_group (void)
17357 // {
17358 // const GActionEntry entries[] = {
17359 // { "quit", activate_quit },
17360 // { "print-string", activate_print_string, "s" }
17361 // };
17362 // GSimpleActionGroup *group;
17364 // group = g_simple_action_group_new ();
17365 // g_simple_action_group_add_entries (group, entries, G_N_ELEMENTS (entries), NULL);
17367 // return G_ACTION_GROUP (group);
17368 // }
17369 // </programlisting>
17370 // </example>
17371 // <entries>: a pointer to the first item in an array of #GActionEntry structs
17372 // <n_entries>: the length of @entries, or -1
17373 // <user_data>: the user data for signal connections
17374 void add_entries()(ActionEntry* entries, int n_entries, void* user_data) {
17375 g_simple_action_group_add_entries(&this, entries, n_entries, user_data);
17378 // VERSION: 2.28
17379 // Adds an action to the action group.
17381 // If the action group already contains an action with the same name as
17382 // @action then the old action is dropped from the group.
17384 // The action group takes its own reference on @action.
17385 // <action>: a #GAction
17386 void insert()(Action* action) {
17387 g_simple_action_group_insert(&this, action);
17390 // VERSION: 2.28
17391 // Looks up the action with the name @action_name in the group.
17393 // If no such action exists, returns %NULL.
17394 // RETURNS: a #GAction, or %NULL
17395 // <action_name>: the name of an action
17396 Action* lookup()(char* action_name) {
17397 return g_simple_action_group_lookup(&this, action_name);
17400 // VERSION: 2.28
17401 // Removes the named action from the action group.
17403 // If no action of this name is in the group then nothing happens.
17404 // <action_name>: the name of the action
17405 void remove()(char* action_name) {
17406 g_simple_action_group_remove(&this, action_name);
17410 struct SimpleActionGroupClass {
17411 private GObject2.ObjectClass parent_class;
17412 private void*[12] padding;
17415 struct SimpleActionGroupPrivate {
17419 // Implements #GAsyncResult for simple cases. Most of the time, this
17420 // will be all an application needs, and will be used transparently.
17421 // Because of this, #GSimpleAsyncResult is used throughout GIO for
17422 // handling asynchronous functions.
17424 // GSimpleAsyncResult handles #GAsyncReadyCallback<!-- -->s, error
17425 // reporting, operation cancellation and the final state of an operation,
17426 // completely transparent to the application. Results can be returned
17427 // as a pointer e.g. for functions that return data that is collected
17428 // asynchronously, a boolean value for checking the success or failure
17429 // of an operation, or a #gssize for operations which return the number
17430 // of bytes modified by the operation; all of the simple return cases
17431 // are covered.
17433 // Most of the time, an application will not need to know of the details
17434 // of this API; it is handled transparently, and any necessary operations
17435 // are handled by #GAsyncResult's interface. However, if implementing a
17436 // new GIO module, for writing language bindings, or for complex
17437 // applications that need better control of how asynchronous operations
17438 // are completed, it is important to understand this functionality.
17440 // GSimpleAsyncResults are tagged with the calling function to ensure
17441 // that asynchronous functions and their finishing functions are used
17442 // together correctly.
17444 // To create a new #GSimpleAsyncResult, call g_simple_async_result_new().
17445 // If the result needs to be created for a #GError, use
17446 // g_simple_async_result_new_from_error() or
17447 // g_simple_async_result_new_take_error(). If a #GError is not available
17448 // (e.g. the asynchronous operation's doesn't take a #GError argument),
17449 // but the result still needs to be created for an error condition, use
17450 // g_simple_async_result_new_error() (or g_simple_async_result_set_error_va()
17451 // if your application or binding requires passing a variable argument list
17452 // directly), and the error can then be propagated through the use of
17453 // g_simple_async_result_propagate_error().
17455 // An asynchronous operation can be made to ignore a cancellation event by
17456 // calling g_simple_async_result_set_handle_cancellation() with a
17457 // #GSimpleAsyncResult for the operation and %FALSE. This is useful for
17458 // operations that are dangerous to cancel, such as close (which would
17459 // cause a leak if cancelled before being run).
17461 // GSimpleAsyncResult can integrate into GLib's event loop, #GMainLoop,
17462 // or it can use #GThread<!-- -->s if available.
17463 // g_simple_async_result_complete() will finish an I/O task directly
17464 // from the point where it is called. g_simple_async_result_complete_in_idle()
17465 // will finish it from an idle handler in the <link
17466 // linkend="g-main-context-push-thread-default">thread-default main
17467 // context</link>. g_simple_async_result_run_in_thread() will run the
17468 // job in a separate thread and then deliver the result to the
17469 // thread-default main context.
17471 // To set the results of an asynchronous function,
17472 // g_simple_async_result_set_op_res_gpointer(),
17473 // g_simple_async_result_set_op_res_gboolean(), and
17474 // g_simple_async_result_set_op_res_gssize()
17475 // are provided, setting the operation's result to a gpointer, gboolean, or
17476 // gssize, respectively.
17478 // Likewise, to get the result of an asynchronous function,
17479 // g_simple_async_result_get_op_res_gpointer(),
17480 // g_simple_async_result_get_op_res_gboolean(), and
17481 // g_simple_async_result_get_op_res_gssize() are
17482 // provided, getting the operation's result as a gpointer, gboolean, and
17483 // gssize, respectively.
17485 // For the details of the requirements implementations must respect, see
17486 // #GAsyncResult. A typical implementation of an asynchronous operation
17487 // using GSimpleAsyncResult looks something like this:
17489 // |[
17490 // static void
17491 // baked_cb (Cake *cake,
17492 // gpointer user_data)
17493 // {
17494 // /&ast; In this example, this callback is not given a reference to the cake, so
17495 // &ast; the GSimpleAsyncResult has to take a reference to it.
17496 // &ast;/
17497 // GSimpleAsyncResult *result = user_data;
17499 // if (cake == NULL)
17500 // g_simple_async_result_set_error (result,
17501 // BAKER_ERRORS,
17502 // BAKER_ERROR_NO_FLOUR,
17503 // "Go to the supermarket");
17504 // else
17505 // g_simple_async_result_set_op_res_gpointer (result,
17506 // g_object_ref (cake),
17507 // g_object_unref);
17510 // /&ast; In this example, we assume that baked_cb is called as a callback from
17511 // &ast; the mainloop, so it's safe to complete the operation synchronously here.
17512 // &ast; If, however, _baker_prepare_cake () might call its callback without
17513 // &ast; first returning to the mainloop — inadvisable, but some APIs do so —
17514 // &ast; we would need to use g_simple_async_result_complete_in_idle().
17515 // &ast;/
17516 // g_simple_async_result_complete (result);
17517 // g_object_unref (result);
17518 // }
17520 // void
17521 // baker_bake_cake_async (Baker *self,
17522 // guint radius,
17523 // GAsyncReadyCallback callback,
17524 // gpointer user_data)
17525 // {
17526 // GSimpleAsyncResult *simple;
17527 // Cake *cake;
17529 // if (radius < 3)
17530 // {
17531 // g_simple_async_report_error_in_idle (G_OBJECT (self),
17532 // callback,
17533 // user_data,
17534 // BAKER_ERRORS,
17535 // BAKER_ERROR_TOO_SMALL,
17536 // "%ucm radius cakes are silly",
17537 // radius);
17538 // return;
17539 // }
17541 // simple = g_simple_async_result_new (G_OBJECT (self),
17542 // callback,
17543 // user_data,
17544 // baker_bake_cake_async);
17545 // cake = _baker_get_cached_cake (self, radius);
17547 // if (cake != NULL)
17548 // {
17549 // g_simple_async_result_set_op_res_gpointer (simple,
17550 // g_object_ref (cake),
17551 // g_object_unref);
17552 // g_simple_async_result_complete_in_idle (simple);
17553 // g_object_unref (simple);
17554 // /&ast; Drop the reference returned by _baker_get_cached_cake(); the
17555 // &ast; GSimpleAsyncResult has taken its own reference.
17556 // &ast;/
17557 // g_object_unref (cake);
17558 // return;
17559 // }
17561 // _baker_prepare_cake (self, radius, baked_cb, simple);
17562 // }
17564 // Cake *
17565 // baker_bake_cake_finish (Baker *self,
17566 // GAsyncResult *result,
17567 // GError **error)
17568 // {
17569 // GSimpleAsyncResult *simple;
17570 // Cake *cake;
17572 // g_return_val_if_fail (g_simple_async_result_is_valid (result,
17573 // G_OBJECT (self),
17574 // baker_bake_cake_async),
17575 // NULL);
17577 // simple = (GSimpleAsyncResult *) result;
17579 // if (g_simple_async_result_propagate_error (simple, error))
17580 // return NULL;
17582 // cake = CAKE (g_simple_async_result_get_op_res_gpointer (simple));
17583 // return g_object_ref (cake);
17584 // }
17585 // ]|
17586 struct SimpleAsyncResult /* : GObject.Object */ {
17587 mixin AsyncResult.__interface__;
17588 alias method_parent this;
17589 alias method_parent super_;
17590 alias method_parent object;
17591 GObject2.Object method_parent;
17594 // Creates a #GSimpleAsyncResult.
17595 // RETURNS: a #GSimpleAsyncResult.
17596 // <source_object>: a #GObject, or %NULL.
17597 // <callback>: a #GAsyncReadyCallback.
17598 // <user_data>: user data passed to @callback.
17599 // <source_tag>: the asynchronous function.
17600 static SimpleAsyncResult* /*new*/ new_()(GObject2.Object* source_object, AsyncReadyCallback callback, void* user_data, void* source_tag) {
17601 return g_simple_async_result_new(source_object, callback, user_data, source_tag);
17604 // Unintrospectable constructor: new_error() / g_simple_async_result_new_error()
17605 // Creates a new #GSimpleAsyncResult with a set error.
17606 // RETURNS: a #GSimpleAsyncResult.
17607 // <source_object>: a #GObject, or %NULL.
17608 // <callback>: a #GAsyncReadyCallback.
17609 // <user_data>: user data passed to @callback.
17610 // <domain>: a #GQuark.
17611 // <code>: an error code.
17612 // <format>: a string with format characters.
17613 alias g_simple_async_result_new_error new_error; // Variadic
17615 // Creates a #GSimpleAsyncResult from an error condition.
17616 // RETURNS: a #GSimpleAsyncResult.
17617 // <source_object>: a #GObject, or %NULL.
17618 // <callback>: a #GAsyncReadyCallback.
17619 // <user_data>: user data passed to @callback.
17620 // <error>: a #GError
17621 static SimpleAsyncResult* /*new*/ new_from_error()(GObject2.Object* source_object, AsyncReadyCallback callback, void* user_data, GLib2.Error* error) {
17622 return g_simple_async_result_new_from_error(source_object, callback, user_data, error);
17625 // Unintrospectable constructor: new_take_error() / g_simple_async_result_new_take_error()
17626 // VERSION: 2.28
17627 // Creates a #GSimpleAsyncResult from an error condition, and takes over the
17628 // caller's ownership of @error, so the caller does not need to free it anymore.
17629 // RETURNS: a #GSimpleAsyncResult
17630 // <source_object>: a #GObject, or %NULL
17631 // <callback>: a #GAsyncReadyCallback
17632 // <user_data>: user data passed to @callback
17633 // <error>: a #GError
17634 static SimpleAsyncResult* /*new*/ new_take_error()(GObject2.Object* source_object, AsyncReadyCallback callback, void* user_data, GLib2.Error* error) {
17635 return g_simple_async_result_new_take_error(source_object, callback, user_data, error);
17638 // VERSION: 2.20
17639 // Ensures that the data passed to the _finish function of an async
17640 // operation is consistent. Three checks are performed.
17642 // First, @result is checked to ensure that it is really a
17643 // #GSimpleAsyncResult. Second, @source is checked to ensure that it
17644 // matches the source object of @result. Third, @source_tag is
17645 // checked to ensure that it is either %NULL (as it is when the result was
17646 // created by g_simple_async_report_error_in_idle() or
17647 // g_simple_async_report_gerror_in_idle()) or equal to the
17648 // @source_tag argument given to g_simple_async_result_new() (which, by
17649 // convention, is a pointer to the _async function corresponding to the
17650 // _finish function from which this function is called).
17651 // RETURNS: #TRUE if all checks passed or #FALSE if any failed.
17652 // <result>: the #GAsyncResult passed to the _finish function.
17653 // <source>: the #GObject passed to the _finish function.
17654 // <source_tag>: the asynchronous function.
17655 static int is_valid()(AsyncResult* result, GObject2.Object* source, void* source_tag) {
17656 return g_simple_async_result_is_valid(result, source, source_tag);
17659 // Completes an asynchronous I/O job immediately. Must be called in
17660 // the thread where the asynchronous result was to be delivered, as it
17661 // invokes the callback directly. If you are in a different thread use
17662 // g_simple_async_result_complete_in_idle().
17664 // Calling this function takes a reference to @simple for as long as
17665 // is needed to complete the call.
17666 void complete()() {
17667 g_simple_async_result_complete(&this);
17670 // Completes an asynchronous function in an idle handler in the <link
17671 // linkend="g-main-context-push-thread-default">thread-default main
17672 // loop</link> of the thread that @simple was initially created in.
17674 // Calling this function takes a reference to @simple for as long as
17675 // is needed to complete the call.
17676 void complete_in_idle()() {
17677 g_simple_async_result_complete_in_idle(&this);
17680 // Gets the operation result boolean from within the asynchronous result.
17682 // if the operation's result was %FALSE.
17683 // RETURNS: %TRUE if the operation's result was %TRUE, %FALSE
17684 int get_op_res_gboolean()() {
17685 return g_simple_async_result_get_op_res_gboolean(&this);
17688 // Unintrospectable method: get_op_res_gpointer() / g_simple_async_result_get_op_res_gpointer()
17689 // Gets a pointer result as returned by the asynchronous function.
17690 // RETURNS: a pointer from the result.
17691 void* get_op_res_gpointer()() {
17692 return g_simple_async_result_get_op_res_gpointer(&this);
17695 // Gets a gssize from the asynchronous result.
17696 // RETURNS: a gssize returned from the asynchronous function.
17697 ssize_t get_op_res_gssize()() {
17698 return g_simple_async_result_get_op_res_gssize(&this);
17701 // Unintrospectable method: get_source_tag() / g_simple_async_result_get_source_tag()
17702 // Gets the source tag for the #GSimpleAsyncResult.
17703 // RETURNS: a #gpointer to the source object for the #GSimpleAsyncResult.
17704 void* get_source_tag()() {
17705 return g_simple_async_result_get_source_tag(&this);
17708 // Propagates an error from within the simple asynchronous result to
17709 // a given destination.
17710 // RETURNS: %TRUE if the error was propagated to @dest. %FALSE otherwise.
17711 int propagate_error()(GLib2.Error** error=null) {
17712 return g_simple_async_result_propagate_error(&this, error);
17715 // Unintrospectable method: run_in_thread() / g_simple_async_result_run_in_thread()
17716 // Runs the asynchronous job in a separate thread and then calls
17717 // g_simple_async_result_complete_in_idle() on @simple to return
17718 // the result to the appropriate main loop.
17720 // Calling this function takes a reference to @simple for as long as
17721 // is needed to run the job and report its completion.
17722 // <func>: a #GSimpleAsyncThreadFunc.
17723 // <io_priority>: the io priority of the request.
17724 // <cancellable>: optional #GCancellable object, %NULL to ignore.
17725 void run_in_thread()(SimpleAsyncThreadFunc func, int io_priority, Cancellable* cancellable=null) {
17726 g_simple_async_result_run_in_thread(&this, func, io_priority, cancellable);
17729 // Unintrospectable method: set_error() / g_simple_async_result_set_error()
17730 // Sets an error within the asynchronous result without a #GError.
17731 // <domain>: a #GQuark (usually #G_IO_ERROR).
17732 // <code>: an error code.
17733 // <format>: a formatted error reporting string.
17734 /+ Not available -- variadic methods unsupported - use the C function directly.
17735 alias g_simple_async_result_set_error set_error; // Variadic
17738 // Unintrospectable method: set_error_va() / g_simple_async_result_set_error_va()
17739 // Sets an error within the asynchronous result without a #GError.
17740 // Unless writing a binding, see g_simple_async_result_set_error().
17741 // <domain>: a #GQuark (usually #G_IO_ERROR).
17742 // <code>: an error code.
17743 // <format>: a formatted error reporting string.
17744 // <args>: va_list of arguments.
17745 void set_error_va()(GLib2.Quark domain, int code, char* format, va_list args) {
17746 g_simple_async_result_set_error_va(&this, domain, code, format, args);
17749 // Sets the result from a #GError.
17750 // <error>: #GError.
17751 void set_from_error()(GLib2.Error* error) {
17752 g_simple_async_result_set_from_error(&this, error);
17755 // Sets whether to handle cancellation within the asynchronous operation.
17756 // <handle_cancellation>: a #gboolean.
17757 void set_handle_cancellation()(int handle_cancellation) {
17758 g_simple_async_result_set_handle_cancellation(&this, handle_cancellation);
17761 // Sets the operation result to a boolean within the asynchronous result.
17762 // <op_res>: a #gboolean.
17763 void set_op_res_gboolean()(int op_res) {
17764 g_simple_async_result_set_op_res_gboolean(&this, op_res);
17767 // Unintrospectable method: set_op_res_gpointer() / g_simple_async_result_set_op_res_gpointer()
17768 // Sets the operation result within the asynchronous result to a pointer.
17769 // <op_res>: a pointer result from an asynchronous function.
17770 // <destroy_op_res>: a #GDestroyNotify function.
17771 void set_op_res_gpointer()(void* op_res, GLib2.DestroyNotify destroy_op_res) {
17772 g_simple_async_result_set_op_res_gpointer(&this, op_res, destroy_op_res);
17775 // Sets the operation result within the asynchronous result to
17776 // the given @op_res.
17777 // <op_res>: a #gssize.
17778 void set_op_res_gssize()(ssize_t op_res) {
17779 g_simple_async_result_set_op_res_gssize(&this, op_res);
17782 // Unintrospectable method: take_error() / g_simple_async_result_take_error()
17783 // VERSION: 2.28
17784 // Sets the result from @error, and takes over the caller's ownership
17785 // of @error, so the caller does not need to free it any more.
17786 // <error>: a #GError
17787 void take_error()(GLib2.Error* error) {
17788 g_simple_async_result_take_error(&this, error);
17792 struct SimpleAsyncResultClass {
17796 // Simple thread function that runs an asynchronous operation and
17797 // checks for cancellation.
17798 // <res>: a #GSimpleAsyncResult.
17799 // <object>: a #GObject.
17800 // <cancellable>: optional #GCancellable object, %NULL to ignore.
17801 extern (C) alias void function (SimpleAsyncResult* res, GObject2.Object* object, Cancellable* cancellable=null) SimpleAsyncThreadFunc;
17804 // #GSimplePermission is a trivial implementation of #GPermission that
17805 // represents a permission that is either always or never allowed. The
17806 // value is given at construction and doesn't change.
17808 // Calling request or release will result in errors.
17809 struct SimplePermission /* : Permission */ {
17810 alias method_parent this;
17811 alias method_parent super_;
17812 alias method_parent permission;
17813 Permission method_parent;
17816 // VERSION: 2.26
17817 // Creates a new #GPermission instance that represents an action that is
17818 // either always or never allowed.
17819 // RETURNS: the #GSimplePermission, as a #GPermission
17820 // <allowed>: %TRUE if the action is allowed
17821 static SimplePermission* /*new*/ new_()(int allowed) {
17822 return g_simple_permission_new(allowed);
17827 // A #GSocket is a low-level networking primitive. It is a more or less
17828 // direct mapping of the BSD socket API in a portable GObject based API.
17829 // It supports both the UNIX socket implementations and winsock2 on Windows.
17831 // #GSocket is the platform independent base upon which the higher level
17832 // network primitives are based. Applications are not typically meant to
17833 // use it directly, but rather through classes like #GSocketClient,
17834 // #GSocketService and #GSocketConnection. However there may be cases where
17835 // direct use of #GSocket is useful.
17837 // #GSocket implements the #GInitable interface, so if it is manually constructed
17838 // by e.g. g_object_new() you must call g_initable_init() and check the
17839 // results before using the object. This is done automatically in
17840 // g_socket_new() and g_socket_new_from_fd(), so these functions can return
17841 // %NULL.
17843 // Sockets operate in two general modes, blocking or non-blocking. When
17844 // in blocking mode all operations block until the requested operation
17845 // is finished or there is an error. In non-blocking mode all calls that
17846 // would block return immediately with a %G_IO_ERROR_WOULD_BLOCK error.
17847 // To know when a call would successfully run you can call g_socket_condition_check(),
17848 // or g_socket_condition_wait(). You can also use g_socket_create_source() and
17849 // attach it to a #GMainContext to get callbacks when I/O is possible.
17850 // Note that all sockets are always set to non blocking mode in the system, and
17851 // blocking mode is emulated in GSocket.
17853 // When working in non-blocking mode applications should always be able to
17854 // handle getting a %G_IO_ERROR_WOULD_BLOCK error even when some other
17855 // function said that I/O was possible. This can easily happen in case
17856 // of a race condition in the application, but it can also happen for other
17857 // reasons. For instance, on Windows a socket is always seen as writable
17858 // until a write returns %G_IO_ERROR_WOULD_BLOCK.
17860 // #GSocket<!-- -->s can be either connection oriented or datagram based.
17861 // For connection oriented types you must first establish a connection by
17862 // either connecting to an address or accepting a connection from another
17863 // address. For connectionless socket types the target/source address is
17864 // specified or received in each I/O operation.
17866 // All socket file descriptors are set to be close-on-exec.
17868 // Note that creating a #GSocket causes the signal %SIGPIPE to be
17869 // ignored for the remainder of the program. If you are writing a
17870 // command-line utility that uses #GSocket, you may need to take into
17871 // account the fact that your program will not automatically be killed
17872 // if it tries to write to %stdout after it has been closed.
17873 struct Socket /* : GObject.Object */ /* Version 2.22 */ {
17874 mixin Initable.__interface__;
17875 alias parent_instance this;
17876 alias parent_instance super_;
17877 alias parent_instance object;
17878 GObject2.Object parent_instance;
17879 SocketPrivate* priv;
17882 // VERSION: 2.22
17883 // Creates a new #GSocket with the defined family, type and protocol.
17884 // If @protocol is 0 (%G_SOCKET_PROTOCOL_DEFAULT) the default protocol type
17885 // for the family and type is used.
17887 // The @protocol is a family and type specific int that specifies what
17888 // kind of protocol to use. #GSocketProtocol lists several common ones.
17889 // Many families only support one protocol, and use 0 for this, others
17890 // support several and using 0 means to use the default protocol for
17891 // the family and type.
17893 // The protocol id is passed directly to the operating
17894 // system, so you can use protocols not listed in #GSocketProtocol if you
17895 // know the protocol number used for it.
17897 // Free the returned object with g_object_unref().
17898 // RETURNS: a #GSocket or %NULL on error.
17899 // <family>: the socket family to use, e.g. %G_SOCKET_FAMILY_IPV4.
17900 // <type>: the socket type to use.
17901 // <protocol>: the id of the protocol to use, or 0 for default.
17902 static Socket* /*new*/ new_()(SocketFamily family, SocketType type, SocketProtocol protocol, GLib2.Error** error=null) {
17903 return g_socket_new(family, type, protocol, error);
17906 // VERSION: 2.22
17907 // Creates a new #GSocket from a native file descriptor
17908 // or winsock SOCKET handle.
17910 // This reads all the settings from the file descriptor so that
17911 // all properties should work. Note that the file descriptor
17912 // will be set to non-blocking mode, independent on the blocking
17913 // mode of the #GSocket.
17915 // Free the returned object with g_object_unref().
17916 // RETURNS: a #GSocket or %NULL on error.
17917 // <fd>: a native socket file descriptor.
17918 static Socket* /*new*/ new_from_fd()(int fd, GLib2.Error** error=null) {
17919 return g_socket_new_from_fd(fd, error);
17922 // VERSION: 2.22
17923 // Accept incoming connections on a connection-based socket. This removes
17924 // the first outstanding connection request from the listening socket and
17925 // creates a #GSocket object for it.
17927 // The @socket must be bound to a local address with g_socket_bind() and
17928 // must be listening for incoming connections (g_socket_listen()).
17930 // If there are no outstanding connections then the operation will block
17931 // or return %G_IO_ERROR_WOULD_BLOCK if non-blocking I/O is enabled.
17932 // To be notified of an incoming connection, wait for the %G_IO_IN condition.
17934 // Free the returned object with g_object_unref().
17935 // RETURNS: a new #GSocket, or %NULL on error.
17936 // <cancellable>: a %GCancellable or %NULL
17937 Socket* /*new*/ accept()(Cancellable* cancellable, GLib2.Error** error=null) {
17938 return g_socket_accept(&this, cancellable, error);
17941 // VERSION: 2.22
17942 // When a socket is created it is attached to an address family, but it
17943 // doesn't have an address in this family. g_socket_bind() assigns the
17944 // address (sometimes called name) of the socket.
17946 // It is generally required to bind to a local address before you can
17947 // receive connections. (See g_socket_listen() and g_socket_accept() ).
17948 // In certain situations, you may also want to bind a socket that will be
17949 // used to initiate connections, though this is not normally required.
17951 // @allow_reuse should be %TRUE for server sockets (sockets that you will
17952 // eventually call g_socket_accept() on), and %FALSE for client sockets.
17953 // (Specifically, if it is %TRUE, then g_socket_bind() will set the
17954 // %SO_REUSEADDR flag on the socket, allowing it to bind @address even if
17955 // that address was previously used by another socket that has not yet been
17956 // fully cleaned-up by the kernel. Failing to set this flag on a server
17957 // socket may cause the bind call to return %G_IO_ERROR_ADDRESS_IN_USE if
17958 // the server program is stopped and then immediately restarted.)
17959 // RETURNS: %TRUE on success, %FALSE on error.
17960 // <address>: a #GSocketAddress specifying the local address.
17961 // <allow_reuse>: whether to allow reusing this address
17962 int bind()(SocketAddress* address, int allow_reuse, GLib2.Error** error=null) {
17963 return g_socket_bind(&this, address, allow_reuse, error);
17966 // VERSION: 2.22
17967 // Checks and resets the pending connect error for the socket.
17968 // This is used to check for errors when g_socket_connect() is
17969 // used in non-blocking mode.
17970 // RETURNS: %TRUE if no error, %FALSE otherwise, setting @error to the error
17971 int check_connect_result()(GLib2.Error** error=null) {
17972 return g_socket_check_connect_result(&this, error);
17975 // VERSION: 2.22
17976 // Closes the socket, shutting down any active connection.
17978 // Closing a socket does not wait for all outstanding I/O operations
17979 // to finish, so the caller should not rely on them to be guaranteed
17980 // to complete even if the close returns with no error.
17982 // Once the socket is closed, all other operations will return
17983 // %G_IO_ERROR_CLOSED. Closing a socket multiple times will not
17984 // return an error.
17986 // Sockets will be automatically closed when the last reference
17987 // is dropped, but you might want to call this function to make sure
17988 // resources are released as early as possible.
17990 // Beware that due to the way that TCP works, it is possible for
17991 // recently-sent data to be lost if either you close a socket while the
17992 // %G_IO_IN condition is set, or else if the remote connection tries to
17993 // send something to you after you close the socket but before it has
17994 // finished reading all of the data you sent. There is no easy generic
17995 // way to avoid this problem; the easiest fix is to design the network
17996 // protocol such that the client will never send data "out of turn".
17997 // Another solution is for the server to half-close the connection by
17998 // calling g_socket_shutdown() with only the @shutdown_write flag set,
17999 // and then wait for the client to notice this and close its side of the
18000 // connection, after which the server can safely call g_socket_close().
18001 // (This is what #GTcpConnection does if you call
18002 // g_tcp_connection_set_graceful_disconnect(). But of course, this
18003 // only works if the client will close its connection after the server
18004 // does.)
18005 // RETURNS: %TRUE on success, %FALSE on error
18006 int close()(GLib2.Error** error=null) {
18007 return g_socket_close(&this, error);
18010 // VERSION: 2.22
18011 // Checks on the readiness of @socket to perform operations.
18012 // The operations specified in @condition are checked for and masked
18013 // against the currently-satisfied conditions on @socket. The result
18014 // is returned.
18016 // Note that on Windows, it is possible for an operation to return
18017 // %G_IO_ERROR_WOULD_BLOCK even immediately after
18018 // g_socket_condition_check() has claimed that the socket is ready for
18019 // writing. Rather than calling g_socket_condition_check() and then
18020 // writing to the socket if it succeeds, it is generally better to
18021 // simply try writing to the socket right away, and try again later if
18022 // the initial attempt returns %G_IO_ERROR_WOULD_BLOCK.
18024 // It is meaningless to specify %G_IO_ERR or %G_IO_HUP in condition;
18025 // these conditions will always be set in the output if they are true.
18027 // This call never blocks.
18028 // RETURNS: the @GIOCondition mask of the current state
18029 // <condition>: a #GIOCondition mask to check
18030 GLib2.IOCondition condition_check()(GLib2.IOCondition condition) {
18031 return g_socket_condition_check(&this, condition);
18034 // VERSION: 2.22
18035 // Waits for @condition to become true on @socket. When the condition
18036 // is met, %TRUE is returned.
18038 // If @cancellable is cancelled before the condition is met, or if the
18039 // socket has a timeout set and it is reached before the condition is
18040 // met, then %FALSE is returned and @error, if non-%NULL, is set to
18041 // the appropriate value (%G_IO_ERROR_CANCELLED or
18042 // %G_IO_ERROR_TIMED_OUT).
18043 // RETURNS: %TRUE if the condition was met, %FALSE otherwise
18044 // <condition>: a #GIOCondition mask to wait for
18045 // <cancellable>: a #GCancellable, or %NULL
18046 int condition_wait()(GLib2.IOCondition condition, Cancellable* cancellable, GLib2.Error** error=null) {
18047 return g_socket_condition_wait(&this, condition, cancellable, error);
18050 // VERSION: 2.22
18051 // Connect the socket to the specified remote address.
18053 // For connection oriented socket this generally means we attempt to make
18054 // a connection to the @address. For a connection-less socket it sets
18055 // the default address for g_socket_send() and discards all incoming datagrams
18056 // from other sources.
18058 // Generally connection oriented sockets can only connect once, but
18059 // connection-less sockets can connect multiple times to change the
18060 // default address.
18062 // If the connect call needs to do network I/O it will block, unless
18063 // non-blocking I/O is enabled. Then %G_IO_ERROR_PENDING is returned
18064 // and the user can be notified of the connection finishing by waiting
18065 // for the G_IO_OUT condition. The result of the connection must then be
18066 // checked with g_socket_check_connect_result().
18067 // RETURNS: %TRUE if connected, %FALSE on error.
18068 // <address>: a #GSocketAddress specifying the remote address.
18069 // <cancellable>: a %GCancellable or %NULL
18070 int connect()(SocketAddress* address, Cancellable* cancellable, GLib2.Error** error=null) {
18071 return g_socket_connect(&this, address, cancellable, error);
18074 // VERSION: 2.22
18075 // Creates a #GSocketConnection subclass of the right type for
18076 // @socket.
18077 // RETURNS: a #GSocketConnection
18078 SocketConnection* /*new*/ connection_factory_create_connection()() {
18079 return g_socket_connection_factory_create_connection(&this);
18082 // Unintrospectable method: create_source() / g_socket_create_source()
18083 // VERSION: 2.22
18084 // Creates a %GSource that can be attached to a %GMainContext to monitor
18085 // for the availibility of the specified @condition on the socket.
18087 // The callback on the source is of the #GSocketSourceFunc type.
18089 // It is meaningless to specify %G_IO_ERR or %G_IO_HUP in @condition;
18090 // these conditions will always be reported output if they are true.
18092 // @cancellable if not %NULL can be used to cancel the source, which will
18093 // cause the source to trigger, reporting the current condition (which
18094 // is likely 0 unless cancellation happened at the same time as a
18095 // condition change). You can check for this in the callback using
18096 // g_cancellable_is_cancelled().
18098 // If @socket has a timeout set, and it is reached before @condition
18099 // occurs, the source will then trigger anyway, reporting %G_IO_IN or
18100 // %G_IO_OUT depending on @condition. However, @socket will have been
18101 // marked as having had a timeout, and so the next #GSocket I/O method
18102 // you call will then fail with a %G_IO_ERROR_TIMED_OUT.
18103 // RETURNS: a newly allocated %GSource, free with g_source_unref().
18104 // <condition>: a #GIOCondition mask to monitor
18105 // <cancellable>: a %GCancellable or %NULL
18106 GLib2.Source* /*new*/ create_source()(GLib2.IOCondition condition, Cancellable* cancellable=null) {
18107 return g_socket_create_source(&this, condition, cancellable);
18110 // VERSION: 2.22
18111 // Gets the blocking mode of the socket. For details on blocking I/O,
18112 // see g_socket_set_blocking().
18113 // RETURNS: %TRUE if blocking I/O is used, %FALSE otherwise.
18114 int get_blocking()() {
18115 return g_socket_get_blocking(&this);
18118 // VERSION: 2.26
18119 // Returns the credentials of the foreign process connected to this
18120 // socket, if any (e.g. it is only supported for %G_SOCKET_FAMILY_UNIX
18121 // sockets).
18123 // If this operation isn't supported on the OS, the method fails with
18124 // the %G_IO_ERROR_NOT_SUPPORTED error. On Linux this is implemented
18125 // by reading the %SO_PEERCRED option on the underlying socket.
18127 // Other ways to obtain credentials from a foreign peer includes the
18128 // #GUnixCredentialsMessage type and
18129 // g_unix_connection_send_credentials() /
18130 // g_unix_connection_receive_credentials() functions.
18132 // that must be freed with g_object_unref().
18133 // RETURNS: %NULL if @error is set, otherwise a #GCredentials object
18134 Credentials* /*new*/ get_credentials()(GLib2.Error** error=null) {
18135 return g_socket_get_credentials(&this, error);
18138 // VERSION: 2.22
18139 // Gets the socket family of the socket.
18140 // RETURNS: a #GSocketFamily
18141 SocketFamily get_family()() {
18142 return g_socket_get_family(&this);
18145 // VERSION: 2.22
18146 // Returns the underlying OS socket object. On unix this
18147 // is a socket file descriptor, and on windows this is
18148 // a Winsock2 SOCKET handle. This may be useful for
18149 // doing platform specific or otherwise unusual operations
18150 // on the socket.
18151 // RETURNS: the file descriptor of the socket.
18152 int get_fd()() {
18153 return g_socket_get_fd(&this);
18156 // VERSION: 2.22
18157 // Gets the keepalive mode of the socket. For details on this,
18158 // see g_socket_set_keepalive().
18159 // RETURNS: %TRUE if keepalive is active, %FALSE otherwise.
18160 int get_keepalive()() {
18161 return g_socket_get_keepalive(&this);
18164 // VERSION: 2.22
18165 // Gets the listen backlog setting of the socket. For details on this,
18166 // see g_socket_set_listen_backlog().
18167 // RETURNS: the maximum number of pending connections.
18168 int get_listen_backlog()() {
18169 return g_socket_get_listen_backlog(&this);
18172 // VERSION: 2.22
18173 // Try to get the local address of a bound socket. This is only
18174 // useful if the socket has been bound to a local address,
18175 // either explicitly or implicitly when connecting.
18177 // Free the returned object with g_object_unref().
18178 // RETURNS: a #GSocketAddress or %NULL on error.
18179 SocketAddress* /*new*/ get_local_address()(GLib2.Error** error=null) {
18180 return g_socket_get_local_address(&this, error);
18183 // VERSION: 2.22
18184 // Gets the socket protocol id the socket was created with.
18185 // In case the protocol is unknown, -1 is returned.
18186 // RETURNS: a protocol id, or -1 if unknown
18187 SocketProtocol get_protocol()() {
18188 return g_socket_get_protocol(&this);
18191 // VERSION: 2.22
18192 // Try to get the remove address of a connected socket. This is only
18193 // useful for connection oriented sockets that have been connected.
18195 // Free the returned object with g_object_unref().
18196 // RETURNS: a #GSocketAddress or %NULL on error.
18197 SocketAddress* /*new*/ get_remote_address()(GLib2.Error** error=null) {
18198 return g_socket_get_remote_address(&this, error);
18201 // VERSION: 2.22
18202 // Gets the socket type of the socket.
18203 // RETURNS: a #GSocketType
18204 SocketType get_socket_type()() {
18205 return g_socket_get_socket_type(&this);
18208 // VERSION: 2.26
18209 // Gets the timeout setting of the socket. For details on this, see
18210 // g_socket_set_timeout().
18211 // RETURNS: the timeout in seconds
18212 uint get_timeout()() {
18213 return g_socket_get_timeout(&this);
18216 // VERSION: 2.22
18217 // Checks whether a socket is closed.
18218 // RETURNS: %TRUE if socket is closed, %FALSE otherwise
18219 int is_closed()() {
18220 return g_socket_is_closed(&this);
18223 // VERSION: 2.22
18224 // Check whether the socket is connected. This is only useful for
18225 // connection-oriented sockets.
18226 // RETURNS: %TRUE if socket is connected, %FALSE otherwise.
18227 int is_connected()() {
18228 return g_socket_is_connected(&this);
18231 // VERSION: 2.22
18232 // Marks the socket as a server socket, i.e. a socket that is used
18233 // to accept incoming requests using g_socket_accept().
18235 // Before calling this the socket must be bound to a local address using
18236 // g_socket_bind().
18238 // To set the maximum amount of outstanding clients, use
18239 // g_socket_set_listen_backlog().
18240 // RETURNS: %TRUE on success, %FALSE on error.
18241 int listen()(GLib2.Error** error=null) {
18242 return g_socket_listen(&this, error);
18245 // VERSION: 2.22
18246 // Receive data (up to @size bytes) from a socket. This is mainly used by
18247 // connection-oriented sockets; it is identical to g_socket_receive_from()
18248 // with @address set to %NULL.
18250 // For %G_SOCKET_TYPE_DATAGRAM and %G_SOCKET_TYPE_SEQPACKET sockets,
18251 // g_socket_receive() will always read either 0 or 1 complete messages from
18252 // the socket. If the received message is too large to fit in @buffer, then
18253 // the data beyond @size bytes will be discarded, without any explicit
18254 // indication that this has occurred.
18256 // For %G_SOCKET_TYPE_STREAM sockets, g_socket_receive() can return any
18257 // number of bytes, up to @size. If more than @size bytes have been
18258 // received, the additional data will be returned in future calls to
18259 // g_socket_receive().
18261 // If the socket is in blocking mode the call will block until there
18262 // is some data to receive, the connection is closed, or there is an
18263 // error. If there is no data available and the socket is in
18264 // non-blocking mode, a %G_IO_ERROR_WOULD_BLOCK error will be
18265 // returned. To be notified when data is available, wait for the
18266 // %G_IO_IN condition.
18268 // On error -1 is returned and @error is set accordingly.
18270 // the peer, or -1 on error
18271 // RETURNS: Number of bytes read, or 0 if the connection was closed by
18272 // <buffer>: a buffer to read data into (which should be at least @size bytes long).
18273 // <size>: the number of bytes you want to read from the socket
18274 // <cancellable>: a %GCancellable or %NULL
18275 ssize_t receive()(char* buffer, size_t size, Cancellable* cancellable, GLib2.Error** error=null) {
18276 return g_socket_receive(&this, buffer, size, cancellable, error);
18279 // VERSION: 2.22
18280 // Receive data (up to @size bytes) from a socket.
18282 // If @address is non-%NULL then @address will be set equal to the
18283 // source address of the received packet.
18284 // @address is owned by the caller.
18286 // See g_socket_receive() for additional information.
18288 // the peer, or -1 on error
18289 // RETURNS: Number of bytes read, or 0 if the connection was closed by
18290 // <address>: a pointer to a #GSocketAddress pointer, or %NULL
18291 // <buffer>: a buffer to read data into (which should be at least @size bytes long).
18292 // <size>: the number of bytes you want to read from the socket
18293 // <cancellable>: a %GCancellable or %NULL
18294 ssize_t receive_from()(SocketAddress** address, char* buffer, size_t size, Cancellable* cancellable, GLib2.Error** error=null) {
18295 return g_socket_receive_from(&this, address, buffer, size, cancellable, error);
18298 // VERSION: 2.22
18299 // Receive data from a socket. This is the most complicated and
18300 // fully-featured version of this call. For easier use, see
18301 // g_socket_receive() and g_socket_receive_from().
18303 // If @address is non-%NULL then @address will be set equal to the
18304 // source address of the received packet.
18305 // @address is owned by the caller.
18307 // @vector must point to an array of #GInputVector structs and
18308 // @num_vectors must be the length of this array. These structs
18309 // describe the buffers that received data will be scattered into.
18310 // If @num_vectors is -1, then @vectors is assumed to be terminated
18311 // by a #GInputVector with a %NULL buffer pointer.
18313 // As a special case, if @num_vectors is 0 (in which case, @vectors
18314 // may of course be %NULL), then a single byte is received and
18315 // discarded. This is to facilitate the common practice of sending a
18316 // single '\0' byte for the purposes of transferring ancillary data.
18318 // @messages, if non-%NULL, will be set to point to a newly-allocated
18319 // array of #GSocketControlMessage instances or %NULL if no such
18320 // messages was received. These correspond to the control messages
18321 // received from the kernel, one #GSocketControlMessage per message
18322 // from the kernel. This array is %NULL-terminated and must be freed
18323 // by the caller using g_free() after calling g_object_unref() on each
18324 // element. If @messages is %NULL, any control messages received will
18325 // be discarded.
18327 // @num_messages, if non-%NULL, will be set to the number of control
18328 // messages received.
18330 // If both @messages and @num_messages are non-%NULL, then
18331 // @num_messages gives the number of #GSocketControlMessage instances
18332 // in @messages (ie: not including the %NULL terminator).
18334 // @flags is an in/out parameter. The commonly available arguments
18335 // for this are available in the #GSocketMsgFlags enum, but the
18336 // values there are the same as the system values, and the flags
18337 // are passed in as-is, so you can pass in system-specific flags too
18338 // (and g_socket_receive_message() may pass system-specific flags out).
18340 // As with g_socket_receive(), data may be discarded if @socket is
18341 // %G_SOCKET_TYPE_DATAGRAM or %G_SOCKET_TYPE_SEQPACKET and you do not
18342 // provide enough buffer space to read a complete message. You can pass
18343 // %G_SOCKET_MSG_PEEK in @flags to peek at the current message without
18344 // removing it from the receive queue, but there is no portable way to find
18345 // out the length of the message other than by reading it into a
18346 // sufficiently-large buffer.
18348 // If the socket is in blocking mode the call will block until there
18349 // is some data to receive, the connection is closed, or there is an
18350 // error. If there is no data available and the socket is in
18351 // non-blocking mode, a %G_IO_ERROR_WOULD_BLOCK error will be
18352 // returned. To be notified when data is available, wait for the
18353 // %G_IO_IN condition.
18355 // On error -1 is returned and @error is set accordingly.
18357 // the peer, or -1 on error
18358 // RETURNS: Number of bytes read, or 0 if the connection was closed by
18359 // <address>: a pointer to a #GSocketAddress pointer, or %NULL
18360 // <vectors>: an array of #GInputVector structs
18361 // <num_vectors>: the number of elements in @vectors, or -1
18362 // <messages>: a pointer which may be filled with an array of #GSocketControlMessages, or %NULL
18363 // <num_messages>: a pointer which will be filled with the number of elements in @messages, or %NULL
18364 // <flags>: a pointer to an int containing #GSocketMsgFlags flags
18365 // <cancellable>: a %GCancellable or %NULL
18366 ssize_t receive_message()(SocketAddress** address, InputVector* vectors, int num_vectors, SocketControlMessage*** messages, int* num_messages, int* flags, Cancellable* cancellable, GLib2.Error** error=null) {
18367 return g_socket_receive_message(&this, address, vectors, num_vectors, messages, num_messages, flags, cancellable, error);
18370 // VERSION: 2.26
18371 // This behaves exactly the same as g_socket_receive(), except that
18372 // the choice of blocking or non-blocking behavior is determined by
18373 // the @blocking argument rather than by @socket's properties.
18375 // the peer, or -1 on error
18376 // RETURNS: Number of bytes read, or 0 if the connection was closed by
18377 // <buffer>: a buffer to read data into (which should be at least @size bytes long).
18378 // <size>: the number of bytes you want to read from the socket
18379 // <blocking>: whether to do blocking or non-blocking I/O
18380 // <cancellable>: a %GCancellable or %NULL
18381 ssize_t receive_with_blocking()(char* buffer, size_t size, int blocking, Cancellable* cancellable, GLib2.Error** error=null) {
18382 return g_socket_receive_with_blocking(&this, buffer, size, blocking, cancellable, error);
18385 // VERSION: 2.22
18386 // Tries to send @size bytes from @buffer on the socket. This is
18387 // mainly used by connection-oriented sockets; it is identical to
18388 // g_socket_send_to() with @address set to %NULL.
18390 // If the socket is in blocking mode the call will block until there is
18391 // space for the data in the socket queue. If there is no space available
18392 // and the socket is in non-blocking mode a %G_IO_ERROR_WOULD_BLOCK error
18393 // will be returned. To be notified when space is available, wait for the
18394 // %G_IO_OUT condition. Note though that you may still receive
18395 // %G_IO_ERROR_WOULD_BLOCK from g_socket_send() even if you were previously
18396 // notified of a %G_IO_OUT condition. (On Windows in particular, this is
18397 // very common due to the way the underlying APIs work.)
18399 // On error -1 is returned and @error is set accordingly.
18401 // on error
18402 // RETURNS: Number of bytes written (which may be less than @size), or -1
18403 // <buffer>: the buffer containing the data to send.
18404 // <size>: the number of bytes to send
18405 // <cancellable>: a %GCancellable or %NULL
18406 ssize_t send()(char* buffer, size_t size, Cancellable* cancellable, GLib2.Error** error=null) {
18407 return g_socket_send(&this, buffer, size, cancellable, error);
18410 // VERSION: 2.22
18411 // Send data to @address on @socket. This is the most complicated and
18412 // fully-featured version of this call. For easier use, see
18413 // g_socket_send() and g_socket_send_to().
18415 // If @address is %NULL then the message is sent to the default receiver
18416 // (set by g_socket_connect()).
18418 // @vectors must point to an array of #GOutputVector structs and
18419 // @num_vectors must be the length of this array. (If @num_vectors is -1,
18420 // then @vectors is assumed to be terminated by a #GOutputVector with a
18421 // %NULL buffer pointer.) The #GOutputVector structs describe the buffers
18422 // that the sent data will be gathered from. Using multiple
18423 // #GOutputVector<!-- -->s is more memory-efficient than manually copying
18424 // data from multiple sources into a single buffer, and more
18425 // network-efficient than making multiple calls to g_socket_send().
18427 // @messages, if non-%NULL, is taken to point to an array of @num_messages
18428 // #GSocketControlMessage instances. These correspond to the control
18429 // messages to be sent on the socket.
18430 // If @num_messages is -1 then @messages is treated as a %NULL-terminated
18431 // array.
18433 // @flags modify how the message is sent. The commonly available arguments
18434 // for this are available in the #GSocketMsgFlags enum, but the
18435 // values there are the same as the system values, and the flags
18436 // are passed in as-is, so you can pass in system-specific flags too.
18438 // If the socket is in blocking mode the call will block until there is
18439 // space for the data in the socket queue. If there is no space available
18440 // and the socket is in non-blocking mode a %G_IO_ERROR_WOULD_BLOCK error
18441 // will be returned. To be notified when space is available, wait for the
18442 // %G_IO_OUT condition. Note though that you may still receive
18443 // %G_IO_ERROR_WOULD_BLOCK from g_socket_send() even if you were previously
18444 // notified of a %G_IO_OUT condition. (On Windows in particular, this is
18445 // very common due to the way the underlying APIs work.)
18447 // On error -1 is returned and @error is set accordingly.
18449 // on error
18450 // RETURNS: Number of bytes written (which may be less than @size), or -1
18451 // <address>: a #GSocketAddress, or %NULL
18452 // <vectors>: an array of #GOutputVector structs
18453 // <num_vectors>: the number of elements in @vectors, or -1
18454 // <messages>: a pointer to an array of #GSocketControlMessages, or %NULL.
18455 // <num_messages>: number of elements in @messages, or -1.
18456 // <flags>: an int containing #GSocketMsgFlags flags
18457 // <cancellable>: a %GCancellable or %NULL
18458 ssize_t send_message()(SocketAddress* address, OutputVector* vectors, int num_vectors, SocketControlMessage** messages, int num_messages, int flags, Cancellable* cancellable, GLib2.Error** error=null) {
18459 return g_socket_send_message(&this, address, vectors, num_vectors, messages, num_messages, flags, cancellable, error);
18462 // VERSION: 2.22
18463 // Tries to send @size bytes from @buffer to @address. If @address is
18464 // %NULL then the message is sent to the default receiver (set by
18465 // g_socket_connect()).
18467 // See g_socket_send() for additional information.
18469 // on error
18470 // RETURNS: Number of bytes written (which may be less than @size), or -1
18471 // <address>: a #GSocketAddress, or %NULL
18472 // <buffer>: the buffer containing the data to send.
18473 // <size>: the number of bytes to send
18474 // <cancellable>: a %GCancellable or %NULL
18475 ssize_t send_to()(SocketAddress* address, char* buffer, size_t size, Cancellable* cancellable, GLib2.Error** error=null) {
18476 return g_socket_send_to(&this, address, buffer, size, cancellable, error);
18479 // VERSION: 2.26
18480 // This behaves exactly the same as g_socket_send(), except that
18481 // the choice of blocking or non-blocking behavior is determined by
18482 // the @blocking argument rather than by @socket's properties.
18484 // on error
18485 // RETURNS: Number of bytes written (which may be less than @size), or -1
18486 // <buffer>: the buffer containing the data to send.
18487 // <size>: the number of bytes to send
18488 // <blocking>: whether to do blocking or non-blocking I/O
18489 // <cancellable>: a %GCancellable or %NULL
18490 ssize_t send_with_blocking()(char* buffer, size_t size, int blocking, Cancellable* cancellable, GLib2.Error** error=null) {
18491 return g_socket_send_with_blocking(&this, buffer, size, blocking, cancellable, error);
18494 // VERSION: 2.22
18495 // Sets the blocking mode of the socket. In blocking mode
18496 // all operations block until they succeed or there is an error. In
18497 // non-blocking mode all functions return results immediately or
18498 // with a %G_IO_ERROR_WOULD_BLOCK error.
18500 // All sockets are created in blocking mode. However, note that the
18501 // platform level socket is always non-blocking, and blocking mode
18502 // is a GSocket level feature.
18503 // <blocking>: Whether to use blocking I/O or not.
18504 void set_blocking()(int blocking) {
18505 g_socket_set_blocking(&this, blocking);
18508 // VERSION: 2.22
18509 // Sets or unsets the %SO_KEEPALIVE flag on the underlying socket. When
18510 // this flag is set on a socket, the system will attempt to verify that the
18511 // remote socket endpoint is still present if a sufficiently long period of
18512 // time passes with no data being exchanged. If the system is unable to
18513 // verify the presence of the remote endpoint, it will automatically close
18514 // the connection.
18516 // This option is only functional on certain kinds of sockets. (Notably,
18517 // %G_SOCKET_PROTOCOL_TCP sockets.)
18519 // The exact time between pings is system- and protocol-dependent, but will
18520 // normally be at least two hours. Most commonly, you would set this flag
18521 // on a server socket if you want to allow clients to remain idle for long
18522 // periods of time, but also want to ensure that connections are eventually
18523 // garbage-collected if clients crash or become unreachable.
18524 // <keepalive>: Value for the keepalive flag
18525 void set_keepalive()(int keepalive) {
18526 g_socket_set_keepalive(&this, keepalive);
18529 // VERSION: 2.22
18530 // Sets the maximum number of outstanding connections allowed
18531 // when listening on this socket. If more clients than this are
18532 // connecting to the socket and the application is not handling them
18533 // on time then the new connections will be refused.
18535 // Note that this must be called before g_socket_listen() and has no
18536 // effect if called after that.
18537 // <backlog>: the maximum number of pending connections.
18538 void set_listen_backlog()(int backlog) {
18539 g_socket_set_listen_backlog(&this, backlog);
18542 // VERSION: 2.26
18543 // Sets the time in seconds after which I/O operations on @socket will
18544 // time out if they have not yet completed.
18546 // On a blocking socket, this means that any blocking #GSocket
18547 // operation will time out after @timeout seconds of inactivity,
18548 // returning %G_IO_ERROR_TIMED_OUT.
18550 // On a non-blocking socket, calls to g_socket_condition_wait() will
18551 // also fail with %G_IO_ERROR_TIMED_OUT after the given time. Sources
18552 // created with g_socket_create_source() will trigger after
18553 // @timeout seconds of inactivity, with the requested condition
18554 // set, at which point calling g_socket_receive(), g_socket_send(),
18555 // g_socket_check_connect_result(), etc, will fail with
18556 // %G_IO_ERROR_TIMED_OUT.
18558 // If @timeout is 0 (the default), operations will never time out
18559 // on their own.
18561 // Note that if an I/O operation is interrupted by a signal, this may
18562 // cause the timeout to be reset.
18563 // <timeout>: the timeout for @socket, in seconds, or 0 for none
18564 void set_timeout()(uint timeout) {
18565 g_socket_set_timeout(&this, timeout);
18568 // VERSION: 2.22
18569 // Shut down part of a full-duplex connection.
18571 // If @shutdown_read is %TRUE then the receiving side of the connection
18572 // is shut down, and further reading is disallowed.
18574 // If @shutdown_write is %TRUE then the sending side of the connection
18575 // is shut down, and further writing is disallowed.
18577 // It is allowed for both @shutdown_read and @shutdown_write to be %TRUE.
18579 // One example where this is used is graceful disconnect for TCP connections
18580 // where you close the sending side, then wait for the other side to close
18581 // the connection, thus ensuring that the other side saw all sent data.
18582 // RETURNS: %TRUE on success, %FALSE on error
18583 // <shutdown_read>: whether to shut down the read side
18584 // <shutdown_write>: whether to shut down the write side
18585 int shutdown()(int shutdown_read, int shutdown_write, GLib2.Error** error=null) {
18586 return g_socket_shutdown(&this, shutdown_read, shutdown_write, error);
18589 // VERSION: 2.22
18590 // Checks if a socket is capable of speaking IPv4.
18592 // IPv4 sockets are capable of speaking IPv4. On some operating systems
18593 // and under some combinations of circumstances IPv6 sockets are also
18594 // capable of speaking IPv4. See RFC 3493 section 3.7 for more
18595 // information.
18597 // No other types of sockets are currently considered as being capable
18598 // of speaking IPv4.
18599 // RETURNS: %TRUE if this socket can be used with IPv4.
18600 int speaks_ipv4()() {
18601 return g_socket_speaks_ipv4(&this);
18606 // #GSocketAddress is the equivalent of <type>struct sockaddr</type>
18607 // in the BSD sockets API. This is an abstract class; use
18608 // #GInetSocketAddress for internet sockets, or #GUnixSocketAddress
18609 // for UNIX domain sockets.
18610 struct SocketAddress /* : GObject.Object */ {
18611 mixin SocketConnectable.__interface__;
18612 alias parent_instance this;
18613 alias parent_instance super_;
18614 alias parent_instance object;
18615 GObject2.Object parent_instance;
18618 // VERSION: 2.22
18619 // Creates a #GSocketAddress subclass corresponding to the native
18620 // <type>struct sockaddr</type> @native.
18622 // otherwise %NULL.
18623 // RETURNS: a new #GSocketAddress if @native could successfully be converted,
18624 // <native>: a pointer to a <type>struct sockaddr</type>
18625 // <len>: the size of the memory location pointed to by @native
18626 static SocketAddress* /*new*/ new_from_native()(void* native, size_t len) {
18627 return g_socket_address_new_from_native(native, len);
18630 // VERSION: 2.22
18631 // Gets the socket family type of @address.
18632 // RETURNS: the socket family type of @address.
18633 SocketFamily get_family()() {
18634 return g_socket_address_get_family(&this);
18637 // VERSION: 2.22
18638 // Gets the size of @address's native <type>struct sockaddr</type>.
18639 // You can use this to allocate memory to pass to
18640 // g_socket_address_to_native().
18642 // @address represents
18643 // RETURNS: the size of the native <type>struct sockaddr</type> that
18644 ssize_t get_native_size()() {
18645 return g_socket_address_get_native_size(&this);
18648 // VERSION: 2.22
18649 // Converts a #GSocketAddress to a native <type>struct
18650 // sockaddr</type>, which can be passed to low-level functions like
18651 // connect() or bind().
18653 // If not enough space is available, a %G_IO_ERROR_NO_SPACE error is
18654 // returned. If the address type is not known on the system
18655 // then a %G_IO_ERROR_NOT_SUPPORTED error is returned.
18656 // RETURNS: %TRUE if @dest was filled in, %FALSE on error
18657 // <dest>: a pointer to a memory location that will contain the native <type>struct sockaddr</type>.
18658 // <destlen>: the size of @dest. Must be at least as large as g_socket_address_get_native_size().
18659 int to_native()(void* dest, size_t destlen, GLib2.Error** error=null) {
18660 return g_socket_address_to_native(&this, dest, destlen, error);
18664 struct SocketAddressClass {
18665 GObject2.ObjectClass parent_class;
18666 // RETURNS: the socket family type of @address.
18667 extern (C) SocketFamily function (SocketAddress* address) get_family;
18668 // RETURNS: the size of the native <type>struct sockaddr</type> that
18669 extern (C) ssize_t function (SocketAddress* address) get_native_size;
18671 // RETURNS: %TRUE if @dest was filled in, %FALSE on error
18672 // <dest>: a pointer to a memory location that will contain the native <type>struct sockaddr</type>.
18673 // <destlen>: the size of @dest. Must be at least as large as g_socket_address_get_native_size().
18674 extern (C) int function (SocketAddress* address, void* dest, size_t destlen, GLib2.Error** error=null) to_native;
18678 // Enumerator type for objects that contain or generate
18679 // #GSocketAddress<!-- -->es.
18680 struct SocketAddressEnumerator /* : GObject.Object */ {
18681 alias parent_instance this;
18682 alias parent_instance super_;
18683 alias parent_instance object;
18684 GObject2.Object parent_instance;
18687 // Retrieves the next #GSocketAddress from @enumerator. Note that this
18688 // may block for some amount of time. (Eg, a #GNetworkAddress may need
18689 // to do a DNS lookup before it can return an address.) Use
18690 // g_socket_address_enumerator_next_async() if you need to avoid
18691 // blocking.
18693 // If @enumerator is expected to yield addresses, but for some reason
18694 // is unable to (eg, because of a DNS error), then the first call to
18695 // g_socket_address_enumerator_next() will return an appropriate error
18696 // in *@error. However, if the first call to
18697 // g_socket_address_enumerator_next() succeeds, then any further
18698 // internal errors (other than @cancellable being triggered) will be
18699 // ignored.
18701 // error (in which case *@error will be set) or if there are no
18702 // more addresses.
18703 // RETURNS: a #GSocketAddress (owned by the caller), or %NULL on
18704 // <cancellable>: optional #GCancellable object, %NULL to ignore.
18705 SocketAddress* /*new*/ next()(Cancellable* cancellable, GLib2.Error** error=null) {
18706 return g_socket_address_enumerator_next(&this, cancellable, error);
18709 // Asynchronously retrieves the next #GSocketAddress from @enumerator
18710 // and then calls @callback, which must call
18711 // g_socket_address_enumerator_next_finish() to get the result.
18712 // <cancellable>: optional #GCancellable object, %NULL to ignore.
18713 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
18714 // <user_data>: the data to pass to callback function
18715 void next_async()(Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
18716 g_socket_address_enumerator_next_async(&this, cancellable, callback, user_data);
18719 // Retrieves the result of a completed call to
18720 // g_socket_address_enumerator_next_async(). See
18721 // g_socket_address_enumerator_next() for more information about
18722 // error handling.
18724 // error (in which case *@error will be set) or if there are no
18725 // more addresses.
18726 // RETURNS: a #GSocketAddress (owned by the caller), or %NULL on
18727 // <result>: a #GAsyncResult
18728 SocketAddress* /*new*/ next_finish()(AsyncResult* result, GLib2.Error** error=null) {
18729 return g_socket_address_enumerator_next_finish(&this, result, error);
18733 struct SocketAddressEnumeratorClass {
18734 GObject2.ObjectClass parent_class;
18736 // RETURNS: a #GSocketAddress (owned by the caller), or %NULL on
18737 // <cancellable>: optional #GCancellable object, %NULL to ignore.
18738 extern (C) SocketAddress* /*new*/ function (SocketAddressEnumerator* enumerator, Cancellable* cancellable, GLib2.Error** error=null) next;
18740 // <cancellable>: optional #GCancellable object, %NULL to ignore.
18741 // <callback>: a #GAsyncReadyCallback to call when the request is satisfied
18742 // <user_data>: the data to pass to callback function
18743 extern (C) void function (SocketAddressEnumerator* enumerator, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) next_async;
18745 // RETURNS: a #GSocketAddress (owned by the caller), or %NULL on
18746 // <result>: a #GAsyncResult
18747 extern (C) SocketAddress* /*new*/ function (SocketAddressEnumerator* enumerator, AsyncResult* result, GLib2.Error** error=null) next_finish;
18750 struct SocketClass {
18751 GObject2.ObjectClass parent_class;
18752 extern (C) void function () _g_reserved1;
18753 extern (C) void function () _g_reserved2;
18754 extern (C) void function () _g_reserved3;
18755 extern (C) void function () _g_reserved4;
18756 extern (C) void function () _g_reserved5;
18757 extern (C) void function () _g_reserved6;
18758 extern (C) void function () _g_reserved7;
18759 extern (C) void function () _g_reserved8;
18760 extern (C) void function () _g_reserved9;
18761 extern (C) void function () _g_reserved10;
18765 // #GSocketClient is a high-level utility class for connecting to a
18766 // network host using a connection oriented socket type.
18768 // You create a #GSocketClient object, set any options you want, and then
18769 // call a sync or async connect operation, which returns a #GSocketConnection
18770 // subclass on success.
18772 // The type of the #GSocketConnection object returned depends on the type of
18773 // the underlying socket that is in use. For instance, for a TCP/IP connection
18774 // it will be a #GTcpConnection.
18775 struct SocketClient /* : GObject.Object */ /* Version 2.22 */ {
18776 alias parent_instance this;
18777 alias parent_instance super_;
18778 alias parent_instance object;
18779 GObject2.Object parent_instance;
18780 SocketClientPrivate* priv;
18783 // VERSION: 2.22
18784 // Creates a new #GSocketClient with the default options.
18786 // Free the returned object with g_object_unref().
18787 // RETURNS: a #GSocketClient.
18788 static SocketClient* /*new*/ new_()() {
18789 return g_socket_client_new();
18792 // Enable proxy protocols to be handled by the application. When the
18793 // indicated proxy protocol is returned by the #GProxyResolver,
18794 // #GSocketClient will consider this protocol as supported but will
18795 // not try to find a #GProxy instance to handle handshaking. The
18796 // application must check for this case by calling
18797 // g_socket_connection_get_remote_address() on the returned
18798 // #GSocketConnection, and seeing if it's a #GProxyAddress of the
18799 // appropriate type, to determine whether or not it needs to handle
18800 // the proxy handshaking itself.
18802 // This should be used for proxy protocols that are dialects of
18803 // another protocol such as HTTP proxy. It also allows cohabitation of
18804 // proxy protocols that are reused between protocols. A good example
18805 // is HTTP. It can be used to proxy HTTP, FTP and Gopher and can also
18806 // be use as generic socket proxy through the HTTP CONNECT method.
18807 // <protocol>: The proxy protocol
18808 void add_application_proxy()(char* protocol) {
18809 g_socket_client_add_application_proxy(&this, protocol);
18812 // VERSION: 2.22
18813 // Tries to resolve the @connectable and make a network connection to it.
18815 // Upon a successful connection, a new #GSocketConnection is constructed
18816 // and returned. The caller owns this new object and must drop their
18817 // reference to it when finished with it.
18819 // The type of the #GSocketConnection object returned depends on the type of
18820 // the underlying socket that is used. For instance, for a TCP/IP connection
18821 // it will be a #GTcpConnection.
18823 // The socket created will be the same family as the address that the
18824 // @connectable resolves to, unless family is set with g_socket_client_set_family()
18825 // or indirectly via g_socket_client_set_local_address(). The socket type
18826 // defaults to %G_SOCKET_TYPE_STREAM but can be set with
18827 // g_socket_client_set_socket_type().
18829 // If a local address is specified with g_socket_client_set_local_address() the
18830 // socket will be bound to this address before connecting.
18831 // RETURNS: a #GSocketConnection on success, %NULL on error.
18832 // <connectable>: a #GSocketConnectable specifying the remote address.
18833 // <cancellable>: optional #GCancellable object, %NULL to ignore.
18834 SocketConnection* /*new*/ connect()(SocketConnectable* connectable, Cancellable* cancellable, GLib2.Error** error=null) {
18835 return g_socket_client_connect(&this, connectable, cancellable, error);
18838 // VERSION: 2.22
18839 // This is the asynchronous version of g_socket_client_connect().
18841 // When the operation is finished @callback will be
18842 // called. You can then call g_socket_client_connect_finish() to get
18843 // the result of the operation.
18844 // <connectable>: a #GSocketConnectable specifying the remote address.
18845 // <cancellable>: a #GCancellable, or %NULL
18846 // <callback>: a #GAsyncReadyCallback
18847 // <user_data>: user data for the callback
18848 void connect_async()(SocketConnectable* connectable, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
18849 g_socket_client_connect_async(&this, connectable, cancellable, callback, user_data);
18852 // VERSION: 2.22
18853 // Finishes an async connect operation. See g_socket_client_connect_async()
18854 // RETURNS: a #GSocketConnection on success, %NULL on error.
18855 // <result>: a #GAsyncResult.
18856 SocketConnection* /*new*/ connect_finish()(AsyncResult* result, GLib2.Error** error=null) {
18857 return g_socket_client_connect_finish(&this, result, error);
18860 // VERSION: 2.22
18861 // This is a helper function for g_socket_client_connect().
18863 // Attempts to create a TCP connection to the named host.
18865 // @host_and_port may be in any of a number of recognized formats; an IPv6
18866 // address, an IPv4 address, or a domain name (in which case a DNS
18867 // lookup is performed). Quoting with [] is supported for all address
18868 // types. A port override may be specified in the usual way with a
18869 // colon. Ports may be given as decimal numbers or symbolic names (in
18870 // which case an /etc/services lookup is performed).
18872 // If no port override is given in @host_and_port then @default_port will be
18873 // used as the port number to connect to.
18875 // In general, @host_and_port is expected to be provided by the user (allowing
18876 // them to give the hostname, and a port override if necessary) and
18877 // @default_port is expected to be provided by the application.
18879 // In the case that an IP address is given, a single connection
18880 // attempt is made. In the case that a name is given, multiple
18881 // connection attempts may be made, in turn and according to the
18882 // number of address records in DNS, until a connection succeeds.
18884 // Upon a successful connection, a new #GSocketConnection is constructed
18885 // and returned. The caller owns this new object and must drop their
18886 // reference to it when finished with it.
18888 // In the event of any failure (DNS error, service not found, no hosts
18889 // connectable) %NULL is returned and @error (if non-%NULL) is set
18890 // accordingly.
18891 // RETURNS: a #GSocketConnection on success, %NULL on error.
18892 // <host_and_port>: the name and optionally port of the host to connect to
18893 // <default_port>: the default port to connect to
18894 // <cancellable>: a #GCancellable, or %NULL
18895 SocketConnection* /*new*/ connect_to_host()(char* host_and_port, ushort default_port, Cancellable* cancellable, GLib2.Error** error=null) {
18896 return g_socket_client_connect_to_host(&this, host_and_port, default_port, cancellable, error);
18899 // VERSION: 2.22
18900 // This is the asynchronous version of g_socket_client_connect_to_host().
18902 // When the operation is finished @callback will be
18903 // called. You can then call g_socket_client_connect_to_host_finish() to get
18904 // the result of the operation.
18905 // <host_and_port>: the name and optionally the port of the host to connect to
18906 // <default_port>: the default port to connect to
18907 // <cancellable>: a #GCancellable, or %NULL
18908 // <callback>: a #GAsyncReadyCallback
18909 // <user_data>: user data for the callback
18910 void connect_to_host_async()(char* host_and_port, ushort default_port, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
18911 g_socket_client_connect_to_host_async(&this, host_and_port, default_port, cancellable, callback, user_data);
18914 // VERSION: 2.22
18915 // Finishes an async connect operation. See g_socket_client_connect_to_host_async()
18916 // RETURNS: a #GSocketConnection on success, %NULL on error.
18917 // <result>: a #GAsyncResult.
18918 SocketConnection* /*new*/ connect_to_host_finish()(AsyncResult* result, GLib2.Error** error=null) {
18919 return g_socket_client_connect_to_host_finish(&this, result, error);
18922 // Attempts to create a TCP connection to a service.
18924 // This call looks up the SRV record for @service at @domain for the
18925 // "tcp" protocol. It then attempts to connect, in turn, to each of
18926 // the hosts providing the service until either a connection succeeds
18927 // or there are no hosts remaining.
18929 // Upon a successful connection, a new #GSocketConnection is constructed
18930 // and returned. The caller owns this new object and must drop their
18931 // reference to it when finished with it.
18933 // In the event of any failure (DNS error, service not found, no hosts
18934 // connectable) %NULL is returned and @error (if non-%NULL) is set
18935 // accordingly.
18936 // RETURNS: a #GSocketConnection if successful, or %NULL on error
18937 // <domain>: a domain name
18938 // <service>: the name of the service to connect to
18939 // <cancellable>: a #GCancellable, or %NULL
18940 SocketConnection* /*new*/ connect_to_service()(char* domain, char* service, Cancellable* cancellable, GLib2.Error** error=null) {
18941 return g_socket_client_connect_to_service(&this, domain, service, cancellable, error);
18944 // VERSION: 2.22
18945 // This is the asynchronous version of
18946 // g_socket_client_connect_to_service().
18947 // <domain>: a domain name
18948 // <service>: the name of the service to connect to
18949 // <cancellable>: a #GCancellable, or %NULL
18950 // <callback>: a #GAsyncReadyCallback
18951 // <user_data>: user data for the callback
18952 void connect_to_service_async()(char* domain, char* service, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
18953 g_socket_client_connect_to_service_async(&this, domain, service, cancellable, callback, user_data);
18956 // VERSION: 2.22
18957 // Finishes an async connect operation. See g_socket_client_connect_to_service_async()
18958 // RETURNS: a #GSocketConnection on success, %NULL on error.
18959 // <result>: a #GAsyncResult.
18960 SocketConnection* /*new*/ connect_to_service_finish()(AsyncResult* result, GLib2.Error** error=null) {
18961 return g_socket_client_connect_to_service_finish(&this, result, error);
18964 // VERSION: 2.26
18965 // This is a helper function for g_socket_client_connect().
18967 // Attempts to create a TCP connection with a network URI.
18969 // @uri may be any valid URI containing an "authority" (hostname/port)
18970 // component. If a port is not specified in the URI, @default_port
18971 // will be used. TLS will be negotiated if #GSocketClient:tls is %TRUE.
18972 // (#GSocketClient does not know to automatically assume TLS for
18973 // certain URI schemes.)
18975 // Using this rather than g_socket_client_connect() or
18976 // g_socket_client_connect_to_host() allows #GSocketClient to
18977 // determine when to use application-specific proxy protocols.
18979 // Upon a successful connection, a new #GSocketConnection is constructed
18980 // and returned. The caller owns this new object and must drop their
18981 // reference to it when finished with it.
18983 // In the event of any failure (DNS error, service not found, no hosts
18984 // connectable) %NULL is returned and @error (if non-%NULL) is set
18985 // accordingly.
18986 // RETURNS: a #GSocketConnection on success, %NULL on error.
18987 // <uri>: A network URI
18988 // <default_port>: the default port to connect to
18989 // <cancellable>: a #GCancellable, or %NULL
18990 SocketConnection* /*new*/ connect_to_uri()(char* uri, ushort default_port, Cancellable* cancellable, GLib2.Error** error=null) {
18991 return g_socket_client_connect_to_uri(&this, uri, default_port, cancellable, error);
18994 // VERSION: 2.26
18995 // This is the asynchronous version of g_socket_client_connect_to_uri().
18997 // When the operation is finished @callback will be
18998 // called. You can then call g_socket_client_connect_to_uri_finish() to get
18999 // the result of the operation.
19000 // <uri>: a network uri
19001 // <default_port>: the default port to connect to
19002 // <cancellable>: a #GCancellable, or %NULL
19003 // <callback>: a #GAsyncReadyCallback
19004 // <user_data>: user data for the callback
19005 void connect_to_uri_async()(char* uri, ushort default_port, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
19006 g_socket_client_connect_to_uri_async(&this, uri, default_port, cancellable, callback, user_data);
19009 // VERSION: 2.26
19010 // Finishes an async connect operation. See g_socket_client_connect_to_uri_async()
19011 // RETURNS: a #GSocketConnection on success, %NULL on error.
19012 // <result>: a #GAsyncResult.
19013 SocketConnection* /*new*/ connect_to_uri_finish()(AsyncResult* result, GLib2.Error** error=null) {
19014 return g_socket_client_connect_to_uri_finish(&this, result, error);
19017 // VERSION: 2.26
19018 // Gets the proxy enable state; see g_socket_client_set_enable_proxy()
19019 // RETURNS: whether proxying is enabled
19020 int get_enable_proxy()() {
19021 return g_socket_client_get_enable_proxy(&this);
19024 // VERSION: 2.22
19025 // Gets the socket family of the socket client.
19027 // See g_socket_client_set_family() for details.
19028 // RETURNS: a #GSocketFamily
19029 SocketFamily get_family()() {
19030 return g_socket_client_get_family(&this);
19033 // VERSION: 2.22
19034 // Gets the local address of the socket client.
19036 // See g_socket_client_set_local_address() for details.
19037 // RETURNS: a #GSocketAddress or %NULL. Do not free.
19038 SocketAddress* get_local_address()() {
19039 return g_socket_client_get_local_address(&this);
19042 // VERSION: 2.22
19043 // Gets the protocol name type of the socket client.
19045 // See g_socket_client_set_protocol() for details.
19046 // RETURNS: a #GSocketProtocol
19047 SocketProtocol get_protocol()() {
19048 return g_socket_client_get_protocol(&this);
19051 // VERSION: 2.22
19052 // Gets the socket type of the socket client.
19054 // See g_socket_client_set_socket_type() for details.
19055 // RETURNS: a #GSocketFamily
19056 SocketType get_socket_type()() {
19057 return g_socket_client_get_socket_type(&this);
19060 // VERSION: 2.26
19061 // Gets the I/O timeout time for sockets created by @client.
19063 // See g_socket_client_set_timeout() for details.
19064 // RETURNS: the timeout in seconds
19065 uint get_timeout()() {
19066 return g_socket_client_get_timeout(&this);
19069 // VERSION: 2.28
19070 // Gets whether @client creates TLS connections. See
19071 // g_socket_client_set_tls() for details.
19072 // RETURNS: whether @client uses TLS
19073 int get_tls()() {
19074 return g_socket_client_get_tls(&this);
19077 // VERSION: 2.28
19078 // Gets the TLS validation flags used creating TLS connections via
19079 // @client.
19080 // RETURNS: the TLS validation flags
19081 TlsCertificateFlags get_tls_validation_flags()() {
19082 return g_socket_client_get_tls_validation_flags(&this);
19085 // VERSION: 2.26
19086 // Sets whether or not @client attempts to make connections via a
19087 // proxy server. When enabled (the default), #GSocketClient will use a
19088 // #GProxyResolver to determine if a proxy protocol such as SOCKS is
19089 // needed, and automatically do the necessary proxy negotiation.
19090 // <enable>: whether to enable proxies
19091 void set_enable_proxy()(int enable) {
19092 g_socket_client_set_enable_proxy(&this, enable);
19095 // VERSION: 2.22
19096 // Sets the socket family of the socket client.
19097 // If this is set to something other than %G_SOCKET_FAMILY_INVALID
19098 // then the sockets created by this object will be of the specified
19099 // family.
19101 // This might be useful for instance if you want to force the local
19102 // connection to be an ipv4 socket, even though the address might
19103 // be an ipv6 mapped to ipv4 address.
19104 // <family>: a #GSocketFamily
19105 void set_family()(SocketFamily family) {
19106 g_socket_client_set_family(&this, family);
19109 // VERSION: 2.22
19110 // Sets the local address of the socket client.
19111 // The sockets created by this object will bound to the
19112 // specified address (if not %NULL) before connecting.
19114 // This is useful if you want to ensure that the local
19115 // side of the connection is on a specific port, or on
19116 // a specific interface.
19117 // <address>: a #GSocketAddress, or %NULL
19118 void set_local_address()(SocketAddress* address) {
19119 g_socket_client_set_local_address(&this, address);
19122 // VERSION: 2.22
19123 // Sets the protocol of the socket client.
19124 // The sockets created by this object will use of the specified
19125 // protocol.
19127 // If @protocol is %0 that means to use the default
19128 // protocol for the socket family and type.
19129 // <protocol>: a #GSocketProtocol
19130 void set_protocol()(SocketProtocol protocol) {
19131 g_socket_client_set_protocol(&this, protocol);
19134 // VERSION: 2.22
19135 // Sets the socket type of the socket client.
19136 // The sockets created by this object will be of the specified
19137 // type.
19139 // It doesn't make sense to specify a type of %G_SOCKET_TYPE_DATAGRAM,
19140 // as GSocketClient is used for connection oriented services.
19141 // <type>: a #GSocketType
19142 void set_socket_type()(SocketType type) {
19143 g_socket_client_set_socket_type(&this, type);
19146 // VERSION: 2.26
19147 // Sets the I/O timeout for sockets created by @client. @timeout is a
19148 // time in seconds, or 0 for no timeout (the default).
19150 // The timeout value affects the initial connection attempt as well,
19151 // so setting this may cause calls to g_socket_client_connect(), etc,
19152 // to fail with %G_IO_ERROR_TIMED_OUT.
19153 // <timeout>: the timeout
19154 void set_timeout()(uint timeout) {
19155 g_socket_client_set_timeout(&this, timeout);
19158 // VERSION: 2.28
19159 // Sets whether @client creates TLS (aka SSL) connections. If @tls is
19160 // %TRUE, @client will wrap its connections in a #GTlsClientConnection
19161 // and perform a TLS handshake when connecting.
19163 // Note that since #GSocketClient must return a #GSocketConnection,
19164 // but #GTlsClientConnection is not a #GSocketConnection, this
19165 // actually wraps the resulting #GTlsClientConnection in a
19166 // #GTcpWrapperConnection when returning it. You can use
19167 // g_tcp_wrapper_connection_get_base_io_stream() on the return value
19168 // to extract the #GTlsClientConnection.
19169 // <tls>: whether to use TLS
19170 void set_tls()(int tls) {
19171 g_socket_client_set_tls(&this, tls);
19174 // VERSION: 2.28
19175 // Sets the TLS validation flags used when creating TLS connections
19176 // via @client. The default value is %G_TLS_CERTIFICATE_VALIDATE_ALL.
19177 // <flags>: the validation flags
19178 void set_tls_validation_flags()(TlsCertificateFlags flags) {
19179 g_socket_client_set_tls_validation_flags(&this, flags);
19183 struct SocketClientClass {
19184 GObject2.ObjectClass parent_class;
19185 extern (C) void function () _g_reserved1;
19186 extern (C) void function () _g_reserved2;
19187 extern (C) void function () _g_reserved3;
19188 extern (C) void function () _g_reserved4;
19189 extern (C) void function () _g_reserved5;
19192 struct SocketClientPrivate {
19196 // Objects that describe one or more potential socket endpoints
19197 // implement #GSocketConnectable. Callers can then use
19198 // g_socket_connectable_enumerate() to get a #GSocketAddressEnumerator
19199 // to try out each socket address in turn until one succeeds, as shown
19200 // in the sample code below.
19202 // |[
19203 // MyConnectionType *
19204 // connect_to_host (const char *hostname,
19205 // guint16 port,
19206 // GCancellable *cancellable,
19207 // GError **error)
19208 // {
19209 // MyConnection *conn = NULL;
19210 // GSocketConnectable *addr;
19211 // GSocketAddressEnumerator *enumerator;
19212 // GSocketAddress *sockaddr;
19213 // GError *conn_error = NULL;
19215 // addr = g_network_address_new ("www.gnome.org", 80);
19216 // enumerator = g_socket_connectable_enumerate (addr);
19217 // g_object_unref (addr);
19219 // /<!-- -->* Try each sockaddr until we succeed. Record the first
19220 // * connection error, but not any further ones (since they'll probably
19221 // * be basically the same as the first).
19222 // *<!-- -->/
19223 // while (!conn && (sockaddr = g_socket_address_enumerator_next (enumerator, cancellable, error))
19224 // {
19225 // conn = connect_to_sockaddr (sockaddr, conn_error ? NULL : &conn_error);
19226 // g_object_unref (sockaddr);
19227 // }
19228 // g_object_unref (enumerator);
19230 // if (conn)
19231 // {
19232 // if (conn_error)
19233 // {
19234 // /<!-- -->* We couldn't connect to the first address, but we succeeded
19235 // * in connecting to a later address.
19236 // *<!-- -->/
19237 // g_error_free (conn_error);
19238 // }
19239 // return conn;
19240 // }
19241 // else if (error)
19242 // {
19243 // /<!-- -->* Either the initial lookup failed, or else the caller
19244 // * cancelled us.
19245 // *<!-- -->/
19246 // if (conn_error)
19247 // g_error_free (conn_error);
19248 // return NULL;
19249 // }
19250 // else
19251 // {
19252 // g_error_propagate (error, conn_error);
19253 // return NULL;
19254 // }
19255 // }
19256 // ]|
19257 struct SocketConnectable /* Interface */ {
19258 mixin template __interface__() {
19259 // VERSION: 2.22
19260 // Creates a #GSocketAddressEnumerator for @connectable.
19261 // RETURNS: a new #GSocketAddressEnumerator.
19262 SocketAddressEnumerator* /*new*/ enumerate()() {
19263 return g_socket_connectable_enumerate(cast(SocketConnectable*)&this);
19266 // VERSION: 2.26
19267 // Creates a #GSocketAddressEnumerator for @connectable that will
19268 // return #GProxyAddress<!-- -->es for addresses that you must connect
19269 // to via a proxy.
19271 // If @connectable does not implement
19272 // g_socket_connectable_proxy_enumerate(), this will fall back to
19273 // calling g_socket_connectable_enumerate().
19274 // RETURNS: a new #GSocketAddressEnumerator.
19275 SocketAddressEnumerator* /*new*/ proxy_enumerate()() {
19276 return g_socket_connectable_proxy_enumerate(cast(SocketConnectable*)&this);
19279 mixin __interface__;
19283 // Provides an interface for returning a #GSocketAddressEnumerator
19284 // and #GProxyAddressEnumerator
19285 struct SocketConnectableIface {
19286 GObject2.TypeInterface g_iface;
19287 // RETURNS: a new #GSocketAddressEnumerator.
19288 extern (C) SocketAddressEnumerator* /*new*/ function (SocketConnectable* connectable) enumerate;
19289 // RETURNS: a new #GSocketAddressEnumerator.
19290 extern (C) SocketAddressEnumerator* /*new*/ function (SocketConnectable* connectable) proxy_enumerate;
19294 // #GSocketConnection is a #GIOStream for a connected socket. They
19295 // can be created either by #GSocketClient when connecting to a host,
19296 // or by #GSocketListener when accepting a new client.
19298 // The type of the #GSocketConnection object returned from these calls
19299 // depends on the type of the underlying socket that is in use. For
19300 // instance, for a TCP/IP connection it will be a #GTcpConnection.
19302 // Choosing what type of object to construct is done with the socket
19303 // connection factory, and it is possible for 3rd parties to register
19304 // custom socket connection types for specific combination of socket
19305 // family/type/protocol using g_socket_connection_factory_register_type().
19306 struct SocketConnection /* : IOStream */ /* Version 2.22 */ {
19307 alias parent_instance this;
19308 alias parent_instance super_;
19309 alias parent_instance iostream;
19310 IOStream parent_instance;
19311 SocketConnectionPrivate* priv;
19314 // VERSION: 2.22
19315 // Looks up the #GType to be used when creating socket connections on
19316 // sockets with the specified @family, @type and @protocol_id.
19318 // If no type is registered, the #GSocketConnection base type is returned.
19319 // RETURNS: a #GType
19320 // <family>: a #GSocketFamily
19321 // <type>: a #GSocketType
19322 // <protocol_id>: a protocol id
19323 static Type factory_lookup_type()(SocketFamily family, SocketType type, int protocol_id) {
19324 return g_socket_connection_factory_lookup_type(family, type, protocol_id);
19327 // VERSION: 2.22
19328 // Looks up the #GType to be used when creating socket connections on
19329 // sockets with the specified @family, @type and @protocol.
19331 // If no type is registered, the #GSocketConnection base type is returned.
19332 // <g_type>: a #GType, inheriting from %G_TYPE_SOCKET_CONNECTION
19333 // <family>: a #GSocketFamily
19334 // <type>: a #GSocketType
19335 // <protocol>: a protocol id
19336 static void factory_register_type()(Type g_type, SocketFamily family, SocketType type, int protocol) {
19337 g_socket_connection_factory_register_type(g_type, family, type, protocol);
19340 // VERSION: 2.22
19341 // Try to get the local address of a socket connection.
19343 // Free the returned object with g_object_unref().
19344 // RETURNS: a #GSocketAddress or %NULL on error.
19345 SocketAddress* /*new*/ get_local_address()(GLib2.Error** error=null) {
19346 return g_socket_connection_get_local_address(&this, error);
19349 // VERSION: 2.22
19350 // Try to get the remote address of a socket connection.
19352 // Free the returned object with g_object_unref().
19353 // RETURNS: a #GSocketAddress or %NULL on error.
19354 SocketAddress* /*new*/ get_remote_address()(GLib2.Error** error=null) {
19355 return g_socket_connection_get_remote_address(&this, error);
19358 // VERSION: 2.22
19359 // Gets the underlying #GSocket object of the connection.
19360 // This can be useful if you want to do something unusual on it
19361 // not supported by the #GSocketConnection APIs.
19362 // RETURNS: a #GSocketAddress or %NULL on error.
19363 Socket* get_socket()() {
19364 return g_socket_connection_get_socket(&this);
19368 struct SocketConnectionClass {
19369 IOStreamClass parent_class;
19370 extern (C) void function () _g_reserved1;
19371 extern (C) void function () _g_reserved2;
19372 extern (C) void function () _g_reserved3;
19373 extern (C) void function () _g_reserved4;
19374 extern (C) void function () _g_reserved5;
19375 extern (C) void function () _g_reserved6;
19378 struct SocketConnectionPrivate {
19382 // A #GSocketControlMessage is a special-purpose utility message that
19383 // can be sent to or received from a #GSocket. These types of
19384 // messages are often called "ancillary data".
19386 // The message can represent some sort of special instruction to or
19387 // information from the socket or can represent a special kind of
19388 // transfer to the peer (for example, sending a file description over
19389 // a UNIX socket).
19391 // These messages are sent with g_socket_send_message() and received
19392 // with g_socket_receive_message().
19394 // To extend the set of control message that can be sent, subclass this
19395 // class and override the get_size, get_level, get_type and serialize
19396 // methods.
19398 // To extend the set of control messages that can be received, subclass
19399 // this class and implement the deserialize method. Also, make sure your
19400 // class is registered with the GType typesystem before calling
19401 // g_socket_receive_message() to read such a message.
19402 struct SocketControlMessage /* : GObject.Object */ {
19403 alias parent_instance this;
19404 alias parent_instance super_;
19405 alias parent_instance object;
19406 GObject2.Object parent_instance;
19407 SocketControlMessagePrivate* priv;
19410 // VERSION: 2.22
19411 // Tries to deserialize a socket control message of a given
19412 // @level and @type. This will ask all known (to GType) subclasses
19413 // of #GSocketControlMessage if they can understand this kind
19414 // of message and if so deserialize it into a #GSocketControlMessage.
19416 // If there is no implementation for this kind of control message, %NULL
19417 // will be returned.
19418 // RETURNS: the deserialized message or %NULL
19419 // <level>: a socket level
19420 // <type>: a socket control message type for the given @level
19421 // <size>: the size of the data in bytes
19422 // <data>: pointer to the message data
19423 static SocketControlMessage* /*new*/ deserialize()(int level, int type, size_t size, void* data) {
19424 return g_socket_control_message_deserialize(level, type, size, data);
19427 // VERSION: 2.22
19428 // Returns the "level" (i.e. the originating protocol) of the control message.
19429 // This is often SOL_SOCKET.
19430 // RETURNS: an integer describing the level
19431 int get_level()() {
19432 return g_socket_control_message_get_level(&this);
19435 // VERSION: 2.22
19436 // Returns the protocol specific type of the control message.
19437 // For instance, for UNIX fd passing this would be SCM_RIGHTS.
19438 // RETURNS: an integer describing the type of control message
19439 int get_msg_type()() {
19440 return g_socket_control_message_get_msg_type(&this);
19443 // VERSION: 2.22
19444 // Returns the space required for the control message, not including
19445 // headers or alignment.
19446 // RETURNS: The number of bytes required.
19447 size_t get_size()() {
19448 return g_socket_control_message_get_size(&this);
19451 // VERSION: 2.22
19452 // Converts the data in the message to bytes placed in the
19453 // message.
19455 // @data is guaranteed to have enough space to fit the size
19456 // returned by g_socket_control_message_get_size() on this
19457 // object.
19458 // <data>: A buffer to write data to
19459 void serialize()(void* data) {
19460 g_socket_control_message_serialize(&this, data);
19464 struct SocketControlMessageClass {
19465 GObject2.ObjectClass parent_class;
19466 // RETURNS: The number of bytes required.
19467 extern (C) size_t function (SocketControlMessage* message) get_size;
19468 // RETURNS: an integer describing the level
19469 extern (C) int function (SocketControlMessage* message) get_level;
19470 extern (C) int function (SocketControlMessage* message) get_type;
19471 // <data>: A buffer to write data to
19472 extern (C) void function (SocketControlMessage* message, void* data) serialize;
19473 // Unintrospectable functionp: deserialize() / ()
19474 extern (C) SocketControlMessage* function (int level, int type, size_t size, void* data) deserialize;
19475 extern (C) void function () _g_reserved1;
19476 extern (C) void function () _g_reserved2;
19477 extern (C) void function () _g_reserved3;
19478 extern (C) void function () _g_reserved4;
19479 extern (C) void function () _g_reserved5;
19482 struct SocketControlMessagePrivate {
19486 // The protocol family of a #GSocketAddress. (These values are
19487 // identical to the system defines %AF_INET, %AF_INET6 and %AF_UNIX,
19488 // if available.)
19489 enum SocketFamily /* Version 2.22 */ {
19490 INVALID = 0,
19491 UNIX = 1,
19492 IPV4 = 2,
19493 IPV6 = 10
19496 // A #GSocketListener is an object that keeps track of a set
19497 // of server sockets and helps you accept sockets from any of the
19498 // socket, either sync or async.
19500 // If you want to implement a network server, also look at #GSocketService
19501 // and #GThreadedSocketService which are subclass of #GSocketListener
19502 // that makes this even easier.
19503 struct SocketListener /* : GObject.Object */ {
19504 alias parent_instance this;
19505 alias parent_instance super_;
19506 alias parent_instance object;
19507 GObject2.Object parent_instance;
19508 SocketListenerPrivate* priv;
19511 // VERSION: 2.22
19512 // Creates a new #GSocketListener with no sockets to listen for.
19513 // New listeners can be added with e.g. g_socket_listener_add_address()
19514 // or g_socket_listener_add_inet_port().
19515 // RETURNS: a new #GSocketListener.
19516 static SocketListener* /*new*/ new_()() {
19517 return g_socket_listener_new();
19520 // VERSION: 2.22
19521 // Blocks waiting for a client to connect to any of the sockets added
19522 // to the listener. Returns a #GSocketConnection for the socket that was
19523 // accepted.
19525 // If @source_object is not %NULL it will be filled out with the source
19526 // object specified when the corresponding socket or address was added
19527 // to the listener.
19529 // If @cancellable is not %NULL, then the operation can be cancelled by
19530 // triggering the cancellable object from another thread. If the operation
19531 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19532 // RETURNS: a #GSocketConnection on success, %NULL on error.
19533 // <source_object>: location where #GObject pointer will be stored, or %NULL
19534 // <cancellable>: optional #GCancellable object, %NULL to ignore.
19535 SocketConnection* /*new*/ accept()(/*out*/ GObject2.Object** source_object, Cancellable* cancellable, GLib2.Error** error=null) {
19536 return g_socket_listener_accept(&this, source_object, cancellable, error);
19539 // VERSION: 2.22
19540 // This is the asynchronous version of g_socket_listener_accept().
19542 // When the operation is finished @callback will be
19543 // called. You can then call g_socket_listener_accept_socket()
19544 // to get the result of the operation.
19545 // <cancellable>: a #GCancellable, or %NULL
19546 // <callback>: a #GAsyncReadyCallback
19547 // <user_data>: user data for the callback
19548 void accept_async()(Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
19549 g_socket_listener_accept_async(&this, cancellable, callback, user_data);
19552 // VERSION: 2.22
19553 // Finishes an async accept operation. See g_socket_listener_accept_async()
19554 // RETURNS: a #GSocketConnection on success, %NULL on error.
19555 // <result>: a #GAsyncResult.
19556 // <source_object>: Optional #GObject identifying this source
19557 SocketConnection* /*new*/ accept_finish()(AsyncResult* result, /*out*/ GObject2.Object** source_object, GLib2.Error** error=null) {
19558 return g_socket_listener_accept_finish(&this, result, source_object, error);
19561 // VERSION: 2.22
19562 // Blocks waiting for a client to connect to any of the sockets added
19563 // to the listener. Returns the #GSocket that was accepted.
19565 // If you want to accept the high-level #GSocketConnection, not a #GSocket,
19566 // which is often the case, then you should use g_socket_listener_accept()
19567 // instead.
19569 // If @source_object is not %NULL it will be filled out with the source
19570 // object specified when the corresponding socket or address was added
19571 // to the listener.
19573 // If @cancellable is not %NULL, then the operation can be cancelled by
19574 // triggering the cancellable object from another thread. If the operation
19575 // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
19576 // RETURNS: a #GSocket on success, %NULL on error.
19577 // <source_object>: location where #GObject pointer will be stored, or %NULL.
19578 // <cancellable>: optional #GCancellable object, %NULL to ignore.
19579 Socket* /*new*/ accept_socket()(/*out*/ GObject2.Object** source_object, Cancellable* cancellable, GLib2.Error** error=null) {
19580 return g_socket_listener_accept_socket(&this, source_object, cancellable, error);
19583 // VERSION: 2.22
19584 // This is the asynchronous version of g_socket_listener_accept_socket().
19586 // When the operation is finished @callback will be
19587 // called. You can then call g_socket_listener_accept_socket_finish()
19588 // to get the result of the operation.
19589 // <cancellable>: a #GCancellable, or %NULL
19590 // <callback>: a #GAsyncReadyCallback
19591 // <user_data>: user data for the callback
19592 void accept_socket_async()(Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
19593 g_socket_listener_accept_socket_async(&this, cancellable, callback, user_data);
19596 // VERSION: 2.22
19597 // Finishes an async accept operation. See g_socket_listener_accept_socket_async()
19598 // RETURNS: a #GSocket on success, %NULL on error.
19599 // <result>: a #GAsyncResult.
19600 // <source_object>: Optional #GObject identifying this source
19601 Socket* /*new*/ accept_socket_finish()(AsyncResult* result, /*out*/ GObject2.Object** source_object, GLib2.Error** error=null) {
19602 return g_socket_listener_accept_socket_finish(&this, result, source_object, error);
19605 // VERSION: 2.22
19606 // Creates a socket of type @type and protocol @protocol, binds
19607 // it to @address and adds it to the set of sockets we're accepting
19608 // sockets from.
19610 // Note that adding an IPv6 address, depending on the platform,
19611 // may or may not result in a listener that also accepts IPv4
19612 // connections. For more deterministic behavior, see
19613 // g_socket_listener_add_inet_port().
19615 // @source_object will be passed out in the various calls
19616 // to accept to identify this particular source, which is
19617 // useful if you're listening on multiple addresses and do
19618 // different things depending on what address is connected to.
19620 // If successful and @effective_address is non-%NULL then it will
19621 // be set to the address that the binding actually occurred at. This
19622 // is helpful for determining the port number that was used for when
19623 // requesting a binding to port 0 (ie: "any port"). This address, if
19624 // requested, belongs to the caller and must be freed.
19625 // RETURNS: %TRUE on success, %FALSE on error.
19626 // <address>: a #GSocketAddress
19627 // <type>: a #GSocketType
19628 // <protocol>: a #GSocketProtocol
19629 // <source_object>: Optional #GObject identifying this source
19630 // <effective_address>: location to store the address that was bound to, or %NULL.
19631 int add_address()(SocketAddress* address, SocketType type, SocketProtocol protocol, GObject2.Object* source_object, /*out*/ SocketAddress** effective_address, GLib2.Error** error=null) {
19632 return g_socket_listener_add_address(&this, address, type, protocol, source_object, effective_address, error);
19635 // VERSION: 2.24
19636 // Listens for TCP connections on any available port number for both
19637 // IPv6 and IPv4 (if each is available).
19639 // This is useful if you need to have a socket for incoming connections
19640 // but don't care about the specific port number.
19642 // @source_object will be passed out in the various calls
19643 // to accept to identify this particular source, which is
19644 // useful if you're listening on multiple addresses and do
19645 // different things depending on what address is connected to.
19646 // RETURNS: the port number, or 0 in case of failure.
19647 // <source_object>: Optional #GObject identifying this source
19648 ushort add_any_inet_port()(GObject2.Object* source_object, GLib2.Error** error=null) {
19649 return g_socket_listener_add_any_inet_port(&this, source_object, error);
19652 // VERSION: 2.22
19653 // Helper function for g_socket_listener_add_address() that
19654 // creates a TCP/IP socket listening on IPv4 and IPv6 (if
19655 // supported) on the specified port on all interfaces.
19657 // @source_object will be passed out in the various calls
19658 // to accept to identify this particular source, which is
19659 // useful if you're listening on multiple addresses and do
19660 // different things depending on what address is connected to.
19661 // RETURNS: %TRUE on success, %FALSE on error.
19662 // <port>: an IP port number (non-zero)
19663 // <source_object>: Optional #GObject identifying this source
19664 int add_inet_port()(ushort port, GObject2.Object* source_object, GLib2.Error** error=null) {
19665 return g_socket_listener_add_inet_port(&this, port, source_object, error);
19668 // VERSION: 2.22
19669 // Adds @socket to the set of sockets that we try to accept
19670 // new clients from. The socket must be bound to a local
19671 // address and listened to.
19673 // @source_object will be passed out in the various calls
19674 // to accept to identify this particular source, which is
19675 // useful if you're listening on multiple addresses and do
19676 // different things depending on what address is connected to.
19677 // RETURNS: %TRUE on success, %FALSE on error.
19678 // <socket>: a listening #GSocket
19679 // <source_object>: Optional #GObject identifying this source
19680 int add_socket()(Socket* socket, GObject2.Object* source_object, GLib2.Error** error=null) {
19681 return g_socket_listener_add_socket(&this, socket, source_object, error);
19684 // VERSION: 2.22
19685 // Closes all the sockets in the listener.
19686 void close()() {
19687 g_socket_listener_close(&this);
19690 // VERSION: 2.22
19691 // Sets the listen backlog on the sockets in the listener.
19693 // See g_socket_set_listen_backlog() for details
19694 // <listen_backlog>: an integer
19695 void set_backlog()(int listen_backlog) {
19696 g_socket_listener_set_backlog(&this, listen_backlog);
19700 struct SocketListenerClass {
19701 GObject2.ObjectClass parent_class;
19702 extern (C) void function (SocketListener* listener) changed;
19703 extern (C) void function () _g_reserved1;
19704 extern (C) void function () _g_reserved2;
19705 extern (C) void function () _g_reserved3;
19706 extern (C) void function () _g_reserved4;
19707 extern (C) void function () _g_reserved5;
19708 extern (C) void function () _g_reserved6;
19711 struct SocketListenerPrivate {
19715 // Flags used in g_socket_receive_message() and g_socket_send_message().
19716 // The flags listed in the enum are some commonly available flags, but the
19717 // values used for them are the same as on the platform, and any other flags
19718 // are passed in/out as is. So to use a platform specific flag, just include
19719 // the right system header and pass in the flag.
19720 enum SocketMsgFlags /* Version 2.22 */ {
19721 NONE = 0,
19722 OOB = 1,
19723 PEEK = 2,
19724 DONTROUTE = 4
19726 struct SocketPrivate {
19730 // A protocol identifier is specified when creating a #GSocket, which is a
19731 // family/type specific identifier, where 0 means the default protocol for
19732 // the particular family/type.
19734 // This enum contains a set of commonly available and used protocols. You
19735 // can also pass any other identifiers handled by the platform in order to
19736 // use protocols not listed here.
19737 enum SocketProtocol /* Version 2.22 */ {
19738 UNKNOWN = -1,
19739 DEFAULT = 0,
19740 TCP = 6,
19741 UDP = 17,
19742 SCTP = 132
19745 // A #GSocketService is an object that represents a service that
19746 // is provided to the network or over local sockets. When a new
19747 // connection is made to the service the #GSocketService::incoming
19748 // signal is emitted.
19750 // A #GSocketService is a subclass of #GSocketListener and you need
19751 // to add the addresses you want to accept connections on with the
19752 // #GSocketListener APIs.
19754 // There are two options for implementing a network service based on
19755 // #GSocketService. The first is to create the service using
19756 // g_socket_service_new() and to connect to the #GSocketService::incoming
19757 // signal. The second is to subclass #GSocketService and override the
19758 // default signal handler implementation.
19760 // In either case, the handler must immediately return, or else it
19761 // will block additional incoming connections from being serviced.
19762 // If you are interested in writing connection handlers that contain
19763 // blocking code then see #GThreadedSocketService.
19765 // The socket service runs on the main loop in the main thread, and is
19766 // not threadsafe in general. However, the calls to start and stop
19767 // the service are threadsafe so these can be used from threads that
19768 // handle incoming clients.
19769 struct SocketService /* : SocketListener */ /* Version 2.22 */ {
19770 alias parent_instance this;
19771 alias parent_instance super_;
19772 alias parent_instance socketlistener;
19773 SocketListener parent_instance;
19774 SocketServicePrivate* priv;
19777 // VERSION: 2.22
19778 // Creates a new #GSocketService with no sockets to listen for.
19779 // New listeners can be added with e.g. g_socket_listener_add_address()
19780 // or g_socket_listener_add_inet_port().
19781 // RETURNS: a new #GSocketService.
19782 static SocketService* /*new*/ new_()() {
19783 return g_socket_service_new();
19786 // VERSION: 2.22
19787 // Check whether the service is active or not. An active
19788 // service will accept new clients that connect, while
19789 // a non-active service will let connecting clients queue
19790 // up until the service is started.
19791 // RETURNS: %TRUE if the service is active, %FALSE otherwise
19792 int is_active()() {
19793 return g_socket_service_is_active(&this);
19796 // VERSION: 2.22
19797 // Starts the service, i.e. start accepting connections
19798 // from the added sockets when the mainloop runs.
19800 // This call is threadsafe, so it may be called from a thread
19801 // handling an incoming client request.
19802 void start()() {
19803 g_socket_service_start(&this);
19806 // VERSION: 2.22
19807 // Stops the service, i.e. stops accepting connections
19808 // from the added sockets when the mainloop runs.
19810 // This call is threadsafe, so it may be called from a thread
19811 // handling an incoming client request.
19812 void stop()() {
19813 g_socket_service_stop(&this);
19816 // VERSION: 2.22
19817 // The ::incoming signal is emitted when a new incoming connection
19818 // to @service needs to be handled. The handler must initiate the
19819 // handling of @connection, but may not block; in essence,
19820 // asynchronous operations must be used.
19822 // @connection will be unreffed once the signal handler returns,
19823 // so you need to ref it yourself if you are planning to use it.
19824 // RETURNS: %TRUE to stop other handlers from being called
19825 // <connection>: a new #GSocketConnection object
19826 // <source_object>: the source_object passed to g_socket_listener_add_address()
19827 extern (C) alias static c_int function (SocketService* this_, SocketConnection* connection, GObject2.Object* source_object, void* user_data=null) signal_incoming;
19829 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
19830 return super_.signal_connect!name(cb, data, cf);
19833 ulong signal_connect(string name:"incoming", CB:signal_incoming)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
19834 return signal_connect_data!()(&this, cast(char*)"incoming",
19835 cast(GObject2.Callback)cb, data, null, cf);
19839 struct SocketServiceClass {
19840 SocketListenerClass parent_class;
19841 extern (C) int function (SocketService* service, SocketConnection* connection, GObject2.Object* source_object) incoming;
19842 extern (C) void function () _g_reserved1;
19843 extern (C) void function () _g_reserved2;
19844 extern (C) void function () _g_reserved3;
19845 extern (C) void function () _g_reserved4;
19846 extern (C) void function () _g_reserved5;
19847 extern (C) void function () _g_reserved6;
19850 struct SocketServicePrivate {
19854 // VERSION: 2.22
19855 // This is the function type of the callback used for the #GSource
19856 // returned by g_socket_create_source().
19857 // RETURNS: it should return %FALSE if the source should be removed.
19858 // <socket>: the #GSocket
19859 // <condition>: the current condition at the source fired.
19860 // <user_data>: data passed in by the user.
19861 extern (C) alias int function (Socket* socket, GLib2.IOCondition condition, void* user_data) SocketSourceFunc;
19864 // Flags used when creating a #GSocket. Some protocols may not implement
19865 // all the socket types.
19866 enum SocketType /* Version 2.22 */ {
19867 INVALID = 0,
19868 STREAM = 1,
19869 DATAGRAM = 2,
19870 SEQPACKET = 3
19873 // SRV (service) records are used by some network protocols to provide
19874 // service-specific aliasing and load-balancing. For example, XMPP
19875 // (Jabber) uses SRV records to locate the XMPP server for a domain;
19876 // rather than connecting directly to "example.com" or assuming a
19877 // specific server hostname like "xmpp.example.com", an XMPP client
19878 // would look up the "xmpp-client" SRV record for "example.com", and
19879 // then connect to whatever host was pointed to by that record.
19881 // You can use g_resolver_lookup_service() or
19882 // g_resolver_lookup_service_async() to find the #GSrvTarget<!-- -->s
19883 // for a given service. However, if you are simply planning to connect
19884 // to the remote service, you can use #GNetworkService's
19885 // #GSocketConnectable interface and not need to worry about
19886 // #GSrvTarget at all.
19887 struct SrvTarget {
19889 // VERSION: 2.22
19890 // Creates a new #GSrvTarget with the given parameters.
19892 // You should not need to use this; normally #GSrvTarget<!-- -->s are
19893 // created by #GResolver.
19894 // RETURNS: a new #GSrvTarget.
19895 // <hostname>: the host that the service is running on
19896 // <port>: the port that the service is running on
19897 // <priority>: the target's priority
19898 // <weight>: the target's weight
19899 static SrvTarget* /*new*/ new_()(char* hostname, ushort port, ushort priority, ushort weight) {
19900 return g_srv_target_new(hostname, port, priority, weight);
19903 // VERSION: 2.22
19904 // Copies @target
19905 // RETURNS: a copy of @target
19906 SrvTarget* /*new*/ copy()() {
19907 return g_srv_target_copy(&this);
19910 // VERSION: 2.22
19911 // Frees @target
19912 void free()() {
19913 g_srv_target_free(&this);
19916 // VERSION: 2.22
19917 // Gets @target's hostname (in ASCII form; if you are going to present
19918 // this to the user, you should use g_hostname_is_ascii_encoded() to
19919 // check if it contains encoded Unicode segments, and use
19920 // g_hostname_to_unicode() to convert it if it does.)
19921 // RETURNS: @target's hostname
19922 char* get_hostname()() {
19923 return g_srv_target_get_hostname(&this);
19926 // VERSION: 2.22
19927 // Gets @target's port
19928 // RETURNS: @target's port
19929 ushort get_port()() {
19930 return g_srv_target_get_port(&this);
19933 // VERSION: 2.22
19934 // Gets @target's priority. You should not need to look at this;
19935 // #GResolver already sorts the targets according to the algorithm in
19936 // RFC 2782.
19937 // RETURNS: @target's priority
19938 ushort get_priority()() {
19939 return g_srv_target_get_priority(&this);
19942 // VERSION: 2.22
19943 // Gets @target's weight. You should not need to look at this;
19944 // #GResolver already sorts the targets according to the algorithm in
19945 // RFC 2782.
19946 // RETURNS: @target's weight
19947 ushort get_weight()() {
19948 return g_srv_target_get_weight(&this);
19951 // Unintrospectable function: list_sort() / g_srv_target_list_sort()
19952 // VERSION: 2.22
19953 // Sorts @targets in place according to the algorithm in RFC 2782.
19954 // RETURNS: the head of the sorted list.
19955 // <targets>: a #GList of #GSrvTarget
19956 static GLib2.List* /*new*/ list_sort()(GLib2.List* targets) {
19957 return g_srv_target_list_sort(targets);
19961 enum TLS_BACKEND_EXTENSION_POINT_NAME = "gio-tls-backend";
19962 enum TLS_DATABASE_PURPOSE_AUTHENTICATE_CLIENT = "1.3.6.1.5.5.7.3.2";
19963 enum TLS_DATABASE_PURPOSE_AUTHENTICATE_SERVER = "1.3.6.1.5.5.7.3.1";
19965 // This is the subclass of #GSocketConnection that is created
19966 // for TCP/IP sockets.
19967 struct TcpConnection /* : SocketConnection */ /* Version 2.22 */ {
19968 alias parent_instance this;
19969 alias parent_instance super_;
19970 alias parent_instance socketconnection;
19971 SocketConnection parent_instance;
19972 TcpConnectionPrivate* priv;
19975 // VERSION: 2.22
19976 // Checks if graceful disconnects are used. See
19977 // g_tcp_connection_set_graceful_disconnect().
19978 // RETURNS: %TRUE if graceful disconnect is used on close, %FALSE otherwise
19979 int get_graceful_disconnect()() {
19980 return g_tcp_connection_get_graceful_disconnect(&this);
19983 // VERSION: 2.22
19984 // This enabled graceful disconnects on close. A graceful disconnect
19985 // means that we signal the receiving end that the connection is terminated
19986 // and wait for it to close the connection before closing the connection.
19988 // A graceful disconnect means that we can be sure that we successfully sent
19989 // all the outstanding data to the other end, or get an error reported.
19990 // However, it also means we have to wait for all the data to reach the
19991 // other side and for it to acknowledge this by closing the socket, which may
19992 // take a while. For this reason it is disabled by default.
19993 // <graceful_disconnect>: Whether to do graceful disconnects or not
19994 void set_graceful_disconnect()(int graceful_disconnect) {
19995 g_tcp_connection_set_graceful_disconnect(&this, graceful_disconnect);
19999 struct TcpConnectionClass {
20000 SocketConnectionClass parent_class;
20003 struct TcpConnectionPrivate {
20007 // A #GTcpWrapperConnection can be used to wrap a #GIOStream that is
20008 // based on a #GSocket, but which is not actually a
20009 // #GSocketConnection. This is used by #GSocketClient so that it can
20010 // always return a #GSocketConnection, even when the connection it has
20011 // actually created is not directly a #GSocketConnection.
20012 struct TcpWrapperConnection /* : TcpConnection */ {
20013 alias parent_instance this;
20014 alias parent_instance super_;
20015 alias parent_instance tcpconnection;
20016 TcpConnection parent_instance;
20017 TcpWrapperConnectionPrivate* priv;
20020 // VERSION: 2.28
20021 // Wraps @base_io_stream and @socket together as a #GSocketConnection.
20022 // RETURNS: the new #GSocketConnection.
20023 // <base_io_stream>: the #GIOStream to wrap
20024 // <socket>: the #GSocket associated with @base_io_stream
20025 static TcpWrapperConnection* /*new*/ new_()(IOStream* base_io_stream, Socket* socket) {
20026 return g_tcp_wrapper_connection_new(base_io_stream, socket);
20029 // Get's @conn's base #GIOStream
20030 // RETURNS: @conn's base #GIOStream
20031 IOStream* get_base_io_stream()() {
20032 return g_tcp_wrapper_connection_get_base_io_stream(&this);
20036 struct TcpWrapperConnectionClass {
20037 TcpConnectionClass parent_class;
20040 struct TcpWrapperConnectionPrivate {
20044 // #GThemedIcon is an implementation of #GIcon that supports icon themes.
20045 // #GThemedIcon contains a list of all of the icons present in an icon
20046 // theme, so that icons can be looked up quickly. #GThemedIcon does
20047 // not provide actual pixmaps for icons, just the icon names.
20048 // Ideally something like gtk_icon_theme_choose_icon() should be used to
20049 // resolve the list of names so that fallback icons work nicely with
20050 // themes that inherit other themes.
20051 struct ThemedIcon /* : GObject.Object */ {
20052 mixin Icon.__interface__;
20053 alias method_parent this;
20054 alias method_parent super_;
20055 alias method_parent object;
20056 GObject2.Object method_parent;
20059 // Creates a new themed icon for @iconname.
20060 // RETURNS: a new #GThemedIcon.
20061 // <iconname>: a string containing an icon name.
20062 static Icon* /*new*/ new_()(char* iconname) {
20063 return g_themed_icon_new(iconname);
20066 // Creates a new themed icon for @iconnames.
20067 // RETURNS: a new #GThemedIcon
20068 // <iconnames>: an array of strings containing icon names.
20069 // <len>: the length of the @iconnames array, or -1 if @iconnames is %NULL-terminated
20070 static Icon* /*new*/ new_from_names()(char** iconnames, int len) {
20071 return g_themed_icon_new_from_names(iconnames, len);
20074 // Creates a new themed icon for @iconname, and all the names
20075 // that can be created by shortening @iconname at '-' characters.
20077 // In the following example, @icon1 and @icon2 are equivalent:
20078 // |[
20079 // const char *names[] = {
20080 // "gnome-dev-cdrom-audio",
20081 // "gnome-dev-cdrom",
20082 // "gnome-dev",
20083 // "gnome"
20084 // };
20086 // icon1 = g_themed_icon_new_from_names (names, 4);
20087 // icon2 = g_themed_icon_new_with_default_fallbacks ("gnome-dev-cdrom-audio");
20088 // ]|
20089 // RETURNS: a new #GThemedIcon.
20090 // <iconname>: a string containing an icon name
20091 static Icon* /*new*/ new_with_default_fallbacks()(char* iconname) {
20092 return g_themed_icon_new_with_default_fallbacks(iconname);
20095 // Append a name to the list of icons from within @icon.
20097 // <note><para>
20098 // Note that doing so invalidates the hash computed by prior calls
20099 // to g_icon_hash().
20100 // </para></note>
20101 // <iconname>: name of icon to append to list of icons from within @icon.
20102 void append_name()(char* iconname) {
20103 g_themed_icon_append_name(&this, iconname);
20106 // Gets the names of icons from within @icon.
20107 // RETURNS: a list of icon names.
20108 char** get_names()() {
20109 return g_themed_icon_get_names(&this);
20112 // VERSION: 2.18
20113 // Prepend a name to the list of icons from within @icon.
20115 // <note><para>
20116 // Note that doing so invalidates the hash computed by prior calls
20117 // to g_icon_hash().
20118 // </para></note>
20119 // <iconname>: name of icon to prepend to list of icons from within @icon.
20120 void prepend_name()(char* iconname) {
20121 g_themed_icon_prepend_name(&this, iconname);
20125 struct ThemedIconClass {
20129 // A #GThreadedSocketService is a simple subclass of #GSocketService
20130 // that handles incoming connections by creating a worker thread and
20131 // dispatching the connection to it by emitting the
20132 // #GThreadedSocketService::run signal in the new thread.
20134 // The signal handler may perform blocking IO and need not return
20135 // until the connection is closed.
20137 // The service is implemented using a thread pool, so there is a
20138 // limited amount of threads available to serve incoming requests.
20139 // The service automatically stops the #GSocketService from accepting
20140 // new connections when all threads are busy.
20142 // As with #GSocketService, you may connect to #GThreadedSocketService::run,
20143 // or subclass and override the default handler.
20144 struct ThreadedSocketService /* : SocketService */ /* Version 2.22 */ {
20145 alias parent_instance this;
20146 alias parent_instance super_;
20147 alias parent_instance socketservice;
20148 SocketService parent_instance;
20149 ThreadedSocketServicePrivate* priv;
20152 // VERSION: 2.22
20153 // Creates a new #GThreadedSocketService with no listeners. Listeners
20154 // must be added with one of the #GSocketListener "add" methods.
20155 // RETURNS: a new #GSocketService.
20156 // <max_threads>: the maximal number of threads to execute concurrently handling incoming clients, -1 means no limit
20157 static ThreadedSocketService* /*new*/ new_()(int max_threads) {
20158 return g_threaded_socket_service_new(max_threads);
20161 // The ::run signal is emitted in a worker thread in response to an
20162 // incoming connection. This thread is dedicated to handling
20163 // @connection and may perform blocking IO. The signal handler need
20164 // not return until the connection is closed.
20165 // RETURNS: %TRUE to stop further signal handlers from being called
20166 // <connection>: a new #GSocketConnection object.
20167 // <source_object>: the source_object passed to g_socket_listener_add_address().
20168 extern (C) alias static c_int function (ThreadedSocketService* this_, SocketConnection* connection, GObject2.Object* source_object, void* user_data=null) signal_run;
20170 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
20171 return super_.signal_connect!name(cb, data, cf);
20174 ulong signal_connect(string name:"run", CB:signal_run)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
20175 return signal_connect_data!()(&this, cast(char*)"run",
20176 cast(GObject2.Callback)cb, data, null, cf);
20180 struct ThreadedSocketServiceClass {
20181 SocketServiceClass parent_class;
20182 extern (C) int function (ThreadedSocketService* service, SocketConnection* connection, GObject2.Object* source_object) run;
20183 extern (C) void function () _g_reserved1;
20184 extern (C) void function () _g_reserved2;
20185 extern (C) void function () _g_reserved3;
20186 extern (C) void function () _g_reserved4;
20187 extern (C) void function () _g_reserved5;
20190 struct ThreadedSocketServicePrivate {
20193 // The client authentication mode for a #GTlsServerConnection.
20194 enum TlsAuthenticationMode /* Version 2.28 */ {
20195 NONE = 0,
20196 REQUESTED = 1,
20197 REQUIRED = 2
20199 struct TlsBackend /* Interface */ /* Version 2.28 */ {
20200 mixin template __interface__() {
20201 // VERSION: 2.28
20202 // Gets the default #GTlsBackend for the system.
20203 // RETURNS: a #GTlsBackend
20204 static TlsBackend* get_default()() {
20205 return g_tls_backend_get_default();
20208 // VERSION: 2.28
20209 // Gets the #GType of @backend's #GTlsCertificate implementation.
20211 // implementation.
20212 // RETURNS: the #GType of @backend's #GTlsCertificate
20213 Type get_certificate_type()() {
20214 return g_tls_backend_get_certificate_type(cast(TlsBackend*)&this);
20217 // VERSION: 2.28
20218 // Gets the #GType of @backend's #GTlsClientConnection implementation.
20220 // implementation.
20221 // RETURNS: the #GType of @backend's #GTlsClientConnection
20222 Type get_client_connection_type()() {
20223 return g_tls_backend_get_client_connection_type(cast(TlsBackend*)&this);
20226 // VERSION: 2.30
20227 // Gets the default #GTlsDatabase used to verify TLS connections.
20229 // unreffed when done.
20230 // RETURNS: the default database, which should be
20231 TlsDatabase* /*new*/ get_default_database()() {
20232 return g_tls_backend_get_default_database(cast(TlsBackend*)&this);
20235 // VERSION: 2.30
20236 // Gets the #GTyep of @backend's #GTlsFileDatabase implementation.
20237 // RETURNS: the #GType of backend's #GTlsFileDatabase implementation.
20238 Type get_file_database_type()() {
20239 return g_tls_backend_get_file_database_type(cast(TlsBackend*)&this);
20242 // VERSION: 2.28
20243 // Gets the #GType of @backend's #GTlsServerConnection implementation.
20245 // implementation.
20246 // RETURNS: the #GType of @backend's #GTlsServerConnection
20247 Type get_server_connection_type()() {
20248 return g_tls_backend_get_server_connection_type(cast(TlsBackend*)&this);
20251 // VERSION: 2.28
20252 // Checks if TLS is supported; if this returns %FALSE for the default
20253 // #GTlsBackend, it means no "real" TLS backend is available.
20254 // RETURNS: whether or not TLS is supported
20255 int supports_tls()() {
20256 return g_tls_backend_supports_tls(cast(TlsBackend*)&this);
20259 mixin __interface__;
20262 // Provides an interface for describing TLS-related types.
20263 struct TlsBackendInterface /* Version 2.28 */ {
20264 GObject2.TypeInterface g_iface;
20265 // RETURNS: whether or not TLS is supported
20266 extern (C) int function (TlsBackend* backend) supports_tls;
20267 extern (C) Type function () get_certificate_type;
20268 extern (C) Type function () get_client_connection_type;
20269 extern (C) Type function () get_server_connection_type;
20270 extern (C) Type function () get_file_database_type;
20271 // RETURNS: the default database, which should be
20272 extern (C) TlsDatabase* /*new*/ function (TlsBackend* backend) get_default_database;
20276 // A certificate used for TLS authentication and encryption.
20277 // This can represent either a public key only (eg, the certificate
20278 // received by a client from a server), or the combination of
20279 // a public key and a private key (which is needed when acting as a
20280 // #GTlsServerConnection).
20281 struct TlsCertificate /* : GObject.Object */ /* Version 2.28 */ {
20282 alias parent_instance this;
20283 alias parent_instance super_;
20284 alias parent_instance object;
20285 GObject2.Object parent_instance;
20286 TlsCertificatePrivate* priv;
20289 // VERSION: 2.28
20290 // Creates a #GTlsCertificate from the PEM-encoded data in @file. If
20291 // @file cannot be read or parsed, the function will return %NULL and
20292 // set @error. Otherwise, this behaves like g_tls_certificate_new().
20293 // RETURNS: the new certificate, or %NULL on error
20294 // <file>: file containing a PEM-encoded certificate to import
20295 static TlsCertificate* /*new*/ new_from_file()(char* file, GLib2.Error** error=null) {
20296 return g_tls_certificate_new_from_file(file, error);
20299 // VERSION: 2.28
20300 // Creates a #GTlsCertificate from the PEM-encoded data in @cert_file
20301 // and @key_file. If either file cannot be read or parsed, the
20302 // function will return %NULL and set @error. Otherwise, this behaves
20303 // like g_tls_certificate_new().
20304 // RETURNS: the new certificate, or %NULL on error
20305 // <cert_file>: file containing a PEM-encoded certificate to import
20306 // <key_file>: file containing a PEM-encoded private key to import
20307 static TlsCertificate* /*new*/ new_from_files()(char* cert_file, char* key_file, GLib2.Error** error=null) {
20308 return g_tls_certificate_new_from_files(cert_file, key_file, error);
20311 // VERSION: 2.28
20312 // Creates a new #GTlsCertificate from the PEM-encoded data in @data.
20313 // If @data includes both a certificate and a private key, then the
20314 // returned certificate will include the private key data as well.
20316 // If @data includes multiple certificates, only the first one will be
20317 // parsed.
20318 // RETURNS: the new certificate, or %NULL if @data is invalid
20319 // <data>: PEM-encoded certificate data
20320 // <length>: the length of @data, or -1 if it's 0-terminated.
20321 static TlsCertificate* /*new*/ new_from_pem()(char* data, ssize_t length, GLib2.Error** error=null) {
20322 return g_tls_certificate_new_from_pem(data, length, error);
20325 // VERSION: 2.28
20326 // Creates one or more #GTlsCertificate<!-- -->s from the PEM-encoded
20327 // data in @file. If @file cannot be read or parsed, the function will
20328 // return %NULL and set @error. If @file does not contain any
20329 // PEM-encoded certificates, this will return an empty list and not
20330 // set @error.
20332 // #GList containing #GTlsCertificate objects. You must free the list
20333 // and its contents when you are done with it.
20334 // RETURNS: a
20335 // <file>: file containing PEM-encoded certificates to import
20336 static GLib2.List* /*new*/ list_new_from_file()(char* file, GLib2.Error** error=null) {
20337 return g_tls_certificate_list_new_from_file(file, error);
20340 // VERSION: 2.28
20341 // Gets the #GTlsCertificate representing @cert's issuer, if known
20343 // or %NULL if @cert is self-signed or signed with an unknown
20344 // certificate.
20345 // RETURNS: The certificate of @cert's issuer,
20346 TlsCertificate* get_issuer()() {
20347 return g_tls_certificate_get_issuer(&this);
20350 // VERSION: 2.28
20351 // This verifies @cert and returns a set of #GTlsCertificateFlags
20352 // indicating any problems found with it. This can be used to verify a
20353 // certificate outside the context of making a connection, or to
20354 // check a certificate against a CA that is not part of the system
20355 // CA database.
20357 // If @identity is not %NULL, @cert's name(s) will be compared against
20358 // it, and %G_TLS_CERTIFICATE_BAD_IDENTITY will be set in the return
20359 // value if it does not match. If @identity is %NULL, that bit will
20360 // never be set in the return value.
20362 // If @trusted_ca is not %NULL, then @cert (or one of the certificates
20363 // in its chain) must be signed by it, or else
20364 // %G_TLS_CERTIFICATE_UNKNOWN_CA will be set in the return value. If
20365 // @trusted_ca is %NULL, that bit will never be set in the return
20366 // value.
20368 // (All other #GTlsCertificateFlags values will always be set or unset
20369 // as appropriate.)
20370 // RETURNS: the appropriate #GTlsCertificateFlags
20371 // <identity>: the expected peer identity
20372 // <trusted_ca>: the certificate of a trusted authority
20373 TlsCertificateFlags verify()(SocketConnectable* identity=null, TlsCertificate* trusted_ca=null) {
20374 return g_tls_certificate_verify(&this, identity, trusted_ca);
20378 struct TlsCertificateClass {
20379 GObject2.ObjectClass parent_class;
20381 // RETURNS: the appropriate #GTlsCertificateFlags
20382 // <identity>: the expected peer identity
20383 // <trusted_ca>: the certificate of a trusted authority
20384 extern (C) TlsCertificateFlags function (TlsCertificate* cert, SocketConnectable* identity=null, TlsCertificate* trusted_ca=null) verify;
20385 private void*[8] padding;
20389 // A set of flags describing TLS certification validation. This can be
20390 // used to set which validation steps to perform (eg, with
20391 // g_tls_client_connection_set_validation_flags()), or to describe why
20392 // a particular certificate was rejected (eg, in
20393 // #GTlsConnection::accept-certificate).
20394 enum TlsCertificateFlags /* Version 2.28 */ {
20395 UNKNOWN_CA = 1,
20396 BAD_IDENTITY = 2,
20397 NOT_ACTIVATED = 4,
20398 EXPIRED = 8,
20399 REVOKED = 16,
20400 INSECURE = 32,
20401 GENERIC_ERROR = 64,
20402 VALIDATE_ALL = 127
20404 struct TlsCertificatePrivate {
20408 // #GTlsClientConnection is the client-side subclass of
20409 // #GTlsConnection, representing a client-side TLS connection.
20410 struct TlsClientConnection /* Interface */ /* Version 2.28 */ {
20411 mixin template __interface__() {
20412 // VERSION: 2.28
20413 // Creates a new #GTlsClientConnection wrapping @base_io_stream (which
20414 // must have pollable input and output streams) which is assumed to
20415 // communicate with the server identified by @server_identity.
20416 // RETURNS: the new #GTlsClientConnection, or %NULL on error
20417 // <base_io_stream>: the #GIOStream to wrap
20418 // <server_identity>: the expected identity of the server
20419 static IOStream* /*new*/ new_()(IOStream* base_io_stream, SocketConnectable* server_identity, GLib2.Error** error=null) {
20420 return g_tls_client_connection_new(base_io_stream, server_identity, error);
20423 // VERSION: 2.28
20424 // Gets the list of distinguished names of the Certificate Authorities
20425 // that the server will accept certificates from. This will be set
20426 // during the TLS handshake if the server requests a certificate.
20427 // Otherwise, it will be %NULL.
20429 // Each item in the list is a #GByteArray which contains the complete
20430 // subject DN of the certificate authority.
20432 // CA DNs. You should unref each element with g_byte_array_unref() and then
20433 // the free the list with g_list_free().
20434 // RETURNS: the list of
20435 GLib2.List* /*new*/ get_accepted_cas()() {
20436 return g_tls_client_connection_get_accepted_cas(cast(TlsClientConnection*)&this);
20439 // VERSION: 2.28
20440 // Gets @conn's expected server identity
20442 // expected server identity, or %NULL if the expected identity is not
20443 // known.
20444 // RETURNS: a #GSocketConnectable describing the
20445 SocketConnectable* get_server_identity()() {
20446 return g_tls_client_connection_get_server_identity(cast(TlsClientConnection*)&this);
20449 // VERSION: 2.28
20450 // Gets whether @conn will use SSL 3.0 rather than the
20451 // highest-supported version of TLS; see
20452 // g_tls_client_connection_set_use_ssl3().
20453 // RETURNS: whether @conn will use SSL 3.0
20454 int get_use_ssl3()() {
20455 return g_tls_client_connection_get_use_ssl3(cast(TlsClientConnection*)&this);
20458 // VERSION: 2.28
20459 // Gets @conn's validation flags
20460 // RETURNS: the validation flags
20461 TlsCertificateFlags get_validation_flags()() {
20462 return g_tls_client_connection_get_validation_flags(cast(TlsClientConnection*)&this);
20465 // VERSION: 2.28
20466 // Sets @conn's expected server identity, which is used both to tell
20467 // servers on virtual hosts which certificate to present, and also
20468 // to let @conn know what name to look for in the certificate when
20469 // performing %G_TLS_CERTIFICATE_BAD_IDENTITY validation, if enabled.
20470 // <identity>: a #GSocketConnectable describing the expected server identity
20471 void set_server_identity()(SocketConnectable* identity) {
20472 g_tls_client_connection_set_server_identity(cast(TlsClientConnection*)&this, identity);
20475 // VERSION: 2.28
20476 // If @use_ssl3 is %TRUE, this forces @conn to use SSL 3.0 rather than
20477 // trying to properly negotiate the right version of TLS or SSL to use.
20478 // This can be used when talking to servers that do not implement the
20479 // fallbacks correctly and which will therefore fail to handshake with
20480 // a "modern" TLS handshake attempt.
20481 // <use_ssl3>: whether to use SSL 3.0
20482 void set_use_ssl3()(int use_ssl3) {
20483 g_tls_client_connection_set_use_ssl3(cast(TlsClientConnection*)&this, use_ssl3);
20486 // VERSION: 2.28
20487 // Sets @conn's validation flags, to override the default set of
20488 // checks performed when validating a server certificate. By default,
20489 // %G_TLS_CERTIFICATE_VALIDATE_ALL is used.
20490 // <flags>: the #GTlsCertificateFlags to use
20491 void set_validation_flags()(TlsCertificateFlags flags) {
20492 g_tls_client_connection_set_validation_flags(cast(TlsClientConnection*)&this, flags);
20495 mixin __interface__;
20498 struct TlsClientConnectionInterface {
20499 GObject2.TypeInterface g_iface;
20503 // #GTlsConnection is the base TLS connection class type, which wraps
20504 // a #GIOStream and provides TLS encryption on top of it. Its
20505 // subclasses, #GTlsClientConnection and #GTlsServerConnection,
20506 // implement client-side and server-side TLS, respectively.
20507 struct TlsConnection /* : IOStream */ /* Version 2.28 */ {
20508 alias parent_instance this;
20509 alias parent_instance super_;
20510 alias parent_instance iostream;
20511 IOStream parent_instance;
20512 TlsConnectionPrivate* priv;
20515 // VERSION: 2.28
20516 // Used by #GTlsConnection implementations to emit the
20517 // #GTlsConnection::accept-certificate signal.
20519 // %TRUE to accept @peer_cert
20520 // RETURNS: %TRUE if one of the signal handlers has returned
20521 // <peer_cert>: the peer's #GTlsCertificate
20522 // <errors>: the problems with @peer_cert
20523 int emit_accept_certificate()(TlsCertificate* peer_cert, TlsCertificateFlags errors) {
20524 return g_tls_connection_emit_accept_certificate(&this, peer_cert, errors);
20527 // VERSION: 2.28
20528 // Gets @conn's certificate, as set by
20529 // g_tls_connection_set_certificate().
20530 // RETURNS: @conn's certificate, or %NULL
20531 TlsCertificate* get_certificate()() {
20532 return g_tls_connection_get_certificate(&this);
20535 // VERSION: 2.30
20536 // Gets the certificate database that @conn uses to verify
20537 // peer certificates. See g_tls_connection_set_database().
20538 // RETURNS: the certificate database that @conn uses or %NULL
20539 TlsDatabase* get_database()() {
20540 return g_tls_connection_get_database(&this);
20543 // VERSION: 2.30
20544 // Get the object that will be used to interact with the user. It will be used
20545 // for things like prompting the user for passwords. If %NULL is returned, then
20546 // no user interaction will occur for this connection.
20547 // RETURNS: The interaction object.
20548 TlsInteraction* get_interaction()() {
20549 return g_tls_connection_get_interaction(&this);
20552 // VERSION: 2.28
20553 // Gets @conn's peer's certificate after the handshake has completed.
20554 // (It is not set during the emission of
20555 // #GTlsConnection::accept-certificate.)
20556 // RETURNS: @conn's peer's certificate, or %NULL
20557 TlsCertificate* get_peer_certificate()() {
20558 return g_tls_connection_get_peer_certificate(&this);
20561 // VERSION: 2.28
20562 // Gets the errors associated with validating @conn's peer's
20563 // certificate, after the handshake has completed. (It is not set
20564 // during the emission of #GTlsConnection::accept-certificate.)
20565 // RETURNS: @conn's peer's certificate errors
20566 TlsCertificateFlags get_peer_certificate_errors()() {
20567 return g_tls_connection_get_peer_certificate_errors(&this);
20570 // VERSION: 2.28
20571 // Gets @conn rehandshaking mode. See
20572 // g_tls_connection_set_rehandshake_mode() for details.
20573 // RETURNS: @conn's rehandshaking mode
20574 TlsRehandshakeMode get_rehandshake_mode()() {
20575 return g_tls_connection_get_rehandshake_mode(&this);
20578 // VERSION: 2.28
20579 // Tests whether or not @conn expects a proper TLS close notification
20580 // when the connection is closed. See
20581 // g_tls_connection_set_require_close_notify() for details.
20583 // notification.
20584 // RETURNS: %TRUE if @conn requires a proper TLS close
20585 int get_require_close_notify()() {
20586 return g_tls_connection_get_require_close_notify(&this);
20589 // DEPRECATED (v2.30) method: get_use_system_certdb - Use g_tls_connection_get_database() instead
20590 // Gets whether @conn uses the system certificate database to verify
20591 // peer certificates. See g_tls_connection_set_use_system_certdb().
20592 // RETURNS: whether @conn uses the system certificate database
20593 int get_use_system_certdb()() {
20594 return g_tls_connection_get_use_system_certdb(&this);
20597 // VERSION: 2.28
20598 // Attempts a TLS handshake on @conn.
20600 // On the client side, it is never necessary to call this method;
20601 // although the connection needs to perform a handshake after
20602 // connecting (or after sending a "STARTTLS"-type command) and may
20603 // need to rehandshake later if the server requests it,
20604 // #GTlsConnection will handle this for you automatically when you try
20605 // to send or receive data on the connection. However, you can call
20606 // g_tls_connection_handshake() manually if you want to know for sure
20607 // whether the initial handshake succeeded or failed (as opposed to
20608 // just immediately trying to write to @conn's output stream, in which
20609 // case if it fails, it may not be possible to tell if it failed
20610 // before or after completing the handshake).
20612 // Likewise, on the server side, although a handshake is necessary at
20613 // the beginning of the communication, you do not need to call this
20614 // function explicitly unless you want clearer error reporting.
20615 // However, you may call g_tls_connection_handshake() later on to
20616 // renegotiate parameters (encryption methods, etc) with the client.
20618 // #GTlsConnection::accept_certificate may be emitted during the
20619 // handshake.
20620 // RETURNS: success or failure
20621 // <cancellable>: a #GCancellable, or %NULL
20622 int handshake()(Cancellable* cancellable, GLib2.Error** error=null) {
20623 return g_tls_connection_handshake(&this, cancellable, error);
20626 // VERSION: 2.28
20627 // Asynchronously performs a TLS handshake on @conn. See
20628 // g_tls_connection_handshake() for more information.
20629 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
20630 // <cancellable>: a #GCancellable, or %NULL
20631 // <callback>: callback to call when the handshake is complete
20632 // <user_data>: the data to pass to the callback function
20633 void handshake_async()(int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
20634 g_tls_connection_handshake_async(&this, io_priority, cancellable, callback, user_data);
20637 // VERSION: 2.28
20638 // Finish an asynchronous TLS handshake operation. See
20639 // g_tls_connection_handshake() for more information.
20641 // case @error will be set.
20642 // RETURNS: %TRUE on success, %FALSE on failure, in which
20643 // <result>: a #GAsyncResult.
20644 int handshake_finish()(AsyncResult* result, GLib2.Error** error=null) {
20645 return g_tls_connection_handshake_finish(&this, result, error);
20648 // VERSION: 2.28
20649 // This sets the certificate that @conn will present to its peer
20650 // during the TLS handshake. For a #GTlsServerConnection, it is
20651 // mandatory to set this, and that will normally be done at construct
20652 // time.
20654 // For a #GTlsClientConnection, this is optional. If a handshake fails
20655 // with %G_TLS_ERROR_CERTIFICATE_REQUIRED, that means that the server
20656 // requires a certificate, and if you try connecting again, you should
20657 // call this method first. You can call
20658 // g_tls_client_connection_get_accepted_cas() on the failed connection
20659 // to get a list of Certificate Authorities that the server will
20660 // accept certificates from.
20662 // (It is also possible that a server will allow the connection with
20663 // or without a certificate; in that case, if you don't provide a
20664 // certificate, you can tell that the server requested one by the fact
20665 // that g_tls_client_connection_get_accepted_cas() will return
20666 // non-%NULL.)
20667 // <certificate>: the certificate to use for @conn
20668 void set_certificate()(TlsCertificate* certificate) {
20669 g_tls_connection_set_certificate(&this, certificate);
20672 // VERSION: 2.30
20673 // Sets the certificate database that is used to verify peer certificates.
20674 // This is set to the default database by default. See
20675 // g_tls_backend_get_default_database(). If set to %NULL, then
20676 // peer certificate validation will always set the
20677 // %G_TLS_CERTIFICATE_UNKNOWN_CA error (meaning
20678 // #GTlsConnection::accept-certificate will always be emitted on
20679 // client-side connections, unless that bit is not set in
20680 // #GTlsClientConnection:validation-flags).
20681 // <database>: a #GTlsDatabase
20682 void set_database()(TlsDatabase* database) {
20683 g_tls_connection_set_database(&this, database);
20686 // VERSION: 2.30
20687 // Set the object that will be used to interact with the user. It will be used
20688 // for things like prompting the user for passwords.
20690 // The @interaction argument will normally be a derived subclass of
20691 // #GTlsInteraction. %NULL can also be provided if no user interaction
20692 // should occur for this connection.
20693 // <interaction>: an interaction object, or %NULL
20694 void set_interaction()(TlsInteraction* interaction=null) {
20695 g_tls_connection_set_interaction(&this, interaction);
20698 // VERSION: 2.28
20699 // Sets how @conn behaves with respect to rehandshaking requests.
20701 // %G_TLS_REHANDSHAKE_NEVER means that it will never agree to
20702 // rehandshake after the initial handshake is complete. (For a client,
20703 // this means it will refuse rehandshake requests from the server, and
20704 // for a server, this means it will close the connection with an error
20705 // if the client attempts to rehandshake.)
20707 // %G_TLS_REHANDSHAKE_SAFELY means that the connection will allow a
20708 // rehandshake only if the other end of the connection supports the
20709 // TLS <literal>renegotiation_info</literal> extension. This is the
20710 // default behavior, but means that rehandshaking will not work
20711 // against older implementations that do not support that extension.
20713 // %G_TLS_REHANDSHAKE_UNSAFELY means that the connection will allow
20714 // rehandshaking even without the
20715 // <literal>renegotiation_info</literal> extension. On the server side
20716 // in particular, this is not recommended, since it leaves the server
20717 // open to certain attacks. However, this mode is necessary if you
20718 // need to allow renegotiation with older client software.
20719 // <mode>: the rehandshaking mode
20720 void set_rehandshake_mode()(TlsRehandshakeMode mode) {
20721 g_tls_connection_set_rehandshake_mode(&this, mode);
20724 // VERSION: 2.28
20725 // Sets whether or not @conn expects a proper TLS close notification
20726 // before the connection is closed. If this is %TRUE (the default),
20727 // then @conn will expect to receive a TLS close notification from its
20728 // peer before the connection is closed, and will return a
20729 // %G_TLS_ERROR_EOF error if the connection is closed without proper
20730 // notification (since this may indicate a network error, or
20731 // man-in-the-middle attack).
20733 // In some protocols, the application will know whether or not the
20734 // connection was closed cleanly based on application-level data
20735 // (because the application-level data includes a length field, or is
20736 // somehow self-delimiting); in this case, the close notify is
20737 // redundant and sometimes omitted. (TLS 1.1 explicitly allows this;
20738 // in TLS 1.0 it is technically an error, but often done anyway.) You
20739 // can use g_tls_connection_set_require_close_notify() to tell @conn
20740 // to allow an "unannounced" connection close, in which case the close
20741 // will show up as a 0-length read, as in a non-TLS
20742 // #GSocketConnection, and it is up to the application to check that
20743 // the data has been fully received.
20745 // Note that this only affects the behavior when the peer closes the
20746 // connection; when the application calls g_io_stream_close() itself
20747 // on @conn, this will send a close notification regardless of the
20748 // setting of this property. If you explicitly want to do an unclean
20749 // close, you can close @conn's #GTlsConnection:base-io-stream rather
20750 // than closing @conn itself.
20751 // <require_close_notify>: whether or not to require close notification
20752 void set_require_close_notify()(int require_close_notify) {
20753 g_tls_connection_set_require_close_notify(&this, require_close_notify);
20756 // DEPRECATED (v2.30) method: set_use_system_certdb - Use g_tls_connection_set_database() instead
20757 // Sets whether @conn uses the system certificate database to verify
20758 // peer certificates. This is %TRUE by default. If set to %FALSE, then
20759 // peer certificate validation will always set the
20760 // %G_TLS_CERTIFICATE_UNKNOWN_CA error (meaning
20761 // #GTlsConnection::accept-certificate will always be emitted on
20762 // client-side connections, unless that bit is not set in
20763 // #GTlsClientConnection:validation-flags).
20764 // <use_system_certdb>: whether to use the system certificate database
20765 void set_use_system_certdb()(int use_system_certdb) {
20766 g_tls_connection_set_use_system_certdb(&this, use_system_certdb);
20769 // VERSION: 2.28
20770 // Emitted during the TLS handshake after the peer certificate has
20771 // been received. You can examine @peer_cert's certification path by
20772 // calling g_tls_certificate_get_issuer() on it.
20774 // For a client-side connection, @peer_cert is the server's
20775 // certificate, and the signal will only be emitted if the
20776 // certificate was not acceptable according to @conn's
20777 // #GTlsClientConnection:validation_flags. If you would like the
20778 // certificate to be accepted despite @errors, return %TRUE from the
20779 // signal handler. Otherwise, if no handler accepts the certificate,
20780 // the handshake will fail with %G_TLS_ERROR_BAD_CERTIFICATE.
20782 // For a server-side connection, @peer_cert is the certificate
20783 // presented by the client, if this was requested via the server's
20784 // #GTlsServerConnection:authentication_mode. On the server side,
20785 // the signal is always emitted when the client presents a
20786 // certificate, and the certificate will only be accepted if a
20787 // handler returns %TRUE.
20789 // Note that if this signal is emitted as part of asynchronous I/O
20790 // in the main thread, then you should not attempt to interact with
20791 // the user before returning from the signal handler. If you want to
20792 // let the user decide whether or not to accept the certificate, you
20793 // would have to return %FALSE from the signal handler on the first
20794 // attempt, and then after the connection attempt returns a
20795 // %G_TLS_ERROR_HANDSHAKE, you can interact with the user, and if
20796 // the user decides to accept the certificate, remember that fact,
20797 // create a new connection, and return %TRUE from the signal handler
20798 // the next time.
20800 // If you are doing I/O in another thread, you do not
20801 // need to worry about this, and can simply block in the signal
20802 // handler until the UI thread returns an answer.
20804 // immediately end the signal emission). %FALSE to allow the signal
20805 // emission to continue, which will cause the handshake to fail if
20806 // no one else overrides it.
20807 // RETURNS: %TRUE to accept @peer_cert (which will also
20808 // <peer_cert>: the peer's #GTlsCertificate
20809 // <errors>: the problems with @peer_cert.
20810 extern (C) alias static c_int function (TlsConnection* this_, TlsCertificate* peer_cert, TlsCertificateFlags* errors, void* user_data=null) signal_accept_certificate;
20812 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
20813 return super_.signal_connect!name(cb, data, cf);
20816 ulong signal_connect(string name:"accept-certificate", CB:signal_accept_certificate)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
20817 return signal_connect_data!()(&this, cast(char*)"accept-certificate",
20818 cast(GObject2.Callback)cb, data, null, cf);
20822 struct TlsConnectionClass {
20823 IOStreamClass parent_class;
20824 extern (C) int function (TlsConnection* connection, TlsCertificate* peer_cert, TlsCertificateFlags errors) accept_certificate;
20826 // RETURNS: success or failure
20827 // <cancellable>: a #GCancellable, or %NULL
20828 extern (C) int function (TlsConnection* conn, Cancellable* cancellable, GLib2.Error** error=null) handshake;
20830 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the request.
20831 // <cancellable>: a #GCancellable, or %NULL
20832 // <callback>: callback to call when the handshake is complete
20833 // <user_data>: the data to pass to the callback function
20834 extern (C) void function (TlsConnection* conn, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) handshake_async;
20836 // RETURNS: %TRUE on success, %FALSE on failure, in which
20837 // <result>: a #GAsyncResult.
20838 extern (C) int function (TlsConnection* conn, AsyncResult* result, GLib2.Error** error=null) handshake_finish;
20839 private void*[8] padding;
20842 struct TlsConnectionPrivate {
20846 // #GTlsDatabase is used to lookup certificates and other information
20847 // from a certificate or key store. It is an abstract base class which
20848 // TLS library specific subtypes override.
20850 // Most common client applications will not directly interact with
20851 // #GTlsDatabase. It is used internally by #GTlsConnection.
20852 struct TlsDatabase /* : GObject.Object */ /* Version 2.30 */ {
20853 alias parent_instance this;
20854 alias parent_instance super_;
20855 alias parent_instance object;
20856 GObject2.Object parent_instance;
20857 TlsDatabasePrivate* priv;
20860 // VERSION: 2.30
20861 // Create a handle string for the certificate. The database will only be able
20862 // to create a handle for certificates that originate from the database. In
20863 // cases where the database cannot create a handle for a certificate, %NULL
20864 // will be returned.
20866 // This handle should be stable across various instances of the application,
20867 // and between applications. If a certificate is modified in the database,
20868 // then it is not guaranteed that this handle will continue to point to it.
20869 // RETURNS: a newly allocated string containing the handle.
20870 // <certificate>: certificate for which to create a handle.
20871 char* /*new*/ create_certificate_handle()(TlsCertificate* certificate) {
20872 return g_tls_database_create_certificate_handle(&this, certificate);
20875 // VERSION: 2.30
20876 // Lookup a certificate by its handle.
20878 // The handle should have been created by calling g_tls_database_create_handle()
20879 // on a #GTlsDatabase object of the same TLS backend. The handle is designed
20880 // to remain valid across instantiations of the database.
20882 // If the handle is no longer valid, or does not point to a certificate in
20883 // this database, then %NULL will be returned.
20885 // This function can block, use g_tls_database_lookup_certificate_for_handle_async() to perform
20886 // the lookup operation asynchronously.
20888 // #GTlsCertificate, or %NULL. Use g_object_unref() to release the certificate.
20889 // RETURNS: a newly allocated
20890 // <handle>: a certificate handle
20891 // <interaction>: used to interact with the user if necessary
20892 // <flags>: Flags which affect the lookup.
20893 // <cancellable>: a #GCancellable, or %NULL
20894 TlsCertificate* /*new*/ lookup_certificate_for_handle()(char* handle, TlsInteraction* interaction, TlsDatabaseLookupFlags flags, Cancellable* cancellable, GLib2.Error** error=null) {
20895 return g_tls_database_lookup_certificate_for_handle(&this, handle, interaction, flags, cancellable, error);
20898 // VERSION: 2.30
20899 // Asynchronously lookup a certificate by its handle in the database. See
20900 // g_tls_database_lookup_handle() for more information.
20901 // <handle>: a certificate handle
20902 // <interaction>: used to interact with the user if necessary
20903 // <flags>: Flags which affect the lookup.
20904 // <cancellable>: a #GCancellable, or %NULL
20905 // <callback>: callback to call when the operation completes
20906 // <user_data>: the data to pass to the callback function
20907 void lookup_certificate_for_handle_async()(char* handle, TlsInteraction* interaction, TlsDatabaseLookupFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
20908 g_tls_database_lookup_certificate_for_handle_async(&this, handle, interaction, flags, cancellable, callback, user_data);
20911 // VERSION: 2.30
20912 // Finish an asynchronous lookup of a certificate by its handle. See
20913 // g_tls_database_lookup_handle() for more information.
20915 // If the handle is no longer valid, or does not point to a certificate in
20916 // this database, then %NULL will be returned.
20918 // Use g_object_unref() to release the certificate.
20919 // RETURNS: a newly allocated #GTlsCertificate object.
20920 // <result>: a #GAsyncResult.
20921 TlsCertificate* /*new*/ lookup_certificate_for_handle_finish()(AsyncResult* result, GLib2.Error** error=null) {
20922 return g_tls_database_lookup_certificate_for_handle_finish(&this, result, error);
20925 // VERSION: 2.30
20926 // Lookup the issuer of @certificate in the database.
20928 // The %issuer property
20929 // of @certificate is not modified, and the two certificates are not hooked
20930 // into a chain.
20932 // This function can block, use g_tls_database_lookup_certificate_issuer_async() to perform
20933 // the lookup operation asynchronously.
20935 // or %NULL. Use g_object_unref() to release the certificate.
20936 // RETURNS: a newly allocated issuer #GTlsCertificate,
20937 // <certificate>: a #GTlsCertificate
20938 // <interaction>: used to interact with the user if necessary
20939 // <flags>: flags which affect the lookup operation
20940 // <cancellable>: a #GCancellable, or %NULL
20941 TlsCertificate* /*new*/ lookup_certificate_issuer()(TlsCertificate* certificate, TlsInteraction* interaction, TlsDatabaseLookupFlags flags, Cancellable* cancellable, GLib2.Error** error=null) {
20942 return g_tls_database_lookup_certificate_issuer(&this, certificate, interaction, flags, cancellable, error);
20945 // VERSION: 2.30
20946 // Asynchronously lookup the issuer of @certificate in the database. See
20947 // g_tls_database_lookup_certificate_issuer() for more information.
20948 // <certificate>: a #GTlsCertificate
20949 // <interaction>: used to interact with the user if necessary
20950 // <flags>: flags which affect the lookup operation
20951 // <cancellable>: a #GCancellable, or %NULL
20952 // <callback>: callback to call when the operation completes
20953 // <user_data>: the data to pass to the callback function
20954 void lookup_certificate_issuer_async()(TlsCertificate* certificate, TlsInteraction* interaction, TlsDatabaseLookupFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
20955 g_tls_database_lookup_certificate_issuer_async(&this, certificate, interaction, flags, cancellable, callback, user_data);
20958 // VERSION: 2.30
20959 // Finish an asynchronous lookup issuer operation. See
20960 // g_tls_database_lookup_certificate_issuer() for more information.
20962 // or %NULL. Use g_object_unref() to release the certificate.
20963 // RETURNS: a newly allocated issuer #GTlsCertificate,
20964 // <result>: a #GAsyncResult.
20965 TlsCertificate* /*new*/ lookup_certificate_issuer_finish()(AsyncResult* result, GLib2.Error** error=null) {
20966 return g_tls_database_lookup_certificate_issuer_finish(&this, result, error);
20969 // Unintrospectable method: lookup_certificates_issued_by() / g_tls_database_lookup_certificates_issued_by()
20970 // VERSION: 2.30
20971 // Lookup certificates issued by this issuer in the database.
20973 // This function can block, use g_tls_database_lookup_certificates_issued_by_async() to perform
20974 // the lookup operation asynchronously.
20976 // Use g_object_unref() on each certificate, and g_list_free() on the release the list.
20977 // RETURNS: a newly allocated list of #GTlsCertificate objects.
20978 // <issuer_raw_dn>: a #GByteArray which holds the DER encoded issuer DN.
20979 // <interaction>: used to interact with the user if necessary
20980 // <flags>: Flags which affect the lookup operation.
20981 // <cancellable>: a #GCancellable, or %NULL
20982 GLib2.List* /*new*/ lookup_certificates_issued_by()(ByteArray* issuer_raw_dn, TlsInteraction* interaction, TlsDatabaseLookupFlags flags, Cancellable* cancellable, GLib2.Error** error=null) {
20983 return g_tls_database_lookup_certificates_issued_by(&this, issuer_raw_dn, interaction, flags, cancellable, error);
20986 // VERSION: 2.30
20987 // Asynchronously lookup certificates issued by this issuer in the database. See
20988 // g_tls_database_lookup_certificates_issued_by() for more information.
20990 // The database may choose to hold a reference to the issuer byte array for the duration
20991 // of of this asynchronous operation. The byte array should not be modified during
20992 // this time.
20993 // <issuer_raw_dn>: a #GByteArray which holds the DER encoded issuer DN.
20994 // <interaction>: used to interact with the user if necessary
20995 // <flags>: Flags which affect the lookup operation.
20996 // <cancellable>: a #GCancellable, or %NULL
20997 // <callback>: callback to call when the operation completes
20998 // <user_data>: the data to pass to the callback function
20999 void lookup_certificates_issued_by_async()(ByteArray* issuer_raw_dn, TlsInteraction* interaction, TlsDatabaseLookupFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
21000 g_tls_database_lookup_certificates_issued_by_async(&this, issuer_raw_dn, interaction, flags, cancellable, callback, user_data);
21003 // Unintrospectable method: lookup_certificates_issued_by_finish() / g_tls_database_lookup_certificates_issued_by_finish()
21004 // VERSION: 2.30
21005 // Finish an asynchronous lookup of certificates. See
21006 // g_tls_database_lookup_certificates_issued_by() for more information.
21008 // Use g_object_unref() on each certificate, and g_list_free() on the release the list.
21009 // RETURNS: a newly allocated list of #GTlsCertificate objects.
21010 // <result>: a #GAsyncResult.
21011 GLib2.List* /*new*/ lookup_certificates_issued_by_finish()(AsyncResult* result, GLib2.Error** error=null) {
21012 return g_tls_database_lookup_certificates_issued_by_finish(&this, result, error);
21015 // VERSION: 2.30
21016 // Verify's a certificate chain after looking up and adding any missing
21017 // certificates to the chain.
21019 // @chain is a chain of #GTlsCertificate objects each pointing to the next
21020 // certificate in the chain by its %issuer property. The chain may initially
21021 // consist of one or more certificates. After the verification process is
21022 // complete, @chain may be modified by adding missing certificates, or removing
21023 // extra certificates. If a certificate anchor was found, then it is added to
21024 // the @chain.
21026 // @purpose describes the purpose (or usage) for which the certificate
21027 // is being used. Typically @purpose will be set to #G_TLS_DATABASE_PURPOSE_AUTHENTICATE_SERVER
21028 // which means that the certificate is being used to authenticate a server
21029 // (and we are acting as the client).
21031 // The @identity is used to check for pinned certificates (trust exceptions)
21032 // in the database. These will override the normal verification process on a
21033 // host by host basis.
21035 // Currently there are no @flags, and %G_TLS_DATABASE_VERIFY_NONE should be
21036 // used.
21038 // This function can block, use g_tls_database_verify_chain_async() to perform
21039 // the verification operation asynchronously.
21041 // result of verification.
21042 // RETURNS: the appropriate #GTlsCertificateFlags which represents the
21043 // <chain>: a #GTlsCertificate chain
21044 // <purpose>: the purpose that this certificate chain will be used for.
21045 // <identity>: the expected peer identity
21046 // <interaction>: used to interact with the user if necessary
21047 // <flags>: additional verify flags
21048 // <cancellable>: a #GCancellable, or %NULL
21049 TlsCertificateFlags verify_chain()(TlsCertificate* chain, char* purpose, SocketConnectable* identity, TlsInteraction* interaction, TlsDatabaseVerifyFlags flags, Cancellable* cancellable, GLib2.Error** error=null) {
21050 return g_tls_database_verify_chain(&this, chain, purpose, identity, interaction, flags, cancellable, error);
21053 // VERSION: 2.30
21054 // Asynchronously verify's a certificate chain after looking up and adding
21055 // any missing certificates to the chain. See g_tls_database_verify_chain()
21056 // for more information.
21057 // <chain>: a #GTlsCertificate chain
21058 // <purpose>: the purpose that this certificate chain will be used for.
21059 // <identity>: the expected peer identity
21060 // <interaction>: used to interact with the user if necessary
21061 // <flags>: additional verify flags
21062 // <cancellable>: a #GCancellable, or %NULL
21063 // <callback>: callback to call when the operation completes
21064 // <user_data>: the data to pass to the callback function
21065 void verify_chain_async()(TlsCertificate* chain, char* purpose, SocketConnectable* identity, TlsInteraction* interaction, TlsDatabaseVerifyFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
21066 g_tls_database_verify_chain_async(&this, chain, purpose, identity, interaction, flags, cancellable, callback, user_data);
21069 // VERSION: 2.30
21070 // Finish an asynchronous verify chain operation. See
21071 // g_tls_database_verify_chain() for more information. *
21072 // result of verification.
21073 // RETURNS: the appropriate #GTlsCertificateFlags which represents the
21074 // <result>: a #GAsyncResult.
21075 TlsCertificateFlags verify_chain_finish()(AsyncResult* result, GLib2.Error** error=null) {
21076 return g_tls_database_verify_chain_finish(&this, result, error);
21080 struct TlsDatabaseClass {
21081 GObject2.ObjectClass parent_class;
21083 // RETURNS: the appropriate #GTlsCertificateFlags which represents the
21084 // <chain>: a #GTlsCertificate chain
21085 // <purpose>: the purpose that this certificate chain will be used for.
21086 // <identity>: the expected peer identity
21087 // <interaction>: used to interact with the user if necessary
21088 // <flags>: additional verify flags
21089 // <cancellable>: a #GCancellable, or %NULL
21090 extern (C) TlsCertificateFlags function (TlsDatabase* self, TlsCertificate* chain, char* purpose, SocketConnectable* identity, TlsInteraction* interaction, TlsDatabaseVerifyFlags flags, Cancellable* cancellable, GLib2.Error** error=null) verify_chain;
21092 // <chain>: a #GTlsCertificate chain
21093 // <purpose>: the purpose that this certificate chain will be used for.
21094 // <identity>: the expected peer identity
21095 // <interaction>: used to interact with the user if necessary
21096 // <flags>: additional verify flags
21097 // <cancellable>: a #GCancellable, or %NULL
21098 // <callback>: callback to call when the operation completes
21099 // <user_data>: the data to pass to the callback function
21100 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;
21102 // RETURNS: the appropriate #GTlsCertificateFlags which represents the
21103 // <result>: a #GAsyncResult.
21104 extern (C) TlsCertificateFlags function (TlsDatabase* self, AsyncResult* result, GLib2.Error** error=null) verify_chain_finish;
21106 // RETURNS: a newly allocated string containing the handle.
21107 // <certificate>: certificate for which to create a handle.
21108 extern (C) char* /*new*/ function (TlsDatabase* self, TlsCertificate* certificate) create_certificate_handle;
21110 // RETURNS: a newly allocated
21111 // <handle>: a certificate handle
21112 // <interaction>: used to interact with the user if necessary
21113 // <flags>: Flags which affect the lookup.
21114 // <cancellable>: a #GCancellable, or %NULL
21115 extern (C) TlsCertificate* /*new*/ function (TlsDatabase* self, char* handle, TlsInteraction* interaction, TlsDatabaseLookupFlags flags, Cancellable* cancellable, GLib2.Error** error=null) lookup_certificate_for_handle;
21117 // <handle>: a certificate handle
21118 // <interaction>: used to interact with the user if necessary
21119 // <flags>: Flags which affect the lookup.
21120 // <cancellable>: a #GCancellable, or %NULL
21121 // <callback>: callback to call when the operation completes
21122 // <user_data>: the data to pass to the callback function
21123 extern (C) void function (TlsDatabase* self, char* handle, TlsInteraction* interaction, TlsDatabaseLookupFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) lookup_certificate_for_handle_async;
21125 // RETURNS: a newly allocated #GTlsCertificate object.
21126 // <result>: a #GAsyncResult.
21127 extern (C) TlsCertificate* /*new*/ function (TlsDatabase* self, AsyncResult* result, GLib2.Error** error=null) lookup_certificate_for_handle_finish;
21129 // RETURNS: a newly allocated issuer #GTlsCertificate,
21130 // <certificate>: a #GTlsCertificate
21131 // <interaction>: used to interact with the user if necessary
21132 // <flags>: flags which affect the lookup operation
21133 // <cancellable>: a #GCancellable, or %NULL
21134 extern (C) TlsCertificate* /*new*/ function (TlsDatabase* self, TlsCertificate* certificate, TlsInteraction* interaction, TlsDatabaseLookupFlags flags, Cancellable* cancellable, GLib2.Error** error=null) lookup_certificate_issuer;
21136 // <certificate>: a #GTlsCertificate
21137 // <interaction>: used to interact with the user if necessary
21138 // <flags>: flags which affect the lookup operation
21139 // <cancellable>: a #GCancellable, or %NULL
21140 // <callback>: callback to call when the operation completes
21141 // <user_data>: the data to pass to the callback function
21142 extern (C) void function (TlsDatabase* self, TlsCertificate* certificate, TlsInteraction* interaction, TlsDatabaseLookupFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) lookup_certificate_issuer_async;
21144 // RETURNS: a newly allocated issuer #GTlsCertificate,
21145 // <result>: a #GAsyncResult.
21146 extern (C) TlsCertificate* /*new*/ function (TlsDatabase* self, AsyncResult* result, GLib2.Error** error=null) lookup_certificate_issuer_finish;
21148 // Unintrospectable functionp: lookup_certificates_issued_by() / ()
21150 // RETURNS: a newly allocated list of #GTlsCertificate objects.
21151 // <issuer_raw_dn>: a #GByteArray which holds the DER encoded issuer DN.
21152 // <interaction>: used to interact with the user if necessary
21153 // <flags>: Flags which affect the lookup operation.
21154 // <cancellable>: a #GCancellable, or %NULL
21155 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;
21157 // <issuer_raw_dn>: a #GByteArray which holds the DER encoded issuer DN.
21158 // <interaction>: used to interact with the user if necessary
21159 // <flags>: Flags which affect the lookup operation.
21160 // <cancellable>: a #GCancellable, or %NULL
21161 // <callback>: callback to call when the operation completes
21162 // <user_data>: the data to pass to the callback function
21163 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;
21165 // Unintrospectable functionp: lookup_certificates_issued_by_finish() / ()
21167 // RETURNS: a newly allocated list of #GTlsCertificate objects.
21168 // <result>: a #GAsyncResult.
21169 extern (C) GLib2.List* /*new*/ function (TlsDatabase* self, AsyncResult* result, GLib2.Error** error=null) lookup_certificates_issued_by_finish;
21170 private void*[16] padding;
21174 // Flags for g_tls_database_lookup_handle(), g_tls_database_lookup_issuer(),
21175 // and g_tls_database_lookup_issued().
21176 enum TlsDatabaseLookupFlags /* Version 2.30 */ {
21177 NONE = 0,
21178 KEYPAIR = 1
21180 struct TlsDatabasePrivate {
21183 // Flags for g_tls_database_verify_chain().
21184 enum TlsDatabaseVerifyFlags /* Version 2.30 */ {
21185 NONE = 0
21188 // An error code used with %G_TLS_ERROR in a #GError returned from a
21189 // TLS-related routine.
21190 enum TlsError /* Version 2.28 */ {
21191 UNAVAILABLE = 0,
21192 MISC = 1,
21193 BAD_CERTIFICATE = 2,
21194 NOT_TLS = 3,
21195 HANDSHAKE = 4,
21196 CERTIFICATE_REQUIRED = 5,
21197 EOF = 6
21200 // #GTlsFileDatabase is implemented by #GTlsDatabase objects which load
21201 // their certificate information from a file. It is in interface which
21202 // TLS library specific subtypes implement.
21203 struct TlsFileDatabase /* Interface */ /* Version 2.30 */ {
21204 mixin template __interface__() {
21205 // VERSION: 2.30
21206 // Creates a new #GTlsFileDatabase which uses anchor certificate authorities
21207 // in @anchors to verify certificate chains.
21209 // The certificates in @anchors must be PEM encoded.
21210 // RETURNS: the new #GTlsFileDatabase, or %NULL on error
21211 // <anchors>: filename of anchor certificate authorities.
21212 static TlsDatabase* /*new*/ new_()(char* anchors, GLib2.Error** error=null) {
21213 return g_tls_file_database_new(anchors, error);
21216 mixin __interface__;
21219 // Provides an interface for #GTlsFileDatabase implementations.
21220 struct TlsFileDatabaseInterface {
21221 GObject2.TypeInterface g_iface;
21222 private void*[8] padding;
21226 // #GTlsInteraction provides a mechanism for the TLS connection and database
21227 // code to interact with the user. It can be used to ask the user for passwords.
21229 // To use a #GTlsInteraction with a TLS connection use
21230 // g_tls_connection_set_interaction().
21232 // Callers should instantiate a derived class that implements the various
21233 // interaction methods to show the required dialogs.
21235 // Callers should use the 'invoke' functions like
21236 // g_tls_interaction_invoke_ask_password() to run interaction methods. These
21237 // functions make sure that the interaction is invoked in the main loop
21238 // and not in the current thread, if the current thread is not running the
21239 // main loop.
21241 // Derived classes can choose to implement whichever interactions methods they'd
21242 // like to support by overriding those virtual methods in their class
21243 // initialization function. Any interactions not implemented will return
21244 // %G_TLS_INTERACTION_UNHANDLED. If a derived class implements an async method,
21245 // it must also implement the corresponding finish method.
21246 struct TlsInteraction /* : GObject.Object */ /* Version 2.30 */ {
21247 alias parent_instance this;
21248 alias parent_instance super_;
21249 alias parent_instance object;
21250 GObject2.Object parent_instance;
21251 private TlsInteractionPrivate* priv;
21254 // VERSION: 2.30
21255 // Run synchronous interaction to ask the user for a password. In general,
21256 // g_tls_interaction_invoke_ask_password() should be used instead of this
21257 // function.
21259 // Derived subclasses usually implement a password prompt, although they may
21260 // also choose to provide a password from elsewhere. The @password value will
21261 // be filled in and then @callback will be called. Alternatively the user may
21262 // abort this password request, which will usually abort the TLS connection.
21264 // If the interaction is cancelled by the cancellation object, or by the
21265 // user then %G_TLS_INTERACTION_FAILED will be returned with an error that
21266 // contains a %G_IO_ERROR_CANCELLED error code. Certain implementations may
21267 // not support immediate cancellation.
21268 // RETURNS: The status of the ask password interaction.
21269 // <password>: a #GTlsPassword object
21270 // <cancellable>: an optional #GCancellable cancellation object
21271 TlsInteractionResult ask_password()(TlsPassword* password, Cancellable* cancellable, GLib2.Error** error=null) {
21272 return g_tls_interaction_ask_password(&this, password, cancellable, error);
21275 // VERSION: 2.30
21276 // Run asynchronous interaction to ask the user for a password. In general,
21277 // g_tls_interaction_invoke_ask_password() should be used instead of this
21278 // function.
21280 // Derived subclasses usually implement a password prompt, although they may
21281 // also choose to provide a password from elsewhere. The @password value will
21282 // be filled in and then @callback will be called. Alternatively the user may
21283 // abort this password request, which will usually abort the TLS connection.
21285 // If the interaction is cancelled by the cancellation object, or by the
21286 // user then %G_TLS_INTERACTION_FAILED will be returned with an error that
21287 // contains a %G_IO_ERROR_CANCELLED error code. Certain implementations may
21288 // not support immediate cancellation.
21290 // Certain implementations may not support immediate cancellation.
21291 // <password>: a #GTlsPassword object
21292 // <cancellable>: an optional #GCancellable cancellation object
21293 // <callback>: will be called when the interaction completes
21294 // <user_data>: data to pass to the @callback
21295 void ask_password_async()(TlsPassword* password, Cancellable* cancellable=null, AsyncReadyCallback callback=null, void* user_data=null) {
21296 g_tls_interaction_ask_password_async(&this, password, cancellable, callback, user_data);
21299 // VERSION: 2.30
21300 // Complete an ask password user interaction request. This should be once
21301 // the g_tls_interaction_ask_password_async() completion callback is called.
21303 // If %G_TLS_INTERACTION_HANDLED is returned, then the #GTlsPassword passed
21304 // to g_tls_interaction_ask_password() will have its password filled in.
21306 // If the interaction is cancelled by the cancellation object, or by the
21307 // user then %G_TLS_INTERACTION_FAILED will be returned with an error that
21308 // contains a %G_IO_ERROR_CANCELLED error code.
21309 // RETURNS: The status of the ask password interaction.
21310 // <result>: the result passed to the callback
21311 TlsInteractionResult ask_password_finish()(AsyncResult* result, GLib2.Error** error=null) {
21312 return g_tls_interaction_ask_password_finish(&this, result, error);
21315 // VERSION: 2.30
21316 // Invoke the interaction to ask the user for a password. It invokes this
21317 // interaction in the main loop, specifically the #GMainContext returned by
21318 // g_main_context_get_thread_default() when the interaction is created. This
21319 // is called by called by #GTlsConnection or #GTlsDatabase to ask the user
21320 // for a password.
21322 // Derived subclasses usually implement a password prompt, although they may
21323 // also choose to provide a password from elsewhere. The @password value will
21324 // be filled in and then @callback will be called. Alternatively the user may
21325 // abort this password request, which will usually abort the TLS connection.
21327 // The implementation can either be a synchronous (eg: modal dialog) or an
21328 // asynchronous one (eg: modeless dialog). This function will take care of
21329 // calling which ever one correctly.
21331 // If the interaction is cancelled by the cancellation object, or by the
21332 // user then %G_TLS_INTERACTION_FAILED will be returned with an error that
21333 // contains a %G_IO_ERROR_CANCELLED error code. Certain implementations may
21334 // not support immediate cancellation.
21335 // RETURNS: The status of the ask password interaction.
21336 // <password>: a #GTlsPassword object
21337 // <cancellable>: an optional #GCancellable cancellation object
21338 TlsInteractionResult invoke_ask_password()(TlsPassword* password, Cancellable* cancellable, GLib2.Error** error=null) {
21339 return g_tls_interaction_invoke_ask_password(&this, password, cancellable, error);
21344 // The class for #GTlsInteraction. Derived classes implement the various
21345 // virtual interaction methods to handle TLS interactions.
21347 // Derived classes can choose to implement whichever interactions methods they'd
21348 // like to support by overriding those virtual methods in their class
21349 // initialization function. If a derived class implements an async method,
21350 // it must also implement the corresponding finish method.
21352 // The synchronous interaction methods should implement to display modal dialogs,
21353 // and the asynchronous methods to display modeless dialogs.
21355 // If the user cancels an interaction, then the result should be
21356 // %G_TLS_INTERACTION_FAILED and the error should be set with a domain of
21357 // %G_IO_ERROR and code of %G_IO_ERROR_CANCELLED.
21358 struct TlsInteractionClass /* Version 2.30 */ {
21359 private GObject2.ObjectClass parent_class;
21361 // RETURNS: The status of the ask password interaction.
21362 // <password>: a #GTlsPassword object
21363 // <cancellable>: an optional #GCancellable cancellation object
21364 extern (C) TlsInteractionResult function (TlsInteraction* interaction, TlsPassword* password, Cancellable* cancellable, GLib2.Error** error=null) ask_password;
21366 // <password>: a #GTlsPassword object
21367 // <cancellable>: an optional #GCancellable cancellation object
21368 // <callback>: will be called when the interaction completes
21369 // <user_data>: data to pass to the @callback
21370 extern (C) void function (TlsInteraction* interaction, TlsPassword* password, Cancellable* cancellable=null, AsyncReadyCallback callback=null, void* user_data=null) ask_password_async;
21372 // RETURNS: The status of the ask password interaction.
21373 // <result>: the result passed to the callback
21374 extern (C) TlsInteractionResult function (TlsInteraction* interaction, AsyncResult* result, GLib2.Error** error=null) ask_password_finish;
21375 private void*[24] padding;
21378 struct TlsInteractionPrivate {
21382 // #GTlsInteractionResult is returned by various functions in #GTlsInteraction
21383 // when finishing an interaction request.
21384 enum TlsInteractionResult /* Version 2.30 */ {
21385 UNHANDLED = 0,
21386 HANDLED = 1,
21387 FAILED = 2
21389 // Holds a password used in TLS.
21390 struct TlsPassword /* : GObject.Object */ /* Version 2.30 */ {
21391 alias parent_instance this;
21392 alias parent_instance super_;
21393 alias parent_instance object;
21394 GObject2.Object parent_instance;
21395 TlsPasswordPrivate* priv;
21398 // Create a new #GTlsPassword object.
21399 // RETURNS: The newly allocated password object
21400 // <flags>: the password flags
21401 // <description>: description of what the password is for
21402 static TlsPassword* /*new*/ new_()(TlsPasswordFlags flags, char* description) {
21403 return g_tls_password_new(flags, description);
21406 // VERSION: 2.30
21407 // Get a description string about what the password will be used for.
21408 // RETURNS: The description of the password.
21409 char* get_description()() {
21410 return g_tls_password_get_description(&this);
21413 // VERSION: 2.30
21414 // Get flags about the password.
21415 // RETURNS: The flags about the password.
21416 TlsPasswordFlags get_flags()() {
21417 return g_tls_password_get_flags(&this);
21420 // VERSION: 2.30
21421 // Get the password value. If @length is not %NULL then it will be filled
21422 // in with the length of the password value.
21423 // RETURNS: The password value owned by the password object.
21424 // <length>: location to place the length of the password.
21425 ubyte* get_value()(size_t* length=null) {
21426 return g_tls_password_get_value(&this, length);
21429 // VERSION: 2.30
21430 // Get a user readable translated warning. Usually this warning is a
21431 // representation of the password flags returned from
21432 // g_tls_password_get_flags().
21433 // RETURNS: The warning.
21434 char* get_warning()() {
21435 return g_tls_password_get_warning(&this);
21438 // VERSION: 2.30
21439 // Set a description string about what the password will be used for.
21440 // <description>: The description of the password
21441 void set_description()(char* description) {
21442 g_tls_password_set_description(&this, description);
21445 // VERSION: 2.30
21446 // Set flags about the password.
21447 // <flags>: The flags about the password
21448 void set_flags()(TlsPasswordFlags flags) {
21449 g_tls_password_set_flags(&this, flags);
21452 // VERSION: 2.30
21453 // Set the value for this password. The @value will be copied by the password
21454 // object.
21456 // Specify the @length, for a non-null-terminated password. Pass -1 as
21457 // @length if using a null-terminated password, and @length will be calculated
21458 // automatically.
21459 // <value>: the new password value
21460 // <length>: the length of the password, or -1
21461 void set_value()(ubyte* value, ssize_t length) {
21462 g_tls_password_set_value(&this, value, length);
21465 // VERSION: 2.30
21466 // Provide the value for this password.
21468 // The @value will be owned by the password object, and later freed using
21469 // the @destroy function callback.
21471 // Specify the @length, for a non-null-terminated password. Pass -1 as
21472 // @length if using a null-terminated password, and @length will be calculated
21473 // automatically.
21474 // <value>: the value for the password
21475 // <length>: the length of the password, or -1
21476 // <destroy>: a function to use to free the password.
21477 void set_value_full()(ubyte* value, ssize_t length, GLib2.DestroyNotify destroy=null) {
21478 g_tls_password_set_value_full(&this, value, length, destroy);
21481 // VERSION: 2.30
21482 // Set a user readable translated warning. Usually this warning is a
21483 // representation of the password flags returned from
21484 // g_tls_password_get_flags().
21485 // <warning>: The user readable warning
21486 void set_warning()(char* warning) {
21487 g_tls_password_set_warning(&this, warning);
21491 struct TlsPasswordClass {
21492 GObject2.ObjectClass parent_class;
21494 // RETURNS: The password value owned by the password object.
21495 // <length>: location to place the length of the password.
21496 extern (C) ubyte* function (TlsPassword* password, size_t* length=null) get_value;
21497 extern (C) void function (TlsPassword* password, ubyte* value, ssize_t length, GLib2.DestroyNotify destroy) set_value;
21498 extern (C) char* function (TlsPassword* password) get_default_warning;
21499 private void*[4] padding;
21502 // Various flags for the password.
21503 enum TlsPasswordFlags /* Version 2.30 */ {
21504 NONE = 0,
21505 RETRY = 2,
21506 MANY_TRIES = 4,
21507 FINAL_TRY = 8
21509 struct TlsPasswordPrivate {
21513 // When to allow rehandshaking. See
21514 // g_tls_connection_set_rehandshake_mode().
21515 enum TlsRehandshakeMode /* Version 2.28 */ {
21516 NEVER = 0,
21517 SAFELY = 1,
21518 UNSAFELY = 2
21521 // #GTlsServerConnection is the server-side subclass of #GTlsConnection,
21522 // representing a server-side TLS connection.
21523 struct TlsServerConnection /* Interface */ /* Version 2.28 */ {
21524 mixin template __interface__() {
21525 // VERSION: 2.28
21526 // Creates a new #GTlsServerConnection wrapping @base_io_stream (which
21527 // must have pollable input and output streams).
21528 // RETURNS: the new #GTlsServerConnection, or %NULL on error
21529 // <base_io_stream>: the #GIOStream to wrap
21530 // <certificate>: the default server certificate, or %NULL
21531 static IOStream* /*new*/ new_()(IOStream* base_io_stream, TlsCertificate* certificate, GLib2.Error** error=null) {
21532 return g_tls_server_connection_new(base_io_stream, certificate, error);
21535 mixin __interface__;
21538 struct TlsServerConnectionInterface {
21539 GObject2.TypeInterface g_iface;
21543 // This is the subclass of #GSocketConnection that is created
21544 // for UNIX domain sockets.
21546 // It contains functions to do some of the UNIX socket specific
21547 // functionality like passing file descriptors.
21549 // Note that <filename>&lt;gio/gunixconnection.h&gt;</filename> belongs to
21550 // the UNIX-specific GIO interfaces, thus you have to use the
21551 // <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
21552 struct UnixConnection /* : SocketConnection */ {
21553 alias parent_instance this;
21554 alias parent_instance super_;
21555 alias parent_instance socketconnection;
21556 SocketConnection parent_instance;
21557 UnixConnectionPrivate* priv;
21560 // VERSION: 2.26
21561 // Receives credentials from the sending end of the connection. The
21562 // sending end has to call g_unix_connection_send_credentials() (or
21563 // similar) for this to work.
21565 // As well as reading the credentials this also reads (and discards) a
21566 // single byte from the stream, as this is required for credentials
21567 // passing to work on some implementations.
21569 // Other ways to exchange credentials with a foreign peer includes the
21570 // #GUnixCredentialsMessage type and g_socket_get_credentials() function.
21572 // g_object_unref()), %NULL if @error is set.
21573 // RETURNS: Received credentials on success (free with
21574 // <cancellable>: A #GCancellable or %NULL.
21575 Credentials* /*new*/ receive_credentials()(Cancellable* cancellable, GLib2.Error** error=null) {
21576 return g_unix_connection_receive_credentials(&this, cancellable, error);
21579 // VERSION: 2.22
21580 // Receives a file descriptor from the sending end of the connection.
21581 // The sending end has to call g_unix_connection_send_fd() for this
21582 // to work.
21584 // As well as reading the fd this also reads a single byte from the
21585 // stream, as this is required for fd passing to work on some
21586 // implementations.
21587 // RETURNS: a file descriptor on success, -1 on error.
21588 // <cancellable>: optional #GCancellable object, %NULL to ignore
21589 int receive_fd()(Cancellable* cancellable, GLib2.Error** error=null) {
21590 return g_unix_connection_receive_fd(&this, cancellable, error);
21593 // VERSION: 2.26
21594 // Passes the credentials of the current user the receiving side
21595 // of the connection. The receiving end has to call
21596 // g_unix_connection_receive_credentials() (or similar) to accept the
21597 // credentials.
21599 // As well as sending the credentials this also writes a single NUL
21600 // byte to the stream, as this is required for credentials passing to
21601 // work on some implementations.
21603 // Other ways to exchange credentials with a foreign peer includes the
21604 // #GUnixCredentialsMessage type and g_socket_get_credentials() function.
21605 // RETURNS: %TRUE on success, %FALSE if @error is set.
21606 // <cancellable>: A #GCancellable or %NULL.
21607 int send_credentials()(Cancellable* cancellable, GLib2.Error** error=null) {
21608 return g_unix_connection_send_credentials(&this, cancellable, error);
21611 // VERSION: 2.22
21612 // Passes a file descriptor to the receiving side of the
21613 // connection. The receiving end has to call g_unix_connection_receive_fd()
21614 // to accept the file descriptor.
21616 // As well as sending the fd this also writes a single byte to the
21617 // stream, as this is required for fd passing to work on some
21618 // implementations.
21619 // RETURNS: a %TRUE on success, %NULL on error.
21620 // <fd>: a file descriptor
21621 // <cancellable>: optional #GCancellable object, %NULL to ignore.
21622 int send_fd()(int fd, Cancellable* cancellable, GLib2.Error** error=null) {
21623 return g_unix_connection_send_fd(&this, fd, cancellable, error);
21627 struct UnixConnectionClass {
21628 SocketConnectionClass parent_class;
21631 struct UnixConnectionPrivate {
21635 // This #GSocketControlMessage contains a #GCredentials instance. It
21636 // may be sent using g_socket_send_message() and received using
21637 // g_socket_receive_message() over UNIX sockets (ie: sockets in the
21638 // %G_SOCKET_FAMILY_UNIX family).
21640 // For an easier way to send and receive credentials over
21641 // stream-oriented UNIX sockets, see
21642 // g_unix_connection_send_credentials() and
21643 // g_unix_connection_receive_credentials(). To receive credentials of
21644 // a foreign process connected to a socket, use
21645 // g_socket_get_credentials().
21646 struct UnixCredentialsMessage /* : SocketControlMessage */ /* Version 2.26 */ {
21647 alias parent_instance this;
21648 alias parent_instance super_;
21649 alias parent_instance socketcontrolmessage;
21650 SocketControlMessage parent_instance;
21651 UnixCredentialsMessagePrivate* priv;
21654 // VERSION: 2.26
21655 // Creates a new #GUnixCredentialsMessage with credentials matching the current processes.
21656 // RETURNS: a new #GUnixCredentialsMessage
21657 static UnixCredentialsMessage* /*new*/ new_()() {
21658 return g_unix_credentials_message_new();
21661 // VERSION: 2.26
21662 // Creates a new #GUnixCredentialsMessage holding @credentials.
21663 // RETURNS: a new #GUnixCredentialsMessage
21664 // <credentials>: A #GCredentials object.
21665 static UnixCredentialsMessage* /*new*/ new_with_credentials()(Credentials* credentials) {
21666 return g_unix_credentials_message_new_with_credentials(credentials);
21669 // VERSION: 2.26
21670 // Checks if passing #GCredentials on a #GSocket is supported on this platform.
21671 // RETURNS: %TRUE if supported, %FALSE otherwise
21672 static int is_supported()() {
21673 return g_unix_credentials_message_is_supported();
21676 // VERSION: 2.26
21677 // Gets the credentials stored in @message.
21678 // RETURNS: A #GCredentials instance. Do not free, it is owned by @message.
21679 Credentials* get_credentials()() {
21680 return g_unix_credentials_message_get_credentials(&this);
21684 // Class structure for #GUnixCredentialsMessage.
21685 struct UnixCredentialsMessageClass /* Version 2.26 */ {
21686 SocketControlMessageClass parent_class;
21687 extern (C) void function () _g_reserved1;
21688 extern (C) void function () _g_reserved2;
21691 struct UnixCredentialsMessagePrivate {
21695 // A #GUnixFDList contains a list of file descriptors. It owns the file
21696 // descriptors that it contains, closing them when finalized.
21698 // It may be wrapped in a #GUnixFDMessage and sent over a #GSocket in
21699 // the %G_SOCKET_ADDRESS_UNIX family by using g_socket_send_message()
21700 // and received using g_socket_receive_message().
21702 // Note that <filename>&lt;gio/gunixfdlist.h&gt;</filename> belongs to
21703 // the UNIX-specific GIO interfaces, thus you have to use the
21704 // <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
21705 struct UnixFDList /* : GObject.Object */ {
21706 alias parent_instance this;
21707 alias parent_instance super_;
21708 alias parent_instance object;
21709 GObject2.Object parent_instance;
21710 UnixFDListPrivate* priv;
21713 // VERSION: 2.24
21714 // Creates a new #GUnixFDList containing no file descriptors.
21715 // RETURNS: a new #GUnixFDList
21716 static UnixFDList* /*new*/ new_()() {
21717 return g_unix_fd_list_new();
21720 // VERSION: 2.24
21721 // Creates a new #GUnixFDList containing the file descriptors given in
21722 // @fds. The file descriptors become the property of the new list and
21723 // may no longer be used by the caller. The array itself is owned by
21724 // the caller.
21726 // Each file descriptor in the array should be set to close-on-exec.
21728 // If @n_fds is -1 then @fds must be terminated with -1.
21729 // RETURNS: a new #GUnixFDList
21730 // <fds>: the initial list of file descriptors
21731 // <n_fds>: the length of #fds, or -1
21732 static UnixFDList* /*new*/ new_from_array()(int* fds, int n_fds) {
21733 return g_unix_fd_list_new_from_array(fds, n_fds);
21736 // VERSION: 2.24
21737 // Adds a file descriptor to @list.
21739 // The file descriptor is duplicated using dup(). You keep your copy
21740 // of the descriptor and the copy contained in @list will be closed
21741 // when @list is finalized.
21743 // A possible cause of failure is exceeding the per-process or
21744 // system-wide file descriptor limit.
21746 // The index of the file descriptor in the list is returned. If you use
21747 // this index with g_unix_fd_list_get() then you will receive back a
21748 // duplicated copy of the same file descriptor.
21750 // (and @error is set)
21751 // RETURNS: the index of the appended fd in case of success, else -1
21752 // <fd>: a valid open file descriptor
21753 int append()(int fd, GLib2.Error** error=null) {
21754 return g_unix_fd_list_append(&this, fd, error);
21757 // VERSION: 2.24
21758 // Gets a file descriptor out of @list.
21760 // @index_ specifies the index of the file descriptor to get. It is a
21761 // programmer error for @index_ to be out of range; see
21762 // g_unix_fd_list_get_length().
21764 // The file descriptor is duplicated using dup() and set as
21765 // close-on-exec before being returned. You must call close() on it
21766 // when you are done.
21768 // A possible cause of failure is exceeding the per-process or
21769 // system-wide file descriptor limit.
21770 // RETURNS: the file descriptor, or -1 in case of error
21771 // <index_>: the index into the list
21772 int get()(int index_, GLib2.Error** error=null) {
21773 return g_unix_fd_list_get(&this, index_, error);
21776 // VERSION: 2.24
21777 // Gets the length of @list (ie: the number of file descriptors
21778 // contained within).
21779 // RETURNS: the length of @list
21780 int get_length()() {
21781 return g_unix_fd_list_get_length(&this);
21784 // VERSION: 2.24
21785 // Returns the array of file descriptors that is contained in this
21786 // object.
21788 // After this call, the descriptors remain the property of @list. The
21789 // caller must not close them and must not free the array. The array is
21790 // valid only until @list is changed in any way.
21792 // If @length is non-%NULL then it is set to the number of file
21793 // descriptors in the returned array. The returned array is also
21794 // terminated with -1.
21796 // This function never returns %NULL. In case there are no file
21797 // descriptors contained in @list, an empty array is returned.
21799 // descriptors
21800 // RETURNS: an array of file
21801 // <length>: pointer to the length of the returned array, or %NULL
21802 int* peek_fds()(/*out*/ int* length=null) {
21803 return g_unix_fd_list_peek_fds(&this, length);
21806 // VERSION: 2.24
21807 // Returns the array of file descriptors that is contained in this
21808 // object.
21810 // After this call, the descriptors are no longer contained in
21811 // @list. Further calls will return an empty list (unless more
21812 // descriptors have been added).
21814 // The return result of this function must be freed with g_free().
21815 // The caller is also responsible for closing all of the file
21816 // descriptors. The file descriptors in the array are set to
21817 // close-on-exec.
21819 // If @length is non-%NULL then it is set to the number of file
21820 // descriptors in the returned array. The returned array is also
21821 // terminated with -1.
21823 // This function never returns %NULL. In case there are no file
21824 // descriptors contained in @list, an empty array is returned.
21826 // descriptors
21827 // RETURNS: an array of file
21828 // <length>: pointer to the length of the returned array, or %NULL
21829 int* /*new*/ steal_fds()(/*out*/ int* length=null) {
21830 return g_unix_fd_list_steal_fds(&this, length);
21834 struct UnixFDListClass {
21835 GObject2.ObjectClass parent_class;
21836 extern (C) void function () _g_reserved1;
21837 extern (C) void function () _g_reserved2;
21838 extern (C) void function () _g_reserved3;
21839 extern (C) void function () _g_reserved4;
21840 extern (C) void function () _g_reserved5;
21843 struct UnixFDListPrivate {
21847 // This #GSocketControlMessage contains a #GUnixFDList.
21848 // It may be sent using g_socket_send_message() and received using
21849 // g_socket_receive_message() over UNIX sockets (ie: sockets in the
21850 // %G_SOCKET_ADDRESS_UNIX family). The file descriptors are copied
21851 // between processes by the kernel.
21853 // For an easier way to send and receive file descriptors over
21854 // stream-oriented UNIX sockets, see g_unix_connection_send_fd() and
21855 // g_unix_connection_receive_fd().
21857 // Note that <filename>&lt;gio/gunixfdmessage.h&gt;</filename> belongs to
21858 // the UNIX-specific GIO interfaces, thus you have to use the
21859 // <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
21860 struct UnixFDMessage /* : SocketControlMessage */ {
21861 alias parent_instance this;
21862 alias parent_instance super_;
21863 alias parent_instance socketcontrolmessage;
21864 SocketControlMessage parent_instance;
21865 UnixFDMessagePrivate* priv;
21868 // VERSION: 2.22
21869 // Creates a new #GUnixFDMessage containing an empty file descriptor
21870 // list.
21871 // RETURNS: a new #GUnixFDMessage
21872 static UnixFDMessage* /*new*/ new_()() {
21873 return g_unix_fd_message_new();
21876 // VERSION: 2.24
21877 // Creates a new #GUnixFDMessage containing @list.
21878 // RETURNS: a new #GUnixFDMessage
21879 // <fd_list>: a #GUnixFDList
21880 static UnixFDMessage* /*new*/ new_with_fd_list()(UnixFDList* fd_list) {
21881 return g_unix_fd_message_new_with_fd_list(fd_list);
21884 // VERSION: 2.22
21885 // Adds a file descriptor to @message.
21887 // The file descriptor is duplicated using dup(). You keep your copy
21888 // of the descriptor and the copy contained in @message will be closed
21889 // when @message is finalized.
21891 // A possible cause of failure is exceeding the per-process or
21892 // system-wide file descriptor limit.
21893 // RETURNS: %TRUE in case of success, else %FALSE (and @error is set)
21894 // <fd>: a valid open file descriptor
21895 int append_fd()(int fd, GLib2.Error** error=null) {
21896 return g_unix_fd_message_append_fd(&this, fd, error);
21899 // VERSION: 2.24
21900 // Gets the #GUnixFDList contained in @message. This function does not
21901 // return a reference to the caller, but the returned list is valid for
21902 // the lifetime of @message.
21903 // RETURNS: the #GUnixFDList from @message
21904 UnixFDList* get_fd_list()() {
21905 return g_unix_fd_message_get_fd_list(&this);
21908 // VERSION: 2.22
21909 // Returns the array of file descriptors that is contained in this
21910 // object.
21912 // After this call, the descriptors are no longer contained in
21913 // @message. Further calls will return an empty list (unless more
21914 // descriptors have been added).
21916 // The return result of this function must be freed with g_free().
21917 // The caller is also responsible for closing all of the file
21918 // descriptors.
21920 // If @length is non-%NULL then it is set to the number of file
21921 // descriptors in the returned array. The returned array is also
21922 // terminated with -1.
21924 // This function never returns %NULL. In case there are no file
21925 // descriptors contained in @message, an empty array is returned.
21927 // descriptors
21928 // RETURNS: an array of file
21929 // <length>: pointer to the length of the returned array, or %NULL
21930 int* /*new*/ steal_fds()(/*out*/ int* length=null) {
21931 return g_unix_fd_message_steal_fds(&this, length);
21935 struct UnixFDMessageClass {
21936 SocketControlMessageClass parent_class;
21937 extern (C) void function () _g_reserved1;
21938 extern (C) void function () _g_reserved2;
21941 struct UnixFDMessagePrivate {
21945 // #GUnixInputStream implements #GInputStream for reading from a
21946 // UNIX file descriptor, including asynchronous operations. The file
21947 // descriptor must be selectable, so it doesn't work with opened files.
21949 // Note that <filename>&lt;gio/gunixinputstream.h&gt;</filename> belongs
21950 // to the UNIX-specific GIO interfaces, thus you have to use the
21951 // <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
21952 struct UnixInputStream /* : InputStream */ {
21953 mixin PollableInputStream.__interface__;
21954 alias parent_instance this;
21955 alias parent_instance super_;
21956 alias parent_instance inputstream;
21957 InputStream parent_instance;
21958 private UnixInputStreamPrivate* priv;
21961 // Creates a new #GUnixInputStream for the given @fd.
21963 // If @close_fd is %TRUE, the file descriptor will be closed
21964 // when the stream is closed.
21965 // RETURNS: a new #GUnixInputStream
21966 // <fd>: a UNIX file descriptor
21967 // <close_fd>: %TRUE to close the file descriptor when done
21968 static UnixInputStream* /*new*/ new_()(int fd, int close_fd) {
21969 return g_unix_input_stream_new(fd, close_fd);
21972 // VERSION: 2.20
21973 // Returns whether the file descriptor of @stream will be
21974 // closed when the stream is closed.
21975 // RETURNS: %TRUE if the file descriptor is closed when done
21976 int get_close_fd()() {
21977 return g_unix_input_stream_get_close_fd(&this);
21980 // VERSION: 2.20
21981 // Return the UNIX file descriptor that the stream reads from.
21982 // RETURNS: The file descriptor of @stream
21983 int get_fd()() {
21984 return g_unix_input_stream_get_fd(&this);
21987 // VERSION: 2.20
21988 // Sets whether the file descriptor of @stream shall be closed
21989 // when the stream is closed.
21990 // <close_fd>: %TRUE to close the file descriptor when done
21991 void set_close_fd()(int close_fd) {
21992 g_unix_input_stream_set_close_fd(&this, close_fd);
21996 struct UnixInputStreamClass {
21997 InputStreamClass parent_class;
21998 extern (C) void function () _g_reserved1;
21999 extern (C) void function () _g_reserved2;
22000 extern (C) void function () _g_reserved3;
22001 extern (C) void function () _g_reserved4;
22002 extern (C) void function () _g_reserved5;
22005 struct UnixInputStreamPrivate {
22009 // Defines a Unix mount entry (e.g. <filename>/media/cdrom</filename>).
22010 // This corresponds roughly to a mtab entry.
22011 struct UnixMountEntry {
22014 // Watches #GUnixMount<!-- -->s for changes.
22015 struct UnixMountMonitor /* : GObject.Object */ {
22016 alias method_parent this;
22017 alias method_parent super_;
22018 alias method_parent object;
22019 GObject2.Object method_parent;
22022 // Gets a new #GUnixMountMonitor. The default rate limit for which the
22023 // monitor will report consecutive changes for the mount and mount
22024 // point entry files is the default for a #GFileMonitor. Use
22025 // g_unix_mount_monitor_set_rate_limit() to change this.
22026 // RETURNS: a #GUnixMountMonitor.
22027 static UnixMountMonitor* /*new*/ new_()() {
22028 return g_unix_mount_monitor_new();
22031 // VERSION: 2.18
22032 // Sets the rate limit to which the @mount_monitor will report
22033 // consecutive change events to the mount and mount point entry files.
22034 // <limit_msec>: a integer with the limit in milliseconds to poll for changes.
22035 void set_rate_limit()(int limit_msec) {
22036 g_unix_mount_monitor_set_rate_limit(&this, limit_msec);
22038 // Emitted when the unix mount points have changed.
22039 extern (C) alias static void function (UnixMountMonitor* this_, void* user_data=null) signal_mountpoints_changed;
22041 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
22042 return super_.signal_connect!name(cb, data, cf);
22045 ulong signal_connect(string name:"mountpoints-changed", CB:signal_mountpoints_changed)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
22046 return signal_connect_data!()(&this, cast(char*)"mountpoints-changed",
22047 cast(GObject2.Callback)cb, data, null, cf);
22049 // Emitted when the unix mounts have changed.
22050 extern (C) alias static void function (UnixMountMonitor* this_, void* user_data=null) signal_mounts_changed;
22051 ulong signal_connect(string name:"mounts-changed", CB:signal_mounts_changed)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
22052 return signal_connect_data!()(&this, cast(char*)"mounts-changed",
22053 cast(GObject2.Callback)cb, data, null, cf);
22057 struct UnixMountMonitorClass {
22061 // Defines a Unix mount point (e.g. <filename>/dev</filename>).
22062 // This corresponds roughly to a fstab entry.
22063 struct UnixMountPoint {
22065 // Compares two unix mount points.
22067 // or less than @mount2, respectively.
22068 // RETURNS: 1, 0 or -1 if @mount1 is greater than, equal to,
22069 // <mount2>: a #GUnixMount.
22070 int compare()(UnixMountPoint* mount2) {
22071 return g_unix_mount_point_compare(&this, mount2);
22073 // Frees a unix mount point.
22074 void free()() {
22075 g_unix_mount_point_free(&this);
22078 // Gets the device path for a unix mount point.
22079 // RETURNS: a string containing the device path.
22080 char* get_device_path()() {
22081 return g_unix_mount_point_get_device_path(&this);
22084 // Gets the file system type for the mount point.
22085 // RETURNS: a string containing the file system type.
22086 char* get_fs_type()() {
22087 return g_unix_mount_point_get_fs_type(&this);
22090 // Gets the mount path for a unix mount point.
22091 // RETURNS: a string containing the mount path.
22092 char* get_mount_path()() {
22093 return g_unix_mount_point_get_mount_path(&this);
22096 // Guesses whether a Unix mount point can be ejected.
22097 // RETURNS: %TRUE if @mount_point is deemed to be ejectable.
22098 int guess_can_eject()() {
22099 return g_unix_mount_point_guess_can_eject(&this);
22102 // Guesses the icon of a Unix mount point.
22103 // RETURNS: a #GIcon
22104 Icon* /*new*/ guess_icon()() {
22105 return g_unix_mount_point_guess_icon(&this);
22108 // Guesses the name of a Unix mount point.
22109 // The result is a translated string.
22111 // be freed with g_free()
22112 // RETURNS: A newly allocated string that must
22113 char* /*new*/ guess_name()() {
22114 return g_unix_mount_point_guess_name(&this);
22117 // Checks if a unix mount point is a loopback device.
22118 // RETURNS: %TRUE if the mount point is a loopback. %FALSE otherwise.
22119 int is_loopback()() {
22120 return g_unix_mount_point_is_loopback(&this);
22123 // Checks if a unix mount point is read only.
22124 // RETURNS: %TRUE if a mount point is read only.
22125 int is_readonly()() {
22126 return g_unix_mount_point_is_readonly(&this);
22129 // Checks if a unix mount point is mountable by the user.
22130 // RETURNS: %TRUE if the mount point is user mountable.
22131 int is_user_mountable()() {
22132 return g_unix_mount_point_is_user_mountable(&this);
22137 // #GUnixOutputStream implements #GOutputStream for writing to a
22138 // UNIX file descriptor, including asynchronous operations. The file
22139 // descriptor must be selectable, so it doesn't work with opened files.
22141 // Note that <filename>&lt;gio/gunixoutputstream.h&gt;</filename> belongs
22142 // to the UNIX-specific GIO interfaces, thus you have to use the
22143 // <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
22144 struct UnixOutputStream /* : OutputStream */ {
22145 mixin PollableOutputStream.__interface__;
22146 alias parent_instance this;
22147 alias parent_instance super_;
22148 alias parent_instance outputstream;
22149 OutputStream parent_instance;
22150 private UnixOutputStreamPrivate* priv;
22153 // Creates a new #GUnixOutputStream for the given @fd.
22155 // If @close_fd, is %TRUE, the file descriptor will be closed when
22156 // the output stream is destroyed.
22157 // RETURNS: a new #GOutputStream
22158 // <fd>: a UNIX file descriptor
22159 // <close_fd>: %TRUE to close the file descriptor when done
22160 static UnixOutputStream* /*new*/ new_()(int fd, int close_fd) {
22161 return g_unix_output_stream_new(fd, close_fd);
22164 // VERSION: 2.20
22165 // Returns whether the file descriptor of @stream will be
22166 // closed when the stream is closed.
22167 // RETURNS: %TRUE if the file descriptor is closed when done
22168 int get_close_fd()() {
22169 return g_unix_output_stream_get_close_fd(&this);
22172 // VERSION: 2.20
22173 // Return the UNIX file descriptor that the stream writes to.
22174 // RETURNS: The file descriptor of @stream
22175 int get_fd()() {
22176 return g_unix_output_stream_get_fd(&this);
22179 // VERSION: 2.20
22180 // Sets whether the file descriptor of @stream shall be closed
22181 // when the stream is closed.
22182 // <close_fd>: %TRUE to close the file descriptor when done
22183 void set_close_fd()(int close_fd) {
22184 g_unix_output_stream_set_close_fd(&this, close_fd);
22188 struct UnixOutputStreamClass {
22189 OutputStreamClass parent_class;
22190 extern (C) void function () _g_reserved1;
22191 extern (C) void function () _g_reserved2;
22192 extern (C) void function () _g_reserved3;
22193 extern (C) void function () _g_reserved4;
22194 extern (C) void function () _g_reserved5;
22197 struct UnixOutputStreamPrivate {
22201 // Support for UNIX-domain (also known as local) sockets.
22203 // UNIX domain sockets are generally visible in the filesystem.
22204 // However, some systems support abstract socket names which are not
22205 // visible in the filesystem and not affected by the filesystem
22206 // permissions, visibility, etc. Currently this is only supported
22207 // under Linux. If you attempt to use abstract sockets on other
22208 // systems, function calls may return %G_IO_ERROR_NOT_SUPPORTED
22209 // errors. You can use g_unix_socket_address_abstract_names_supported()
22210 // to see if abstract names are supported.
22212 // Note that <filename>&lt;gio/gunixsocketaddress.h&gt;</filename> belongs to
22213 // the UNIX-specific GIO interfaces, thus you have to use the
22214 // <filename>gio-unix-2.0.pc</filename> pkg-config file when using it.
22215 struct UnixSocketAddress /* : SocketAddress */ {
22216 mixin SocketConnectable.__interface__;
22217 alias parent_instance this;
22218 alias parent_instance super_;
22219 alias parent_instance socketaddress;
22220 SocketAddress parent_instance;
22221 private UnixSocketAddressPrivate* priv;
22224 // VERSION: 2.22
22225 // Creates a new #GUnixSocketAddress for @path.
22227 // To create abstract socket addresses, on systems that support that,
22228 // use g_unix_socket_address_new_abstract().
22229 // RETURNS: a new #GUnixSocketAddress
22230 // <path>: the socket path
22231 static UnixSocketAddress* /*new*/ new_()(char* path) {
22232 return g_unix_socket_address_new(path);
22235 // DEPRECATED constructor: new_abstract - Use g_unix_socket_address_new_with_type().
22236 // Creates a new %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED
22237 // #GUnixSocketAddress for @path.
22238 // RETURNS: a new #GUnixSocketAddress
22239 // <path>: the abstract name
22240 // <path_len>: the length of @path, or -1
22241 static UnixSocketAddress* /*new*/ new_abstract()(char* path, int path_len) {
22242 return g_unix_socket_address_new_abstract(path, path_len);
22245 // VERSION: 2.26
22246 // Creates a new #GUnixSocketAddress of type @type with name @path.
22248 // If @type is %G_UNIX_SOCKET_ADDRESS_PATH, this is equivalent to
22249 // calling g_unix_socket_address_new().
22251 // If @path_type is %G_UNIX_SOCKET_ADDRESS_ABSTRACT, then @path_len
22252 // bytes of @path will be copied to the socket's path, and only those
22253 // bytes will be considered part of the name. (If @path_len is -1,
22254 // then @path is assumed to be NUL-terminated.) For example, if @path
22255 // was "test", then calling g_socket_address_get_native_size() on the
22256 // returned socket would return 7 (2 bytes of overhead, 1 byte for the
22257 // abstract-socket indicator byte, and 4 bytes for the name "test").
22259 // If @path_type is %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED, then
22260 // @path_len bytes of @path will be copied to the socket's path, the
22261 // rest of the path will be padded with 0 bytes, and the entire
22262 // zero-padded buffer will be considered the name. (As above, if
22263 // @path_len is -1, then @path is assumed to be NUL-terminated.) In
22264 // this case, g_socket_address_get_native_size() will always return
22265 // the full size of a <literal>struct sockaddr_un</literal>, although
22266 // g_unix_socket_address_get_path_len() will still return just the
22267 // length of @path.
22269 // %G_UNIX_SOCKET_ADDRESS_ABSTRACT is preferred over
22270 // %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED for new programs. Of course,
22271 // when connecting to a server created by another process, you must
22272 // use the appropriate type corresponding to how that process created
22273 // its listening socket.
22274 // RETURNS: a new #GUnixSocketAddress
22275 // <path>: the name
22276 // <path_len>: the length of @path, or -1
22277 // <type>: a #GUnixSocketAddressType
22278 static UnixSocketAddress* /*new*/ new_with_type()(char* path, int path_len, UnixSocketAddressType type) {
22279 return g_unix_socket_address_new_with_type(path, path_len, type);
22282 // VERSION: 2.22
22283 // Checks if abstract unix domain socket names are supported.
22284 // RETURNS: %TRUE if supported, %FALSE otherwise
22285 static int abstract_names_supported()() {
22286 return g_unix_socket_address_abstract_names_supported();
22289 // VERSION: 2.26
22290 // Gets @address's type.
22291 // RETURNS: a #GUnixSocketAddressType
22292 UnixSocketAddressType get_address_type()() {
22293 return g_unix_socket_address_get_address_type(&this);
22296 // VERSION: 2.22
22297 // DEPRECATED method: get_is_abstract - Use g_unix_socket_address_get_address_type()
22298 // Tests if @address is abstract.
22299 // RETURNS: %TRUE if the address is abstract, %FALSE otherwise
22300 int get_is_abstract()() {
22301 return g_unix_socket_address_get_is_abstract(&this);
22304 // VERSION: 2.22
22305 // Gets @address's path, or for abstract sockets the "name".
22307 // Guaranteed to be zero-terminated, but an abstract socket
22308 // may contain embedded zeros, and thus you should use
22309 // g_unix_socket_address_get_path_len() to get the true length
22310 // of this string.
22311 // RETURNS: the path for @address
22312 char* get_path()() {
22313 return g_unix_socket_address_get_path(&this);
22316 // VERSION: 2.22
22317 // Gets the length of @address's path.
22319 // For details, see g_unix_socket_address_get_path().
22320 // RETURNS: the length of the path
22321 size_t get_path_len()() {
22322 return g_unix_socket_address_get_path_len(&this);
22326 struct UnixSocketAddressClass {
22327 SocketAddressClass parent_class;
22330 struct UnixSocketAddressPrivate {
22334 // The type of name used by a #GUnixSocketAddress.
22335 // %G_UNIX_SOCKET_ADDRESS_PATH indicates a traditional unix domain
22336 // socket bound to a filesystem path. %G_UNIX_SOCKET_ADDRESS_ANONYMOUS
22337 // indicates a socket not bound to any name (eg, a client-side socket,
22338 // or a socket created with socketpair()).
22340 // For abstract sockets, there are two incompatible ways of naming
22341 // them; the man pages suggest using the entire <literal>struct
22342 // sockaddr_un</literal> as the name, padding the unused parts of the
22343 // %sun_path field with zeroes; this corresponds to
22344 // %G_UNIX_SOCKET_ADDRESS_ABSTRACT_PADDED. However, many programs
22345 // instead just use a portion of %sun_path, and pass an appropriate
22346 // smaller length to bind() or connect(). This is
22347 // %G_UNIX_SOCKET_ADDRESS_ABSTRACT.
22348 enum UnixSocketAddressType /* Version 2.26 */ {
22349 INVALID = 0,
22350 ANONYMOUS = 1,
22351 PATH = 2,
22352 ABSTRACT = 3,
22353 ABSTRACT_PADDED = 4
22355 enum VFS_EXTENSION_POINT_NAME = "gio-vfs";
22356 enum VOLUME_IDENTIFIER_KIND_HAL_UDI = "hal-udi";
22357 enum VOLUME_IDENTIFIER_KIND_LABEL = "label";
22358 enum VOLUME_IDENTIFIER_KIND_NFS_MOUNT = "nfs-mount";
22359 enum VOLUME_IDENTIFIER_KIND_UNIX_DEVICE = "unix-device";
22360 enum VOLUME_IDENTIFIER_KIND_UUID = "uuid";
22361 enum VOLUME_MONITOR_EXTENSION_POINT_NAME = "gio-volume-monitor";
22362 // Entry point for using GIO functionality.
22363 struct Vfs /* : GObject.Object */ {
22364 alias parent_instance this;
22365 alias parent_instance super_;
22366 alias parent_instance object;
22367 GObject2.Object parent_instance;
22370 // Gets the default #GVfs for the system.
22371 // RETURNS: a #GVfs.
22372 static Vfs* get_default()() {
22373 return g_vfs_get_default();
22376 // Gets the local #GVfs for the system.
22377 // RETURNS: a #GVfs.
22378 static Vfs* get_local()() {
22379 return g_vfs_get_local();
22382 // Gets a #GFile for @path.
22384 // Free the returned object with g_object_unref().
22385 // RETURNS: a #GFile.
22386 // <path>: a string containing a VFS path.
22387 File* /*new*/ get_file_for_path()(char* path) {
22388 return g_vfs_get_file_for_path(&this, path);
22391 // Gets a #GFile for @uri.
22393 // This operation never fails, but the returned object
22394 // might not support any I/O operation if the URI
22395 // is malformed or if the URI scheme is not supported.
22397 // Free the returned object with g_object_unref().
22398 // RETURNS: a #GFile.
22399 // <uri>: a string containing a URI
22400 File* /*new*/ get_file_for_uri()(char* uri) {
22401 return g_vfs_get_file_for_uri(&this, uri);
22404 // Gets a list of URI schemes supported by @vfs.
22406 // The returned array belongs to GIO and must
22407 // not be freed or modified.
22408 // RETURNS: a %NULL-terminated array of strings.
22409 char** get_supported_uri_schemes()() {
22410 return g_vfs_get_supported_uri_schemes(&this);
22413 // Checks if the VFS is active.
22414 // RETURNS: %TRUE if construction of the @vfs was successful and it is now active.
22415 int is_active()() {
22416 return g_vfs_is_active(&this);
22419 // This operation never fails, but the returned object might
22420 // not support any I/O operations if the @parse_name cannot
22421 // be parsed by the #GVfs module.
22423 // Free the returned object with g_object_unref().
22424 // RETURNS: a #GFile for the given @parse_name.
22425 // <parse_name>: a string to be parsed by the VFS module.
22426 File* /*new*/ parse_name()(char* parse_name) {
22427 return g_vfs_parse_name(&this, parse_name);
22431 struct VfsClass {
22432 GObject2.ObjectClass parent_class;
22433 // RETURNS: %TRUE if construction of the @vfs was successful and it is now active.
22434 extern (C) int function (Vfs* vfs) is_active;
22436 // RETURNS: a #GFile.
22437 // <path>: a string containing a VFS path.
22438 extern (C) File* /*new*/ function (Vfs* vfs, char* path) get_file_for_path;
22440 // RETURNS: a #GFile.
22441 // <uri>: a string containing a URI
22442 extern (C) File* /*new*/ function (Vfs* vfs, char* uri) get_file_for_uri;
22443 // RETURNS: a %NULL-terminated array of strings.
22444 extern (C) char** function (Vfs* vfs) get_supported_uri_schemes;
22446 // RETURNS: a #GFile for the given @parse_name.
22447 // <parse_name>: a string to be parsed by the VFS module.
22448 extern (C) File* /*new*/ function (Vfs* vfs, char* parse_name) parse_name;
22449 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;
22450 extern (C) void function (Vfs* vfs, FileAttributeInfoList* list) add_writable_namespaces;
22451 extern (C) int function (Vfs* vfs, char* filename, FileInfo* info, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error=null) local_file_set_attributes;
22452 extern (C) void function (Vfs* vfs, char* filename) local_file_removed;
22453 extern (C) void function (Vfs* vfs, char* source, char* dest) local_file_moved;
22454 extern (C) void function () _g_reserved1;
22455 extern (C) void function () _g_reserved2;
22456 extern (C) void function () _g_reserved3;
22457 extern (C) void function () _g_reserved4;
22458 extern (C) void function () _g_reserved5;
22459 extern (C) void function () _g_reserved6;
22460 extern (C) void function () _g_reserved7;
22464 // The #GVolume interface represents user-visible objects that can be
22465 // mounted. Note, when porting from GnomeVFS, #GVolume is the moral
22466 // equivalent of #GnomeVFSDrive.
22468 // Mounting a #GVolume instance is an asynchronous operation. For more
22469 // information about asynchronous operations, see #GAsyncReady and
22470 // #GSimpleAsyncReady. To mount a #GVolume, first call
22471 // g_volume_mount() with (at least) the #GVolume instance, optionally
22472 // a #GMountOperation object and a #GAsyncReadyCallback.
22474 // Typically, one will only want to pass %NULL for the
22475 // #GMountOperation if automounting all volumes when a desktop session
22476 // starts since it's not desirable to put up a lot of dialogs asking
22477 // for credentials.
22479 // The callback will be fired when the operation has resolved (either
22480 // with success or failure), and a #GAsyncReady structure will be
22481 // passed to the callback. That callback should then call
22482 // g_volume_mount_finish() with the #GVolume instance and the
22483 // #GAsyncReady data to see if the operation was completed
22484 // successfully. If an @error is present when g_volume_mount_finish()
22485 // is called, then it will be filled with any error information.
22487 // <para id="volume-identifier">
22488 // It is sometimes necessary to directly access the underlying
22489 // operating system object behind a volume (e.g. for passing a volume
22490 // to an application via the commandline). For this purpose, GIO
22491 // allows to obtain an 'identifier' for the volume. There can be
22492 // different kinds of identifiers, such as Hal UDIs, filesystem labels,
22493 // traditional Unix devices (e.g. <filename>/dev/sda2</filename>),
22494 // uuids. GIO uses predefind strings as names for the different kinds
22495 // of identifiers: #G_VOLUME_IDENTIFIER_KIND_HAL_UDI,
22496 // #G_VOLUME_IDENTIFIER_KIND_LABEL, etc. Use g_volume_get_identifier()
22497 // to obtain an identifier for a volume.
22498 // </para>
22500 // Note that #G_VOLUME_IDENTIFIER_KIND_HAL_UDI will only be available
22501 // when the gvfs hal volume monitor is in use. Other volume monitors
22502 // will generally be able to provide the #G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE
22503 // identifier, which can be used to obtain a hal device by means of
22504 // libhal_manger_find_device_string_match().
22505 struct Volume /* Interface */ {
22506 mixin template __interface__() {
22507 // Checks if a volume can be ejected.
22508 // RETURNS: %TRUE if the @volume can be ejected. %FALSE otherwise.
22509 int can_eject()() {
22510 return g_volume_can_eject(cast(Volume*)&this);
22513 // Checks if a volume can be mounted.
22514 // RETURNS: %TRUE if the @volume can be mounted. %FALSE otherwise.
22515 int can_mount()() {
22516 return g_volume_can_mount(cast(Volume*)&this);
22519 // DEPRECATED (v2.22) method: eject - Use g_volume_eject_with_operation() instead.
22520 // Ejects a volume. This is an asynchronous operation, and is
22521 // finished by calling g_volume_eject_finish() with the @volume
22522 // and #GAsyncResult returned in the @callback.
22523 // <flags>: flags affecting the unmount if required for eject
22524 // <cancellable>: optional #GCancellable object, %NULL to ignore.
22525 // <callback>: a #GAsyncReadyCallback, or %NULL.
22526 // <user_data>: user data that gets passed to @callback
22527 void eject()(MountUnmountFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
22528 g_volume_eject(cast(Volume*)&this, flags, cancellable, callback, user_data);
22531 // DEPRECATED (v2.22) method: eject_finish - Use g_volume_eject_with_operation_finish() instead.
22532 // Finishes ejecting a volume. If any errors occurred during the operation,
22533 // @error will be set to contain the errors and %FALSE will be returned.
22534 // RETURNS: %TRUE, %FALSE if operation failed.
22535 // <result>: a #GAsyncResult.
22536 int eject_finish()(AsyncResult* result, GLib2.Error** error=null) {
22537 return g_volume_eject_finish(cast(Volume*)&this, result, error);
22540 // VERSION: 2.22
22541 // Ejects a volume. This is an asynchronous operation, and is
22542 // finished by calling g_volume_eject_with_operation_finish() with the @volume
22543 // and #GAsyncResult data returned in the @callback.
22544 // <flags>: flags affecting the unmount if required for eject
22545 // <mount_operation>: a #GMountOperation or %NULL to avoid user interaction.
22546 // <cancellable>: optional #GCancellable object, %NULL to ignore.
22547 // <callback>: a #GAsyncReadyCallback, or %NULL.
22548 // <user_data>: user data passed to @callback.
22549 void eject_with_operation()(MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
22550 g_volume_eject_with_operation(cast(Volume*)&this, flags, mount_operation, cancellable, callback, user_data);
22553 // VERSION: 2.22
22554 // Finishes ejecting a volume. If any errors occurred during the operation,
22555 // @error will be set to contain the errors and %FALSE will be returned.
22556 // RETURNS: %TRUE if the volume was successfully ejected. %FALSE otherwise.
22557 // <result>: a #GAsyncResult.
22558 int eject_with_operation_finish()(AsyncResult* result, GLib2.Error** error=null) {
22559 return g_volume_eject_with_operation_finish(cast(Volume*)&this, result, error);
22562 // Gets the kinds of <link linkend="volume-identifier">identifiers</link>
22563 // that @volume has. Use g_volume_get_identifer() to obtain
22564 // the identifiers themselves.
22566 // of strings containing kinds of identifiers. Use g_strfreev() to free.
22567 // RETURNS: a %NULL-terminated array
22568 char** /*new*/ enumerate_identifiers()() {
22569 return g_volume_enumerate_identifiers(cast(Volume*)&this);
22572 // VERSION: 2.18
22573 // Gets the activation root for a #GVolume if it is known ahead of
22574 // mount time. Returns %NULL otherwise. If not %NULL and if @volume
22575 // is mounted, then the result of g_mount_get_root() on the
22576 // #GMount object obtained from g_volume_get_mount() will always
22577 // either be equal or a prefix of what this function returns. In
22578 // other words, in code
22580 // <programlisting>
22581 // GMount *mount;
22582 // GFile *mount_root
22583 // GFile *volume_activation_root;
22585 // mount = g_volume_get_mount (volume); /&ast; mounted, so never NULL &ast;/
22586 // mount_root = g_mount_get_root (mount);
22587 // volume_activation_root = g_volume_get_activation_root(volume); /&ast; assume not NULL &ast;/
22588 // </programlisting>
22590 // then the expression
22592 // <programlisting>
22593 // (g_file_has_prefix (volume_activation_root, mount_root) ||
22594 // </programlisting>
22596 // will always be %TRUE.
22598 // Activation roots are typically used in #GVolumeMonitor
22599 // implementations to find the underlying mount to shadow, see
22600 // g_mount_is_shadowed() for more details.
22602 // g_object_unref() to free.
22603 // RETURNS: the activation root of @volume or %NULL. Use
22604 File* /*new*/ get_activation_root()() {
22605 return g_volume_get_activation_root(cast(Volume*)&this);
22608 // Gets the drive for the @volume.
22610 // The returned object should be unreffed with g_object_unref()
22611 // when no longer needed.
22612 // RETURNS: a #GDrive or %NULL if @volume is not associated with a drive.
22613 Drive* /*new*/ get_drive()() {
22614 return g_volume_get_drive(cast(Volume*)&this);
22617 // Gets the icon for @volume.
22619 // The returned object should be unreffed with g_object_unref()
22620 // when no longer needed.
22621 // RETURNS: a #GIcon.
22622 Icon* /*new*/ get_icon()() {
22623 return g_volume_get_icon(cast(Volume*)&this);
22626 // Gets the identifier of the given kind for @volume.
22627 // See the <link linkend="volume-identifier">introduction</link>
22628 // for more information about volume identifiers.
22630 // requested identfier, or %NULL if the #GVolume
22631 // doesn't have this kind of identifier
22632 // RETURNS: a newly allocated string containing the
22633 // <kind>: the kind of identifier to return
22634 char* /*new*/ get_identifier()(char* kind) {
22635 return g_volume_get_identifier(cast(Volume*)&this, kind);
22638 // Gets the mount for the @volume.
22640 // The returned object should be unreffed with g_object_unref()
22641 // when no longer needed.
22642 // RETURNS: a #GMount or %NULL if @volume isn't mounted.
22643 Mount* /*new*/ get_mount()() {
22644 return g_volume_get_mount(cast(Volume*)&this);
22647 // Gets the name of @volume.
22649 // be freed with g_free() when no longer needed.
22650 // RETURNS: the name for the given @volume. The returned string should
22651 char* /*new*/ get_name()() {
22652 return g_volume_get_name(cast(Volume*)&this);
22655 // Gets the UUID for the @volume. The reference is typically based on
22656 // the file system UUID for the volume in question and should be
22657 // considered an opaque string. Returns %NULL if there is no UUID
22658 // available.
22660 // The returned string should be freed with g_free()
22661 // when no longer needed.
22662 // RETURNS: the UUID for @volume or %NULL if no UUID can be computed.
22663 char* /*new*/ get_uuid()() {
22664 return g_volume_get_uuid(cast(Volume*)&this);
22667 // Mounts a volume. This is an asynchronous operation, and is
22668 // finished by calling g_volume_mount_finish() with the @volume
22669 // and #GAsyncResult returned in the @callback.
22670 // <flags>: flags affecting the operation
22671 // <mount_operation>: a #GMountOperation or %NULL to avoid user interaction.
22672 // <cancellable>: optional #GCancellable object, %NULL to ignore.
22673 // <callback>: a #GAsyncReadyCallback, or %NULL.
22674 // <user_data>: user data that gets passed to @callback
22675 void mount()(MountMountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
22676 g_volume_mount(cast(Volume*)&this, flags, mount_operation, cancellable, callback, user_data);
22679 // Finishes mounting a volume. If any errors occurred during the operation,
22680 // @error will be set to contain the errors and %FALSE will be returned.
22682 // If the mount operation succeeded, g_volume_get_mount() on @volume
22683 // is guaranteed to return the mount right after calling this
22684 // function; there's no need to listen for the 'mount-added' signal on
22685 // #GVolumeMonitor.
22686 // RETURNS: %TRUE, %FALSE if operation failed.
22687 // <result>: a #GAsyncResult
22688 int mount_finish()(AsyncResult* result, GLib2.Error** error=null) {
22689 return g_volume_mount_finish(cast(Volume*)&this, result, error);
22692 // Returns whether the volume should be automatically mounted.
22693 // RETURNS: %TRUE if the volume should be automatically mounted.
22694 int should_automount()() {
22695 return g_volume_should_automount(cast(Volume*)&this);
22697 // Emitted when the volume has been changed.
22698 extern (C) alias static void function (Volume* this_, void* user_data=null) signal_changed;
22700 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
22701 return super_.signal_connect!name(cb, data, cf);
22704 ulong signal_connect(string name:"changed", CB:signal_changed)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
22705 return signal_connect_data!()(&this, cast(char*)"changed",
22706 cast(GObject2.Callback)cb, data, null, cf);
22709 // This signal is emitted when the #GVolume have been removed. If
22710 // the recipient is holding references to the object they should
22711 // release them so the object can be finalized.
22712 extern (C) alias static void function (Volume* this_, void* user_data=null) signal_removed;
22713 ulong signal_connect(string name:"removed", CB:signal_removed)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
22714 return signal_connect_data!()(&this, cast(char*)"removed",
22715 cast(GObject2.Callback)cb, data, null, cf);
22718 mixin __interface__;
22721 // Interface for implementing operations for mountable volumes.
22722 struct VolumeIface {
22723 GObject2.TypeInterface g_iface;
22724 extern (C) void function (Volume* volume) changed;
22725 extern (C) void function (Volume* volume) removed;
22726 // RETURNS: the name for the given @volume. The returned string should
22727 extern (C) char* /*new*/ function (Volume* volume) get_name;
22728 // RETURNS: a #GIcon.
22729 extern (C) Icon* /*new*/ function (Volume* volume) get_icon;
22730 // RETURNS: the UUID for @volume or %NULL if no UUID can be computed.
22731 extern (C) char* /*new*/ function (Volume* volume) get_uuid;
22732 // RETURNS: a #GDrive or %NULL if @volume is not associated with a drive.
22733 extern (C) Drive* /*new*/ function (Volume* volume) get_drive;
22734 // RETURNS: a #GMount or %NULL if @volume isn't mounted.
22735 extern (C) Mount* /*new*/ function (Volume* volume) get_mount;
22736 // RETURNS: %TRUE if the @volume can be mounted. %FALSE otherwise.
22737 extern (C) int function (Volume* volume) can_mount;
22738 // RETURNS: %TRUE if the @volume can be ejected. %FALSE otherwise.
22739 extern (C) int function (Volume* volume) can_eject;
22741 // <flags>: flags affecting the operation
22742 // <mount_operation>: a #GMountOperation or %NULL to avoid user interaction.
22743 // <cancellable>: optional #GCancellable object, %NULL to ignore.
22744 // <callback>: a #GAsyncReadyCallback, or %NULL.
22745 // <user_data>: user data that gets passed to @callback
22746 extern (C) void function (Volume* volume, MountMountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) mount_fn;
22748 // RETURNS: %TRUE, %FALSE if operation failed.
22749 // <result>: a #GAsyncResult
22750 extern (C) int function (Volume* volume, AsyncResult* result, GLib2.Error** error=null) mount_finish;
22752 // <flags>: flags affecting the unmount if required for eject
22753 // <cancellable>: optional #GCancellable object, %NULL to ignore.
22754 // <callback>: a #GAsyncReadyCallback, or %NULL.
22755 // <user_data>: user data that gets passed to @callback
22756 extern (C) void function (Volume* volume, MountUnmountFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) eject;
22758 // RETURNS: %TRUE, %FALSE if operation failed.
22759 // <result>: a #GAsyncResult.
22760 extern (C) int function (Volume* volume, AsyncResult* result, GLib2.Error** error=null) eject_finish;
22762 // RETURNS: a newly allocated string containing the
22763 // <kind>: the kind of identifier to return
22764 extern (C) char* /*new*/ function (Volume* volume, char* kind) get_identifier;
22765 // RETURNS: a %NULL-terminated array
22766 extern (C) char** /*new*/ function (Volume* volume) enumerate_identifiers;
22767 // RETURNS: %TRUE if the volume should be automatically mounted.
22768 extern (C) int function (Volume* volume) should_automount;
22769 // RETURNS: the activation root of @volume or %NULL. Use
22770 extern (C) File* /*new*/ function (Volume* volume) get_activation_root;
22772 // <flags>: flags affecting the unmount if required for eject
22773 // <mount_operation>: a #GMountOperation or %NULL to avoid user interaction.
22774 // <cancellable>: optional #GCancellable object, %NULL to ignore.
22775 // <callback>: a #GAsyncReadyCallback, or %NULL.
22776 // <user_data>: user data passed to @callback.
22777 extern (C) void function (Volume* volume, MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) eject_with_operation;
22779 // RETURNS: %TRUE if the volume was successfully ejected. %FALSE otherwise.
22780 // <result>: a #GAsyncResult.
22781 extern (C) int function (Volume* volume, AsyncResult* result, GLib2.Error** error=null) eject_with_operation_finish;
22785 // #GVolumeMonitor is for listing the user interesting devices and volumes
22786 // on the computer. In other words, what a file selector or file manager
22787 // would show in a sidebar.
22789 // #GVolumeMonitor is not <link
22790 // linkend="g-main-context-push-thread-default">thread-default-context
22791 // aware</link>, and so should not be used other than from the main
22792 // thread, with no thread-default-context active.
22793 struct VolumeMonitor /* : GObject.Object */ {
22794 alias parent_instance this;
22795 alias parent_instance super_;
22796 alias parent_instance object;
22797 GObject2.Object parent_instance;
22798 private void* priv;
22801 // DEPRECATED (v2.20) function: adopt_orphan_mount - Instead of using this function, #GVolumeMonitor
22802 // This function should be called by any #GVolumeMonitor
22803 // implementation when a new #GMount object is created that is not
22804 // associated with a #GVolume object. It must be called just before
22805 // emitting the @mount_added signal.
22807 // If the return value is not %NULL, the caller must associate the
22808 // returned #GVolume object with the #GMount. This involves returning
22809 // it in its g_mount_get_volume() implementation. The caller must
22810 // also listen for the "removed" signal on the returned object
22811 // and give up its reference when handling that signal
22813 // Similary, if implementing g_volume_monitor_adopt_orphan_mount(),
22814 // the implementor must take a reference to @mount and return it in
22815 // its g_volume_get_mount() implemented. Also, the implementor must
22816 // listen for the "unmounted" signal on @mount and give up its
22817 // reference upon handling that signal.
22819 // There are two main use cases for this function.
22821 // One is when implementing a user space file system driver that reads
22822 // blocks of a block device that is already represented by the native
22823 // volume monitor (for example a CD Audio file system driver). Such
22824 // a driver will generate its own #GMount object that needs to be
22825 // associated with the #GVolume object that represents the volume.
22827 // The other is for implementing a #GVolumeMonitor whose sole purpose
22828 // is to return #GVolume objects representing entries in the users
22829 // "favorite servers" list or similar.
22831 // if no wants to adopt the #GMount.
22833 // implementations should instead create shadow mounts with the URI of
22834 // the mount they intend to adopt. See the proxy volume monitor in
22835 // gvfs for an example of this. Also see g_mount_is_shadowed(),
22836 // g_mount_shadow() and g_mount_unshadow() functions.
22837 // RETURNS: the #GVolume object that is the parent for @mount or %NULL
22838 // <mount>: a #GMount object to find a parent for
22839 static Volume* /*new*/ adopt_orphan_mount()(Mount* mount) {
22840 return g_volume_monitor_adopt_orphan_mount(mount);
22843 // Gets the volume monitor used by gio.
22845 // g_object_unref() when done with it.
22846 // RETURNS: a reference to the #GVolumeMonitor used by gio. Call
22847 static VolumeMonitor* /*new*/ get()() {
22848 return g_volume_monitor_get();
22851 // Gets a list of drives connected to the system.
22853 // The returned list should be freed with g_list_free(), after
22854 // its elements have been unreffed with g_object_unref().
22855 // RETURNS: a #GList of connected #GDrive objects.
22856 GLib2.List* /*new*/ get_connected_drives()() {
22857 return g_volume_monitor_get_connected_drives(&this);
22860 // Finds a #GMount object by its UUID (see g_mount_get_uuid())
22862 // Free the returned object with g_object_unref().
22863 // RETURNS: a #GMount or %NULL if no such mount is available.
22864 // <uuid>: the UUID to look for
22865 Mount* /*new*/ get_mount_for_uuid()(char* uuid) {
22866 return g_volume_monitor_get_mount_for_uuid(&this, uuid);
22869 // Gets a list of the mounts on the system.
22871 // The returned list should be freed with g_list_free(), after
22872 // its elements have been unreffed with g_object_unref().
22873 // RETURNS: a #GList of #GMount objects.
22874 GLib2.List* /*new*/ get_mounts()() {
22875 return g_volume_monitor_get_mounts(&this);
22878 // Finds a #GVolume object by its UUID (see g_volume_get_uuid())
22880 // Free the returned object with g_object_unref().
22881 // RETURNS: a #GVolume or %NULL if no such volume is available.
22882 // <uuid>: the UUID to look for
22883 Volume* /*new*/ get_volume_for_uuid()(char* uuid) {
22884 return g_volume_monitor_get_volume_for_uuid(&this, uuid);
22887 // Gets a list of the volumes on the system.
22889 // The returned list should be freed with g_list_free(), after
22890 // its elements have been unreffed with g_object_unref().
22891 // RETURNS: a #GList of #GVolume objects.
22892 GLib2.List* /*new*/ get_volumes()() {
22893 return g_volume_monitor_get_volumes(&this);
22896 // Emitted when a drive changes.
22897 // <drive>: the drive that changed
22898 extern (C) alias static void function (VolumeMonitor* this_, Drive* drive, void* user_data=null) signal_drive_changed;
22900 ulong signal_connect(string name, CB)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
22901 return super_.signal_connect!name(cb, data, cf);
22904 ulong signal_connect(string name:"drive-changed", CB:signal_drive_changed)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
22905 return signal_connect_data!()(&this, cast(char*)"drive-changed",
22906 cast(GObject2.Callback)cb, data, null, cf);
22909 // Emitted when a drive is connected to the system.
22910 // <drive>: a #GDrive that was connected.
22911 extern (C) alias static void function (VolumeMonitor* this_, Drive* drive, void* user_data=null) signal_drive_connected;
22912 ulong signal_connect(string name:"drive-connected", CB:signal_drive_connected)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
22913 return signal_connect_data!()(&this, cast(char*)"drive-connected",
22914 cast(GObject2.Callback)cb, data, null, cf);
22917 // Emitted when a drive is disconnected from the system.
22918 // <drive>: a #GDrive that was disconnected.
22919 extern (C) alias static void function (VolumeMonitor* this_, Drive* drive, void* user_data=null) signal_drive_disconnected;
22920 ulong signal_connect(string name:"drive-disconnected", CB:signal_drive_disconnected)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
22921 return signal_connect_data!()(&this, cast(char*)"drive-disconnected",
22922 cast(GObject2.Callback)cb, data, null, cf);
22925 // VERSION: 2.18
22926 // Emitted when the eject button is pressed on @drive.
22927 // <drive>: the drive where the eject button was pressed
22928 extern (C) alias static void function (VolumeMonitor* this_, Drive* drive, void* user_data=null) signal_drive_eject_button;
22929 ulong signal_connect(string name:"drive-eject-button", CB:signal_drive_eject_button)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
22930 return signal_connect_data!()(&this, cast(char*)"drive-eject-button",
22931 cast(GObject2.Callback)cb, data, null, cf);
22934 // VERSION: 2.22
22935 // Emitted when the stop button is pressed on @drive.
22936 // <drive>: the drive where the stop button was pressed
22937 extern (C) alias static void function (VolumeMonitor* this_, Drive* drive, void* user_data=null) signal_drive_stop_button;
22938 ulong signal_connect(string name:"drive-stop-button", CB:signal_drive_stop_button)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
22939 return signal_connect_data!()(&this, cast(char*)"drive-stop-button",
22940 cast(GObject2.Callback)cb, data, null, cf);
22943 // Emitted when a mount is added.
22944 // <mount>: a #GMount that was added.
22945 extern (C) alias static void function (VolumeMonitor* this_, Mount* mount, void* user_data=null) signal_mount_added;
22946 ulong signal_connect(string name:"mount-added", CB:signal_mount_added)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
22947 return signal_connect_data!()(&this, cast(char*)"mount-added",
22948 cast(GObject2.Callback)cb, data, null, cf);
22951 // Emitted when a mount changes.
22952 // <mount>: a #GMount that changed.
22953 extern (C) alias static void function (VolumeMonitor* this_, Mount* mount, void* user_data=null) signal_mount_changed;
22954 ulong signal_connect(string name:"mount-changed", CB:signal_mount_changed)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
22955 return signal_connect_data!()(&this, cast(char*)"mount-changed",
22956 cast(GObject2.Callback)cb, data, null, cf);
22959 // Emitted when a mount is about to be removed.
22960 // <mount>: a #GMount that is being unmounted.
22961 extern (C) alias static void function (VolumeMonitor* this_, Mount* mount, void* user_data=null) signal_mount_pre_unmount;
22962 ulong signal_connect(string name:"mount-pre-unmount", CB:signal_mount_pre_unmount)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
22963 return signal_connect_data!()(&this, cast(char*)"mount-pre-unmount",
22964 cast(GObject2.Callback)cb, data, null, cf);
22967 // Emitted when a mount is removed.
22968 // <mount>: a #GMount that was removed.
22969 extern (C) alias static void function (VolumeMonitor* this_, Mount* mount, void* user_data=null) signal_mount_removed;
22970 ulong signal_connect(string name:"mount-removed", CB:signal_mount_removed)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
22971 return signal_connect_data!()(&this, cast(char*)"mount-removed",
22972 cast(GObject2.Callback)cb, data, null, cf);
22975 // Emitted when a mountable volume is added to the system.
22976 // <volume>: a #GVolume that was added.
22977 extern (C) alias static void function (VolumeMonitor* this_, Volume* volume, void* user_data=null) signal_volume_added;
22978 ulong signal_connect(string name:"volume-added", CB:signal_volume_added)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
22979 return signal_connect_data!()(&this, cast(char*)"volume-added",
22980 cast(GObject2.Callback)cb, data, null, cf);
22983 // Emitted when mountable volume is changed.
22984 // <volume>: a #GVolume that changed.
22985 extern (C) alias static void function (VolumeMonitor* this_, Volume* volume, void* user_data=null) signal_volume_changed;
22986 ulong signal_connect(string name:"volume-changed", CB:signal_volume_changed)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
22987 return signal_connect_data!()(&this, cast(char*)"volume-changed",
22988 cast(GObject2.Callback)cb, data, null, cf);
22991 // Emitted when a mountable volume is removed from the system.
22992 // <volume>: a #GVolume that was removed.
22993 extern (C) alias static void function (VolumeMonitor* this_, Volume* volume, void* user_data=null) signal_volume_removed;
22994 ulong signal_connect(string name:"volume-removed", CB:signal_volume_removed)(CB cb, void* data=null, ConnectFlags cf=cast(ConnectFlags)0) {
22995 return signal_connect_data!()(&this, cast(char*)"volume-removed",
22996 cast(GObject2.Callback)cb, data, null, cf);
23000 struct VolumeMonitorClass {
23001 GObject2.ObjectClass parent_class;
23002 extern (C) void function (VolumeMonitor* volume_monitor, Volume* volume) volume_added;
23003 extern (C) void function (VolumeMonitor* volume_monitor, Volume* volume) volume_removed;
23004 extern (C) void function (VolumeMonitor* volume_monitor, Volume* volume) volume_changed;
23005 extern (C) void function (VolumeMonitor* volume_monitor, Mount* mount) mount_added;
23006 extern (C) void function (VolumeMonitor* volume_monitor, Mount* mount) mount_removed;
23007 extern (C) void function (VolumeMonitor* volume_monitor, Mount* mount) mount_pre_unmount;
23008 extern (C) void function (VolumeMonitor* volume_monitor, Mount* mount) mount_changed;
23009 extern (C) void function (VolumeMonitor* volume_monitor, Drive* drive) drive_connected;
23010 extern (C) void function (VolumeMonitor* volume_monitor, Drive* drive) drive_disconnected;
23011 extern (C) void function (VolumeMonitor* volume_monitor, Drive* drive) drive_changed;
23012 extern (C) int function () is_supported;
23013 // RETURNS: a #GList of connected #GDrive objects.
23014 extern (C) GLib2.List* /*new*/ function (VolumeMonitor* volume_monitor) get_connected_drives;
23015 // RETURNS: a #GList of #GVolume objects.
23016 extern (C) GLib2.List* /*new*/ function (VolumeMonitor* volume_monitor) get_volumes;
23017 // RETURNS: a #GList of #GMount objects.
23018 extern (C) GLib2.List* /*new*/ function (VolumeMonitor* volume_monitor) get_mounts;
23020 // RETURNS: a #GVolume or %NULL if no such volume is available.
23021 // <uuid>: the UUID to look for
23022 extern (C) Volume* /*new*/ function (VolumeMonitor* volume_monitor, char* uuid) get_volume_for_uuid;
23024 // RETURNS: a #GMount or %NULL if no such mount is available.
23025 // <uuid>: the UUID to look for
23026 extern (C) Mount* /*new*/ function (VolumeMonitor* volume_monitor, char* uuid) get_mount_for_uuid;
23027 // Unintrospectable functionp: adopt_orphan_mount() / ()
23028 extern (C) Volume* function (Mount* mount, VolumeMonitor* volume_monitor) adopt_orphan_mount;
23029 extern (C) void function (VolumeMonitor* volume_monitor, Drive* drive) drive_eject_button;
23030 extern (C) void function (VolumeMonitor* volume_monitor, Drive* drive) drive_stop_button;
23031 extern (C) void function () _g_reserved1;
23032 extern (C) void function () _g_reserved2;
23033 extern (C) void function () _g_reserved3;
23034 extern (C) void function () _g_reserved4;
23035 extern (C) void function () _g_reserved5;
23036 extern (C) void function () _g_reserved6;
23039 // Zlib decompression
23040 struct ZlibCompressor /* : GObject.Object */ {
23041 mixin Converter.__interface__;
23042 alias method_parent this;
23043 alias method_parent super_;
23044 alias method_parent object;
23045 GObject2.Object method_parent;
23048 // VERSION: 2.24
23049 // Creates a new #GZlibCompressor.
23050 // RETURNS: a new #GZlibCompressor
23051 // <format>: The format to use for the compressed data
23052 // <level>: compression level (0-9), -1 for default
23053 static ZlibCompressor* /*new*/ new_()(ZlibCompressorFormat format, int level) {
23054 return g_zlib_compressor_new(format, level);
23057 // VERSION: 2.26
23058 // Returns the #GZlibCompressor:file-info property.
23059 // RETURNS: a #GFileInfo, or %NULL
23060 FileInfo* get_file_info()() {
23061 return g_zlib_compressor_get_file_info(&this);
23064 // VERSION: 2.26
23065 // Sets @file_info in @compressor. If non-%NULL, and @compressor's
23066 // #GZlibCompressor:format property is %G_ZLIB_COMPRESSOR_FORMAT_GZIP,
23067 // it will be used to set the file name and modification time in
23068 // the GZIP header of the compressed data.
23070 // Note: it is an error to call this function while a compression is in
23071 // progress; it may only be called immediately after creation of @compressor,
23072 // or after resetting it with g_converter_reset().
23073 // <file_info>: a #GFileInfo
23074 void set_file_info()(FileInfo* file_info=null) {
23075 g_zlib_compressor_set_file_info(&this, file_info);
23079 struct ZlibCompressorClass {
23080 GObject2.ObjectClass parent_class;
23084 // Used to select the type of data format to use for #GZlibDecompressor
23085 // and #GZlibCompressor.
23086 enum ZlibCompressorFormat /* Version 2.24 */ {
23087 ZLIB = 0,
23088 GZIP = 1,
23089 RAW = 2
23091 // Zlib decompression
23092 struct ZlibDecompressor /* : GObject.Object */ {
23093 mixin Converter.__interface__;
23094 alias method_parent this;
23095 alias method_parent super_;
23096 alias method_parent object;
23097 GObject2.Object method_parent;
23100 // VERSION: 2.24
23101 // Creates a new #GZlibDecompressor.
23102 // RETURNS: a new #GZlibDecompressor
23103 // <format>: The format to use for the compressed data
23104 static ZlibDecompressor* /*new*/ new_()(ZlibCompressorFormat format) {
23105 return g_zlib_decompressor_new(format);
23108 // VERSION: 2.26
23109 // Retrieves the #GFileInfo constructed from the GZIP header data
23110 // of compressed data processed by @compressor, or %NULL if @decompressor's
23111 // #GZlibDecompressor:format property is not %G_ZLIB_COMPRESSOR_FORMAT_GZIP,
23112 // or the header data was not fully processed yet, or it not present in the
23113 // data stream at all.
23114 // RETURNS: a #GFileInfo, or %NULL
23115 FileInfo* get_file_info()() {
23116 return g_zlib_decompressor_get_file_info(&this);
23120 struct ZlibDecompressorClass {
23121 GObject2.ObjectClass parent_class;
23125 // MOVED TO: AppInfo.create_from_commandline
23126 // Creates a new #GAppInfo from the given information.
23127 // RETURNS: new #GAppInfo for given command.
23128 // <commandline>: the commandline to use
23129 // <application_name>: the application name, or %NULL to use @commandline
23130 // <flags>: flags that can specify details of the created #GAppInfo
23131 static AppInfo* /*new*/ app_info_create_from_commandline()(char* commandline, char* application_name, AppInfoCreateFlags flags, GLib2.Error** error=null) {
23132 return g_app_info_create_from_commandline(commandline, application_name, flags, error);
23136 // MOVED TO: AppInfo.get_all
23137 // Gets a list of all of the applications currently registered
23138 // on this system.
23140 // For desktop files, this includes applications that have
23141 // <literal>NoDisplay=true</literal> set or are excluded from
23142 // display by means of <literal>OnlyShowIn</literal> or
23143 // <literal>NotShowIn</literal>. See g_app_info_should_show().
23144 // The returned list does not include applications which have
23145 // the <literal>Hidden</literal> key set.
23146 // RETURNS: a newly allocated #GList of references to #GAppInfo<!---->s.
23147 static GLib2.List* /*new*/ app_info_get_all()() {
23148 return g_app_info_get_all();
23152 // MOVED TO: AppInfo.get_all_for_type
23153 // Gets a list of all #GAppInfos for a given content type.
23155 // for given @content_type or %NULL on error.
23156 // RETURNS: #GList of #GAppInfos
23157 // <content_type>: the content type to find a #GAppInfo for
23158 static GLib2.List* /*new*/ app_info_get_all_for_type()(char* content_type) {
23159 return g_app_info_get_all_for_type(content_type);
23163 // MOVED TO: AppInfo.get_default_for_type
23164 // Gets the #GAppInfo that corresponds to a given content type.
23166 // %NULL on error.
23167 // RETURNS: #GAppInfo for given @content_type or
23168 // <content_type>: the content type to find a #GAppInfo for
23169 // <must_support_uris>: if %TRUE, the #GAppInfo is expected to support URIs
23170 static AppInfo* /*new*/ app_info_get_default_for_type()(char* content_type, int must_support_uris) {
23171 return g_app_info_get_default_for_type(content_type, must_support_uris);
23175 // MOVED TO: AppInfo.get_default_for_uri_scheme
23176 // Gets the default application for launching applications
23177 // using this URI scheme. A URI scheme is the initial part
23178 // of the URI, up to but not including the ':', e.g. "http",
23179 // "ftp" or "sip".
23180 // RETURNS: #GAppInfo for given @uri_scheme or %NULL on error.
23181 // <uri_scheme>: a string containing a URI scheme.
23182 static AppInfo* /*new*/ app_info_get_default_for_uri_scheme()(char* uri_scheme) {
23183 return g_app_info_get_default_for_uri_scheme(uri_scheme);
23187 // VERSION: 2.28
23188 // MOVED TO: AppInfo.get_fallback_for_type
23189 // Gets a list of fallback #GAppInfos for a given content type, i.e.
23190 // those applications which claim to support the given content type
23191 // by MIME type subclassing and not directly.
23193 // for given @content_type or %NULL on error.
23194 // RETURNS: #GList of #GAppInfos
23195 // <content_type>: the content type to find a #GAppInfo for
23196 static GLib2.List* /*new*/ app_info_get_fallback_for_type()(char* content_type) {
23197 return g_app_info_get_fallback_for_type(content_type);
23201 // VERSION: 2.28
23202 // MOVED TO: AppInfo.get_recommended_for_type
23203 // Gets a list of recommended #GAppInfos for a given content type, i.e.
23204 // those applications which claim to support the given content type exactly,
23205 // and not by MIME type subclassing.
23206 // Note that the first application of the list is the last used one, i.e.
23207 // the last one for which #g_app_info_set_as_last_used_for_type has been
23208 // called.
23210 // for given @content_type or %NULL on error.
23211 // RETURNS: #GList of #GAppInfos
23212 // <content_type>: the content type to find a #GAppInfo for
23213 static GLib2.List* /*new*/ app_info_get_recommended_for_type()(char* content_type) {
23214 return g_app_info_get_recommended_for_type(content_type);
23218 // MOVED TO: AppInfo.launch_default_for_uri
23219 // Utility function that launches the default application
23220 // registered to handle the specified uri. Synchronous I/O
23221 // is done on the uri to detect the type of the file if
23222 // required.
23223 // RETURNS: %TRUE on success, %FALSE on error.
23224 // <uri>: the uri to show
23225 // <launch_context>: an optional #GAppLaunchContext.
23226 static int app_info_launch_default_for_uri()(char* uri, AppLaunchContext* launch_context, GLib2.Error** error=null) {
23227 return g_app_info_launch_default_for_uri(uri, launch_context, error);
23231 // VERSION: 2.20
23232 // MOVED TO: AppInfo.reset_type_associations
23233 // Removes all changes to the type associations done by
23234 // g_app_info_set_as_default_for_type(),
23235 // g_app_info_set_as_default_for_extension(),
23236 // g_app_info_add_supports_type() or g_app_info_remove_supports_type().
23237 // <content_type>: a content type
23238 static void app_info_reset_type_associations()(char* content_type) {
23239 g_app_info_reset_type_associations(content_type);
23243 // VERSION: 2.22
23244 // MOVED TO: AsyncInitable.newv_async
23245 // Helper function for constructing #GAsyncInitable object. This is
23246 // similar to g_object_newv() but also initializes the object asynchronously.
23248 // When the initialization is finished, @callback will be called. You can
23249 // then call g_async_initable_new_finish() to get the new object and check
23250 // for any errors.
23251 // <object_type>: a #GType supporting #GAsyncInitable.
23252 // <n_parameters>: the number of parameters in @parameters
23253 // <parameters>: the parameters to use to construct the object
23254 // <io_priority>: the <link linkend="io-priority">I/O priority</link> of the operation.
23255 // <cancellable>: optional #GCancellable object, %NULL to ignore.
23256 // <callback>: a #GAsyncReadyCallback to call when the initialization is finished
23257 // <user_data>: the data to pass to callback function
23258 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) {
23259 g_async_initable_newv_async(object_type, n_parameters, parameters, io_priority, cancellable, callback, user_data);
23263 // VERSION: 2.26
23264 // Asynchronously connects to the message bus specified by @bus_type.
23266 // When the operation is finished, @callback will be invoked. You can
23267 // then call g_bus_get_finish() to get the result of the operation.
23269 // This is a asynchronous failable function. See g_bus_get_sync() for
23270 // the synchronous version.
23271 // <bus_type>: A #GBusType.
23272 // <cancellable>: A #GCancellable or %NULL.
23273 // <callback>: A #GAsyncReadyCallback to call when the request is satisfied.
23274 // <user_data>: The data to pass to @callback.
23275 static void bus_get()(BusType bus_type, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
23276 g_bus_get(bus_type, cancellable, callback, user_data);
23280 // VERSION: 2.26
23281 // Finishes an operation started with g_bus_get().
23283 // The returned object is a singleton, that is, shared with other
23284 // callers of g_bus_get() and g_bus_get_sync() for @bus_type. In the
23285 // event that you need a private message bus connection, use
23286 // g_dbus_address_get_for_bus_sync() and
23287 // g_dbus_connection_new_for_address().
23289 // Note that the returned #GDBusConnection object will (usually) have
23290 // the #GDBusConnection:exit-on-close property set to %TRUE.
23291 // RETURNS: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
23292 // <res>: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_bus_get().
23293 static DBusConnection* /*new*/ bus_get_finish()(AsyncResult* res, GLib2.Error** error=null) {
23294 return g_bus_get_finish(res, error);
23298 // VERSION: 2.26
23299 // Synchronously connects to the message bus specified by @bus_type.
23300 // Note that the returned object may shared with other callers,
23301 // e.g. if two separate parts of a process calls this function with
23302 // the same @bus_type, they will share the same object.
23304 // This is a synchronous failable function. See g_bus_get() and
23305 // g_bus_get_finish() for the asynchronous version.
23307 // The returned object is a singleton, that is, shared with other
23308 // callers of g_bus_get() and g_bus_get_sync() for @bus_type. In the
23309 // event that you need a private message bus connection, use
23310 // g_dbus_address_get_for_bus_sync() and
23311 // g_dbus_connection_new_for_address().
23313 // Note that the returned #GDBusConnection object will (usually) have
23314 // the #GDBusConnection:exit-on-close property set to %TRUE.
23315 // RETURNS: A #GDBusConnection or %NULL if @error is set. Free with g_object_unref().
23316 // <bus_type>: A #GBusType.
23317 // <cancellable>: A #GCancellable or %NULL.
23318 static DBusConnection* /*new*/ bus_get_sync()(BusType bus_type, Cancellable* cancellable, GLib2.Error** error=null) {
23319 return g_bus_get_sync(bus_type, cancellable, error);
23323 // Unintrospectable function: bus_own_name() / g_bus_own_name()
23324 // VERSION: 2.26
23325 // Starts acquiring @name on the bus specified by @bus_type and calls
23326 // @name_acquired_handler and @name_lost_handler when the name is
23327 // acquired respectively lost. Callbacks will be invoked in the <link
23328 // linkend="g-main-context-push-thread-default">thread-default main
23329 // loop</link> of the thread you are calling this function from.
23331 // You are guaranteed that one of the @name_acquired_handler and @name_lost_handler
23332 // callbacks will be invoked after calling this function - there are three
23333 // possible cases:
23334 // <itemizedlist>
23335 // <listitem><para>
23336 // @name_lost_handler with a %NULL connection (if a connection to the bus can't be made).
23337 // </para></listitem>
23338 // <listitem><para>
23339 // @bus_acquired_handler then @name_lost_handler (if the name can't be obtained)
23340 // </para></listitem>
23341 // <listitem><para>
23342 // @bus_acquired_handler then @name_acquired_handler (if the name was obtained).
23343 // </para></listitem>
23344 // </itemizedlist>
23345 // When you are done owning the name, just call g_bus_unown_name()
23346 // with the owner id this function returns.
23348 // If the name is acquired or lost (for example another application
23349 // could acquire the name if you allow replacement or the application
23350 // currently owning the name exits), the handlers are also invoked. If the
23351 // #GDBusConnection that is used for attempting to own the name
23352 // closes, then @name_lost_handler is invoked since it is no
23353 // longer possible for other processes to access the process.
23355 // You cannot use g_bus_own_name() several times for the same name (unless
23356 // interleaved with calls to g_bus_unown_name()) - only the first call
23357 // will work.
23359 // Another guarantee is that invocations of @name_acquired_handler
23360 // and @name_lost_handler are guaranteed to alternate; that
23361 // is, if @name_acquired_handler is invoked then you are
23362 // guaranteed that the next time one of the handlers is invoked, it
23363 // will be @name_lost_handler. The reverse is also true.
23365 // If you plan on exporting objects (using e.g.
23366 // g_dbus_connection_register_object()), note that it is generally too late
23367 // to export the objects in @name_acquired_handler. Instead, you can do this
23368 // in @bus_acquired_handler since you are guaranteed that this will run
23369 // before @name is requested from the bus.
23371 // This behavior makes it very simple to write applications that wants
23372 // to own names and export objects, see <xref linkend="gdbus-owning-names"/>.
23373 // Simply register objects to be exported in @bus_acquired_handler and
23374 // unregister the objects (if any) in @name_lost_handler.
23376 // g_bus_unown_name() to stop owning the name.
23377 // RETURNS: An identifier (never 0) that an be used with
23378 // <bus_type>: The type of bus to own a name on.
23379 // <name>: The well-known name to own.
23380 // <flags>: A set of flags from the #GBusNameOwnerFlags enumeration.
23381 // <bus_acquired_handler>: Handler to invoke when connected to the bus of type @bus_type or %NULL.
23382 // <name_acquired_handler>: Handler to invoke when @name is acquired or %NULL.
23383 // <name_lost_handler>: Handler to invoke when @name is lost or %NULL.
23384 // <user_data>: User data to pass to handlers.
23385 // <user_data_free_func>: Function for freeing @user_data or %NULL.
23386 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) {
23387 return g_bus_own_name(bus_type, name, flags, bus_acquired_handler, name_acquired_handler, name_lost_handler, user_data, user_data_free_func);
23391 // Unintrospectable function: bus_own_name_on_connection() / g_bus_own_name_on_connection()
23392 // VERSION: 2.26
23393 // Like g_bus_own_name() but takes a #GDBusConnection instead of a
23394 // #GBusType.
23396 // g_bus_unown_name() to stop owning the name.
23397 // RETURNS: An identifier (never 0) that an be used with
23398 // <connection>: A #GDBusConnection.
23399 // <name>: The well-known name to own.
23400 // <flags>: A set of flags from the #GBusNameOwnerFlags enumeration.
23401 // <name_acquired_handler>: Handler to invoke when @name is acquired or %NULL.
23402 // <name_lost_handler>: Handler to invoke when @name is lost or %NULL.
23403 // <user_data>: User data to pass to handlers.
23404 // <user_data_free_func>: Function for freeing @user_data or %NULL.
23405 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) {
23406 return g_bus_own_name_on_connection(connection, name, flags, name_acquired_handler, name_lost_handler, user_data, user_data_free_func);
23410 // VERSION: 2.26
23411 // Version of g_bus_own_name_on_connection() using closures instead of callbacks for
23412 // easier binding in other languages.
23414 // g_bus_unown_name() to stop owning the name.
23415 // RETURNS: An identifier (never 0) that an be used with
23416 // <connection>: A #GDBusConnection.
23417 // <name>: The well-known name to own.
23418 // <flags>: A set of flags from the #GBusNameOwnerFlags enumeration.
23419 // <name_acquired_closure>: #GClosure to invoke when @name is acquired or %NULL.
23420 // <name_lost_closure>: #GClosure to invoke when @name is lost or %NULL.
23421 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) {
23422 return g_bus_own_name_on_connection_with_closures(connection, name, flags, name_acquired_closure, name_lost_closure);
23426 // VERSION: 2.26
23427 // Version of g_bus_own_name() using closures instead of callbacks for
23428 // easier binding in other languages.
23430 // g_bus_unown_name() to stop owning the name.
23431 // RETURNS: An identifier (never 0) that an be used with
23432 // <bus_type>: The type of bus to own a name on.
23433 // <name>: The well-known name to own.
23434 // <flags>: A set of flags from the #GBusNameOwnerFlags enumeration.
23435 // <bus_acquired_closure>: #GClosure to invoke when connected to the bus of type @bus_type or %NULL.
23436 // <name_acquired_closure>: #GClosure to invoke when @name is acquired or %NULL.
23437 // <name_lost_closure>: #GClosure to invoke when @name is lost or %NULL.
23438 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) {
23439 return g_bus_own_name_with_closures(bus_type, name, flags, bus_acquired_closure, name_acquired_closure, name_lost_closure);
23443 // VERSION: 2.26
23444 // Stops owning a name.
23445 // <owner_id>: An identifier obtained from g_bus_own_name()
23446 static void bus_unown_name()(uint owner_id) {
23447 g_bus_unown_name(owner_id);
23451 // VERSION: 2.26
23452 // Stops watching a name.
23453 // <watcher_id>: An identifier obtained from g_bus_watch_name()
23454 static void bus_unwatch_name()(uint watcher_id) {
23455 g_bus_unwatch_name(watcher_id);
23459 // Unintrospectable function: bus_watch_name() / g_bus_watch_name()
23460 // VERSION: 2.26
23461 // Starts watching @name on the bus specified by @bus_type and calls
23462 // @name_appeared_handler and @name_vanished_handler when the name is
23463 // known to have a owner respectively known to lose its
23464 // owner. Callbacks will be invoked in the <link
23465 // linkend="g-main-context-push-thread-default">thread-default main
23466 // loop</link> of the thread you are calling this function from.
23468 // You are guaranteed that one of the handlers will be invoked after
23469 // calling this function. When you are done watching the name, just
23470 // call g_bus_unwatch_name() with the watcher id this function
23471 // returns.
23473 // If the name vanishes or appears (for example the application owning
23474 // the name could restart), the handlers are also invoked. If the
23475 // #GDBusConnection that is used for watching the name disconnects, then
23476 // @name_vanished_handler is invoked since it is no longer
23477 // possible to access the name.
23479 // Another guarantee is that invocations of @name_appeared_handler
23480 // and @name_vanished_handler are guaranteed to alternate; that
23481 // is, if @name_appeared_handler is invoked then you are
23482 // guaranteed that the next time one of the handlers is invoked, it
23483 // will be @name_vanished_handler. The reverse is also true.
23485 // This behavior makes it very simple to write applications that wants
23486 // to take action when a certain name exists, see <xref
23487 // linkend="gdbus-watching-names"/>. Basically, the application
23488 // should create object proxies in @name_appeared_handler and destroy
23489 // them again (if any) in @name_vanished_handler.
23491 // g_bus_unwatch_name() to stop watching the name.
23492 // RETURNS: An identifier (never 0) that an be used with
23493 // <bus_type>: The type of bus to watch a name on.
23494 // <name>: The name (well-known or unique) to watch.
23495 // <flags>: Flags from the #GBusNameWatcherFlags enumeration.
23496 // <name_appeared_handler>: Handler to invoke when @name is known to exist or %NULL.
23497 // <name_vanished_handler>: Handler to invoke when @name is known to not exist or %NULL.
23498 // <user_data>: User data to pass to handlers.
23499 // <user_data_free_func>: Function for freeing @user_data or %NULL.
23500 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) {
23501 return g_bus_watch_name(bus_type, name, flags, name_appeared_handler, name_vanished_handler, user_data, user_data_free_func);
23505 // Unintrospectable function: bus_watch_name_on_connection() / g_bus_watch_name_on_connection()
23506 // VERSION: 2.26
23507 // Like g_bus_watch_name() but takes a #GDBusConnection instead of a
23508 // #GBusType.
23510 // g_bus_unwatch_name() to stop watching the name.
23511 // RETURNS: An identifier (never 0) that an be used with
23512 // <connection>: A #GDBusConnection.
23513 // <name>: The name (well-known or unique) to watch.
23514 // <flags>: Flags from the #GBusNameWatcherFlags enumeration.
23515 // <name_appeared_handler>: Handler to invoke when @name is known to exist or %NULL.
23516 // <name_vanished_handler>: Handler to invoke when @name is known to not exist or %NULL.
23517 // <user_data>: User data to pass to handlers.
23518 // <user_data_free_func>: Function for freeing @user_data or %NULL.
23519 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) {
23520 return g_bus_watch_name_on_connection(connection, name, flags, name_appeared_handler, name_vanished_handler, user_data, user_data_free_func);
23524 // VERSION: 2.26
23525 // Version of g_bus_watch_name_on_connection() using closures instead of callbacks for
23526 // easier binding in other languages.
23528 // g_bus_unwatch_name() to stop watching the name.
23529 // RETURNS: An identifier (never 0) that an be used with
23530 // <connection>: A #GDBusConnection.
23531 // <name>: The name (well-known or unique) to watch.
23532 // <flags>: Flags from the #GBusNameWatcherFlags enumeration.
23533 // <name_appeared_closure>: #GClosure to invoke when @name is known to exist or %NULL.
23534 // <name_vanished_closure>: #GClosure to invoke when @name is known to not exist or %NULL.
23535 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) {
23536 return g_bus_watch_name_on_connection_with_closures(connection, name, flags, name_appeared_closure, name_vanished_closure);
23540 // VERSION: 2.26
23541 // Version of g_bus_watch_name() using closures instead of callbacks for
23542 // easier binding in other languages.
23544 // g_bus_unwatch_name() to stop watching the name.
23545 // RETURNS: An identifier (never 0) that an be used with
23546 // <bus_type>: The type of bus to watch a name on.
23547 // <name>: The name (well-known or unique) to watch.
23548 // <flags>: Flags from the #GBusNameWatcherFlags enumeration.
23549 // <name_appeared_closure>: #GClosure to invoke when @name is known to exist or %NULL.
23550 // <name_vanished_closure>: #GClosure to invoke when @name is known to not exist or %NULL.
23551 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) {
23552 return g_bus_watch_name_with_closures(bus_type, name, flags, name_appeared_closure, name_vanished_closure);
23556 // Checks if a content type can be executable. Note that for instance
23557 // things like text files can be executables (i.e. scripts and batch files).
23559 // can be executable, %FALSE otherwise.
23560 // RETURNS: %TRUE if the file type corresponds to a type that
23561 // <type>: a content type string
23562 static int content_type_can_be_executable()(char* type) {
23563 return g_content_type_can_be_executable(type);
23567 // Compares two content types for equality.
23569 // %FALSE otherwise.
23570 // RETURNS: %TRUE if the two strings are identical or equivalent,
23571 // <type1>: a content type string
23572 // <type2>: a content type string
23573 static int content_type_equals()(char* type1, char* type2) {
23574 return g_content_type_equals(type1, type2);
23578 // VERSION: 2.18
23579 // Tries to find a content type based on the mime type name.
23581 // or %NULL. Free with g_free()
23582 // RETURNS: Newly allocated string with content type
23583 // <mime_type>: a mime type string
23584 static char* /*new*/ content_type_from_mime_type()(char* mime_type) {
23585 return g_content_type_from_mime_type(mime_type);
23589 // Gets the human readable description of the content type.
23591 // returned string with g_free()
23592 // RETURNS: a short description of the content type @type. Free the
23593 // <type>: a content type string
23594 static char* /*new*/ content_type_get_description()(char* type) {
23595 return g_content_type_get_description(type);
23599 // Gets the icon for a content type.
23601 // object with g_object_unref()
23602 // RETURNS: #GIcon corresponding to the content type. Free the returned
23603 // <type>: a content type string
23604 static Icon* /*new*/ content_type_get_icon()(char* type) {
23605 return g_content_type_get_icon(type);
23609 // Gets the mime type for the content type, if one is registered.
23611 // or %NULL if unknown.
23612 // RETURNS: the registered mime type for the given @type,
23613 // <type>: a content type string
23614 static char* /*new*/ content_type_get_mime_type()(char* type) {
23615 return g_content_type_get_mime_type(type);
23619 // Guesses the content type based on example data. If the function is
23620 // uncertain, @result_uncertain will be set to %TRUE. Either @filename
23621 // or @data may be %NULL, in which case the guess will be based solely
23622 // on the other argument.
23624 // given data. Free with g_free()
23625 // RETURNS: a string indicating a guessed content type for the
23626 // <filename>: a string, or %NULL
23627 // <data>: a stream of data, or %NULL
23628 // <data_size>: the size of @data
23629 // <result_uncertain>: return location for the certainty of the result, or %NULL
23630 static char* /*new*/ content_type_guess()(char* filename, ubyte* data, size_t data_size, /*out*/ int* result_uncertain=null) {
23631 return g_content_type_guess(filename, data, data_size, result_uncertain);
23635 // VERSION: 2.18
23636 // Tries to guess the type of the tree with root @root, by
23637 // looking at the files it contains. The result is an array
23638 // of content types, with the best guess coming first.
23640 // The types returned all have the form x-content/foo, e.g.
23641 // x-content/audio-cdda (for audio CDs) or x-content/image-dcf
23642 // (for a camera memory card). See the <ulink url="http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec">shared-mime-info</ulink>
23643 // specification for more on x-content types.
23645 // This function is useful in the implementation of
23646 // g_mount_guess_content_type().
23648 // array of zero or more content types, or %NULL. Free with g_strfreev()
23649 // RETURNS: an %NULL-terminated
23650 // <root>: the root of the tree to guess a type for
23651 static char** /*new*/ content_type_guess_for_tree()(File* root) {
23652 return g_content_type_guess_for_tree(root);
23656 // Determines if @type is a subset of @supertype.
23658 // %FALSE otherwise.
23659 // RETURNS: %TRUE if @type is a kind of @supertype,
23660 // <type>: a content type string
23661 // <supertype>: a content type string
23662 static int content_type_is_a()(char* type, char* supertype) {
23663 return g_content_type_is_a(type, supertype);
23667 // Checks if the content type is the generic "unknown" type.
23668 // On UNIX this is the "application/octet-stream" mimetype,
23669 // while on win32 it is "*".
23670 // RETURNS: %TRUE if the type is the unknown type.
23671 // <type>: a content type string
23672 static int content_type_is_unknown()(char* type) {
23673 return g_content_type_is_unknown(type);
23677 // Gets a list of strings containing all the registered content types
23678 // known to the system. The list and its data should be freed using
23679 // <programlisting>
23680 // g_list_foreach (list, g_free, NULL);
23681 // g_list_free (list);
23682 // </programlisting>
23683 // RETURNS: #GList of the registered content types
23684 static GLib2.List* /*new*/ content_types_get_registered()() {
23685 return g_content_types_get_registered();
23689 // VERSION: 2.26
23690 // Synchronously looks up the D-Bus address for the well-known message
23691 // bus instance specified by @bus_type. This may involve using various
23692 // platform specific mechanisms.
23693 // RETURNS: A valid D-Bus address string for @bus_type or %NULL if @error is set.
23694 // <bus_type>: A #GBusType.
23695 // <cancellable>: A #GCancellable or %NULL.
23696 static char* /*new*/ dbus_address_get_for_bus_sync()(BusType bus_type, Cancellable* cancellable, GLib2.Error** error=null) {
23697 return g_dbus_address_get_for_bus_sync(bus_type, cancellable, error);
23701 // VERSION: 2.26
23702 // Asynchronously connects to an endpoint specified by @address and
23703 // sets up the connection so it is in a state to run the client-side
23704 // of the D-Bus authentication conversation.
23706 // When the operation is finished, @callback will be invoked. You can
23707 // then call g_dbus_address_get_stream_finish() to get the result of
23708 // the operation.
23710 // This is an asynchronous failable function. See
23711 // g_dbus_address_get_stream_sync() for the synchronous version.
23712 // <address>: A valid D-Bus address.
23713 // <cancellable>: A #GCancellable or %NULL.
23714 // <callback>: A #GAsyncReadyCallback to call when the request is satisfied.
23715 // <user_data>: Data to pass to @callback.
23716 static void dbus_address_get_stream()(char* address, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data) {
23717 g_dbus_address_get_stream(address, cancellable, callback, user_data);
23721 // VERSION: 2.26
23722 // Finishes an operation started with g_dbus_address_get_stream().
23723 // RETURNS: A #GIOStream or %NULL if @error is set.
23724 // <res>: A #GAsyncResult obtained from the GAsyncReadyCallback passed to g_dbus_address_get_stream().
23725 // <out_guid>: %NULL or return location to store the GUID extracted from @address, if any.
23726 static IOStream* /*new*/ dbus_address_get_stream_finish()(AsyncResult* res, char** out_guid, GLib2.Error** error=null) {
23727 return g_dbus_address_get_stream_finish(res, out_guid, error);
23731 // VERSION: 2.26
23732 // Synchronously connects to an endpoint specified by @address and
23733 // sets up the connection so it is in a state to run the client-side
23734 // of the D-Bus authentication conversation.
23736 // This is a synchronous failable function. See
23737 // g_dbus_address_get_stream() for the asynchronous version.
23738 // RETURNS: A #GIOStream or %NULL if @error is set.
23739 // <address>: A valid D-Bus address.
23740 // <out_guid>: %NULL or return location to store the GUID extracted from @address, if any.
23741 // <cancellable>: A #GCancellable or %NULL.
23742 static IOStream* /*new*/ dbus_address_get_stream_sync()(char* address, char** out_guid, Cancellable* cancellable, GLib2.Error** error=null) {
23743 return g_dbus_address_get_stream_sync(address, out_guid, cancellable, error);
23747 // VERSION: 2.26
23748 // MOVED TO: DBusAnnotationInfo.lookup
23749 // Looks up the value of an annotation.
23751 // This cost of this function is O(n) in number of annotations.
23752 // RETURNS: The value or %NULL if not found. Do not free, it is owned by @annotations.
23753 // <annotations>: A %NULL-terminated array of annotations or %NULL.
23754 // <name>: The name of the annotation to look up.
23755 static char* dbus_annotation_info_lookup()(DBusAnnotationInfo** annotations, char* name) {
23756 return g_dbus_annotation_info_lookup(annotations, name);
23760 // VERSION: 2.26
23761 // MOVED TO: DBusError.encode_gerror
23762 // Creates a D-Bus error name to use for @error. If @error matches
23763 // a registered error (cf. g_dbus_error_register_error()), the corresponding
23764 // D-Bus error name will be returned.
23766 // Otherwise the a name of the form
23767 // <literal>org.gtk.GDBus.UnmappedGError.Quark._ESCAPED_QUARK_NAME.Code_ERROR_CODE</literal>
23768 // will be used. This allows other GDBus applications to map the error
23769 // on the wire back to a #GError using g_dbus_error_new_for_dbus_error().
23771 // This function is typically only used in object mappings to put a
23772 // #GError on the wire. Regular applications should not use it.
23773 // RETURNS: A D-Bus error name (never %NULL). Free with g_free().
23774 // <error>: A #GError.
23775 static char* /*new*/ dbus_error_encode_gerror()(GLib2.Error* error) {
23776 return g_dbus_error_encode_gerror(error);
23780 // VERSION: 2.26
23781 // MOVED TO: DBusError.get_remote_error
23782 // Gets the D-Bus error name used for @error, if any.
23784 // This function is guaranteed to return a D-Bus error name for all
23785 // #GError<!-- -->s returned from functions handling remote method
23786 // calls (e.g. g_dbus_connection_call_finish()) unless
23787 // g_dbus_error_strip_remote_error() has been used on @error.
23788 // RETURNS: An allocated string or %NULL if the D-Bus error name could not be found. Free with g_free().
23789 // <error>: A #GError.
23790 static char* /*new*/ dbus_error_get_remote_error()(GLib2.Error* error) {
23791 return g_dbus_error_get_remote_error(error);
23795 // VERSION: 2.26
23796 // MOVED TO: DBusError.is_remote_error
23797 // Checks if @error represents an error received via D-Bus from a remote peer. If so,
23798 // use g_dbus_error_get_remote_error() to get the name of the error.
23800 // %FALSE otherwise.
23801 // RETURNS: %TRUE if @error represents an error from a remote peer,
23802 // <error>: A #GError.
23803 static int dbus_error_is_remote_error()(GLib2.Error* error) {
23804 return g_dbus_error_is_remote_error(error);
23808 // VERSION: 2.26
23809 // MOVED TO: DBusError.new_for_dbus_error
23810 // Creates a #GError based on the contents of @dbus_error_name and
23811 // @dbus_error_message.
23813 // Errors registered with g_dbus_error_register_error() will be looked
23814 // up using @dbus_error_name and if a match is found, the error domain
23815 // and code is used. Applications can use g_dbus_error_get_remote_error()
23816 // to recover @dbus_error_name.
23818 // If a match against a registered error is not found and the D-Bus
23819 // error name is in a form as returned by g_dbus_error_encode_gerror()
23820 // the error domain and code encoded in the name is used to
23821 // create the #GError. Also, @dbus_error_name is added to the error message
23822 // such that it can be recovered with g_dbus_error_get_remote_error().
23824 // Otherwise, a #GError with the error code %G_IO_ERROR_DBUS_ERROR
23825 // in the #G_IO_ERROR error domain is returned. Also, @dbus_error_name is
23826 // added to the error message such that it can be recovered with
23827 // g_dbus_error_get_remote_error().
23829 // In all three cases, @dbus_error_name can always be recovered from the
23830 // returned #GError using the g_dbus_error_get_remote_error() function
23831 // (unless g_dbus_error_strip_remote_error() hasn't been used on the returned error).
23833 // This function is typically only used in object mappings to prepare
23834 // #GError instances for applications. Regular applications should not use
23835 // it.
23836 // RETURNS: An allocated #GError. Free with g_error_free().
23837 // <dbus_error_name>: D-Bus error name.
23838 // <dbus_error_message>: D-Bus error message.
23839 static GLib2.Error* /*new*/ dbus_error_new_for_dbus_error()(char* dbus_error_name, char* dbus_error_message) {
23840 return g_dbus_error_new_for_dbus_error(dbus_error_name, dbus_error_message);
23843 // MOVED TO: DBusError.quark
23844 static GLib2.Quark dbus_error_quark()() {
23845 return g_dbus_error_quark();
23849 // VERSION: 2.26
23850 // MOVED TO: DBusError.register_error
23851 // Creates an association to map between @dbus_error_name and
23852 // #GError<!-- -->s specified by @error_domain and @error_code.
23854 // This is typically done in the routine that returns the #GQuark for
23855 // an error domain.
23857 // exists.
23858 // RETURNS: %TRUE if the association was created, %FALSE if it already
23859 // <error_domain>: A #GQuark for a error domain.
23860 // <error_code>: An error code.
23861 // <dbus_error_name>: A D-Bus error name.
23862 static int dbus_error_register_error()(GLib2.Quark error_domain, int error_code, char* dbus_error_name) {
23863 return g_dbus_error_register_error(error_domain, error_code, dbus_error_name);
23867 // VERSION: 2.26
23868 // MOVED TO: DBusError.register_error_domain
23869 // Helper function for associating a #GError error domain with D-Bus error names.
23870 // <error_domain_quark_name>: The error domain name.
23871 // <quark_volatile>: A pointer where to store the #GQuark.
23872 // <entries>: A pointer to @num_entries #GDBusErrorEntry struct items.
23873 // <num_entries>: Number of items to register.
23874 static void dbus_error_register_error_domain()(char* error_domain_quark_name, size_t* quark_volatile, DBusErrorEntry* entries, uint num_entries) {
23875 g_dbus_error_register_error_domain(error_domain_quark_name, quark_volatile, entries, num_entries);
23879 // VERSION: 2.26
23880 // MOVED TO: DBusError.strip_remote_error
23881 // Looks for extra information in the error message used to recover
23882 // the D-Bus error name and strips it if found. If stripped, the
23883 // message field in @error will correspond exactly to what was
23884 // received on the wire.
23886 // This is typically used when presenting errors to the end user.
23887 // RETURNS: %TRUE if information was stripped, %FALSE otherwise.
23888 // <error>: A #GError.
23889 static int dbus_error_strip_remote_error()(GLib2.Error* error) {
23890 return g_dbus_error_strip_remote_error(error);
23894 // VERSION: 2.26
23895 // MOVED TO: DBusError.unregister_error
23896 // Destroys an association previously set up with g_dbus_error_register_error().
23897 // RETURNS: %TRUE if the association was destroyed, %FALSE if it wasn't found.
23898 // <error_domain>: A #GQuark for a error domain.
23899 // <error_code>: An error code.
23900 // <dbus_error_name>: A D-Bus error name.
23901 static int dbus_error_unregister_error()(GLib2.Quark error_domain, int error_code, char* dbus_error_name) {
23902 return g_dbus_error_unregister_error(error_domain, error_code, dbus_error_name);
23906 // VERSION: 2.26
23907 // Generate a D-Bus GUID that can be used with
23908 // e.g. g_dbus_connection_new().
23910 // See the D-Bus specification regarding what strings are valid D-Bus
23911 // GUID (for example, D-Bus GUIDs are not RFC-4122 compliant).
23912 // RETURNS: A valid D-Bus GUID. Free with g_free().
23913 static char* /*new*/ dbus_generate_guid()() {
23914 return g_dbus_generate_guid();
23918 // VERSION: 2.30
23919 // Converts a #GValue to a #GVariant of the type indicated by the @type parameter.
23921 // The conversion is using the following rules:
23922 // <table frame='all'>
23923 // <title>#GValue / #GVariant conversion rules</title>
23924 // <tgroup cols='2' align='left' colsep='1' rowsep='1'>
23925 // <thead>
23926 // <row>
23927 // <entry>If the #GType for @gvalue is...</entry>
23928 // <entry>... then @type must be</entry>
23929 // </row>
23930 // </thead>
23931 // <tbody>
23932 // <row>
23933 // <entry>#G_TYPE_STRING</entry>
23934 // <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>
23935 // </row>
23936 // <row>
23937 // <entry>#G_TYPE_STRV</entry>
23938 // <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>
23939 // </row>
23940 // <row>
23941 // <entry>#G_TYPE_BOOLEAN</entry>
23942 // <entry><link linkend="G-VARIANT-TYPE-BOOLEAN:CAPS">'b'</link></entry>
23943 // </row>
23944 // <row>
23945 // <entry>#G_TYPE_UCHAR</entry>
23946 // <entry><link linkend="G-VARIANT-TYPE-BYTE:CAPS">'y'</link></entry>
23947 // </row>
23948 // <row>
23949 // <entry>#G_TYPE_INT</entry>
23950 // <entry><link linkend="G-VARIANT-TYPE-INT32:CAPS">'i'</link> or <link linkend="G-VARIANT-TYPE-INT16:CAPS">'n'</link></entry>
23951 // </row>
23952 // <row>
23953 // <entry>#G_TYPE_UINT</entry>
23954 // <entry><link linkend="G-VARIANT-TYPE-UINT32:CAPS">'u'</link> or <link linkend="G-VARIANT-TYPE-UINT16:CAPS">'q'</link></entry>
23955 // </row>
23956 // <row>
23957 // <entry>#G_TYPE_INT64</entry>
23958 // <entry><link linkend="G-VARIANT-TYPE-INT64:CAPS">'x'</link></entry>
23959 // </row>
23960 // <row>
23961 // <entry>#G_TYPE_UINT64</entry>
23962 // <entry><link linkend="G-VARIANT-TYPE-UINT64:CAPS">'t'</link></entry>
23963 // </row>
23964 // <row>
23965 // <entry>#G_TYPE_DOUBLE</entry>
23966 // <entry><link linkend="G-VARIANT-TYPE-DOUBLE:CAPS">'d'</link></entry>
23967 // </row>
23968 // <row>
23969 // <entry>#G_TYPE_VARIANT</entry>
23970 // <entry>Any #GVariantType</entry>
23971 // </row>
23972 // </tbody>
23973 // </tgroup>
23974 // </table>
23975 // This can fail if e.g. @gvalue is of type #G_TYPE_STRING and @type
23976 // is <link linkend="G-VARIANT-TYPE-INT32:CAPS">'i'</link>. It will
23977 // also fail for any #GType (including e.g. #G_TYPE_OBJECT and
23978 // #G_TYPE_BOXED derived-types) not in the table above.
23980 // Note that if @gvalue is of type #G_TYPE_VARIANT and its value is
23981 // %NULL, the <emphasis>empty</emphasis> #GVariant instance (never
23982 // %NULL) for @type is returned (e.g. 0 for scalar types, the empty
23983 // string for string types, <literal>'/'</literal> for object path
23984 // types, the empty array for any array type and so on).
23986 // See the g_dbus_gvariant_to_gvalue() function for how to convert a
23987 // #GVariant to a #GValue.
23989 // @type holding the data from @gvalue or %NULL in case of
23990 // failure. Free with g_variant_unref().
23991 // RETURNS: A #GVariant (never floating) of #GVariantType
23992 // <gvalue>: A #GValue to convert to a #GVariant.
23993 // <type>: A #GVariantType.
23994 static GLib2.Variant* /*new*/ dbus_gvalue_to_gvariant()(GObject2.Value* gvalue, GLib2.VariantType* type) {
23995 return g_dbus_gvalue_to_gvariant(gvalue, type);
23999 // VERSION: 2.30
24000 // Converts a #GVariant to a #GValue. If @value is floating, it is consumed.
24002 // The rules specified in the g_dbus_gvalue_to_gvariant() function are
24003 // used - this function is essentially its reverse form.
24005 // The conversion never fails - a valid #GValue is always returned in
24006 // @out_gvalue.
24007 // <value>: A #GVariant.
24008 // <out_gvalue>: Return location pointing to a zero-filled (uninitialized) #GValue.
24009 static void dbus_gvariant_to_gvalue()(GLib2.Variant* value, GObject2.Value* out_gvalue) {
24010 g_dbus_gvariant_to_gvalue(value, out_gvalue);
24014 // VERSION: 2.26
24015 // Checks if @string is a D-Bus address.
24017 // This doesn't check if @string is actually supported by #GDBusServer
24018 // or #GDBusConnection - use g_dbus_is_supported_address() to do more
24019 // checks.
24020 // RETURNS: %TRUE if @string is a valid D-Bus address, %FALSE otherwise.
24021 // <string>: A string.
24022 static int dbus_is_address()(char* string_) {
24023 return g_dbus_is_address(string_);
24027 // VERSION: 2.26
24028 // Checks if @string is a D-Bus GUID.
24030 // See the D-Bus specification regarding what strings are valid D-Bus
24031 // GUID (for example, D-Bus GUIDs are not RFC-4122 compliant).
24032 // RETURNS: %TRUE if @string is a guid, %FALSE otherwise.
24033 // <string>: The string to check.
24034 static int dbus_is_guid()(char* string_) {
24035 return g_dbus_is_guid(string_);
24039 // VERSION: 2.26
24040 // Checks if @string is a valid D-Bus interface name.
24041 // RETURNS: %TRUE if valid, %FALSE otherwise.
24042 // <string>: The string to check.
24043 static int dbus_is_interface_name()(char* string_) {
24044 return g_dbus_is_interface_name(string_);
24048 // VERSION: 2.26
24049 // Checks if @string is a valid D-Bus member (e.g. signal or method) name.
24050 // RETURNS: %TRUE if valid, %FALSE otherwise.
24051 // <string>: The string to check.
24052 static int dbus_is_member_name()(char* string_) {
24053 return g_dbus_is_member_name(string_);
24057 // VERSION: 2.26
24058 // Checks if @string is a valid D-Bus bus name (either unique or well-known).
24059 // RETURNS: %TRUE if valid, %FALSE otherwise.
24060 // <string>: The string to check.
24061 static int dbus_is_name()(char* string_) {
24062 return g_dbus_is_name(string_);
24066 // VERSION: 2.26
24067 // Like g_dbus_is_address() but also checks if the library suppors the
24068 // transports in @string and that key/value pairs for each transport
24069 // are valid.
24071 // supported by this library, %FALSE if @error is set.
24072 // RETURNS: %TRUE if @string is a valid D-Bus address that is
24073 // <string>: A string.
24074 static int dbus_is_supported_address()(char* string_, GLib2.Error** error=null) {
24075 return g_dbus_is_supported_address(string_, error);
24079 // VERSION: 2.26
24080 // Checks if @string is a valid D-Bus unique bus name.
24081 // RETURNS: %TRUE if valid, %FALSE otherwise.
24082 // <string>: The string to check.
24083 static int dbus_is_unique_name()(char* string_) {
24084 return g_dbus_is_unique_name(string_);
24088 // MOVED TO: File.hash
24089 // Creates a hash value for a #GFile.
24091 // This call does no blocking i/o.
24093 // integer that can be used as hash value for the #GFile.
24094 // This function is intended for easily hashing a #GFile to
24095 // add to a #GHashTable or similar data structure.
24096 // RETURNS: 0 if @file is not a valid #GFile, otherwise an
24097 // <file>: #gconstpointer to a #GFile.
24098 static uint file_hash()(const(void)* file) {
24099 return g_file_hash(file);
24103 // MOVED TO: File.new_for_commandline_arg
24104 // Creates a #GFile with the given argument from the command line. The value of
24105 // @arg can be either a URI, an absolute path or a relative path resolved
24106 // relative to the current working directory.
24107 // This operation never fails, but the returned object might not support any
24108 // I/O operation if @arg points to a malformed path.
24109 // RETURNS: a new #GFile.
24110 // <arg>: a command line string.
24111 static File* /*new*/ file_new_for_commandline_arg()(char* arg) {
24112 return g_file_new_for_commandline_arg(arg);
24116 // MOVED TO: File.new_for_path
24117 // Constructs a #GFile for a given path. This operation never
24118 // fails, but the returned object might not support any I/O
24119 // operation if @path is malformed.
24120 // RETURNS: a new #GFile for the given @path.
24121 // <path>: a string containing a relative or absolute path. The string must be encoded in the glib filename encoding.
24122 static File* /*new*/ file_new_for_path()(char* path) {
24123 return g_file_new_for_path(path);
24127 // MOVED TO: File.new_for_uri
24128 // Constructs a #GFile for a given URI. This operation never
24129 // fails, but the returned object might not support any I/O
24130 // operation if @uri is malformed or if the uri type is
24131 // not supported.
24132 // RETURNS: a #GFile for the given @uri.
24133 // <uri>: a UTF8 string containing a URI.
24134 static File* /*new*/ file_new_for_uri()(char* uri) {
24135 return g_file_new_for_uri(uri);
24139 // MOVED TO: File.parse_name
24140 // Constructs a #GFile with the given @parse_name (i.e. something given by g_file_get_parse_name()).
24141 // This operation never fails, but the returned object might not support any I/O
24142 // operation if the @parse_name cannot be parsed.
24143 // RETURNS: a new #GFile.
24144 // <parse_name>: a file name or path to be parsed.
24145 static File* /*new*/ file_parse_name()(char* parse_name) {
24146 return g_file_parse_name(parse_name);
24150 // MOVED TO: Icon.hash
24151 // Gets a hash for an icon.
24153 // use in a #GHashTable or similar data structure.
24154 // RETURNS: a #guint containing a hash for the @icon, suitable for
24155 // <icon>: #gconstpointer to an icon object.
24156 static uint icon_hash()(const(void)* icon) {
24157 return g_icon_hash(icon);
24161 // VERSION: 2.20
24162 // MOVED TO: Icon.new_for_string
24163 // Generate a #GIcon instance from @str. This function can fail if
24164 // @str is not valid - see g_icon_to_string() for discussion.
24166 // If your application or library provides one or more #GIcon
24167 // implementations you need to ensure that each #GType is registered
24168 // with the type system prior to calling g_icon_new_for_string().
24170 // interface or %NULL if @error is set.
24171 // RETURNS: An object implementing the #GIcon
24172 // <str>: A string obtained via g_icon_to_string().
24173 static Icon* /*new*/ icon_new_for_string()(char* str, GLib2.Error** error=null) {
24174 return g_icon_new_for_string(str, error);
24178 // VERSION: 2.22
24179 // MOVED TO: Initable.newv
24180 // Helper function for constructing #GInitiable object. This is
24181 // similar to g_object_newv() but also initializes the object
24182 // and returns %NULL, setting an error on failure.
24183 // RETURNS: a newly allocated #GObject, or %NULL on error
24184 // <object_type>: a #GType supporting #GInitable.
24185 // <n_parameters>: the number of parameters in @parameters
24186 // <parameters>: the parameters to use to construct the object
24187 // <cancellable>: optional #GCancellable object, %NULL to ignore.
24188 static void* /*new*/ initable_newv()(Type object_type, uint n_parameters, GObject2.Parameter* parameters, Cancellable* cancellable, GLib2.Error** error=null) {
24189 return g_initable_newv(object_type, n_parameters, parameters, cancellable, error);
24193 // Converts errno.h error codes into GIO error codes.
24194 // RETURNS: #GIOErrorEnum value for the given errno.h error number.
24195 // <err_no>: Error number as defined in errno.h.
24196 static IOErrorEnum io_error_from_errno()(int err_no) {
24197 return g_io_error_from_errno(err_no);
24201 // Gets the GIO Error Quark.
24202 // RETURNS: a #GQuark.
24203 static GLib2.Quark io_error_quark()() {
24204 return g_io_error_quark();
24208 // Gets the type associated with @extension.
24209 // RETURNS: the type of @extension
24210 // <extension>: a #GIOExtension
24211 static Type io_extension_get_type()(IOExtension* extension) {
24212 return g_io_extension_get_type(extension);
24216 // MOVED TO: IOExtensionPoint.implement
24217 // Registers @type as extension for the extension point with name
24218 // @extension_point_name.
24220 // If @type has already been registered as an extension for this
24221 // extension point, the existing #GIOExtension object is returned.
24222 // RETURNS: a #GIOExtension object for #GType
24223 // <extension_point_name>: the name of the extension point
24224 // <type>: the #GType to register as extension
24225 // <extension_name>: the name for the extension
24226 // <priority>: the priority for the extension
24227 static IOExtension* io_extension_point_implement()(char* extension_point_name, Type type, char* extension_name, int priority) {
24228 return g_io_extension_point_implement(extension_point_name, type, extension_name, priority);
24232 // MOVED TO: IOExtensionPoint.lookup
24233 // Looks up an existing extension point.
24235 // is no registered extension point with the given name.
24236 // RETURNS: the #GIOExtensionPoint, or %NULL if there
24237 // <name>: the name of the extension point
24238 static IOExtensionPoint* io_extension_point_lookup()(char* name) {
24239 return g_io_extension_point_lookup(name);
24243 // MOVED TO: IOExtensionPoint.register
24244 // Registers an extension point.
24246 // owned by GIO and should not be freed.
24247 // RETURNS: the new #GIOExtensionPoint. This object is
24248 // <name>: The name of the extension point
24249 static IOExtensionPoint* io_extension_point_register()(char* name) {
24250 return g_io_extension_point_register(name);
24254 // Loads all the modules in the specified directory.
24256 // If don't require all modules to be initialized (and thus registering
24257 // all gtypes) then you can use g_io_modules_scan_all_in_directory()
24258 // which allows delayed/lazy loading of modules.
24260 // from the directory,
24261 // All the modules are loaded into memory, if you want to
24262 // unload them (enabling on-demand loading) you must call
24263 // g_type_module_unuse() on all the modules. Free the list
24264 // with g_list_free().
24265 // RETURNS: a list of #GIOModules loaded
24266 // <dirname>: pathname for a directory containing modules to load.
24267 static GLib2.List* /*new*/ io_modules_load_all_in_directory()(char* dirname) {
24268 return g_io_modules_load_all_in_directory(dirname);
24272 // VERSION: 2.30
24273 // Loads all the modules in the specified directory.
24275 // If don't require all modules to be initialized (and thus registering
24276 // all gtypes) then you can use g_io_modules_scan_all_in_directory()
24277 // which allows delayed/lazy loading of modules.
24279 // from the directory,
24280 // All the modules are loaded into memory, if you want to
24281 // unload them (enabling on-demand loading) you must call
24282 // g_type_module_unuse() on all the modules. Free the list
24283 // with g_list_free().
24284 // RETURNS: a list of #GIOModules loaded
24285 // <dirname>: pathname for a directory containing modules to load.
24286 // <scope>: a scope to use when scanning the modules.
24287 static GLib2.List* /*new*/ io_modules_load_all_in_directory_with_scope()(char* dirname, IOModuleScope* scope_) {
24288 return g_io_modules_load_all_in_directory_with_scope(dirname, scope_);
24292 // VERSION: 2.24
24293 // Scans all the modules in the specified directory, ensuring that
24294 // any extension point implemented by a module is registered.
24296 // This may not actually load and initialize all the types in each
24297 // module, some modules may be lazily loaded and initialized when
24298 // an extension point it implementes is used with e.g.
24299 // g_io_extension_point_get_extensions() or
24300 // g_io_extension_point_get_extension_by_name().
24302 // If you need to guarantee that all types are loaded in all the modules,
24303 // use g_io_modules_load_all_in_directory().
24304 // <dirname>: pathname for a directory containing modules to scan.
24305 static void io_modules_scan_all_in_directory()(char* dirname) {
24306 g_io_modules_scan_all_in_directory(dirname);
24310 // VERSION: 2.30
24311 // Scans all the modules in the specified directory, ensuring that
24312 // any extension point implemented by a module is registered.
24314 // This may not actually load and initialize all the types in each
24315 // module, some modules may be lazily loaded and initialized when
24316 // an extension point it implementes is used with e.g.
24317 // g_io_extension_point_get_extensions() or
24318 // g_io_extension_point_get_extension_by_name().
24320 // If you need to guarantee that all types are loaded in all the modules,
24321 // use g_io_modules_load_all_in_directory().
24322 // <dirname>: pathname for a directory containing modules to scan.
24323 // <scope>: a scope to use when scanning the modules
24324 static void io_modules_scan_all_in_directory_with_scope()(char* dirname, IOModuleScope* scope_) {
24325 g_io_modules_scan_all_in_directory_with_scope(dirname, scope_);
24329 // Cancels all cancellable I/O jobs.
24331 // A job is cancellable if a #GCancellable was passed into
24332 // g_io_scheduler_push_job().
24333 static void io_scheduler_cancel_all_jobs()() {
24334 g_io_scheduler_cancel_all_jobs();
24338 // Schedules the I/O job to run.
24340 // @notify will be called on @user_data after @job_func has returned,
24341 // regardless whether the job was cancelled or has run to completion.
24343 // If @cancellable is not %NULL, it can be used to cancel the I/O job
24344 // by calling g_cancellable_cancel() or by calling
24345 // g_io_scheduler_cancel_all_jobs().
24346 // <job_func>: a #GIOSchedulerJobFunc.
24347 // <user_data>: data to pass to @job_func
24348 // <notify>: a #GDestroyNotify for @user_data, or %NULL
24349 // <io_priority>: the <link linkend="gioscheduler">I/O priority</link> of the request.
24350 // <cancellable>: optional #GCancellable object, %NULL to ignore.
24351 static void io_scheduler_push_job()(IOSchedulerJobFunc job_func, void* user_data, GLib2.DestroyNotify notify, int io_priority, Cancellable* cancellable=null) {
24352 g_io_scheduler_push_job(job_func, user_data, notify, io_priority, cancellable);
24356 // Unintrospectable function: pollable_source_new() / g_pollable_source_new()
24357 // VERSION: 2.28
24358 // Utility method for #GPollableInputStream and #GPollableOutputStream
24359 // implementations. Creates a new #GSource that expects a callback of
24360 // type #GPollableSourceFunc. The new source does not actually do
24361 // anything on its own; use g_source_add_child_source() to add other
24362 // sources to it to cause it to trigger.
24363 // RETURNS: the new #GSource.
24364 // <pollable_stream>: the stream associated with the new source
24365 static GLib2.Source* /*new*/ pollable_source_new()(GObject2.Object* pollable_stream) {
24366 return g_pollable_source_new(pollable_stream);
24370 // VERSION: 2.26
24371 // MOVED TO: Proxy.get_default_for_protocol
24372 // Lookup "gio-proxy" extension point for a proxy implementation that supports
24373 // specified protocol.
24375 // is not supported.
24376 // RETURNS: return a #GProxy or NULL if protocol
24377 // <protocol>: the proxy protocol name (e.g. http, socks, etc)
24378 static Proxy* /*new*/ proxy_get_default_for_protocol()(char* protocol) {
24379 return g_proxy_get_default_for_protocol(protocol);
24383 // VERSION: 2.26
24384 // MOVED TO: ProxyResolver.get_default
24385 // Gets the default #GProxyResolver for the system.
24386 // RETURNS: the default #GProxyResolver.
24387 static ProxyResolver* proxy_resolver_get_default()() {
24388 return g_proxy_resolver_get_default();
24392 // VERSION: 2.22
24393 // MOVED TO: ResolverError.quark
24394 // Gets the #GResolver Error Quark.
24395 // RETURNS: a #GQuark.
24396 static GLib2.Quark resolver_error_quark()() {
24397 return g_resolver_error_quark();
24401 // Unintrospectable function: simple_async_report_error_in_idle() / g_simple_async_report_error_in_idle()
24402 // Reports an error in an asynchronous function in an idle function by
24403 // directly setting the contents of the #GAsyncResult with the given error
24404 // information.
24405 // <object>: a #GObject, or %NULL.
24406 // <callback>: a #GAsyncReadyCallback.
24407 // <user_data>: user data passed to @callback.
24408 // <domain>: a #GQuark containing the error domain (usually #G_IO_ERROR).
24409 // <code>: a specific error code.
24410 // <format>: a formatted error reporting string.
24411 alias g_simple_async_report_error_in_idle simple_async_report_error_in_idle; // Variadic
24414 // Reports an error in an idle function. Similar to
24415 // g_simple_async_report_error_in_idle(), but takes a #GError rather
24416 // than building a new one.
24417 // <object>: a #GObject, or %NULL
24418 // <callback>: a #GAsyncReadyCallback.
24419 // <user_data>: user data passed to @callback.
24420 // <error>: the #GError to report
24421 static void simple_async_report_gerror_in_idle()(GObject2.Object* object, AsyncReadyCallback callback, void* user_data, GLib2.Error* error) {
24422 g_simple_async_report_gerror_in_idle(object, callback, user_data, error);
24426 // Unintrospectable function: simple_async_report_take_gerror_in_idle() / g_simple_async_report_take_gerror_in_idle()
24427 // VERSION: 2.28
24428 // Reports an error in an idle function. Similar to
24429 // g_simple_async_report_gerror_in_idle(), but takes over the caller's
24430 // ownership of @error, so the caller does not have to free it any more.
24431 // <object>: a #GObject, or %NULL
24432 // <callback>: a #GAsyncReadyCallback.
24433 // <user_data>: user data passed to @callback.
24434 // <error>: the #GError to report
24435 static void simple_async_report_take_gerror_in_idle()(GObject2.Object* object, AsyncReadyCallback callback, void* user_data, GLib2.Error* error) {
24436 g_simple_async_report_take_gerror_in_idle(object, callback, user_data, error);
24440 // Unintrospectable function: srv_target_list_sort() / g_srv_target_list_sort()
24441 // VERSION: 2.22
24442 // MOVED TO: SrvTarget.list_sort
24443 // Sorts @targets in place according to the algorithm in RFC 2782.
24444 // RETURNS: the head of the sorted list.
24445 // <targets>: a #GList of #GSrvTarget
24446 static GLib2.List* /*new*/ srv_target_list_sort()(GLib2.List* targets) {
24447 return g_srv_target_list_sort(targets);
24451 // VERSION: 2.28
24452 // MOVED TO: TlsBackend.get_default
24453 // Gets the default #GTlsBackend for the system.
24454 // RETURNS: a #GTlsBackend
24455 static TlsBackend* tls_backend_get_default()() {
24456 return g_tls_backend_get_default();
24460 // VERSION: 2.28
24461 // MOVED TO: TlsClientConnection.new
24462 // Creates a new #GTlsClientConnection wrapping @base_io_stream (which
24463 // must have pollable input and output streams) which is assumed to
24464 // communicate with the server identified by @server_identity.
24465 // RETURNS: the new #GTlsClientConnection, or %NULL on error
24466 // <base_io_stream>: the #GIOStream to wrap
24467 // <server_identity>: the expected identity of the server
24468 static IOStream* /*new*/ tls_client_connection_new()(IOStream* base_io_stream, SocketConnectable* server_identity, GLib2.Error** error=null) {
24469 return g_tls_client_connection_new(base_io_stream, server_identity, error);
24473 // VERSION: 2.28
24474 // MOVED TO: TlsError.quark
24475 // Gets the TLS error quark.
24476 // RETURNS: a #GQuark.
24477 static GLib2.Quark tls_error_quark()() {
24478 return g_tls_error_quark();
24482 // VERSION: 2.30
24483 // MOVED TO: TlsFileDatabase.new
24484 // Creates a new #GTlsFileDatabase which uses anchor certificate authorities
24485 // in @anchors to verify certificate chains.
24487 // The certificates in @anchors must be PEM encoded.
24488 // RETURNS: the new #GTlsFileDatabase, or %NULL on error
24489 // <anchors>: filename of anchor certificate authorities.
24490 static TlsDatabase* /*new*/ tls_file_database_new()(char* anchors, GLib2.Error** error=null) {
24491 return g_tls_file_database_new(anchors, error);
24495 // VERSION: 2.28
24496 // MOVED TO: TlsServerConnection.new
24497 // Creates a new #GTlsServerConnection wrapping @base_io_stream (which
24498 // must have pollable input and output streams).
24499 // RETURNS: the new #GTlsServerConnection, or %NULL on error
24500 // <base_io_stream>: the #GIOStream to wrap
24501 // <certificate>: the default server certificate, or %NULL
24502 static IOStream* /*new*/ tls_server_connection_new()(IOStream* base_io_stream, TlsCertificate* certificate, GLib2.Error** error=null) {
24503 return g_tls_server_connection_new(base_io_stream, certificate, error);
24507 // Determines if @mount_path is considered an implementation of the
24508 // OS. This is primarily used for hiding mountable and mounted volumes
24509 // that only are used in the OS and has little to no relevance to the
24510 // casual user.
24512 // of the OS.
24513 // RETURNS: %TRUE if @mount_path is considered an implementation detail
24514 // <mount_path>: a mount path, e.g. <filename>/media/disk</filename> or <filename>/usr</filename>
24515 static int unix_is_mount_path_system_internal()(char* mount_path) {
24516 return g_unix_is_mount_path_system_internal(mount_path);
24520 // Unintrospectable function: unix_mount_at() / g_unix_mount_at()
24521 // Gets a #GUnixMountEntry for a given mount path. If @time_read
24522 // is set, it will be filled with a unix timestamp for checking
24523 // if the mounts have changed since with g_unix_mounts_changed_since().
24524 // RETURNS: a #GUnixMountEntry.
24525 // <mount_path>: path for a possible unix mount.
24526 // <time_read>: guint64 to contain a timestamp.
24527 static UnixMountEntry* /*new*/ unix_mount_at()(char* mount_path, /*out*/ ulong* time_read=null) {
24528 return g_unix_mount_at(mount_path, time_read);
24532 // Compares two unix mounts.
24534 // or less than @mount2, respectively.
24535 // RETURNS: 1, 0 or -1 if @mount1 is greater than, equal to,
24536 // <mount1>: first #GUnixMountEntry to compare.
24537 // <mount2>: second #GUnixMountEntry to compare.
24538 static int unix_mount_compare()(UnixMountEntry* mount1, UnixMountEntry* mount2) {
24539 return g_unix_mount_compare(mount1, mount2);
24543 // Frees a unix mount.
24544 // <mount_entry>: a #GUnixMount.
24545 static void unix_mount_free()(UnixMountEntry* mount_entry) {
24546 g_unix_mount_free(mount_entry);
24550 // Gets the device path for a unix mount.
24551 // RETURNS: a string containing the device path.
24552 // <mount_entry>: a #GUnixMount.
24553 static char* unix_mount_get_device_path()(UnixMountEntry* mount_entry) {
24554 return g_unix_mount_get_device_path(mount_entry);
24558 // Gets the filesystem type for the unix mount.
24559 // RETURNS: a string containing the file system type.
24560 // <mount_entry>: a #GUnixMount.
24561 static char* unix_mount_get_fs_type()(UnixMountEntry* mount_entry) {
24562 return g_unix_mount_get_fs_type(mount_entry);
24566 // Gets the mount path for a unix mount.
24567 // RETURNS: the mount path for @mount_entry.
24568 // <mount_entry>: input #GUnixMountEntry to get the mount path for.
24569 static char* unix_mount_get_mount_path()(UnixMountEntry* mount_entry) {
24570 return g_unix_mount_get_mount_path(mount_entry);
24574 // Guesses whether a Unix mount can be ejected.
24575 // RETURNS: %TRUE if @mount_entry is deemed to be ejectable.
24576 // <mount_entry>: a #GUnixMountEntry
24577 static int unix_mount_guess_can_eject()(UnixMountEntry* mount_entry) {
24578 return g_unix_mount_guess_can_eject(mount_entry);
24582 // Guesses the icon of a Unix mount.
24583 // RETURNS: a #GIcon
24584 // <mount_entry>: a #GUnixMountEntry
24585 static Icon* /*new*/ unix_mount_guess_icon()(UnixMountEntry* mount_entry) {
24586 return g_unix_mount_guess_icon(mount_entry);
24590 // Guesses the name of a Unix mount.
24591 // The result is a translated string.
24593 // be freed with g_free()
24594 // RETURNS: A newly allocated string that must
24595 // <mount_entry>: a #GUnixMountEntry
24596 static char* /*new*/ unix_mount_guess_name()(UnixMountEntry* mount_entry) {
24597 return g_unix_mount_guess_name(mount_entry);
24601 // Guesses whether a Unix mount should be displayed in the UI.
24602 // RETURNS: %TRUE if @mount_entry is deemed to be displayable.
24603 // <mount_entry>: a #GUnixMountEntry
24604 static int unix_mount_guess_should_display()(UnixMountEntry* mount_entry) {
24605 return g_unix_mount_guess_should_display(mount_entry);
24609 // Checks if a unix mount is mounted read only.
24610 // RETURNS: %TRUE if @mount_entry is read only.
24611 // <mount_entry>: a #GUnixMount.
24612 static int unix_mount_is_readonly()(UnixMountEntry* mount_entry) {
24613 return g_unix_mount_is_readonly(mount_entry);
24617 // Checks if a unix mount is a system path.
24618 // RETURNS: %TRUE if the unix mount is for a system path.
24619 // <mount_entry>: a #GUnixMount.
24620 static int unix_mount_is_system_internal()(UnixMountEntry* mount_entry) {
24621 return g_unix_mount_is_system_internal(mount_entry);
24625 // Checks if the unix mount points have changed since a given unix time.
24626 // RETURNS: %TRUE if the mount points have changed since @time.
24627 // <time>: guint64 to contain a timestamp.
24628 static int unix_mount_points_changed_since()(ulong time) {
24629 return g_unix_mount_points_changed_since(time);
24633 // Unintrospectable function: unix_mount_points_get() / g_unix_mount_points_get()
24634 // Gets a #GList of #GUnixMountPoint containing the unix mount points.
24635 // If @time_read is set, it will be filled with the mount timestamp,
24636 // allowing for checking if the mounts have changed with
24637 // g_unix_mount_points_changed_since().
24639 // a #GList of the UNIX mountpoints.
24640 // <time_read>: guint64 to contain a timestamp.
24641 static GLib2.List* /*new*/ unix_mount_points_get()(/*out*/ ulong* time_read=null) {
24642 return g_unix_mount_points_get(time_read);
24646 // Checks if the unix mounts have changed since a given unix time.
24647 // RETURNS: %TRUE if the mounts have changed since @time.
24648 // <time>: guint64 to contain a timestamp.
24649 static int unix_mounts_changed_since()(ulong time) {
24650 return g_unix_mounts_changed_since(time);
24654 // Unintrospectable function: unix_mounts_get() / g_unix_mounts_get()
24655 // Gets a #GList of #GUnixMountEntry containing the unix mounts.
24656 // If @time_read is set, it will be filled with the mount
24657 // timestamp, allowing for checking if the mounts have changed
24658 // with g_unix_mounts_changed_since().
24660 // a #GList of the UNIX mounts.
24661 // <time_read>: guint64 to contain a timestamp, or %NULL
24662 static GLib2.List* /*new*/ unix_mounts_get()(/*out*/ ulong* time_read=null) {
24663 return g_unix_mounts_get(time_read);
24667 // C prototypes:
24669 extern (C) {
24670 void g_action_activate(Action* this_, GLib2.Variant* parameter=null);
24671 void g_action_change_state(Action* this_, GLib2.Variant* value);
24672 int g_action_get_enabled(Action* this_);
24673 char* g_action_get_name(Action* this_);
24674 GLib2.VariantType* g_action_get_parameter_type(Action* this_);
24675 GLib2.Variant* /*new*/ g_action_get_state(Action* this_);
24676 GLib2.Variant* /*new*/ g_action_get_state_hint(Action* this_);
24677 GLib2.VariantType* g_action_get_state_type(Action* this_);
24678 void g_action_group_action_added(ActionGroup* this_, char* action_name);
24679 void g_action_group_action_enabled_changed(ActionGroup* this_, char* action_name, int enabled);
24680 void g_action_group_action_removed(ActionGroup* this_, char* action_name);
24681 void g_action_group_action_state_changed(ActionGroup* this_, char* action_name, GLib2.Variant* state);
24682 void g_action_group_activate_action(ActionGroup* this_, char* action_name, GLib2.Variant* parameter=null);
24683 void g_action_group_change_action_state(ActionGroup* this_, char* action_name, GLib2.Variant* value);
24684 int g_action_group_get_action_enabled(ActionGroup* this_, char* action_name);
24685 GLib2.VariantType* g_action_group_get_action_parameter_type(ActionGroup* this_, char* action_name);
24686 GLib2.Variant* /*new*/ g_action_group_get_action_state(ActionGroup* this_, char* action_name);
24687 GLib2.Variant* /*new*/ g_action_group_get_action_state_hint(ActionGroup* this_, char* action_name);
24688 GLib2.VariantType* /*new*/ g_action_group_get_action_state_type(ActionGroup* this_, char* action_name);
24689 int g_action_group_has_action(ActionGroup* this_, char* action_name);
24690 char** /*new*/ g_action_group_list_actions(ActionGroup* this_);
24691 AppInfo* /*new*/ g_app_info_create_from_commandline(char* commandline, char* application_name, AppInfoCreateFlags flags, GLib2.Error** error);
24692 GLib2.List* /*new*/ g_app_info_get_all();
24693 GLib2.List* /*new*/ g_app_info_get_all_for_type(char* content_type);
24694 AppInfo* /*new*/ g_app_info_get_default_for_type(char* content_type, int must_support_uris);
24695 AppInfo* /*new*/ g_app_info_get_default_for_uri_scheme(char* uri_scheme);
24696 GLib2.List* /*new*/ g_app_info_get_fallback_for_type(char* content_type);
24697 GLib2.List* /*new*/ g_app_info_get_recommended_for_type(char* content_type);
24698 int g_app_info_launch_default_for_uri(char* uri, AppLaunchContext* launch_context, GLib2.Error** error);
24699 void g_app_info_reset_type_associations(char* content_type);
24700 int g_app_info_add_supports_type(AppInfo* this_, char* content_type, GLib2.Error** error);
24701 int g_app_info_can_delete(AppInfo* this_);
24702 int g_app_info_can_remove_supports_type(AppInfo* this_);
24703 int g_app_info_delete(AppInfo* this_);
24704 AppInfo* /*new*/ g_app_info_dup(AppInfo* this_);
24705 int g_app_info_equal(AppInfo* this_, AppInfo* appinfo2);
24706 char* g_app_info_get_commandline(AppInfo* this_);
24707 char* g_app_info_get_description(AppInfo* this_);
24708 char* g_app_info_get_display_name(AppInfo* this_);
24709 char* g_app_info_get_executable(AppInfo* this_);
24710 Icon* g_app_info_get_icon(AppInfo* this_);
24711 char* g_app_info_get_id(AppInfo* this_);
24712 char* g_app_info_get_name(AppInfo* this_);
24713 int g_app_info_launch(AppInfo* this_, GLib2.List* files, AppLaunchContext* launch_context, GLib2.Error** error);
24714 int g_app_info_launch_uris(AppInfo* this_, GLib2.List* uris, AppLaunchContext* launch_context, GLib2.Error** error);
24715 int g_app_info_remove_supports_type(AppInfo* this_, char* content_type, GLib2.Error** error);
24716 int g_app_info_set_as_default_for_extension(AppInfo* this_, char* extension, GLib2.Error** error);
24717 int g_app_info_set_as_default_for_type(AppInfo* this_, char* content_type, GLib2.Error** error);
24718 int g_app_info_set_as_last_used_for_type(AppInfo* this_, char* content_type, GLib2.Error** error);
24719 int g_app_info_should_show(AppInfo* this_);
24720 int g_app_info_supports_files(AppInfo* this_);
24721 int g_app_info_supports_uris(AppInfo* this_);
24722 AppLaunchContext* /*new*/ g_app_launch_context_new();
24723 char* /*new*/ g_app_launch_context_get_display(AppLaunchContext* this_, AppInfo* info, GLib2.List* files);
24724 char* /*new*/ g_app_launch_context_get_startup_notify_id(AppLaunchContext* this_, AppInfo* info, GLib2.List* files);
24725 void g_app_launch_context_launch_failed(AppLaunchContext* this_, char* startup_notify_id);
24726 Application* /*new*/ g_application_new(char* application_id, ApplicationFlags flags);
24727 int g_application_id_is_valid(char* application_id);
24728 void g_application_activate(Application* this_);
24729 char* g_application_get_application_id(Application* this_);
24730 ApplicationFlags g_application_get_flags(Application* this_);
24731 uint g_application_get_inactivity_timeout(Application* this_);
24732 int g_application_get_is_registered(Application* this_);
24733 int g_application_get_is_remote(Application* this_);
24734 void g_application_hold(Application* this_);
24735 void g_application_open(Application* this_, File** files, int n_files, char* hint);
24736 int g_application_register(Application* this_, Cancellable* cancellable, GLib2.Error** error);
24737 void g_application_release(Application* this_);
24738 int g_application_run(Application* this_, int argc, char** argv=null);
24739 void g_application_set_action_group(Application* this_, ActionGroup* action_group=null);
24740 void g_application_set_application_id(Application* this_, char* application_id);
24741 void g_application_set_flags(Application* this_, ApplicationFlags flags);
24742 void g_application_set_inactivity_timeout(Application* this_, uint inactivity_timeout);
24743 char** /*new*/ g_application_command_line_get_arguments(ApplicationCommandLine* this_, /*out*/ int* argc);
24744 char* g_application_command_line_get_cwd(ApplicationCommandLine* this_);
24745 char** g_application_command_line_get_environ(ApplicationCommandLine* this_);
24746 int g_application_command_line_get_exit_status(ApplicationCommandLine* this_);
24747 int g_application_command_line_get_is_remote(ApplicationCommandLine* this_);
24748 GLib2.Variant* /*new*/ g_application_command_line_get_platform_data(ApplicationCommandLine* this_);
24749 char* g_application_command_line_getenv(ApplicationCommandLine* this_, char* name);
24750 void g_application_command_line_print(ApplicationCommandLine* this_, char* format, ...);
24751 void g_application_command_line_printerr(ApplicationCommandLine* this_, char* format, ...);
24752 void g_application_command_line_set_exit_status(ApplicationCommandLine* this_, int exit_status);
24753 void g_async_initable_new_async(Type object_type, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data, char* first_property_name, ...);
24754 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);
24755 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);
24756 void g_async_initable_init_async(AsyncInitable* this_, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
24757 int g_async_initable_init_finish(AsyncInitable* this_, AsyncResult* res, GLib2.Error** error);
24758 GObject2.Object* /*new*/ g_async_initable_new_finish(AsyncInitable* this_, AsyncResult* res, GLib2.Error** error);
24759 GObject2.Object* /*new*/ g_async_result_get_source_object(AsyncResult* this_);
24760 void* /*new*/ g_async_result_get_user_data(AsyncResult* this_);
24761 BufferedInputStream* /*new*/ g_buffered_input_stream_new(InputStream* base_stream);
24762 BufferedInputStream* /*new*/ g_buffered_input_stream_new_sized(InputStream* base_stream, size_t size);
24763 ssize_t g_buffered_input_stream_fill(BufferedInputStream* this_, ssize_t count, Cancellable* cancellable, GLib2.Error** error);
24764 void g_buffered_input_stream_fill_async(BufferedInputStream* this_, ssize_t count, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
24765 ssize_t g_buffered_input_stream_fill_finish(BufferedInputStream* this_, AsyncResult* result, GLib2.Error** error);
24766 size_t g_buffered_input_stream_get_available(BufferedInputStream* this_);
24767 size_t g_buffered_input_stream_get_buffer_size(BufferedInputStream* this_);
24768 size_t g_buffered_input_stream_peek(BufferedInputStream* this_, void* buffer, size_t offset, size_t count);
24769 ubyte* g_buffered_input_stream_peek_buffer(BufferedInputStream* this_, /*out*/ size_t* count);
24770 int g_buffered_input_stream_read_byte(BufferedInputStream* this_, Cancellable* cancellable, GLib2.Error** error);
24771 void g_buffered_input_stream_set_buffer_size(BufferedInputStream* this_, size_t size);
24772 BufferedOutputStream* /*new*/ g_buffered_output_stream_new(OutputStream* base_stream);
24773 BufferedOutputStream* /*new*/ g_buffered_output_stream_new_sized(OutputStream* base_stream, size_t size);
24774 int g_buffered_output_stream_get_auto_grow(BufferedOutputStream* this_);
24775 size_t g_buffered_output_stream_get_buffer_size(BufferedOutputStream* this_);
24776 void g_buffered_output_stream_set_auto_grow(BufferedOutputStream* this_, int auto_grow);
24777 void g_buffered_output_stream_set_buffer_size(BufferedOutputStream* this_, size_t size);
24778 Cancellable* /*new*/ g_cancellable_new();
24779 Cancellable* g_cancellable_get_current();
24780 void g_cancellable_cancel(Cancellable* this_);
24781 c_ulong g_cancellable_connect(Cancellable* this_, GObject2.Callback callback, void* data, GLib2.DestroyNotify data_destroy_func);
24782 void g_cancellable_disconnect(Cancellable* this_, c_ulong handler_id);
24783 int g_cancellable_get_fd(Cancellable* this_);
24784 int g_cancellable_is_cancelled(Cancellable* this_);
24785 int g_cancellable_make_pollfd(Cancellable* this_, GLib2.PollFD* pollfd);
24786 void g_cancellable_pop_current(Cancellable* this_);
24787 void g_cancellable_push_current(Cancellable* this_);
24788 void g_cancellable_release_fd(Cancellable* this_);
24789 void g_cancellable_reset(Cancellable* this_);
24790 int g_cancellable_set_error_if_cancelled(Cancellable* this_, GLib2.Error** error);
24791 GLib2.Source* /*new*/ g_cancellable_source_new(Cancellable* this_);
24792 CharsetConverter* /*new*/ g_charset_converter_new(char* to_charset, char* from_charset, GLib2.Error** error);
24793 uint g_charset_converter_get_num_fallbacks(CharsetConverter* this_);
24794 int g_charset_converter_get_use_fallback(CharsetConverter* this_);
24795 void g_charset_converter_set_use_fallback(CharsetConverter* this_, int use_fallback);
24796 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);
24797 void g_converter_reset(Converter* this_);
24798 ConverterInputStream* /*new*/ g_converter_input_stream_new(InputStream* base_stream, Converter* converter);
24799 Converter* g_converter_input_stream_get_converter(ConverterInputStream* this_);
24800 ConverterOutputStream* /*new*/ g_converter_output_stream_new(OutputStream* base_stream, Converter* converter);
24801 Converter* g_converter_output_stream_get_converter(ConverterOutputStream* this_);
24802 Credentials* /*new*/ g_credentials_new();
24803 void* g_credentials_get_native(Credentials* this_, CredentialsType native_type);
24804 uint g_credentials_get_unix_user(Credentials* this_, GLib2.Error** error);
24805 int g_credentials_is_same_user(Credentials* this_, Credentials* other_credentials, GLib2.Error** error);
24806 void g_credentials_set_native(Credentials* this_, CredentialsType native_type, void* native);
24807 int g_credentials_set_unix_user(Credentials* this_, uint uid, GLib2.Error** error);
24808 char* /*new*/ g_credentials_to_string(Credentials* this_);
24809 DBusAnnotationInfo* /*new*/ g_dbus_annotation_info_ref(DBusAnnotationInfo* this_);
24810 void g_dbus_annotation_info_unref(DBusAnnotationInfo* this_);
24811 char* g_dbus_annotation_info_lookup(DBusAnnotationInfo** annotations, char* name);
24812 DBusArgInfo* /*new*/ g_dbus_arg_info_ref(DBusArgInfo* this_);
24813 void g_dbus_arg_info_unref(DBusArgInfo* this_);
24814 DBusAuthObserver* /*new*/ g_dbus_auth_observer_new();
24815 int g_dbus_auth_observer_authorize_authenticated_peer(DBusAuthObserver* this_, IOStream* stream, Credentials* credentials);
24816 DBusConnection* /*new*/ g_dbus_connection_new_finish(AsyncResult* res, GLib2.Error** error);
24817 DBusConnection* /*new*/ g_dbus_connection_new_for_address_finish(AsyncResult* res, GLib2.Error** error);
24818 DBusConnection* /*new*/ g_dbus_connection_new_for_address_sync(char* address, DBusConnectionFlags flags, DBusAuthObserver* observer, Cancellable* cancellable, GLib2.Error** error);
24819 DBusConnection* /*new*/ g_dbus_connection_new_sync(IOStream* stream, char* guid, DBusConnectionFlags flags, DBusAuthObserver* observer, Cancellable* cancellable, GLib2.Error** error);
24820 void g_dbus_connection_new(IOStream* stream, char* guid, DBusConnectionFlags flags, DBusAuthObserver* observer, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
24821 void g_dbus_connection_new_for_address(char* address, DBusConnectionFlags flags, DBusAuthObserver* observer, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
24822 uint g_dbus_connection_add_filter(DBusConnection* this_, DBusMessageFilterFunction filter_function, void* user_data, GLib2.DestroyNotify user_data_free_func);
24823 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);
24824 GLib2.Variant* /*new*/ g_dbus_connection_call_finish(DBusConnection* this_, AsyncResult* res, GLib2.Error** error);
24825 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);
24826 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);
24827 GLib2.Variant* /*new*/ g_dbus_connection_call_with_unix_fd_list_finish(DBusConnection* this_, /*out*/ UnixFDList** out_fd_list, AsyncResult* res, GLib2.Error** error);
24828 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);
24829 void g_dbus_connection_close(DBusConnection* this_, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
24830 int g_dbus_connection_close_finish(DBusConnection* this_, AsyncResult* res, GLib2.Error** error);
24831 int g_dbus_connection_close_sync(DBusConnection* this_, Cancellable* cancellable, GLib2.Error** error);
24832 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);
24833 void g_dbus_connection_flush(DBusConnection* this_, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
24834 int g_dbus_connection_flush_finish(DBusConnection* this_, AsyncResult* res, GLib2.Error** error);
24835 int g_dbus_connection_flush_sync(DBusConnection* this_, Cancellable* cancellable, GLib2.Error** error);
24836 DBusCapabilityFlags g_dbus_connection_get_capabilities(DBusConnection* this_);
24837 int g_dbus_connection_get_exit_on_close(DBusConnection* this_);
24838 char* g_dbus_connection_get_guid(DBusConnection* this_);
24839 Credentials* g_dbus_connection_get_peer_credentials(DBusConnection* this_);
24840 IOStream* g_dbus_connection_get_stream(DBusConnection* this_);
24841 char* g_dbus_connection_get_unique_name(DBusConnection* this_);
24842 int g_dbus_connection_is_closed(DBusConnection* this_);
24843 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);
24844 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);
24845 void g_dbus_connection_remove_filter(DBusConnection* this_, uint filter_id);
24846 int g_dbus_connection_send_message(DBusConnection* this_, DBusMessage* message, DBusSendMessageFlags flags, /*out*/ uint* out_serial, GLib2.Error** error);
24847 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);
24848 DBusMessage* /*new*/ g_dbus_connection_send_message_with_reply_finish(DBusConnection* this_, AsyncResult* res, GLib2.Error** error);
24849 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);
24850 void g_dbus_connection_set_exit_on_close(DBusConnection* this_, int exit_on_close);
24851 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);
24852 void g_dbus_connection_signal_unsubscribe(DBusConnection* this_, uint subscription_id);
24853 void g_dbus_connection_start_message_processing(DBusConnection* this_);
24854 int g_dbus_connection_unregister_object(DBusConnection* this_, uint registration_id);
24855 int g_dbus_connection_unregister_subtree(DBusConnection* this_, uint registration_id);
24856 DBusInterfaceInfo* g_dbus_interface_get_info(DBusInterface* this_);
24857 DBusObject* g_dbus_interface_get_object(DBusInterface* this_);
24858 void g_dbus_interface_set_object(DBusInterface* this_, DBusObject* object);
24859 void g_dbus_interface_info_cache_build(DBusInterfaceInfo* this_);
24860 void g_dbus_interface_info_cache_release(DBusInterfaceInfo* this_);
24861 void g_dbus_interface_info_generate_xml(DBusInterfaceInfo* this_, uint indent, /*out*/ GLib2.String* string_builder);
24862 DBusMethodInfo* g_dbus_interface_info_lookup_method(DBusInterfaceInfo* this_, char* name);
24863 DBusPropertyInfo* g_dbus_interface_info_lookup_property(DBusInterfaceInfo* this_, char* name);
24864 DBusSignalInfo* g_dbus_interface_info_lookup_signal(DBusInterfaceInfo* this_, char* name);
24865 DBusInterfaceInfo* /*new*/ g_dbus_interface_info_ref(DBusInterfaceInfo* this_);
24866 void g_dbus_interface_info_unref(DBusInterfaceInfo* this_);
24867 int g_dbus_interface_skeleton_export(DBusInterfaceSkeleton* this_, DBusConnection* connection, char* object_path, GLib2.Error** error);
24868 void g_dbus_interface_skeleton_flush(DBusInterfaceSkeleton* this_);
24869 DBusConnection* g_dbus_interface_skeleton_get_connection(DBusInterfaceSkeleton* this_);
24870 DBusInterfaceSkeletonFlags g_dbus_interface_skeleton_get_flags(DBusInterfaceSkeleton* this_);
24871 DBusInterfaceInfo* g_dbus_interface_skeleton_get_info(DBusInterfaceSkeleton* this_);
24872 char* g_dbus_interface_skeleton_get_object_path(DBusInterfaceSkeleton* this_);
24873 GLib2.Variant* /*new*/ g_dbus_interface_skeleton_get_properties(DBusInterfaceSkeleton* this_);
24874 DBusInterfaceVTable* g_dbus_interface_skeleton_get_vtable(DBusInterfaceSkeleton* this_);
24875 void g_dbus_interface_skeleton_set_flags(DBusInterfaceSkeleton* this_, DBusInterfaceSkeletonFlags flags);
24876 void g_dbus_interface_skeleton_unexport(DBusInterfaceSkeleton* this_);
24877 DBusMessage* /*new*/ g_dbus_message_new();
24878 DBusMessage* /*new*/ g_dbus_message_new_from_blob(ubyte* blob, size_t blob_len, DBusCapabilityFlags capabilities, GLib2.Error** error);
24879 DBusMessage* /*new*/ g_dbus_message_new_method_call(char* name, char* path, char* interface_, char* method);
24880 DBusMessage* /*new*/ g_dbus_message_new_signal(char* path, char* interface_, char* signal);
24881 ssize_t g_dbus_message_bytes_needed(ubyte* blob, size_t blob_len, GLib2.Error** error);
24882 DBusMessage* /*new*/ g_dbus_message_copy(DBusMessage* this_, GLib2.Error** error);
24883 char* g_dbus_message_get_arg0(DBusMessage* this_);
24884 GLib2.Variant* /*new*/ g_dbus_message_get_body(DBusMessage* this_);
24885 DBusMessageByteOrder g_dbus_message_get_byte_order(DBusMessage* this_);
24886 char* g_dbus_message_get_destination(DBusMessage* this_);
24887 char* g_dbus_message_get_error_name(DBusMessage* this_);
24888 DBusMessageFlags g_dbus_message_get_flags(DBusMessage* this_);
24889 GLib2.Variant* /*new*/ g_dbus_message_get_header(DBusMessage* this_, DBusMessageHeaderField header_field);
24890 ubyte* g_dbus_message_get_header_fields(DBusMessage* this_);
24891 char* g_dbus_message_get_interface(DBusMessage* this_);
24892 int g_dbus_message_get_locked(DBusMessage* this_);
24893 char* g_dbus_message_get_member(DBusMessage* this_);
24894 DBusMessageType g_dbus_message_get_message_type(DBusMessage* this_);
24895 uint g_dbus_message_get_num_unix_fds(DBusMessage* this_);
24896 char* g_dbus_message_get_path(DBusMessage* this_);
24897 uint g_dbus_message_get_reply_serial(DBusMessage* this_);
24898 char* g_dbus_message_get_sender(DBusMessage* this_);
24899 uint g_dbus_message_get_serial(DBusMessage* this_);
24900 char* g_dbus_message_get_signature(DBusMessage* this_);
24901 UnixFDList* g_dbus_message_get_unix_fd_list(DBusMessage* this_);
24902 void g_dbus_message_lock(DBusMessage* this_);
24903 DBusMessage* /*new*/ g_dbus_message_new_method_error(DBusMessage* this_, char* error_name, char* error_message_format, ...);
24904 DBusMessage* /*new*/ g_dbus_message_new_method_error_literal(DBusMessage* this_, char* error_name, char* error_message);
24905 DBusMessage* /*new*/ g_dbus_message_new_method_error_valist(DBusMessage* this_, char* error_name, char* error_message_format, va_list var_args);
24906 DBusMessage* /*new*/ g_dbus_message_new_method_reply(DBusMessage* this_);
24907 char* /*new*/ g_dbus_message_print(DBusMessage* this_, uint indent);
24908 void g_dbus_message_set_body(DBusMessage* this_, GLib2.Variant* body_);
24909 void g_dbus_message_set_byte_order(DBusMessage* this_, DBusMessageByteOrder byte_order);
24910 void g_dbus_message_set_destination(DBusMessage* this_, char* value);
24911 void g_dbus_message_set_error_name(DBusMessage* this_, char* value);
24912 void g_dbus_message_set_flags(DBusMessage* this_, DBusMessageFlags flags);
24913 void g_dbus_message_set_header(DBusMessage* this_, DBusMessageHeaderField header_field, GLib2.Variant* value);
24914 void g_dbus_message_set_interface(DBusMessage* this_, char* value);
24915 void g_dbus_message_set_member(DBusMessage* this_, char* value);
24916 void g_dbus_message_set_message_type(DBusMessage* this_, DBusMessageType type);
24917 void g_dbus_message_set_num_unix_fds(DBusMessage* this_, uint value);
24918 void g_dbus_message_set_path(DBusMessage* this_, char* value);
24919 void g_dbus_message_set_reply_serial(DBusMessage* this_, uint value);
24920 void g_dbus_message_set_sender(DBusMessage* this_, char* value);
24921 void g_dbus_message_set_serial(DBusMessage* this_, uint serial);
24922 void g_dbus_message_set_signature(DBusMessage* this_, char* value);
24923 void g_dbus_message_set_unix_fd_list(DBusMessage* this_, UnixFDList* fd_list=null);
24924 ubyte* g_dbus_message_to_blob(DBusMessage* this_, size_t* out_size, DBusCapabilityFlags capabilities, GLib2.Error** error);
24925 int g_dbus_message_to_gerror(DBusMessage* this_, GLib2.Error** error);
24926 DBusMethodInfo* /*new*/ g_dbus_method_info_ref(DBusMethodInfo* this_);
24927 void g_dbus_method_info_unref(DBusMethodInfo* this_);
24928 DBusConnection* g_dbus_method_invocation_get_connection(DBusMethodInvocation* this_);
24929 char* g_dbus_method_invocation_get_interface_name(DBusMethodInvocation* this_);
24930 DBusMessage* g_dbus_method_invocation_get_message(DBusMethodInvocation* this_);
24931 DBusMethodInfo* g_dbus_method_invocation_get_method_info(DBusMethodInvocation* this_);
24932 char* g_dbus_method_invocation_get_method_name(DBusMethodInvocation* this_);
24933 char* g_dbus_method_invocation_get_object_path(DBusMethodInvocation* this_);
24934 GLib2.Variant* g_dbus_method_invocation_get_parameters(DBusMethodInvocation* this_);
24935 char* g_dbus_method_invocation_get_sender(DBusMethodInvocation* this_);
24936 void* g_dbus_method_invocation_get_user_data(DBusMethodInvocation* this_);
24937 void g_dbus_method_invocation_return_dbus_error(DBusMethodInvocation* this_, char* error_name, char* error_message);
24938 void g_dbus_method_invocation_return_error(DBusMethodInvocation* this_, GLib2.Quark domain, int code, char* format, ...);
24939 void g_dbus_method_invocation_return_error_literal(DBusMethodInvocation* this_, GLib2.Quark domain, int code, char* message);
24940 void g_dbus_method_invocation_return_error_valist(DBusMethodInvocation* this_, GLib2.Quark domain, int code, char* format, va_list var_args);
24941 void g_dbus_method_invocation_return_gerror(DBusMethodInvocation* this_, GLib2.Error* error);
24942 void g_dbus_method_invocation_return_value(DBusMethodInvocation* this_, GLib2.Variant* parameters=null);
24943 void g_dbus_method_invocation_return_value_with_unix_fd_list(DBusMethodInvocation* this_, GLib2.Variant* parameters=null, UnixFDList* fd_list=null);
24944 void g_dbus_method_invocation_take_error(DBusMethodInvocation* this_, GLib2.Error* error);
24945 DBusNodeInfo* /*new*/ g_dbus_node_info_new_for_xml(char* xml_data, GLib2.Error** error);
24946 void g_dbus_node_info_generate_xml(DBusNodeInfo* this_, uint indent, /*out*/ GLib2.String* string_builder);
24947 DBusInterfaceInfo* g_dbus_node_info_lookup_interface(DBusNodeInfo* this_, char* name);
24948 DBusNodeInfo* /*new*/ g_dbus_node_info_ref(DBusNodeInfo* this_);
24949 void g_dbus_node_info_unref(DBusNodeInfo* this_);
24950 DBusInterface* /*new*/ g_dbus_object_get_interface(DBusObject* this_, char* interface_name);
24951 GLib2.List* /*new*/ g_dbus_object_get_interfaces(DBusObject* this_);
24952 char* g_dbus_object_get_object_path(DBusObject* this_);
24953 DBusInterface* /*new*/ g_dbus_object_manager_get_interface(DBusObjectManager* this_, char* object_path, char* interface_name);
24954 DBusObject* /*new*/ g_dbus_object_manager_get_object(DBusObjectManager* this_, char* object_path);
24955 char* g_dbus_object_manager_get_object_path(DBusObjectManager* this_);
24956 GLib2.List* /*new*/ g_dbus_object_manager_get_objects(DBusObjectManager* this_);
24957 DBusObjectManagerClient* /*new*/ g_dbus_object_manager_client_new_finish(AsyncResult* res, GLib2.Error** error);
24958 DBusObjectManagerClient* /*new*/ g_dbus_object_manager_client_new_for_bus_finish(AsyncResult* res, GLib2.Error** error);
24959 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);
24960 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);
24961 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);
24962 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);
24963 DBusConnection* g_dbus_object_manager_client_get_connection(DBusObjectManagerClient* this_);
24964 DBusObjectManagerClientFlags g_dbus_object_manager_client_get_flags(DBusObjectManagerClient* this_);
24965 char* g_dbus_object_manager_client_get_name(DBusObjectManagerClient* this_);
24966 char* /*new*/ g_dbus_object_manager_client_get_name_owner(DBusObjectManagerClient* this_);
24967 DBusObjectManagerServer* /*new*/ g_dbus_object_manager_server_new(char* object_path);
24968 void g_dbus_object_manager_server_export(DBusObjectManagerServer* this_, DBusObjectSkeleton* object);
24969 void g_dbus_object_manager_server_export_uniquely(DBusObjectManagerServer* this_, DBusObjectSkeleton* object);
24970 DBusConnection* /*new*/ g_dbus_object_manager_server_get_connection(DBusObjectManagerServer* this_);
24971 void g_dbus_object_manager_server_set_connection(DBusObjectManagerServer* this_, DBusConnection* connection=null);
24972 int g_dbus_object_manager_server_unexport(DBusObjectManagerServer* this_, char* object_path);
24973 DBusObjectProxy* /*new*/ g_dbus_object_proxy_new(DBusConnection* connection, char* object_path);
24974 DBusConnection* g_dbus_object_proxy_get_connection(DBusObjectProxy* this_);
24975 DBusObjectSkeleton* /*new*/ g_dbus_object_skeleton_new(char* object_path);
24976 void g_dbus_object_skeleton_add_interface(DBusObjectSkeleton* this_, DBusInterfaceSkeleton* interface_);
24977 void g_dbus_object_skeleton_flush(DBusObjectSkeleton* this_);
24978 void g_dbus_object_skeleton_remove_interface(DBusObjectSkeleton* this_, DBusInterfaceSkeleton* interface_);
24979 void g_dbus_object_skeleton_remove_interface_by_name(DBusObjectSkeleton* this_, char* interface_name);
24980 void g_dbus_object_skeleton_set_object_path(DBusObjectSkeleton* this_, char* object_path);
24981 DBusPropertyInfo* /*new*/ g_dbus_property_info_ref(DBusPropertyInfo* this_);
24982 void g_dbus_property_info_unref(DBusPropertyInfo* this_);
24983 DBusProxy* /*new*/ g_dbus_proxy_new_finish(AsyncResult* res, GLib2.Error** error);
24984 DBusProxy* /*new*/ g_dbus_proxy_new_for_bus_finish(AsyncResult* res, GLib2.Error** error);
24985 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);
24986 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);
24987 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);
24988 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);
24989 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);
24990 GLib2.Variant* /*new*/ g_dbus_proxy_call_finish(DBusProxy* this_, AsyncResult* res, GLib2.Error** error);
24991 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);
24992 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);
24993 GLib2.Variant* /*new*/ g_dbus_proxy_call_with_unix_fd_list_finish(DBusProxy* this_, /*out*/ UnixFDList** out_fd_list, AsyncResult* res, GLib2.Error** error);
24994 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);
24995 GLib2.Variant* /*new*/ g_dbus_proxy_get_cached_property(DBusProxy* this_, char* property_name);
24996 char** /*new*/ g_dbus_proxy_get_cached_property_names(DBusProxy* this_);
24997 DBusConnection* g_dbus_proxy_get_connection(DBusProxy* this_);
24998 int g_dbus_proxy_get_default_timeout(DBusProxy* this_);
24999 DBusProxyFlags g_dbus_proxy_get_flags(DBusProxy* this_);
25000 DBusInterfaceInfo* /*new*/ g_dbus_proxy_get_interface_info(DBusProxy* this_);
25001 char* g_dbus_proxy_get_interface_name(DBusProxy* this_);
25002 char* g_dbus_proxy_get_name(DBusProxy* this_);
25003 char* /*new*/ g_dbus_proxy_get_name_owner(DBusProxy* this_);
25004 char* g_dbus_proxy_get_object_path(DBusProxy* this_);
25005 void g_dbus_proxy_set_cached_property(DBusProxy* this_, char* property_name, GLib2.Variant* value=null);
25006 void g_dbus_proxy_set_default_timeout(DBusProxy* this_, int timeout_msec);
25007 void g_dbus_proxy_set_interface_info(DBusProxy* this_, DBusInterfaceInfo* info=null);
25008 DBusServer* /*new*/ g_dbus_server_new_sync(char* address, DBusServerFlags flags, char* guid, DBusAuthObserver* observer, Cancellable* cancellable, GLib2.Error** error);
25009 char* g_dbus_server_get_client_address(DBusServer* this_);
25010 DBusServerFlags g_dbus_server_get_flags(DBusServer* this_);
25011 char* g_dbus_server_get_guid(DBusServer* this_);
25012 int g_dbus_server_is_active(DBusServer* this_);
25013 void g_dbus_server_start(DBusServer* this_);
25014 void g_dbus_server_stop(DBusServer* this_);
25015 DBusSignalInfo* /*new*/ g_dbus_signal_info_ref(DBusSignalInfo* this_);
25016 void g_dbus_signal_info_unref(DBusSignalInfo* this_);
25017 DataInputStream* /*new*/ g_data_input_stream_new(InputStream* base_stream);
25018 DataStreamByteOrder g_data_input_stream_get_byte_order(DataInputStream* this_);
25019 DataStreamNewlineType g_data_input_stream_get_newline_type(DataInputStream* this_);
25020 ubyte g_data_input_stream_read_byte(DataInputStream* this_, Cancellable* cancellable, GLib2.Error** error);
25021 short g_data_input_stream_read_int16(DataInputStream* this_, Cancellable* cancellable, GLib2.Error** error);
25022 int g_data_input_stream_read_int32(DataInputStream* this_, Cancellable* cancellable, GLib2.Error** error);
25023 long g_data_input_stream_read_int64(DataInputStream* this_, Cancellable* cancellable, GLib2.Error** error);
25024 ubyte* /*new*/ g_data_input_stream_read_line(DataInputStream* this_, /*out*/ size_t* length, Cancellable* cancellable, GLib2.Error** error);
25025 void g_data_input_stream_read_line_async(DataInputStream* this_, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25026 ubyte* /*new*/ g_data_input_stream_read_line_finish(DataInputStream* this_, AsyncResult* result, /*out*/ size_t* length, GLib2.Error** error);
25027 char* /*new*/ g_data_input_stream_read_line_finish_utf8(DataInputStream* this_, AsyncResult* result, /*out*/ size_t* length, GLib2.Error** error);
25028 char* /*new*/ g_data_input_stream_read_line_utf8(DataInputStream* this_, /*out*/ size_t* length, Cancellable* cancellable, GLib2.Error** error);
25029 ushort g_data_input_stream_read_uint16(DataInputStream* this_, Cancellable* cancellable, GLib2.Error** error);
25030 uint g_data_input_stream_read_uint32(DataInputStream* this_, Cancellable* cancellable, GLib2.Error** error);
25031 ulong g_data_input_stream_read_uint64(DataInputStream* this_, Cancellable* cancellable, GLib2.Error** error);
25032 char* /*new*/ g_data_input_stream_read_until(DataInputStream* this_, char* stop_chars, /*out*/ size_t* length, Cancellable* cancellable, GLib2.Error** error);
25033 void g_data_input_stream_read_until_async(DataInputStream* this_, char* stop_chars, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25034 char* /*new*/ g_data_input_stream_read_until_finish(DataInputStream* this_, AsyncResult* result, /*out*/ size_t* length, GLib2.Error** error);
25035 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);
25036 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);
25037 char* /*new*/ g_data_input_stream_read_upto_finish(DataInputStream* this_, AsyncResult* result, /*out*/ size_t* length, GLib2.Error** error);
25038 void g_data_input_stream_set_byte_order(DataInputStream* this_, DataStreamByteOrder order);
25039 void g_data_input_stream_set_newline_type(DataInputStream* this_, DataStreamNewlineType type);
25040 DataOutputStream* /*new*/ g_data_output_stream_new(OutputStream* base_stream);
25041 DataStreamByteOrder g_data_output_stream_get_byte_order(DataOutputStream* this_);
25042 int g_data_output_stream_put_byte(DataOutputStream* this_, ubyte data, Cancellable* cancellable, GLib2.Error** error);
25043 int g_data_output_stream_put_int16(DataOutputStream* this_, short data, Cancellable* cancellable, GLib2.Error** error);
25044 int g_data_output_stream_put_int32(DataOutputStream* this_, int data, Cancellable* cancellable, GLib2.Error** error);
25045 int g_data_output_stream_put_int64(DataOutputStream* this_, long data, Cancellable* cancellable, GLib2.Error** error);
25046 int g_data_output_stream_put_string(DataOutputStream* this_, char* str, Cancellable* cancellable, GLib2.Error** error);
25047 int g_data_output_stream_put_uint16(DataOutputStream* this_, ushort data, Cancellable* cancellable, GLib2.Error** error);
25048 int g_data_output_stream_put_uint32(DataOutputStream* this_, uint data, Cancellable* cancellable, GLib2.Error** error);
25049 int g_data_output_stream_put_uint64(DataOutputStream* this_, ulong data, Cancellable* cancellable, GLib2.Error** error);
25050 void g_data_output_stream_set_byte_order(DataOutputStream* this_, DataStreamByteOrder order);
25051 DesktopAppInfo* /*new*/ g_desktop_app_info_new(char* desktop_id);
25052 DesktopAppInfo* /*new*/ g_desktop_app_info_new_from_filename(char* filename);
25053 DesktopAppInfo* /*new*/ g_desktop_app_info_new_from_keyfile(GLib2.KeyFile* key_file);
25054 void g_desktop_app_info_set_desktop_env(char* desktop_env);
25055 char* g_desktop_app_info_get_categories(DesktopAppInfo* this_);
25056 char* g_desktop_app_info_get_filename(DesktopAppInfo* this_);
25057 char* g_desktop_app_info_get_generic_name(DesktopAppInfo* this_);
25058 int g_desktop_app_info_get_is_hidden(DesktopAppInfo* this_);
25059 int g_desktop_app_info_get_nodisplay(DesktopAppInfo* this_);
25060 int g_desktop_app_info_get_show_in(DesktopAppInfo* this_, char* desktop_env);
25061 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);
25062 AppInfo* /*new*/ g_desktop_app_info_lookup_get_default_for_uri_scheme(DesktopAppInfoLookup* this_, char* uri_scheme);
25063 int g_drive_can_eject(Drive* this_);
25064 int g_drive_can_poll_for_media(Drive* this_);
25065 int g_drive_can_start(Drive* this_);
25066 int g_drive_can_start_degraded(Drive* this_);
25067 int g_drive_can_stop(Drive* this_);
25068 void g_drive_eject(Drive* this_, MountUnmountFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25069 int g_drive_eject_finish(Drive* this_, AsyncResult* result, GLib2.Error** error);
25070 void g_drive_eject_with_operation(Drive* this_, MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25071 int g_drive_eject_with_operation_finish(Drive* this_, AsyncResult* result, GLib2.Error** error);
25072 char** /*new*/ g_drive_enumerate_identifiers(Drive* this_);
25073 Icon* /*new*/ g_drive_get_icon(Drive* this_);
25074 char* /*new*/ g_drive_get_identifier(Drive* this_, char* kind);
25075 char* /*new*/ g_drive_get_name(Drive* this_);
25076 DriveStartStopType g_drive_get_start_stop_type(Drive* this_);
25077 GLib2.List* /*new*/ g_drive_get_volumes(Drive* this_);
25078 int g_drive_has_media(Drive* this_);
25079 int g_drive_has_volumes(Drive* this_);
25080 int g_drive_is_media_check_automatic(Drive* this_);
25081 int g_drive_is_media_removable(Drive* this_);
25082 void g_drive_poll_for_media(Drive* this_, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25083 int g_drive_poll_for_media_finish(Drive* this_, AsyncResult* result, GLib2.Error** error);
25084 void g_drive_start(Drive* this_, DriveStartFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25085 int g_drive_start_finish(Drive* this_, AsyncResult* result, GLib2.Error** error);
25086 void g_drive_stop(Drive* this_, MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25087 int g_drive_stop_finish(Drive* this_, AsyncResult* result, GLib2.Error** error);
25088 Emblem* /*new*/ g_emblem_new(Icon* icon);
25089 Emblem* /*new*/ g_emblem_new_with_origin(Icon* icon, EmblemOrigin origin);
25090 Icon* g_emblem_get_icon(Emblem* this_);
25091 EmblemOrigin g_emblem_get_origin(Emblem* this_);
25092 Icon* /*new*/ g_emblemed_icon_new(Icon* icon, Emblem* emblem=null);
25093 void g_emblemed_icon_add_emblem(EmblemedIcon* this_, Emblem* emblem);
25094 void g_emblemed_icon_clear_emblems(EmblemedIcon* this_);
25095 GLib2.List* g_emblemed_icon_get_emblems(EmblemedIcon* this_);
25096 Icon* g_emblemed_icon_get_icon(EmblemedIcon* this_);
25097 uint g_file_hash(const(void)* file);
25098 File* /*new*/ g_file_new_for_commandline_arg(char* arg);
25099 File* /*new*/ g_file_new_for_path(char* path);
25100 File* /*new*/ g_file_new_for_uri(char* uri);
25101 File* /*new*/ g_file_parse_name(char* parse_name);
25102 FileOutputStream* /*new*/ g_file_append_to(File* this_, FileCreateFlags flags, Cancellable* cancellable, GLib2.Error** error);
25103 void g_file_append_to_async(File* this_, FileCreateFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25104 FileOutputStream* /*new*/ g_file_append_to_finish(File* this_, AsyncResult* res, GLib2.Error** error);
25105 int g_file_copy(File* this_, File* destination, FileCopyFlags flags, Cancellable* cancellable, FileProgressCallback progress_callback, void* progress_callback_data, GLib2.Error** error);
25106 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);
25107 int g_file_copy_attributes(File* this_, File* destination, FileCopyFlags flags, Cancellable* cancellable, GLib2.Error** error);
25108 int g_file_copy_finish(File* this_, AsyncResult* res, GLib2.Error** error);
25109 FileOutputStream* /*new*/ g_file_create(File* this_, FileCreateFlags flags, Cancellable* cancellable, GLib2.Error** error);
25110 void g_file_create_async(File* this_, FileCreateFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25111 FileOutputStream* /*new*/ g_file_create_finish(File* this_, AsyncResult* res, GLib2.Error** error);
25112 FileIOStream* /*new*/ g_file_create_readwrite(File* this_, FileCreateFlags flags, Cancellable* cancellable, GLib2.Error** error);
25113 void g_file_create_readwrite_async(File* this_, FileCreateFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25114 FileIOStream* /*new*/ g_file_create_readwrite_finish(File* this_, AsyncResult* res, GLib2.Error** error);
25115 int g_file_delete(File* this_, Cancellable* cancellable, GLib2.Error** error);
25116 File* /*new*/ g_file_dup(File* this_);
25117 void g_file_eject_mountable(File* this_, MountUnmountFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25118 int g_file_eject_mountable_finish(File* this_, AsyncResult* result, GLib2.Error** error);
25119 void g_file_eject_mountable_with_operation(File* this_, MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25120 int g_file_eject_mountable_with_operation_finish(File* this_, AsyncResult* result, GLib2.Error** error);
25121 FileEnumerator* /*new*/ g_file_enumerate_children(File* this_, char* attributes, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error);
25122 void g_file_enumerate_children_async(File* this_, char* attributes, FileQueryInfoFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25123 FileEnumerator* /*new*/ g_file_enumerate_children_finish(File* this_, AsyncResult* res, GLib2.Error** error);
25124 int g_file_equal(File* this_, File* file2);
25125 Mount* /*new*/ g_file_find_enclosing_mount(File* this_, Cancellable* cancellable, GLib2.Error** error);
25126 void g_file_find_enclosing_mount_async(File* this_, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25127 Mount* /*new*/ g_file_find_enclosing_mount_finish(File* this_, AsyncResult* res, GLib2.Error** error);
25128 char* /*new*/ g_file_get_basename(File* this_);
25129 File* /*new*/ g_file_get_child(File* this_, char* name);
25130 File* /*new*/ g_file_get_child_for_display_name(File* this_, char* display_name, GLib2.Error** error);
25131 File* /*new*/ g_file_get_parent(File* this_);
25132 char* /*new*/ g_file_get_parse_name(File* this_);
25133 char* /*new*/ g_file_get_path(File* this_);
25134 char* /*new*/ g_file_get_relative_path(File* this_, File* descendant);
25135 char* /*new*/ g_file_get_uri(File* this_);
25136 char* /*new*/ g_file_get_uri_scheme(File* this_);
25137 int g_file_has_parent(File* this_, File* parent);
25138 int g_file_has_prefix(File* this_, File* prefix);
25139 int g_file_has_uri_scheme(File* this_, char* uri_scheme);
25140 Icon* /*new*/ g_file_icon_new(File* this_);
25141 int g_file_is_native(File* this_);
25142 int g_file_load_contents(File* this_, Cancellable* cancellable, /*out*/ ubyte** contents, /*out*/ size_t* length, /*out*/ char** etag_out, GLib2.Error** error);
25143 void g_file_load_contents_async(File* this_, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25144 int g_file_load_contents_finish(File* this_, AsyncResult* res, /*out*/ ubyte** contents, /*out*/ size_t* length, /*out*/ char** etag_out, GLib2.Error** error);
25145 void g_file_load_partial_contents_async(File* this_, Cancellable* cancellable, FileReadMoreCallback read_more_callback, AsyncReadyCallback callback, void* user_data);
25146 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);
25147 int g_file_make_directory(File* this_, Cancellable* cancellable, GLib2.Error** error);
25148 int g_file_make_directory_with_parents(File* this_, Cancellable* cancellable, GLib2.Error** error);
25149 int g_file_make_symbolic_link(File* this_, char* symlink_value, Cancellable* cancellable, GLib2.Error** error);
25150 FileMonitor* /*new*/ g_file_monitor(File* this_, FileMonitorFlags flags, Cancellable* cancellable, GLib2.Error** error);
25151 FileMonitor* /*new*/ g_file_monitor_directory(File* this_, FileMonitorFlags flags, Cancellable* cancellable, GLib2.Error** error);
25152 FileMonitor* /*new*/ g_file_monitor_file(File* this_, FileMonitorFlags flags, Cancellable* cancellable, GLib2.Error** error);
25153 void g_file_mount_enclosing_volume(File* this_, MountMountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25154 int g_file_mount_enclosing_volume_finish(File* this_, AsyncResult* result, GLib2.Error** error);
25155 void g_file_mount_mountable(File* this_, MountMountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25156 File* /*new*/ g_file_mount_mountable_finish(File* this_, AsyncResult* result, GLib2.Error** error);
25157 int g_file_move(File* this_, File* destination, FileCopyFlags flags, Cancellable* cancellable, FileProgressCallback progress_callback, void* progress_callback_data, GLib2.Error** error);
25158 FileIOStream* /*new*/ g_file_open_readwrite(File* this_, Cancellable* cancellable, GLib2.Error** error);
25159 void g_file_open_readwrite_async(File* this_, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25160 FileIOStream* /*new*/ g_file_open_readwrite_finish(File* this_, AsyncResult* res, GLib2.Error** error);
25161 void g_file_poll_mountable(File* this_, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25162 int g_file_poll_mountable_finish(File* this_, AsyncResult* result, GLib2.Error** error);
25163 AppInfo* /*new*/ g_file_query_default_handler(File* this_, Cancellable* cancellable, GLib2.Error** error);
25164 int g_file_query_exists(File* this_, Cancellable* cancellable=null);
25165 FileType g_file_query_file_type(File* this_, FileQueryInfoFlags flags, Cancellable* cancellable=null);
25166 FileInfo* /*new*/ g_file_query_filesystem_info(File* this_, char* attributes, Cancellable* cancellable, GLib2.Error** error);
25167 void g_file_query_filesystem_info_async(File* this_, char* attributes, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25168 FileInfo* /*new*/ g_file_query_filesystem_info_finish(File* this_, AsyncResult* res, GLib2.Error** error);
25169 FileInfo* /*new*/ g_file_query_info(File* this_, char* attributes, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error);
25170 void g_file_query_info_async(File* this_, char* attributes, FileQueryInfoFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25171 FileInfo* /*new*/ g_file_query_info_finish(File* this_, AsyncResult* res, GLib2.Error** error);
25172 FileAttributeInfoList* /*new*/ g_file_query_settable_attributes(File* this_, Cancellable* cancellable, GLib2.Error** error);
25173 FileAttributeInfoList* /*new*/ g_file_query_writable_namespaces(File* this_, Cancellable* cancellable, GLib2.Error** error);
25174 FileInputStream* /*new*/ g_file_read(File* this_, Cancellable* cancellable, GLib2.Error** error);
25175 void g_file_read_async(File* this_, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25176 FileInputStream* /*new*/ g_file_read_finish(File* this_, AsyncResult* res, GLib2.Error** error);
25177 FileOutputStream* /*new*/ g_file_replace(File* this_, char* etag, int make_backup, FileCreateFlags flags, Cancellable* cancellable, GLib2.Error** error);
25178 void g_file_replace_async(File* this_, char* etag, int make_backup, FileCreateFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25179 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);
25180 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);
25181 int g_file_replace_contents_finish(File* this_, AsyncResult* res, /*out*/ char** new_etag, GLib2.Error** error);
25182 FileOutputStream* /*new*/ g_file_replace_finish(File* this_, AsyncResult* res, GLib2.Error** error);
25183 FileIOStream* /*new*/ g_file_replace_readwrite(File* this_, char* etag, int make_backup, FileCreateFlags flags, Cancellable* cancellable, GLib2.Error** error);
25184 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);
25185 FileIOStream* /*new*/ g_file_replace_readwrite_finish(File* this_, AsyncResult* res, GLib2.Error** error);
25186 File* /*new*/ g_file_resolve_relative_path(File* this_, char* relative_path);
25187 int g_file_set_attribute(File* this_, char* attribute, FileAttributeType type, void* value_p, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error);
25188 int g_file_set_attribute_byte_string(File* this_, char* attribute, char* value, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error);
25189 int g_file_set_attribute_int32(File* this_, char* attribute, int value, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error);
25190 int g_file_set_attribute_int64(File* this_, char* attribute, long value, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error);
25191 int g_file_set_attribute_string(File* this_, char* attribute, char* value, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error);
25192 int g_file_set_attribute_uint32(File* this_, char* attribute, uint value, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error);
25193 int g_file_set_attribute_uint64(File* this_, char* attribute, ulong value, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error);
25194 void g_file_set_attributes_async(File* this_, FileInfo* info, FileQueryInfoFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25195 int g_file_set_attributes_finish(File* this_, AsyncResult* result, /*out*/ FileInfo** info, GLib2.Error** error);
25196 int g_file_set_attributes_from_info(File* this_, FileInfo* info, FileQueryInfoFlags flags, Cancellable* cancellable, GLib2.Error** error);
25197 File* /*new*/ g_file_set_display_name(File* this_, char* display_name, Cancellable* cancellable, GLib2.Error** error);
25198 void g_file_set_display_name_async(File* this_, char* display_name, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25199 File* /*new*/ g_file_set_display_name_finish(File* this_, AsyncResult* res, GLib2.Error** error);
25200 void g_file_start_mountable(File* this_, DriveStartFlags flags, MountOperation* start_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25201 int g_file_start_mountable_finish(File* this_, AsyncResult* result, GLib2.Error** error);
25202 void g_file_stop_mountable(File* this_, MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25203 int g_file_stop_mountable_finish(File* this_, AsyncResult* result, GLib2.Error** error);
25204 int g_file_supports_thread_contexts(File* this_);
25205 int g_file_trash(File* this_, Cancellable* cancellable, GLib2.Error** error);
25206 void g_file_unmount_mountable(File* this_, MountUnmountFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25207 int g_file_unmount_mountable_finish(File* this_, AsyncResult* result, GLib2.Error** error);
25208 void g_file_unmount_mountable_with_operation(File* this_, MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25209 int g_file_unmount_mountable_with_operation_finish(File* this_, AsyncResult* result, GLib2.Error** error);
25210 FileAttributeInfoList* /*new*/ g_file_attribute_info_list_new();
25211 void g_file_attribute_info_list_add(FileAttributeInfoList* this_, char* name, FileAttributeType type, FileAttributeInfoFlags flags);
25212 FileAttributeInfoList* /*new*/ g_file_attribute_info_list_dup(FileAttributeInfoList* this_);
25213 FileAttributeInfo* g_file_attribute_info_list_lookup(FileAttributeInfoList* this_, char* name);
25214 FileAttributeInfoList* /*new*/ g_file_attribute_info_list_ref(FileAttributeInfoList* this_);
25215 void g_file_attribute_info_list_unref(FileAttributeInfoList* this_);
25216 FileAttributeMatcher* /*new*/ g_file_attribute_matcher_new(char* attributes);
25217 int g_file_attribute_matcher_enumerate_namespace(FileAttributeMatcher* this_, char* ns);
25218 char* g_file_attribute_matcher_enumerate_next(FileAttributeMatcher* this_);
25219 int g_file_attribute_matcher_matches(FileAttributeMatcher* this_, char* attribute);
25220 int g_file_attribute_matcher_matches_only(FileAttributeMatcher* this_, char* attribute);
25221 FileAttributeMatcher* /*new*/ g_file_attribute_matcher_ref(FileAttributeMatcher* this_);
25222 void g_file_attribute_matcher_unref(FileAttributeMatcher* this_);
25223 int g_file_descriptor_based_get_fd(FileDescriptorBased* this_);
25224 int g_file_enumerator_close(FileEnumerator* this_, Cancellable* cancellable, GLib2.Error** error);
25225 void g_file_enumerator_close_async(FileEnumerator* this_, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25226 int g_file_enumerator_close_finish(FileEnumerator* this_, AsyncResult* result, GLib2.Error** error);
25227 File* g_file_enumerator_get_container(FileEnumerator* this_);
25228 int g_file_enumerator_has_pending(FileEnumerator* this_);
25229 int g_file_enumerator_is_closed(FileEnumerator* this_);
25230 FileInfo* /*new*/ g_file_enumerator_next_file(FileEnumerator* this_, Cancellable* cancellable, GLib2.Error** error);
25231 void g_file_enumerator_next_files_async(FileEnumerator* this_, int num_files, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25232 GLib2.List* /*new*/ g_file_enumerator_next_files_finish(FileEnumerator* this_, AsyncResult* result, GLib2.Error** error);
25233 void g_file_enumerator_set_pending(FileEnumerator* this_, int pending);
25234 char* /*new*/ g_file_io_stream_get_etag(FileIOStream* this_);
25235 FileInfo* /*new*/ g_file_io_stream_query_info(FileIOStream* this_, char* attributes, Cancellable* cancellable, GLib2.Error** error);
25236 void g_file_io_stream_query_info_async(FileIOStream* this_, char* attributes, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25237 FileInfo* /*new*/ g_file_io_stream_query_info_finish(FileIOStream* this_, AsyncResult* result, GLib2.Error** error);
25238 File* g_file_icon_get_file(FileIcon* this_);
25239 FileInfo* /*new*/ g_file_info_new();
25240 void g_file_info_clear_status(FileInfo* this_);
25241 void g_file_info_copy_into(FileInfo* this_, FileInfo* dest_info);
25242 FileInfo* /*new*/ g_file_info_dup(FileInfo* this_);
25243 char* /*new*/ g_file_info_get_attribute_as_string(FileInfo* this_, char* attribute);
25244 int g_file_info_get_attribute_boolean(FileInfo* this_, char* attribute);
25245 char* g_file_info_get_attribute_byte_string(FileInfo* this_, char* attribute);
25246 int g_file_info_get_attribute_data(FileInfo* this_, char* attribute, /*out*/ FileAttributeType* type=null, /*out*/ void** value_pp=null, /*out*/ FileAttributeStatus* status=null);
25247 int g_file_info_get_attribute_int32(FileInfo* this_, char* attribute);
25248 long g_file_info_get_attribute_int64(FileInfo* this_, char* attribute);
25249 GObject2.Object* g_file_info_get_attribute_object(FileInfo* this_, char* attribute);
25250 FileAttributeStatus g_file_info_get_attribute_status(FileInfo* this_, char* attribute);
25251 char* g_file_info_get_attribute_string(FileInfo* this_, char* attribute);
25252 char** g_file_info_get_attribute_stringv(FileInfo* this_, char* attribute);
25253 FileAttributeType g_file_info_get_attribute_type(FileInfo* this_, char* attribute);
25254 uint g_file_info_get_attribute_uint32(FileInfo* this_, char* attribute);
25255 ulong g_file_info_get_attribute_uint64(FileInfo* this_, char* attribute);
25256 char* g_file_info_get_content_type(FileInfo* this_);
25257 char* g_file_info_get_display_name(FileInfo* this_);
25258 char* g_file_info_get_edit_name(FileInfo* this_);
25259 char* g_file_info_get_etag(FileInfo* this_);
25260 FileType g_file_info_get_file_type(FileInfo* this_);
25261 Icon* g_file_info_get_icon(FileInfo* this_);
25262 int g_file_info_get_is_backup(FileInfo* this_);
25263 int g_file_info_get_is_hidden(FileInfo* this_);
25264 int g_file_info_get_is_symlink(FileInfo* this_);
25265 void g_file_info_get_modification_time(FileInfo* this_, GLib2.TimeVal* result);
25266 char* g_file_info_get_name(FileInfo* this_);
25267 long g_file_info_get_size(FileInfo* this_);
25268 int g_file_info_get_sort_order(FileInfo* this_);
25269 char* g_file_info_get_symlink_target(FileInfo* this_);
25270 int g_file_info_has_attribute(FileInfo* this_, char* attribute);
25271 int g_file_info_has_namespace(FileInfo* this_, char* name_space);
25272 char** /*new*/ g_file_info_list_attributes(FileInfo* this_, char* name_space);
25273 void g_file_info_remove_attribute(FileInfo* this_, char* attribute);
25274 void g_file_info_set_attribute(FileInfo* this_, char* attribute, FileAttributeType type, void* value_p);
25275 void g_file_info_set_attribute_boolean(FileInfo* this_, char* attribute, int attr_value);
25276 void g_file_info_set_attribute_byte_string(FileInfo* this_, char* attribute, char* attr_value);
25277 void g_file_info_set_attribute_int32(FileInfo* this_, char* attribute, int attr_value);
25278 void g_file_info_set_attribute_int64(FileInfo* this_, char* attribute, long attr_value);
25279 void g_file_info_set_attribute_mask(FileInfo* this_, FileAttributeMatcher* mask);
25280 void g_file_info_set_attribute_object(FileInfo* this_, char* attribute, GObject2.Object* attr_value);
25281 int g_file_info_set_attribute_status(FileInfo* this_, char* attribute, FileAttributeStatus status);
25282 void g_file_info_set_attribute_string(FileInfo* this_, char* attribute, char* attr_value);
25283 void g_file_info_set_attribute_stringv(FileInfo* this_, char* attribute, char** attr_value);
25284 void g_file_info_set_attribute_uint32(FileInfo* this_, char* attribute, uint attr_value);
25285 void g_file_info_set_attribute_uint64(FileInfo* this_, char* attribute, ulong attr_value);
25286 void g_file_info_set_content_type(FileInfo* this_, char* content_type);
25287 void g_file_info_set_display_name(FileInfo* this_, char* display_name);
25288 void g_file_info_set_edit_name(FileInfo* this_, char* edit_name);
25289 void g_file_info_set_file_type(FileInfo* this_, FileType type);
25290 void g_file_info_set_icon(FileInfo* this_, Icon* icon);
25291 void g_file_info_set_is_hidden(FileInfo* this_, int is_hidden);
25292 void g_file_info_set_is_symlink(FileInfo* this_, int is_symlink);
25293 void g_file_info_set_modification_time(FileInfo* this_, GLib2.TimeVal* mtime);
25294 void g_file_info_set_name(FileInfo* this_, char* name);
25295 void g_file_info_set_size(FileInfo* this_, long size);
25296 void g_file_info_set_sort_order(FileInfo* this_, int sort_order);
25297 void g_file_info_set_symlink_target(FileInfo* this_, char* symlink_target);
25298 void g_file_info_unset_attribute_mask(FileInfo* this_);
25299 FileInfo* /*new*/ g_file_input_stream_query_info(FileInputStream* this_, char* attributes, Cancellable* cancellable, GLib2.Error** error);
25300 void g_file_input_stream_query_info_async(FileInputStream* this_, char* attributes, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25301 FileInfo* /*new*/ g_file_input_stream_query_info_finish(FileInputStream* this_, AsyncResult* result, GLib2.Error** error);
25302 int g_file_monitor_cancel(FileMonitor* this_);
25303 void g_file_monitor_emit_event(FileMonitor* this_, File* child, File* other_file, FileMonitorEvent event_type);
25304 int g_file_monitor_is_cancelled(FileMonitor* this_);
25305 void g_file_monitor_set_rate_limit(FileMonitor* this_, int limit_msecs);
25306 char* /*new*/ g_file_output_stream_get_etag(FileOutputStream* this_);
25307 FileInfo* /*new*/ g_file_output_stream_query_info(FileOutputStream* this_, char* attributes, Cancellable* cancellable, GLib2.Error** error);
25308 void g_file_output_stream_query_info_async(FileOutputStream* this_, char* attributes, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25309 FileInfo* /*new*/ g_file_output_stream_query_info_finish(FileOutputStream* this_, AsyncResult* result, GLib2.Error** error);
25310 FilenameCompleter* /*new*/ g_filename_completer_new();
25311 char* /*new*/ g_filename_completer_get_completion_suffix(FilenameCompleter* this_, char* initial_text);
25312 char** /*new*/ g_filename_completer_get_completions(FilenameCompleter* this_, char* initial_text);
25313 void g_filename_completer_set_dirs_only(FilenameCompleter* this_, int dirs_only);
25314 InputStream* g_filter_input_stream_get_base_stream(FilterInputStream* this_);
25315 int g_filter_input_stream_get_close_base_stream(FilterInputStream* this_);
25316 void g_filter_input_stream_set_close_base_stream(FilterInputStream* this_, int close_base);
25317 OutputStream* g_filter_output_stream_get_base_stream(FilterOutputStream* this_);
25318 int g_filter_output_stream_get_close_base_stream(FilterOutputStream* this_);
25319 void g_filter_output_stream_set_close_base_stream(FilterOutputStream* this_, int close_base);
25320 char* g_io_extension_get_name(IOExtension* this_);
25321 int g_io_extension_get_priority(IOExtension* this_);
25322 GObject2.TypeClass* /*new*/ g_io_extension_ref_class(IOExtension* this_);
25323 IOExtension* g_io_extension_point_get_extension_by_name(IOExtensionPoint* this_, char* name);
25324 GLib2.List* g_io_extension_point_get_extensions(IOExtensionPoint* this_);
25325 Type g_io_extension_point_get_required_type(IOExtensionPoint* this_);
25326 void g_io_extension_point_set_required_type(IOExtensionPoint* this_, Type type);
25327 IOExtension* g_io_extension_point_implement(char* extension_point_name, Type type, char* extension_name, int priority);
25328 IOExtensionPoint* g_io_extension_point_lookup(char* name);
25329 IOExtensionPoint* g_io_extension_point_register(char* name);
25330 IOModule* /*new*/ g_io_module_new(char* filename);
25331 char** /*new*/ g_io_module_query();
25332 void g_io_module_load(IOModule* this_);
25333 void g_io_module_unload(IOModule* this_);
25334 void g_io_module_scope_block(IOModuleScope* this_, char* basename);
25335 void g_io_module_scope_free(IOModuleScope* this_);
25336 IOModuleScope* /*new*/ g_io_module_scope_new(IOModuleScopeFlags flags);
25337 int g_io_scheduler_job_send_to_mainloop(IOSchedulerJob* this_, GLib2.SourceFunc func, void* user_data, GLib2.DestroyNotify notify);
25338 void g_io_scheduler_job_send_to_mainloop_async(IOSchedulerJob* this_, GLib2.SourceFunc func, void* user_data, GLib2.DestroyNotify notify);
25339 int g_io_stream_splice_finish(AsyncResult* result, GLib2.Error** error);
25340 void g_io_stream_clear_pending(IOStream* this_);
25341 int g_io_stream_close(IOStream* this_, Cancellable* cancellable, GLib2.Error** error);
25342 void g_io_stream_close_async(IOStream* this_, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25343 int g_io_stream_close_finish(IOStream* this_, AsyncResult* result, GLib2.Error** error);
25344 InputStream* g_io_stream_get_input_stream(IOStream* this_);
25345 OutputStream* g_io_stream_get_output_stream(IOStream* this_);
25346 int g_io_stream_has_pending(IOStream* this_);
25347 int g_io_stream_is_closed(IOStream* this_);
25348 int g_io_stream_set_pending(IOStream* this_, GLib2.Error** error);
25349 void g_io_stream_splice_async(IOStream* this_, IOStream* stream2, IOStreamSpliceFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25350 uint g_icon_hash(const(void)* icon);
25351 Icon* /*new*/ g_icon_new_for_string(char* str, GLib2.Error** error);
25352 int g_icon_equal(Icon* this_, Icon* icon2);
25353 char* /*new*/ g_icon_to_string(Icon* this_);
25354 InetAddress* /*new*/ g_inet_address_new_any(SocketFamily family);
25355 InetAddress* /*new*/ g_inet_address_new_from_bytes(ubyte* bytes, SocketFamily family);
25356 InetAddress* /*new*/ g_inet_address_new_from_string(char* string_);
25357 InetAddress* /*new*/ g_inet_address_new_loopback(SocketFamily family);
25358 int g_inet_address_equal(InetAddress* this_, InetAddress* other_address);
25359 SocketFamily g_inet_address_get_family(InetAddress* this_);
25360 int g_inet_address_get_is_any(InetAddress* this_);
25361 int g_inet_address_get_is_link_local(InetAddress* this_);
25362 int g_inet_address_get_is_loopback(InetAddress* this_);
25363 int g_inet_address_get_is_mc_global(InetAddress* this_);
25364 int g_inet_address_get_is_mc_link_local(InetAddress* this_);
25365 int g_inet_address_get_is_mc_node_local(InetAddress* this_);
25366 int g_inet_address_get_is_mc_org_local(InetAddress* this_);
25367 int g_inet_address_get_is_mc_site_local(InetAddress* this_);
25368 int g_inet_address_get_is_multicast(InetAddress* this_);
25369 int g_inet_address_get_is_site_local(InetAddress* this_);
25370 size_t g_inet_address_get_native_size(InetAddress* this_);
25371 ubyte* g_inet_address_to_bytes(InetAddress* this_);
25372 char* /*new*/ g_inet_address_to_string(InetAddress* this_);
25373 InetSocketAddress* /*new*/ g_inet_socket_address_new(InetAddress* address, ushort port);
25374 InetAddress* g_inet_socket_address_get_address(InetSocketAddress* this_);
25375 ushort g_inet_socket_address_get_port(InetSocketAddress* this_);
25376 void* /*new*/ g_initable_new(Type object_type, Cancellable* cancellable, GLib2.Error** error, char* first_property_name, ...);
25377 GObject2.Object* /*new*/ g_initable_new_valist(Type object_type, char* first_property_name, va_list var_args, Cancellable* cancellable, GLib2.Error** error);
25378 void* /*new*/ g_initable_newv(Type object_type, uint n_parameters, GObject2.Parameter* parameters, Cancellable* cancellable, GLib2.Error** error);
25379 int g_initable_init(Initable* this_, Cancellable* cancellable, GLib2.Error** error);
25380 void g_input_stream_clear_pending(InputStream* this_);
25381 int g_input_stream_close(InputStream* this_, Cancellable* cancellable, GLib2.Error** error);
25382 void g_input_stream_close_async(InputStream* this_, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25383 int g_input_stream_close_finish(InputStream* this_, AsyncResult* result, GLib2.Error** error);
25384 int g_input_stream_has_pending(InputStream* this_);
25385 int g_input_stream_is_closed(InputStream* this_);
25386 ssize_t g_input_stream_read(InputStream* this_, void* buffer, size_t count, Cancellable* cancellable, GLib2.Error** error);
25387 int g_input_stream_read_all(InputStream* this_, void* buffer, size_t count, /*out*/ size_t* bytes_read, Cancellable* cancellable, GLib2.Error** error);
25388 void g_input_stream_read_async(InputStream* this_, void* buffer, size_t count, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25389 ssize_t g_input_stream_read_finish(InputStream* this_, AsyncResult* result, GLib2.Error** error);
25390 int g_input_stream_set_pending(InputStream* this_, GLib2.Error** error);
25391 ssize_t g_input_stream_skip(InputStream* this_, size_t count, Cancellable* cancellable, GLib2.Error** error);
25392 void g_input_stream_skip_async(InputStream* this_, size_t count, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25393 ssize_t g_input_stream_skip_finish(InputStream* this_, AsyncResult* result, GLib2.Error** error);
25394 InputStream* /*new*/ g_loadable_icon_load(LoadableIcon* this_, int size, /*out*/ char** type, Cancellable* cancellable, GLib2.Error** error);
25395 void g_loadable_icon_load_async(LoadableIcon* this_, int size, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25396 InputStream* /*new*/ g_loadable_icon_load_finish(LoadableIcon* this_, AsyncResult* res, char** type, GLib2.Error** error);
25397 MemoryInputStream* /*new*/ g_memory_input_stream_new();
25398 MemoryInputStream* /*new*/ g_memory_input_stream_new_from_data(ubyte* data, ssize_t len, GLib2.DestroyNotify destroy=null);
25399 void g_memory_input_stream_add_data(MemoryInputStream* this_, ubyte* data, ssize_t len, GLib2.DestroyNotify destroy=null);
25400 MemoryOutputStream* /*new*/ g_memory_output_stream_new(void* data, size_t size, ReallocFunc realloc_function, GLib2.DestroyNotify destroy_function);
25401 void* g_memory_output_stream_get_data(MemoryOutputStream* this_);
25402 size_t g_memory_output_stream_get_data_size(MemoryOutputStream* this_);
25403 size_t g_memory_output_stream_get_size(MemoryOutputStream* this_);
25404 void* /*new*/ g_memory_output_stream_steal_data(MemoryOutputStream* this_);
25405 int g_mount_can_eject(Mount* this_);
25406 int g_mount_can_unmount(Mount* this_);
25407 void g_mount_eject(Mount* this_, MountUnmountFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25408 int g_mount_eject_finish(Mount* this_, AsyncResult* result, GLib2.Error** error);
25409 void g_mount_eject_with_operation(Mount* this_, MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25410 int g_mount_eject_with_operation_finish(Mount* this_, AsyncResult* result, GLib2.Error** error);
25411 File* /*new*/ g_mount_get_default_location(Mount* this_);
25412 Drive* /*new*/ g_mount_get_drive(Mount* this_);
25413 Icon* /*new*/ g_mount_get_icon(Mount* this_);
25414 char* /*new*/ g_mount_get_name(Mount* this_);
25415 File* /*new*/ g_mount_get_root(Mount* this_);
25416 char* /*new*/ g_mount_get_uuid(Mount* this_);
25417 Volume* /*new*/ g_mount_get_volume(Mount* this_);
25418 void g_mount_guess_content_type(Mount* this_, int force_rescan, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25419 char** /*new*/ g_mount_guess_content_type_finish(Mount* this_, AsyncResult* result, GLib2.Error** error);
25420 char** /*new*/ g_mount_guess_content_type_sync(Mount* this_, int force_rescan, Cancellable* cancellable, GLib2.Error** error);
25421 int g_mount_is_shadowed(Mount* this_);
25422 void g_mount_remount(Mount* this_, MountMountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25423 int g_mount_remount_finish(Mount* this_, AsyncResult* result, GLib2.Error** error);
25424 void g_mount_shadow(Mount* this_);
25425 void g_mount_unmount(Mount* this_, MountUnmountFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25426 int g_mount_unmount_finish(Mount* this_, AsyncResult* result, GLib2.Error** error);
25427 void g_mount_unmount_with_operation(Mount* this_, MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25428 int g_mount_unmount_with_operation_finish(Mount* this_, AsyncResult* result, GLib2.Error** error);
25429 void g_mount_unshadow(Mount* this_);
25430 MountOperation* /*new*/ g_mount_operation_new();
25431 int g_mount_operation_get_anonymous(MountOperation* this_);
25432 int g_mount_operation_get_choice(MountOperation* this_);
25433 char* g_mount_operation_get_domain(MountOperation* this_);
25434 char* g_mount_operation_get_password(MountOperation* this_);
25435 PasswordSave g_mount_operation_get_password_save(MountOperation* this_);
25436 char* g_mount_operation_get_username(MountOperation* this_);
25437 void g_mount_operation_reply(MountOperation* this_, MountOperationResult result);
25438 void g_mount_operation_set_anonymous(MountOperation* this_, int anonymous);
25439 void g_mount_operation_set_choice(MountOperation* this_, int choice);
25440 void g_mount_operation_set_domain(MountOperation* this_, char* domain);
25441 void g_mount_operation_set_password(MountOperation* this_, char* password);
25442 void g_mount_operation_set_password_save(MountOperation* this_, PasswordSave save);
25443 void g_mount_operation_set_username(MountOperation* this_, char* username);
25444 SocketConnectable* /*new*/ g_network_address_new(char* hostname, ushort port);
25445 SocketConnectable* /*new*/ g_network_address_parse(char* host_and_port, ushort default_port, GLib2.Error** error);
25446 SocketConnectable* /*new*/ g_network_address_parse_uri(char* uri, ushort default_port, GLib2.Error** error);
25447 char* g_network_address_get_hostname(NetworkAddress* this_);
25448 ushort g_network_address_get_port(NetworkAddress* this_);
25449 char* g_network_address_get_scheme(NetworkAddress* this_);
25450 SocketConnectable* /*new*/ g_network_service_new(char* service, char* protocol, char* domain);
25451 char* g_network_service_get_domain(NetworkService* this_);
25452 char* g_network_service_get_protocol(NetworkService* this_);
25453 char* g_network_service_get_scheme(NetworkService* this_);
25454 char* g_network_service_get_service(NetworkService* this_);
25455 void g_network_service_set_scheme(NetworkService* this_, char* scheme);
25456 void g_output_stream_clear_pending(OutputStream* this_);
25457 int g_output_stream_close(OutputStream* this_, Cancellable* cancellable, GLib2.Error** error);
25458 void g_output_stream_close_async(OutputStream* this_, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25459 int g_output_stream_close_finish(OutputStream* this_, AsyncResult* result, GLib2.Error** error);
25460 int g_output_stream_flush(OutputStream* this_, Cancellable* cancellable, GLib2.Error** error);
25461 void g_output_stream_flush_async(OutputStream* this_, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25462 int g_output_stream_flush_finish(OutputStream* this_, AsyncResult* result, GLib2.Error** error);
25463 int g_output_stream_has_pending(OutputStream* this_);
25464 int g_output_stream_is_closed(OutputStream* this_);
25465 int g_output_stream_is_closing(OutputStream* this_);
25466 int g_output_stream_set_pending(OutputStream* this_, GLib2.Error** error);
25467 ssize_t g_output_stream_splice(OutputStream* this_, InputStream* source, OutputStreamSpliceFlags flags, Cancellable* cancellable, GLib2.Error** error);
25468 void g_output_stream_splice_async(OutputStream* this_, InputStream* source, OutputStreamSpliceFlags flags, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25469 ssize_t g_output_stream_splice_finish(OutputStream* this_, AsyncResult* result, GLib2.Error** error);
25470 ssize_t g_output_stream_write(OutputStream* this_, ubyte* buffer, size_t count, Cancellable* cancellable, GLib2.Error** error);
25471 int g_output_stream_write_all(OutputStream* this_, ubyte* buffer, size_t count, /*out*/ size_t* bytes_written, Cancellable* cancellable, GLib2.Error** error);
25472 void g_output_stream_write_async(OutputStream* this_, ubyte* buffer, size_t count, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25473 ssize_t g_output_stream_write_finish(OutputStream* this_, AsyncResult* result, GLib2.Error** error);
25474 int g_permission_acquire(Permission* this_, Cancellable* cancellable, GLib2.Error** error);
25475 void g_permission_acquire_async(Permission* this_, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25476 int g_permission_acquire_finish(Permission* this_, AsyncResult* result, GLib2.Error** error);
25477 int g_permission_get_allowed(Permission* this_);
25478 int g_permission_get_can_acquire(Permission* this_);
25479 int g_permission_get_can_release(Permission* this_);
25480 void g_permission_impl_update(Permission* this_, int allowed, int can_acquire, int can_release);
25481 int g_permission_release(Permission* this_, Cancellable* cancellable, GLib2.Error** error);
25482 void g_permission_release_async(Permission* this_, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25483 int g_permission_release_finish(Permission* this_, AsyncResult* result, GLib2.Error** error);
25484 int g_pollable_input_stream_can_poll(PollableInputStream* this_);
25485 GLib2.Source* /*new*/ g_pollable_input_stream_create_source(PollableInputStream* this_, Cancellable* cancellable=null);
25486 int g_pollable_input_stream_is_readable(PollableInputStream* this_);
25487 ssize_t g_pollable_input_stream_read_nonblocking(PollableInputStream* this_, void* buffer, size_t size, Cancellable* cancellable, GLib2.Error** error);
25488 int g_pollable_output_stream_can_poll(PollableOutputStream* this_);
25489 GLib2.Source* /*new*/ g_pollable_output_stream_create_source(PollableOutputStream* this_, Cancellable* cancellable=null);
25490 int g_pollable_output_stream_is_writable(PollableOutputStream* this_);
25491 ssize_t g_pollable_output_stream_write_nonblocking(PollableOutputStream* this_, ubyte* buffer, size_t size, Cancellable* cancellable, GLib2.Error** error);
25492 Proxy* /*new*/ g_proxy_get_default_for_protocol(char* protocol);
25493 IOStream* /*new*/ g_proxy_connect(Proxy* this_, IOStream* connection, ProxyAddress* proxy_address, Cancellable* cancellable, GLib2.Error** error);
25494 void g_proxy_connect_async(Proxy* this_, IOStream* connection, ProxyAddress* proxy_address, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25495 IOStream* /*new*/ g_proxy_connect_finish(Proxy* this_, AsyncResult* result, GLib2.Error** error);
25496 int g_proxy_supports_hostname(Proxy* this_);
25497 ProxyAddress* /*new*/ g_proxy_address_new(InetAddress* inetaddr, ushort port, char* protocol, char* dest_hostname, ushort dest_port, char* username=null, char* password=null);
25498 char* g_proxy_address_get_destination_hostname(ProxyAddress* this_);
25499 ushort g_proxy_address_get_destination_port(ProxyAddress* this_);
25500 char* g_proxy_address_get_password(ProxyAddress* this_);
25501 char* g_proxy_address_get_protocol(ProxyAddress* this_);
25502 char* g_proxy_address_get_username(ProxyAddress* this_);
25503 ProxyResolver* g_proxy_resolver_get_default();
25504 int g_proxy_resolver_is_supported(ProxyResolver* this_);
25505 char** /*new*/ g_proxy_resolver_lookup(ProxyResolver* this_, char* uri, Cancellable* cancellable, GLib2.Error** error);
25506 void g_proxy_resolver_lookup_async(ProxyResolver* this_, char* uri, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25507 char** /*new*/ g_proxy_resolver_lookup_finish(ProxyResolver* this_, AsyncResult* result, GLib2.Error** error);
25508 void g_resolver_free_addresses(GLib2.List* addresses);
25509 void g_resolver_free_targets(GLib2.List* targets);
25510 Resolver* /*new*/ g_resolver_get_default();
25511 char* /*new*/ g_resolver_lookup_by_address(Resolver* this_, InetAddress* address, Cancellable* cancellable, GLib2.Error** error);
25512 void g_resolver_lookup_by_address_async(Resolver* this_, InetAddress* address, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25513 char* /*new*/ g_resolver_lookup_by_address_finish(Resolver* this_, AsyncResult* result, GLib2.Error** error);
25514 GLib2.List* /*new*/ g_resolver_lookup_by_name(Resolver* this_, char* hostname, Cancellable* cancellable, GLib2.Error** error);
25515 void g_resolver_lookup_by_name_async(Resolver* this_, char* hostname, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25516 GLib2.List* /*new*/ g_resolver_lookup_by_name_finish(Resolver* this_, AsyncResult* result, GLib2.Error** error);
25517 GLib2.List* /*new*/ g_resolver_lookup_service(Resolver* this_, char* service, char* protocol, char* domain, Cancellable* cancellable, GLib2.Error** error);
25518 void g_resolver_lookup_service_async(Resolver* this_, char* service, char* protocol, char* domain, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25519 GLib2.List* /*new*/ g_resolver_lookup_service_finish(Resolver* this_, AsyncResult* result, GLib2.Error** error);
25520 void g_resolver_set_default(Resolver* this_);
25521 int g_seekable_can_seek(Seekable* this_);
25522 int g_seekable_can_truncate(Seekable* this_);
25523 int g_seekable_seek(Seekable* this_, long offset, GLib2.SeekType type, Cancellable* cancellable, GLib2.Error** error);
25524 long g_seekable_tell(Seekable* this_);
25525 int g_seekable_truncate(Seekable* this_, long offset, Cancellable* cancellable, GLib2.Error** error);
25526 Settings* /*new*/ g_settings_new(char* schema);
25527 Settings* /*new*/ g_settings_new_with_backend(char* schema, SettingsBackend* backend);
25528 Settings* /*new*/ g_settings_new_with_backend_and_path(char* schema, SettingsBackend* backend, char* path);
25529 Settings* /*new*/ g_settings_new_with_path(char* schema, char* path);
25530 char** g_settings_list_relocatable_schemas();
25531 char** g_settings_list_schemas();
25532 void g_settings_sync();
25533 void g_settings_unbind(void* object, char* property);
25534 void g_settings_apply(Settings* this_);
25535 void g_settings_bind(Settings* this_, char* key, GObject2.Object* object, char* property, SettingsBindFlags flags);
25536 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);
25537 void g_settings_bind_writable(Settings* this_, char* key, GObject2.Object* object, char* property, int inverted);
25538 void g_settings_delay(Settings* this_);
25539 void g_settings_get(Settings* this_, char* key, char* format, ...);
25540 int g_settings_get_boolean(Settings* this_, char* key);
25541 Settings* /*new*/ g_settings_get_child(Settings* this_, char* name);
25542 double g_settings_get_double(Settings* this_, char* key);
25543 int g_settings_get_enum(Settings* this_, char* key);
25544 uint g_settings_get_flags(Settings* this_, char* key);
25545 int g_settings_get_has_unapplied(Settings* this_);
25546 int g_settings_get_int(Settings* this_, char* key);
25547 void* /*new*/ g_settings_get_mapped(Settings* this_, char* key, SettingsGetMapping mapping, void* user_data);
25548 GLib2.Variant* /*new*/ g_settings_get_range(Settings* this_, char* key);
25549 char* /*new*/ g_settings_get_string(Settings* this_, char* key);
25550 char** /*new*/ g_settings_get_strv(Settings* this_, char* key);
25551 uint g_settings_get_uint(Settings* this_, char* key);
25552 GLib2.Variant* /*new*/ g_settings_get_value(Settings* this_, char* key);
25553 int g_settings_is_writable(Settings* this_, char* name);
25554 char** /*new*/ g_settings_list_children(Settings* this_);
25555 char** /*new*/ g_settings_list_keys(Settings* this_);
25556 int g_settings_range_check(Settings* this_, char* key, GLib2.Variant* value);
25557 void g_settings_reset(Settings* this_, char* key);
25558 void g_settings_revert(Settings* this_);
25559 int g_settings_set(Settings* this_, char* key, char* format, ...);
25560 int g_settings_set_boolean(Settings* this_, char* key, int value);
25561 int g_settings_set_double(Settings* this_, char* key, double value);
25562 int g_settings_set_enum(Settings* this_, char* key, int value);
25563 int g_settings_set_flags(Settings* this_, char* key, uint value);
25564 int g_settings_set_int(Settings* this_, char* key, int value);
25565 int g_settings_set_string(Settings* this_, char* key, char* value);
25566 int g_settings_set_strv(Settings* this_, char* key, char** value=null);
25567 int g_settings_set_uint(Settings* this_, char* key, uint value);
25568 int g_settings_set_value(Settings* this_, char* key, GLib2.Variant* value);
25569 SimpleAction* /*new*/ g_simple_action_new(char* name, GLib2.VariantType* parameter_type=null);
25570 SimpleAction* /*new*/ g_simple_action_new_stateful(char* name, GLib2.VariantType* parameter_type, GLib2.Variant* state);
25571 void g_simple_action_set_enabled(SimpleAction* this_, int enabled);
25572 void g_simple_action_set_state(SimpleAction* this_, GLib2.Variant* value);
25573 SimpleActionGroup* /*new*/ g_simple_action_group_new();
25574 void g_simple_action_group_add_entries(SimpleActionGroup* this_, ActionEntry* entries, int n_entries, void* user_data);
25575 void g_simple_action_group_insert(SimpleActionGroup* this_, Action* action);
25576 Action* g_simple_action_group_lookup(SimpleActionGroup* this_, char* action_name);
25577 void g_simple_action_group_remove(SimpleActionGroup* this_, char* action_name);
25578 SimpleAsyncResult* /*new*/ g_simple_async_result_new(GObject2.Object* source_object, AsyncReadyCallback callback, void* user_data, void* source_tag);
25579 SimpleAsyncResult* /*new*/ g_simple_async_result_new_error(GObject2.Object* source_object, AsyncReadyCallback callback, void* user_data, GLib2.Quark domain, int code, char* format, ...);
25580 SimpleAsyncResult* /*new*/ g_simple_async_result_new_from_error(GObject2.Object* source_object, AsyncReadyCallback callback, void* user_data, GLib2.Error* error);
25581 SimpleAsyncResult* /*new*/ g_simple_async_result_new_take_error(GObject2.Object* source_object, AsyncReadyCallback callback, void* user_data, GLib2.Error* error);
25582 int g_simple_async_result_is_valid(AsyncResult* result, GObject2.Object* source, void* source_tag);
25583 void g_simple_async_result_complete(SimpleAsyncResult* this_);
25584 void g_simple_async_result_complete_in_idle(SimpleAsyncResult* this_);
25585 int g_simple_async_result_get_op_res_gboolean(SimpleAsyncResult* this_);
25586 void* g_simple_async_result_get_op_res_gpointer(SimpleAsyncResult* this_);
25587 ssize_t g_simple_async_result_get_op_res_gssize(SimpleAsyncResult* this_);
25588 void* g_simple_async_result_get_source_tag(SimpleAsyncResult* this_);
25589 int g_simple_async_result_propagate_error(SimpleAsyncResult* this_, GLib2.Error** error);
25590 void g_simple_async_result_run_in_thread(SimpleAsyncResult* this_, SimpleAsyncThreadFunc func, int io_priority, Cancellable* cancellable=null);
25591 void g_simple_async_result_set_error(SimpleAsyncResult* this_, GLib2.Quark domain, int code, char* format, ...);
25592 void g_simple_async_result_set_error_va(SimpleAsyncResult* this_, GLib2.Quark domain, int code, char* format, va_list args);
25593 void g_simple_async_result_set_from_error(SimpleAsyncResult* this_, GLib2.Error* error);
25594 void g_simple_async_result_set_handle_cancellation(SimpleAsyncResult* this_, int handle_cancellation);
25595 void g_simple_async_result_set_op_res_gboolean(SimpleAsyncResult* this_, int op_res);
25596 void g_simple_async_result_set_op_res_gpointer(SimpleAsyncResult* this_, void* op_res, GLib2.DestroyNotify destroy_op_res);
25597 void g_simple_async_result_set_op_res_gssize(SimpleAsyncResult* this_, ssize_t op_res);
25598 void g_simple_async_result_take_error(SimpleAsyncResult* this_, GLib2.Error* error);
25599 SimplePermission* /*new*/ g_simple_permission_new(int allowed);
25600 Socket* /*new*/ g_socket_new(SocketFamily family, SocketType type, SocketProtocol protocol, GLib2.Error** error);
25601 Socket* /*new*/ g_socket_new_from_fd(int fd, GLib2.Error** error);
25602 Socket* /*new*/ g_socket_accept(Socket* this_, Cancellable* cancellable, GLib2.Error** error);
25603 int g_socket_bind(Socket* this_, SocketAddress* address, int allow_reuse, GLib2.Error** error);
25604 int g_socket_check_connect_result(Socket* this_, GLib2.Error** error);
25605 int g_socket_close(Socket* this_, GLib2.Error** error);
25606 GLib2.IOCondition g_socket_condition_check(Socket* this_, GLib2.IOCondition condition);
25607 int g_socket_condition_wait(Socket* this_, GLib2.IOCondition condition, Cancellable* cancellable, GLib2.Error** error);
25608 int g_socket_connect(Socket* this_, SocketAddress* address, Cancellable* cancellable, GLib2.Error** error);
25609 SocketConnection* /*new*/ g_socket_connection_factory_create_connection(Socket* this_);
25610 GLib2.Source* /*new*/ g_socket_create_source(Socket* this_, GLib2.IOCondition condition, Cancellable* cancellable=null);
25611 int g_socket_get_blocking(Socket* this_);
25612 Credentials* /*new*/ g_socket_get_credentials(Socket* this_, GLib2.Error** error);
25613 SocketFamily g_socket_get_family(Socket* this_);
25614 int g_socket_get_fd(Socket* this_);
25615 int g_socket_get_keepalive(Socket* this_);
25616 int g_socket_get_listen_backlog(Socket* this_);
25617 SocketAddress* /*new*/ g_socket_get_local_address(Socket* this_, GLib2.Error** error);
25618 SocketProtocol g_socket_get_protocol(Socket* this_);
25619 SocketAddress* /*new*/ g_socket_get_remote_address(Socket* this_, GLib2.Error** error);
25620 SocketType g_socket_get_socket_type(Socket* this_);
25621 uint g_socket_get_timeout(Socket* this_);
25622 int g_socket_is_closed(Socket* this_);
25623 int g_socket_is_connected(Socket* this_);
25624 int g_socket_listen(Socket* this_, GLib2.Error** error);
25625 ssize_t g_socket_receive(Socket* this_, char* buffer, size_t size, Cancellable* cancellable, GLib2.Error** error);
25626 ssize_t g_socket_receive_from(Socket* this_, SocketAddress** address, char* buffer, size_t size, Cancellable* cancellable, GLib2.Error** error);
25627 ssize_t g_socket_receive_message(Socket* this_, SocketAddress** address, InputVector* vectors, int num_vectors, SocketControlMessage*** messages, int* num_messages, int* flags, Cancellable* cancellable, GLib2.Error** error);
25628 ssize_t g_socket_receive_with_blocking(Socket* this_, char* buffer, size_t size, int blocking, Cancellable* cancellable, GLib2.Error** error);
25629 ssize_t g_socket_send(Socket* this_, char* buffer, size_t size, Cancellable* cancellable, GLib2.Error** error);
25630 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);
25631 ssize_t g_socket_send_to(Socket* this_, SocketAddress* address, char* buffer, size_t size, Cancellable* cancellable, GLib2.Error** error);
25632 ssize_t g_socket_send_with_blocking(Socket* this_, char* buffer, size_t size, int blocking, Cancellable* cancellable, GLib2.Error** error);
25633 void g_socket_set_blocking(Socket* this_, int blocking);
25634 void g_socket_set_keepalive(Socket* this_, int keepalive);
25635 void g_socket_set_listen_backlog(Socket* this_, int backlog);
25636 void g_socket_set_timeout(Socket* this_, uint timeout);
25637 int g_socket_shutdown(Socket* this_, int shutdown_read, int shutdown_write, GLib2.Error** error);
25638 int g_socket_speaks_ipv4(Socket* this_);
25639 SocketAddress* /*new*/ g_socket_address_new_from_native(void* native, size_t len);
25640 SocketFamily g_socket_address_get_family(SocketAddress* this_);
25641 ssize_t g_socket_address_get_native_size(SocketAddress* this_);
25642 int g_socket_address_to_native(SocketAddress* this_, void* dest, size_t destlen, GLib2.Error** error);
25643 SocketAddress* /*new*/ g_socket_address_enumerator_next(SocketAddressEnumerator* this_, Cancellable* cancellable, GLib2.Error** error);
25644 void g_socket_address_enumerator_next_async(SocketAddressEnumerator* this_, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25645 SocketAddress* /*new*/ g_socket_address_enumerator_next_finish(SocketAddressEnumerator* this_, AsyncResult* result, GLib2.Error** error);
25646 SocketClient* /*new*/ g_socket_client_new();
25647 void g_socket_client_add_application_proxy(SocketClient* this_, char* protocol);
25648 SocketConnection* /*new*/ g_socket_client_connect(SocketClient* this_, SocketConnectable* connectable, Cancellable* cancellable, GLib2.Error** error);
25649 void g_socket_client_connect_async(SocketClient* this_, SocketConnectable* connectable, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25650 SocketConnection* /*new*/ g_socket_client_connect_finish(SocketClient* this_, AsyncResult* result, GLib2.Error** error);
25651 SocketConnection* /*new*/ g_socket_client_connect_to_host(SocketClient* this_, char* host_and_port, ushort default_port, Cancellable* cancellable, GLib2.Error** error);
25652 void g_socket_client_connect_to_host_async(SocketClient* this_, char* host_and_port, ushort default_port, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25653 SocketConnection* /*new*/ g_socket_client_connect_to_host_finish(SocketClient* this_, AsyncResult* result, GLib2.Error** error);
25654 SocketConnection* /*new*/ g_socket_client_connect_to_service(SocketClient* this_, char* domain, char* service, Cancellable* cancellable, GLib2.Error** error);
25655 void g_socket_client_connect_to_service_async(SocketClient* this_, char* domain, char* service, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25656 SocketConnection* /*new*/ g_socket_client_connect_to_service_finish(SocketClient* this_, AsyncResult* result, GLib2.Error** error);
25657 SocketConnection* /*new*/ g_socket_client_connect_to_uri(SocketClient* this_, char* uri, ushort default_port, Cancellable* cancellable, GLib2.Error** error);
25658 void g_socket_client_connect_to_uri_async(SocketClient* this_, char* uri, ushort default_port, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25659 SocketConnection* /*new*/ g_socket_client_connect_to_uri_finish(SocketClient* this_, AsyncResult* result, GLib2.Error** error);
25660 int g_socket_client_get_enable_proxy(SocketClient* this_);
25661 SocketFamily g_socket_client_get_family(SocketClient* this_);
25662 SocketAddress* g_socket_client_get_local_address(SocketClient* this_);
25663 SocketProtocol g_socket_client_get_protocol(SocketClient* this_);
25664 SocketType g_socket_client_get_socket_type(SocketClient* this_);
25665 uint g_socket_client_get_timeout(SocketClient* this_);
25666 int g_socket_client_get_tls(SocketClient* this_);
25667 TlsCertificateFlags g_socket_client_get_tls_validation_flags(SocketClient* this_);
25668 void g_socket_client_set_enable_proxy(SocketClient* this_, int enable);
25669 void g_socket_client_set_family(SocketClient* this_, SocketFamily family);
25670 void g_socket_client_set_local_address(SocketClient* this_, SocketAddress* address);
25671 void g_socket_client_set_protocol(SocketClient* this_, SocketProtocol protocol);
25672 void g_socket_client_set_socket_type(SocketClient* this_, SocketType type);
25673 void g_socket_client_set_timeout(SocketClient* this_, uint timeout);
25674 void g_socket_client_set_tls(SocketClient* this_, int tls);
25675 void g_socket_client_set_tls_validation_flags(SocketClient* this_, TlsCertificateFlags flags);
25676 SocketAddressEnumerator* /*new*/ g_socket_connectable_enumerate(SocketConnectable* this_);
25677 SocketAddressEnumerator* /*new*/ g_socket_connectable_proxy_enumerate(SocketConnectable* this_);
25678 Type g_socket_connection_factory_lookup_type(SocketFamily family, SocketType type, int protocol_id);
25679 void g_socket_connection_factory_register_type(Type g_type, SocketFamily family, SocketType type, int protocol);
25680 SocketAddress* /*new*/ g_socket_connection_get_local_address(SocketConnection* this_, GLib2.Error** error);
25681 SocketAddress* /*new*/ g_socket_connection_get_remote_address(SocketConnection* this_, GLib2.Error** error);
25682 Socket* g_socket_connection_get_socket(SocketConnection* this_);
25683 SocketControlMessage* /*new*/ g_socket_control_message_deserialize(int level, int type, size_t size, void* data);
25684 int g_socket_control_message_get_level(SocketControlMessage* this_);
25685 int g_socket_control_message_get_msg_type(SocketControlMessage* this_);
25686 size_t g_socket_control_message_get_size(SocketControlMessage* this_);
25687 void g_socket_control_message_serialize(SocketControlMessage* this_, void* data);
25688 SocketListener* /*new*/ g_socket_listener_new();
25689 SocketConnection* /*new*/ g_socket_listener_accept(SocketListener* this_, /*out*/ GObject2.Object** source_object, Cancellable* cancellable, GLib2.Error** error);
25690 void g_socket_listener_accept_async(SocketListener* this_, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25691 SocketConnection* /*new*/ g_socket_listener_accept_finish(SocketListener* this_, AsyncResult* result, /*out*/ GObject2.Object** source_object, GLib2.Error** error);
25692 Socket* /*new*/ g_socket_listener_accept_socket(SocketListener* this_, /*out*/ GObject2.Object** source_object, Cancellable* cancellable, GLib2.Error** error);
25693 void g_socket_listener_accept_socket_async(SocketListener* this_, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25694 Socket* /*new*/ g_socket_listener_accept_socket_finish(SocketListener* this_, AsyncResult* result, /*out*/ GObject2.Object** source_object, GLib2.Error** error);
25695 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);
25696 ushort g_socket_listener_add_any_inet_port(SocketListener* this_, GObject2.Object* source_object, GLib2.Error** error);
25697 int g_socket_listener_add_inet_port(SocketListener* this_, ushort port, GObject2.Object* source_object, GLib2.Error** error);
25698 int g_socket_listener_add_socket(SocketListener* this_, Socket* socket, GObject2.Object* source_object, GLib2.Error** error);
25699 void g_socket_listener_close(SocketListener* this_);
25700 void g_socket_listener_set_backlog(SocketListener* this_, int listen_backlog);
25701 SocketService* /*new*/ g_socket_service_new();
25702 int g_socket_service_is_active(SocketService* this_);
25703 void g_socket_service_start(SocketService* this_);
25704 void g_socket_service_stop(SocketService* this_);
25705 SrvTarget* /*new*/ g_srv_target_new(char* hostname, ushort port, ushort priority, ushort weight);
25706 SrvTarget* /*new*/ g_srv_target_copy(SrvTarget* this_);
25707 void g_srv_target_free(SrvTarget* this_);
25708 char* g_srv_target_get_hostname(SrvTarget* this_);
25709 ushort g_srv_target_get_port(SrvTarget* this_);
25710 ushort g_srv_target_get_priority(SrvTarget* this_);
25711 ushort g_srv_target_get_weight(SrvTarget* this_);
25712 GLib2.List* /*new*/ g_srv_target_list_sort(GLib2.List* targets);
25713 int g_tcp_connection_get_graceful_disconnect(TcpConnection* this_);
25714 void g_tcp_connection_set_graceful_disconnect(TcpConnection* this_, int graceful_disconnect);
25715 TcpWrapperConnection* /*new*/ g_tcp_wrapper_connection_new(IOStream* base_io_stream, Socket* socket);
25716 IOStream* g_tcp_wrapper_connection_get_base_io_stream(TcpWrapperConnection* this_);
25717 Icon* /*new*/ g_themed_icon_new(char* iconname);
25718 Icon* /*new*/ g_themed_icon_new_from_names(char** iconnames, int len);
25719 Icon* /*new*/ g_themed_icon_new_with_default_fallbacks(char* iconname);
25720 void g_themed_icon_append_name(ThemedIcon* this_, char* iconname);
25721 char** g_themed_icon_get_names(ThemedIcon* this_);
25722 void g_themed_icon_prepend_name(ThemedIcon* this_, char* iconname);
25723 ThreadedSocketService* /*new*/ g_threaded_socket_service_new(int max_threads);
25724 TlsBackend* g_tls_backend_get_default();
25725 Type g_tls_backend_get_certificate_type(TlsBackend* this_);
25726 Type g_tls_backend_get_client_connection_type(TlsBackend* this_);
25727 TlsDatabase* /*new*/ g_tls_backend_get_default_database(TlsBackend* this_);
25728 Type g_tls_backend_get_file_database_type(TlsBackend* this_);
25729 Type g_tls_backend_get_server_connection_type(TlsBackend* this_);
25730 int g_tls_backend_supports_tls(TlsBackend* this_);
25731 TlsCertificate* /*new*/ g_tls_certificate_new_from_file(char* file, GLib2.Error** error);
25732 TlsCertificate* /*new*/ g_tls_certificate_new_from_files(char* cert_file, char* key_file, GLib2.Error** error);
25733 TlsCertificate* /*new*/ g_tls_certificate_new_from_pem(char* data, ssize_t length, GLib2.Error** error);
25734 GLib2.List* /*new*/ g_tls_certificate_list_new_from_file(char* file, GLib2.Error** error);
25735 TlsCertificate* g_tls_certificate_get_issuer(TlsCertificate* this_);
25736 TlsCertificateFlags g_tls_certificate_verify(TlsCertificate* this_, SocketConnectable* identity=null, TlsCertificate* trusted_ca=null);
25737 IOStream* /*new*/ g_tls_client_connection_new(IOStream* base_io_stream, SocketConnectable* server_identity, GLib2.Error** error);
25738 GLib2.List* /*new*/ g_tls_client_connection_get_accepted_cas(TlsClientConnection* this_);
25739 SocketConnectable* g_tls_client_connection_get_server_identity(TlsClientConnection* this_);
25740 int g_tls_client_connection_get_use_ssl3(TlsClientConnection* this_);
25741 TlsCertificateFlags g_tls_client_connection_get_validation_flags(TlsClientConnection* this_);
25742 void g_tls_client_connection_set_server_identity(TlsClientConnection* this_, SocketConnectable* identity);
25743 void g_tls_client_connection_set_use_ssl3(TlsClientConnection* this_, int use_ssl3);
25744 void g_tls_client_connection_set_validation_flags(TlsClientConnection* this_, TlsCertificateFlags flags);
25745 int g_tls_connection_emit_accept_certificate(TlsConnection* this_, TlsCertificate* peer_cert, TlsCertificateFlags errors);
25746 TlsCertificate* g_tls_connection_get_certificate(TlsConnection* this_);
25747 TlsDatabase* g_tls_connection_get_database(TlsConnection* this_);
25748 TlsInteraction* g_tls_connection_get_interaction(TlsConnection* this_);
25749 TlsCertificate* g_tls_connection_get_peer_certificate(TlsConnection* this_);
25750 TlsCertificateFlags g_tls_connection_get_peer_certificate_errors(TlsConnection* this_);
25751 TlsRehandshakeMode g_tls_connection_get_rehandshake_mode(TlsConnection* this_);
25752 int g_tls_connection_get_require_close_notify(TlsConnection* this_);
25753 int g_tls_connection_get_use_system_certdb(TlsConnection* this_);
25754 int g_tls_connection_handshake(TlsConnection* this_, Cancellable* cancellable, GLib2.Error** error);
25755 void g_tls_connection_handshake_async(TlsConnection* this_, int io_priority, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25756 int g_tls_connection_handshake_finish(TlsConnection* this_, AsyncResult* result, GLib2.Error** error);
25757 void g_tls_connection_set_certificate(TlsConnection* this_, TlsCertificate* certificate);
25758 void g_tls_connection_set_database(TlsConnection* this_, TlsDatabase* database);
25759 void g_tls_connection_set_interaction(TlsConnection* this_, TlsInteraction* interaction=null);
25760 void g_tls_connection_set_rehandshake_mode(TlsConnection* this_, TlsRehandshakeMode mode);
25761 void g_tls_connection_set_require_close_notify(TlsConnection* this_, int require_close_notify);
25762 void g_tls_connection_set_use_system_certdb(TlsConnection* this_, int use_system_certdb);
25763 char* /*new*/ g_tls_database_create_certificate_handle(TlsDatabase* this_, TlsCertificate* certificate);
25764 TlsCertificate* /*new*/ g_tls_database_lookup_certificate_for_handle(TlsDatabase* this_, char* handle, TlsInteraction* interaction, TlsDatabaseLookupFlags flags, Cancellable* cancellable, GLib2.Error** error);
25765 void g_tls_database_lookup_certificate_for_handle_async(TlsDatabase* this_, char* handle, TlsInteraction* interaction, TlsDatabaseLookupFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25766 TlsCertificate* /*new*/ g_tls_database_lookup_certificate_for_handle_finish(TlsDatabase* this_, AsyncResult* result, GLib2.Error** error);
25767 TlsCertificate* /*new*/ g_tls_database_lookup_certificate_issuer(TlsDatabase* this_, TlsCertificate* certificate, TlsInteraction* interaction, TlsDatabaseLookupFlags flags, Cancellable* cancellable, GLib2.Error** error);
25768 void g_tls_database_lookup_certificate_issuer_async(TlsDatabase* this_, TlsCertificate* certificate, TlsInteraction* interaction, TlsDatabaseLookupFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25769 TlsCertificate* /*new*/ g_tls_database_lookup_certificate_issuer_finish(TlsDatabase* this_, AsyncResult* result, GLib2.Error** error);
25770 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);
25771 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);
25772 GLib2.List* /*new*/ g_tls_database_lookup_certificates_issued_by_finish(TlsDatabase* this_, AsyncResult* result, GLib2.Error** error);
25773 TlsCertificateFlags g_tls_database_verify_chain(TlsDatabase* this_, TlsCertificate* chain, char* purpose, SocketConnectable* identity, TlsInteraction* interaction, TlsDatabaseVerifyFlags flags, Cancellable* cancellable, GLib2.Error** error);
25774 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);
25775 TlsCertificateFlags g_tls_database_verify_chain_finish(TlsDatabase* this_, AsyncResult* result, GLib2.Error** error);
25776 TlsDatabase* /*new*/ g_tls_file_database_new(char* anchors, GLib2.Error** error);
25777 TlsInteractionResult g_tls_interaction_ask_password(TlsInteraction* this_, TlsPassword* password, Cancellable* cancellable, GLib2.Error** error);
25778 void g_tls_interaction_ask_password_async(TlsInteraction* this_, TlsPassword* password, Cancellable* cancellable=null, AsyncReadyCallback callback=null, void* user_data=null);
25779 TlsInteractionResult g_tls_interaction_ask_password_finish(TlsInteraction* this_, AsyncResult* result, GLib2.Error** error);
25780 TlsInteractionResult g_tls_interaction_invoke_ask_password(TlsInteraction* this_, TlsPassword* password, Cancellable* cancellable, GLib2.Error** error);
25781 TlsPassword* /*new*/ g_tls_password_new(TlsPasswordFlags flags, char* description);
25782 char* g_tls_password_get_description(TlsPassword* this_);
25783 TlsPasswordFlags g_tls_password_get_flags(TlsPassword* this_);
25784 ubyte* g_tls_password_get_value(TlsPassword* this_, size_t* length=null);
25785 char* g_tls_password_get_warning(TlsPassword* this_);
25786 void g_tls_password_set_description(TlsPassword* this_, char* description);
25787 void g_tls_password_set_flags(TlsPassword* this_, TlsPasswordFlags flags);
25788 void g_tls_password_set_value(TlsPassword* this_, ubyte* value, ssize_t length);
25789 void g_tls_password_set_value_full(TlsPassword* this_, ubyte* value, ssize_t length, GLib2.DestroyNotify destroy=null);
25790 void g_tls_password_set_warning(TlsPassword* this_, char* warning);
25791 IOStream* /*new*/ g_tls_server_connection_new(IOStream* base_io_stream, TlsCertificate* certificate, GLib2.Error** error);
25792 Credentials* /*new*/ g_unix_connection_receive_credentials(UnixConnection* this_, Cancellable* cancellable, GLib2.Error** error);
25793 int g_unix_connection_receive_fd(UnixConnection* this_, Cancellable* cancellable, GLib2.Error** error);
25794 int g_unix_connection_send_credentials(UnixConnection* this_, Cancellable* cancellable, GLib2.Error** error);
25795 int g_unix_connection_send_fd(UnixConnection* this_, int fd, Cancellable* cancellable, GLib2.Error** error);
25796 UnixCredentialsMessage* /*new*/ g_unix_credentials_message_new();
25797 UnixCredentialsMessage* /*new*/ g_unix_credentials_message_new_with_credentials(Credentials* credentials);
25798 int g_unix_credentials_message_is_supported();
25799 Credentials* g_unix_credentials_message_get_credentials(UnixCredentialsMessage* this_);
25800 UnixFDList* /*new*/ g_unix_fd_list_new();
25801 UnixFDList* /*new*/ g_unix_fd_list_new_from_array(int* fds, int n_fds);
25802 int g_unix_fd_list_append(UnixFDList* this_, int fd, GLib2.Error** error);
25803 int g_unix_fd_list_get(UnixFDList* this_, int index_, GLib2.Error** error);
25804 int g_unix_fd_list_get_length(UnixFDList* this_);
25805 int* g_unix_fd_list_peek_fds(UnixFDList* this_, /*out*/ int* length=null);
25806 int* /*new*/ g_unix_fd_list_steal_fds(UnixFDList* this_, /*out*/ int* length=null);
25807 UnixFDMessage* /*new*/ g_unix_fd_message_new();
25808 UnixFDMessage* /*new*/ g_unix_fd_message_new_with_fd_list(UnixFDList* fd_list);
25809 int g_unix_fd_message_append_fd(UnixFDMessage* this_, int fd, GLib2.Error** error);
25810 UnixFDList* g_unix_fd_message_get_fd_list(UnixFDMessage* this_);
25811 int* /*new*/ g_unix_fd_message_steal_fds(UnixFDMessage* this_, /*out*/ int* length=null);
25812 UnixInputStream* /*new*/ g_unix_input_stream_new(int fd, int close_fd);
25813 int g_unix_input_stream_get_close_fd(UnixInputStream* this_);
25814 int g_unix_input_stream_get_fd(UnixInputStream* this_);
25815 void g_unix_input_stream_set_close_fd(UnixInputStream* this_, int close_fd);
25816 UnixMountMonitor* /*new*/ g_unix_mount_monitor_new();
25817 void g_unix_mount_monitor_set_rate_limit(UnixMountMonitor* this_, int limit_msec);
25818 int g_unix_mount_point_compare(UnixMountPoint* this_, UnixMountPoint* mount2);
25819 void g_unix_mount_point_free(UnixMountPoint* this_);
25820 char* g_unix_mount_point_get_device_path(UnixMountPoint* this_);
25821 char* g_unix_mount_point_get_fs_type(UnixMountPoint* this_);
25822 char* g_unix_mount_point_get_mount_path(UnixMountPoint* this_);
25823 int g_unix_mount_point_guess_can_eject(UnixMountPoint* this_);
25824 Icon* /*new*/ g_unix_mount_point_guess_icon(UnixMountPoint* this_);
25825 char* /*new*/ g_unix_mount_point_guess_name(UnixMountPoint* this_);
25826 int g_unix_mount_point_is_loopback(UnixMountPoint* this_);
25827 int g_unix_mount_point_is_readonly(UnixMountPoint* this_);
25828 int g_unix_mount_point_is_user_mountable(UnixMountPoint* this_);
25829 UnixOutputStream* /*new*/ g_unix_output_stream_new(int fd, int close_fd);
25830 int g_unix_output_stream_get_close_fd(UnixOutputStream* this_);
25831 int g_unix_output_stream_get_fd(UnixOutputStream* this_);
25832 void g_unix_output_stream_set_close_fd(UnixOutputStream* this_, int close_fd);
25833 UnixSocketAddress* /*new*/ g_unix_socket_address_new(char* path);
25834 UnixSocketAddress* /*new*/ g_unix_socket_address_new_abstract(char* path, int path_len);
25835 UnixSocketAddress* /*new*/ g_unix_socket_address_new_with_type(char* path, int path_len, UnixSocketAddressType type);
25836 int g_unix_socket_address_abstract_names_supported();
25837 UnixSocketAddressType g_unix_socket_address_get_address_type(UnixSocketAddress* this_);
25838 int g_unix_socket_address_get_is_abstract(UnixSocketAddress* this_);
25839 char* g_unix_socket_address_get_path(UnixSocketAddress* this_);
25840 size_t g_unix_socket_address_get_path_len(UnixSocketAddress* this_);
25841 Vfs* g_vfs_get_default();
25842 Vfs* g_vfs_get_local();
25843 File* /*new*/ g_vfs_get_file_for_path(Vfs* this_, char* path);
25844 File* /*new*/ g_vfs_get_file_for_uri(Vfs* this_, char* uri);
25845 char** g_vfs_get_supported_uri_schemes(Vfs* this_);
25846 int g_vfs_is_active(Vfs* this_);
25847 File* /*new*/ g_vfs_parse_name(Vfs* this_, char* parse_name);
25848 int g_volume_can_eject(Volume* this_);
25849 int g_volume_can_mount(Volume* this_);
25850 void g_volume_eject(Volume* this_, MountUnmountFlags flags, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25851 int g_volume_eject_finish(Volume* this_, AsyncResult* result, GLib2.Error** error);
25852 void g_volume_eject_with_operation(Volume* this_, MountUnmountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25853 int g_volume_eject_with_operation_finish(Volume* this_, AsyncResult* result, GLib2.Error** error);
25854 char** /*new*/ g_volume_enumerate_identifiers(Volume* this_);
25855 File* /*new*/ g_volume_get_activation_root(Volume* this_);
25856 Drive* /*new*/ g_volume_get_drive(Volume* this_);
25857 Icon* /*new*/ g_volume_get_icon(Volume* this_);
25858 char* /*new*/ g_volume_get_identifier(Volume* this_, char* kind);
25859 Mount* /*new*/ g_volume_get_mount(Volume* this_);
25860 char* /*new*/ g_volume_get_name(Volume* this_);
25861 char* /*new*/ g_volume_get_uuid(Volume* this_);
25862 void g_volume_mount(Volume* this_, MountMountFlags flags, MountOperation* mount_operation, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25863 int g_volume_mount_finish(Volume* this_, AsyncResult* result, GLib2.Error** error);
25864 int g_volume_should_automount(Volume* this_);
25865 Volume* /*new*/ g_volume_monitor_adopt_orphan_mount(Mount* mount);
25866 VolumeMonitor* /*new*/ g_volume_monitor_get();
25867 GLib2.List* /*new*/ g_volume_monitor_get_connected_drives(VolumeMonitor* this_);
25868 Mount* /*new*/ g_volume_monitor_get_mount_for_uuid(VolumeMonitor* this_, char* uuid);
25869 GLib2.List* /*new*/ g_volume_monitor_get_mounts(VolumeMonitor* this_);
25870 Volume* /*new*/ g_volume_monitor_get_volume_for_uuid(VolumeMonitor* this_, char* uuid);
25871 GLib2.List* /*new*/ g_volume_monitor_get_volumes(VolumeMonitor* this_);
25872 ZlibCompressor* /*new*/ g_zlib_compressor_new(ZlibCompressorFormat format, int level);
25873 FileInfo* g_zlib_compressor_get_file_info(ZlibCompressor* this_);
25874 void g_zlib_compressor_set_file_info(ZlibCompressor* this_, FileInfo* file_info=null);
25875 ZlibDecompressor* /*new*/ g_zlib_decompressor_new(ZlibCompressorFormat format);
25876 FileInfo* g_zlib_decompressor_get_file_info(ZlibDecompressor* this_);
25877 void g_bus_get(BusType bus_type, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25878 DBusConnection* /*new*/ g_bus_get_finish(AsyncResult* res, GLib2.Error** error);
25879 DBusConnection* /*new*/ g_bus_get_sync(BusType bus_type, Cancellable* cancellable, GLib2.Error** error);
25880 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);
25881 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);
25882 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);
25883 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);
25884 void g_bus_unown_name(uint owner_id);
25885 void g_bus_unwatch_name(uint watcher_id);
25886 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);
25887 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);
25888 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);
25889 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);
25890 int g_content_type_can_be_executable(char* type);
25891 int g_content_type_equals(char* type1, char* type2);
25892 char* /*new*/ g_content_type_from_mime_type(char* mime_type);
25893 char* /*new*/ g_content_type_get_description(char* type);
25894 Icon* /*new*/ g_content_type_get_icon(char* type);
25895 char* /*new*/ g_content_type_get_mime_type(char* type);
25896 char* /*new*/ g_content_type_guess(char* filename, ubyte* data, size_t data_size, /*out*/ int* result_uncertain=null);
25897 char** /*new*/ g_content_type_guess_for_tree(File* root);
25898 int g_content_type_is_a(char* type, char* supertype);
25899 int g_content_type_is_unknown(char* type);
25900 GLib2.List* /*new*/ g_content_types_get_registered();
25901 char* /*new*/ g_dbus_address_get_for_bus_sync(BusType bus_type, Cancellable* cancellable, GLib2.Error** error);
25902 void g_dbus_address_get_stream(char* address, Cancellable* cancellable, AsyncReadyCallback callback, void* user_data);
25903 IOStream* /*new*/ g_dbus_address_get_stream_finish(AsyncResult* res, char** out_guid, GLib2.Error** error);
25904 IOStream* /*new*/ g_dbus_address_get_stream_sync(char* address, char** out_guid, Cancellable* cancellable, GLib2.Error** error);
25905 char* /*new*/ g_dbus_error_encode_gerror(GLib2.Error* error);
25906 char* /*new*/ g_dbus_error_get_remote_error(GLib2.Error* error);
25907 int g_dbus_error_is_remote_error(GLib2.Error* error);
25908 GLib2.Error* /*new*/ g_dbus_error_new_for_dbus_error(char* dbus_error_name, char* dbus_error_message);
25909 GLib2.Quark g_dbus_error_quark();
25910 int g_dbus_error_register_error(GLib2.Quark error_domain, int error_code, char* dbus_error_name);
25911 void g_dbus_error_register_error_domain(char* error_domain_quark_name, size_t* quark_volatile, DBusErrorEntry* entries, uint num_entries);
25912 int g_dbus_error_strip_remote_error(GLib2.Error* error);
25913 int g_dbus_error_unregister_error(GLib2.Quark error_domain, int error_code, char* dbus_error_name);
25914 char* /*new*/ g_dbus_generate_guid();
25915 GLib2.Variant* /*new*/ g_dbus_gvalue_to_gvariant(GObject2.Value* gvalue, GLib2.VariantType* type);
25916 void g_dbus_gvariant_to_gvalue(GLib2.Variant* value, GObject2.Value* out_gvalue);
25917 int g_dbus_is_address(char* string_);
25918 int g_dbus_is_guid(char* string_);
25919 int g_dbus_is_interface_name(char* string_);
25920 int g_dbus_is_member_name(char* string_);
25921 int g_dbus_is_name(char* string_);
25922 int g_dbus_is_supported_address(char* string_, GLib2.Error** error);
25923 int g_dbus_is_unique_name(char* string_);
25924 IOErrorEnum g_io_error_from_errno(int err_no);
25925 GLib2.Quark g_io_error_quark();
25926 Type g_io_extension_get_type(IOExtension* extension);
25927 GLib2.List* /*new*/ g_io_modules_load_all_in_directory(char* dirname);
25928 GLib2.List* /*new*/ g_io_modules_load_all_in_directory_with_scope(char* dirname, IOModuleScope* scope_);
25929 void g_io_modules_scan_all_in_directory(char* dirname);
25930 void g_io_modules_scan_all_in_directory_with_scope(char* dirname, IOModuleScope* scope_);
25931 void g_io_scheduler_cancel_all_jobs();
25932 void g_io_scheduler_push_job(IOSchedulerJobFunc job_func, void* user_data, GLib2.DestroyNotify notify, int io_priority, Cancellable* cancellable=null);
25933 GLib2.Source* /*new*/ g_pollable_source_new(GObject2.Object* pollable_stream);
25934 GLib2.Quark g_resolver_error_quark();
25935 void g_simple_async_report_error_in_idle(GObject2.Object* object, AsyncReadyCallback callback, void* user_data, GLib2.Quark domain, int code, char* format, ...);
25936 void g_simple_async_report_gerror_in_idle(GObject2.Object* object, AsyncReadyCallback callback, void* user_data, GLib2.Error* error);
25937 void g_simple_async_report_take_gerror_in_idle(GObject2.Object* object, AsyncReadyCallback callback, void* user_data, GLib2.Error* error);
25938 GLib2.Quark g_tls_error_quark();
25939 int g_unix_is_mount_path_system_internal(char* mount_path);
25940 UnixMountEntry* /*new*/ g_unix_mount_at(char* mount_path, /*out*/ ulong* time_read=null);
25941 int g_unix_mount_compare(UnixMountEntry* mount1, UnixMountEntry* mount2);
25942 void g_unix_mount_free(UnixMountEntry* mount_entry);
25943 char* g_unix_mount_get_device_path(UnixMountEntry* mount_entry);
25944 char* g_unix_mount_get_fs_type(UnixMountEntry* mount_entry);
25945 char* g_unix_mount_get_mount_path(UnixMountEntry* mount_entry);
25946 int g_unix_mount_guess_can_eject(UnixMountEntry* mount_entry);
25947 Icon* /*new*/ g_unix_mount_guess_icon(UnixMountEntry* mount_entry);
25948 char* /*new*/ g_unix_mount_guess_name(UnixMountEntry* mount_entry);
25949 int g_unix_mount_guess_should_display(UnixMountEntry* mount_entry);
25950 int g_unix_mount_is_readonly(UnixMountEntry* mount_entry);
25951 int g_unix_mount_is_system_internal(UnixMountEntry* mount_entry);
25952 int g_unix_mount_points_changed_since(ulong time);
25953 GLib2.List* /*new*/ g_unix_mount_points_get(/*out*/ ulong* time_read=null);
25954 int g_unix_mounts_changed_since(ulong time);
25955 GLib2.List* /*new*/ g_unix_mounts_get(/*out*/ ulong* time_read=null);