ClockP.h revision 6ea72052
1/* $Xorg: ClockP.h,v 1.4 2001/02/09 02:05:33 xorgcvs Exp $ */ 2/* 3 4Copyright 1993, 1998 The Open Group 5 6Permission to use, copy, modify, distribute, and sell this software and its 7documentation for any purpose is hereby granted without fee, provided that 8the above copyright notice appear in all copies and that both that 9copyright notice and this permission notice appear in supporting 10documentation. 11 12The above copyright notice and this permission notice shall be included 13in all copies or substantial portions of the Software. 14 15THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 16OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR 19OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 20ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 21OTHER DEALINGS IN THE SOFTWARE. 22 23Except as contained in this notice, the name of The Open Group shall 24not be used in advertising or otherwise to promote the sale, use or 25other dealings in this Software without prior written authorization 26from The Open Group. 27 28*/ 29/* $XFree86: xc/programs/oclock/ClockP.h,v 1.4 2001/01/17 23:45:01 dawes Exp $ */ 30 31 32#ifndef _ClockP_h 33#define _ClockP_h 34 35#include "Clock.h" 36#include <X11/CoreP.h> 37#include "transform.h" 38 39#define POLY_SIZE 6 40 41/* New fields for the clock widget instance record */ 42typedef struct { 43 Pixel minute; 44 Pixel hour; 45 Pixel jewel; 46 GC minuteGC; 47 GC hourGC; 48 GC jewelGC; 49 GC eraseGC; 50 GC shapeGC; /* pointer to GraphicsContext */ 51/* start of graph stuff */ 52 int backing_store; /* backing store variety */ 53 Boolean shape_window; /* use SetWindowShapeMask */ 54 Boolean transparent; /* make window transparent */ 55 float border_size; 56 float jewel_size; 57 XtIntervalId interval_id; 58 Transform t; 59 Transform maskt; 60 Pixmap shape_mask; /* window shape */ 61 int shape_width; /* window width when shape last made */ 62 int shape_height; /* window height when shape last made */ 63 double hour_angle; /* hour hand position */ 64 double minute_angle; /* minute hand position */ 65 int polys_valid; /* polygons contain good data */ 66 TPoint minute_poly[POLY_SIZE]; /* polygon for minute hand */ 67 TPoint hour_poly[POLY_SIZE]; /* polygon for hour hand */ 68} ClockPart; 69 70/* Full instance record declaration */ 71typedef struct _ClockRec { 72 CorePart core; 73 ClockPart clock; 74} ClockRec; 75 76/* New fields for the Clock widget class record */ 77typedef struct {int dummy;} ClockClassPart; 78 79/* Full class record declaration. */ 80typedef struct _ClockClassRec { 81 CoreClassPart core_class; 82 ClockClassPart clock_class; 83} ClockClassRec; 84 85/* Class pointer. */ 86extern ClockClassRec clockClassRec; 87 88extern void paint_jewel ( ClockWidget w, Drawable d, GC gc ); 89extern int check_jewel_poly ( ClockWidget w, TPoint poly[6] ); 90extern void check_jewel ( ClockWidget w, Drawable d, GC gc ); 91extern void compute_hand ( ClockWidget w, double a, double l, double width, 92 TPoint poly[6] ); 93extern void compute_hands ( ClockWidget w ); 94extern void paint_hand ( ClockWidget w, Drawable d, GC gc, TPoint poly[6] ); 95extern void paint_hands ( ClockWidget w, Drawable d, GC minute_gc, GC hour_gc ); 96 97#endif /* _ClockP_h */ 98