1 /* $Id: SliderP.h,v 1.3 2000/01/18 20:40:05 falk Exp $
2  *
3  * SliderP.h - Private definitions for Slider widget
4  *
5  */
6 
7 #ifndef _MwSliderP_h
8 #define _MwSliderP_h
9 
10 /***********************************************************************
11  *
12  * Slider Widget Private Data
13  *
14  ***********************************************************************/
15 
16 #include <X11/IntrinsicP.h>
17 #include "MwSlider.h"
18 
19 typedef	void	(*sliderProc)(MwSliderWidget) ;
20 typedef	void	(*sliderBgProc)(MwSliderWidget, int x, int y, int wid, int hgt);
21 typedef	void	(*sliderMoveProc)(MwSliderWidget, int newpos) ;
22 typedef	void	(*sliderPrefSize)(MwSliderWidget, Dimension *, Dimension *,
23 			Dimension *, Dimension *) ;
24 
25 /* programming note:  The convention is to define these as _XtInherit, but
26  * since NULL is not permitted in the class structure, things work out
27  * better if I do it this way.
28  */
29 
30 #define	XtInheritDrawBorder	NULL
31 #define	XtInheritDrawBackground	NULL
32 #define	XtInheritDrawThumb	NULL
33 #define	XtInheritMoveThumb	NULL
34 #define	XtInheritFocusProc	NULL
35 #define	XtInheritPreferredSize	NULL
36 
37 
38 
39 /* New fields for the Slider widget class record */
40 typedef struct {
41     sliderProc	draw_border ;
42     sliderBgProc draw_background ;
43     sliderProc	draw_thumb ;
44     sliderMoveProc move_thumb ;
45     sliderProc	focus_proc ;
46     sliderPrefSize preferred_size ;
47     XtPointer	extension;
48 } MwSliderClassPart;
49 
50 /* Full class record declaration */
51 typedef struct _MwSliderClassRec {
52     CoreClassPart	core_class;
53     MwSliderClassPart	slider_class;
54 } MwSliderClassRec;
55 
56 extern MwSliderClassRec mwSliderClassRec;
57 
58 
59 
60 /****************************************************************
61  *
62  * instance record declaration
63  *
64  ****************************************************************/
65 
66 /* New fields for the Slider widget record */
67 typedef struct {
68     /* resources */
69     XFontStruct	*font ;
70     Pixel	foreground ;
71     int		minimum, maximum, value ;
72     int		step, step2 ;
73     XtOrientation orientation ;
74     short	decimalPoints ;
75     short	inputScale ;
76     short	thumbLength ;
77     Boolean	showValue ;
78     Boolean	autoScale ;
79     XtCallbackList dragCallback ;
80     XtCallbackList valueChangedCallback ;
81     short	shadowWidth ;
82     short	top_contrast ;
83     short	bot_contrast ;
84     short	arm_contrast ;
85     short	insensitive_contrast ;
86     Boolean	be_nice_to_cmap ;
87 
88     /* private state */
89     Boolean	needs_layout ;
90     Boolean	has_focus ;
91     GC		foregroundGC ;
92     GC		backgroundGC ;
93     GC		greyGC ;
94     GC		topGC ;
95     GC		botGC ;
96     Pixmap	grey50 ;		/* TODO: cache this elsewhere */
97     int		oldvalue ;
98     short	start ;			/* first pixel thumb may occupy */
99     short	length ;		/* working length */
100     short	thumbpos ;
101     short	adjustPt ;
102     short	thumbWidth ;
103     Boolean	adjusting ;
104     XtPointer	extension ;
105 } MwSliderPart;
106 
107 
108 typedef struct _MwSliderRec {
109     CorePart	core;
110     MwSliderPart	slider;
111 } MwSliderRec;
112 
113 
114 
115 	/* internals */
116 
117 #define	SliderClass(w)	((MwSliderWidgetClass)(w)->core.widget_class)
118 
119 
120 _XFUNCPROTOBEGIN
121 extern	void
122 _MwSliderThumb(
123 #if NeedFunctionPrototypes
124 	MwSliderWidget sw,
125 	int	*x,
126 	int	*y,
127 	int	*wid,
128 	int	*hgt
129 #endif
130 ) ;
131 
132 _XFUNCPROTOEND
133 
134 #endif /* _MwSliderP_h */
135