Top |
TeplApplication extends the GtkApplication class.
For some features, the Tepl framework gets the default GtkApplication with
g_application_get_default()
, for example to call g_application_hold()
,
g_application_mark_busy()
, etc. Normally a GTK application has only one
GApplication per process, so this shouldn't cause any problem.
Note that TeplApplication extends the GtkApplication class but without subclassing it, because several libraries might want to extend GtkApplication and an application needs to be able to use all those extensions at the same time.
This class adds the following GAction's to the GtkApplication.
Corresponding AmtkActionInfo's are available with
tepl_application_get_tepl_action_info_store()
.
"app.tepl-new-window"
: creates a new main window with
tepl_abstract_factory_create_main_window()
.
TeplApplication *
tepl_application_get_from_gtk_application
(GtkApplication *gtk_app
);
Returns the TeplApplication of gtk_app
. The returned object is guaranteed
to be the same for the lifetime of gtk_app
.
Since: 2.0
TeplApplication *
tepl_application_get_default (void
);
Convenience function that calls g_application_get_default()
followed by
tepl_application_get_from_gtk_application()
. The object returned by
g_application_get_default()
must be a GtkApplication.
Since: 2.0
GtkApplication *
tepl_application_get_application (TeplApplication *tepl_app
);
Since: 2.0
AmtkActionInfoStore *
tepl_application_get_app_action_info_store
(TeplApplication *tepl_app
);
Returns an initially empty AmtkActionInfoStore reserved for the application-specific actions. Libraries should not add AmtkActionInfo's to this store. Libraries should provide their own store if they want to share AmtkActionInfo's.
Since: 2.0
AmtkActionInfoStore *
tepl_application_get_tepl_action_info_store
(TeplApplication *tepl_app
);
The returned AmtkActionInfoStore contains AmtkActionInfo's for all the GAction's listed in the class description of TeplApplicationWindow and the class description of TeplApplication.
Since: 3.0
GtkApplicationWindow *
tepl_application_get_active_main_window
(TeplApplication *tepl_app
);
Like gtk_application_get_active_window()
, but returns the main window in the
sense of tepl_application_window_is_main_window()
.
Since: 4.0
void tepl_application_open_simple (TeplApplication *tepl_app
,GFile *file
);
Calls g_application_open()
with a single file and an empty hint.
Since: 2.0
void
tepl_application_handle_activate (TeplApplication *tepl_app
);
Connects a generic function handler for the “activate” signal.
If no main windows exist, it creates one with
tepl_abstract_factory_create_main_window()
. If a main window already exists,
it calls gtk_window_present()
on the most recently focused window of the
application.
Since: 4.0
void
tepl_application_handle_open (TeplApplication *tepl_app
);
Connects a generic function handler for the “open” signal.
It calls tepl_application_window_open_file()
for each GFile to open, on the
active main window as returned by tepl_application_get_active_main_window()
.
If the active main window is NULL
, it creates one with
tepl_abstract_factory_create_main_window()
.
Since: 4.0
void
tepl_application_handle_metadata (TeplApplication *tepl_app
);
This function:
Connects to the “startup” signal to call
tepl_metadata_manager_load_from_disk()
.
Connects to the “shutdown” signal to call
tepl_metadata_manager_save_to_disk()
with trim
set to TRUE
.
It gets the GFile by calling
tepl_abstract_factory_create_metadata_manager_file()
.
Since: 5.0
“application”
property“application” GtkApplication *
The GtkApplication.
Owner: TeplApplication
Flags: Read / Write / Construct Only
Since: 2.0