Creates a #GFile corresponding to a filename that was given as part of the invocation of cmdline.
Signals that command line processing is completed.
Gets the list of arguments that was passed on the command line.
Gets the working directory of the command line invocation. The string may contain non-utf8 data.
Gets the contents of the 'environ' variable of the command line invocation, as would be returned by glib.global.getEnviron, ie as a null-terminated list of strings in the form 'NAME=VALUE'. The strings may contain non-utf8 data.
Gets the exit status of cmdline. See gio.application_command_line.ApplicationCommandLine.setExitStatus for more information.
Determines if cmdline represents a remote invocation.
Gets the options that were passed to g_application_command_line().
Gets the platform data associated with the invocation of cmdline.
Gets the stdin of the invoking process.
Gets the value of a particular environment variable of the command line invocation, as would be returned by glib.global.getenv. The strings may contain non-utf8 data.
Prints a message using the stdout print handler in the invoking process.
Prints a message using the stderr print handler in the invoking process.
Sets the exit status that will be used when the invoking process exits.
Set the GObject of a D ObjectG wrapper.
Get a pointer to the underlying C object.
Calls g_object_ref() on a GObject.
Calls g_object_unref() on a GObject.
Get the GType of an object.
GObject GType property.
Convenience method to return this cast to a type. For use in D with statements.
Template to get the D object from a C GObject and cast it to the given D object type.
Connect a D closure to an object signal.
Template for setting a GObject property.
Template for getting a GObject property.
Creates a binding between source_property on source and target_property on target.
Creates a binding between source_property on source and target_property on target, allowing you to set the transformation functions to be used by the binding.
This function is intended for #GObject implementations to re-enforce a floating[floating-ref] object reference. Doing this is seldom required: all #GInitiallyUnowneds are created with a floating reference which usually just needs to be sunken by calling gobject.object.ObjectG.refSink.
Increases the freeze count on object. If the freeze count is non-zero, the emission of "notify" signals on object is stopped. The signals are queued until the freeze count is decreased to zero. Duplicate notifications are squashed so that at most one #GObject::notify signal is emitted for each property modified while the object is frozen.
Gets a named field from the objects table of associations (see gobject.object.ObjectG.setData).
Gets a property of an object.
This function gets back user data pointers stored via gobject.object.ObjectG.setQdata.
Gets n_properties properties for an object. Obtained properties will be set to values. All properties must be valid. Warnings will be emitted and undefined behaviour may result if invalid properties are passed in.
Checks whether object has a floating[floating-ref] reference.
Emits a "notify" signal for the property property_name on object.
Emits a "notify" signal for the property specified by pspec on object.
Increase the reference count of object, and possibly remove the floating[floating-ref] reference, if object has a floating reference.
Releases all references to other objects. This can be used to break reference cycles.
Each object carries around a table of associations from strings to pointers. This function lets you set an association.
Sets a property on an object.
Remove a specified datum from the object's data associations, without invoking the association's destroy handler.
This function gets back user data pointers stored via gobject.object.ObjectG.setQdata and removes the data from object without invoking its destroy() function (if any was set). Usually, calling this function is only required to update user data pointers with a destroy notifier, for example:
Reverts the effect of a previous call to gobject.object.ObjectG.freezeNotify. The freeze count is decreased on object and when it reaches zero, queued "notify" signals are emitted.
This function essentially limits the life time of the closure to the life time of the object. That is, when the object is finalized, the closure is invalidated by calling gobject.closure.Closure.invalidate on it, in order to prevent invocations of the closure with a finalized (nonexisting) object. Also, gobject.object.ObjectG.ref_ and gobject.object.ObjectG.unref are added as marshal guards to the closure, to ensure that an extra reference count is held on object during invocation of the closure. Usually, this function will be called on closures that use this object as closure data.
Connect to Notify signal.
gio.application_command_line.ApplicationCommandLine represents a command-line invocation of an application.
It is created by gio.application.Application and emitted in the signal@Gio.Application::command-line signal and virtual function.
The class contains the list of arguments that the program was invoked with. It is also possible to query if the commandline invocation was local (ie: the current process is running in direct response to the invocation) or remote (ie: some other process forwarded the commandline to this process).
The gio.application_command_line.ApplicationCommandLine object can provide the @argc and @argv parameters for use with the glib.option_context.OptionContext command-line parsing API, with the gio.application_command_line.ApplicationCommandLine.getArguments function. See [gapplication-example-cmdline3.c][gapplication-example-cmdline3] for an example.
The exit status of the originally-invoked process may be set and messages can be printed to stdout or stderr of that process.
For remote invocation, the originally-invoked process exits when gio.application_command_line.ApplicationCommandLine.done method is called. This method is also automatically called when the object is disposed.
The main use for gio.application_command_line.ApplicationCommandLine (and the signal@Gio.Application::command-line signal) is 'Emacs server' like use cases: You can set the EDITOR environment variable to have e.g. git use your favourite editor to edit commit messages, and if you already have an instance of the editor running, the editing will happen in the running instance, instead of opening a new one. An important aspect of this use case is that the process that gets started by git does not return until the editing is done.
Normally, the commandline is completely handled in the signal@Gio.Application::command-line handler. The launching instance exits once the signal handler in the primary instance has returned, and the return value of the signal handler becomes the exit status of the launching instance.
The complete example can be found here: gapplication-example-cmdline.c
In more complicated cases, the handling of the commandline can be split between the launcher and the primary instance.
In this example of split commandline handling, options that start with --local- are handled locally, all other options are passed to the signal@Gio.Application::command-line handler which runs in the primary instance.
The complete example can be found here: gapplication-example-cmdline2.c
If handling the commandline requires a lot of work, it may be better to defer it.
In this example the commandline is not completely handled before the signal@Gio.Application::command-line handler returns. Instead, we keep a reference to the gio.application_command_line.ApplicationCommandLine object and handle it later (in this example, in an idle). Note that it is necessary to hold the application until you are done with the commandline.
The complete example can be found here: gapplication-example-cmdline3.c