home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / X / mit / clients / bitmap / Requests.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-02-22  |  4.7 KB  |  139 lines

  1. /*
  2.  * $XConsortium: Requests.h,v 1.5 90/12/08 17:29:57 dmatic Exp $
  3.  *
  4.  * Copyright 1989 Massachusetts Institute of Technology
  5.  *
  6.  * Permission to use, copy, modify, distribute, and sell this software and its
  7.  * documentation for any purpose is hereby granted without fee, provided that
  8.  * the above copyright notice appear in all copies and that both that
  9.  * copyright notice and this permission notice appear in supporting
  10.  * documentation, and that the name of M.I.T. not be used in advertising or
  11.  * publicity pertaining to distribution of the software without specific,
  12.  * written prior permission.  M.I.T. makes no representations about the
  13.  * suitability of this software for any purpose.  It is provided "as is"
  14.  * without express or implied warranty.
  15.  *
  16.  * M.I.T. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
  17.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL M.I.T.
  18.  * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  19.  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
  20.  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  21.  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  22.  *
  23.  * Author:  Davor Matic, MIT X Consortium
  24.  */
  25.  
  26. typedef struct {
  27.     Boolean  success;
  28.     Position at_x, at_y;
  29.     Position from_x, from_y,
  30.              to_x, to_y;
  31.     void   (*draw)();
  32.     int      value;
  33.     Time     btime;
  34.     int      state;
  35. } BWStatus;
  36.  
  37. void OnePointEngage();
  38. void OnePointTerminate();
  39. void OnePointTerminateTransparent();
  40. void DragOnePointEngage();
  41. void DragOnePointTerminate();
  42. void TwoPointsEngage();
  43. void TwoPointsTerminate();
  44. void TwoPointsTerminateTransparent();
  45. void TwoPointsTerminateTimed();
  46. void DragTwoPointsEngage();
  47. void DragTwoPointsTerminate();
  48. void Interface();
  49. void Paste();
  50.  
  51. void BWMark();
  52. void BWUnmark();
  53. void BWStore();
  54. void BWDragMarked();
  55. void BWDragStored();
  56. void BWRestore();
  57. void BWCopy();
  58. void BWMove();
  59. void BWDrawPoint();
  60. void BWDrawLine();
  61. void BWBlindLine();
  62. void BWDrawRectangle();
  63. void BWDrawFilledRectangle();
  64. void BWDrawCircle();
  65. void BWDrawFilledCircle();
  66. void BWFloodFill();
  67. void BWDrawHotSpot();
  68. void BWChangeNotify();
  69. void BWZoomIn();
  70.  
  71. static BWRequestRec requests[] = /* SUPPRESS 592 */
  72. {
  73. {MarkRequest, sizeof(BWStatus),
  74.      TwoPointsEngage, (caddr_t) BWDrawRectangle,
  75.      TwoPointsTerminateTimed, (caddr_t) BWSelect,
  76.      NULL, (caddr_t) NULL},
  77. {RestoreRequest, sizeof(BWStatus),
  78.      OnePointEngage, (caddr_t) BWDragStored,
  79.      OnePointTerminate, (caddr_t) BWRestore,
  80.      NULL, (caddr_t) NULL},
  81. {ImmediateCopyRequest, sizeof(BWStatus),
  82.      OnePointEngage, (caddr_t) BWDragMarked,
  83.      OnePointTerminate, (caddr_t) BWCopy,
  84.      NULL, (caddr_t) NULL},
  85. {ImmediateMoveRequest, sizeof(BWStatus),
  86.      OnePointEngage, (caddr_t) BWDragMarked,
  87.      OnePointTerminate, (caddr_t) BWMove,
  88.      NULL, (caddr_t) NULL},
  89. {CopyRequest, sizeof(BWStatus),
  90.      DragOnePointEngage, (caddr_t) Paste,
  91.      DragOnePointTerminate, (caddr_t) ImmediateCopyRequest,
  92.      Interface, (caddr_t) BWUnmark},
  93. {MoveRequest, sizeof(BWStatus),
  94.      DragOnePointEngage, (caddr_t) Paste,
  95.      DragOnePointTerminate, (caddr_t) ImmediateMoveRequest,
  96.      Interface, (caddr_t) BWUnmark},
  97. {PointRequest, sizeof(BWStatus),
  98.      DragOnePointEngage, (caddr_t) BWDrawPoint,
  99.      DragOnePointTerminate, (caddr_t) BWDrawPoint,
  100.      NULL, (caddr_t) NULL},
  101. {CurveRequest, sizeof(BWStatus),
  102.      DragTwoPointsEngage, (caddr_t) BWBlindLine,
  103.      DragTwoPointsTerminate, (caddr_t) BWBlindLine,
  104.      NULL, (caddr_t) NULL},
  105. {LineRequest, sizeof(BWStatus), 
  106.      TwoPointsEngage, (caddr_t) BWDrawLine, 
  107.      TwoPointsTerminate, (caddr_t) BWDrawLine,
  108.      NULL, (caddr_t) NULL},
  109. {RectangleRequest, sizeof(BWStatus), 
  110.      TwoPointsEngage, (caddr_t) BWDrawRectangle,
  111.      TwoPointsTerminate, (caddr_t) BWDrawRectangle,
  112.      NULL, (caddr_t) NULL},
  113. {FilledRectangleRequest, sizeof(BWStatus), 
  114.      TwoPointsEngage, (caddr_t) BWDrawRectangle,
  115.      TwoPointsTerminate, (caddr_t) BWDrawFilledRectangle,
  116.      NULL, (caddr_t) NULL},
  117. {CircleRequest, sizeof(BWStatus), 
  118.      TwoPointsEngage, (caddr_t) BWDrawCircle,
  119.      TwoPointsTerminate, (caddr_t) BWDrawCircle,
  120.      NULL, (caddr_t) NULL},
  121. {FilledCircleRequest, sizeof(BWStatus), 
  122.      TwoPointsEngage, (caddr_t) BWDrawCircle, 
  123.      TwoPointsTerminate, (caddr_t) BWDrawFilledCircle,
  124.      NULL, (caddr_t) NULL},
  125. {FloodFillRequest, sizeof(BWStatus),
  126.      OnePointEngage, (caddr_t) NULL,
  127.      OnePointTerminate, (caddr_t) BWFloodFill,
  128.      NULL, (caddr_t) NULL},
  129. {HotSpotRequest, sizeof(BWStatus),
  130.      OnePointEngage, (caddr_t) BWDrawHotSpot,
  131.      OnePointTerminate, (caddr_t) BWDrawHotSpot,
  132.      NULL, (caddr_t) NULL},
  133. {ZoomInRequest, sizeof(BWStatus),
  134.      TwoPointsEngage, (caddr_t) BWDrawRectangle,
  135.      TwoPointsTerminate, (caddr_t) BWZoomIn,
  136.      NULL, (caddr_t) NULL},
  137. };
  138.  
  139.