Scale.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. /*
  2. Copyright 1993, 1998 The Open Group
  3. Permission to use, copy, modify, distribute, and sell this software and its
  4. documentation for any purpose is hereby granted without fee, provided that
  5. the above copyright notice appear in all copies and that both that
  6. copyright notice and this permission notice appear in supporting
  7. documentation.
  8. The above copyright notice and this permission notice shall be included
  9. in all copies or substantial portions of the Software.
  10. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  11. OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  12. MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  13. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
  14. OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  15. ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  16. OTHER DEALINGS IN THE SOFTWARE.
  17. Except as contained in this notice, the name of The Open Group shall
  18. not be used in advertising or otherwise to promote the sale, use or
  19. other dealings in this Software without prior written authorization
  20. from The Open Group.
  21. */
  22. #ifndef _XawScale_h
  23. #define _XawScale_h
  24. /***********************************************************************
  25. *
  26. * Scale Widget
  27. *
  28. ***********************************************************************/
  29. #include <X11/Xaw/Simple.h>
  30. #include <X11/Xmu/Converters.h>
  31. /* Resources:
  32. All the SimpleWidget resources plus...
  33. Name Class RepType Default Value
  34. ---- ----- ------- -------------
  35. aspectRatio AspectRatio Float 1.0
  36. autoscale Autoscale Boolean True
  37. bufferSize BufferSize Cardinal 1024
  38. foreground Foreground Pixel XtDefaultForeground
  39. gravity Gravity XtGravity ForgetGravity
  40. image Image XImage* NULL
  41. internalHeight Height Dimension 2
  42. internalWidth Width Dimension 2
  43. pasteBuffer PasteBuffer Boolean False
  44. precision Precision Float 0.001
  45. proportional Proportional Boolean False
  46. resize Resize Boolean True
  47. scaleX ScaleValue Float 1.0
  48. scaleY ScaleValue Float 1.0
  49. userData UserData XtPointer NULL
  50. visual Visual Visual* CopyFromParent
  51. */
  52. #ifndef _XtStringDefs_h_
  53. #define XtNforeground "foreground"
  54. #define XtNinternalWidth "internalWidth"
  55. #define XtNinternalHeight "internalHeight"
  56. #define XtNresize "resize"
  57. #define XtCResize "Resize"
  58. #endif
  59. #define XtNaspectRatio "aspectRatio"
  60. #define XtCAspectRatio "AspectRatio"
  61. #define XtNbufferSize "bufferSize"
  62. #define XtCBufferSize "BufferSize"
  63. #define XtNscaleX "scaleX"
  64. #define XtNscaleY "scaleY"
  65. #define XtCScaleFactor "ScaleFactor"
  66. #define XtNautoscale "autoscale"
  67. #define XtCAutoscale "Autoscale"
  68. #define XtNproportional "proportional"
  69. #define XtCProportional "Proportional"
  70. #define XtNprecision "precision"
  71. #define XtCPrecision "Precision"
  72. #define XtNgravity "gravity"
  73. #define XtCGravity "Gravity"
  74. #define XtNpasteBuffer "pasteBuffer"
  75. #define XtCPasteBuffer "PasteBuffer"
  76. #define XtNimage "image"
  77. #define XtCImage "image"
  78. #define XtNexponent "exponent"
  79. #define XtCExponent "Exponent"
  80. #define XtNuserData "userData"
  81. #define XtCuserData "UserData"
  82. #define XtRuserData "UserData"
  83. #define XtRImage "Image"
  84. #ifndef XtNvisual
  85. #define XtNvisual "visual"
  86. #endif
  87. #define XtCvisual "Visual"
  88. #define XtRvisual "Visual"
  89. /* Class record constants */
  90. extern WidgetClass scaleWidgetClass;
  91. typedef struct _ScaleClassRec *ScaleWidgetClass;
  92. typedef struct _ScaleRec *ScaleWidget;
  93. extern int SWGetImagePixel ( Widget w, Position x, Position y,
  94. Position *img_x, Position *img_y,
  95. Pixel *img_pixel );
  96. extern void SWUnscale ( Widget w, XEvent *event, String *params,
  97. Cardinal *num_params );
  98. extern void SWAutoscale ( Widget w, XEvent *event, String *params,
  99. Cardinal *num_params );
  100. extern void SWInitialSize ( Widget w, XEvent *event, String *params,
  101. Cardinal *num_params );
  102. extern void SWSetImage ( Widget w, XImage *image );
  103. extern void RequestSelection ( Widget w, XEvent *event, String *params,
  104. Cardinal *num_params );
  105. extern void GrabSelection ( Widget w, XEvent *event, String *params,
  106. Cardinal *num_params );
  107. extern Pixmap SWGetPixmap ( Widget w );
  108. #endif /* _XawScale_h */