Icons are changed
[gnuplot] / src / mousecmn.h
1 /*
2  * $Id: mousecmn.h,v 1.15 2006/06/16 19:55:56 mikulik Exp $
3  */
4
5 /* GNUPLOT - mousecnm.h */
6
7 /*[
8  * 
9  * Copyright: Petr Mikulik <mikulik@physics.muni.cz>, since 1999
10  *
11  * Permission to use, copy, and distribute this software and its
12  * documentation for any purpose with or without fee is hereby granted
13  * provided that the above copyright notice appear in all copies and
14  * that both that copyright notice and this permission notice appear
15  * in supporting documentation.
16  *
17  * Permission to modify the software is granted, but not the right to
18  * distribute the complete modified source code.  Modifications are to
19  * be distributed as patches to the released version.  Permission to
20  * distribute binaries produced by compiling modified sources is granted,
21  * provided you
22  *   1. distribute the corresponding source modifications from the
23  *    released version in the form of a patch file along with the binaries,
24  *   2. add special version identification to distinguish your version
25  *    in addition to the base release version number,
26  *   3. provide your name and address as the primary contact for the
27  *    support of your modified version, and
28  *   4. retain our contact information in regard to use of the base
29  *    software.
30  * Permission to distribute the released version of the source code along
31  * with corresponding source modifications in the form of a patch file is
32  * granted with same provisions 2 through 4 for binary distributions.
33  *
34  * This software is provided "as is" without express or implied warranty
35  * to the extent permitted by applicable law.
36 ]*/
37
38 #ifndef MOUSECMN_H
39 # define MOUSECMN_H
40
41 /*
42  * Definitions that are used by both gnuplot core and standalone terminals.
43  */
44
45
46 /*
47  * Structure for reporting mouse events to the main program
48  */
49 struct gp_event_t {
50     int type;           /* see below */
51     int mx, my;         /* current mouse coordinates */
52     int par1, par2;     /* other parameters, depending on the event type */
53     int winid;          /* ID of window in which the event occurred */
54 };
55
56
57 /* event types:
58 */
59 enum {
60     GE_motion,          /* mouse has moved */
61     GE_buttonpress,     /* mouse button has been pressed; par1 = number of the button (1, 2, 3...) */
62     GE_buttonrelease,   /* mouse button has been released; par1 = number of the button (1, 2, 3...); par2 = time (ms) since previous button release */
63     GE_keypress,        /* keypress; par1 = keycode (either ASCII, or one of the GP_ enums defined below); par2 = ( |1 .. don't pass through bindings )*/
64     GE_buttonpress_old, /* same as GE_buttonpress but triggered from inactive window */
65     GE_buttonrelease_old,       /* same as GE_buttonrelease but triggered from inactive window */
66     GE_keypress_old,    /* same as GE_keypress but triggered from inactive window */
67     GE_modifier,        /* shift/ctrl/alt key pressed or released; par1 = is new mask, see Mod_ enums below */
68     GE_plotdone,        /* acknowledgement of plot completion (for synchronization) */
69     GE_replot,          /* used only by ggi.trm */
70     GE_reset            /* reset to a well-defined state
71                            (e.g.  after an X11 error occured) */
72     , GE_fontprops      /* par1 = hchar par2 = vchar */
73 #if defined(PIPE_IPC) || defined(WIN_IPC)
74     , GE_pending        /* signal gp_exec_event() to send pending events */
75 #endif
76 };
77
78
79 /* the status of the shift, ctrl and alt keys
80 */
81 enum { Mod_Shift = (1), Mod_Ctrl = (1 << 1), Mod_Alt = (1 << 2) };
82
83
84 /* the below depends on the ascii character set lying in the
85  * range from 0 to 255 (below 1000) */
86 enum { /* special keys with "usual well-known" keycodes */
87     GP_BackSpace = 0x08,
88     GP_Tab = 0x09,
89     GP_KP_Enter = 0x0A,
90     GP_Return = 0x0D,
91     GP_Escape = 0x1B,
92     GP_Delete = 127
93 };
94
95 enum { /* other special keys */
96     GP_FIRST_KEY = 1000,
97     GP_Linefeed,
98     GP_Clear,
99     GP_Pause,
100     GP_Scroll_Lock,
101     GP_Sys_Req,
102     GP_Insert,
103     GP_Home,
104     GP_Left,
105     GP_Up,
106     GP_Right,
107     GP_Down,
108     GP_PageUp,
109     GP_PageDown,
110     GP_End,
111     GP_Begin,
112     GP_KP_Space,
113     GP_KP_Tab,
114     GP_KP_F1,
115     GP_KP_F2,
116     GP_KP_F3,
117     GP_KP_F4,
118
119     GP_KP_Insert,    /* ~ KP_0 */
120     GP_KP_End,       /* ~ KP_1 */
121     GP_KP_Down,      /* ~ KP_2 */
122     GP_KP_Page_Down, /* ~ KP_3 */
123     GP_KP_Left,      /* ~ KP_4 */
124     GP_KP_Begin,     /* ~ KP_5 */
125     GP_KP_Right,     /* ~ KP_6 */
126     GP_KP_Home,      /* ~ KP_7 */
127     GP_KP_Up,        /* ~ KP_8 */
128     GP_KP_Page_Up,   /* ~ KP_9 */
129
130     GP_KP_Delete,
131     GP_KP_Equal,
132     GP_KP_Multiply,
133     GP_KP_Add,
134     GP_KP_Separator,
135     GP_KP_Subtract,
136     GP_KP_Decimal,
137     GP_KP_Divide,
138     GP_KP_0,
139     GP_KP_1,
140     GP_KP_2,
141     GP_KP_3,
142     GP_KP_4,
143     GP_KP_5,
144     GP_KP_6,
145     GP_KP_7,
146     GP_KP_8,
147     GP_KP_9,
148     GP_F1,
149     GP_F2,
150     GP_F3,
151     GP_F4,
152     GP_F5,
153     GP_F6,
154     GP_F7,
155     GP_F8,
156     GP_F9,
157     GP_F10,
158     GP_F11,
159     GP_F12,
160     GP_LAST_KEY
161 };
162
163
164 #ifdef OS2
165 /* Pass information necessary for (un)checking menu items in the
166    Presentation Manager terminal.
167    Thus this structure is required by pm.trm and gclient.c.
168 */
169 struct t_gpPMmenu {
170     int use_mouse;
171     int where_zoom_queue;
172         /* logical or: 1..unzoom, 2..unzoom back, 4..zoom next */
173     int polar_distance;
174 };
175
176 #endif
177
178
179 #endif /* MOUSECMN_H */