Initial git import
[sxemacs] / src / ui / lwlib / xlwgaugeP.h
1 /* Gauge Widget for SXEmacs. 
2    Copyright (C) 1999 Edward A. Falk
3
4 This file is part of SXEmacs.
5
6 SXEmacs is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 SXEmacs is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program.  If not, see <http://www.gnu.org/licenses/>. */
18
19 /*
20  * GaugeP.h - Gauge widget
21  *
22  * Author: Edward A. Falk
23  *         falk@falconer.vip.best.com
24  *  
25  * Date:   July 9, 1997
26  */
27
28 #ifndef _XawGaugeP_h
29 #define _XawGaugeP_h
30
31 /***********************************************************************
32  *
33  * Gauge Widget Private Data
34  *
35  * Gauge has little in common with the label widget, but can make use
36  * of some label resources, so is subclassed from label.
37  *
38  ***********************************************************************/
39
40 #include "xlwgauge.h"
41 #include ATHENA_LabelP_h_
42
43 /* New fields for the Gauge widget class record */
44
45 typedef struct {
46         XtPointer extension;
47 } GaugeClassPart;
48
49 /* Full class record declaration */
50 typedef struct _GaugeClassRec {
51         CoreClassPart core_class;
52         SimpleClassPart simple_class;
53 #ifdef  _ThreeDP_h
54         ThreeDClassPart threeD_class;
55 #endif
56         LabelClassPart label_class;
57         GaugeClassPart gauge_class;
58 } GaugeClassRec;
59
60 extern GaugeClassRec gaugeClassRec;
61
62 /* New fields for the Gauge widget record */
63 typedef struct {
64         /* resources */
65         int value, v0, v1;
66         int ntics, nlabels;
67         String *labels;
68         XtOrientation orientation;
69         Boolean autoScaleUp;    /* scales automatically */
70         Boolean autoScaleDown;  /* scales automatically */
71         int update;             /* update interval */
72         XtCallbackList getValue;        /* proc to call to fetch a point */
73
74         /* private state */
75         Dimension gmargin;      /* edges <-> gauge */
76         Dimension tmargin;      /* top (left) edge <-> tic marks */
77         Dimension lmargin;      /* tic marks <-> labels */
78         Dimension margin0;      /* left/bottom margin */
79         Dimension margin1;      /* right/top margin */
80         XtIntervalId intervalId;
81         Atom selected;
82         String selstr;          /* selection string, if any */
83         GC inverse_GC;
84 } GaugePart;
85
86 /****************************************************************
87  *
88  * Full instance record declaration
89  *
90  ****************************************************************/
91
92 typedef struct _GaugeRec {
93         CorePart core;
94         SimplePart simple;
95 #ifdef  _ThreeDP_h
96         ThreeDPart threeD;
97 #endif
98         LabelPart label;
99         GaugePart gauge;
100 } GaugeRec;
101
102 #endif                          /* _XawGaugeP_h */