X-Git-Url: http://git.maemo.org/git/?p=gnuplot;a=blobdiff_plain;f=term%2Fxlib.trm;fp=term%2Fxlib.trm;h=721466395d5f7f2020ae4309f7dd6c6aeca6b760;hp=0000000000000000000000000000000000000000;hb=39ec1247a71f61152a4a7f502a30f06a3896c5da;hpb=06be459be4f5f6a7c6ff878e84f355fb2575caa8 diff --git a/term/xlib.trm b/term/xlib.trm new file mode 100644 index 0000000..7214663 --- /dev/null +++ b/term/xlib.trm @@ -0,0 +1,107 @@ +/* Hello, Emacs, this is -*-C-*- + * $Id: xlib.trm,v 1.20.2.2 2009/02/07 19:57:21 sfeam Exp $ + */ + +/* GNUPLOT - xlib.trm */ + +/* + * xlib.trm - inboard terminal driver for X11 (dumps gnuplot_x11 commands) + * + * New implementation November 2003 + * Xlib_init() sets up the output channels, but otherwise all work is done + * by the main x11.trm driver routines. + * Ethan A Merritt + */ + +#include "driver.h" + +#ifdef TERM_REGISTER +register_term(xlib) +#endif + +#ifdef TERM_PROTO +TERM_PUBLIC void Xlib_init __PROTO((void)); +TERM_PUBLIC void Xlib_text __PROTO((void)); +TERM_PUBLIC void Xlib_reset __PROTO((void)); +#define GOT_XLIB_PROTO +#endif + +#ifndef TERM_PROTO_ONLY +#ifdef TERM_BODY + +TERM_PUBLIC void +Xlib_init() +{ + /* x11.trm thinks it is writing to a private pipe, but here we */ + /* set it to use the channel opened by 'set output ' */ + X11_ipc = gpoutfile; + +#ifdef PIPE_IPC + /* There is, of course, no mouse feedback */ + ipc_back_fd = IPC_BACK_UNUSABLE; +#endif +} + +TERM_PUBLIC void +Xlib_text() +{ + PRINT0("E\n"); + FFLUSH(); +#ifdef PIPE_IPC + ipc_back_fd = IPC_BACK_UNUSABLE; +#endif + +} + +TERM_PUBLIC void +Xlib_reset() +{ + X11_ipc = NULL; +} + +#endif + +#ifdef TERM_TABLE +TERM_TABLE_START(xlib_driver) + "xlib", "X11 Window System (gnulib_x11 dump)", + X11_XMAX, X11_YMAX, X11_VCHAR, X11_HCHAR, + X11_VTIC, X11_HTIC, X11_options, Xlib_init, Xlib_reset, + Xlib_text, null_scale, X11_graphics, X11_move, X11_vector, + X11_linetype, X11_put_text, X11_text_angle, + X11_justify_text, X11_point, do_arrow, X11_set_font, + X11_pointsize, TERM_CAN_MULTIPLOT|TERM_INIT_ON_REPLOT, + X11_text /* suspend can use same routine */ , 0 /* resume */ , + X11_fillbox, X11_linewidth +#ifdef USE_MOUSE + , X11_waitforinput, X11_put_tmptext, X11_set_ruler, X11_set_cursor, X11_set_clipboard +#endif + , X11_make_palette, 0 /* X11_previous_palette */ , + X11_set_color, X11_filled_polygon +#ifdef WITH_IMAGE + , X11_image +#endif + , ENHX11_OPEN, ENHX11_FLUSH, do_enh_writec +TERM_TABLE_END(xlib_driver) + +#undef LAST_TERM +#define LAST_TERM xlib_driver + +#endif /* TERM_TABLE */ +#endif /* TERM_PROTO_ONLY */ + +#ifdef TERM_HELP +START_HELP(xlib) +"1 xlib", +"?commands set terminal xlib", +"?set terminal xlib", +"?set term xlib", +"?terminal xlib", +"?term xlib", +"?xlib", +" The `xlib` terminal driver supports the X11 Windows System. It generates", +" gnuplot_x11 commands, but sends them to the output file specified by", +" `set output ''`. `set term x11` is equivalent to", +" `set output \"|gnuplot_x11 -noevents\"; set term xlib.`", +" `xlib` takes the same set of options as `x11`." +END_HELP(xlib) +#endif