Bitmap.h revision eaef79e5
1eaef79e5Smrg/* $Xorg: Bitmap.h,v 1.4 2001/02/09 02:05:28 xorgcvs Exp $ */
2eaef79e5Smrg/*
3eaef79e5Smrg
4eaef79e5SmrgCopyright 1989, 1998  The Open Group
5eaef79e5Smrg
6eaef79e5SmrgPermission to use, copy, modify, distribute, and sell this software and its
7eaef79e5Smrgdocumentation for any purpose is hereby granted without fee, provided that
8eaef79e5Smrgthe above copyright notice appear in all copies and that both that
9eaef79e5Smrgcopyright notice and this permission notice appear in supporting
10eaef79e5Smrgdocumentation.
11eaef79e5Smrg
12eaef79e5SmrgThe above copyright notice and this permission notice shall be included
13eaef79e5Smrgin all copies or substantial portions of the Software.
14eaef79e5Smrg
15eaef79e5SmrgTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
16eaef79e5SmrgOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17eaef79e5SmrgMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18eaef79e5SmrgIN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
19eaef79e5SmrgOTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20eaef79e5SmrgARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
21eaef79e5SmrgOTHER DEALINGS IN THE SOFTWARE.
22eaef79e5Smrg
23eaef79e5SmrgExcept as contained in this notice, the name of The Open Group shall
24eaef79e5Smrgnot be used in advertising or otherwise to promote the sale, use or
25eaef79e5Smrgother dealings in this Software without prior written authorization
26eaef79e5Smrgfrom The Open Group.
27eaef79e5Smrg
28eaef79e5Smrg*/
29eaef79e5Smrg/* $XFree86: xc/programs/bitmap/Bitmap.h,v 1.4 2001/06/12 09:45:53 alanh Exp $ */
30eaef79e5Smrg
31eaef79e5Smrg/*
32eaef79e5Smrg * Author:  Davor Matic, MIT X Consortium
33eaef79e5Smrg */
34eaef79e5Smrg
35eaef79e5Smrg
36eaef79e5Smrg#ifndef _Bitmap_h
37eaef79e5Smrg#define _Bitmap_h
38eaef79e5Smrg
39eaef79e5Smrg/****************************************************************
40eaef79e5Smrg *
41eaef79e5Smrg * Bitmap widget
42eaef79e5Smrg *
43eaef79e5Smrg ****************************************************************/
44eaef79e5Smrg
45eaef79e5Smrg#include <X11/Xaw/Simple.h>
46eaef79e5Smrg
47eaef79e5Smrg/* Resources:
48eaef79e5Smrg
49eaef79e5Smrg Name		     Class		RepType		Default Value
50eaef79e5Smrg ----		     -----		-------		-------------
51eaef79e5Smrg background	     Background		Pixel		XtDefaultBackground
52eaef79e5Smrg foreground          Foredround         Pixel           XtDefaultForeground
53eaef79e5Smrg highlight           Highlight          Pixel           XtDefaultForeground
54eaef79e5Smrg frame               Frame              Pixel           XtDefaultForeground
55eaef79e5Smrg border		     BorderColor	Pixel		XtDefaultForeground
56eaef79e5Smrg borderWidth	     BorderWidth	Dimension	1
57eaef79e5Smrg mappedWhenManaged   MappedWhenManaged	Boolean		True
58eaef79e5Smrg resize              Resize             Boolean         True
59eaef79e5Smrg sensitive	     Sensitive		Boolean		True
60eaef79e5Smrg width		     Width		Dimension	0
61eaef79e5Smrg height		     Height		Dimension	0
62eaef79e5Smrg size                Size               String          32x32
63eaef79e5Smrg squareWidht         SquareWidht        Dimension       16
64eaef79e5Smrg squareHeight        SquareHeight       Dimension       16
65eaef79e5Smrg x		     Position		Position	320
66eaef79e5Smrg y		     Position		Position	320
67eaef79e5Smrg xHot                XHot               Position        NotSet
68eaef79e5Smrg yHot                YHot               Position        NotSet
69eaef79e5Smrg margin              Margin             Dimension       16
70eaef79e5Smrg grid                Grid               Boolean         True
71eaef79e5Smrg gridTolerance       GridTolerance      Dimension       8
72eaef79e5Smrg dashed              Dashed             Boolean         True
73eaef79e5Smrg dashes              Dashes             Bitmap          XtUnspecifiedPixmap
74eaef79e5Smrg stippled            Stippled           Boolean         True
75eaef79e5Smrg stipple             Stipple            Bitmap          XtUnspecifiedPixmap
76eaef79e5Smrg proportional        Proportional       Boolean         True
77eaef79e5Smrg axes                Axes               Boolean         True
78eaef79e5Smrg button1Function     Button1Function    ButtonFunction  Set
79eaef79e5Smrg button2Function     Button2Function    ButtonFunction  Invert
80eaef79e5Smrg button3Function     Button3Function    ButtonFunction  Clear
81eaef79e5Smrg button4Function     Button4Function    ButtonFunction  Invert
82eaef79e5Smrg button5Function     Button5Function    ButtonFunction  Invert
83eaef79e5Smrg filename            Filename           String          None
84eaef79e5Smrg basename            Basename           String          None
85eaef79e5Smrg*/
86eaef79e5Smrg
87eaef79e5Smrg/* define any special resource names here that are not in <X11/StringDefs.h> */
88eaef79e5Smrg
89eaef79e5Smrg#define XtNbitmapResource "bitmapResource"
90eaef79e5Smrg#define XtNstipple "stipple"
91eaef79e5Smrg#define XtNstippled "stippled"
92eaef79e5Smrg#define XtNdashes "dashes"
93eaef79e5Smrg#define XtNdashed "dashed"
94eaef79e5Smrg#define XtNgrid "grid"
95eaef79e5Smrg#define XtNgridTolerance "gridTolerance"
96eaef79e5Smrg#define XtNaxes "axes"
97eaef79e5Smrg#define XtNbitmapSize "bitmapSize"
98eaef79e5Smrg#define XtNsize "size"
99eaef79e5Smrg#define XtNsquareWidth "squareWidth"
100eaef79e5Smrg#define XtNsquareHeight "squareHeight"
101eaef79e5Smrg#define XtNxHot "xHot"
102eaef79e5Smrg#define XtNyHot "yHot"
103eaef79e5Smrg#define XtNbutton1Function "button1Function"
104eaef79e5Smrg#define XtNbutton2Function "button2Function"
105eaef79e5Smrg#define XtNbutton3Function "button3Function"
106eaef79e5Smrg#define XtNbutton4Function "button4Function"
107eaef79e5Smrg#define XtNbutton5Function "button5Function"
108eaef79e5Smrg#define XtNfilename "filename"
109eaef79e5Smrg#define XtNbasename "basename"
110eaef79e5Smrg#define XtNmouseForeground "mouseForeground"
111eaef79e5Smrg#define XtNmouseBackground "mouseBackground"
112eaef79e5Smrg#define XtNframe "frame"
113eaef79e5Smrg#define XtNmargin "margin"
114eaef79e5Smrg#define XtNproportional "proportional"
115eaef79e5Smrg
116eaef79e5Smrg#define XtCBitmapResource "BitmapResource"
117eaef79e5Smrg#define XtCHighlight "Highlight"
118eaef79e5Smrg#define XtCStipple "Stipple"
119eaef79e5Smrg#define XtCStippled "Stippled"
120eaef79e5Smrg#define XtCDashes "Dashes"
121eaef79e5Smrg#define XtCDashed "Dashed"
122eaef79e5Smrg#define XtCGrid "Grid"
123eaef79e5Smrg#define XtCGridTolerance "GridTolerance"
124eaef79e5Smrg#define XtCAxes "Axes"
125eaef79e5Smrg#define XtBitmapSize "BitmapSize"
126eaef79e5Smrg#define XtCSize "Size"
127eaef79e5Smrg#define XtCSquareWidth "SquareWidth"
128eaef79e5Smrg#define XtCSquareHeight "SquareHeight"
129eaef79e5Smrg#define XtCXHot "XHot"
130eaef79e5Smrg#define XtCYHot "YHot"
131eaef79e5Smrg#define XtCButton1Function "Button1Function"
132eaef79e5Smrg#define XtCButton2Function "Button2Function"
133eaef79e5Smrg#define XtCButton3Function "Button3Function"
134eaef79e5Smrg#define XtCButton4Function "Button4Function"
135eaef79e5Smrg#define XtCButton5Function "Button5Function"
136eaef79e5Smrg#define XtCFilename "Filename"
137eaef79e5Smrg#define XtCBasename "Basename"
138eaef79e5Smrg#define XtCFrame "Frame"
139eaef79e5Smrg#ifndef XtCMargin
140eaef79e5Smrg#define XtCMargin "Margin"
141eaef79e5Smrg#endif
142eaef79e5Smrg#define XtCProportional "Proportional"
143eaef79e5Smrg
144eaef79e5Smrg#define XtRButtonFunction "ButtonFunction"
145eaef79e5Smrg
146eaef79e5Smrg/* bitmap defines */
147eaef79e5Smrg
148eaef79e5Smrg#define NotSet   -1
149eaef79e5Smrg#define Clear     0
150eaef79e5Smrg#define Set       1
151eaef79e5Smrg#define Invert    2
152eaef79e5Smrg#define Highlight 3
153eaef79e5Smrg#define On        True
154eaef79e5Smrg#define Off       False
155eaef79e5Smrg
156eaef79e5Smrg#define XtClear "clear"
157eaef79e5Smrg#define XtSet "set"
158eaef79e5Smrg#define XtInvert "invert"
159eaef79e5Smrg
160eaef79e5Smrg#define MarkRequest "MarkRequest"
161eaef79e5Smrg#define StoreRequest "StoreRequest"
162eaef79e5Smrg#define RestoreRequest "RestoreRequest"
163eaef79e5Smrg#define CopyRequest "CopyRequest"
164eaef79e5Smrg#define MoveRequest "MoveRequest"
165eaef79e5Smrg#define PointRequest "PointRequest"
166eaef79e5Smrg#define LineRequest "LineRequest"
167eaef79e5Smrg#define CurveRequest "CurveRequest"
168eaef79e5Smrg#define RectangleRequest "RectangleRequest"
169eaef79e5Smrg#define FilledRectangleRequest "FilledRectangleRequest"
170eaef79e5Smrg#define CircleRequest "CircleRequest"
171eaef79e5Smrg#define FilledCircleRequest "FilledCircleRequest"
172eaef79e5Smrg#define FloodFillRequest "FloodFillRequest"
173eaef79e5Smrg#define HotSpotRequest "HotSpotRequest"
174eaef79e5Smrg#define ZoomInRequest "ZoomInRequest"
175eaef79e5Smrg#define PasteRequest "PasteRequest"
176eaef79e5Smrg#define ImmediateCopyRequest "ImmediateCopyRequest"
177eaef79e5Smrg#define ImmediateMoveRequest "ImmediateMoveRequest"
178eaef79e5Smrg
179eaef79e5Smrg/* bitmap exports */
180eaef79e5Smrg
181eaef79e5Smrgtypedef struct _BWRequestRec BWRequestRec;
182eaef79e5Smrgtypedef char *BWRequest;
183eaef79e5Smrg
184eaef79e5Smrg/* declare specific BitmapWidget class and instance datatypes */
185eaef79e5Smrg
186eaef79e5Smrgtypedef struct _BitmapClassRec *BitmapWidgetClass;
187eaef79e5Smrgtypedef struct _BitmapRec      *BitmapWidget;
188eaef79e5Smrg/* declare the class constant */
189eaef79e5Smrg
190eaef79e5Smrgextern WidgetClass bitmapWidgetClass;
191eaef79e5Smrg
192eaef79e5Smrgextern Boolean BWEngageRequest(Widget w, BWRequest name, Boolean trap,
193eaef79e5Smrg			       XtPointer call_data, Cardinal call_data_size);
194eaef79e5Smrgextern Boolean BWTerminateRequest(Widget w, Boolean cont);
195eaef79e5Smrg
196eaef79e5Smrgextern void BWUp ( Widget w );
197eaef79e5Smrgextern void BWDown ( Widget w );
198eaef79e5Smrgextern void BWLeft ( Widget w );
199eaef79e5Smrgextern void BWRight ( Widget w );
200eaef79e5Smrgextern void BWRotateRight ( Widget w );
201eaef79e5Smrgextern void BWRotateLeft ( Widget w );
202eaef79e5Smrgextern void BWSwitchGrid ( Widget w );
203eaef79e5Smrgextern void BWGrid ( Widget w, Boolean _switch );
204eaef79e5Smrgextern void BWSwitchDashed ( Widget w );
205eaef79e5Smrgextern void BWDashed ( Widget w, Boolean _switch );
206eaef79e5Smrgextern void BWSwitchAxes ( Widget w );
207eaef79e5Smrgextern void BWAxes ( Widget w, Boolean _switch );
208eaef79e5Smrgextern void BWRedrawAxes( Widget w );
209eaef79e5Smrgextern void BWDrawLine ( Widget w, Position from_x, Position from_y, Position to_x, Position to_y, int value );
210eaef79e5Smrgextern void BWDrawRectangle ( Widget w, Position from_x, Position from_y, Position to_x, Position to_y, int value );
211eaef79e5Smrgextern void BWDrawFilledRectangle ( Widget w, Position from_x, Position from_y, Position to_x, Position to_y, int value );
212eaef79e5Smrgextern void BWDrawCircle ( Widget w, Position origin_x, Position origin_y, Position point_x, Position point_y, int value );
213eaef79e5Smrgextern void BWDrawFilledCircle ( Widget w, Position origin_x, Position origin_y, Position point_x, Position point_y, int value );
214eaef79e5Smrgextern void BWFloodFill ( Widget w, Position x, Position y, int value );
215eaef79e5Smrgextern void BWMark ( Widget w, Position from_x, Position from_y, Position to_x, Position to_y );
216eaef79e5Smrgextern void BWMarkAll ( Widget w );
217eaef79e5Smrgextern void BWUnmark ( Widget w );
218eaef79e5Smrgextern void BWSelect ( Widget w, Position from_x, Position from_y, Position to_x, Position to_y, Time btime );
219eaef79e5Smrgextern void BWStore ( Widget w );
220eaef79e5Smrgextern void BWStoreToBuffer ( Widget w );
221eaef79e5Smrgextern void BWUndo ( Widget w );
222eaef79e5Smrgextern void BWResize ( Widget w, Dimension width, Dimension height );
223eaef79e5Smrgextern void BWClip ( Widget w, Position x, Position y, Dimension width, Dimension height );
224eaef79e5Smrgextern void BWUnclip ( Widget w );
225eaef79e5Smrgextern void BWGrabSelection ( Widget w, Time btime );
226eaef79e5Smrgextern void BWRequestSelection ( Widget w, Time btime, Boolean wait );
227eaef79e5Smrgextern void BWSetChanged ( Widget w );
228eaef79e5Smrgextern Boolean BWQueryChanged ( Widget w );
229eaef79e5Smrgextern int BWReadFile ( Widget w, String filename, String basename );
230eaef79e5Smrgextern int BWWriteFile ( Widget w, String filename, String basename );
231eaef79e5Smrgextern String BWUnparseStatus ( Widget w );
232eaef79e5Smrgextern String BWGetFilename ( Widget w, String *str );
233eaef79e5Smrgextern String BWGetBasename ( Widget w, String *str );
234eaef79e5Smrgextern void BWChangeBasename ( Widget w, String str );
235eaef79e5Smrgextern void BWRemoveAllRequests ( Widget w );
236eaef79e5Smrgextern void BWClearHotSpot ( Widget w );
237eaef79e5Smrgextern Boolean BWQueryMarked ( Widget w );
238eaef79e5Smrgextern void BWFold ( Widget w );
239eaef79e5Smrgextern void BWClear ( Widget w );
240eaef79e5Smrgextern void BWSet ( Widget w );
241eaef79e5Smrgextern void BWInvert ( Widget w );
242eaef79e5Smrgextern void BWFlipHoriz ( Widget w );
243eaef79e5Smrgextern void BWFlipVert ( Widget w );
244eaef79e5Smrgextern void BWClearMarked ( Widget w );
245eaef79e5Smrgextern Boolean BWAddRequest ( Widget w, BWRequest name, Boolean trap, XtPointer call_data, Cardinal call_data_size );
246eaef79e5Smrgextern void BWChangeNotify ( Widget w );
247eaef79e5Smrgextern Pixmap BWGetUnzoomedPixmap ( Widget w );
248eaef79e5Smrgextern void BWClearChanged ( Widget w );
249eaef79e5Smrgextern Boolean BWQueryStored ( Widget w );
250eaef79e5Smrgextern Boolean BWQueryStippled ( Widget w );
251eaef79e5Smrgextern void BWSwitchStippled ( Widget w );
252eaef79e5Smrgextern void BWRedrawMark ( Widget w );
253eaef79e5Smrgextern Boolean BWQueryAxes ( Widget w );
254eaef79e5Smrgextern void BWHighlightAxes ( Widget w );
255eaef79e5Smrgextern String BWGetFilepath ( Widget w, String *str );
256eaef79e5Smrgextern void BWZoomOut ( Widget w );
257eaef79e5Smrgextern void BWZoomMarked ( Widget w );
258eaef79e5Smrgextern void BWRescale ( Widget w, Dimension width, Dimension height );
259eaef79e5Smrgextern Boolean BWQueryZooming ( Widget w );
260eaef79e5Smrgextern void BWRedrawGrid ( Widget w, Position x, Position y, Dimension width, Dimension height );
261eaef79e5Smrgextern void BWRedrawSquares ( Widget w, Position x, Position y, Dimension width, Dimension height );
262eaef79e5Smrgextern void BWRedrawHotSpot ( Widget w );
263eaef79e5Smrgextern void BWSetHotSpot(Widget w, Position x, Position y);
264eaef79e5Smrgextern Boolean BWQueryGrid ( Widget w );
265eaef79e5Smrgextern Boolean BWQueryDashed ( Widget w );
266eaef79e5Smrgextern Boolean BWQueryProportional ( Widget w );
267eaef79e5Smrgextern void BWSwitchProportional ( Widget w );
268eaef79e5Smrgextern void BWDrawGrid ( Widget w, Position from_x, Position from_y, Position to_x, Position to_y );
269eaef79e5Smrgextern void BWChangeFilename ( Widget w, String str );
270eaef79e5Smrgextern Boolean BWParseSize ( String size, Dimension *width, Dimension *height );
271eaef79e5Smrgextern Boolean BWQuerySelection ( Widget w, Time btime );
272eaef79e5Smrgextern int BWStoreFile ( Widget w, String filename, String *basename );
273eaef79e5Smrgextern void BWNotify ( Widget w, XtActionProc proc );
274eaef79e5Smrgextern void BWTMark ( Widget w, XEvent *event, String *params, Cardinal *num_params  );
275eaef79e5Smrgextern void BWTMarkAll ( Widget w, XEvent *event, String *params, Cardinal *num_params );
276eaef79e5Smrgextern void BWTUnmark ( Widget w, XEvent *event, String *params, Cardinal *num_params );
277eaef79e5Smrgextern void BWTPaste ( Widget w, XEvent *event, String *params, Cardinal *num_params );
278eaef79e5Smrgextern void BWDebug ( Widget w, XEvent *event, String *params, Cardinal *num_params );
279eaef79e5Smrgextern void BWAbort ( Widget w );
280eaef79e5Smrgextern Boolean BWRemoveRequest ( Widget w );
281eaef79e5Smrgextern void BWRedraw ( Widget w );
282eaef79e5Smrgextern Pixmap BWGetPixmap( Widget w );
283eaef79e5Smrg
284eaef79e5Smrg#endif /* _Bitmap_h */
285eaef79e5Smrg
286eaef79e5Smrg
287