1 /* $XConsortium: ClockP.h /main/4 1996/10/16 16:57:08 drk $ */
2 /**---------------------------------------------------------------------
6 *** project: MotifPlus Widgets
8 *** description: Private include file for DtClock class.
9 *** Portions adapted from the Xaw Clock widget.
12 *** (c) Copyright 1990 by Hewlett-Packard Company.
15 Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts,
16 and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
20 Permission to use, copy, modify, and distribute this software and its
21 documentation for any purpose and without fee is hereby granted,
22 provided that the above copyright notice appear in all copies and that
23 both that copyright notice and this permission notice appear in
24 supporting documentation, and that the names of Digital or MIT not be
25 used in advertising or publicity pertaining to distribution of the
26 software without specific, written prior permission.
28 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
29 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
30 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
31 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
32 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
33 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
37 ***-------------------------------------------------------------------*/
44 #include <Dt/ControlP.h>
47 #define SEG_BUFF_SIZE 128
48 #define ASCII_TIME_BUFLEN 32 /* big enough for 26 plus slop */
52 /*-------------------------------------------------------------
58 typedef struct _DtClockClassPart
60 XmCacheClassPartPtr cache_part;
66 typedef struct _DtClockClassRec
68 RectObjClassPart rect_class;
69 XmGadgetClassPart gadget_class;
70 DtIconClassPart icon_class;
71 DtControlClassPart control_class;
72 DtClockClassPart clock_class;
77 extern DtClockClassRec dtClockClassRec;
81 /*-------------------------------------------------------------
87 typedef struct _DtClockPart
89 int update; /* update frequence */
90 Dimension radius; /* radius factor */
91 int backing_store; /* backing store type */
92 Boolean reverse_video;
95 Dimension tick_spacing;
96 Dimension minute_hand_length;
97 Dimension hour_hand_length;
102 XPoint segbuff[SEG_BUFF_SIZE];
107 XtIntervalId interval_id;
108 char prev_time_string[ASCII_TIME_BUFLEN];
112 GC clock_background_gc;
114 Dimension left_inset;
115 Dimension right_inset;
117 Dimension bottom_inset;
118 Dimension clock_width;
119 Dimension clock_height;
122 /* Full Instance Record
124 typedef struct _DtClockRec
127 RectObjPart rectangle;
130 DtControlPart control;
136 /*-------------------------------------------------------------
137 ** Class and Instance Macros
140 /* DtClock Class Macros
143 /* DtClock Instance Macros
145 #define G_ClockInterval(g) (g -> clock.clock_interval)
146 #define G_ClockHandGC(g) (g -> clock.clock_hand_gc)
147 #define G_ClockBackgroundGC(g) (g -> clock.clock_background_gc)
148 #define G_ClockHandPixel(g) (g -> icon.pixmap_foreground)
149 #define G_ClockBackground(g) (g -> icon.pixmap_background)
150 #define G_ClockWidth(g) (g -> clock.clock_width)
151 #define G_ClockHeight(g) (g -> clock.clock_height)
152 #define G_LeftInset(g) (g -> clock.left_inset)
153 #define G_RightInset(g) (g -> clock.right_inset)
154 #define G_TopInset(g) (g -> clock.top_inset)
155 #define G_BottomInset(g) (g -> clock.bottom_inset)
158 #endif /* _DtClockP_h */
161 /* DON'T ADD ANYTHING AFTER THIS #endif */