static MString get_tip_of_the_day(Widget w, int n) { struct tip_of_the_day_resource_values { XmString tip; }; const string tip_name = "tip" + itostring(n); XtResource r; r.resource_name = XTRESSTR(tip_name.chars()); r.resource_class = XTRESSTR("Tip"); r.resource_type = XmRXmString; r.resource_size = sizeof(XmString); r.resource_offset = XtOffsetOf(tip_of_the_day_resource_values, tip); r.default_type = XtRImmediate; r.default_addr = XtPointer(0); tip_of_the_day_resource_values values; XtGetApplicationResources(w, &values, &r, 1, ArgList(0), 0); return MString(values.tip, true); }
static void PannerCB(Widget w, XtPointer client_data, XtPointer call_data); // Method function declarations extern "C" { static void Resize(Widget w); } // Resource list static XtResource resources[] = { #define offset(field) XtOffsetOf(PannedGraphEditRec, pannedGraphEdit.field) // {name, class, type, size, offset, default_type, default_addr} { XTRESSTR(XtNminimumPannerWidth), XTRESSTR(XtCMinimumPannerWidth), XtRDimension, sizeof(Dimension), offset(minimumPannerWidth), XtRImmediate, XtPointer(50) }, { XTRESSTR(XtNminimumPannerHeight), XTRESSTR(XtCMinimumPannerHeight), XtRDimension, sizeof(Dimension), offset(minimumPannerHeight), XtRImmediate, XtPointer(50) }, { XTRESSTR(XtNmaximumScale), XTRESSTR(XtCMaximumScale), XtRDimension, sizeof(Dimension), offset(maximumScale), XtRImmediate, XtPointer(33) } #undef offset }; // Class record initialization
#include <stdlib.h> #include <ctype.h> #include <X11/StringDefs.h> #include <X11/Xlib.h> #include <Xm/DrawingA.h> // Data struct plot_resource_values { String font; int pointsize; }; static XtResource plot_subresources[] = { { XTRESSTR("font"), XTRESSTR("Font"), XtRString, sizeof(String), XtOffsetOf(plot_resource_values, font), XtRImmediate, XtPointer("fixed") }, { XTRESSTR("pointsize"), XTRESSTR("Pointsize"), XtRInt, sizeof(int), XtOffsetOf(plot_resource_values, pointsize), XtRImmediate, XtPointer(1)
static GC _topShadowGC(XmLabelWidget _label); static GC _bottomShadowGC(XmLabelWidget _label); #define CORE(w) ((w)->core) #define PRIM(w) ((w)->primitive) #define MANAGER(w) ((w)->manager) #define LABEL(w) ((w)->label) #define HACK(w) ((w)->label_hack) #define HACK_CLASS(w) ((w)->label_hack_class) #define TheOffset(field) XtOffset(XmLabelHackWidget, label_hack.field) //#define PrimOffset(field) XtOffset(XmLabelHackWidget, primitive.field) static XtResource resources[] = { {XTRESSTR(XmNinsensitive3D), XTRESSTR(XmCInsensitive3D), XmRBoolean, sizeof(Boolean), TheOffset(insensitive3D), XmRImmediate, (XtPointer)TRUE}, }; #if XmVersion < 1002 // Motif 1.1 backwards compatibility #ifndef XmInheritBorderHighlight #define XmInheritBorderHighlight (XtWidgetProc)_XtInherit #endif #ifndef XmInheritBorderUnhighlight #define XmInheritBorderUnhighlight (XtWidgetProc)_XtInherit #endif #ifndef XmInheritArmAndActivate #define XmInheritArmAndActivate (XmArmAndActivate)_XtInherit