[ Web Proxy ]
URL:
Viewing: https://raw.githubusercontent.com/gnuplot/gnuplot/master/src/mousecmn.h [Back]  [Original]

/* GNUPLOT - mousecnm.h */

/*[
 *
 * Copyright: Petr Mikulik , since 1999
 *
 * 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.
]*/

#ifndef MOUSECMN_H
# define MOUSECMN_H

/*
 * Definitions that are used by both gnuplot core and standalone terminals.
 */


/*
 * Structure for reporting mouse events to the main program
 */
struct gp_event_t {
    int type;		/* see below */
    int mx, my;		/* current mouse coordinates */
    int par1, par2;	/* other parameters, depending on the event type */
    int winid;		/* ID of window in which the event occurred */
};


/* event types:
*/
#define GE_EVT_LIST(_) \
    _(GE_motion)            /* mouse has moved */ \
    _(GE_buttonpress)       /* mouse button has been pressed; par1 = number of the button (1, 2, 3...) */ \
    _(GE_buttonrelease)     /* mouse button has been released; par1 = number of the button (1, 2, 3...); par2 = time (ms) since previous button release */ \
    _(GE_keypress)          /* keypress; par1 = keycode (either ASCII, or one of the GP_ enums defined below); par2 = ( |1 .. don't pass through bindings )*/ \
    _(GE_buttonpress_old)   /* same as GE_buttonpress but triggered from inactive window */ \
    _(GE_buttonrelease_old) /* same as GE_buttonrelease but triggered from inactive window */ \
    _(GE_keypress_old)      /* same as GE_keypress but triggered from inactive window */ \
    _(GE_modifier)          /* shift/ctrl/alt key pressed or released; par1 = is new mask, see Mod_ enums below */ \
    _(GE_plotdone)          /* acknowledgement of plot completion (for synchronization) */ \
    _(GE_replot)            /* used only by ggi.trm */ \
    _(GE_reset)             /* reset to a well-defined state (e.g.  after an X11 error occured) */ \
    _(GE_fontprops)         /* par1 = hchar par2 = vchar */ \
    _(GE_pending)           /* signal gp_exec_event() to send pending events */ \
    _(GE_raise)             /* raise console window */ \

#define GE_EVT_DEFINE_ENUM(name) name,
enum {
    GE_EVT_LIST(GE_EVT_DEFINE_ENUM)
    GE_EVT_NUM
};

/* the status of the shift, ctrl and alt keys
 * Mod_Opt is used by the "bind" mechanism to indicate that the
 * Ctrl or Alt key is allowed but not required
 */
enum { Mod_Shift = (1), Mod_Ctrl = (1 

Web Proxy Viewer  |  New URL  |  Original Page