Use C++ linker
[oweals/cde.git] / cde / programs / dtwm / ClockP.h
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
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)
10  * any later version.
11  *
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
16  * details.
17  *
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
22  */
23 /* $XConsortium: ClockP.h /main/4 1996/10/16 16:57:08 drk $ */
24 /**---------------------------------------------------------------------
25 ***     
26 ***     file:           ClockP.h
27 ***
28 ***     project:        MotifPlus Widgets
29 ***
30 ***     description:    Private include file for DtClock class.
31 ***                     Portions adapted from the Xaw Clock widget.
32 ***     
33 ***     
34 ***                     (c) Copyright 1990 by Hewlett-Packard Company.
35 ***
36 ***
37 Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts,
38 and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
39
40                         All Rights Reserved
41
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.  
49
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
56 SOFTWARE.
57 ***
58 ***
59 ***-------------------------------------------------------------------*/
60
61
62 #ifndef _DtClockP_h
63 #define _DtClockP_h
64
65 #include <Xm/XmP.h>
66 #include <Dt/ControlP.h>
67 #include "Clock.h"
68
69 #define SEG_BUFF_SIZE           128
70 #define ASCII_TIME_BUFLEN       32      /* big enough for 26 plus slop */
71
72
73 \f
74 /*-------------------------------------------------------------
75 **      Class Structure
76 */
77
78 /*      Class Part
79 */
80 typedef struct _DtClockClassPart
81 {
82         XmCacheClassPartPtr     cache_part;
83         caddr_t                 extension;
84 } DtClockClassPart;
85
86 /*      Full Class Record
87 */
88 typedef struct _DtClockClassRec
89 {
90         RectObjClassPart        rect_class;
91         XmGadgetClassPart       gadget_class;
92         DtIconClassPart icon_class;
93         DtControlClassPart      control_class;
94         DtClockClassPart        clock_class;
95 } DtClockClassRec;
96
97 /*      Actual Class
98 */
99 extern DtClockClassRec dtClockClassRec;
100
101
102 \f
103 /*-------------------------------------------------------------
104 **      Instance Structure
105 */
106
107 /*      Instance Part
108 */
109 typedef struct _DtClockPart
110 {
111         int             update;         /* update frequence */
112         Dimension       radius;         /* radius factor */
113         int             backing_store;  /* backing store type */
114         Boolean         reverse_video;
115         Boolean         chime;
116         Boolean         beeped;
117         Dimension       tick_spacing;
118         Dimension       minute_hand_length;
119         Dimension       hour_hand_length;
120         Dimension       hand_width;
121         Position        centerX;
122         Position        centerY;
123         int             numseg;
124         XPoint          segbuff[SEG_BUFF_SIZE];
125         XPoint          *segbuffptr;
126         XPoint          *hour, *sec;
127         struct          tm  otm ;
128
129         XtIntervalId    interval_id;
130         char            prev_time_string[ASCII_TIME_BUFLEN];
131         int             clock_interval;
132
133         GC              clock_hand_gc;
134         GC              clock_background_gc;
135
136         Dimension       left_inset;
137         Dimension       right_inset;
138         Dimension       top_inset;
139         Dimension       bottom_inset;
140         Dimension       clock_width;
141         Dimension       clock_height;
142 } DtClockPart;
143
144 /*      Full Instance Record
145 */
146 typedef struct _DtClockRec
147 {
148         ObjectPart      object;
149         RectObjPart     rectangle;
150         XmGadgetPart    gadget;
151         DtIconPart      icon;
152         DtControlPart   control;
153         DtClockPart     clock;
154 } DtClockRec;
155
156
157 \f
158 /*-------------------------------------------------------------
159 **      Class and Instance Macros
160 */
161
162 /*      DtClock Class Macros
163 */
164
165 /*      DtClock Instance Macros
166 */
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)
178
179
180 #endif /* _DtClockP_h */
181
182
183 /* DON'T ADD ANYTHING AFTER THIS #endif */