AgsApplicationContext

AgsApplicationContext — The application context

Functions

Properties

GObject * config Read / Write
GObject * file Read / Write
GObject * main-loop Read / Write

Signals

Types and Values

Object Hierarchy

    GObject
    ╰── AgsApplicationContext
        ├── AgsServerApplicationContext
        ╰── AgsThreadApplicationContext

Implemented Interfaces

AgsApplicationContext implements AgsConnectable.

Includes

#include <ags/object/ags_application_context.h>

Description

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.

Functions

ags_application_context_load_config ()

void
ags_application_context_load_config (AgsApplicationContext *application_context);

Signal to load and parse configuration.

Since 0.7.0

Parameters

application_context

the AgsApplicationContext

 

ags_application_context_prepare ()

void
ags_application_context_prepare (AgsApplicationContext *application_context);

ags_application_context_setup ()

void
ags_application_context_setup (AgsApplicationContext *application_context);

ags_application_context_register_types ()

void
ags_application_context_register_types
                               (AgsApplicationContext *application_context);

Notification to register your types.

Since 0.7.0

Parameters

application_context

the AgsApplicationContext

 

ags_application_context_add_sibling ()

void
ags_application_context_add_sibling (AgsApplicationContext *application_context,
                                     AgsApplicationContext *sibling);

ags_application_context_remove_sibling ()

void
ags_application_context_remove_sibling
                               (AgsApplicationContext *application_context,
                                AgsApplicationContext *sibling);

ags_application_context_find_default ()

AgsApplicationContext *
ags_application_context_find_default (GList *application_context);

Find default context in application_context GList containing AgsApplicationContext.

Parameters

application_context

the GList containing AgsApplicationContext

 

Since: 1.0.0


ags_application_context_find_main_loop ()

GList *
ags_application_context_find_main_loop
                               (GList *application_context);

Find :main-loop in application_context GList containing AgsApplicationContext.

Parameters

application_context

the GList containing AgsApplicationContext

 

Since: 1.0.0


ags_application_context_quit ()

void
ags_application_context_quit (AgsApplicationContext *application_context);

Calls exit()

Parameters

application_context

the context to quit

 

Since: 1.0.0


ags_application_context_get_instance ()

AgsApplicationContext *
ags_application_context_get_instance ();

Get your application context instance.

Returns

the AgsApplicationContext instance

Since: 1.0.0


ags_application_context_new ()

AgsApplicationContext *
ags_application_context_new (GObject *main_loop,
                             AgsConfig *config);

Create a new instance of AgsApplicationContext

Parameters

main_loop

the AgsMainLoop

 

config

the AgsConfig

 

Returns

the AgsApplicationContext instance

Since: 1.0.0


AGS_APPLICATION_CONTEXT()

#define AGS_APPLICATION_CONTEXT(obj)                (G_TYPE_CHECK_INSTANCE_CAST((obj), AGS_TYPE_APPLICATION_CONTEXT, AgsApplicationContext))

AGS_APPLICATION_CONTEXT_CLASS()

#define AGS_APPLICATION_CONTEXT_CLASS(class)        (G_TYPE_CHECK_CLASS_CAST(class, AGS_TYPE_APPLICATION_CONTEXT, AgsApplicationContextClass))

AGS_APPLICATION_CONTEXT_GET_CLASS()

#define AGS_APPLICATION_CONTEXT_GET_CLASS(obj)      (G_TYPE_INSTANCE_GET_CLASS(obj, AGS_TYPE_APPLICATION_CONTEXT, AgsApplicationContextClass))

AGS_IS_APPLICATION_CONTEXT()

#define AGS_IS_APPLICATION_CONTEXT(obj)             (G_TYPE_CHECK_INSTANCE_TYPE ((obj), AGS_TYPE_APPLICATION_CONTEXT))

ags_application_context_get_type ()

GType
ags_application_context_get_type ();

Types and Values

AGS_VERSION

#define AGS_VERSION "1.0.0"

AGS_BUILD_ID

#define AGS_BUILD_ID "CEST 14-09-2017 04:33"

AGS_DEFAULT_DIRECTORY

#define AGS_DEFAULT_DIRECTORY ".gsequencer"

AGS_DEFAULT_CONFIG

#define AGS_DEFAULT_CONFIG "ags.conf"

enum AgsApplicationContextFlags

Enum values to control the behavior or indicate internal state of AgsApplicationContext by enable/disable as flags.

Members

AGS_APPLICATION_CONTEXT_DEFAULT

indicates the default context, used if siblings available

 

AGS_APPLICATION_CONTEXT_REGISTER_TYPES

enable to register types

 

AGS_APPLICATION_CONTEXT_ADD_TO_REGISTRY

add to AgsRegistry

 

AGS_APPLICATION_CONTEXT_CONNECT

call connect of AgsConnectable descending objects

 

AGS_APPLICATION_CONTEXT_TYPES_REGISTERED

indicates the types have been registered

 

AGS_APPLICATION_CONTEXT_ADDED_TO_REGISTRY

indicates the application context was added to AgsRegistry

 

AGS_APPLICATION_CONTEXT_CONNECTED

indicates the application context was connected by calling AgsConnectable::connect()

 

AGS_TYPE_APPLICATION_CONTEXT

#define AGS_TYPE_APPLICATION_CONTEXT                (ags_application_context_get_type())

struct AgsApplicationContext

struct AgsApplicationContext;

struct AgsApplicationContextClass

struct AgsApplicationContextClass {
  GObjectClass object;

  void (*load_config)(AgsApplicationContext *application_context);
  
  void (*prepare)(AgsApplicationContext *application_context);
  void (*setup)(AgsApplicationContext *application_context);

  void (*register_types)(AgsApplicationContext *application_context);

  void (*read)(AgsFile *file, xmlNode *node, GObject **gobject);
  xmlNode* (*write)(AgsFile *file, xmlNode *parent, GObject *gobject);

  void (*quit)(AgsApplicationContext *application_context);
};

Property Details

The “config” property

  “config”                   GObject *

The assigned config.

Flags: Read / Write

Since: 1.0.0


The “file” property

  “file”                     GObject *

The assigned file.

Flags: Read / Write

Since: 1.0.0


The “main-loop” property

  “main-loop”                GObject *

The assigned main-loop.

Flags: Read / Write

Since: 1.0.0

Signal Details

The “load-config” signal

void
user_function (AgsApplicationContext *application_context,
               gpointer               user_data)

The ::load-config notifies to load configuration.

Parameters

application_context

the AgsApplicationContext

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 1.0.0


The “prepare” signal

void
user_function (AgsApplicationContext *application_context,
               gpointer               user_data)

The ::prepare signal should be implemented to prepare your application context.

Parameters

application_context

the AgsApplicationContext

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 1.0.0


The “quit” signal

void
user_function (AgsApplicationContext *application_context,
               gpointer               user_data)

The ::quit notifies to load configuration.

Parameters

application_context

the AgsApplicationContext

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 1.0.0


The “register-types” signal

void
user_function (AgsApplicationContext *application_context,
               gpointer               user_data)

The ::register-types signal should be implemented to load your types.

Parameters

application_context

the AgsApplicationContext

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 1.0.0


The “setup” signal

void
user_function (AgsApplicationContext *application_context,
               gpointer               user_data)

The ::setup signal should be implemented to setup your application context.

Parameters

application_context

the AgsApplicationContext

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 1.0.0