Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007 #ifndef __PLTKWD_H__
00008 #define __PLTKWD_H__
00009
00010 #include "plplot.h"
00011 #include "plstrm.h"
00012
00013
00014
00015 #ifndef MAC_TCL
00016 #ifndef __MWERKS__
00017 #include <sys/types.h>
00018 #endif
00019 #endif
00020
00021 #include <tk.h>
00022 #ifdef MAC_TCL
00023 #else
00024
00025 #include <X11/Xlib.h>
00026 #include <X11/Xutil.h>
00027 #include <X11/cursorfont.h>
00028 #include <X11/keysym.h>
00029 #endif
00030
00031
00032 #define PLTKDISPLAYS 100
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 static int plplot_tkwin_ccmap = 0;
00043
00044
00045
00046
00047 typedef struct
00048 {
00049 int nstreams;
00050 int ixwd;
00051 char *displayName;
00052 int screen;
00053 Display *display;
00054 Visual *visual;
00055 GC gcXor;
00056 Colormap map;
00057 unsigned depth;
00058 int color;
00059 int ncol0;
00060 int ncol1;
00061 XColor cmap0[16];
00062 XColor cmap1[256];
00063 XColor fgcolor;
00064 Tk_Cursor xhair_cursor;
00065 } TkwDisplay;
00066
00067
00068
00069 typedef struct
00070 {
00071 TkwDisplay *tkwd;
00072
00073 Window window;
00074 Pixmap pixmap;
00075 GC gc;
00076 XColor curcolor;
00077
00078 long event_mask;
00079 int flags;
00080 long init_width;
00081 long init_height;
00082
00083 unsigned width, height, border;
00084
00085 double xscale_init;
00086 double yscale_init;
00087 double xscale;
00088 double yscale;
00089
00090 short xlen, ylen;
00091
00092 int write_to_window;
00093 int write_to_pixmap;
00094
00095 int instr;
00096 int max_instr;
00097
00098 PLGraphicsIn gin;
00099
00100 int locate_mode;
00101 int drawing_xhairs;
00102 XPoint xhair_x[2], xhair_y[2];
00103
00104 void ( *MasterEH )( PLStream *, XEvent * );
00105 } TkwDev;
00106
00107
00108
00109
00110
00111 #ifdef __cplusplus
00112 extern "C" {
00113 #endif
00114
00115
00116
00117 void
00118 plD_open_tkwin( PLStream *pls );
00119
00120
00121
00122 void
00123 PLColor_to_TkColor( PLColor *plcolor, XColor *xcolor );
00124
00125
00126
00127 void
00128 PLColor_from_TkColor( PLColor *plcolor, XColor *xcolor );
00129
00130
00131 int
00132 PLColor_from_TkColor_Changed( PLColor *plcolor, XColor *xcolor );
00133
00134 void Tkw_StoreColor( PLStream* pls, TkwDisplay* tkwd, XColor* col );
00135
00136
00137
00138 void
00139 pltkwin_setBGFG( PLStream *pls );
00140
00141 #ifdef __cplusplus
00142 }
00143 #endif
00144
00145 #endif // __PLTKWD_H__