1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
|
/************************************************************************/
/* */
/* Translation of GUI Resource primitives to the actual implementing */
/* GUI system. As we do not have the pretentence to introduce our own */
/* GUI layer, as much as possible is done through macros. (#defines) */
/* */
/************************************************************************/
# ifndef APP_GUI_RESOURCE_H
# define APP_GUI_RESOURCE_H
# ifdef USE_GTK
# include <gtk/gtk.h>
# endif
# ifdef USE_MOTIF
# include <X11/Xlib.h>
# include <X11/Intrinsic.h>
# endif
/************************************************************************/
/* */
/* Resource table entries. In order no to complicate things, all */
/* values are strings. No attempt to make a fully generalised */
/* abstracted universal solution for calling strtol() or strtod() */
/* occasionally is made. */
/* */
/************************************************************************/
# ifdef USE_GTK
typedef struct AppConfigurableResource
{
const char * acrResourceName;
unsigned int acrStructOffset;
const char * acrDefaultValue;
} AppConfigurableResource;
# define APP_RESOURCE( x, o, d ) \
{ (x), (o), (d) }
# define APP_SET_RESOURCE( acr, x, o, d ) \
{ \
(acr)->acrResourceName= (x); \
(acr)->acrStructOffset= (o); \
(acr)->acrDefaultValue= (d); \
}
# endif
# ifdef USE_MOTIF
typedef XtResource AppConfigurableResource;
# define APP_RESOURCE( x, o, d ) \
{ \
(x),(x), \
XtRString, sizeof(char *), \
(o), \
XtRString, (d), \
}
# define APP_SET_RESOURCE( acr, x, o, d ) \
{ \
(acr)->resource_name= (x); \
(acr)->resource_class= (x); \
(acr)->resource_type= XtRString; \
(acr)->resource_size= sizeof(char *); \
(acr)->resource_offset= (o); \
(acr)->default_type= XtRString; \
(acr)->default_addr= (d); \
}
# endif
# endif /* APP_GUI_RESOURCE_H */
|