MassifG Application

MassifG Application — the main application object

Synopsis

                    MassifgApplication;
                    MassifgApplicationClass;
MassifgApplication * massifg_application_new            (int *argc_ptr,
                                                         char ***argv_ptr);
void                massifg_application_free            (MassifgApplication *app);
gboolean            massifg_application_set_file        (MassifgApplication *app,
                                                         gchar *filename,
                                                         GError **error);
int                 massifg_application_run             (MassifgApplication *app);

Object Hierarchy

  GObject
   +----MassifgApplication

Signals

  "file-changed"                                   : Run Last / No Recursion / No Hooks

Description

Note: These functions are meant to be used internally in MassifG

Details

MassifgApplication

typedef struct _MassifgApplication MassifgApplication;

Instance structure for a MassifgApplication object


MassifgApplicationClass

typedef struct {
	GObjectClass parent_class;

	void (*file_changed) (MassifgApplication *app, gpointer user_data);
} MassifgApplicationClass;

Class structure for a MassifgApplication object


massifg_application_new ()

MassifgApplication * massifg_application_new            (int *argc_ptr,
                                                         char ***argv_ptr);

Get a new MassifgApplication instance. Arguments are typically gotten from main(), but can for testing purposes for instance be provided manually or by g_shell_parse_argv()

argc_ptr :

Pointer to argc, the number of elements in the argument array

argv_ptr :

Pointer to argv array

Returns :

A new MassifgApplication instance

massifg_application_free ()

void                massifg_application_free            (MassifgApplication *app);

Free a MassifgApplication

app :

The MassifgApplication to free

massifg_application_set_file ()

gboolean            massifg_application_set_file        (MassifgApplication *app,
                                                         gchar *filename,
                                                         GError **error);

Set the currently active file

app :

A MassifgApplication

filename :

Path to filename to set as active. Will be copied internally. NULL is invalid

error :

A place to return a GError or NULL

Returns :

TRUE on success or FALSE on failure

massifg_application_run ()

int                 massifg_application_run             (MassifgApplication *app);

This function will block until the application quits. It is separate from main() so that the application can be tested more easily

app :

The MassifgApplication to run

Returns :

The applications exit status. Non-zero indicates failure

Signal Details

The "file-changed" signal

void                user_function                      (MassifgApplication *arg0,
                                                        gpointer            user_data)      : Run Last / No Recursion / No Hooks

This signal is emitted when the current active file is changed

user_data :

user data set when the signal handler was connected.