Bonobo API Reference Manual | |||
---|---|---|---|
<<< Previous Page | Home | Up | Next Page >>> |
void (*BonoboMonikerAsyncFn) ( |
The moniker utility functions provide two sets of functions:
Helper functions for constructing and resolving monikers,
and a simple get_object method that constructs and resolves
against an interface in a single pass. Also, asynchronous
versions of these methods are provided using the
Helper functions for the implementation of new custom monikers are also provided here, along with a lot of the grunt code neccessary for moniker implementation, particularly constructing the chained list of sub-monikers that comprises a complex moniker.
The most useful function to get a feel for what monikers can do is the bonobo_get_object method. This is used to create a moniker and resolve it against a given interface like this:
Example 1. GetObject example
GtkWidget * moniker_resolve_demo (void) { Bonobo_Control control; CORBA_Environment ev; CORBA_exception_init (&ev); control = bonobo_get_object ("file:/demo/a.jpeg", "Bonobo/Control", NULL); if (control == CORBA_OBJECT_NIL) g_error ("Failed to get object file:/demo/a.jpeg"); return bonobo_widget_new_control (control); } |
It is worth noting that when resolving monikers a contracted version of the interface name may be used, ommitting the 'IDL:' prefix and / or the ':0' suffix.
void (*BonoboMonikerAsyncFn) ( |
|
This encapsulates both the parse stage and resolve process of using a moniker, providing a simple VisualBasic like mechanism for using the object name space.
|
This routine tries to parse a Moniker in string form
eg. file:/tmp/a.tar.gz
into a CORBA_Object representation of this that can later be resolved against an interface.
|
|
This resolves the moniker object against the given interface, with a default set of resolve options.
BonoboObjectClient* bonobo_moniker_client_resolve_client_default ( |
See: bonobo_moniker_client_resolve_default; however this version returns a BonoboObjectClient wrapped reference.
|
This routine is used to continue building up the chain that forms a multi-part moniker. The parent is referenced as the parent and passed onto the next stage of parsing the 'name'. We eventually return a moniker handle which represents the end of a linked list of monikers each pointing to their parent:
file:/tmp/a.tar.gz <-- gzip: <-- tar: <-- [ this is returned ]
|
This gets the display name of the parent moniker ( recursively all of the parents of this moniker ).
|
A helper function to share code from the end of a resolve implementation; this ensures that the returned object is of the correct interface by doing a queryInterface on the object.
int bonobo_moniker_util_seek_std_separator (const |
This looks for a standard separator in a moniker's display name string. Most monikers will want to use standard separators.
See also bonobo_moniker_util_escape
void bonobo_get_object_async (const |
An async version of bonobo_get_object
void bonobo_moniker_client_new_from_name_async (const |
An asynchronous version of new_from_name
char* bonobo_moniker_util_escape (const char *string, int offset); |
Escapes possible separator characters inside a moniker these include '!' and '#', the '\' escaping character is used.
char* bonobo_moniker_util_unescape (const char *string, int num_chars); |
This routine strips num_chars: from the start of string, discards the rest, and proceeds to un-escape characters escaped with '\'.
|
Compare a full moniker with the given name
void bonobo_moniker_resolve_async ( |
An async version of bonobo_moniker_client_resolve
moniker : | the moniker to resolve |
options : | resolve options |
interface_name : | the name of the interface we want returned as the result |
ev : | a corba exception environment |
timeout_msec : | the timeout in milliseconds |
cb : | the async callback that gets the response |
user_data : | user context data to pass to that callback |
void bonobo_moniker_resolve_async_default ( |
An async version of bonobo_moniker_client_resolve_default