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
|
#ifndef XaPgplot_h
#define XaPgplot_h
#ifdef __cplusplus
extern "C" {
#endif
/*
* Define resource-name constants.
*/
#define XapNminColors "minColors"
#define XapCMinColors "MinColors"
#define XapNmaxColors "maxColors"
#define XapCMaxColors "MaxColors"
#define XapNpadX "padX"
#define XapCPadX "PadX"
#define XapNpadY "padY"
#define XapCPadY "PadY"
#define XapNshare "share"
#define XapCShare "Share"
#define XAP_NORM_CURSOR 0 /* Un-augmented X cursor */
#define XAP_LINE_CURSOR 1 /* Line cursor between ref and pointer */
#define XAP_RECT_CURSOR 2 /* Rectangular cursor between ref and pointer */
#define XAP_YRNG_CURSOR 3 /* Two horizontal lines, at ref.x and pointer.x */
#define XAP_XRNG_CURSOR 4 /* Two vertical lines, at ref.y and pointer.y */
#define XAP_HLINE_CURSOR 6 /* Horizontal line cursor at y=ref.y */
#define XAP_VLINE_CURSOR 5 /* Vertical line cursor at x=ref.x */
#define XAP_CROSS_CURSOR 7 /* Cross-hair cursor centered on the pointer */
/*
* When a cursor-input callback [previously registered using xap_arm_cursor()]
* is called by the widget, the position of the cursor and the key
* that the user pressed are recorded in a struct of the following
* form. A pointer to this struct is then cast to (XtPointer) and
* passed as the 'call_data' argument of the callback function. The
* callback function should cast this argument back to
* (XapCursorCallbackStruct *) in order to access its fields.
*/
typedef struct {
float x,y; /* The world-coordinate position of the cursor */
char key; /* The key pressed by the user (Mouse buttons='A','D','X') */
} XapCursorCallbackStruct;
int xap_arm_cursor(Widget widget, int mode, float xref, float yref,
XtCallbackProc callback, void *client_data);
int xap_disarm_cursor(Widget widget);
/*
* Record the official PGPLOT device name of the widget driver.
*/
#define XAP_DEVICE "XATHENA"
/*
* The following function returns an unambiguous PGPLOT device-specification
* that can be used as the FILE argument of cpgbeg() to open a given PGPLOT
* widget. It simply returns a string composed of the widget name, followed
* by a "/" followed by XAP_DEVICE. Note that the returned string is owned
* by the widget and must not be free()d or overwritten.
*/
char *xap_device_name(Widget widget);
/*
* After a widget has been opened to PGPLOT (via pgopen or pgbeg), the
* following function can be used to return the PGPLOT id of the device.
* When multiple PGPLOT devices are open this id can then be used with
* the PGPLOT cpgslct() function to select the widget as the currently
* selected PGPLOT graphics device.
*
* If the specified widget has not been opened to pgplot, or has been
* closed and not re-opened, then 0 will be returned.
*/
int xap_device_id(Widget widget);
/*
* The following global is a pointer to the shared class context
* descriptor and is what is passed to XtCreateManagedWidget()
* to tell it what type of widget to create.
*/
externalref WidgetClass xaPgplotWidgetClass;
/*
* Declare opaque aliases to the widget class and instance structures.
*/
typedef struct XaPgplotClassRec *XaPgplotWidgetClass;
typedef struct XaPgplotRec *XaPgplotWidget;
/*
* Convenience widget creation functions.
*/
Widget XaCreatePgplot(Widget parent, char *name, ArgList arglist,
Cardinal argcount);
/*
* The following functions allow conversions between PGPLOT world coordinates
* and X-window pixel coordinates.
*/
int xap_pixel_to_world(Widget widget, int px, int py, float *wx, float *wy);
int xap_world_to_pixel(Widget widget, float wx, float wy, int *px, int *py);
#ifdef __cplusplus
}
#endif
#endif
|