diff lwlib/xlwgauge.c @ 4522:fc7067b7f407

Backout last patch; forgot to specify file.
author Stephen J. Turnbull <stephen@xemacs.org>
date Wed, 29 Oct 2008 03:37:16 +0900
parents 383ab474a241
children 726060ee587c
line wrap: on
line diff
--- a/lwlib/xlwgauge.c	Tue Oct 28 10:38:26 2008 +0900
+++ b/lwlib/xlwgauge.c	Wed Oct 29 03:37:16 2008 +0900
@@ -53,7 +53,6 @@
 #include <X11/Xatom.h>
 #include <X11/StringDefs.h>
 #include ATHENA_XawInit_h_
-#include "xt-wrappers.h"
 #include "xlwgaugeP.h"
 #include "../src/xmu.h"
 #ifdef HAVE_XMU
@@ -78,29 +77,33 @@
 
 
 
-#define offset(field) XtOffsetOf(GaugeRec, gauge.field)
-#define res(name,_class,intrepr,type,member,extrepr,value) \
-  Xt_RESOURCE (name, _class, intrepr, type, offset(member), extrepr, value)
+#define offset(field) XtOffsetOf(GaugeRec, field)
 static XtResource resources[] = {
-    res (XtNvalue, XtCValue, XtRInt, int, value, XtRImmediate, 0),
-    res (XtNminValue, XtCMinValue, XtRInt, int, v0, XtRImmediate, 0),
-    res (XtNmaxValue, XtCMaxValue, XtRInt, int, v1, XtRImmediate, 100),
-    res (XtNntics, XtCNTics, XtRInt, int, ntics, XtRImmediate,  0),
-    res (XtNnlabels, XtCNLabels, XtRInt, int, nlabels, XtRImmediate,  0),
-    res (XtNlabels, XtCLabels, XtRStringArray, String *, labels,
-	 XtRStringArray, NULL),
-    res (XtNautoScaleUp, XtCAutoScaleUp, XtRBoolean, Boolean, autoScaleUp,
-	 XtRImmediate, FALSE),
-    res (XtNautoScaleDown, XtCAutoScaleDown, XtRBoolean, Boolean,
-	 autoScaleDown, XtRImmediate, FALSE),
-    res (XtNorientation, XtCOrientation, XtROrientation, XtOrientation,
-	 orientation, XtRImmediate, XtorientHorizontal),
-    res (XtNupdate, XtCInterval, XtRInt, int, update, XtRImmediate, 0),
-    res (XtNgetValue, XtCCallback, XtRCallback, XtPointer, getValue,
-	 XtRImmediate, NULL),
+    {XtNvalue, XtCValue, XtRInt, sizeof(int),
+	offset(gauge.value), XtRImmediate, (XtPointer)0},
+    {XtNminValue, XtCMinValue, XtRInt, sizeof(int),
+	offset(gauge.v0), XtRImmediate, (XtPointer)0},
+    {XtNmaxValue, XtCMaxValue, XtRInt, sizeof(int),
+	offset(gauge.v1), XtRImmediate, (XtPointer)100},
+    {XtNntics, XtCNTics, XtRInt, sizeof(int),
+	offset(gauge.ntics), XtRImmediate, (XtPointer) 0},
+    {XtNnlabels, XtCNLabels, XtRInt, sizeof(int),
+	offset(gauge.nlabels), XtRImmediate, (XtPointer) 0},
+    {XtNlabels, XtCLabels, XtRStringArray, sizeof(String *),
+	offset(gauge.labels), XtRStringArray, NULL},
+    {XtNautoScaleUp, XtCAutoScaleUp, XtRBoolean, sizeof(Boolean),
+	offset(gauge.autoScaleUp), XtRImmediate, FALSE},
+    {XtNautoScaleDown, XtCAutoScaleDown, XtRBoolean, sizeof(Boolean),
+	offset(gauge.autoScaleDown), XtRImmediate, FALSE},
+    {XtNorientation, XtCOrientation, XtROrientation, sizeof(XtOrientation),
+	offset(gauge.orientation), XtRImmediate, (XtPointer)XtorientHorizontal},
+    {XtNupdate, XtCInterval, XtRInt, sizeof(int),
+	offset(gauge.update), XtRImmediate, (XtPointer)0},
+    {XtNgetValue, XtCCallback, XtRCallback, sizeof(XtPointer),
+	offset(gauge.getValue), XtRImmediate, (XtPointer)NULL},
 };
 #undef offset
-#undef res
+
 
 
 	/* member functions */
@@ -143,8 +146,8 @@
 
 static	XtActionsRec	actionsList[] =
 {
-  { (String) "select",	GaugeSelect },
-  { (String) "paste",	GaugePaste },
+  {"select",	GaugeSelect},
+  {"paste",	GaugePaste},
 } ;
 
 
@@ -159,7 +162,7 @@
   {
 /* core_class fields */
     /* superclass	  	*/	(WidgetClass) &labelClassRec,
-    /* class_name	  	*/	(String) "Gauge",
+    /* class_name	  	*/	"Gauge",
     /* widget_size	  	*/	sizeof(GaugeRec),
     /* class_initialize   	*/	GaugeClassInit,
     /* class_part_initialize	*/	NULL,