Top |
GObject * | config | Read / Write |
GObject * | file | Read / Write |
GObject * | main-loop | Read / Write |
GObject * | task-launcher | Read / Write |
void | load-config | Run Last |
void | prepare | Run Last |
void | quit | Run Last |
void | register-types | Run Last |
void | setup | Run Last |
#define | AGS_VERSION |
#define | AGS_BUILD_ID |
#define | AGS_DEFAULT_DIRECTORY |
#define | AGS_DEFAULT_CONFIG |
#define | AGS_DEFAULT_BUNDLE_ID |
enum | AgsApplicationContextFlags |
GFlags ╰── AgsApplicationContextFlags GObject ╰── AgsApplicationContext ├── AgsServerApplicationContext ╰── AgsThreadApplicationContext
AgsApplicationContext is a context provider is your and libraries entry point to the application. You might subtype it to implement your own contices. Thus you should consider to create a provider interface for reusability.
Use this code to retrieve application context:
1 |
AgsApplicationContext *application_context = ags_application_context_get_instance(); |
AgsApplicationContext itself doesn't implement any provider interfaces, so you need to instantiate a specific application context first, before you get the singleton.
For example with AgsThreadApplicationContext implementing AgsConcurrencyProvider:
1 2 3 4 5 6 7 8 9 |
AgsThread *main_loop; AgsApplicationContext *application_context; ags_thread_application_context_new(); application_context = ags_application_context_get_instance(); main_loop = ags_concurrency_provider_get_main_loop(AGS_CONCURRENCY_PROVIDER(application_context)); |
#define AGS_APPLICATION_CONTEXT_GET_OBJ_MUTEX(obj) (&(((AgsApplicationContext *) obj)->obj_mutex))
gboolean ags_application_context_test_flags (AgsApplicationContext *application_context
,AgsApplicationContextFlags flags
);
Test flags
to be set on application_context
.
Since: 3.0.0
void ags_application_context_set_flags (AgsApplicationContext *application_context
,AgsApplicationContextFlags flags
);
Enable a feature of AgsApplicationContext.
Since: 3.0.0
void ags_application_context_unset_flags (AgsApplicationContext *application_context
,AgsApplicationContextFlags flags
);
Disable a feature of AgsApplicationContext.
Since: 3.0.0
void
ags_application_context_load_config (AgsApplicationContext *application_context
);
Signal to load and parse configuration.
Since: 3.0.0
void
ags_application_context_prepare (AgsApplicationContext *application_context
);
Prepare application_context
.
Since: 3.0.0
void
ags_application_context_setup (AgsApplicationContext *application_context
);
Setup application_context
.
Since: 3.0.0
void
ags_application_context_register_types
(AgsApplicationContext *application_context
);
Notification to register your types.
Since: 3.0.0
void
ags_application_context_quit (AgsApplicationContext *application_context
);
Calls exit()
Since: 3.0.0
AgsApplicationContext * ags_application_context_get_instance ();
Get your application context instance.
Since: 3.0.0
AgsApplicationContext * ags_application_context_new (GObject *main_loop
,AgsConfig *config
);
Create a new instance of AgsApplicationContext
Since: 3.0.0
Enum values to control the behavior or indicate internal state of AgsApplicationContext by enable/disable as flags.
“config”
property “config” GObject *
The assigned config.
Owner: AgsApplicationContext
Flags: Read / Write
Since: 3.0.0
“file”
property “file” GObject *
The assigned file.
Owner: AgsApplicationContext
Flags: Read / Write
Since: 3.0.0
“main-loop”
property “main-loop” GObject *
The assigned main-loop.
Owner: AgsApplicationContext
Flags: Read / Write
Since: 3.0.0
“load-config”
signalvoid user_function (AgsApplicationContext *application_context, gpointer user_data)
The ::load-config notifies to load configuration.
Flags: Run Last
Since: 3.0.0
“prepare”
signalvoid user_function (AgsApplicationContext *application_context, gpointer user_data)
The ::prepare signal should be implemented to prepare your application context.
Flags: Run Last
Since: 3.0.0
“quit”
signalvoid user_function (AgsApplicationContext *application_context, gpointer user_data)
The ::quit notifies to load configuration.
Flags: Run Last
Since: 3.0.0
“register-types”
signalvoid user_function (AgsApplicationContext *application_context, gpointer user_data)
The ::register-types signal should be implemented to load your types.
Flags: Run Last
Since: 3.0.0
“setup”
signalvoid user_function (AgsApplicationContext *application_context, gpointer user_data)
The ::setup signal should be implemented to setup your application context.
Flags: Run Last
Since: 3.0.0