/* GNUPLOT - qt.trm */
/*[
* Copyright 2009 Jrme Lodewyck
*
* Permission to use, copy, and distribute this software and its
* documentation for any purpose with or without fee is hereby granted,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation.
*
* Permission to modify the software is granted, but not the right to
* distribute the complete modified source code. Modifications are to
* be distributed as patches to the released version. Permission to
* distribute binaries produced by compiling modified sources is granted,
* provided you
* 1. distribute the corresponding source modifications from the
* released version in the form of a patch file along with the binaries,
* 2. add special version identification to distinguish your version
* in addition to the base release version number,
* 3. provide your name and address as the primary contact for the
* support of your modified version, and
* 4. retain our contact information in regard to use of the base
* software.
* Permission to distribute the released version of the source code along
* with corresponding source modifications in the form of a patch file is
* granted with same provisions 2 through 4 for binary distributions.
*
* This software is provided "as is" without express or implied warranty
* to the extent permitted by applicable law.
]*/
#ifdef TERM_REGISTER
register_term (qt)
#endif
#ifndef TERM_PROTO_ONLY
#ifdef TERM_BODY
#include "qtterminal/qt_term.h"
#endif /* TERM_BODY */
#ifdef TERM_TABLE
TERM_TABLE_START (qt_driver)
"qt", "Qt cross-platform interactive terminal",
/* the following values are overridden by qt_graphics */
1 /* xmax */ , 1 /* ymax */ , 1 /* vchar */ , 1 /* hchar */ ,
1 /* vtic */ , 1 /* htic */ ,
qt_options, qt_init, qt_reset, qt_text_wrapper, null_scale, qt_graphics,
qt_move, qt_vector, qt_linetype, qt_put_text,
qt_text_angle, qt_justify_text,
qt_point, do_arrow, qt_set_font,
qt_pointsize,
TERM_CAN_MULTIPLOT|TERM_NO_OUTPUTFILE|TERM_ALPHA_CHANNEL|TERM_CAN_DASH|TERM_ENHANCED_TEXT|TERM_POLYGON_PIXELS|TERM_LINEWIDTH|TERM_COLORBOX_IMAGE,
0 /* suspend */, 0 /* resume */, qt_fillbox, qt_linewidth
#ifdef USE_MOUSE
, qt_waitforinput, qt_put_tmptext, qt_set_ruler, qt_set_cursor, qt_set_clipboard
#endif
, qt_make_palette, 0 /* qt_previous_palette */, qt_set_color, qt_filled_polygon
, qt_image
, qt_enhanced_open, qt_enhanced_flush, qt_enhanced_writec
, qt_layer
, NULL /* qt_path */
, 0.0 /* Scale (unused) */
, qt_hypertext
, qt_boxed_text
, qt_modify_plots
, qt_dashtype
TERM_TABLE_END (qt_driver)
#undef LAST_TERM
#define LAST_TERM qt_driver
#endif /* TERM_TABLE */
#endif /* TERM_PROTO_ONLY */
#ifdef TERM_HELP
START_HELP(qt)
"1 qt",
"?set terminal qt",
"?terminal qt",
"?set term qt",
"?term qt",
"?qt",
" The `qt` terminal device generates output in a separate window with the Qt library."
"",
" Syntax:",
" set term qt {}",
" {size ,}",
" {position ,}",
" {title \"title\"}",
" {font } {{no}enhanced}",
" {rounded|butt}",
" {{no}replotonresize}",
" {{no}antialias}",
" {linewidth } {dashlength }",
" {{no}persist} {{no}raise} {{no}ctrl}",
" {close}",
" {widget }",
"",
" Multiple plot windows are supported: `set terminal qt ` directs the",
" output to plot window number n.",
"",
" The default window title is based on the window number. This title can also",
" be specified with the keyword \"title\".",
"",
" Plot windows remain open even when the `gnuplot` driver is changed to a",
" different device. A plot window can be closed by pressing the letter 'q'",
" while that window has input focus, by choosing `close` from a window",
" manager menu, or with `set term qt close`.",
"",
" The size of the plot area is given in pixels, it defaults to 640x480.",
" In addition to that, the actual size of the window also includes the space",
" reserved for the toolbar and the status bar.",
" When you resize a window, the plot is immediately scaled to fit in the",
" new size of the window. The `qt` terminal scales the whole plot, including",
" fonts and linewidths, and keeps its global aspect ratio constant.",
" If you type `replot`, click the `replot` icon in the terminal toolbar or",
" type a new `plot` command, the new plot will completely fit in the window",
" and the font size and the linewidths will be reset to their defaults.",
"",
" The position option can be used to set the position of the plot window.",
" The position option only applies to the first plot after the `set term`",
" command.",
"",
"",
" The active plot window (the one selected by `set term qt `) is",
" interactive. Its behaviour is shared with other terminal types. See `mouse`",
" for details. It also has some extra icons, which are supposed to be",
" self-explanatory.",
"",
" This terminal supports an enhanced text mode, which allows font and other",
" formatting commands (subscripts, superscripts, etc.) to be embedded in labels",
" and other text strings. The enhanced text mode syntax is shared with other",
" gnuplot terminal types. See `enhanced` for more details.",
"",
" is in the format \"FontFace,FontSize\", i.e. the face and the size",
" comma-separated in a single string. FontFace is a usual font face name, such",
" as \'Arial\'. If you do not provide FontFace, the qt terminal will use",
" \'Sans\'. FontSize is the font size, in points. If you do not provide it,",
" the qt terminal will use a size of 9 points.",
" For example :",
" set term qt font \"Arial,12\"",
" set term qt font \"Arial\" # to change the font face only",
" set term qt font \",12\" # to change the font size only",
" set term qt font \"\" # to reset the font name and size",
"",
" The dashlength affects only custom dash patterns, not Qt's built-in set.",
"",
#if (QTVER == 4)
" The Qt rendering speed is affected strongly by the rendering mode used.",
" In Qt version 4 this can be controlled by the environmental",
" variable QT_GRAPHICSSYSTEM. The options are \"native\", \"raster\", or",
" \"opengl\" in order of increasing rendering speed. For earlier versions",
" of Qt the terminal defaults to \"raster\".",
"",
#endif
" To obtain the best output possible, the rendering involves three",
" mechanisms : antialiasing, oversampling and hinting.",
" Oversampling combined with antialiasing provides subpixel accuracy,",
" so that gnuplot can draw a line from non-integer coordinates. This avoids",
" wobbling effects on diagonal lines ('plot x' for example).",
" Hinting avoids the blur on horizontal and vertical lines caused by",
" oversampling. The terminal will snap these lines to integer coordinates so",
" that a one-pixel-wide line will actually be drawn on one and only one pixel.",
"",
" `butt` instructs the driver to use a line drawing method that does",
" not overshoot the desired end point of a line. This setting is only",
" applicable for line widths greater than 1. This setting is most useful when",
" drawing horizontal or vertical lines. Default is `rounded`.",
"",
" The option `replotonresize` replots the data when the plot window is",
" resized. Without this option, the even-aspect-ratio scaling may result in the",
" plot filling only part of the window after resizing. With this option, gnuplot",
" does a full replot on each resize event, resulting in better space",
" utilization. This option is generally desirable, unless the potentially",
" CPU-intensive replotting during resizing is a concern. Replots can be manually",
" initiated with hotkey 'e' or the 'replot' command.",
"",
" By default, the window is raised to the top of your desktop when a plot is",
" drawn. This can be controlled with the keyword \"raise\".",
" The keyword \"persist\" will prevent gnuplot from exiting before you",
" explicitly close all the plot windows.",
"",
" The key raises the gnuplot console window [MS Windows only].",
" The 'q' key closes the plot window. These hot keys can be changed to",
" ctrl-space and ctrl-q using the terminal option keyword \"{no}ctrl\".",
" However the preferred way to select ctrl-q rather than 'q' is to use",
" the toggle in the tools widget of the plot window.",
"",
" The gnuplot outboard driver, gnuplot_qt, is searched in a default place",
" chosen when the program is compiled. You can override that by defining",
" the environment variable GNUPLOT_DRIVER_DIR."
END_HELP(qt)
#endif /* TERM_HELP */