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 libraries and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /**---------------------------------------------------------------------
27 *** project: MotifPlus Widgets
29 *** description: Private include file for DtClock class.
30 *** Portions adapted from the Xaw Clock widget.
33 *** (c) Copyright 1990 by Hewlett-Packard Company.
36 Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts,
37 and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
41 Permission to use, copy, modify, and distribute this software and its
42 documentation for any purpose and without fee is hereby granted,
43 provided that the above copyright notice appear in all copies and that
44 both that copyright notice and this permission notice appear in
45 supporting documentation, and that the names of Digital or MIT not be
46 used in advertising or publicity pertaining to distribution of the
47 software without specific, written prior permission.
49 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
50 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
51 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
52 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
53 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
54 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
58 ***-------------------------------------------------------------------*/
65 #include <Dt/ControlP.h>
68 #define SEG_BUFF_SIZE 128
69 #define ASCII_TIME_BUFLEN 32 /* big enough for 26 plus slop */
73 /*-------------------------------------------------------------
79 typedef struct _DtClockClassPart
81 XmCacheClassPartPtr cache_part;
87 typedef struct _DtClockClassRec
89 RectObjClassPart rect_class;
90 XmGadgetClassPart gadget_class;
91 DtIconClassPart icon_class;
92 DtControlClassPart control_class;
93 DtClockClassPart clock_class;
98 extern DtClockClassRec dtClockClassRec;
102 /*-------------------------------------------------------------
103 ** Instance Structure
108 typedef struct _DtClockPart
110 int update; /* update frequence */
111 Dimension radius; /* radius factor */
112 int backing_store; /* backing store type */
113 Boolean reverse_video;
116 Dimension tick_spacing;
117 Dimension minute_hand_length;
118 Dimension hour_hand_length;
119 Dimension hand_width;
123 XPoint segbuff[SEG_BUFF_SIZE];
128 XtIntervalId interval_id;
129 char prev_time_string[ASCII_TIME_BUFLEN];
133 GC clock_background_gc;
135 Dimension left_inset;
136 Dimension right_inset;
138 Dimension bottom_inset;
139 Dimension clock_width;
140 Dimension clock_height;
143 /* Full Instance Record
145 typedef struct _DtClockRec
148 RectObjPart rectangle;
151 DtControlPart control;
157 /*-------------------------------------------------------------
158 ** Class and Instance Macros
161 /* DtClock Class Macros
164 /* DtClock Instance Macros
166 #define G_ClockInterval(g) (g -> clock.clock_interval)
167 #define G_ClockHandGC(g) (g -> clock.clock_hand_gc)
168 #define G_ClockBackgroundGC(g) (g -> clock.clock_background_gc)
169 #define G_ClockHandPixel(g) (g -> icon.pixmap_foreground)
170 #define G_ClockBackground(g) (g -> icon.pixmap_background)
171 #define G_ClockWidth(g) (g -> clock.clock_width)
172 #define G_ClockHeight(g) (g -> clock.clock_height)
173 #define G_LeftInset(g) (g -> clock.left_inset)
174 #define G_RightInset(g) (g -> clock.right_inset)
175 #define G_TopInset(g) (g -> clock.top_inset)
176 #define G_BottomInset(g) (g -> clock.bottom_inset)
179 #endif /* _DtClockP_h */
182 /* DON'T ADD ANYTHING AFTER THIS #endif */