1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161
|
/* * Last edited: Sep 12 16:59 1991 (mallet) */
/*
* $Id: Requests.h,v 1.4.1.1 1992/08/05 15:26:04 mallet Exp $
*
* Copyright 1991 Lionel Mallet
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appears in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of Lionel MALLET not be used in
* advertising or publicity pertaining to distribution of the software
* without specific, written prior permission. Lionel MALLET makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
* Lionel MALLET DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS, IN NO EVENT SHALL Lionel MALLET BE LIABLE FOR ANY SPECIAL,
* INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
* RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* This software is opened and free. Furthermore, everybody is kindly
* invited to participate to improve it for the benefit of all.
* Improvements can be new features, bugs fixes and porting issues
* resolution.
*
* Author: Lionel Mallet, SIMULOG
*/
/*
* $XConsortium: Requests.h,v 1.2 90/06/09 20:20:44 dmatic Exp $
*
* Copyright 1989 Massachusetts Institute of Technology
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of M.I.T. not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. M.I.T. makes no representations about the
* suitability of this software for any purpose. It is provided "as is"
* without express or implied warranty.
*
* M.I.T. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL M.I.T.
* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* Author: Davor Matic, MIT X Consortium
*/
typedef struct {
Boolean success;
Position at_x, at_y;
Position from_x, from_y,
to_x, to_y;
void (*draw)();
Pixel value;
Time time;
int state;
} PWStatus;
void OnePointEngage();
void OnePointTerminate();
void OnePointTerminateTransparent();
void DragOnePointEngage();
void DragOnePointTerminate();
void TwoPointsEngage();
void TwoPointsTerminate();
void TwoPointsTerminateTransparent();
void TwoPointsTerminateTimed();
void DragTwoPointsEngage();
void DragTwoPointsTerminate();
void Interface();
void Paste();
static PWRequestRec requests[] =
{
{MarkRequest, sizeof(PWStatus),
TwoPointsEngage, (XtPointer) PWDrawRectangle,
TwoPointsTerminateTimed, (XtPointer) PWSelect,
NULL, (XtPointer) NULL},
{RestoreRequest, sizeof(PWStatus),
OnePointEngage, (XtPointer) PWDragStored,
OnePointTerminate, (XtPointer) PWRestore,
NULL, (XtPointer) NULL},
{ImmediateCopyRequest, sizeof(PWStatus),
OnePointEngage, (XtPointer) PWDragMarked,
OnePointTerminate, (XtPointer) PWCopy,
NULL, (XtPointer) NULL},
{ImmediateMoveRequest, sizeof(PWStatus),
OnePointEngage, (XtPointer) PWDragMarked,
OnePointTerminate, (XtPointer) PWMove,
NULL, (XtPointer) NULL},
{CopyRequest, sizeof(PWStatus),
DragOnePointEngage, (XtPointer) Paste,
DragOnePointTerminate, (XtPointer) ImmediateCopyRequest,
Interface, (XtPointer) PWUnmark},
{MoveRequest, sizeof(PWStatus),
DragOnePointEngage, (XtPointer) Paste,
DragOnePointTerminate, (XtPointer) ImmediateMoveRequest,
Interface, (XtPointer) PWUnmark},
{PointRequest, sizeof(PWStatus),
DragOnePointEngage, (XtPointer) PWDrawPoint,
DragOnePointTerminate, (XtPointer) PWDrawPoint,
NULL, (XtPointer) NULL},
{CurveRequest, sizeof(PWStatus),
DragTwoPointsEngage, (XtPointer) PWBlindLine,
DragTwoPointsTerminate, (XtPointer) PWBlindLine,
NULL, (XtPointer) NULL},
{LineRequest, sizeof(PWStatus),
TwoPointsEngage, (XtPointer) PWDrawLine,
TwoPointsTerminate, (XtPointer) PWDrawLine,
NULL, (XtPointer) NULL},
{RectangleRequest, sizeof(PWStatus),
TwoPointsEngage, (XtPointer) PWDrawRectangle,
TwoPointsTerminate, (XtPointer) PWDrawRectangle,
NULL, (XtPointer) NULL},
{FilledRectangleRequest, sizeof(PWStatus),
TwoPointsEngage, (XtPointer) PWDrawRectangle,
TwoPointsTerminate, (XtPointer) PWDrawFilledRectangle,
NULL, (XtPointer) NULL},
{CircleRequest, sizeof(PWStatus),
TwoPointsEngage, (XtPointer) PWDrawCircle,
TwoPointsTerminate, (XtPointer) PWDrawCircle,
NULL, (XtPointer) NULL},
{FilledCircleRequest, sizeof(PWStatus),
TwoPointsEngage, (XtPointer) PWDrawCircle,
TwoPointsTerminate, (XtPointer) PWDrawFilledCircle,
NULL, (XtPointer) NULL},
{FloodFillRequest, sizeof(PWStatus),
OnePointEngage, (XtPointer) NULL,
OnePointTerminate, (XtPointer) PWFloodFill,
NULL, (XtPointer) NULL},
{HotSpotRequest, sizeof(PWStatus),
OnePointEngage, (XtPointer) PWDrawHotSpot,
OnePointTerminate, (XtPointer) PWDrawHotSpot,
NULL, (XtPointer) NULL},
{PickPixelRequest, sizeof(PWStatus),
OnePointEngage, (XtPointer) PWPickPixelDraw,
OnePointTerminate, (XtPointer) PWPickPixelComplete,
NULL, (XtPointer) NULL},
{ZoomInRequest, sizeof(PWStatus),
TwoPointsEngage, (XtPointer) PWDrawRectangle,
TwoPointsTerminate, (XtPointer) PWZoomIn,
NULL, (XtPointer) NULL},
{TextRequest, sizeof(PWStatus),
OnePointEngage, (XtPointer) PWDragText,
OnePointTerminate, (XtPointer) PWDrawText,
NULL, (XtPointer) NULL},
};
|