1 /******************************************************************* 2 FILE: BarGrafP.h 3 CONTENTS: Private definitions for the BarGraph widget. 4 AUTHOR: Paul D. Johnston 5 HISTORY: 6 Date Action 7 --------- ------------------------------------ 8 4/15/91 Created. 9 10 ********************************************************************/ 11 12 #ifndef BARGRAPHP_H 13 #define BARGRAPHP_H 14 15 /* 16 * Include the superclass private headers. 17 */ 18 #include <X11/CoreP.h> 19 #include <X11/Xc/Xc.h> 20 #include <X11/Xc/ValueP.h> 21 22 /* 23 * Include this widget class public header. 24 */ 25 #include <X11/Xc/BarGraf.h> 26 27 28 /* Private declarations and definitions. */ 29 #define MIN_BG_WIDTH 50 30 #define MIN_BG_HEIGHT 90 31 #define MAX_BG_WIDTH 150 32 #define MAX_BG_HEIGHT 300 33 34 /* Max number of Scale segments. */ 35 #define MIN_SCALE_SEGS 0 36 #define MAX_SCALE_SEGS 20 37 38 39 /* 40 * Class part. 41 */ 42 typedef struct 43 { 44 int dummy; /* Minimum of one member required. */ 45 } BarGraphClassPart; 46 47 /* 48 * Class record. 49 */ 50 typedef struct _BarGraphClassRec 51 { 52 CoreClassPart core_class; 53 ControlClassPart control_class; 54 ValueClassPart value_class; 55 BarGraphClassPart barGraph_class; 56 } BarGraphClassRec; 57 58 /* 59 * Declare the widget class record as external for use in the widget source 60 * file. 61 */ 62 extern BarGraphClassRec barGraphClassRec; 63 64 65 66 /* 67 * Instance part. 68 */ 69 typedef struct 70 { 71 /* Public instance variables. */ 72 XcOrient orient; /* BarGraph's orientation: vertical 73 * or horizontal. 74 */ 75 int interval; /* Time interval for updateCallback */ 76 XtCallbackList update_callback; /* The updateCallback function. */ 77 Pixel bar_background; /* Background color of the bar. */ 78 Pixel bar_foreground; /* Foreground color of the bar. */ 79 Pixel scale_pixel; /* Color of the Scale indicator. */ 80 int num_segments; /* Number of segments in the Scale */ 81 Boolean value_visible; /* Enable/Disable display of the 82 * value in the Value Box. 83 */ 84 85 /* Private instance variables. */ 86 XRectangle face; /* Geometry of the BarGraph face */ 87 XPoint lbl; /* Location of the Label string */ 88 XRectangle bar; /* Rectangle for the Bar indicator. */ 89 XSegment scale_line; /* Scale line along Bar indicator. */ 90 XPoint segs[MAX_SCALE_SEGS+1]; /* Line segments for the Scale. */ 91 int seg_length; /* Length of Scale line segments. */ 92 XPoint max_val; /* Point at which to draw the max 93 * value string on the Scale. 94 */ 95 XPoint min_val; /* Point at which to draw the min 96 * value string on the Scale. 97 */ 98 int interval_id; /* Xt TimeOut interval ID. */ 99 100 } BarGraphPart; 101 102 /* 103 * Instance record. 104 */ 105 typedef struct _BarGraphRec 106 { 107 CorePart core; 108 ControlPart control; 109 ValuePart value; 110 BarGraphPart barGraph; 111 } BarGraphRec; 112 113 114 /* Declare widget class functions here. */ 115 116 117 #endif /* BARGRAPHP_H */ 118 119