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