bonobo-application

bonobo-application

Functions

Description

Functions

BonoboAppHookFunc ()

void
(*BonoboAppHookFunc) (BonoboApplication *app,
                      gpointer data);

bonobo_application_new ()

BonoboApplication *
bonobo_application_new (const char *name);

Creates a new BonoboApplication object.

Parameters

name

application name

 

Returns

a new BonoboApplication


bonobo_application_register_message ()

void
bonobo_application_register_message (BonoboApplication *app,
                                     const gchar *name,
                                     const gchar *description,
                                     GClosure *opt_closure,
                                     GType return_type,
                                     GType first_arg_type,
                                     ...);

Registers a new message type that the application supports.

Parameters

app

a BonoboApplication

 

name

message string identifier

 

description

a string containing a human readable description of the message

 

opt_closure

a GClosure that will be called for this message, or NULL; Function takes ownership of this closure.

 

return_type

Message return GType.

 

first_arg_type

GType of first argument of message, or G_TYPE_NONE.

 

...

G_TYPE_NONE -terminated list of argument GType's

 

bonobo_application_register_message_v ()

void
bonobo_application_register_message_v (BonoboApplication *app,
                                       const gchar *name,
                                       const gchar *description,
                                       GClosure *opt_closure,
                                       GType return_type,
                                       GType const arg_types[]);

See bonobo_application_register_message().

Parameters

app

a BonoboApplication

 

name

message string identifier

 

description

a string containing a human readable description of the message

 

opt_closure

a GClosure that will be called for this message, or NULL; Function takes ownership of this closure.

 

return_type

Message return GType.

 

arg_types

G_TYPE_NONE -terminated vector of argument GType's

 

bonobo_application_register_message_va ()

void
bonobo_application_register_message_va
                               (BonoboApplication *app,
                                const gchar *name,
                                const gchar *description,
                                GClosure *opt_closure,
                                GType return_type,
                                GType first_arg_type,
                                va_list var_args);

See bonobo_application_register_message().

Parameters

app

a BonoboApplication

 

name

message string identifier

 

description

a string containing a human readable description of the message

 

opt_closure

a GClosure that will be called for this message, or NULL; Function takes ownership of this closure.

 

return_type

Message return GType.

 

first_arg_type

GType of first argument of message, or G_TYPE_NONE

 

var_args

G_TYPE_NONE -terminated valist of argument GType's

 

bonobo_application_new_instance ()

gint
bonobo_application_new_instance (BonoboApplication *app,
                                 gint argc,
                                 gchar *argv[]);

Emit the "new-instance" signal of the BonoboApplication with the given arguments.

Parameters

app

a BonoboApplication

 

argc

number of elements in argv

 

argv

array of strings (command-line arguments)

 

Returns

signal return value


bonobo_application_create_serverinfo ()

gchar *
bonobo_application_create_serverinfo (BonoboApplication *app,
                                      gchar const *envp[]);

This utility function provides a simple way to contruct a valid serverinfo XML string.

Parameters

app

a BonoboApplication

 

envp

NULL-terminated string vector, containing the enviroment variables we wish to include in the server description.

 

Returns

a newly allocated string; caller must g_free() it.


bonobo_application_register_unique ()

Bonobo_RegistrationResult
bonobo_application_register_unique (BonoboApplication *app,
                                    gchar const *serverinfo,
                                    BonoboAppClient **client);

Try to register the running application, or check for an existing application already registered and get a reference to it. Applications already running but on different environments (as defined by the bonobo:environenment server property) than this one are ignored and do not interfere.

If the registration attempt indicates that another instance of this application is already running, then the output variable client will receive a newly created BonoboAppClient associated with the running application. Otherwise, *client is set to NULL.

Parameters

app

a BonoboApplication instance

 

serverinfo

the XML server description. bonobo_application_create_server_description() may be used to easily create such description.

 

client

output parameter that will contain a client object, in case another instance has already running, or NULL if we are the first to register.

 

Returns

the registration result. Bonobo_ACTIVATION_REG_SUCCESS means the application was registered, since no other running instance was detected. If, however, a running application is detected, Bonobo_ACTIVATION_REG_ALREADY_ACTIVE is returned.


bonobo_application_add_hook ()

void
bonobo_application_add_hook (BonoboAppHookFunc func,
                             gpointer data);

Add a hook function to be called whenever a new BonoboApplication instance is created.

Parameters

func

hook function

 

data

user data

 

bonobo_application_remove_hook ()

void
bonobo_application_remove_hook (BonoboAppHookFunc func,
                                gpointer data);

Removes a hook function previously set with bonobo_application_add_hook().

Parameters

func

hook function

 

data

user data