Mercurial > hg > xemacs-beta
comparison 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 |
comparison
equal
deleted
inserted
replaced
4521:383ab474a241 | 4522:fc7067b7f407 |
---|---|
51 #include <ctype.h> | 51 #include <ctype.h> |
52 #include <X11/IntrinsicP.h> | 52 #include <X11/IntrinsicP.h> |
53 #include <X11/Xatom.h> | 53 #include <X11/Xatom.h> |
54 #include <X11/StringDefs.h> | 54 #include <X11/StringDefs.h> |
55 #include ATHENA_XawInit_h_ | 55 #include ATHENA_XawInit_h_ |
56 #include "xt-wrappers.h" | |
57 #include "xlwgaugeP.h" | 56 #include "xlwgaugeP.h" |
58 #include "../src/xmu.h" | 57 #include "../src/xmu.h" |
59 #ifdef HAVE_XMU | 58 #ifdef HAVE_XMU |
60 #include <X11/Xmu/Atoms.h> | 59 #include <X11/Xmu/Atoms.h> |
61 #include <X11/Xmu/Drawing.h> | 60 #include <X11/Xmu/Drawing.h> |
76 <Btn2Up>: paste()\n\ | 75 <Btn2Up>: paste()\n\ |
77 <Key>F2: paste(CLIPBOARD)" ; | 76 <Key>F2: paste(CLIPBOARD)" ; |
78 | 77 |
79 | 78 |
80 | 79 |
81 #define offset(field) XtOffsetOf(GaugeRec, gauge.field) | 80 #define offset(field) XtOffsetOf(GaugeRec, field) |
82 #define res(name,_class,intrepr,type,member,extrepr,value) \ | |
83 Xt_RESOURCE (name, _class, intrepr, type, offset(member), extrepr, value) | |
84 static XtResource resources[] = { | 81 static XtResource resources[] = { |
85 res (XtNvalue, XtCValue, XtRInt, int, value, XtRImmediate, 0), | 82 {XtNvalue, XtCValue, XtRInt, sizeof(int), |
86 res (XtNminValue, XtCMinValue, XtRInt, int, v0, XtRImmediate, 0), | 83 offset(gauge.value), XtRImmediate, (XtPointer)0}, |
87 res (XtNmaxValue, XtCMaxValue, XtRInt, int, v1, XtRImmediate, 100), | 84 {XtNminValue, XtCMinValue, XtRInt, sizeof(int), |
88 res (XtNntics, XtCNTics, XtRInt, int, ntics, XtRImmediate, 0), | 85 offset(gauge.v0), XtRImmediate, (XtPointer)0}, |
89 res (XtNnlabels, XtCNLabels, XtRInt, int, nlabels, XtRImmediate, 0), | 86 {XtNmaxValue, XtCMaxValue, XtRInt, sizeof(int), |
90 res (XtNlabels, XtCLabels, XtRStringArray, String *, labels, | 87 offset(gauge.v1), XtRImmediate, (XtPointer)100}, |
91 XtRStringArray, NULL), | 88 {XtNntics, XtCNTics, XtRInt, sizeof(int), |
92 res (XtNautoScaleUp, XtCAutoScaleUp, XtRBoolean, Boolean, autoScaleUp, | 89 offset(gauge.ntics), XtRImmediate, (XtPointer) 0}, |
93 XtRImmediate, FALSE), | 90 {XtNnlabels, XtCNLabels, XtRInt, sizeof(int), |
94 res (XtNautoScaleDown, XtCAutoScaleDown, XtRBoolean, Boolean, | 91 offset(gauge.nlabels), XtRImmediate, (XtPointer) 0}, |
95 autoScaleDown, XtRImmediate, FALSE), | 92 {XtNlabels, XtCLabels, XtRStringArray, sizeof(String *), |
96 res (XtNorientation, XtCOrientation, XtROrientation, XtOrientation, | 93 offset(gauge.labels), XtRStringArray, NULL}, |
97 orientation, XtRImmediate, XtorientHorizontal), | 94 {XtNautoScaleUp, XtCAutoScaleUp, XtRBoolean, sizeof(Boolean), |
98 res (XtNupdate, XtCInterval, XtRInt, int, update, XtRImmediate, 0), | 95 offset(gauge.autoScaleUp), XtRImmediate, FALSE}, |
99 res (XtNgetValue, XtCCallback, XtRCallback, XtPointer, getValue, | 96 {XtNautoScaleDown, XtCAutoScaleDown, XtRBoolean, sizeof(Boolean), |
100 XtRImmediate, NULL), | 97 offset(gauge.autoScaleDown), XtRImmediate, FALSE}, |
98 {XtNorientation, XtCOrientation, XtROrientation, sizeof(XtOrientation), | |
99 offset(gauge.orientation), XtRImmediate, (XtPointer)XtorientHorizontal}, | |
100 {XtNupdate, XtCInterval, XtRInt, sizeof(int), | |
101 offset(gauge.update), XtRImmediate, (XtPointer)0}, | |
102 {XtNgetValue, XtCCallback, XtRCallback, sizeof(XtPointer), | |
103 offset(gauge.getValue), XtRImmediate, (XtPointer)NULL}, | |
101 }; | 104 }; |
102 #undef offset | 105 #undef offset |
103 #undef res | 106 |
104 | 107 |
105 | 108 |
106 /* member functions */ | 109 /* member functions */ |
107 | 110 |
108 static void GaugeClassInit (void); | 111 static void GaugeClassInit (void); |
141 static GC Get_GC (GaugeWidget, Pixel); | 144 static GC Get_GC (GaugeWidget, Pixel); |
142 | 145 |
143 | 146 |
144 static XtActionsRec actionsList[] = | 147 static XtActionsRec actionsList[] = |
145 { | 148 { |
146 { (String) "select", GaugeSelect }, | 149 {"select", GaugeSelect}, |
147 { (String) "paste", GaugePaste }, | 150 {"paste", GaugePaste}, |
148 } ; | 151 } ; |
149 | 152 |
150 | 153 |
151 | 154 |
152 /**************************************************************** | 155 /**************************************************************** |
157 | 160 |
158 GaugeClassRec gaugeClassRec = { | 161 GaugeClassRec gaugeClassRec = { |
159 { | 162 { |
160 /* core_class fields */ | 163 /* core_class fields */ |
161 /* superclass */ (WidgetClass) &labelClassRec, | 164 /* superclass */ (WidgetClass) &labelClassRec, |
162 /* class_name */ (String) "Gauge", | 165 /* class_name */ "Gauge", |
163 /* widget_size */ sizeof(GaugeRec), | 166 /* widget_size */ sizeof(GaugeRec), |
164 /* class_initialize */ GaugeClassInit, | 167 /* class_initialize */ GaugeClassInit, |
165 /* class_part_initialize */ NULL, | 168 /* class_part_initialize */ NULL, |
166 /* class_inited */ FALSE, | 169 /* class_inited */ FALSE, |
167 /* initialize */ GaugeInit, | 170 /* initialize */ GaugeInit, |