Mercurial > hg > xemacs-beta
comparison lwlib/xlwgauge.c @ 4528:726060ee587c g++-warning-removal-2008-10-28
First draft of g++ 4.3 warning removal patch. Builds. *Needs ChangeLogs.*
author | Stephen J. Turnbull <stephen@xemacs.org> |
---|---|
date | Wed, 29 Oct 2008 04:06:33 +0900 |
parents | fc7067b7f407 |
children | 5460287a3327 |
comparison
equal
deleted
inserted
replaced
4524:03ba50f7ecd7 | 4528:726060ee587c |
---|---|
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" | |
56 #include "xlwgaugeP.h" | 57 #include "xlwgaugeP.h" |
57 #include "../src/xmu.h" | 58 #include "../src/xmu.h" |
58 #ifdef HAVE_XMU | 59 #ifdef HAVE_XMU |
59 #include <X11/Xmu/Atoms.h> | 60 #include <X11/Xmu/Atoms.h> |
60 #include <X11/Xmu/Drawing.h> | 61 #include <X11/Xmu/Drawing.h> |
75 <Btn2Up>: paste()\n\ | 76 <Btn2Up>: paste()\n\ |
76 <Key>F2: paste(CLIPBOARD)" ; | 77 <Key>F2: paste(CLIPBOARD)" ; |
77 | 78 |
78 | 79 |
79 | 80 |
80 #define offset(field) XtOffsetOf(GaugeRec, field) | 81 #define offset(field) XtOffsetOf(GaugeRec, gauge.field) |
82 #define res(name,_class,intrepr,type,member,extrepr,value) \ | |
83 Xt_RESOURCE (name, _class, intrepr, type, offset(member), extrepr, value) | |
81 static XtResource resources[] = { | 84 static XtResource resources[] = { |
82 {XtNvalue, XtCValue, XtRInt, sizeof(int), | 85 res (XtNvalue, XtCValue, XtRInt, int, value, XtRImmediate, 0), |
83 offset(gauge.value), XtRImmediate, (XtPointer)0}, | 86 res (XtNminValue, XtCMinValue, XtRInt, int, v0, XtRImmediate, 0), |
84 {XtNminValue, XtCMinValue, XtRInt, sizeof(int), | 87 res (XtNmaxValue, XtCMaxValue, XtRInt, int, v1, XtRImmediate, 100), |
85 offset(gauge.v0), XtRImmediate, (XtPointer)0}, | 88 res (XtNntics, XtCNTics, XtRInt, int, ntics, XtRImmediate, 0), |
86 {XtNmaxValue, XtCMaxValue, XtRInt, sizeof(int), | 89 res (XtNnlabels, XtCNLabels, XtRInt, int, nlabels, XtRImmediate, 0), |
87 offset(gauge.v1), XtRImmediate, (XtPointer)100}, | 90 res (XtNlabels, XtCLabels, XtRStringArray, String *, labels, |
88 {XtNntics, XtCNTics, XtRInt, sizeof(int), | 91 XtRStringArray, NULL), |
89 offset(gauge.ntics), XtRImmediate, (XtPointer) 0}, | 92 res (XtNautoScaleUp, XtCAutoScaleUp, XtRBoolean, Boolean, autoScaleUp, |
90 {XtNnlabels, XtCNLabels, XtRInt, sizeof(int), | 93 XtRImmediate, FALSE), |
91 offset(gauge.nlabels), XtRImmediate, (XtPointer) 0}, | 94 res (XtNautoScaleDown, XtCAutoScaleDown, XtRBoolean, Boolean, |
92 {XtNlabels, XtCLabels, XtRStringArray, sizeof(String *), | 95 autoScaleDown, XtRImmediate, FALSE), |
93 offset(gauge.labels), XtRStringArray, NULL}, | 96 res (XtNorientation, XtCOrientation, XtROrientation, XtOrientation, |
94 {XtNautoScaleUp, XtCAutoScaleUp, XtRBoolean, sizeof(Boolean), | 97 orientation, XtRImmediate, XtorientHorizontal), |
95 offset(gauge.autoScaleUp), XtRImmediate, FALSE}, | 98 res (XtNupdate, XtCInterval, XtRInt, int, update, XtRImmediate, 0), |
96 {XtNautoScaleDown, XtCAutoScaleDown, XtRBoolean, sizeof(Boolean), | 99 res (XtNgetValue, XtCCallback, XtRCallback, XtPointer, getValue, |
97 offset(gauge.autoScaleDown), XtRImmediate, FALSE}, | 100 XtRImmediate, NULL), |
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}, | |
104 }; | 101 }; |
105 #undef offset | 102 #undef offset |
106 | 103 #undef res |
107 | 104 |
108 | 105 |
109 /* member functions */ | 106 /* member functions */ |
110 | 107 |
111 static void GaugeClassInit (void); | 108 static void GaugeClassInit (void); |
144 static GC Get_GC (GaugeWidget, Pixel); | 141 static GC Get_GC (GaugeWidget, Pixel); |
145 | 142 |
146 | 143 |
147 static XtActionsRec actionsList[] = | 144 static XtActionsRec actionsList[] = |
148 { | 145 { |
149 {"select", GaugeSelect}, | 146 { (String) "select", GaugeSelect }, |
150 {"paste", GaugePaste}, | 147 { (String) "paste", GaugePaste }, |
151 } ; | 148 } ; |
152 | 149 |
153 | 150 |
154 | 151 |
155 /**************************************************************** | 152 /**************************************************************** |
160 | 157 |
161 GaugeClassRec gaugeClassRec = { | 158 GaugeClassRec gaugeClassRec = { |
162 { | 159 { |
163 /* core_class fields */ | 160 /* core_class fields */ |
164 /* superclass */ (WidgetClass) &labelClassRec, | 161 /* superclass */ (WidgetClass) &labelClassRec, |
165 /* class_name */ "Gauge", | 162 /* class_name */ (String) "Gauge", |
166 /* widget_size */ sizeof(GaugeRec), | 163 /* widget_size */ sizeof(GaugeRec), |
167 /* class_initialize */ GaugeClassInit, | 164 /* class_initialize */ GaugeClassInit, |
168 /* class_part_initialize */ NULL, | 165 /* class_part_initialize */ NULL, |
169 /* class_inited */ FALSE, | 166 /* class_inited */ FALSE, |
170 /* initialize */ GaugeInit, | 167 /* initialize */ GaugeInit, |