X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lwlib%2Fxlwgauge.c;h=7364fd1a845541b23340089ce09f96eaebd481ca;hb=fcaee60f4c186cd2f66a8b1e1b969bcd04e354d9;hp=ffd93ab074a2e7a5ac76d5f3a9c88179177574cc;hpb=762383636a99307282c2d93d26c35c046ec24da1;p=chise%2Fxemacs-chise.git.1 diff --git a/lwlib/xlwgauge.c b/lwlib/xlwgauge.c index ffd93ab..7364fd1 100644 --- a/lwlib/xlwgauge.c +++ b/lwlib/xlwgauge.c @@ -1,4 +1,4 @@ -/* Gauge Widget for XEmacs. +/* Gauge Widget for XEmacs. Copyright (C) 1999 Edward A. Falk This file is part of XEmacs. @@ -25,7 +25,7 @@ Boston, MA 02111-1307, USA. */ * * Author: Edward A. Falk * falk@falconer.vip.best.com - * + * * Date: July 9, 1997 * * Note: for fun and demonstration purposes, I have added selection @@ -132,14 +132,14 @@ static void EnableUpdate (GaugeWidget); static void DisableUpdate (GaugeWidget); static void GaugeGetValue (XtPointer, XtIntervalId *); -static void GaugeMercury (Display *, Window, GC, GaugeWidget, Cardinal, Cardinal); +static void GaugeMercury (Display *, Window, GC, GaugeWidget, int, int); static Boolean GaugeConvert (Widget, Atom *, Atom *, Atom *, - XtPointer *, u_long *, int *); + XtPointer *, unsigned long *, int *); static void GaugeLoseSel (Widget, Atom *); static void GaugeDoneSel (Widget, Atom *, Atom *); static void GaugeGetSelCB (Widget, XtPointer, Atom *, Atom *, - XtPointer, u_long *, int *); + XtPointer, unsigned long *, int *); static GC Get_GC (GaugeWidget, Pixel); @@ -160,7 +160,7 @@ static XtActionsRec actionsList[] = GaugeClassRec gaugeClassRec = { { -/* core_class fields */ +/* core_class fields */ /* superclass */ (WidgetClass) &labelClassRec, /* class_name */ "Gauge", /* widget_size */ sizeof(GaugeRec), @@ -334,7 +334,7 @@ GaugeResize (Widget w) } else { - gw->gauge.margin0 = + gw->gauge.margin0 = gw->gauge.margin1 = lh / 2 ; size += lwm + vmargin ; } @@ -404,7 +404,7 @@ register Window win = XtWindow(w) ; } /* if the gauge is selected, signify by drawing the background - * in a constrasting color. + * in a contrasting color. */ if( gw->gauge.selected ) @@ -540,7 +540,7 @@ GaugeSetValues (Widget old, else GaugeResize(new) ; } - + if( gw->gauge.update != oldgw->gauge.update ) { if( gw->gauge.update > 0 ) @@ -636,7 +636,7 @@ GaugeConvert (Widget w, Atom *target, /* requested target */ Atom *type, /* returned type */ XtPointer *value, /* returned value */ - u_long *length, /* returned length */ + unsigned long *length, /* returned length */ int *format) /* returned format */ { GaugeWidget gw = (GaugeWidget)w ; @@ -650,7 +650,7 @@ GaugeConvert (Widget w, if( *target == XA_TARGETS(XtDisplay(w)) ) { Atom *rval, *stdTargets ; - u_long stdLength ; + unsigned long stdLength ; /* XmuConvertStandardSelection can handle this. This function * will return a list of standard targets. We prepend TEXT, @@ -674,7 +674,7 @@ GaugeConvert (Widget w, return True ; } - else + else #endif if( *target == XA_INTEGER ) { @@ -685,10 +685,10 @@ GaugeConvert (Widget w, return True ; } - else if( *target == XA_STRING + else if( *target == XA_STRING #ifdef HAVE_XMU - || - *target == XA_TEXT(XtDisplay(w)) + || + *target == XA_TEXT(XtDisplay(w)) #endif ) { @@ -707,7 +707,7 @@ GaugeConvert (Widget w, if( XmuConvertStandardSelection(w, req->time, selection, target, type, (XPointer *) value, length, format) ) return True ; - else + else #endif { printf( @@ -774,7 +774,7 @@ GaugeGetSelCB (Widget w, Atom *selection, Atom *type, XtPointer value, - u_long *length, + unsigned long *length, int *format) { Display *dpy = XtDisplay(w) ; @@ -787,12 +787,12 @@ GaugeGetSelCB (Widget w, XawGaugeSetValue(w, *iptr) ; } - else if( *type == XA_STRING + else if( *type == XA_STRING #ifdef HAVE_XMU || - *type == XA_TEXT(dpy) + *type == XA_TEXT(dpy) #endif - ) + ) { cptr = (char *)value ; XawGaugeSetValue(w, atoi(cptr)) ; @@ -819,8 +819,7 @@ GaugeGetSelCB (Widget w, */ void -XawGaugeSetValue (Widget w, - Cardinal value) +XawGaugeSetValue (Widget w, int value) { GaugeWidget gw = (GaugeWidget)w ; int oldvalue ; @@ -852,7 +851,7 @@ XawGaugeSetValue (Widget w, } -Cardinal +int XawGaugeGetValue (Widget w) { GaugeWidget gw = (GaugeWidget)w ; @@ -875,8 +874,8 @@ GaugeMercury (Display *dpy, Window win, GC gc, GaugeWidget gw, - Cardinal val0, - Cardinal val1) + int val0, + int val1) { int v0 = gw->gauge.v0 ; int v1 = gw->gauge.v1 ; @@ -1110,7 +1109,7 @@ GaugeGetValue (XtPointer clientData, XtIntervalId *intervalId) { GaugeWidget gw = (GaugeWidget)clientData ; - Cardinal value ; + int value ; if( gw->gauge.update > 0 ) EnableUpdate(gw) ;