![]() |
![]() |
![]() |
Libbonobo Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy |
struct BonoboMonikerSimple; BonoboMonikerSimpleClass; Bonobo_Unknown (*BonoboMonikerSimpleResolveFn) (BonoboMoniker *moniker
,const Bonobo_ResolveOptions *options
,const CORBA_char *requested_interface
,CORBA_Environment *ev
); BonoboMoniker * bonobo_moniker_simple_construct (BonoboMonikerSimple *moniker
,const char *name
,GClosure *resolve_closure
); BonoboMoniker * bonobo_moniker_simple_new (const char *name
,BonoboMonikerSimpleResolveFn resolve_fn
); BonoboMoniker * bonobo_moniker_simple_new_closure (const char *name
,GClosure *resolve_closure
);
BonoboMonikerSimple makes writing monikers really extremely easy. To implement a moniker you only have to write 1 function. To register create the moniker object you have to use only 1 call. It can't get much simpler. If you want to use monikers instead of implementing them, you probably want to see bonobo-moniker-util instead.
Few people need to implement monikers, but if they do, this is how they should do it:
After implementing the resolve function, you need to create the new moniker
in your standard factory:
typedef struct { BonoboMonikerClass parent_class; } BonoboMonikerSimpleClass;
BonoboMonikerSimple's class.
Bonobo_Unknown (*BonoboMonikerSimpleResolveFn) (BonoboMoniker *moniker
,const Bonobo_ResolveOptions *options
,const CORBA_char *requested_interface
,CORBA_Environment *ev
);
Type of callback function that implements a simple moniker resolution.
|
the moniker |
|
resolve options |
|
the requested interface (repoid string) |
|
CORBA environment, in case an exception needs to be raised |
Returns : |
a Bonobo_Unknown as the result of the resolution |
BonoboMoniker * bonobo_moniker_simple_construct (BonoboMonikerSimple *moniker
,const char *name
,GClosure *resolve_closure
);
Constructs a simple moniker
|
the moniker to construct |
|
the name of the moniker eg. 'file:' |
|
the closure used to resolve the moniker |
Returns : |
the constructed moniker or NULL on failure. |
BonoboMoniker * bonobo_moniker_simple_new (const char *name
,BonoboMonikerSimpleResolveFn resolve_fn
);
Create a new instance of a simplified moniker.
|
the display name for the moniker |
|
a resolve function for the moniker |
Returns : |
the moniker object |
BonoboMoniker * bonobo_moniker_simple_new_closure (const char *name
,GClosure *resolve_closure
);
Create a new instance of a simplified moniker.
Instead of the Bonobo_ResolveOptions struct, the closure takes its contents as two arguments: BONOBO_TYPE_RESOLVE_FLAG and G_TYPE_LONG.
|
the display name for the moniker |
|
a closure for the resolve process. |
Returns : |
the moniker object |