EZ
Up Prev Next Contents


2.7 Application Resources

EZwgl provides a very limited support for application resources. In particular, there is no automatic type conversion facility as seen in Xt. As a result, in order to set application variables from resources, the application writer must provide ways to convert resource values (strings) to the desired data types.

Nevertheless, EZwgl includes a few functions that may be helpful for those who wants to use application resources.

One special data type is introduced for the purpose of doing simple type conversions.

typedef struct EZ_Value_ int type; /* value type: EZ_INT, EZ_FLOAT, EZ_POINTER, EZ_ULONG */ union int i; float f; void *p; unsigned long l; value; EZ_Value;

The few relevent functions are:

There are also four pairs of convenience routines for EZ_InstallSymbol, then are

int   EZ_InstallSymbolicInt       (char *name, int value);
int   EZ_RetrieveSymbolicInt      (char *name, int *value_ret);

int   EZ_InstallSymbolicFloat     (char *name, float value);
int   EZ_RetrieveSymbolicFloat    (char *name, float *value_ret);

int   EZ_InstallSymbolicPointer   (char *name, void *value);
int   EZ_RetrieveSymbolicPointer  (char *name, void **value_ret);

int   EZ_InstallSymbolicULong     (char *name, unsigned long value);
int   EZ_RetrieveSymbolicULong    (char *name, unsigned long *value_ret);


HTML Documentation Maintainance:Arturo Espinosa <arturo@nuclecu.unam.mx>