1 /*
2  *  Copyright (C) 1995, 1996  Karl-Johan Johnsson.
3  */
4 
5 #ifndef ShadowP_h
6 #define ShadowP_h
7 
8 #include "Shadow.h"
9 #include <X11/CoreP.h>
10 
11 typedef Boolean (*ShadowAllocShadowColorsProc)(ShadowWidget, XColor*);
12 typedef void    (*ShadowAllocShadowPixmapsProc)(ShadowWidget, Pixel);
13 typedef Boolean (*ShadowAllocArmColorProc)(ShadowWidget, XColor*);
14 typedef void    (*ShadowAllocArmPixmapProc)(ShadowWidget, Pixel);
15 typedef void    (*ShadowAllocGCsProc)(ShadowWidget);
16 
17 #define XtInheritPixelOffset		\
18     0 /* this is a bit unortodox... */
19 #define XtInheritAllocShadowColors	\
20     ((ShadowAllocShadowColorsProc)_XtInherit)
21 #define XtInheritAllocShadowPixmaps	\
22     ((ShadowAllocShadowPixmapsProc)_XtInherit)
23 #define XtInheritAllocArmColor		\
24     ((ShadowAllocArmColorProc)_XtInherit)
25 #define XtInheritAllocArmPixmap		\
26     ((ShadowAllocArmPixmapProc)_XtInherit)
27 #define XtInheritAllocGCs		\
28     ((ShadowAllocGCsProc)_XtInherit)
29 
30 typedef struct {
31     Cardinal				pixel_offset;
32     Boolean				use_arm_for_background;
33     ShadowAllocShadowColorsProc		alloc_shadow_colors;
34     ShadowAllocShadowPixmapsProc	alloc_shadow_pixmaps;
35     ShadowAllocArmColorProc		alloc_arm_color;
36     ShadowAllocArmPixmapProc		alloc_arm_pixmap;
37     ShadowAllocGCsProc			alloc_gcs;
38     XtPointer				extension;
39 } ShadowClassPart;
40 
41 typedef struct ShadowClassRec {
42     CoreClassPart	core_class;
43     ShadowClassPart	shadow_class;
44 } ShadowClassRec;
45 
46 extern ShadowClassRec shadowClassRec;
47 
48 typedef struct {
49     Dimension	shadow_width;
50     Boolean	alloc_shadow_colors;
51     Boolean	use_lines;
52     Boolean	alloc_arm_color;
53     Boolean	alloc_arm_pixmap;
54     /* private data */
55     Pixel	light_pixel;
56     Pixmap	light_pixmap;
57     GC		light_gc;
58     Pixel	dark_pixel;
59     Pixmap	dark_pixmap;
60     GC		dark_gc;
61     Pixel	arm_pixel;
62     Pixmap	arm_pixmap;
63     GC		arm_gc;
64     Boolean	line_mode;
65     Boolean	alloced_shadow_pixels;
66     Boolean	alloced_arm_pixel;
67 } ShadowPart;
68 
69 typedef struct ShadowRec {
70     CorePart	core;
71     ShadowPart	shadow;
72 } ShadowRec;
73 
74 extern void ShadowDrawShadows(ShadowWidget, Position, Position,
75 			      Dimension, Dimension, Boolean);
76 
77 #endif /* ShadowP_h */
78