home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / fortran / pgplot5.1 / pgplot5 / pgplot5.1.0 / include / XmPgplot.h < prev   
Encoding:
C/C++ Source or Header  |  1996-05-12  |  3.2 KB  |  97 lines

  1. #ifndef XmPgplot_h
  2. #define XmPgplot_h
  3.  
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7.  
  8. /*
  9.  * Define resource-name constants.
  10.  */
  11. #define XmpNminColors "minColors"
  12. #define XmpCMinColors "MinColors"
  13.  
  14. #define XmpNmaxColors "maxColors"
  15. #define XmpCMaxColors "MaxColors"
  16.  
  17. #define XMP_NORM_CURSOR  0 /* Un-augmented X cursor */
  18. #define XMP_LINE_CURSOR  1 /* Line cursor between ref and pointer */
  19. #define XMP_RECT_CURSOR  2 /* Rectangular cursor between ref and pointer */
  20. #define XMP_YRNG_CURSOR  3 /* Two horizontal lines, at ref.x and pointer.x */
  21. #define XMP_XRNG_CURSOR  4 /* Two vertical lines, at ref.y and pointer.y */
  22. #define XMP_HLINE_CURSOR 6 /* Horizontal line cursor at y=ref.y */
  23. #define XMP_VLINE_CURSOR 5 /* Vertical line cursor at x=ref.x */
  24. #define XMP_CROSS_CURSOR 7 /* Cross-hair cursor centered on the pointer */
  25.  
  26. /*
  27.  * When a cursor-input callback [previously registered using xmp_arm_cursor()]
  28.  * is called by the widget, the position of the cursor and the key
  29.  * that the user pressed are recorded in a struct of the following
  30.  * form. A pointer to this struct is then cast to (XtPointer) and
  31.  * passed as the 'call_data' argument of the callback function. The
  32.  * callback function should cast this argument back to
  33.  * (XmpCursorCallbackStruct *) in order to access its fields.
  34.  */
  35.  
  36. typedef struct {
  37.   float x,y;      /* The world-coordinate position of the cursor */
  38.   char key;       /* The key pressed by the user (Mouse buttons='A','D','X') */
  39. } XmpCursorCallbackStruct;
  40.  
  41. int xmp_arm_cursor(Widget widget, int mode, float xref, float yref,
  42.            XtCallbackProc callback, void *client_data);
  43. int xmp_disarm_cursor(Widget widget);
  44.  
  45. /*
  46.  * Record the official PGPLOT device name of the widget driver.
  47.  */
  48. #define XMP_DEVICE "XMOTIF"
  49.  
  50. /*
  51.  * The following function returns an unambiguous PGPLOT device-specification
  52.  * that can be used as the FILE argument of cpgbeg() to open a given PGPLOT
  53.  * widget. It simply returns a string composed of the widget name, followed
  54.  * by a "/" followed by XMP_DEVICE. Note that the returned string is owned
  55.  * by the widget and must not be free()d or overwritten.
  56.  */
  57. char *xmp_device_name(Widget widget);
  58.  
  59. /*
  60.  * After a widget has been opened to PGPLOT (via pgopen or pgbeg), the
  61.  * following function can be used to return the PGPLOT id of the device.
  62.  * When multiple PGPLOT devices are open this id can then be used with
  63.  * the PGPLOT cpgslct() function to select the widget as the currently
  64.  * selected PGPLOT graphics device.
  65.  *
  66.  * If the specified widget has not been opened to pgplot, or has been
  67.  * closed and not re-opened, then 0 will be returned.
  68.  */
  69. int xmp_device_id(Widget widget);
  70.  
  71. /*
  72.  * The following global is a pointer to the shared class context
  73.  * descriptor and is what is passed to XtCreateManagedWidget()
  74.  * to tell it what type of widget to create.
  75.  */
  76. externalref WidgetClass xmPgplotWidgetClass;
  77.  
  78. /*
  79.  * Declare opaque aliases to the widget class and instance structures.
  80.  */
  81. typedef struct XmPgplotClassRec *XmPgplotWidgetClass;
  82. typedef struct XmPgplotRec *XmPgplotWidget;
  83.  
  84. /*
  85.  * Convenience widget creation functions.
  86.  */
  87. Widget XmCreatePgplot(Widget parent, char *name, ArgList arglist,
  88.               Cardinal argcount);
  89. Widget XmCreateScrolledPgplot(Widget parent, char *name, ArgList arglist,
  90.                   Cardinal argcount);
  91.  
  92. #ifdef __cplusplus
  93. }
  94. #endif
  95.  
  96. #endif
  97.