bonobo-listener

bonobo-listener

Functions

Signals

void event-notify Run Last

Types and Values

Object Hierarchy

    GObject
    ╰── BonoboObject
        ╰── BonoboListener

Description

Functions

BonoboListenerCallbackFn ()

void
(*BonoboListenerCallbackFn) (BonoboListener *listener,
                             const char *event_name,
                             const CORBA_any *any,
                             CORBA_Environment *ev,
                             gpointer user_data);

bonobo_listener_new ()

BonoboListener *
bonobo_listener_new (BonoboListenerCallbackFn event_cb,
                     gpointer user_data);

Creates a generic event listener. The listener calls the event_callback function and emits an "event_notify" signal when notified of an event. The signal callback should be of the form:

1
2
3
4
5
void some_callback (BonoboListener *listener,
                    char *event_name, 
		    CORBA_any *any,
		    CORBA_Environment *ev,
		    gpointer user_data);

You will typically pass the CORBA_Object reference in the return value to an EventSource (by invoking EventSource::addListener).

Parameters

event_cb

function to be invoked when an event is emitted by the EventSource.

 

user_data

data passed to the functioned pointed by event_call .

 

Returns

A BonoboListener object.


bonobo_listener_new_closure ()

BonoboListener *
bonobo_listener_new_closure (GClosure *event_closure);

Creates a generic event listener. The listener invokes the event_closure closure and emits an "event_notify" signal when notified of an event. The signal callback should be of the form:

1
2
3
4
5
void some_callback (BonoboListener *listener,
                    char *event_name, 
		    CORBA_any *any,
		    CORBA_Environment *ev,
		    gpointer user_data);

You will typically pass the CORBA_Object reference in the return value to an EventSource (by invoking EventSource::addListener).

Parameters

event_closure

closure to be invoked when an event is emitted by the EventSource.

 

Returns

A BonoboListener object.


bonobo_event_make_name ()

char *
bonobo_event_make_name (const char *idl_path,
                        const char *kind,
                        const char *subtype);

Creates an event name. Event names consist of three parts. The idl_path is mainly to create a unique namespace, and should identify the interface which triggered the event, for example "Bonobo/Property". The kind denotes what happened, for example "change". Finally you can use the optional subtype to make events more specific. All three parts of the name are joined together separated by colons. "Bonobo/Property:change" or "Bonobo/Property:change:autosave" are examples of valid event names.

Parameters

idl_path

the IDL part of the event name.

 

kind

the kind of the event

 

subtype

an optional subtype

 

Returns

A valid event_name, or NULL on error.


bonobo_event_type ()

char *
bonobo_event_type (const char *event_name);

Parameters

event_name

the event name

 

Returns

The event subtype, or NULL on error.


bonobo_event_subtype ()

char *
bonobo_event_subtype (const char *event_name);

bonobo_event_kind ()

char *
bonobo_event_kind (const char *event_name);

Parameters

event_name

the event name

 

Returns

The event kind, or NULL on error.


bonobo_event_idl_path ()

char *
bonobo_event_idl_path (const char *event_name);

Parameters

event_name

the event name

 

Returns

The event idl path, or NULL on error.

Types and Values

struct BonoboListener

struct BonoboListener;

BonoboListenerClass

typedef struct {
	BonoboObjectClass     parent_class;

	POA_Bonobo_Listener__epv epv;

	/* Signals */
	void (* event_notify) (BonoboListener    *listener,

			       char              *event_name,
			       BonoboArg         *event_data,

			       CORBA_Environment *ev);
} BonoboListenerClass;

Signal Details

The “event-notify” signal

void
user_function (BonoboListener       *bonobolistener,
               char                 *arg1,
               BonoboCorbaAny       *arg2,
               BonoboCorbaException *arg3,
               gpointer              user_data)

Flags: Run Last