2 * (c) Copyright 1989, 1990, 1991, 1992, 1993 OPEN SOFTWARE FOUNDATION, INC.
8 /* $XConsortium: DNDDemo.h /main/4 1995/10/27 10:43:48 rswiston $ */
10 * (c) Copyright 1987, 1988, 1989 HEWLETT-PACKARD COMPANY */
14 * Header file for the program DNDDemo.
18 #include <X11/Xatom.h>
19 #include <X11/Intrinsic.h>
21 #include <Xm/AtomMgr.h>
23 #include <Xm/DrawingA.h>
24 #include <Xm/SeparatoG.h>
26 #include <Xm/RowColumn.h>
28 #include <Xm/MessageB.h>
29 #include <Xm/DragDrop.h>
30 #include <Xm/Screen.h>
33 /* The following is used to layout the color labels */
36 #define BOX_X_OFFSET 95
37 #define BOX_Y_OFFSET 35
38 #define BOX_X_MARGIN 10
39 #define BOX_Y_MARGIN 10
41 /* The following are used in setting up the drag icons */
43 #define ICON_HEIGHT 32
44 #define SMALL_ICON_WIDTH 16
45 #define SMALL_ICON_HEIGHT 16
49 /* Some scales or text entry field could be added to change this value */
51 #define RECT_HEIGHT 50
53 /* The following defines could be setup as application resources */
54 #define RECT_START_COLOR "black"
55 #define HIGHLIGHT_THICKNESS 3
56 #define HIGHLIGHT_COLOR "Black" /* this is equivalent to gray60
58 #define DRAW_AREA_BG_COLOR "white"
59 #define DRAW_AREA_FG_COLOR "black" /* 5127 fix */
60 #define LABEL1_COLOR "#ff5026" /* a slight softer shade of red,
62 #define LABEL2_COLOR "orange"
63 #define LABEL3_COLOR "yellow"
64 #define LABEL4_COLOR "violet"
65 #define LABEL5_COLOR "#00C3ff" /* a blue green color,
67 #define LABEL6_COLOR "green"
69 #define VALID_CURSOR_FG_COLOR "black"
70 #define INVALID_CURSOR_FG_COLOR "maroon"
71 #define NONE_CURSOR_FG_COLOR "maroon"
75 * This struct is used to contain information about each rectangle
76 * to use in the dislay routines
78 typedef struct _RectStruct {
84 Pixmap pixmap; /* currently not in use */
85 } RectStruct, *RectPtr;
87 /* This struct is used to hold global application information */
88 typedef struct _AppInfoRec {
89 GC rectGC; /* graphic context used to draw the rectangles */
90 Pixel currentColor; /* color that is currently in the GC */
91 RectPtr *rectDpyTable; /* the rectangle display table */
92 int rectsAllocd; /* keeps track of how much the above
93 table has been alloc'd */
94 int numRects; /* the number of rects that are visible */
95 RectPtr highlightRect; /* the current highlighted rectangle */
96 RectPtr clearRect; /* the rectangle that is being moved */
97 Boolean doMove; /* indicates that a move is being performed */
98 Boolean creatingRect; /* indicates that a rect create is being
100 unsigned char operation;/* indicates the drop help operation */
101 unsigned int maxCursorWidth; /* the maximum allowable cursor width */
102 unsigned int maxCursorHeight; /* the maximum allowable cursor height */
107 } AppInfoRec, *AppInfo;
110 * This struct is used to pass information
111 * from the dropProc to the transferProc
113 typedef struct _DropTransferRec {
117 } DropTransferRec, *DropTransfer;
120 * This struct is used to pass information
121 * from the rectangle dragStart proc to it's associated
124 typedef struct _DragConvertRec {
127 } DragConvertRec, *DragConvertPtr;
131 extern void InitializeAppInfo(void );
132 extern void StartRect(Widget , XEvent *, String *, Cardinal *);
133 extern void ExtendRect(Widget , XEvent *, String *, Cardinal *);
134 extern void EndRect(Widget , XEvent *, String *, Cardinal *);
135 extern RectPtr RectCreate(Position , Position , Dimension ,
136 Dimension , Pixel , Pixmap );
137 extern RectPtr RectFind(Position , Position );
138 extern void RectSetColor(RectPtr , Display *, Window , Pixel );
139 extern Pixel RectGetColor(RectPtr );
140 extern Pixmap GetBitmapFromRect(Widget , RectPtr , Pixel , Pixel ,
141 Dimension *, Dimension *);
142 extern void RectHide(Display *, Window , RectPtr );
143 extern void RectFree(RectPtr );
144 extern void RedrawRectangles(Widget );
145 extern void RectDrawStippled(Display *, Window , RectPtr );
146 extern void RectHighlight(Widget , RectPtr );
147 extern void RectUnhighlight(Widget );
148 extern void RectSetPixmap(RectPtr , Display *, Window , Pixmap );
149 extern void RectRegister(RectPtr , Position , Position );
150 extern void InitializeRectDpyTable(void );
151 extern void CreateLayout(void );
152 extern void CreateRectGC(void );
153 extern Pixel GetColor(char *);
154 extern void ColorRect(Widget , XEvent *, String *, Cardinal *);
158 /* The following character arrays hold the bits for
159 * the source and state icons for both 32x32 and 16x16 drag icons.
160 * The source is a color palatte icon and the state is a paint brush icon.
162 extern unsigned char SOURCE_ICON_BITS[];
163 extern unsigned char SOURCE_ICON_MASK[];
164 extern unsigned char STATE_ICON_BITS[];
165 extern unsigned char STATE_ICON_MASK[];
166 extern unsigned char INVALID_ICON_BITS[];
167 extern unsigned char SMALL_SOURCE_ICON_BITS[];
168 extern unsigned char SMALL_SOURCE_ICON_MASK[];
169 extern unsigned char SMALL_STATE_ICON_BITS[];
170 extern unsigned char SMALL_STATE_ICON_MASK[];
171 extern unsigned char SMALL_INVALID_ICON_BITS[];
173 /* The folowing character arrays are for use with the drop help
174 * dialogs. For internationalization, message catalogs should
175 * replace these static declarations.
177 extern char HELP_MSG1[];
178 extern char HELP_MSG2[];
179 extern char HELP_MSG3[];
180 extern char HELP_MSG4[];
181 extern char HELP_MSG5[];
184 /* Globals variables */
185 extern AppInfo appInfo;
186 extern Widget topLevel;
187 extern Widget drawingArea;
188 extern Widget helpDialog;
189 extern Widget helpLabel, helpMenu;
190 extern XtAppContext appContext;