* add support to Wacom Cintiq 20WSX
authorAristeu Rozanski <arozansk@redhat.com>
Thu, 26 Jun 2008 19:07:59 +0000 (15:07 -0400)
committerAristeu Rozanski <arozansk@redhat.com>
Thu, 26 Jun 2008 19:07:59 +0000 (15:07 -0400)
src-expresskeys/config_read.c
src-expresskeys/config_write.c
src-expresskeys/defines.h
src-expresskeys/event_loop.c
src-expresskeys/get_device.c
src-expresskeys/mark_info.c
src-expresskeys/on_signal.c
src-expresskeys/tablet.c
src-expresskeys/tablet.h

index 76c721b..6ddbb43 100644 (file)
@@ -43,6 +43,7 @@ static int st2_prcurve_malloced;
 extern int be_verbose;
 extern int reread_config;
 
+extern const int bee;
 extern const int i3;
 extern const int i3s;
 extern const int g4;
@@ -300,6 +301,7 @@ static void prune_field(char* field_begin, char* write_buffer)
 static void handle_field(FILE* errorfp, char* read_buffer, void* address,
                                                                const int model)
 {
+       struct bee_program* pbee;
        struct i3_program* pi3;
        struct i3s_program* pi3s;
        struct g4_program* pg4;
@@ -309,6 +311,7 @@ static void handle_field(FILE* errorfp, char* read_buffer, void* address,
        struct touch_data* tdp = NULL;
        struct wheel_data* wdp = NULL;
        struct button_data* bdp = NULL;
+       struct bee_configstrings* cbee;
        struct i3_configstrings* ci3;
        struct i3s_configstrings* ci3s;
        struct g4_configstrings* cg4;
@@ -319,7 +322,16 @@ static void handle_field(FILE* errorfp, char* read_buffer, void* address,
        struct wheel_string* wsp = NULL;
        struct button_string* bsp = NULL;
 
-       if (model == i3) {
+       if (model == bee) {
+               pbee = address;
+               cdp = &pbee->common_data;
+               tdp = &pbee->touch_data;
+               bdp = &pbee->button_data;
+               cbee = bee_configstrings;
+               csp = &cbee->common_string;
+               tsp = &cbee->touch_string;
+               bsp = &cbee->button_string;
+       } else if (model == i3) {
                pi3 = address;
                cdp = &pi3->common_data;
                tdp = &pi3->touch_data;
@@ -439,7 +451,7 @@ static void handle_field(FILE* errorfp, char* read_buffer, void* address,
        }
 /* HandleTouchStrips TouchRepeatAfter DelayTouchRepeat
  LeftPadTouchUp LeftPadTouchDown RepeatLeftUp RepeatLeftDown */
-       if (model == i3s || model == i3) {
+       if (model == i3s || model == i3 || model == bee) {
                if (((field = (strstr(read_buffer, tsp->handle_touch))) != NULL)
                        && (((comment = (strchr(read_buffer, '#'))) == NULL)
                                                || (field < comment))) {
@@ -523,7 +535,8 @@ static void handle_field(FILE* errorfp, char* read_buffer, void* address,
 /* ButtonRepeatAfter DelayButtonRepeat
  LeftPadButton9/LeftButton LeftPadButton10/RightButton
  RepeatButton9/RepeatLeft RepeatButton10/RepeatRight */
-       if (model == i3s || model == i3 || model == g4 || model == g4b) {
+       if (model == i3s || model == i3 || model == g4 || model == g4b ||
+                                                         model == bee) {
                if (((field = (strstr(read_buffer, bsp->repeat_after)))!= NULL)
                        && (((comment = (strchr(read_buffer, '#'))) == NULL)
                                                || (field < comment))) {
@@ -568,7 +581,7 @@ static void handle_field(FILE* errorfp, char* read_buffer, void* address,
                }
        }
 /* LeftPadButton11 LeftPadButton12 RepeatButton11 RepeatButton12 */
-       if (model == i3s || model == i3) {
+       if (model == i3s || model == i3 || model == bee) {
                if (((field = (strstr(read_buffer, bsp->button11))) != NULL)
                        && (((comment = (strchr(read_buffer, '#'))) == NULL)
                                                || (field < comment))) {
@@ -601,7 +614,7 @@ static void handle_field(FILE* errorfp, char* read_buffer, void* address,
 /* RightPadTouchUp RightPadTouchDown RepeatRightUp RepeatRightDown
  RightPadButton13 RightPadButton14 RightPadButton15 RightPadButton16
  RepeatButton13 RepeatButton14 RepeatButton15 RepeatButton16 */
-       if (model == i3) {
+       if (model == i3 || model == bee) {
                if (((field = (strstr(read_buffer, tsp->right_touch_up)))
                                                                != NULL)
                        && (((comment = (strchr(read_buffer, '#'))) == NULL)
@@ -690,6 +703,37 @@ static void handle_field(FILE* errorfp, char* read_buffer, void* address,
                        transfer_boolean(bdp->repeat16, write_buffer);
                        return;
                }
+
+               if (model == bee) {
+                       if (((field = (strstr(read_buffer, bsp->button17))) != NULL)
+                               && (((comment = (strchr(read_buffer, '#'))) == NULL)
+                                                       || (field < comment))) {
+                               prune_field(field, write_buffer);
+                               transfer_keycode(bdp->button17, write_buffer);
+                               return;
+                       }
+                       if (((field = (strstr(read_buffer, bsp->button18))) != NULL)
+                               && (((comment = (strchr(read_buffer, '#'))) == NULL)
+                                                       || (field < comment))) {
+                               prune_field(field, write_buffer);
+                               transfer_keycode(bdp->button18, write_buffer);
+                               return;
+                       }
+                       if (((field = (strstr(read_buffer, bsp->repeat17))) != NULL)
+                               && (((comment = (strchr(read_buffer, '#'))) == NULL)
+                                                       || (field < comment))) {
+                               prune_field(field, write_buffer);
+                               transfer_boolean(bdp->repeat17, write_buffer);
+                               return;
+                       }
+                       if (((field = (strstr(read_buffer, bsp->repeat18))) != NULL)
+                               && (((comment = (strchr(read_buffer, '#'))) == NULL)
+                                                       || (field < comment))) {
+                               prune_field(field, write_buffer);
+                               transfer_boolean(bdp->repeat18, write_buffer);
+                               return;
+                       }
+               }
        }
 
 }
@@ -716,18 +760,27 @@ static void read_body(FILE* errorfp, void* address, const int model,
        st1_prcurve_malloced = 0;
        st2_prcurve_malloced = 0;
 
+       struct bee_program* pbee = NULL;
        struct i3_program* pi3 = NULL;
        struct i3s_program* pi3s = NULL;
        struct g4_program* pg4 = NULL;
        struct g4b_program* pg4b = NULL;
        struct nop_program* pnop = NULL;
+       struct bee_program* pbee_base = NULL;
        struct i3_program* pi3_base = NULL;
        struct i3s_program* pi3s_base = NULL;
        struct g4_program* pg4_base = NULL;
        struct g4b_program* pg4b_base = NULL;
        struct nop_program* pnop_base = NULL;
 
-       if (model == i3) {
+       if (model == bee) {
+               pbee = address;
+               pbee_base = pbee;
+               if (reread_config) {
+                       pbee->default_program = NULL;
+                       pbee->common_data.num_record = 0;
+               }
+       } else if (model == i3) {
                pi3 = address;
                pi3_base = pi3;
                if (reread_config) {
@@ -847,7 +900,9 @@ static void read_body(FILE* errorfp, void* address, const int model,
                                continue;
                        }
 
-                       if (pi3) {
+                       if (pbee) {
+                               handle_field(errorfp, read_buffer, pbee, model);
+                       } else if (pi3) {
                                handle_field(errorfp, read_buffer, pi3, model);
                        } else if (pi3s) {
                                handle_field(errorfp, read_buffer, pi3s, model);
@@ -862,7 +917,42 @@ static void read_body(FILE* errorfp, void* address, const int model,
 
 /* End field loop*/
 
-               if (pi3) {
+               if (pbee) {
+                       if (pbee->common_data.class_name == NULL) {
+                               revert_config = 1;
+                               if (pbee->common_data.stylus1_presscurve
+                                                               != NULL) {
+                               free(pbee->common_data.stylus1_presscurve);
+                               st1_prcurve_malloced = 0;
+                               pbee->common_data.stylus1_presscurve = NULL;
+                               }
+                               if (pbee->common_data.stylus2_presscurve
+                                                               != NULL) {
+                               free(pbee->common_data.stylus2_presscurve);
+                               st2_prcurve_malloced = 0;
+                               pbee->common_data.stylus2_presscurve = NULL;
+                               }
+                       }
+                       if ((pbee->common_data.class_name != NULL)
+                               && (strcmp(pbee->common_data.class_name,
+                                                       def_rec) == 0)) {
+                               pbee_base->default_program = pbee;
+                       }
+                       if (pbee->common_data.class_name != NULL) {
+                               pgr_recname_malloced = 0;
+                               revert_config = 0;
+                               num_record++;
+                               if (pbee->common_data.stylus1_presscurve
+                                                               != NULL) {
+                                       st1_prcurve_malloced = 0;
+                               }
+                               if (pbee->common_data.stylus2_presscurve
+                                                               != NULL) {
+                                       st2_prcurve_malloced = 0;
+                               }
+                               pbee++;
+                       }
+               } else if (pi3) {
                        if (pi3->common_data.class_name == NULL) {
                                revert_config = 1;
                                if (pi3->common_data.stylus1_presscurve
@@ -1044,7 +1134,13 @@ static void read_body(FILE* errorfp, void* address, const int model,
 
        fclose(fp);
 
-       if (model == i3) {
+       if (model == bee) {
+               pbee = address;
+               if (pbee->default_program == NULL) {
+                       no_default = 1;
+               }
+               pbee->common_data.num_record = num_record;
+       } else if (model == i3) {
                pi3 = address;
                if (pi3->default_program == NULL) {
                        no_default = 1;
@@ -1205,6 +1301,25 @@ void read_config(FILE* errorfp)
        mip = model_list;
 
        for (i = 0; i < MAXPAD; i++, mip++) {
+               if (mip->bee->common_data.configfile) {
+                       if (be_verbose) {
+                               fprintf(stderr, "%s %s\n", our_cnffile,
+                               mip->bee->common_data.configfile);
+                       }
+
+                       if ((k = read_header(errorfp, write_buffer,
+                                       mip->bee->common_data.configfile))) {
+                               mip->bee->common_data.userconfigversion = k;
+                               if (be_verbose) {
+                                       print_device(stderr,
+                                               mip->bee->common_data.padname,
+                                               mip->bee->common_data.sty1name,
+                                               mip->bee->common_data.sty2name);
+                               }
+                               read_body(errorfp, mip->bee, bee,
+                                       mip->bee->common_data.configfile);
+                       }
+               }
                if (mip->i3->common_data.configfile) {
                        if (be_verbose) {
                                fprintf(stderr, "%s %s\n", our_cnffile,
index f333344..74bcf53 100644 (file)
@@ -30,12 +30,14 @@ const char* configversion = "4";
 
 /* Externals: */
 
+extern const int bee;
 extern const int i3;
 extern const int i3s;
 extern const int g4;
 extern const int g4b;
 extern const int nop;
 
+extern const int bee_num_list;
 extern const int i3_num_list;
 extern const int i3s_num_list;
 extern const int g4_num_list;
@@ -44,6 +46,158 @@ extern const int nop_num_list;
 
 extern const char* our_prog_name;
 
+/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Write a set of records tuned for a Cintiq 20wsx/'bee' tablet:
+ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
+
+static void write_bee(FILE* fp)
+{
+       int i;
+
+       const char* new_record =
+"%%                    # <---  ******** BEGIN NEW PROGRAM RECORD ********\n\n";
+       const char* name_tail = "# Name must be within double quotes \"\"";
+       const char* cur_tail = "# PressCurve must be within double quotes \"\"";
+       const char* sec_tail = "# Seconds (Max 10 - Min 0.01 - Or no delay)";
+       const char* tch_onoff = "# Switch 1/0 (Enable/Disable Touch Strips)";
+       const char* key_tail = "# Keycodes (Max number of keys to send is";
+       const char* tht_tail = "# Switch 1/0 (Finger held at top repeat keys)";
+       const char* thb_tail="# Switch 1/0 (Finger held at bottom repeat keys)";
+       const char* but_tail="# Switch 1/0 (Press and hold button repeat keys)";
+
+       struct bee_program* ip;
+       ip = bee_internal_list;
+       struct bee_configstrings* sp;
+       sp = bee_configstrings;
+
+       for (i = 0; i < bee_num_list; i++, ip++) {
+               fprintf(fp, "%s", new_record);
+
+               fprintf(fp, "%s         \"%s\" %s\n\n",
+               sp->common_string.class_name, ip->common_data.class_name,
+                                                               name_tail);
+
+               fprintf(fp, "%s \"%s\" %s\n",
+               sp->common_string.stylus1_presscurve,
+                               ip->common_data.stylus1_presscurve, cur_tail);
+               fprintf(fp, "%s \"%s\" %s\n\n",
+               sp->common_string.stylus2_presscurve,
+                               ip->common_data.stylus2_presscurve, cur_tail);
+
+               fprintf(fp, "%s %i.%i   %s\n\n",
+               sp->common_string.keycode_delay, *ip->common_data.keycode_delay,
+                               *(ip->common_data.keycode_delay+1), sec_tail);
+
+               fprintf(fp, "%s %i.%i   %s\n",
+               sp->button_string.repeat_after, *ip->button_data.repeat_after,
+                               *(ip->button_data.repeat_after+1), sec_tail);
+               fprintf(fp, "%s %i.%i   %s\n\n",
+               sp->button_string.repeat_delay, *ip->button_data.repeat_delay,
+                               *(ip->button_data.repeat_delay+1), sec_tail);
+
+               fprintf(fp, "%s %i.%i   %s\n",
+               sp->touch_string.repeat_after, *ip->touch_data.repeat_after,
+                               *(ip->touch_data.repeat_after+1), sec_tail);
+               fprintf(fp, "%s %i.%i   %s\n\n",
+               sp->touch_string.repeat_delay, *ip->touch_data.repeat_delay,
+                               *(ip->touch_data.repeat_delay+1), sec_tail);
+
+               fprintf(fp, "%s %i      %s\n\n",
+               sp->touch_string.handle_touch,
+                               *ip->touch_data.handle_touch, tch_onoff);
+
+               fprintf(fp, "%s         %i %i   %s %i)\n",
+               sp->touch_string.left_touch_up,
+                       *ip->touch_data.left_touch_up,
+                       *(ip->touch_data.left_touch_up+1), key_tail, MAXKEYS);
+               fprintf(fp, "%s %i %i   %s %i)\n\n",
+               sp->touch_string.left_touch_down,
+                       *ip->touch_data.left_touch_down,
+                       *(ip->touch_data.left_touch_down+1), key_tail, MAXKEYS);
+
+               fprintf(fp, "%s         %i      %s\n",
+               sp->touch_string.repeat_left_up,
+                               *ip->touch_data.repeat_left_up, tht_tail);
+               fprintf(fp, "%s         %i      %s\n\n",
+               sp->touch_string.repeat_left_down,
+                               *ip->touch_data.repeat_left_down, thb_tail);
+
+               fprintf(fp, "%s         %i %i   %s %i)\n",
+               sp->touch_string.right_touch_up,
+                       *ip->touch_data.right_touch_up,
+                       *(ip->touch_data.right_touch_up+1), key_tail, MAXKEYS);
+               fprintf(fp, "%s %i %i   %s %i)\n\n",
+               sp->touch_string.right_touch_down,
+                       *ip->touch_data.right_touch_down,
+                       *(ip->touch_data.right_touch_down+1), key_tail,MAXKEYS);
+
+               fprintf(fp, "%s         %i      %s\n",
+               sp->touch_string.repeat_right_up,
+                               *ip->touch_data.repeat_right_up, tht_tail);
+               fprintf(fp, "%s         %i      %s\n\n",
+               sp->touch_string.repeat_right_down,
+                               *ip->touch_data.repeat_right_down, thb_tail);
+
+               fprintf(fp, "%s         %i %i   %s %i)\n",
+               sp->button_string.button9, *ip->button_data.button9,
+                               *(ip->button_data.button9+1), key_tail,MAXKEYS);
+               fprintf(fp, "%s         %i %i   %s %i)\n",
+               sp->button_string.button10, *ip->button_data.button10,
+                               *(ip->button_data.button10+1),key_tail,MAXKEYS);
+               fprintf(fp, "%s         %i %i   %s %i)\n",
+               sp->button_string.button11, *ip->button_data.button11,
+                               *(ip->button_data.button11+1),key_tail,MAXKEYS);
+               fprintf(fp, "%s         %i %i   %s %i)\n",
+               sp->button_string.button12, *ip->button_data.button12,
+                               *(ip->button_data.button12+1),key_tail,MAXKEYS);
+               /* button 17 is on the left side */
+               fprintf(fp, "%s         %i %i   %s %i)\n\n",
+               sp->button_string.button17, *ip->button_data.button17,
+                               *(ip->button_data.button17+1),key_tail,MAXKEYS);
+
+               fprintf(fp, "%s         %i      %s\n",
+               sp->button_string.repeat9, *ip->button_data.repeat9, but_tail);
+               fprintf(fp, "%s         %i      %s\n",
+               sp->button_string.repeat10, *ip->button_data.repeat10,but_tail);
+               fprintf(fp, "%s         %i      %s\n",
+               sp->button_string.repeat11, *ip->button_data.repeat11,but_tail);
+               fprintf(fp, "%s         %i      %s\n",
+               sp->button_string.repeat12, *ip->button_data.repeat12,but_tail);
+               fprintf(fp, "%s         %i      %s\n\n",
+               sp->button_string.repeat17, *ip->button_data.repeat17,but_tail);
+
+               fprintf(fp, "%s %i %i   %s %i)\n",
+               sp->button_string.button13, *ip->button_data.button13,
+                               *(ip->button_data.button13+1),key_tail,MAXKEYS);
+               fprintf(fp, "%s %i %i   %s %i)\n",
+               sp->button_string.button14, *ip->button_data.button14,
+                               *(ip->button_data.button14+1),key_tail,MAXKEYS);
+               fprintf(fp, "%s %i %i   %s %i)\n",
+               sp->button_string.button15, *ip->button_data.button15,
+                               *(ip->button_data.button15+1),key_tail,MAXKEYS);
+               fprintf(fp, "%s %i %i   %s %i)\n",
+               sp->button_string.button16, *ip->button_data.button16,
+                               *(ip->button_data.button16+1),key_tail,MAXKEYS);
+               fprintf(fp, "%s %i %i   %s %i)\n\n",
+               sp->button_string.button18, *ip->button_data.button18,
+                               *(ip->button_data.button18+1),key_tail,MAXKEYS);
+
+               fprintf(fp, "%s         %i      %s\n",
+               sp->button_string.repeat13, *ip->button_data.repeat13,but_tail);
+               fprintf(fp, "%s         %i      %s\n",
+               sp->button_string.repeat14, *ip->button_data.repeat14,but_tail);
+               fprintf(fp, "%s         %i      %s\n",
+               sp->button_string.repeat15, *ip->button_data.repeat15,but_tail);
+               fprintf(fp, "%s         %i      %s\n",
+               sp->button_string.repeat16, *ip->button_data.repeat16,but_tail);
+               fprintf(fp, "%s         %i      %s\n\n",
+               sp->button_string.repeat18, *ip->button_data.repeat18,but_tail);
+       }
+}
+
+
+
+
 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  Write a set of records tuned for a Intuos3/Cintiq tablet:
  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
@@ -486,6 +640,24 @@ static void write_preface(FILE* fp, const int model)
 "# Some ASCII art showing the \"default\" program record:\n"
 "#\n";
 
+       const char *model_bee =
+"# Cintiq 20 ExpressKeys Pad\n"
+"#             Left         Right\n"
+"#           +---+---+    +---+---+\n"
+"#           |N/A|N/A|    |N/A|N/A|\n"
+"#           +---+---+    +---+---+\n"
+"# Back Left                         Back Right\n"
+"#  +----+   +---+---+    +---+---+   +----+\n"
+"#  |    |   |   17  |    |   18  |   |    |\n"
+"#  | T  |   +---+---+    +---+---+   | T  |\n"
+"#  | O  |   |   | 9 |    | 13|   |   | O  |\n"
+"#  | U  |   |11 |---|    +---+ 15|   | U  |\n"
+"#  | C  |   |   |10 |    | 14|   |   | C  |\n"
+"#  | H  |   +---+---+    +---+---+   | H  |\n"
+"#  |    |   |   12  |    |   16  |   |    |\n"
+"#  +----+   +---+---+    +---+---+   +----+\n"
+"# The N/A keys aren't supported yet\n";
+
        const char* model_i3si3 =
 "# Left ExpressKeys Pad\n"
 "# ------------\n"
@@ -586,6 +758,9 @@ static void write_preface(FILE* fp, const int model)
                fprintf(fp, "%s", model_notnop1);
        }
 
+       if (model == bee)
+               fprintf(fp, "%s", model_bee);
+
        if ((model == i3s) || (model == i3)) {
                fprintf(fp, "%s", model_i3si3);
        }
@@ -631,7 +806,9 @@ static void write_if_lacking(FILE* errorfp, const char* configfile, int model)
 
                write_preface(fp, model);
 
-               if (model == i3) {
+               if (model == bee) {
+                       write_bee(fp);
+               } else if (model == i3) {
                        write_i3(fp);
                } else if (model == i3s) {
                        write_i3s(fp);
@@ -666,6 +843,9 @@ void write_config(FILE* errorfp)
        mip = model_list;
 
        for (i = 0; i < MAXPAD; i++, mip++) {
+               if (mip->bee->common_data.configfile)
+                       write_if_lacking(errorfp,
+                                       mip->bee->common_data.configfile, bee);
                if (mip->i3->common_data.configfile) {
                        write_if_lacking(errorfp,
                                        mip->i3->common_data.configfile, i3);
index 31e466e..dba9f92 100644 (file)
@@ -31,8 +31,8 @@ extern void exit_on_error(FILE* errorfp, char* string1, const char* string2,
 the longest keyword (currently RightPadTouchDown + a space = 18) + 32 keycodes
 of max 4 digits length + a space between each of them (sum 178): */
 #define MAXBUFFER 180
-/* 'Models': padless, Graphire4 BlueTooth, Graphire4, Intuos3 small, Intuos3: */
-#define MAXMODEL 5
+/* 'Models': padless, Graphire4 BlueTooth, Graphire4, Intuos3 small, Intuos3, Bee */
+#define MAXMODEL 6
 /* Max number of tablets per 'model': */
 #define MAXPAD 3
 /* Max number of styli per tablet: */
index 80d5aca..98cd752 100644 (file)
@@ -39,6 +39,7 @@ static unsigned long int* id_sty2;
 
 /* Crucial flags to keep track of the event state
  (except for the is_pad. But the future...): */
+static int is_bee;
 static int is_i3;
 static int is_i3s;
 static int is_g4;
@@ -310,6 +311,11 @@ static void prepare_action(int fake_key, int which_action)
 
        mip = model_list;
        for (i = 0; i < MAXPAD; i++, mip++) {
+               if ((mip->bee->common_data.sty1id != NULL)
+               && (mip->bee->common_data.sty1id == id_sty1)) {
+                       cdp = &mip->bee->common_data;
+                       break;
+               }
                if ((mip->i3->common_data.sty1id != NULL)
                && (mip->i3->common_data.sty1id == id_sty1)) {
                        cdp = &mip->i3->common_data;
@@ -542,6 +548,7 @@ static void do_repeat(void* base_address, void* record_address,
        XDeviceButtonEvent* tmp_button;
        XDeviceMotionEvent* tmp_motion;
 
+       struct bee_program* pbee;
        struct i3_program* pi3;
        struct i3s_program* pi3s;
        struct g4_program* pg4;
@@ -552,7 +559,14 @@ static void do_repeat(void* base_address, void* record_address,
        struct button_data* bdp = NULL;
        struct touch_data* tdp = NULL;
 
-       if (is_i3) {
+       if (is_bee) {
+               pbee = base_address;
+               base_cdp = &pbee->common_data;
+               pbee = record_address;
+               cdp = &pbee->common_data;
+               bdp = &pbee->button_data;
+               tdp = &pbee->touch_data;
+       } else if (is_i3) {
                pi3 = base_address;
                base_cdp = &pi3->common_data;
                pi3 = record_address;
@@ -895,6 +909,12 @@ static void do_repeat(void* base_address, void* record_address,
                                case 16:
                                        send_keys(bdp->button16, button_state);
                                        break;
+                               case 17:
+                                       send_keys(bdp->button17, button_state);
+                                       break;
+                               case 18:
+                                       send_keys(bdp->button18, button_state);
+                                       break;
 
                                default:
                                        return;
@@ -966,12 +986,17 @@ static void do_motion(void* base_address, void* record_address,
                rotation = motion->axis_data[0];
        }
 
+       struct bee_program* pbee;
        struct i3_program* pi3;
        struct i3s_program* pi3s;
        struct common_data* cdp = NULL;
        struct touch_data* tdp = NULL;
 
-       if (is_i3) {
+       if (is_bee) {
+               pbee = record_address;
+               cdp = &pbee->common_data;
+               tdp = &pbee->touch_data;
+       } else if (is_i3) {
                pi3 = record_address;
                cdp = &pi3->common_data;
                tdp = &pi3->touch_data;
@@ -1162,6 +1187,7 @@ static void do_button(void* base_address, void* record_address,
        int repeat_button = 0;
        int ok_button = 0;
 
+       struct bee_program* pbee;
        struct i3_program* pi3;
        struct i3s_program* pi3s;
        struct g4_program* pg4;
@@ -1171,7 +1197,11 @@ static void do_button(void* base_address, void* record_address,
        struct button_data* bdp = NULL;
        struct wheel_data* wdp = NULL;
 
-       if (is_i3) {
+       if (is_bee) {
+               pbee = record_address;
+               cdp = &pbee->common_data;
+               bdp = &pbee->button_data;
+       } else if (is_i3) {
                pi3 = record_address;
                cdp = &pi3->common_data;
                bdp = &pi3->button_data;
@@ -1324,6 +1354,24 @@ configuration file *\n");
                                }
                        }
                        break;
+               case 17:
+                       if (*bdp->button17) {
+                               ok_button = 1;
+                               send_keys(bdp->button17, button_state);
+                               if (*bdp->repeat17) {
+                                       repeat_button = 1;
+                               }
+                       }
+                       break;
+               case 18:
+                       if (*bdp->button18) {
+                               ok_button = 1;
+                               send_keys(bdp->button18, button_state);
+                               if (*bdp->repeat18) {
+                                       repeat_button = 1;
+                               }
+                       }
+                       break;
                default:
                        return;
 
@@ -1351,6 +1399,7 @@ configuration file *\n");
 
 static void do_stylus(void* base_address, void* record_address)
 {
+       struct bee_program* pbee;
        struct i3_program* pi3;
        struct i3s_program* pi3s;
        struct g4_program* pg4;
@@ -1360,7 +1409,12 @@ static void do_stylus(void* base_address, void* record_address)
        struct common_data* cdp = NULL;
        struct common_data* base_cdp = NULL;
 
-       if (is_i3) {
+       if (is_bee) {
+               pbee = base_address;
+               base_cdp = &pbee->common_data;
+               pbee = record_address;
+               cdp = &pbee->common_data;
+       } else if (is_i3) {
                pi3 = base_address;
                base_cdp = &pi3->common_data;
                pi3 = record_address;
@@ -1452,6 +1506,7 @@ static void* find_focus(void* record_address, XEvent Event)
        focus_window = None;
        name_change = 0;
 
+       struct bee_program* pbee;
        struct i3_program* pi3;
        struct i3s_program* pi3s;
        struct g4_program* pg4;
@@ -1496,7 +1551,48 @@ static void* find_focus(void* record_address, XEvent Event)
 "--------------------------------------------------------------------------\n");
        }
 
-       if (is_i3) {
+       if (is_bee) {
+               pbee = record_address;
+               if ((focus_window == root) || (class_hint->res_class == NULL)) {
+                       record_address = pbee->default_program;
+                       pbee = record_address;
+                       if (be_verbose) {
+                               fprintf(stderr, "%s %s\n", prog_focus,
+                                               pbee->common_data.class_name);
+                       }
+                       if (strcmp(namebuffer, pbee->common_data.class_name)
+                                                                       != 0) {
+                               snprintf(namebuffer, MAXBUFFER, "%s",
+                                               pbee->common_data.class_name);
+                               name_change = 1;
+                       }
+                       goto clean_up;
+               }
+               for (i = 0; i < record_num; i++, pbee++) {
+                       if (strcmp(class_hint->res_class,
+                                       pbee->common_data.class_name) == 0) {
+                               in_list = 1;
+                               break;
+                       }
+               }
+               if (!in_list) {
+                       pbee = record_address;
+                       record_address = pbee->default_program;
+                       pbee = record_address;
+               } else {
+                       record_address = pbee;
+               }
+               if (be_verbose) {
+                       fprintf(stderr, "%s %s\n", prog_focus,
+                                               pbee->common_data.class_name);
+               }
+               if (strcmp(namebuffer, pbee->common_data.class_name) != 0) {
+                       snprintf(namebuffer, MAXBUFFER, "%s",
+                                               pbee->common_data.class_name);
+                       name_change = 1;
+               }
+               goto clean_up;
+       } else if (is_i3) {
                pi3 = record_address;
                if ((focus_window == root) || (class_hint->res_class == NULL)) {
                        record_address = pi3->default_program;
@@ -1731,6 +1827,42 @@ static void* match_id(XDeviceButtonEvent* button, XDeviceMotionEvent* motion)
        if (button) {
                mip = model_list;
                for (i = 0; i < MAXPAD; i++, mip++) {
+                       if ((mip->bee->common_data.padid != NULL
+                       && *mip->bee->common_data.padid ==
+                                       button->deviceid)
+                       || (mip->bee->common_data.sty1id != NULL
+                       && *mip->bee->common_data.sty1id ==
+                                       button->deviceid)
+                       || (mip->bee->common_data.sty2id != NULL
+                       && *mip->bee->common_data.sty2id ==
+                                       button->deviceid)) {
+                               if (mip->bee->default_program == NULL) {
+                                       return NULL;
+                               }
+                               if (mip->bee->common_data.padid != NULL
+                               && *mip->bee->common_data.padid ==
+                                                       button->deviceid) {
+                                       is_pad = 1;
+                                       id_pad = mip->bee->common_data.padid;
+                               } else if (mip->bee->common_data.sty1id != NULL
+                               && *mip->bee->common_data.sty1id ==
+                                                       button->deviceid) {
+                                       is_sty1 = 1;
+                               } else if (mip->bee->common_data.sty2id != NULL
+                               && *mip->bee->common_data.sty2id ==
+                                                       button->deviceid) {
+                                       is_sty2 = 1;
+                               }
+                               is_bee = 1;
+                               record_num = mip->bee->common_data.num_record;
+                               if (mip->bee->common_data.sty1id != NULL) {
+                                       id_sty1 = mip->bee->common_data.sty1id;
+                               }
+                               if (mip->bee->common_data.sty2id != NULL) {
+                                       id_sty2 = mip->bee->common_data.sty2id;
+                               }
+                               return mip->bee;
+                       }
                        if ((mip->i3->common_data.padid != NULL
                        && *mip->i3->common_data.padid ==
                                        button->deviceid)
@@ -1905,6 +2037,24 @@ static void* match_id(XDeviceButtonEvent* button, XDeviceMotionEvent* motion)
        } else if (motion) {
                mip = model_list;
                for (i = 0; i < MAXPAD; i++, mip++) {
+                       if ((mip->bee->common_data.padid != NULL)
+                       && (*mip->bee->common_data.padid
+                                       == motion->deviceid)) {
+                               if (mip->bee->default_program == NULL) {
+                                       return NULL;
+                               }
+                               is_pad = 1;
+                               is_bee = 1;
+                               id_pad = mip->bee->common_data.padid;
+                               record_num = mip->bee->common_data.num_record;
+                               if (mip->bee->common_data.sty1id != NULL) {
+                                       id_sty1 = mip->bee->common_data.sty1id;
+                               }
+                               if (mip->bee->common_data.sty2id != NULL) {
+                                       id_sty2 = mip->bee->common_data.sty2id;
+                               }
+                               return mip->bee;
+                       }
                        if ((mip->i3->common_data.padid != NULL)
                        && (*mip->i3->common_data.padid
                                        == motion->deviceid)) {
@@ -2000,6 +2150,7 @@ void use_events()
                        }
                }
 
+               is_bee = 0;
                is_i3 = 0;
                is_i3s = 0;
                is_g4 = 0;
index a55b054..975b743 100644 (file)
@@ -42,6 +42,7 @@ int proximity_in_type;
 int proximity_out_type;
 
 /* Used in many situations as identification, for math and for flow control: */
+const int bee = 5;
 const int i3 = 4;
 const int i3s = 3;
 const int g4 = 2;
@@ -99,6 +100,7 @@ static int identify_device(char* device_name)
 {
        ok_xsetwacom = 0;
 
+       const char* cintiq_20wsx = "197"; /* 0xC5 */
        const char* cintiq_21UX = "63"; /* 0x3F */
        const char* i3_6x8 = "177"; /* 0xB1 */
        const char* i3_9x12 = "178"; /* 0xB2 */
@@ -172,6 +174,9 @@ static int identify_device(char* device_name)
 
                if (ok_value) {
                        len = strcspn(read_buffer, " \t\n");
+                       if ((strncmp(read_buffer, cintiq_20wsx, len)) == 0) {
+                               return bee;
+                       }
                        if ((strncmp(read_buffer, cintiq_21UX, len)) == 0) {
                                return i3;
                        }
index 584ba4e..7f0f948 100644 (file)
@@ -41,12 +41,16 @@ const char* total_file3_intuos3s;
 const char* total_file1_intuos3;
 const char* total_file2_intuos3;
 const char* total_file3_intuos3;
+const char* total_file1_bee;
+const char* total_file2_bee;
+const char* total_file3_bee;
 
 /* Externals: */
 
 extern int have_pad;
 extern int have_padless;
 
+extern const int bee;
 extern const int i3;
 extern const int i3s;
 extern const int g4;
@@ -79,6 +83,20 @@ static void mark_device(const char* device, int row, int column,
                                                        const char* configfile)
 {
        if (device == pad_string) {
+               if (row == bee) {
+                       struct bee_program* p = NULL;
+                       if (column == 0) {
+                               p = bee_1_external_list;
+                       } else if (column == 1) {
+                               p = bee_2_external_list;
+                       } else if (column == 2) {
+                               p = bee_3_external_list;
+                       }
+                       p->common_data.padname = pad_name[row][column];
+                       p->common_data.padid = pad_id[row][column];
+                       p->common_data.configfile = configfile;
+                       return;
+               }
                if (row == i3) {
                        struct i3_program* p = NULL;
                        if (column == 0) {
@@ -150,6 +168,31 @@ static void mark_device(const char* device, int row, int column,
        }
 
        if (device == stylus_string) {
+               if ((column == MAXPAD*bee) || (column == (MAXPAD*bee)+1)
+                       || (column == (MAXPAD*bee)+2)) {
+                       struct bee_program* p = NULL;
+                       if (column == MAXPAD*bee) {
+                               p = bee_1_external_list;
+                       } else if (column == (MAXPAD*bee)+1) {
+                               p = bee_2_external_list;
+                       } else if (column == (MAXPAD*bee)+2) {
+                               p = bee_3_external_list;
+                       }
+                       if (row == 0) {
+                               p->common_data.sty1name =
+                                               stylus_name[row][column];
+                               p->common_data.sty1id = stylus_id[row][column];
+                               p->common_data.sty1mode =
+                                               stylus_mode[row][column];
+                       } else if (row == 1) {
+                               p->common_data.sty2name =
+                                               stylus_name[row][column];
+                               p->common_data.sty2id = stylus_id[row][column];
+                               p->common_data.sty2mode =
+                                               stylus_mode[row][column];
+                       }
+                       return;
+               }
                if ((column == MAXPAD*i3) || (column == (MAXPAD*i3)+1)
                        || (column == (MAXPAD*i3)+2)) {
                        struct i3_program* p = NULL;
@@ -299,8 +342,35 @@ static void mark_config(const char* device, int row, int column)
        const char* file1_intuos3 = "/intuos3.conf1";
        const char* file2_intuos3 = "/intuos3.conf2";
        const char* file3_intuos3 = "/intuos3.conf3";
+       const char* file1_bee = "/cintiq20.conf1";
+       const char* file2_bee = "/cintiq20.conf2";
+       const char* file3_bee = "/cintiq20.conf3";
 
        switch (row) {
+/* pad Cintiq 20wsx */
+       case 5:
+               switch (column) {
+               case 0:
+                       total_file1_bee = path_malloc
+                               ((void*)total_config_dir, (void*)file1_bee);
+                       mark_device(device, row, column, total_file1_bee);
+                       return;
+
+               case 1:
+                       total_file2_bee = path_malloc
+                               ((void*)total_config_dir, (void*)file2_bee);
+                       mark_device(device, row, column, total_file2_bee);
+                       return;
+
+               case 2:
+                       total_file3_bee = path_malloc
+                               ((void*)total_config_dir, (void*)file3_bee);
+                       mark_device(device, row, column, total_file3_bee);
+                       return;
+
+               default:
+                       return;
+               }
 /* pad Intuos3/Cintiq 21UX */
        case 4:
                switch (column) {
index 8ec84c4..7b17bfa 100644 (file)
@@ -43,6 +43,7 @@ const char* sty2str = "CurrentSty2";
 extern int ok_config;
 extern int go_daemon;
 
+extern const int bee;
 extern const int i3;
 extern const int i3s;
 extern const int g4;
@@ -83,6 +84,9 @@ extern char* total_file3_intuos3s;
 extern char* total_file1_intuos3;
 extern char* total_file2_intuos3;
 extern char* total_file3_intuos3;
+extern char* total_file1_bee;
+extern char* total_file2_bee;
+extern char* total_file3_bee;
 
 extern void read_config(FILE* errorfp);
 
@@ -96,18 +100,19 @@ void report_header(FILE* statusfp)
 
        fprintf(statusfp,
 "\n'Models': nopad, Graphire4 BlueTooth, Graphire4, Intuos3 small, \
-Intuos3/Cintiq\n");
+Intuos3/Cintiq, Cintiq 20wsx\n");
        fprintf(statusfp, "\n* Pad-index *\n");
        fprintf(statusfp, "%i (nop): 0 1 2\n", nop);
        fprintf(statusfp, "%i (g4b): 0 1 2\n", g4b);
        fprintf(statusfp, "%i (g4 ): 0 1 2\n", g4);
        fprintf(statusfp, "%i (i3s): 0 1 2\n", i3s);
-       fprintf(statusfp, "%i (i3 ): 0 1 2\n\n", i3);
+       fprintf(statusfp, "%i (i3 ): 0 1 2\n", i3);
+       fprintf(statusfp, "%i (bee): 0 1 2\n\n", bee);
        fprintf(statusfp, "* Stylus-index *\n");
        fprintf(statusfp, "0 st1 (nop): 0 1 2 (g4b): 3 4 5 (g4): 6 7 8 \
-(i3s): 9 10 11 (i3): 12 13 14\n");
+(i3s): 9 10 11 (i3): 12 13 14 (bee): 15 16\n");
        fprintf(statusfp, "1 st2 (nop): 0 1 2 (g4b): 3 4 5 (g4): 6 7 8 \
-(i3s): 9 10 11 (i3): 12 13 14\n\n");
+(i3s): 9 10 11 (i3): 12 13 14 (bee): 15 16\n\n");
        fprintf(statusfp, "PGR RUNNAME = %s\n", our_prog_name);
        fprintf(statusfp, "PGR VERSION = %s\n", our_prog_version);
        fprintf(statusfp, "USR HOMEDIR = %s\n", getenv("HOME"));
@@ -141,6 +146,7 @@ Intuos3/Cintiq\n");
 
 static void report_record(FILE* statusfp, void* address, const int model)
 {
+       struct bee_program* pbee;
        struct i3_program* pi3;
        struct i3s_program* pi3s;
        struct g4_program* pg4;
@@ -148,7 +154,10 @@ static void report_record(FILE* statusfp, void* address, const int model)
        struct nop_program* pnop;
        struct common_data* cdp = NULL;
 
-       if (model == i3) {
+       if (model == bee) {
+               pbee = address;
+               cdp = &pbee->common_data;
+       } else if (model == i3) {
                pi3 = address;
                cdp = &pi3->common_data;
        } else if (model == i3s) {
@@ -206,6 +215,7 @@ static void report_common(FILE* statusfp)
        int num_record;
        const char* pgr_records = "PGR RECORDS =";
 
+       struct bee_program* pbee;
        struct i3_program* pi3;
        struct i3s_program* pi3s;
        struct g4_program* pg4;
@@ -216,6 +226,20 @@ static void report_common(FILE* statusfp)
        mip = model_list;
 
        for (i = 0; i < MAXPAD; i++, mip++) {
+               if (mip->bee->common_data.num_record) {
+                       print_common(statusfp, mip->bee->common_data.configfile,
+                                       mip->bee->common_data.userconfigversion,
+                                               mip->bee->common_data.padname,
+                                               mip->bee->common_data.sty1name,
+                                               mip->bee->common_data.sty2name);
+                       num_record = mip->bee->common_data.num_record;
+                       pbee = mip->bee;
+                       for (j = 0; j < num_record; j++, pbee++) {
+                               report_record(statusfp, pbee, bee);
+                       }
+                       fprintf(statusfp, "%s %i (of max %i)\n\n", pgr_records,
+                                                       num_record, MAXRECORDS);
+               }
                if (mip->i3->common_data.num_record) {
                        print_common(statusfp, mip->i3->common_data.configfile,
                                        mip->i3->common_data.userconfigversion,
@@ -366,6 +390,7 @@ void re_read_config(int signum)
 
 static void free_common(void* address, const int model)
 {
+       struct bee_program* pbee;
        struct i3_program* pi3;
        struct i3s_program* pi3s;
        struct g4_program* pg4;
@@ -373,7 +398,10 @@ static void free_common(void* address, const int model)
        struct nop_program* pnop;
        struct common_data* cdp = NULL;
 
-       if (model == i3) {
+       if (model == bee) {
+               pbee = address;
+               cdp = &pbee->common_data;
+       } else if (model == i3) {
                pi3 = address;
                cdp = &pi3->common_data;
        } else if (model == i3s) {
@@ -417,6 +445,7 @@ void clean_up_exit(int signum)
 {
        int i, j;
 
+       struct bee_program* pbee;
        struct i3_program* pi3;
        struct i3s_program* pi3s;
        struct g4_program* pg4;
@@ -440,6 +469,12 @@ void clean_up_exit(int signum)
 
        mip = model_list;
        for (i = 0; i < MAXPAD; i++, mip++) {
+               if (mip->bee->common_data.configfile) {
+                       pbee = mip->bee;
+                       for (j = 0; j < MAXRECORDS; j++, pbee++) {
+                               free_common(pbee, bee);
+                       }
+               }
                if (mip->i3->common_data.configfile) {
                        pi3 = mip->i3;
                        for (j = 0; j < MAXRECORDS; j++, pi3++) {
@@ -555,6 +590,18 @@ void clean_up_exit(int signum)
                free(total_file3_intuos3);
        }
 
+/*---*/
+
+       if (total_file1_bee) {
+               free(total_file1_bee);
+       }
+       if (total_file2_bee) {
+               free(total_file2_bee);
+       }
+       if (total_file3_bee) {
+               free(total_file3_bee);
+       }
+
 /* The pad devices and styli devices should not be explicitly closed by a
  call to XCloseDevice. It leaves a message from X (in the terminal where X
  is started from) saying: "ProcXCloseDevice to close or not ?" Instead we
index b0c415a..9335141 100644 (file)
 
 /* Globals: */
 
+struct bee_program bee_internal_list[] = {
+       {
+       .common_data = {
+               .class_name = "default",
+               .stylus1_presscurve = "0 0 100 100",
+               .stylus2_presscurve = "0 0 100 100",
+               },
+       .touch_data = {
+               .handle_touch = { 1 },
+               .repeat_after = { 0, 6 },
+               .repeat_delay = { 0, 1 },
+               .repeat_left_up = { 1 },
+               .repeat_left_down = { 1 },
+               .repeat_right_up = { 1 },
+               .repeat_right_down = { 1 },
+               .left_touch_up = { 994, 0 },
+               .left_touch_down = { 995, 0 },
+               .right_touch_up = { 98, 0 },
+               .right_touch_down = { 104, 0 },
+               },
+       .button_data = {
+               .repeat_after = { 0, 5 },
+               .repeat_delay = { 0, 1 },
+               .button9 = { 50, 0 },
+               .button10 = { 64, 0 },
+               .button11 = { 37, 0 },
+               .button12 = { 65, 0 },
+               .button13 = { 50, 0 },
+               .button14 = { 64, 0 },
+               .button15 = { 37, 0 },
+               .button16 = { 65, 0 },
+               .button17 = { 9, 0 },
+               .button18 = { 36, 0 },
+               },
+       },
+       {
+       .common_data = {
+               .class_name = "Gimp",
+               .stylus1_presscurve = "0 0 100 100",
+               .stylus2_presscurve = "0 0 100 100",
+               },
+       .touch_data = {
+               .handle_touch = { 1 },
+               .repeat_after = { 0, 6 },
+               .repeat_delay = { 0, 1 },
+               .left_touch_up = { 20, 0 },
+               .left_touch_down = { 61, 0 },
+               .right_touch_up = { 98, 20 },
+               .right_touch_down = { 104, 61 },
+               },
+       .button_data = {
+               .repeat_after = { 0, 5 },
+               .repeat_delay = { 0, 1 },
+               .button9 = { 50, 0 },
+               .button10 = { 64, 0 },
+               .button11 = { 37, 0 },
+               .button12 = { 65, 0 },
+               .button13 = { 37, 29 },
+               .button14 = { 37, 52 },
+               .button15 = { 999, 0 },
+               .button16 = { 65, 0 },
+               .button17 = { 9, 0 },
+               .button18 = { 36, 0 },
+               },
+       },
+       {
+       .common_data = {
+               .class_name = "Blender",
+               .stylus1_presscurve = "0 0 100 100",
+               .stylus2_presscurve = "0 0 100 100",
+               },
+       .touch_data = {
+               .handle_touch = { 1 },
+               .repeat_after = { 0, 6 },
+               .repeat_delay = { 0, 1 },
+               .repeat_left_up = { 1 },
+               .repeat_left_down = { 1 },
+               .repeat_right_up = { 1 },
+               .repeat_right_down = { 1 },
+               .left_touch_up = { 102, 0 },
+               .left_touch_down = { 100, 0 },
+               .right_touch_up = { 98, 0 },
+               .right_touch_down = { 104, 0 },
+               },
+       .button_data = {
+               .repeat_after = { 0, 5 },
+               .repeat_delay = { 0, 1 },
+               .button9 = { 37, 0 },
+               .button10 = { 9, 0 },
+               .button11 = { 50, 0 },
+               .button12 = { 23, 0 },
+               .button13 = { 37, 29 },
+               .button14 = { 37, 52 },
+               .button15 = { 999, 0 },
+               .button16 = { 65, 0 },
+               .button17 = { 9, 0 },
+               .button18 = { 36, 0 },
+               },
+       },
+       {
+       .common_data = {
+               .class_name = "XTerm",
+               .stylus1_presscurve = "0 0 100 100",
+               .stylus2_presscurve = "0 0 100 100",
+               },
+       .touch_data = {
+               .repeat_after = { 0, 6 },
+               .repeat_delay = { 0, 1 },
+               },
+       .button_data = {
+               .repeat_after = { 0, 5 },
+               .repeat_delay = { 0, 1 },
+               .button15 = { 999, 0 },
+               },
+       },
+};
+const int bee_num_list = (sizeof bee_internal_list / sizeof bee_internal_list[0]);
+
+struct bee_program bee_1_external_list[MAXRECORDS];
+struct bee_program bee_2_external_list[MAXRECORDS];
+struct bee_program bee_3_external_list[MAXRECORDS];
+
+struct bee_configstrings bee_configstrings[] = {
+{{"DelayEachKeycode", "ProgramName", "Stylus1PressCurve", "Stylus2PressCurve"},
+{"HandleTouchStrips", "TouchRepeatAfter", "DelayTouchRepeat",
+"RepeatLeftUp", "RepeatLeftDown", "RepeatRightUp", "RepeatRightDown",
+"LeftPadTouchUp", "LeftPadTouchDown", "RightPadTouchUp", "RightPadTouchDown"},
+{"ButtonRepeatAfter", "DelayButtonRepeat",
+"RepeatButton9", "RepeatButton10", "RepeatButton11", "RepeatButton12",
+"RepeatButton13", "RepeatButton14", "RepeatButton15", "RepeatButton16",
+"RepeatButton17", "RepeatButton18",
+"LeftPadButton9", "LeftPadButton10", "LeftPadButton11", "LeftPadButton12",
+"RightPadButton13", "RightPadButton14", "RightPadButton15", "RightPadButton16",
+"LeftPadButton17", "RightPadButton18"}}
+};
+
 struct i3_program i3_internal_list[] = {
        {NULL,{NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,
        {0,0},"default", "0 0 100 100", "0 0 100 100"},
        {{1},{0,6},{0,1},{1},{1},{1},{1},
-       {994,0},{995,0},{102,0},{100,0}},
-       {{0,5},{0,1},{0},{0},{0},{0},{0},{0},{0},{0},
+       {994,0},{995,0},{98,0},{104,0}},
+       {{0,5},{0,1},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},
        {50,0},{64,0},{37,0},{65,0},
-       {50,0},{64,0},{37,0},{65,0}}},
+       {50,0},{64,0},{37,0},{65,0},}},
        {NULL,{NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,
        {0,0},"Gimp", "0 0 100 100", "0 0 100 100"},
        {{1},{0,6},{0,1},{0},{0},{0},{0},
        {20,0},{61,0},{64,20},{64,61}},
-       {{0,5},{0,1},{0},{0},{0},{0},{0},{0},{0},{0},
+       {{0,5},{0,1},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},
        {50,0},{64,0},{37,0},{65,0},
-       {37,29},{37,52},{999,0},{65,0}}},
+       {37,29},{37,52},{999,0},{65,0},}},
        {NULL,{NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,
        {0,0},"Blender", "0 0 100 100", "0 0 100 100"},
        {{1},{0,6},{0,1},{1},{1},{1},{1},
        {102,0},{100,0},{98,0},{104,0}},
-       {{0,5},{0,1},{0},{0},{0},{0},{0},{0},{0},{0},
+       {{0,5},{0,1},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},
        {37,0},{9,0},{50,0},{23,0},
-       {37,29},{37,52},{999,0},{65,0}}},
+       {37,29},{37,52},{999,0},{65,0},}},
        {NULL,{NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,
        {0,0},"XTerm", "0 0 100 100", "0 0 100 100"},
        {{0},{0,6},{0,1},{0},{0},{0},{0},
        {0,0},{0,0},{0,0},{0,0}},
-       {{0,5},{0,1},{0},{0},{0},{0},{0},{0},{0},{0},
+       {{0,5},{0,1},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},
        {0,0},{0,0},{0,0},{0,0},
-       {0,0},{0,0},{999,0},{0,0}}}
+       {0,0},{0,0},{999,0},{0,0},}}
 };
 const int i3_num_list = (sizeof i3_internal_list / sizeof i3_internal_list[0]);
 
@@ -67,8 +203,10 @@ struct i3_configstrings i3_configstrings[] = {
 {"ButtonRepeatAfter", "DelayButtonRepeat",
 "RepeatButton9", "RepeatButton10", "RepeatButton11", "RepeatButton12",
 "RepeatButton13", "RepeatButton14", "RepeatButton15", "RepeatButton16",
+NULL,NULL,
 "LeftPadButton9", "LeftPadButton10", "LeftPadButton11", "LeftPadButton12",
-"RightPadButton13", "RightPadButton14", "RightPadButton15", "RightPadButton16"}}
+"RightPadButton13", "RightPadButton14", "RightPadButton15", "RightPadButton16",
+NULL, NULL}}
 };
 
 struct i3s_program i3s_internal_list[] = {
@@ -76,26 +214,26 @@ struct i3s_program i3s_internal_list[] = {
        {0,0},"default", "0 0 100 100", "0 0 100 100"},
        {{1},{0,6},{0,1},{1},{1},{0},{0},
        {994,0},{995,0}},
-       {{0,5},{0,1},{0},{0},{0},{0},{0},{0},{0},{0},
-       {50,0},{64,0},{37,0},{65,0}}},
+       {{0,5},{0,1},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},
+       {50,0},{64,0},{37,0},{65,0},}},
        {NULL,{NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,
        {0,0},"Gimp", "0 0 100 100", "0 0 100 100"},
        {{1},{0,6},{0,1},{0},{0},{0},{0},
        {20,0},{61,0}},
-       {{0,5},{0,1},{0},{0},{0},{0},{0},{0},{0},{0},
-       {37,29},{37,52},{999,0},{65,0}}},
+       {{0,5},{0,1},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},
+       {37,29},{37,52},{999,0},{65,0},}},
        {NULL,{NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,
        {0,0},"Blender", "0 0 100 100", "0 0 100 100"},
        {{1},{0,6},{0,1},{1},{1},{0},{0},
        {102,0},{100,0}},
-       {{0,5},{0,1},{0},{0},{0},{0},{0},{0},{0},{0},
-       {37,29},{37,52},{999,0},{65,0}}},
+       {{0,5},{0,1},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},
+       {37,29},{37,52},{999,0},{65,0},}},
        {NULL,{NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,
        {0,0},"XTerm", "0 0 100 100", "0 0 100 100"},
        {{0},{0,6},{0,1},{0},{0},{0},{0},
        {0,0},{0,0}},
-       {{0,5},{0,1},{0},{0},{0},{0},{0},{0},{0},{0},
-       {0,0},{0,0},{999,0},{0,0}}}
+       {{0,5},{0,1},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},
+       {0,0},{0,0},{999,0},{0,0},}}
 };
 const int i3s_num_list = (sizeof i3s_internal_list / sizeof
                                                        i3s_internal_list[0]);
@@ -110,7 +248,7 @@ struct i3s_configstrings i3s_configstrings[] = {
 "RepeatLeftUp","RepeatLeftDown",NULL,NULL,"LeftPadTouchUp", "LeftPadTouchDown"},
 {"ButtonRepeatAfter", "DelayButtonRepeat",
 "RepeatButton9", "RepeatButton10", "RepeatButton11", "RepeatButton12",
-NULL,NULL,NULL,NULL,
+NULL,NULL,NULL,NULL,NULL,NULL,
 "LeftPadButton9", "LeftPadButton10", "LeftPadButton11", "LeftPadButton12"}}
 };
 
@@ -118,23 +256,23 @@ struct g4_program g4_internal_list[] = {
        {NULL,{NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,
        {0,0},"default", "0 0 100 100", "0 0 100 100"},
        {{1},{994,0},{995,0}},
-       {{0,5},{0,1},{0},{0},{0},{0},{0},{0},{0},{0},
-       {50,0},{64,0}}},
+       {{0,5},{0,1},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},
+       {50,0},{64,0},}},
        {NULL,{NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,
        {0,0},"Gimp", "0 0 100 100", "0 0 100 100"},
        {{1},{20,0},{61,0}},
-       {{0,5},{0,1},{0},{0},{0},{0},{0},{0},{0},{0},
-       {37,29},{37,52}}},
+       {{0,5},{0,1},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},
+       {37,29},{37,52},}},
        {NULL,{NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,
        {0,0},"Blender", "0 0 100 100", "0 0 100 100"},
        {{1},{102,0},{100,0}},
-       {{0,5},{0,1},{0},{0},{0},{0},{0},{0},{0},{0},
-       {37,29},{37,52}}},
+       {{0,5},{0,1},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},
+       {37,29},{37,52},}},
        {NULL,{NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,
        {0,0},"XTerm", "0 0 100 100", "0 0 100 100"},
        {{0},{0,0},{0,0}},
-       {{0,5},{0,1},{0},{0},{0},{0},{0},{0},{0},{0},
-       {0,0},{999,0}}}
+       {{0,5},{0,1},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},
+       {0,0},{999,0},}}
 };
 const int g4_num_list = (sizeof g4_internal_list / sizeof g4_internal_list[0]);
 
@@ -146,27 +284,27 @@ struct g4_configstrings g4_configstrings[] = {
 {{"DelayEachKeycode", "ProgramName", "Stylus1PressCurve", "Stylus2PressCurve"},
 {"HandleScrollWheel", "ScrollWheelUp", "ScrollWheelDown"},
 {"ButtonRepeatAfter", "DelayButtonRepeat",
-"RepeatLeft", "RepeatRight",NULL,NULL,NULL,NULL,NULL,NULL,
+"RepeatLeft", "RepeatRight",NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
 "LeftButton", "RightButton"}}
 };
 
 struct g4b_program g4b_internal_list[] = {
        {NULL,{NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,
        {0,0},"default", "0 0 100 100", "0 0 100 100"},
-       {{0,5},{0,1},{0},{0},{0},{0},{0},{0},{0},{0},
-       {50,0},{64,0}}},
+       {{0,5},{0,1},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},
+       {50,0},{64,0},}},
        {NULL,{NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,
        {0,0},"Gimp", "0 0 100 100", "0 0 100 100"},
-       {{0,5},{0,1},{0},{0},{0},{0},{0},{0},{0},{0},
-       {37,29},{37,52}}},
+       {{0,5},{0,1},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},
+       {37,29},{37,52},}},
        {NULL,{NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,
        {0,0},"Blender", "0 0 100 100", "0 0 100 100"},
-       {{0,5},{0,1},{0},{0},{0},{0},{0},{0},{0},{0},
-       {37,29},{37,52}}},
+       {{0,5},{0,1},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},
+       {37,29},{37,52},}},
        {NULL,{NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,
        {0,0},"XTerm", "0 0 100 100", "0 0 100 100"},
-       {{0,5},{0,1},{0},{0},{0},{0},{0},{0},{0},{0},
-       {0,0},{999,0}}}
+       {{0,5},{0,1},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},
+       {0,0},{999,0},}}
 };
 const int g4b_num_list = (sizeof g4b_internal_list / sizeof
                                                        g4b_internal_list[0]);
@@ -178,7 +316,7 @@ struct g4b_program g4b_3_external_list[MAXRECORDS];
 struct g4b_configstrings g4b_configstrings[] = {
 {{"DelayEachKeycode", "ProgramName", "Stylus1PressCurve", "Stylus2PressCurve"},
 {"ButtonRepeatAfter", "DelayButtonRepeat",
-"RepeatLeft", "RepeatRight",NULL,NULL,NULL,NULL,NULL,NULL,
+"RepeatLeft", "RepeatRight",NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
 "LeftButton", "RightButton"}}
 };
 
@@ -204,12 +342,12 @@ struct nop_configstrings nop_configstrings[] = {
 };
 
 struct model_index model_list[] = {
-       {i3_1_external_list, i3s_1_external_list, g4_1_external_list,
-                               g4b_1_external_list, nop_1_external_list},
-       {i3_2_external_list, i3s_2_external_list, g4_2_external_list,
-                               g4b_2_external_list, nop_2_external_list},
-       {i3_3_external_list, i3s_3_external_list, g4_3_external_list,
-                               g4b_3_external_list, nop_3_external_list}
+       {bee_1_external_list, i3_1_external_list, i3s_1_external_list,
+        g4_1_external_list, g4b_1_external_list, nop_1_external_list},
+       {bee_2_external_list, i3_2_external_list, i3s_2_external_list,
+        g4_2_external_list, g4b_2_external_list, nop_2_external_list},
+       {bee_3_external_list, i3_3_external_list, i3s_3_external_list,
+        g4_3_external_list, g4b_3_external_list, nop_3_external_list}
 };
 
 /* End Code */
index 22301e0..38a0caa 100644 (file)
@@ -74,6 +74,8 @@ extern struct button_data {
        int repeat14 [1];
        int repeat15 [1];
        int repeat16 [1];
+       int repeat17 [1];
+       int repeat18 [1];
        int button9[MAXKEYS];
        int button10[MAXKEYS];
        int button11[MAXKEYS];
@@ -82,11 +84,21 @@ extern struct button_data {
        int button14[MAXKEYS];
        int button15[MAXKEYS];
        int button16[MAXKEYS];
+       int button17[MAXKEYS];
+       int button18[MAXKEYS];
 } button_data[];
 
 
 /* Data structures (consolidation): */
 
+extern struct bee_program {
+       struct bee_program* default_program;
+       struct common_data common_data;
+       struct touch_data touch_data;
+       struct button_data button_data;
+} bee_internal_list[], bee_1_external_list[], bee_2_external_list[],
+                                                       bee_3_external_list[];
+
 extern struct i3_program {
        struct i3_program* default_program;
        struct common_data common_data;
@@ -165,6 +177,8 @@ extern struct button_string {
        const char* repeat14;
        const char* repeat15;
        const char* repeat16;
+       const char* repeat17;
+       const char* repeat18;
        const char* button9;
        const char* button10;
        const char* button11;
@@ -173,11 +187,19 @@ extern struct button_string {
        const char* button14;
        const char* button15;
        const char* button16;
+       const char* button17;
+       const char* button18;
 } button_string[];
 
 
 /* String structures (consolidation): */
 
+extern struct bee_configstrings {
+       struct common_string common_string;
+       struct touch_string touch_string;
+       struct button_string button_string;
+} bee_configstrings[];
+
 extern struct i3_configstrings {
        struct common_string common_string;
        struct touch_string touch_string;
@@ -209,6 +231,7 @@ extern struct nop_configstrings {
 /* Data structure (final consolidation): */
 
 extern struct model_index {
+       struct bee_program* bee;
        struct i3_program* i3;
        struct i3s_program* i3s;
        struct g4_program* g4;