Initial release of Maemo 5 port of gnuplot
[gnuplot] / term / xlib.trm
1 /* Hello, Emacs, this is -*-C-*-
2  * $Id: xlib.trm,v 1.20.2.2 2009/02/07 19:57:21 sfeam Exp $
3  */
4
5 /* GNUPLOT - xlib.trm */
6
7 /*
8  * xlib.trm - inboard terminal driver for X11 (dumps gnuplot_x11 commands)
9  *
10  * New implementation November 2003
11  * Xlib_init() sets up the output channels, but otherwise all work is done
12  * by the main x11.trm driver routines.
13  * Ethan A Merritt <merritt@u.washington.edu>
14  */
15
16 #include "driver.h"
17
18 #ifdef TERM_REGISTER
19 register_term(xlib)
20 #endif
21
22 #ifdef TERM_PROTO
23 TERM_PUBLIC void Xlib_init __PROTO((void));
24 TERM_PUBLIC void Xlib_text __PROTO((void));
25 TERM_PUBLIC void Xlib_reset __PROTO((void));
26 #define GOT_XLIB_PROTO
27 #endif
28
29 #ifndef TERM_PROTO_ONLY
30 #ifdef TERM_BODY
31
32 TERM_PUBLIC void
33 Xlib_init()
34 {
35     /* x11.trm thinks it is writing to a private pipe, but here we */
36     /* set it to use the channel opened by 'set output <file>'     */
37     X11_ipc = gpoutfile;
38
39 #ifdef PIPE_IPC
40     /* There is, of course, no mouse feedback */
41     ipc_back_fd = IPC_BACK_UNUSABLE;
42 #endif
43 }
44
45 TERM_PUBLIC void
46 Xlib_text()
47 {
48     PRINT0("E\n");
49     FFLUSH();
50 #ifdef PIPE_IPC
51     ipc_back_fd = IPC_BACK_UNUSABLE;
52 #endif
53
54 }
55
56 TERM_PUBLIC void
57 Xlib_reset()
58 {
59     X11_ipc = NULL;
60 }
61
62 #endif
63
64 #ifdef TERM_TABLE
65 TERM_TABLE_START(xlib_driver)
66     "xlib", "X11 Window System (gnulib_x11 dump)",
67     X11_XMAX, X11_YMAX, X11_VCHAR, X11_HCHAR,
68     X11_VTIC, X11_HTIC, X11_options, Xlib_init, Xlib_reset,
69     Xlib_text, null_scale, X11_graphics, X11_move, X11_vector,
70     X11_linetype, X11_put_text, X11_text_angle,
71     X11_justify_text, X11_point, do_arrow, X11_set_font,
72     X11_pointsize, TERM_CAN_MULTIPLOT|TERM_INIT_ON_REPLOT,
73     X11_text /* suspend can use same routine */ , 0 /* resume */ ,
74     X11_fillbox, X11_linewidth
75 #ifdef USE_MOUSE
76     , X11_waitforinput, X11_put_tmptext, X11_set_ruler, X11_set_cursor, X11_set_clipboard
77 #endif
78     , X11_make_palette, 0 /* X11_previous_palette */ ,
79     X11_set_color, X11_filled_polygon
80 #ifdef WITH_IMAGE
81     , X11_image
82 #endif
83     , ENHX11_OPEN, ENHX11_FLUSH, do_enh_writec
84 TERM_TABLE_END(xlib_driver)
85
86 #undef LAST_TERM
87 #define LAST_TERM xlib_driver
88
89 #endif /* TERM_TABLE */
90 #endif /* TERM_PROTO_ONLY */
91
92 #ifdef TERM_HELP
93 START_HELP(xlib)
94 "1 xlib",
95 "?commands set terminal xlib",
96 "?set terminal xlib",
97 "?set term xlib",
98 "?terminal xlib",
99 "?term xlib",
100 "?xlib",
101 " The `xlib` terminal driver supports the X11 Windows System.  It generates",
102 " gnuplot_x11 commands, but sends them to the output file specified by",
103 " `set output '<filename>'`. `set term x11` is equivalent to",
104 " `set output \"|gnuplot_x11 -noevents\"; set term xlib.`",
105 " `xlib` takes the same set of options as `x11`."
106 END_HELP(xlib)
107 #endif