Term-Gnuplot

 view release on metacpan or  search on metacpan

Gnuplot.h  view on Meta::CPAN

    int flags;
    void (*suspend) __PROTO((void)); /* called after one plot of multiplot */
    void (*resume)  __PROTO((void)); /* called before plots of multiplot */
    void (*fillbox) __PROTO((int, unsigned int, unsigned int, unsigned int, unsigned int)); /* clear in multiplot mode */
    void (*linewidth) __PROTO((double linewidth));
#ifdef USE_MOUSE
    int (*waitforinput) __PROTO((void));     /* used for mouse input */
    void (*put_tmptext) __PROTO((int, const char []));   /* draws temporary text; int determines where: 0=statusline, 1,2: at corners of zoom box, with \r separating text above and below the point */
    void (*set_ruler) __PROTO((int, int));    /* set ruler location; x<0 switches ruler off */
    void (*set_cursor) __PROTO((int, int, int));   /* set cursor style and corner of rubber band */
    void (*set_clipboard) __PROTO((const char[]));  /* write text into cut&paste buffer (clipboard) */
#endif
#ifdef PM3D
    int (*make_palette) __PROTO((t_sm_palette *palette));
    /* 1. if palette==NULL, then return nice/suitable
       maximal number of colours supported by this terminal.
       Returns 0 if it can make colours without palette (like 
       postscript).
       2. if palette!=NULL, then allocate its own palette
       return value is undefined
       3. available: some negative values of max_colors for whatever 

GnuplotTerminals.pod  view on Meta::CPAN

where <font> is the name of the default font to use (default Helvetica)
and <fontsize> is the font size (in points, default 12)



=head1 pm

The C<pm> terminal driver provides an OS/2 Presentation Manager window in
which the graph is plotted.  The window is opened when the first graph is
plotted.  This window has its own online help as well as facilities for
printing, copying to the clipboard and some line type and color adjustments.
The C<multiplot> option is supported.

Syntax:

      set terminal pm {server {n}} {persist} {widelines} {enhanced} {"title"}

If C<persist> is specified, each graph appears in its own window and all
windows remain open after C<gnuplot> exits.  If C<server> is specified, all
graphs appear in the same window, which remains open when C<gnuplot> exits.
This option takes an optional numerical argument which specifies an instance

GnuplotTerminals.pod  view on Meta::CPAN

printer.



=head2 text-menu

The C<gnuplot text> window has the following options on a pop-up menu accessed
by pressing the right mouse button or selecting C<Options> from the system
menu:

C<Copy to Clipboard> copies marked text to the clipboard.

C<Paste> copies text from the clipboard as if typed by the user.

C<Choose Font...> selects the font used in the text window.

C<System Colors> when selected makes the text window honor the System Colors
set using the Control Panel.  When unselected, text is black or blue on a
white background.

C<Update wgnuplot.ini> saves the current text window location, text window
size, text window font and text window font size to the initialisation file
C<WGNUPLOT.INI>.

gnuterm/README  view on Meta::CPAN


TECHNICAL DETAILS FOR HOTKEYS/MOUSE COMMUNICATION
=================================================

The communication between a mouseable terminal and the main gnuplot core goes
via structures defined in mousecmn.h. Further, the following terminal entries
are used (see USE_MOUSE #defined code in .trm files):
	void XX_set_ruler (int, int);
	void XX_set_cursor (int, int, int);
	void XX_put_tmptext (int, const char str[]);
	void XX_set_clipboard (const char[]);

On OS/2, the communication of these structures between the stand-alone
terminals gnupmdrv.exe or gnuplot_x11.exe and the main gnuplot.exe executable
is implemented by shared memory and an event semaphore.

On Unix, a bidirectional pipe is implemented for the ipc (inter-process)
communication between gnuplot_x11 and gnuplot. The readline interfaces were
modified to listen to both stdin and the ipc file descriptor.  (Well, that's
just the usual way). Note that if compiling with gnu readline, you must have a
gnu readline version > 2.2 (3.0).  This will not be a major drawback, as 2.2 is

gnuterm/mouse.h  view on Meta::CPAN

    MOUSE_COORDINATES_TIMEFMT,
    MOUSE_COORDINATES_XDATE,
    MOUSE_COORDINATES_XTIME,
    MOUSE_COORDINATES_XDATETIME,
    MOUSE_COORDINATES_ALT    /* alternative format as specified by the user */
};

/* FIXME HBB 20010207: Codestyle violation: these should be in mouse.c! */
#if defined(_MOUSE_C)
    long mouse_mode = MOUSE_COORDINATES_REAL;
    long clipboard_mode = MOUSE_COORDINATES_REAL;
    char* mouse_alt_string = (char*) 0;
    char* clipboard_alt_string = (char*) 0;
#else
    extern long mouse_mode;
    extern long clipboard_mode;
    extern char* mouse_alt_string;
    extern char* clipboard_alt_string;
#endif


void event_plotdone __PROTO((void));
void recalc_statusline __PROTO((void));
void update_ruler __PROTO((void));
void UpdateStatusline __PROTO((void));
void do_event __PROTO((struct gp_event_t *ge));
int plot_mode __PROTO((int mode));
void event_reset __PROTO((struct gp_event_t *ge));

gnuterm/mousing.c  view on Meta::CPAN



#ifndef GNUPMDRV /* gnupmdrv: they are available as menu items */
const  char *( MouseCoordinatesHelpStrings[] ) = {
		"real", "pixels", "screen", "x date / y real",
		"x time / y real", "x date+time / y real"
		 };
#endif


/* formats for saving the mouse position into clipboard / print to screen
   (double click of mouse button 1).
   Important: do not change this unless you update the appropriate items 
   in os2/gnupmdrv.rc
*/
#ifndef GNUPMDRV
int mouseSprintfFormat = 1;
#endif
const  int	nMouseSprintfFormats = IDM_MOUSE_FORMAT_LABEL - IDM_MOUSE_FORMAT;
const  char  *( MouseSprintfFormats[ /*nMouseSprintfFormats*/ ] ) = {
		"%g %g","%g,%g","%g;%g",

gnuterm/mousing.c  view on Meta::CPAN



#ifdef OS2

void gp_execute ( char *s )
{
/* Copy the command to the shared memory and let gnuplot execute it.
	If this routine is called during a 'pause', then the command is
   ignored (shared memory is cleared). Needed for actions launched by a
   hotkey.
	Firstly, the command is copied from shared memory to clipboard
   if this option is set on.
	Secondly, gnuplot is informed that shared memory contains a command
   by posting semInputReady event semaphore.

   OS/2 specific: if (!s), then the command has been already sprintf'ed to
   the shared memory.
*/
    APIRET rc;
    if (input_from_PM_Terminal==NULL)
	return;
    if (s) /* copy the command to shared memory */
      strcpy(input_from_PM_Terminal,s);
    if (((char*)input_from_PM_Terminal)[0]==0)
	return;
    if (pausing) { /* no communication during pause */
	DosBeep(440,111);
	((char*)input_from_PM_Terminal)[0] = 0;
	return;
    }
#ifdef GNUPMDRV
    /* write the command to clipboard */
    if (bSend2gp == TRUE)
	TextToClipboard ( input_from_PM_Terminal );
#endif
    /* let the command in the shared memory be executed... */
    if (semInputReady == 0) { /* but it must be open for the first time */
	char semInputReadyName[40];
	sprintf( semInputReadyName, "\\SEM32\\GP%i_Input_Ready", (int)ppidGnu );
	DosOpenEventSem( semInputReadyName, &semInputReady);
    }
    rc = DosPostEventSem(semInputReady);

gnuterm/term/README  view on Meta::CPAN

                              int flags; /* various flags */
   void (*suspend) __PROTO((void)); /* after one plot of multiplot */
   void (*resume) __PROTO((void));  /* before subsequent plot of multiplot */
   void (*fillbox) __PROTO((int style, unsigned int x1, unsigned int y1, unsigned int width, unsigned int height)); /* clear part of multiplot */
   void (*linewidth) __PROTO((double linewidth));
#ifdef USE_MOUSE
   int (*waitforinput) __PROTO((void));
   void (*put_tmptext) __PROTO((int i, const char str[]));
   void (*set_ruler) __PROTO((int x, int y));
   void (*set_cursor) __PROTO((int c, int x, int y));
   void (*set_clipboard) __PROTO((const char s[]));
#endif
#ifdef PM3D
   int (*make_palette)__PROTO((t_sm_palette *palette));
   void (*previous_palette) __PROTO(());
   void (*set_color) __PROTO((double gray));
   void (*filled_polygon) __PROTO((int points, gpiPoint *corners));
#endif
};

One consequence of (1) is that we would like drivers to be backwards

gnuterm/term/README  view on Meta::CPAN


_set_ruler(int x, int y) - Draw a ruler (crosshairs) centered at the
   indicated screen coordinates.  If x<0, switch ruler off.

_set_cursor(int c, int x, int y) - Set cursor style and corner of
   rubber band rectangle.  c selects the action: -2=warp the cursor to
   the given point, -1=start zooming, 0=standard cross-hair cursor,
   1=cursor during rotation, 2=cursor during scaling, 3=cursor during
   zooming.

_set_clipboard(const char s[]) - Write a string to the clipboard.


The following four functions should be conditioned on PM3D.  See also:
pm3d/old-docs/README-pm3d.

_make_palette(t_sm_palette *palette) - If argument is NULL, return
   number of colors available.  If the number of colors is not limited
   (continuously shaded colors can be generated), return 0.
   Otherwise, allocate the palette.  (t_sm_palette is defined in
   src/color.h.)

gnuterm/term/cgm.trm  view on Meta::CPAN

    CGM_linetype, CGM_put_text, CGM_text_angle,
    CGM_justify_text, CGM_point, do_arrow, CGM_set_font,
    CGM_set_pointsize,
    TERM_BINARY,		/* various flags */
    NULL,			/* after one plot of multiplot */
    NULL,			/* before subsequent plot of multiplot */
    NULL,			/* clear part of multiplot */
    CGM_linewidth
#ifdef USE_MOUSE
    , NULL, NULL, NULL, NULL, NULL
/*  , waitforinput, put_tmptext, set_ruler, set_cursor, set_clipboard */
#endif
#ifdef PM3D
    , CGM_make_palette,
    NULL /* _previous_palette */,
    CGM_set_color,
    CGM_filled_polygon
#endif
TERM_TABLE_END(cgm_driver)

#undef LAST_TERM

gnuterm/term/ggi.trm  view on Meta::CPAN

TERM_PUBLIC void GGI_clear __PROTO((const GGI_vertex_t* v, const int tag));
TERM_PUBLIC void GGI_save_puts __PROTO((GGI_vertex_t* v, const int tag));
TERM_PUBLIC void GGI_set_vertex __PROTO((GGI_vertex_t* v, const int x, const int y, const char* str, const int tag));
TERM_PUBLIC void GGI_abort_zooming __PROTO((void));
TERM_PUBLIC void GGI_put_tmptext __PROTO((int, const char str[]));
TERM_PUBLIC void GGI_relative __PROTO((int r[2]));
TERM_PUBLIC void GGI_clear_hline __PROTO((int x1, int x2, int y));
TERM_PUBLIC void GGI_clear_vline __PROTO((int y1, int y2, int x));
TERM_PUBLIC void GGI_draw_hline __PROTO((int x1, int x2, int y));
TERM_PUBLIC void GGI_draw_vline __PROTO((int y1, int y2, int x));
TERM_PUBLIC void GGI_set_clipboard __PROTO((const char[]));
#endif /* USE_MOUSE */

#ifdef PM3D
TERM_PUBLIC int GGI_make_palette __PROTO((t_sm_palette*));
TERM_PUBLIC void GGI_previous_palette __PROTO((void));
TERM_PUBLIC void GGI_set_color __PROTO((double));
#ifdef ENABLE_XMI
TERM_PUBLIC void GGI_filled_polygon __PROTO((int, gpiPoint*));
#endif
#endif

gnuterm/term/ggi.trm  view on Meta::CPAN

	case 2:
	case 3:
	default:
	    /* XXX not implemented */
	    break;
    }
    GGI_needs_update++;
}

TERM_PUBLIC void
GGI_set_clipboard(s)
    const char s[];
{
    /* XXX: not implemented */
}
#endif

#ifdef PM3D
TERM_PUBLIC int
GGI_make_palette(palette)
    t_sm_palette *palette;

gnuterm/term/ggi.trm  view on Meta::CPAN

    0, /* point */
    0, /* arrow */
    0, /* set_font */
    0, /* set_pointsize */
    TERM_CAN_MULTIPLOT,
    GGI_suspend,
    GGI_resume,
    GGI_fillbox,
    0 /* linewidth */
#ifdef USE_MOUSE
    , GGI_waitforinput, GGI_put_tmptext, GGI_set_ruler, GGI_set_cursor, GGI_set_clipboard
#endif
#ifdef PM3D
    , GGI_make_palette,
    GGI_previous_palette,
    GGI_set_color,
#ifdef ENABLE_XMI
    GGI_filled_polygon
#else
    0 /* GGI_filled_polygon */
#endif

gnuterm/term/pm.trm  view on Meta::CPAN

TERM_PUBLIC int PM_justify_text __PROTO((enum JUSTIFY mode));
TERM_PUBLIC void PM_point __PROTO((unsigned int x, unsigned int y, int number));
TERM_PUBLIC void PM_suspend __PROTO((void));
TERM_PUBLIC void PM_resume __PROTO((void));
TERM_PUBLIC void PM_fillbox __PROTO((int style, unsigned int x, unsigned int y, unsigned int w, unsigned int h));
TERM_PUBLIC void PM_linewidth __PROTO((double linewidth));
#ifdef USE_MOUSE
TERM_PUBLIC void PM_set_ruler __PROTO((int, int));
TERM_PUBLIC void PM_set_cursor __PROTO((int, int, int));
TERM_PUBLIC void PM_put_tmptext __PROTO((int, const char str[]));
TERM_PUBLIC void PM_set_clipboard __PROTO((const char[]));
#endif
#ifdef PM3D
TERM_PUBLIC int PM_make_palette (t_sm_palette *);
TERM_PUBLIC void PM_previous_palette (void);
TERM_PUBLIC void PM_set_color (double);
TERM_PUBLIC void PM_filled_polygon (int, gpiPoint *);
#endif

/* define PM world coordinate limits */

gnuterm/term/pm.trm  view on Meta::CPAN

    if (PM_pipe) {
	putc(SET_CURSOR, PM_pipe);
	fwrite(&c, sizeof(int), 1, PM_pipe);
	fwrite(&x, sizeof(int), 1, PM_pipe);
	fwrite(&y, sizeof(int), 1, PM_pipe);
	fflush(PM_pipe);
    }
}

TERM_PUBLIC void
PM_set_clipboard(const char s[])
{
    if (PM_pipe) {
	int i = strlen(s);
	putc(SET_CLIPBOARD, PM_pipe);
	fwrite(&i, sizeof(int), 1, PM_pipe);
	fwrite(s, i+1, 1, PM_pipe);
	fflush(PM_pipe);
    }
}

gnuterm/term/pm.trm  view on Meta::CPAN

    PM_linetype, PM_put_text, PM_text_angle,
    PM_justify_text, PM_point, do_arrow, PM_set_font,
    0 /*pointsize */ , TERM_CAN_MULTIPLOT, PM_suspend, PM_resume,
    PM_fillbox, PM_linewidth
#ifdef USE_MOUSE
#ifdef PIPE_IPC
    , PM_waitforinput,
#else
    , 0 /* PM_waitforinput */, 
#endif
    PM_put_tmptext, PM_set_ruler, PM_set_cursor, PM_set_clipboard
#endif
#ifdef PM3D
    , PM_make_palette,
    PM_previous_palette,
    PM_set_color,
    PM_filled_polygon
#endif
TERM_TABLE_END(PM_driver)

#undef LAST_TERM

gnuterm/term/pm.trm  view on Meta::CPAN

"1 pm",
"?commands set terminal pm",
"?set terminal pm",
"?set term pm",
"?terminal pm",
"?term pm",
"?pm",
" The `pm` terminal driver provides an OS/2 Presentation Manager window in",
" which the graph is plotted.  The window is opened when the first graph is",
" plotted.  This window has its own online help as well as facilities for",
" printing, copying to the clipboard and some line type and color adjustments.",
" The `multiplot` option is supported.",
"",
" Syntax:",
"       set terminal pm {server {n}} {persist} {widelines} {enhanced} {\"title\"}",
"",
" If `persist` is specified, each graph appears in its own window and all",
" windows remain open after `gnuplot` exits.  If `server` is specified, all",
" graphs appear in the same window, which remains open when `gnuplot` exits.",
" This option takes an optional numerical argument which specifies an instance",
" of the server process.  Thus multiple server windows can be in use at the",

gnuterm/term/vgagl.trm  view on Meta::CPAN

TERM_PUBLIC void VGAGL_suspend __PROTO((void));
TERM_PUBLIC void VGAGL_resume __PROTO((void));


#include "mousecmn.h"
void VGAGL_eventually_process_graphics_events __PROTO((void));
TERM_PUBLIC void VGAGL_draw_cursor __PROTO((int x, int y));
TERM_PUBLIC void VGAGL_set_ruler __PROTO((int, int));
TERM_PUBLIC void VGAGL_set_cursor __PROTO((int, int, int));
TERM_PUBLIC void VGAGL_put_tmptext __PROTO((int, const char str[]));
TERM_PUBLIC void VGAGL_set_clipboard __PROTO((const char[]));
TERM_PUBLIC void VGAGL_init_keytable __PROTO((void));
TERM_PUBLIC void VGAGL_xor_pixel __PROTO((int x, int y));
TERM_PUBLIC void VGAGL_xor_pixel_wrapper __PROTO((int x, int y, int color));
TERM_PUBLIC void VGAGL_hline_xor __PROTO((int x1, int x2, int y));
TERM_PUBLIC void VGAGL_vline_xor __PROTO((int y1, int y2, int x));
#if 0
TERM_PUBLIC void VGAGL_line_xor __PROTO((unsigned int x1, unsigned int y1, unsigned int x2, unsigned int y2));
#endif
TERM_PUBLIC void VGAGL_zoombox __PROTO((int x, int y));
TERM_PUBLIC void VGAGL_update_zoombox __PROTO((int x, int y));

gnuterm/term/vgagl.trm  view on Meta::CPAN

	    /* TODO */
	    break;
	default:
	    fprintf(stderr, "(VGAGL_set_cursor) %s:%d protocol error\n", __FILE__, __LINE__);
	    break;
    }
    return;
}

TERM_PUBLIC void
VGAGL_set_clipboard(s)
    const char s[];
{
    return;
}

TERM_PUBLIC int
VGAGL_make_palette(t_sm_palette *palette)
{
    /* only reallocate colors, if the color spec has changed */
    if (palette && (VGAGL_save_pal.colorFormulae < 0

gnuterm/term/vgagl.trm  view on Meta::CPAN

    VGAGL_XMAX, VGAGL_YMAX, VGAGL_VCHAR, VGAGL_HCHAR,
    VGAGL_VTIC, VGAGL_HTIC, VGAGL_options, VGAGL_init, VGAGL_reset,
    VGAGL_text, null_scale, VGAGL_graphics, VGAGL_move, VGAGL_vector,
    VGAGL_linetype, VGAGL_put_text, VGAGL_text_angle,
    null_justify_text, do_point, do_arrow, set_font_null,
    0,				/* pointsize */
    TERM_CAN_MULTIPLOT, VGAGL_suspend, VGAGL_resume
    , 0, 0 /* fillbox, linewidth */
# ifdef USE_MOUSE
    , 0 /* VGAGL_waitforinput */, VGAGL_put_tmptext, VGAGL_set_ruler,
    VGAGL_set_cursor, VGAGL_set_clipboard
# endif
# ifdef PM3D
    , VGAGL_make_palette,
    0 /* VGAGL_previous_palette */,
    VGAGL_set_color,
    VGAGL_filled_polygon
# endif /* PM3D */
TERM_TABLE_END(vgagl_driver)
#undef LAST_TERM
#define LAST_TERM vgagl_driver

gnuterm/term/win.trm  view on Meta::CPAN

TERM_PUBLIC int WIN_justify_text __PROTO((enum JUSTIFY mode));
TERM_PUBLIC int WIN_text_angle __PROTO((int ang));
TERM_PUBLIC void WIN_point __PROTO((unsigned int x, unsigned int y, int number));
TERM_PUBLIC void WIN_resume __PROTO((void));
TERM_PUBLIC void WIN_set_pointsize __PROTO((double));
TERM_PUBLIC void WIN_linewidth __PROTO((double linewidth));
#ifdef USE_MOUSE
TERM_PUBLIC void WIN_set_ruler __PROTO((int, int));
TERM_PUBLIC void WIN_set_cursor __PROTO((int, int, int));
TERM_PUBLIC void WIN_put_tmptext __PROTO((int, const char str[]));
TERM_PUBLIC void WIN_set_clipboard __PROTO((const char[]));
#endif
#ifdef PM3D
TERM_PUBLIC int WIN_make_palette __PROTO((t_sm_palette *palette));
TERM_PUBLIC void WIN_set_color __PROTO((double gray));
TERM_PUBLIC void WIN_filled_polygon __PROTO((int points, gpiPoint *corners));
#endif
TERM_PUBLIC void WIN_boxfill __PROTO((int, unsigned int, unsigned int, unsigned int, unsigned int));


/* Initialization values - Guess Now Scale later */

gnuterm/term/win.trm  view on Meta::CPAN

    Graph_set_ruler(&graphwin, x, y );
}

TERM_PUBLIC void
WIN_set_cursor ( int c, int x, int y )
{
    Graph_set_cursor(&graphwin, c, x, y );
}

TERM_PUBLIC void
WIN_set_clipboard ( const char s[] )
{
    Graph_set_clipboard(&graphwin, s);
}

#endif /* USE_MOUSE */

#ifdef PM3D

TERM_PUBLIC int
WIN_make_palette(palette)
    t_sm_palette *palette;
{	
    /* Win can do continuous colors. However, we round them only to 256 levels
     * in order to pass an integer to GraphOp; it also reasonably limits
     * the number of colors if "copy to clipboard" is used. Don't change this
     * number unless you change it also in WIN_set_color() and in wgraph.c.
     */
    return 256;
}

TERM_PUBLIC void
WIN_set_color(gray)
    double gray;
{
    WIN_last_linetype = -3;      /* invalidate cached linetype */

gnuterm/term/win.trm  view on Meta::CPAN

    WIN_XMAX, WIN_YMAX, WIN_VCHAR, WIN_HCHAR,
    WIN_VTIC, WIN_HTIC, WIN_options, WIN_init, WIN_reset,
    WIN_text, null_scale, WIN_graphics, WIN_move, WIN_vector,
    WIN_linetype, WIN_put_text, WIN_text_angle,
    WIN_justify_text, WIN_point, do_arrow, set_font_null,
    WIN_set_pointsize, TERM_CAN_MULTIPLOT,
    WIN_text /* suspend */ , WIN_resume, 
    WIN_boxfill, WIN_linewidth
#ifdef USE_MOUSE
    , 0 /* WIN_waitforinput */, 
    WIN_put_tmptext, WIN_set_ruler, WIN_set_cursor, WIN_set_clipboard
#endif
#ifdef PM3D
    , WIN_make_palette, 0 /* previous_palette */,
    WIN_set_color, WIN_filled_polygon
#endif            
TERM_TABLE_END(win_driver)

#undef LAST_TERM
#define LAST_TERM win_driver

gnuterm/term/win.trm  view on Meta::CPAN

"2 text-menu",
"?commands set terminal windows text-menu",
"?set terminal windows text-menu",
"?set term windows text-menu",
"?windows text-menu",
"?text-menu",
" The `gnuplot text` window has the following options on a pop-up menu accessed",
" by pressing the right mouse button or selecting `Options` from the system",
" menu:",
"",
" `Copy to Clipboard` copies marked text to the clipboard.",
"",
" `Paste` copies text from the clipboard as if typed by the user.",
"",
" `Choose Font...` selects the font used in the text window.",
"",
" `System Colors` when selected makes the text window honor the System Colors",
" set using the Control Panel.  When unselected, text is black or blue on a",
" white background.",
"",
" `Update wgnuplot.ini` saves the current text window location, text window",
" size, text window font and text window font size to the initialisation file",
" `WGNUPLOT.INI`.",

gnuterm/term/x11.trm  view on Meta::CPAN

TERM_PUBLIC int X11_text_angle __PROTO((int i));
TERM_PUBLIC int X11_justify_text __PROTO((enum JUSTIFY mode));
TERM_PUBLIC void X11_point __PROTO((unsigned int x, unsigned int y, int number));
TERM_PUBLIC void X11_fillbox __PROTO((int style, unsigned int x, unsigned y, unsigned int width, unsigned int height));

# ifdef USE_MOUSE
TERM_PUBLIC int X11_waitforinput __PROTO((void));
TERM_PUBLIC void X11_set_ruler __PROTO((int, int));
TERM_PUBLIC void X11_set_cursor __PROTO((int, int, int));
TERM_PUBLIC void X11_put_tmptext __PROTO((int, const char str[]));
TERM_PUBLIC void X11_set_clipboard __PROTO((const char[]));
TERM_PUBLIC void X11_update_opts __PROTO((void));
# endif

# ifdef PM3D
TERM_PUBLIC int X11_make_palette __PROTO((t_sm_palette *));
TERM_PUBLIC void X11_set_color __PROTO((double));
TERM_PUBLIC void X11_filled_polygon __PROTO((int, gpiPoint *));

/* these must match the definitions in gplt_x11.c */
#  define X11_GR_MAKE_PALETTE     'p'

gnuterm/term/x11.trm  view on Meta::CPAN

TERM_PUBLIC void
X11_set_cursor(int c, int x, int y)
{
    if (X11_ipc) {
	PRINT3("u%04d%04d%04d\n", c, x, y);
	FFLUSH();
    }
}

TERM_PUBLIC void
X11_set_clipboard(const char s[])
{
    if (X11_ipc) {
	PRINT1("z%s\n", s);
	FFLUSH();
    }
}

#endif /* USE_MOUSE */

#ifdef PM3D

gnuterm/term/x11.trm  view on Meta::CPAN

    "x11", "X11 Window System",
    X11_XMAX, X11_YMAX, X11_VCHAR, X11_HCHAR,
    X11_VTIC, X11_HTIC, X11_options, X11_init, X11_reset,
    X11_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,
    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
#ifdef PM3D
    , X11_make_palette, 0 /* X11_previous_palette */ ,
    X11_set_color, X11_filled_polygon
#endif
TERM_TABLE_END(x11_driver)

#undef LAST_TERM
#define LAST_TERM x11_driver

gnuterm/term/x11.trm  view on Meta::CPAN

    "X11", "X11 Window System (identical to x11)",
    X11_XMAX, X11_YMAX, X11_VCHAR, X11_HCHAR,
    X11_VTIC, X11_HTIC, X11_options, X11_init, X11_reset,
    X11_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,
    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
#ifdef PM3D
    , X11_make_palette, 0 /* X11_previous_palette */ ,
    X11_set_color, X11_filled_polygon
#endif
TERM_TABLE_END(X11_driver)

#undef LAST_TERM
#define LAST_TERM x11_driver

gnuterm/term_api.h  view on Meta::CPAN

    int flags;
    void (*suspend) __PROTO((void)); /* called after one plot of multiplot */
    void (*resume)  __PROTO((void)); /* called before plots of multiplot */
    void (*fillbox) __PROTO((int, unsigned int, unsigned int, unsigned int, unsigned int)); /* clear in multiplot mode */
    void (*linewidth) __PROTO((double linewidth));
#ifdef USE_MOUSE
    int (*waitforinput) __PROTO((void));     /* used for mouse input */
    void (*put_tmptext) __PROTO((int, const char []));   /* draws temporary text; int determines where: 0=statusline, 1,2: at corners of zoom box, with \r separating text above and below the point */
    void (*set_ruler) __PROTO((int, int));    /* set ruler location; x<0 switches ruler off */
    void (*set_cursor) __PROTO((int, int, int));   /* set cursor style and corner of rubber band */
    void (*set_clipboard) __PROTO((const char[]));  /* write text into cut&paste buffer (clipboard) */
#endif
#ifdef PM3D
    int (*make_palette) __PROTO((t_sm_palette *palette));
    /* 1. if palette==NULL, then return nice/suitable
       maximal number of colours supported by this terminal.
       Returns 0 if it can make colours without palette (like 
       postscript).
       2. if palette!=NULL, then allocate its own palette
       return value is undefined
       3. available: some negative values of max_colors for whatever 

patches/diff_ipc-pm-with-hack  view on Meta::CPAN

 	/* return maximal number of colours in palette */
@@ -808,7 +896,11 @@ TERM_TABLE_START(PM_driver)
     0 /*pointsize */ , TERM_CAN_MULTIPLOT, PM_suspend, PM_resume,
     PM_fillbox, PM_linewidth
 #ifdef USE_MOUSE
+#ifdef PIPE_IPC
+    , PM_waitforinput,
+#else
     , 0 /* PM_waitforinput */, 
+#endif
     PM_put_tmptext, PM_set_ruler, PM_set_cursor, PM_set_clipboard
 #endif
 #ifdef PM3D

pm_exec/gclient.c  view on Meta::CPAN


/* New event handles for mouse processing */

#if 0 /* already defined */
case WM_MOUSEMOVE:
  return  0L;
#endif

case WM_BUTTON1DBLCLK:
  if (IGNORE_MOUSE) return 0L;
  /* put the mouse coordinates to the clipboard */
  {
  SHORT mx = MOUSEMSG(&message)->x;
  SHORT my = MOUSEMSG(&message)->y;
  double x,y;
  char s[256];
  int frm = ulMouseSprintfFormatItem-IDM_MOUSE_FORMAT_X_Y;
  /*
  Note:
  Another solution of getting mouse position (available at any
  method, not just in this handle event) is the following one:

pm_exec/gclient.c  view on Meta::CPAN

            if( GetNewFont( hWnd, hpsScreen ) ) {
                bNewFont = TRUE ;
                WinInvalidateRect( hWnd, NULL, TRUE ) ;
                }
	    break ;
            
        case IDM_SAVE :
            SaveIni( hWnd ) ;
            break ;
            
        case IDM_COPY :         /* copy to clipboard */
            if( WinOpenClipbrd( hab ) ) {
                CopyToClipBrd( hWnd ) ; 
                }
            else {
                WinMessageBox( HWND_DESKTOP,
                               hWnd, 
                               "Can't open clipboard",
                               APP_NAME,
                               0,
			       MB_OK | MB_ICONEXCLAMATION ) ;
                }
            break ;

        case IDM_CLEARCLIP :         /* clear clipboard */
	    if( WinOpenClipbrd( hab ) ) {
                WinEmptyClipbrd( hab ) ;
                WinCloseClipbrd( hab ) ;
                }
            else {
                WinMessageBox( HWND_DESKTOP,
                               hWnd, 
                               "Can't open clipboard",
                               APP_NAME,
                               0,
                               MB_OK | MB_ICONEXCLAMATION ) ;
                }
	    break ;

        case IDM_COMMAND:       /* go back to GNUPLOT command window */
            WinSwitchToProgram( hSwitch ) ;
            break ;

pm_exec/gclient.c  view on Meta::CPAN

	    ChangeCheck( hWnd, ulMouseCoordItem, IDM_MOUSE_COORDINATES_XTIME ) ;
	    ulMouseCoordItem = IDM_MOUSE_COORDINATES_XTIME;
	    return 0L;

	case IDM_MOUSE_COORDINATES_XDATETIME:
	    ChangeCheck( hWnd, ulMouseCoordItem, IDM_MOUSE_COORDINATES_XDATETIME ) ;
	    ulMouseCoordItem = IDM_MOUSE_COORDINATES_XDATETIME;
	    return 0L;

	case IDM_MOUSE_CMDS2CLIP:
		/* toggle copying the command sent to gnuplot to clipboard */
	    bSend2gp = !bSend2gp ;
	    ChangeCheck( hWnd, IDM_MOUSE_CMDS2CLIP, bSend2gp?IDM_MOUSE_CMDS2CLIP:0 ) ;
	    break ;

	case IDM_MOUSE_FORMAT_X_Y:
	case IDM_MOUSE_FORMAT_XcY:
	case IDM_MOUSE_FORMAT_XsY:
	case IDM_MOUSE_FORMAT_XcYc:
	case IDM_MOUSE_FORMAT_XcYs:
	case IDM_MOUSE_FORMAT_pXdYp:
	case IDM_MOUSE_FORMAT_pXcYp:
	case IDM_MOUSE_FORMAT_pXsYp:
	case IDM_MOUSE_FORMAT_LABEL:
	    {
	    char s[100];
	    ChangeCheck( hWnd, ulMouseSprintfFormatItem, SHORT1FROMMP( mp1 ) ) ;
	    ulMouseSprintfFormatItem = SHORT1FROMMP( mp1 );
	    sprintf(s,"set mouse mouseformat \"%s\"",MouseSprintfFormats[ulMouseSprintfFormatItem-IDM_MOUSE_FORMAT_X_Y]);
	    sprintf(s,"set mouse clipboardformat \"%s\"",MouseSprintfFormats[ulMouseSprintfFormatItem-IDM_MOUSE_FORMAT_X_Y]);
	    gp_execute(s);
	    }
	    return 0L;

	case IDM_MOUSE_POLAR_DISTANCE: /* toggle using/not using polar coords of distance */
	    gp_execute( gpPMmenu.polar_distance ? "set mouse nopolardistance" : "set mouse polardistance" );
	    return 0L;

	case IDM_MOUSE_ZOOMNEXT: /* zoom to next level */
	    {

pm_exec/gclient.c  view on Meta::CPAN

                    MPFROM2SHORT( MIA_CHECKED, 0 ) ) ;
    if( wItem2 != 0 )
        WinSendMsg( hMenu,
                    MM_SETITEMATTR,
                    MPFROM2SHORT( wItem2, TRUE ),
                    MPFROM2SHORT( MIA_CHECKED, MIA_CHECKED ) ) ;
    }       

static void CopyToClipBrd( HWND hWnd ) 
/*
**  Copy window to clipboard as bitmap.
*/
    {
    HAB hab ;
    HBITMAP hbm ;
    HMF     hmf ;

    hab = WinQueryAnchorBlock( hWnd ) ;
    WinEmptyClipbrd( hab ) ;
    hbm = CopyToBitmap( hpsScreen ) ; 
    WinSetClipbrdData( hab, (ULONG) hbm, CF_BITMAP, CFI_HANDLE) ;

pm_exec/gclient.c  view on Meta::CPAN

			       WinSetPointer( HWND_DESKTOP, hptrCurrent = hptrZooming );
			       break;
		      }
		    if (c>=0 && zoombox.on) { /* erase zoom box */
		      DrawZoomBox();
		      zoombox.on = 0;
		      }
		    }
		    break ;

		case 'l' : {  /* set_clipboard(const char s[]) term API */
		    int len;
		    char *s;
		    BufRead(hRead,&len, sizeof(int), &cbR);
		    s = malloc( len + 1 );
		    BufRead(hRead,s, len+1, &cbR);
		    TextToClipboard(s);
		    free(s);
		    break ;
		    }

pm_exec/gclient.c  view on Meta::CPAN

    iLtype = iType ;
    iState = 0 ;
    togo = iPatt[iLtype][0] ;
    }


/* Now routines for mouse etc. */

static void TextToClipboard ( PCSZ szTextIn )
{
/* copy string given by szTextIn to the clipboard */
PSZ szTextOut = NULL;
ULONG ulRC = DosAllocSharedMem( (PVOID*)&szTextOut, NULL,
		       strlen( szTextIn ) + 1,
		       PAG_READ | PAG_WRITE | PAG_COMMIT | OBJ_GIVEABLE );
if( !ulRC ) {
  HAB hab = 0;
  strcpy( szTextOut, szTextIn );
  WinOpenClipbrd(hab);
  WinEmptyClipbrd(hab);
  WinSetClipbrdData( hab, (ULONG) szTextOut, CF_TEXT, CFI_POINTER );

pm_exec/gnupmdrv.ipf  view on Meta::CPAN

:p.The data is saved in the file :hp2.gnupmdrv.ini:ehp2. file in the 
program&csq.s working directory. You can delete the file if you want to restore
all settings to their default values. (This file is created even if
no settings are saved.) 


:h1 res=500. Edit Menu Help
:i1 id=medit. Edit menu
:i2 refid=medit. The Edit menu
:p.The :hp2.Edit:ehp2. menu gives you access to commands 
for copying the plot to the clipboard.

:h2 res=501. Copy to clipboard
:i2 refid=medit. Copy to clipboard
:p.Selecting the :hp2.Copy:ehp2. menu item from the :hp2.Edit:ehp2.
pulldown menu causes the current plot to be copied to the system
clipboard. The plot is copied in bitmap and in metafile format.

:h2 res=504. Clear clipboard
:i2 refid=medit. Clear clipboard
:p.Selecting the :hp2.Clear clipboard:ehp2. menu item from 
the :hp2.Edit:ehp2.pulldown menu causes the clipboard to be cleared.

:h1 res=300. Gnuplot Menu Help
:i1 id=mgnu. Gnuplot menu
:i2 refid=mgnu. Moving to GNUPLOT window
:p.Selecting the :hp2.Gnuplot:ehp2. menu item causes the GNUPLOT
command window to be brought to the foreground. The same result can be be
obtained by pressing the ESC key when the Gnushell window is active.

:h1 res=600. Mouse Menu Help
:i1 id=mmouse. Mouse menu
:i2 refid=mmouse. The Mouse menu
:p.The :hp2.Mouse:ehp2. menu gives you access to mouse (pointer)-related 
functions. Recently the mouse code has been rearranged so that many hotkeys 
and other actions are configurable in gnuplot itself; see 'help mouse' and
'help bind'. Help on current mouse configuration is available via hotkey 'h'.
Consequently, the behaviour of the submenu items may be changed according 
to gnuplot or user settings. Menu items showing two hotkeys: the first one 
is user-configurable (so it may not corresponding to the actual settings), 
the other is fixed (has precedence over user settings). 
:p.Note that the new mouse style adds formats 'format', 'clipboardformat' and
'mouseformat' which are not well cared about in the menu; I mean that menu 
items 'Coordinates' and 'Coords. format' are out of date now (no more 
pixels, for instance). You are welcome to update this if you have time.

:h2 res=601. Use mouse
:i2 refid=mmouse. Use mouse
:p.Checking this menu item enables the mouse (pointer device) functionality:
tracing the position over graph, zooming, annotating graph etc. for 2d graphs
and for maps (i.e. `set view` with z-rotation 0,90,180,270 or 360 degrees).
Mousing is not available in multiplot mode. 

pm_exec/gnupmdrv.ipf  view on Meta::CPAN

This driver keeps the list of zoomed ranges. You can browse through it via 
:hp2.Unzoom all:ehp2., :hp2.Unzoom back:ehp2. and :hp2.Zoom next:ehp2..

:p.:hp2.Double click of MB1:ehp2. writes the current pointer position to
clipbord according to the format chosen in :hp2.sprintf format:ehp2. menu.
:p.:hp2.MB3:ehp2. annotates temporarily the graph.

:h2 res=602. Mouse coordinates
:i2 refid=mmouse. Coordinates
:p.Choose the coordinates which are used for showing the mouse position, 
clipboard copy and annotation. 
:p.:hp2.Real coordinates:ehp2. are coordinates of x and y axes of the current 
graph.
:p.:hp2.Screen coordinates:ehp2. are relative coordinates of the screen, 
i.e. [0,0]..[1,1]. These may be used in gnuplot commands like 
:hp2.set label "ahoj" at screen 0.85,0.85:ehp2.
:p.:hp2.Pixel coordinates:ehp2. are the coordinates of the window depending 
on the screen resolution. They determine the precision of the other 
coordinates.
:p.:hp2.x time / date:ehp2. coordinate is useful when the coordinate on the x axis
is time or date. 

:h2 res=605. By mouse...
:i2 refid=mmouse. By mouse: zoom
:p.Well, subitems of this do nothing just remember you which mouse button 
combinations to use for putting the current position to the clipboard, for 
zooming or temporarily annotating the graph. 

:h2 res=603. Coordinates format
:i2 refid=mmouse. Coordinates format
:p.Choose here the format for writing the cursor position into clipboard
(via double click of MB1).

:h2 res=606. Unzoom and zoom history
:i2 refid=mmouse. Unzoom and zoom
:p.These choises lets you browse through the list of zooms.

:h2 res=607. Ruler
:i2 refid=mmouse. Ruler
:p.Disables the ruler if it is already on.
:p.If the ruler has been off, then show it at the current pointer position. 

pm_exec/gnupmdrv.ipf  view on Meta::CPAN

:i2 refid=mutils. Reload
:p.Reloads a file, i.e it issues :hp2.history !load:ehp2.

:h2 res=715. Command
:i2 refid=mutils. Command
:p.This enables you to send any command to gnuplot from within this 
display driver. This is particularly useful when the gnuplot command line 
is not available (an application sends commands and data to gnuplot via 
pipe, for instance).

:h2 res=716. Commands to clipboard
:i2 refid=mutils. Commands to clipboard
:p.If this option is switched on, then all commands sent to gnuplot will be 
copied into clipboard. This can be useful for tracing the executed commands 
from mouse/hotkey actions, or for displaying x and y ranges during zoom, 
for instance. You may use your favourite clipboard viewer to look at the 
clipboard contents.


:h1 res=400. Continue Menu Help
:i1 id=mcont. Continue menu
:i2 refid=mcont. Continue plotting
:p.Selecting the :hp2.Continue:ehp2. menu item causes plotting
to resume after a pause command is received from Gnuplot.
 

:h1 res=103. Help Menu Help

pm_exec/gnupmdrv.rc  view on Meta::CPAN

            MENUITEM  "~Gnuplot", IDM_PAUSEGNU
        END
        MENUITEM    "P~op to front",  IDM_FRONT,,MIA_CHECKED
        MENUITEM    "~Keep aspect ratio",  IDM_KEEPRATIO,,MIA_CHECKED
        MENUITEM  SEPARATOR
        MENUITEM    "~Save settings", IDM_SAVE
    END
    SUBMENU  "~Edit" , IDM_EDIT
    BEGIN
        MENUITEM    "~Copy", IDM_COPY
        MENUITEM    "Cl~ear clipboard", IDM_CLEARCLIP
    END

    SUBMENU  "~Mouse" , IDM_MOUSE,,MIA_DISABLED
    BEGIN
        MENUITEM    "~Use mouse\tm,Ctrl-M", IDM_USEMOUSE,,MIA_CHECKED
        SUBMENU    "Coordinates", IDM_MOUSE_COORDINATES
        BEGIN
            MENUITEM  "~real", IDM_MOUSE_COORDINATES_REAL,,MIA_CHECKED
            MENUITEM  "~screen", IDM_MOUSE_COORDINATES_SCREEN
            MENUITEM  "~pixels", IDM_MOUSE_COORDINATES_PIXELS

pm_exec/gpexecute.c  view on Meta::CPAN

     * (info sent to shared memory was too fast; maybe a blocking
     * semaphore would help, but no fun to implement it...)
     &*/
}

/* Copy the command (given by the input string) to the shared memory
 * and let gnuplot execute it.
 * If this routine is called during a 'pause', then the command is
 * ignored (shared memory is cleared). Needed for actions launched by a
 * hotkey.
 * Firstly, the command is copied from shared memory to clipboard
 * if this option is set on.
 * Secondly, gnuplot is informed that shared memory contains a command
 * by posting semInputReady event semaphore.
 *
 * OS/2 specific: if (!s), then the command has been already sprintf'ed to
 * the shared memory.
 */
void
gp_execute(char *s)
{

pm_exec/gpexecute.c  view on Meta::CPAN

    if (s)			/* copy the command to shared memory */
	strcpy(input_from_PM_Terminal, s);
    if (((char *) input_from_PM_Terminal)[0] == 0)
	return;
    if (pausing) {		/* no communication during pause */
	/* DosBeep(440,111); */
	((char *) input_from_PM_Terminal)[0] = 0;
	return;
    }
#ifdef GNUPMDRV
    /* write the command to clipboard */
    if (bSend2gp == TRUE)
	TextToClipboard(input_from_PM_Terminal);
#endif
    gp_post_shared_mem();
}

#endif /* OS2_IPC */

#if defined(PIPE_IPC) /* || defined(WIN_IPC) */



( run in 1.504 second using v1.01-cache-2.11-cpan-2398b32b56e )