GObject.Object
Gio.Application
Gtk.Application
Import line: | Gtk = imports.gi.Gtk; |
GIR File: | Gtk-3.0.gir |
C documentation: | GtkApplication |
Class : | Application |
Implements: | Gio.ActionGroup |
Extends: | Gio.Application |
Properties | Defined By | |
---|---|---|
action_group : Gio.ActionGroup
|
Gio.Application | |
application_id : String
|
Gio.Application | |
flags : Gio.ApplicationFlags
|
Gio.Application | |
inactivity_timeout : guint32
|
Gio.Application | |
is_registered : gboolean
read only
|
Gio.Application | |
is_remote : gboolean
read only
|
Gio.Application | |
parent : Gio.Application
read only
|
Gtk.Application | |
parent_instance : GObject.Object
read only
|
Gio.Application | |
priv : Gtk.ApplicationPrivate
read only
|
Gtk.Application |
Method / Constructor | Defined By | |
---|---|---|
new Gtk.Application
(Object properties)
Create a new Gtk.Application
Create a new Gtk.Application
|
||
Create a new Gtk.Application
Create a new Gtk.Application
|
||
action_added
(String action_name)
:
none
Emits the GActionGroup::action-added signal on action_group.
Emits the GActionGroup::action-added signal on action_group.
This function should only be called by GActionGroup implementations.
|
Gio.ActionGroup | |
Emits the GActionGroup::action-enabled-changed signal on action_group.
Emits the GActionGroup::action-enabled-changed signal on action_group.
This function should only be called by GActionGroup implementations.
|
Gio.ActionGroup | |
action_removed
(String action_name)
:
none
Emits the GActionGroup::action-removed signal on action_group.
Emits the GActionGroup::action-removed signal on action_group.
This function should only be called by GActionGroup implementations.
|
Gio.ActionGroup | |
Emits the GActionGroup::action-state-changed signal on action_group.
Emits the GActionGroup::action-state-changed signal on action_group.
This function should only be called by GActionGroup implementations.
|
Gio.ActionGroup | |
activate
()
:
none
Activates the application.
Activates the application.
In essence, this results in the GApplication::activate() signal being emitted in the primary instance. The application must be registered before calling this function.
|
Gio.Application | |
Activate the named action within action_group.
Activate the named action within action_group.
If the action is expecting a parameter, then the correct type of parameter must be given as parameter. If the action is expecting no parameters then parameter must be NULL. See g_action_group_get_parameter_type().
|
Gio.ActionGroup | |
add_window
(Window window)
:
none
Adds a window from application.
Adds a window from application.
This call is equivalent to setting the GtkWindow:application property of window to application. Normally, the connection between the application and the window will remain until the window is destroyed, but you can explicitly remove it with gtk_application_remove_window(). GTK+ will keep the application running as long as it has any windows.
|
Gtk.Application | |
Request for the state of the named action within action_group to be
changed to value.
Request for the state of the named action within action_group to be
changed to value. The action must be stateful and value must be of the correct type. See g_action_group_get_state_type(). This call merely requests a change. The action may refuse to change its state or may change its state to something other than value. See g_action_group_get_state_hint(). If the value GVariant is floating, it is consumed.
|
Gio.ActionGroup | |
Checks if the named action within action_group is currently enabled.
Checks if the named action within action_group is currently enabled.
An action must be enabled in order to be activated or in order to have its state changed from outside callers.
|
Gio.ActionGroup | |
get_action_parameter_type
(String action_name)
:
GLib.VariantType
Queries the type of the parameter that must be given when activating
the named action within action_group.
Queries the type of the parameter that must be given when activating
the named action within action_group. When activating the action using g_action_group_activate(), the GVariant given to that function must be of the type returned by this function. In the case that this function returns NULL, you must not give any GVariant, but NULL instead. The parameter type of a particular action will never change but it is possible for an action to be removed and for a new action to be added with the same name but a different parameter type.
|
Gio.ActionGroup | |
get_action_state
(String action_name)
:
GLib.Variant
Queries the current state of the named action within action_group.
Queries the current state of the named action within action_group.
If the action is not stateful then NULL will be returned. If the action is stateful then the type of the return value is the type given by g_action_group_get_state_type(). The return value (if non-NULL) should be freed with g_variant_unref() when it is no longer required.
|
Gio.ActionGroup | |
get_action_state_hint
(String action_name)
:
GLib.Variant
Requests a hint about the valid range of values for the state of the
named action within action_group.
Requests a hint about the valid range of values for the state of the
named action within action_group. If NULL is returned it either means that the action is not stateful or that there is no hint about the valid range of values for the state of the action. If a GVariant array is returned then each item in the array is a returned then the tuple specifies the inclusive lower and upper bound of valid values for the state. In any case, the information is merely a hint. It may be possible to have a state value outside of the hinted range and setting a value within the range may fail. The return value (if non-NULL) should be freed with g_variant_unref() when it is no longer required.
|
Gio.ActionGroup | |
get_application_id
()
:
String
Gets the unique identifier for application.
Gets the unique identifier for application.
|
Gio.Application | |
get_flags
()
:
Gio.ApplicationFlags
Gets the flags for application.
Gets the flags for application.
See GApplicationFlags.
|
Gio.Application | |
get_inactivity_timeout
()
:
guint32
Gets the current inactivity timeout for the application.
Gets the current inactivity timeout for the application.
This is the amount of time (in milliseconds) after the last call to g_application_release() before the application stops running.
|
Gio.Application | |
get_is_registered
()
:
gboolean
Checks if application is registered.
Checks if application is registered.
An application is registered if g_application_register() has been successfully called.
|
Gio.Application | |
get_is_remote
()
:
gboolean
Checks if application is remote.
Checks if application is remote.
If application is remote then it means that another instance of application already exists (the 'primary' instance). Calls to perform actions on application will result in the actions being performed by the primary instance. The value of this property cannot be accessed before g_application_register() has been called. See g_application_get_is_registered().
|
Gio.Application | |
get_windows
()
:
Array
Gets a list of the GtkWindows associated with application.
Gets a list of the GtkWindows associated with application.
The list that is returned should not be modified in any way.
|
Gtk.Application | |
Gio.ActionGroup | ||
hold
()
:
none
Increases the use count of application.
Increases the use count of application.
Use this function to indicate that the application has a reason to continue to run. For example, g_application_hold() is called by GTK+ when a toplevel window is on the screen. To cancel the hold, call g_application_release().
|
Gio.Application | |
list_actions
()
:
Array
Lists the actions contained within action_group.
Lists the actions contained within action_group.
The caller is responsible for freeing the list with g_strfreev() when it is no longer required. actions in the groupb
|
Gio.ActionGroup | |
Opens the given files.
Opens the given files.
In essence, this results in the GApplication::open signal being emitted in the primary instance. intended to be used by applications that have multiple modes for for this functionality, you should use "". The application must be registered before calling this function and it must have the G_APPLICATION_HANDLES_OPEN flag set.
|
Gio.Application | |
register
(Cancellable cancellable)
:
gboolean
Attempts registration of the application.
Attempts registration of the application.
This is the point at which the application discovers if it is the primary instance or merely acting as a remote for an already-existing primary instance. This is implemented by attempting to acquire the application identifier as a unique bus name on the session bus using GDBus. Due to the internal architecture of GDBus, method calls can be dispatched at any time (even if a main loop is not running). For this reason, you must ensure that any object paths that you wish to register are registered before calling this function. If the application has already been registered then TRUE is returned with no work performed. The GApplication::startup signal is emitted if registration succeeds and application is the primary instance. In the event of an error (such as cancellable being cancelled, or a failure to connect to the session bus), FALSE is returned and error is set appropriately. instance is or is not the primary instance of the application. See g_application_get_is_remote() for that.
|
Gio.Application | |
release
()
:
none
Decrease the use count of application.
Decrease the use count of application.
When the use count reaches zero, the application will stop running. Never call this function except to cancel the effect of a previous call to g_application_hold().
|
Gio.Application | |
remove_window
(Window window)
:
none
Remove a window from application.
Remove a window from application.
If window belongs to application then this call is equivalent to setting the GtkWindow:application property of window to NULL. The application may stop running as a result of a call to this function.
|
Gtk.Application | |
Runs the application.
Runs the application.
This function is intended to be run from main() and its return value is intended to be returned by main(). Although you are expected to pass the argc, argv parameters from main() to this function, it is possible to pass NULL if argv is not available or commandline handling is not required. First, the local_command_line() virtual function is invoked. This function always runs on the local instance. It gets passed a pointer to a NULL-terminated copy of argv and is expected to remove the arguments that it handled (shifting up remaining arguments). See parsing argv manually. Alternatively, you may use the GOptionContext API, after setting The last argument to local_command_line() is a pointer to the status variable which can used to set the exit status that is returned from g_application_run(). If local_command_line() returns TRUE, the command line is expected to be completely handled, including possibly registering as the primary instance, calling g_application_activate() or g_application_open(), etc. If local_command_line() returns FALSE then the application is registered and the GApplication::command-line signal is emitted in the primary instance (which may or may not be this instance). The signal handler gets passed a GApplicationCommandline object that (among other things) contains the remaining commandline arguments that have not been handled by local_command_line(). If the application has the G_APPLICATION_HANDLES_COMMAND_LINE flag set then the default implementation of local_command_line() always returns FALSE immediately, resulting in the commandline always being handled in the primary instance. Otherwise, the default implementation of local_command_line() tries to do a couple of things that are probably reasonable for most applications. First, g_application_register() is called to attempt to register the application. If that works, then the command line arguments are inspected. If no commandline arguments are given, then g_application_activate() is called. If commandline arguments are given and the G_APPLICATION_HANDLES_OPEN flag is set then they are assumed to be filenames and g_application_open() is called. If you need to handle commandline arguments that are not filenames, and you don't mind commandline handling to happen in the primary instance, you should set G_APPLICATION_HANDLED_COMMAND_LINE and process the commandline arguments in your GApplication::command-line signal handler, either manually or using the GOptionContext API. If you are interested in doing more complicated local handling of the commandline then you should implement your own GApplication subclass and override local_command_line(). In this case, you most likely want to return TRUE from your local_command_line() implementation to suppress the default handling. See If, after the above is done, the use count of the application is zero then the exit status is returned immediately. If the use count is non-zero then the mainloop is run until the use count falls to zero, at which point 0 is returned. If the G_APPLICATION_IS_SERVICE flag is set, then the exiting at around to provide its
|
Gio.Application | |
set_action_group
(ActionGroup action_group)
:
none
Sets or unsets the group of actions associated with the application.
Sets or unsets the group of actions associated with the application.
These actions are the actions that can be remotely invoked. It is an error to call this function after the application has been registered.
|
Gio.Application | |
set_application_id
(String application_id)
:
none
Sets the unique identifier for application.
Sets the unique identifier for application.
The application id can only be modified if application has not yet been registered. The application id must be valid. See g_application_id_is_valid().
|
Gio.Application | |
set_flags
(ApplicationFlags flags)
:
none
Sets the flags for application.
Sets the flags for application.
The flags can only be modified if application has not yet been registered. See GApplicationFlags.
|
Gio.Application | |
set_inactivity_timeout
(guint32 inactivity_timeout)
:
none
Sets the current inactivity timeout for the application.
Sets the current inactivity timeout for the application.
This is the amount of time (in milliseconds) after the last call to g_application_release() before the application stops running. This call has no side effects of its own. The value set here is only used for next time g_application_release() drops the use count to zero. Any timeouts currently in progress are not impacted.
|
Gio.Application |
Event | Defined By | |
---|---|---|
action_added (ActionGroup self, String action_name)
:
none
Signals that a new action was just added to the group.
Signals that a new action was just added to the group. This signal
is emitted after the action has been added and is now visible.
|
Gio.ActionGroup | |
Signals that the enabled status of the named action has changed.
Signals that the enabled status of the named action has changed.
|
Gio.ActionGroup | |
action_removed (ActionGroup self, String action_name)
:
none
Signals that an action is just about to be removed from the group.
Signals that an action is just about to be removed from the group.
This signal is emitted before the action is removed, so the action is still visible and can be queried from the signal handler.
|
Gio.ActionGroup | |
Signals that the state of the named action has changed.
Signals that the state of the named action has changed.
|
Gio.ActionGroup | |
activate (Application self)
:
none
The ::activate signal is emitted on the primary instance when an
activation occurs.
The ::activate signal is emitted on the primary instance when an
activation occurs. See g_application_activate().
|
Gio.Application | |
The ::command-line signal is emitted on the primary instance when
a commandline is not handled locally.
The ::command-line signal is emitted on the primary instance when
a commandline is not handled locally. See g_application_run() and the GApplicationCommandline documentation for more information. process. See g_application_command_line_set_exit_status().
|
Gio.Application | |
The ::open signal is emitted on the primary instance when there are
files to open.
The ::open signal is emitted on the primary instance when there are
files to open. See g_application_open() for more information.
|
Gio.Application | |
startup (Application self)
:
none
The ::startup signal is emitted on the primary instance immediately
after registration.
The ::startup signal is emitted on the primary instance immediately
after registration. See g_application_register().
|
Gio.Application |
Class / Namespace | Method / Signal / Properties |
---|---|
Gtk.Window
Property |
application : Gtk.Application
The GtkApplication associated with the window.
|
Gtk.Window
Method |
get_application
()
:
Gtk.Application
Gets the GtkApplication associated with the window (if any).
|
Gtk.Window
Method |
set_application
(Application application)
:
none
Sets or unsets the GtkApplication associated with the window.
|