Libbonobo Reference Manual | ||||
---|---|---|---|---|
Top | Description |
Synopsis
typedef BonoboArg; typedef BonoboArgType; #define BONOBO_ARG_NULL #define BONOBO_ARG_BOOLEAN #define BONOBO_ARG_SHORT #define BONOBO_ARG_INT #define BONOBO_ARG_LONG #define BONOBO_ARG_LONGLONG #define BONOBO_ARG_FLOAT #define BONOBO_ARG_DOUBLE #define BONOBO_ARG_CHAR #define BONOBO_ARG_STRING #define BONOBO_ARG_GET_GENERAL (a, c, t, e) #define BONOBO_ARG_SET_GENERAL (a, v, c, t, e) #define BONOBO_ARG_GET_BOOLEAN (a) #define BONOBO_ARG_SET_BOOLEAN (a, v) #define BONOBO_ARG_GET_SHORT (a) #define BONOBO_ARG_SET_SHORT (a, v) #define BONOBO_ARG_GET_INT (a) #define BONOBO_ARG_SET_INT (a, v) #define BONOBO_ARG_GET_LONG (a) #define BONOBO_ARG_SET_LONG (a, v) #define BONOBO_ARG_GET_LONGLONG (a) #define BONOBO_ARG_SET_LONGLONG (a, v) #define BONOBO_ARG_GET_FLOAT (a) #define BONOBO_ARG_SET_FLOAT (a, v) #define BONOBO_ARG_GET_DOUBLE (a) #define BONOBO_ARG_SET_DOUBLE (a, v) #define BONOBO_ARG_GET_CHAR (a) #define BONOBO_ARG_SET_CHAR (a, v) #define BONOBO_ARG_GET_STRING (a) #define BONOBO_ARG_SET_STRING (a, v) BonoboArg * bonobo_arg_new (BonoboArgType t
); BonoboArg * bonobo_arg_new_from (BonoboArgType t
,gconstpointer data
); void bonobo_arg_release (BonoboArg *arg
); BonoboArg * bonobo_arg_copy (const BonoboArg *arg
); void bonobo_arg_from_gvalue (BonoboArg *a
,const GValue *value
); BonoboArgType bonobo_arg_type_from_gtype (GType t
); void bonobo_arg_to_gvalue (GValue *value
,const BonoboArg *arg
); GType bonobo_arg_type_to_gtype (BonoboArgType id
); gboolean bonobo_arg_is_equal (const BonoboArg *a
,const BonoboArg *b
,CORBA_Environment *opt_ev
); gboolean bonobo_arg_type_is_equal (BonoboArgType a
,BonoboArgType b
,CORBA_Environment *opt_ev
);
Description
The BonoboArg code, and macros are designed to make the use of CORBA_Any's slightly simpler by providing a glib like binding for them. The bonobo-arg code also provides mappings between GValues and CORBA_anys.
A typical use of the BonoboArg macros would be in
Example 14. Property bag implementation
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
static void get_prop (BonoboPropertyBag *bag, BonoboArg *arg, guint arg_id, CORBA_Environment *ev, gpointer user_data) { GObject *clock = user_data; switch (arg_id) { case PROP_RUNNING: { BONOBO_ARG_SET_BOOLEAN (arg, is_it_running); break; } default: bonobo_exception_set (ev, ex_Bonobo_PropertyBag_NotFound); break; } } |
Details
BonoboArgType
typedef CORBA_TypeCode BonoboArgType;
A glib style looking typedef for a CORBA type description.
BONOBO_ARG_GET_GENERAL()
#define BONOBO_ARG_GET_GENERAL(a,c,t,e)
A macro to extract a value from a BonoboArg with
the given CORBA type t
.
|
the BonoboArg |
|
a BonoboArgType for checking |
|
the C type of the value eg. for BONOBO_ARG_LONG: CORBA_long |
|
an optional CORBA_Environment or NULL. |
BONOBO_ARG_SET_GENERAL()
#define BONOBO_ARG_SET_GENERAL(a,v,c,t,e)
A macro to insert a value into an empty BonoboArg with
the given CORBA type t
.
|
the BonoboArg |
|
a pointer to the value to insert. |
|
a BonoboArgType for checking |
|
the C type of the value eg. for BONOBO_ARG_LONG: CORBA_long |
|
an optional CORBA_Environment or NULL. |
BONOBO_ARG_GET_BOOLEAN()
#define BONOBO_ARG_GET_BOOLEAN(a) (BONOBO_ARG_GET_GENERAL (a, TC_CORBA_boolean, CORBA_boolean, NULL))
This macro returns a CORBA_boolean from inside a BonoboArg. If the BonoboArg's type does not match, the behavior is undefined, and may cause faults.
|
the BonoboArg to extract the value from. |
BONOBO_ARG_SET_BOOLEAN()
#define BONOBO_ARG_SET_BOOLEAN(a,v) (BONOBO_ARG_SET_GENERAL (a, v, TC_CORBA_boolean, CORBA_boolean, NULL))
This macro sets the value of a
to contain v
|
the Bonobo arg to insert the value into |
|
a CORBA_boolean. |
BONOBO_ARG_GET_SHORT()
#define BONOBO_ARG_GET_SHORT(a) (BONOBO_ARG_GET_GENERAL (a, TC_CORBA_short, CORBA_short, NULL))
This macro returns a CORBA_short from inside a BonoboArg. If the BonoboArg's type does not match, the behavior is undefined, and may cause faults.
|
the BonoboArg to extract the value from. |
BONOBO_ARG_SET_SHORT()
#define BONOBO_ARG_SET_SHORT(a,v) (BONOBO_ARG_SET_GENERAL (a, v, TC_CORBA_short, CORBA_short, NULL))
This macro sets the value of a
to contain v
|
the Bonobo arg to insert the value into |
|
a CORBA_short. |
BONOBO_ARG_GET_INT()
#define BONOBO_ARG_GET_INT(a) (BONOBO_ARG_GET_GENERAL (a, TC_CORBA_long, CORBA_long, NULL))
this macro returns a CORBA_long from inside a BonoboArg, if the BonoboArg's type does not match, the behavior is undefined, and may cause faults.
|
the BonoboArg to extract the value from. |
BONOBO_ARG_SET_INT()
#define BONOBO_ARG_SET_INT(a,v) (BONOBO_ARG_SET_GENERAL (a, v, TC_CORBA_long, CORBA_long, NULL))
This macro sets the value of a
to contain v
|
the Bonobo arg to insert the value into |
|
a CORBA_long. |
BONOBO_ARG_GET_LONG()
#define BONOBO_ARG_GET_LONG(a) (BONOBO_ARG_GET_GENERAL (a, TC_CORBA_long, CORBA_long, NULL))
this macro returns a CORBA_long from from inside a BonoboArg, if the BonoboArg's type does not match, the behavior is undefined, and may cause faults.
|
the BonoboArg to extract the value from. |
BONOBO_ARG_SET_LONG()
#define BONOBO_ARG_SET_LONG(a,v) (BONOBO_ARG_SET_GENERAL (a, v, TC_CORBA_long, CORBA_long, NULL))
This macro sets the value of a
to contain v
|
the Bonobo arg to insert the value into |
|
a CORBA_long. |
BONOBO_ARG_GET_LONGLONG()
#define BONOBO_ARG_GET_LONGLONG(a) (BONOBO_ARG_GET_GENERAL (a, TC_CORBA_long_long, CORBA_long_long, NULL))
this macro returns a CORBA_long_long from from inside a BonoboArg, if the BonoboArg's type does not match, the behavior is undefined, and may cause faults.
|
the BonoboArg to extract the value from. |
BONOBO_ARG_SET_LONGLONG()
#define BONOBO_ARG_SET_LONGLONG(a,v) (BONOBO_ARG_SET_GENERAL (a, v, TC_CORBA_long_long, CORBA_long_long, NULL))
This macro sets the value of a
to contain v
|
the Bonobo arg to insert the value into |
|
a CORBA_long_long. |
BONOBO_ARG_GET_FLOAT()
#define BONOBO_ARG_GET_FLOAT(a) (BONOBO_ARG_GET_GENERAL (a, TC_CORBA_float, CORBA_float, NULL))
this macro returns a CORBA_float from inside a BonoboArg, if the BonoboArg's type does not match, the behavior is undefined, and may cause faults.
|
the BonoboArg to extract the value from. |
BONOBO_ARG_SET_FLOAT()
#define BONOBO_ARG_SET_FLOAT(a,v) (BONOBO_ARG_SET_GENERAL (a, v, TC_CORBA_float, CORBA_float, NULL))
This macro sets the value of a
to contain v
|
the Bonobo arg to insert the value into |
|
a CORBA_float. |
BONOBO_ARG_GET_DOUBLE()
#define BONOBO_ARG_GET_DOUBLE(a) (BONOBO_ARG_GET_GENERAL (a, TC_CORBA_double, CORBA_double, NULL))
This macro returns a CORBA_double from inside a BonoboArg. If the BonoboArg's type does not match, the behavior is undefined, and may cause faults.
|
the BonoboArg to extract the value from. |
BONOBO_ARG_SET_DOUBLE()
#define BONOBO_ARG_SET_DOUBLE(a,v) (BONOBO_ARG_SET_GENERAL (a, v, TC_CORBA_double, CORBA_double, NULL))
This macro sets the value of a
to contain v
|
the Bonobo arg to insert the value into |
|
a CORBA_double. |
BONOBO_ARG_GET_CHAR()
#define BONOBO_ARG_GET_CHAR(a) (BONOBO_ARG_GET_GENERAL (a, TC_CORBA_char, CORBA_char, NULL))
This macro returns a CORBA_char from inside a BonoboArg, If the BonoboArg's type does not match, the behavior is undefined, and may cause faults.
|
the BonoboArg to extract the value from. |
BONOBO_ARG_SET_CHAR()
#define BONOBO_ARG_SET_CHAR(a,v) (BONOBO_ARG_SET_GENERAL (a, v, TC_CORBA_char, CORBA_char, NULL))
This macro sets the value of a
to contain v
|
the Bonobo arg to insert the value into |
|
a CORBA_char. |
BONOBO_ARG_GET_STRING()
#define BONOBO_ARG_GET_STRING(a)
this macro returns a const CORBA_char * from from inside a
BonoboArg, if the BonoboArg's type does not match, the
behavior is undefined, and may cause faults. The
pointer to the string is only valid for the scope of
the lifetime of a
.
|
the BonoboArg to extract the value from. |
BONOBO_ARG_SET_STRING()
#define BONOBO_ARG_SET_STRING(a,v)
This macro sets the value of a
to contain a
duplicated copy of v
|
the Bonobo arg to insert the value into |
|
a CORBA_char *. |
bonobo_arg_new ()
BonoboArg * bonobo_arg_new (BonoboArgType t
);
Create a new BonoboArg with the specified type the value of the BonoboArg is initially empty.
|
the BonoboArgType eg. TC_CORBA_long |
Returns : |
the new BonoboArg |
bonobo_arg_new_from ()
BonoboArg * bonobo_arg_new_from (BonoboArgType t
,gconstpointer data
);
Create a new BonoboArg with the specified type and data
|
the BonoboArgType eg. TC_CORBA_long |
|
the data for the BonoboArg to be created |
Returns : |
the new BonoboArg |
bonobo_arg_release ()
void bonobo_arg_release (BonoboArg *arg
);
This frees the memory associated with arg
|
the bonobo arg. |
bonobo_arg_copy ()
BonoboArg * bonobo_arg_copy (const BonoboArg *arg
);
This function duplicates a
by a deep copy
|
the bonobo arg |
Returns : |
a copy of arg
|
bonobo_arg_from_gvalue ()
void bonobo_arg_from_gvalue (BonoboArg *a
,const GValue *value
);
This maps a GValue value
to a BonoboArg a
;
a
must point to a freshly allocated BonoboArg
eg. such as returned by bonobo_arg_new
|
pointer to blank BonoboArg |
|
GValue to copy |
bonobo_arg_to_gvalue ()
void bonobo_arg_to_gvalue (GValue *value
,const BonoboArg *arg
);
Maps a BonoboArg to a GtkArg; a
must point
to a blank GtkArg.
|
pointer to a blank GValue |
|
the BonoboArg to copy |
bonobo_arg_type_to_gtype ()
GType bonobo_arg_type_to_gtype (BonoboArgType id
);
This maps a BonoboArgType to a GType
|
the BonoboArgType |
Returns : |
the mapped type or 0 on failure
|
bonobo_arg_is_equal ()
gboolean bonobo_arg_is_equal (const BonoboArg *a
,const BonoboArg *b
,CORBA_Environment *opt_ev
);
Compares two BonoboArg's for equivalence; will return TRUE
if equivalent for all simple cases. For Object references
CORBA sometimes denies 2 object references are equivalent
even if they are [ this is a feature_not_bug ].
This function is commutative.
bonobo_arg_type_is_equal ()
gboolean bonobo_arg_type_is_equal (BonoboArgType a
,BonoboArgType b
,CORBA_Environment *opt_ev
);
This compares two BonoboArgType's in a
and b
.
The opt_ev
is an optional CORBA_Environment for
exceptions, or NULL
. This function is commutative.