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