![]() | ![]() | ![]() | Bonobo API Reference Manual |
---|
typedef BonoboArg; typedef BonoboArgType; #define BONOBO_ARG_NULL #define BONOBO_ARG_BOOLEAN #define BONOBO_ARG_INT #define BONOBO_ARG_LONG #define BONOBO_ARG_STRING #define BONOBO_ARG_FLOAT #define BONOBO_ARG_DOUBLE #define BONOBO_ARG_GET_GENERAL (a,c,t,e) #define BONOBO_ARG_GET_BOOLEAN (a) #define BONOBO_ARG_GET_INT (a) #define BONOBO_ARG_GET_LONG (a) #define BONOBO_ARG_GET_STRING (a) #define BONOBO_ARG_GET_FLOAT (a) #define BONOBO_ARG_GET_DOUBLE (a) #define BONOBO_ARG_SET_GENERAL (a,v,c,t,e) #define BONOBO_ARG_SET_BOOLEAN (a,v) #define BONOBO_ARG_SET_INT (a,v) #define BONOBO_ARG_SET_LONG (a,v) #define BONOBO_ARG_SET_STRING (a,v) #define BONOBO_ARG_SET_FLOAT (a,v) #define BONOBO_ARG_SET_DOUBLE (a,v) BonoboArg* bonobo_arg_new (BonoboArgType t); void bonobo_arg_release (BonoboArg *arg); BonoboArg* bonobo_arg_copy (const BonoboArg *arg); gboolean bonobo_arg_is_equal (BonoboArg *a, BonoboArg *b, CORBA_Environment *opt_ev); GtkType bonobo_arg_type_to_gtk (BonoboArgType id); BonoboArgType bonobo_arg_type_from_gtk (GtkType t); void bonobo_arg_to_gtk (GtkArg *a, const BonoboArg *arg); void bonobo_arg_from_gtk (BonoboArg *a, const GtkArg *arg); gboolean bonobo_arg_type_is_equal (BonoboArgType a, BonoboArgType b, CORBA_Environment *opt_ev);
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 Gtk Args and CORBA_anys.
A typical use of the BonoboArg macros would be in
Example 1. Property bag implementation
static void get_prop (BonoboPropertyBag *bag, BonoboArg *arg, guint arg_id, CORBA_Environment *ev, gpointer user_data) { GtkObject *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; } }
typedef CORBA_TypeCode BonoboArgType;
A glib style looking typedef for a CORBA type description.
#define BONOBO_ARG_GET_GENERAL(a,c,t,e)
A macro to extract a value from a BonoboArg with
the given CORBA type t
.
#define BONOBO_ARG_GET_BOOLEAN(a) (BONOBO_ARG_GET_GENERAL (a, TC_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.
#define BONOBO_ARG_GET_INT(a) (BONOBO_ARG_GET_GENERAL (a, TC_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.
#define BONOBO_ARG_GET_LONG(a) (BONOBO_ARG_GET_GENERAL (a, TC_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.
#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
.
#define BONOBO_ARG_GET_FLOAT(a) (BONOBO_ARG_GET_GENERAL (a, TC_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.
#define BONOBO_ARG_GET_DOUBLE(a) (BONOBO_ARG_GET_GENERAL (a, TC_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.
#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
.
#define BONOBO_ARG_SET_BOOLEAN(a,v) (BONOBO_ARG_SET_GENERAL (a, v, TC_boolean, CORBA_boolean, NULL))
This macro sets the value of a
to contain v
#define BONOBO_ARG_SET_INT(a,v) (BONOBO_ARG_SET_GENERAL (a, v, TC_long, CORBA_long, NULL))
This macro sets the value of a
to contain v
#define BONOBO_ARG_SET_LONG(a,v) (BONOBO_ARG_SET_GENERAL (a, v, TC_long, CORBA_long, NULL))
This macro sets the value of a
to contain v
#define BONOBO_ARG_SET_STRING(a,v)
This macro sets the value of a
to contain a
duplicated copy of v
#define BONOBO_ARG_SET_FLOAT(a,v) (BONOBO_ARG_SET_GENERAL (a, v, TC_float, CORBA_float, NULL))
This macro sets the value of a
to contain v
#define BONOBO_ARG_SET_DOUBLE(a,v) (BONOBO_ARG_SET_GENERAL (a, v, TC_double, CORBA_double, NULL))
This macro sets the value of a
to contain v
gboolean bonobo_arg_is_equal (BonoboArg *a, BonoboArg *b, CORBA_Environment *opt_ev);
<<< bonobo-arg |