home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-386-Vol-2of3.iso / c / cwikwidg.zip / cwikwidget / Image / Image.h < prev    next >
C/C++ Source or Header  |  1992-04-01  |  3KB  |  89 lines

  1. /*
  2.  * Copyright 1992 John L. Cwikla
  3.  * 
  4.  * Permission to use, copy, modify, distribute, and sell this software
  5.  * and its documentation for any purpose is hereby granted without fee,
  6.  * provided that the above copyright notice appears in all copies and that
  7.  * both that copyright notice and this permission notice appear in
  8.  * supporting documentation, and that the name of John L. Cwikla or
  9.  * University of Illinois not be used in advertising or publicity
  10.  * pertaining to distribution of the software without specific, written
  11.  * prior permission.  John L. Cwikla and University of Illinois make no
  12.  * representations about the suitability of this software for any
  13.  * purpose.  It is provided "as is" without express or implied warranty.
  14.  *
  15.  * John L. Cwikla and University of Illinois disclaim all warranties with
  16.  * regard to this software, including all implied warranties of
  17.  * merchantability and fitness, in no event shall John L. Cwikla or
  18.  * University of Illinois be liable for any special, indirect or
  19.  * consequential damages or any damages whatsoever resulting from loss of
  20.  * use, data or profits, whether in an action of contract, negligence or
  21.  * other tortious action, arising out of or in connection with the use or
  22.  * performance of this software.
  23.  *
  24.  * Author:
  25.  *     John L. Cwikla
  26.  *     Materials Research Laboratory Center for Computation
  27.  *     University Of Illinois at Urbana-Champaign
  28.  *    104 S. Goodwin
  29.  *     Urbana, IL 61801
  30.  * 
  31.  *     cwikla@uimrl7.mrl.uiuc.edu
  32.  */
  33.  
  34. #ifndef IMAGE__H
  35. #define IMAGE__H
  36.  
  37. /*
  38. ** Image Widget
  39. */
  40.  
  41. extern WidgetClass imageWidgetClass;
  42. typedef struct _ImageClassRec *ImageWidgetClass;
  43. typedef struct _ImageRec *ImageWidget;
  44.  
  45. #ifndef XtIsImage
  46. #define XtIsImage(w) XtIsSubclass((w), imageWidgetClass)
  47. #endif
  48.  
  49. #define XtNselectCallback "selectCallback"
  50. #define XtNdata "data"
  51. #define XtNdataWidth "dataWidth"
  52. #define XtNdataHeight "dataHeight"
  53. #define XtNgravity "gravity"
  54.  
  55. #define XtCData "Data"
  56. #define XtCDataWidth "DataWidth"
  57. #define XtCDataHeight "DataHeight"
  58. #define XtCGravity "Gravity"
  59.  
  60. #define XtRGravity "Gravity"
  61.  
  62. /* Reasons */
  63. #define IMAGE_SELECT 1
  64.  
  65. typedef struct _ImageCallbackStruct
  66. {
  67.   int reason;
  68.   XEvent *event;
  69.   Pixel pixel;
  70. } ImageCallbackStruct, *ImageCallbackPtr;
  71.  
  72. typedef struct _ImageErrorStruct
  73. {
  74.   int reason;
  75. } ImageErrorStruct, *ImageErrorPtr;
  76.  
  77. extern void ImageAddPixel(Widget _w, int _value);
  78. extern XImage *ImageGetImage(Widget _w, int _xcoord, int _ycoord, unsigned int _width,
  79.   unsigned int _height, long _planeMask, int imageFormat);
  80. extern Pixel ImageGetPixel(Widget _w, int _x, int _y);
  81. extern XImage *ImageGetSubImage(Drawable _d, Widget _dest, int _srcX, int _srcY,
  82.   long planeMask, int _destX, int _destY);
  83. extern void ImagePutImage(Widget _w, Drawable _d, GC _gc, int _srcX, int _srcY,
  84.   int _destX, int _destY, unsigned int _width, unsigned int _height);
  85. extern void ImagePutPixel(Widget _w, int _x, int _y, Pixel _pixel);
  86. extern XImage *ImageSubImage(Widget _w, int _x, int _y, unsigned int _width, unsigned int _height);
  87.   
  88. #endif /* IMAGE__H */
  89.