Initial release of Maemo 5 port of gnuplot
[gnuplot] / src / mouse.h
1 /*
2  * $Id: mouse.h,v 1.18 2006/07/06 23:11:09 mikulik Exp $
3  */
4
5 /* GNUPLOT - mouse.h */
6
7 /*[
8  * Permission to use, copy, and distribute this software and its
9  * documentation for any purpose with or without fee is hereby granted,
10  * provided that the above copyright notice appear in all copies and
11  * that both that copyright notice and this permission notice appear
12  * in supporting documentation.
13  *
14  * Permission to modify the software is granted, but not the right to
15  * distribute the complete modified source code.  Modifications are to
16  * be distributed as patches to the released version.  Permission to
17  * distribute binaries produced by compiling modified sources is granted,
18  * provided you
19  *   1. distribute the corresponding source modifications from the
20  *    released version in the form of a patch file along with the binaries,
21  *   2. add special version identification to distinguish your version
22  *    in addition to the base release version number,
23  *   3. provide your name and address as the primary contact for the
24  *    support of your modified version, and
25  *   4. retain our contact information in regard to use of the base
26  *    software.
27  * Permission to distribute the released version of the source code along
28  * with corresponding source modifications in the form of a patch file is
29  * granted with same provisions 2 through 4 for binary distributions.
30  *
31  * This software is provided "as is" without express or implied warranty
32  * to the extent permitted by applicable law.
33 ]*/
34
35 /*
36  * AUTHORS
37  *
38  *   Original Software (October 1999 - January 2000):
39  *     Pieter-Tjerk de Boer <ptdeboer@cs.utwente.nl>
40  *     Petr Mikulik <mikulik@physics.muni.cz>
41  *     Johannes Zellner <johannes@zellner.org>
42  */
43
44
45 #ifndef _HAVE_MOUSE_H
46 #define _HAVE_MOUSE_H
47
48 #include "mousecmn.h"
49
50 #include "syscfg.h"
51
52 /* Zoom queue
53 */
54 struct t_zoom {
55   double xmin, ymin, xmax, ymax;
56   double x2min, y2min, x2max, y2max;
57   int was_splot_map;
58   struct t_zoom *prev, *next;
59 };
60
61 typedef struct mouse_setting_t {
62     int on;                /* ...                                         */
63     int doubleclick;       /* Button1 double / single click resolution    */
64     int annotate_zoom_box; /* draw coordinates at zoom box                */
65     int label;             /* draw real gnuplot labels on Button 2        */
66     int polardistance;     /* display dist. to ruler in polar coordinates */
67     int verbose;           /* display ipc commands                        */
68     int warp_pointer;      /* warp pointer after starting a zoom box      */
69     char fmt[0xff];        /* fprintf format for printing numbers         */
70     char labelopts[0xff];  /* label options                               */
71 } mouse_setting_t;
72
73 extern mouse_setting_t mouse_setting;
74
75
76 /* enum of GP_ -keycodes has moved to mousecmn.h so that it can be
77  * accessed by standalone terminals too */
78
79
80 /* FIXME HBB 20010207: Codestyle violation, again. */
81 #ifdef _MOUSE_C
82 /* the following table must match exactly the
83  * enum's of GP_ and end with a NULL pointer! */
84 static char* special_keys[] = {
85     "GP_FIRST_KEY", /* keep this dummy there */
86     "Linefeed",
87     "Clear",
88     "Pause",
89     "Scroll_Lock",
90     "Sys_Req",
91     "Insert",
92     "Home",
93     "Left",
94     "Up",
95     "Right",
96     "Down",
97     "PageUp",
98     "PageDown",
99     "End",
100     "Begin",
101     "KP_Space",
102     "KP_Tab",
103     "KP_F1",
104     "KP_F2",
105     "KP_F3",
106     "KP_F4",
107
108     /* see KP_0 - KP_9 */
109     "KP_Insert",
110     "KP_End",
111     "KP_Down",
112     "KP_PageDown",
113     "KP_Left",
114     "KP_Begin",
115     "KP_Right",
116     "KP_Home",
117     "KP_Up",
118     "KP_PageUp",
119
120     "KP_Delete",
121     "KP_Equal",
122     "KP_Multiply",
123     "KP_Add",
124     "KP_Separator",
125     "KP_Subtract",
126     "KP_Decimal",
127     "KP_Divide",
128     "KP_0",
129     "KP_1",
130     "KP_2",
131     "KP_3",
132     "KP_4",
133     "KP_5",
134     "KP_6",
135     "KP_7",
136     "KP_8",
137     "KP_9",
138     "F1",
139     "F2",
140     "F3",
141     "F4",
142     "F5",
143     "F6",
144     "F7",
145     "F8",
146     "F9",
147     "F10",
148     "F11",
149     "F12",
150     "GP_LAST_KEY",
151     (char*) 0 /* must be the last line */
152 };
153 #endif /* _MOUSE_C */
154
155 enum {
156     MOUSE_COORDINATES_REAL = 0,
157     MOUSE_COORDINATES_REAL1, /* w/o brackets */
158     MOUSE_COORDINATES_FRACTIONAL,
159 #if 0
160     MOUSE_COORDINATES_PIXELS,
161     MOUSE_COORDINATES_SCREEN,
162 #endif
163     MOUSE_COORDINATES_TIMEFMT,
164     MOUSE_COORDINATES_XDATE,
165     MOUSE_COORDINATES_XTIME,
166     MOUSE_COORDINATES_XDATETIME,
167     MOUSE_COORDINATES_ALT    /* alternative format as specified by the user */
168 };
169
170 /* FIXME HBB 20010207: Codestyle violation: these should be in mouse.c! */
171 #if defined(_MOUSE_C)
172     long mouse_mode = MOUSE_COORDINATES_REAL;
173     long clipboard_mode = MOUSE_COORDINATES_REAL;
174     char* mouse_alt_string = (char*) 0;
175     char* clipboard_alt_string = (char*) 0;
176 #else
177     extern long mouse_mode;
178     extern long clipboard_mode;
179     extern char* mouse_alt_string;
180     extern char* clipboard_alt_string;
181 #endif
182
183
184 void event_plotdone __PROTO((void));
185 void recalc_statusline __PROTO((void));
186 void update_ruler __PROTO((void));
187 void set_ruler __PROTO((TBOOLEAN on, int mx, int my));
188 void UpdateStatusline __PROTO((void));
189 void do_event __PROTO((struct gp_event_t *ge));
190 int plot_mode __PROTO((int mode));
191 void event_reset __PROTO((struct gp_event_t *ge));
192
193 /* bind prototype(s) */
194
195 void bind_process __PROTO((char* lhs, char* rhs, TBOOLEAN allwindows));
196 void bind_remove_all __PROTO((void));
197
198 #endif /* !_HAVE_MOUSE_H */