2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /* $XConsortium: ClockP.h /main/4 1996/10/16 16:57:08 drk $ */
24 /**---------------------------------------------------------------------
28 *** project: MotifPlus Widgets
30 *** description: Private include file for DtClock class.
31 *** Portions adapted from the Xaw Clock widget.
34 *** (c) Copyright 1990 by Hewlett-Packard Company.
37 Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts,
38 and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
42 Permission to use, copy, modify, and distribute this software and its
43 documentation for any purpose and without fee is hereby granted,
44 provided that the above copyright notice appear in all copies and that
45 both that copyright notice and this permission notice appear in
46 supporting documentation, and that the names of Digital or MIT not be
47 used in advertising or publicity pertaining to distribution of the
48 software without specific, written prior permission.
50 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
51 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
52 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
53 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
54 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
55 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
59 ***-------------------------------------------------------------------*/
66 #include <Dt/ControlP.h>
69 #define SEG_BUFF_SIZE 128
70 #define ASCII_TIME_BUFLEN 32 /* big enough for 26 plus slop */
74 /*-------------------------------------------------------------
80 typedef struct _DtClockClassPart
82 XmCacheClassPartPtr cache_part;
88 typedef struct _DtClockClassRec
90 RectObjClassPart rect_class;
91 XmGadgetClassPart gadget_class;
92 DtIconClassPart icon_class;
93 DtControlClassPart control_class;
94 DtClockClassPart clock_class;
99 extern DtClockClassRec dtClockClassRec;
103 /*-------------------------------------------------------------
104 ** Instance Structure
109 typedef struct _DtClockPart
111 int update; /* update frequence */
112 Dimension radius; /* radius factor */
113 int backing_store; /* backing store type */
114 Boolean reverse_video;
117 Dimension tick_spacing;
118 Dimension minute_hand_length;
119 Dimension hour_hand_length;
120 Dimension hand_width;
124 XPoint segbuff[SEG_BUFF_SIZE];
129 XtIntervalId interval_id;
130 char prev_time_string[ASCII_TIME_BUFLEN];
134 GC clock_background_gc;
136 Dimension left_inset;
137 Dimension right_inset;
139 Dimension bottom_inset;
140 Dimension clock_width;
141 Dimension clock_height;
144 /* Full Instance Record
146 typedef struct _DtClockRec
149 RectObjPart rectangle;
152 DtControlPart control;
158 /*-------------------------------------------------------------
159 ** Class and Instance Macros
162 /* DtClock Class Macros
165 /* DtClock Instance Macros
167 #define G_ClockInterval(g) (g -> clock.clock_interval)
168 #define G_ClockHandGC(g) (g -> clock.clock_hand_gc)
169 #define G_ClockBackgroundGC(g) (g -> clock.clock_background_gc)
170 #define G_ClockHandPixel(g) (g -> icon.pixmap_foreground)
171 #define G_ClockBackground(g) (g -> icon.pixmap_background)
172 #define G_ClockWidth(g) (g -> clock.clock_width)
173 #define G_ClockHeight(g) (g -> clock.clock_height)
174 #define G_LeftInset(g) (g -> clock.left_inset)
175 #define G_RightInset(g) (g -> clock.right_inset)
176 #define G_TopInset(g) (g -> clock.top_inset)
177 #define G_BottomInset(g) (g -> clock.bottom_inset)
180 #endif /* _DtClockP_h */
183 /* DON'T ADD ANYTHING AFTER THIS #endif */