File: xlib.trm

package info (click to toggle)
gnuplot 4.6.6-1~bpo70%2B1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy-backports
  • size: 15,640 kB
  • sloc: ansic: 85,383; cpp: 6,743; lisp: 3,999; makefile: 2,126; sh: 976; objc: 647; asm: 539; perl: 310; awk: 235; pascal: 194; csh: 179; tcl: 88; python: 46
file content (108 lines) | stat: -rw-r--r-- 2,692 bytes parent folder | download | duplicates (2)
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
/* Hello, Emacs, this is -*-C-*-
 * $Id: xlib.trm,v 1.23.4.3 2013/09/03 04:25:10 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 <merritt@u.washington.edu>
 */

#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

static FILE *X11_save_ipc = NULL;

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 <file>'     */
    X11_save_ipc = X11_ipc;
    X11_ipc = gpoutfile;

#ifdef PIPE_IPC
    /* There is, of course, no mouse feedback */
    ipc_back_fd = IPC_BACK_UNUSABLE;
#endif
    term_initialised = TRUE;
}

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 = X11_save_ipc;
}

#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|TERM_CAN_DASH,
    X11_text /* suspend can use same routine */ , 0 /* resume */ ,
    X11_fillbox, X11_linewidth
#ifdef USE_MOUSE
    , NULL, NULL, NULL, NULL, NULL
#endif
    , X11_make_palette, 0 /* X11_previous_palette */ ,
    X11_set_color, X11_filled_polygon
    , X11_image
    , 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 '<filename>'`. `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