2 globals.c -- Support ExpressKeys & Touch Strips on a Wacom Intuos3 tablet.
4 Copyright (C) 2005 - Mats Johannesson
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
24 XDeviceInfo *pad_info_block;
25 XDeviceInfo *pen_info_block;
26 XDeviceInfo *pad_info;
27 XDeviceInfo *pen_info;
33 char *total_config_dir;
34 char *total_config_file;
36 char *total_error_file;
37 char *config_dir = "/.expresskeys"; /* This is where in the user home */
38 char *config_file = "/expresskeys.conf";/* directory we'd like to reside, */
39 char *pid_file = "/expresskeys.pid"; /* and what our different status */
40 char *error_file = "/error.log"; /* files should be called */
43 int go_daemon = 0; /* Do not become a daemon without a command */
44 int be_verbose = 0; /* Run silently per default */
45 int reread_config = 0; /* No memory should be freed on the first read */
46 int handle_pen = 0; /* Pen should not be handled per default */
47 int pen_mode = 1; /* Assume pen is in Absolute mode initially */
48 int pen_open = 0; /* Pen device hasn't been opened */
50 int motion_type = NON_VALID;
51 int button_press_type = NON_VALID;
52 int button_release_type = NON_VALID;
54 /* Allocate space for a list of program definitions (config file based)
55 Also initialize a small list that is written out if no config file exists */
57 struct program external_list [MAXRECORDS];
58 struct program internal_list[] = {
59 /* Name handle_touch */
61 /* l_touch_up l_touch_up_plus l_touch_down l_touch_down_plus */
63 /* r_touch_up r_touch_up_plus r_touch_down r_touch_down_plus */
65 /* key_9 key_9_plus key_10 key_10_plus */
67 /* key_11 key_11_plus key_12 key_12_plus */
69 /* key_13 key_13_plus key_14 key_14_plus */
71 /* key_15 key_15_plus key_16 key_16_plus */
74 /* Name handle_touch */
76 /* l_touch_up l_touch_up_plus l_touch_down l_touch_down_plus */
78 /* r_touch_up r_touch_up_plus r_touch_down r_touch_down_plus */
80 /* key_9 key_9_plus key_10 key_10_plus */
82 /* key_11 key_11_plus key_12 key_12_plus */
84 /* key_13 key_13_plus key_14 key_14_plus */
86 /* key_15 key_15_plus key_16 key_16_plus */
89 /* Name handle_touch */
91 /* l_touch_up l_touch_up_plus l_touch_down l_touch_down_plus */
93 /* r_touch_up r_touch_up_plus r_touch_down r_touch_down_plus */
95 /* key_9 key_9_plus key_10 key_10_plus */
97 /* key_11 key_11_plus key_12 key_12_plus */
99 /* key_13 key_13_plus key_14 key_14_plus */
101 /* key_15 key_15_plus key_16 key_16_plus */
104 /* Name handle_touch */
106 /* l_touch_up l_touch_up_plus l_touch_down l_touch_down_plus */
108 /* r_touch_up r_touch_up_plus r_touch_down r_touch_down_plus */
110 /* key_9 key_9_plus key_10 key_10_plus */
112 /* key_11 key_11_plus key_12 key_12_plus */
114 /* key_13 key_13_plus key_14 key_14_plus */
116 /* key_15 key_15_plus key_16 key_16_plus */
119 /* The number of programs (num_list) must be computed here. After the struct */
120 int num_list = (sizeof internal_list / sizeof internal_list[0]);