Re: [AD] keyboard recalcitrant under X

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Sun, 2003-03-09 at 17:24, Eric Botcazou wrote:
> > Maybe tools/x11/xkeymap can solve the problem. This also reminds to
> > attach this small patch which adds xkeymap to the makefile..
> 
> This patch is not ok since it doesn't conditionalize the compilation of 
> xkeymap.

I completely forgot the dependence on X, but when I tried adding xf2pcx,
I already had failed to figure out how to detect the same.

> I'd suggest to add ALLEGRO_LIB_X_EXE_SOURCES and ALLEGRO_LIB_X_EXES to 
> makefile.lst with the right entries for xkeymap (you could also add xf2pcx 
> in the process), then define ALLEGRO_MAYBE_LIB_X_EXE_SOURCES and 
> ALLEGRO_MAYBE_LIB_X_EXES in configure.in (around line 307) and use the 
> latter two symbols in your patch against makefile.in

Ah, now I understand. The contents of configure.in looked much to scary
for me to try changing anything :)

I tried adding xf2pcx, taking asmdef as example, but encountered
problems for the delete and depend targets..

> And xkeymap.c doesn't compile in warnmode (./configure --enable-strictwarn).
> 

Fixed! And i think none of the warnings was in code added by me :)

-- 
Elias Pschernig <elias@xxxxxxxxxx>
Index: makefile.in
===================================================================
RCS file: /cvsroot/alleg/allegro/makefile.in,v
retrieving revision 1.42
diff -u -r1.42 makefile.in
--- makefile.in	7 Feb 2003 18:50:45 -0000	1.42
+++ makefile.in	9 Mar 2003 17:11:12 -0000
@@ -126,7 +126,8 @@
 ALLEGRO_EXE_TARGETS = \
 	$(ALLEGRO_LIB_EXES) \
 	$(ALLEGRO_DATAFILE_EXES) \
-	$(ALLEGRO_EXAMPLE_EXES)
+	$(ALLEGRO_EXAMPLE_EXES) \
+	$(ALLEGRO_MAYBE_LIB_X_EXES)
 
 # Header files (look in makefile.dep for "Headers referred by symbols").
 ALLEGRO_EXTRA_HEADER = $(srcdir)/include/allegro/platform/alunix.h
@@ -528,7 +529,7 @@
 	$(SHELL) -c 'cd $(srcdir) && misc/depmod.sh artsdigi "\`artsc-config --libs\`" $(ALLEGRO_MODULE_ARTS_FILES)' >>makefile.dep
 	$(SHELL) -c 'cd $(srcdir) && misc/depmod.sh sgialdigi -laudio $(ALLEGRO_MODULE_SGIAL_FILES)' >>makefile.dep
 	@echo "Generating dependencies for simple programs"
-	$(SHELL) -c 'cd $(srcdir) && misc/deplexe.sh $(ALLEGRO_LIB_EXE_SOURCES) $(ALLEGRO_EXAMPLE_FILES)' >>makefile.dep
+	$(SHELL) -c 'cd $(srcdir) && misc/deplexe.sh $(ALLEGRO_LIB_EXE_SOURCES) $(ALLEGRO_MAYBE_LIB_X_EXE_SOURCES) $(ALLEGRO_EXAMPLE_FILES)' >>makefile.dep
 	@echo "Generating dependencies for datafile plugins"
 	$(SHELL) -c 'cd $(srcdir) && misc/depdlib.sh tools/datedit.c' >>makefile.dep
 	@echo "Generating dependencies for datafile programs"
Index: configure.in
===================================================================
RCS file: /cvsroot/alleg/allegro/configure.in,v
retrieving revision 1.54
diff -u -r1.54 configure.in
--- configure.in	7 Feb 2003 18:50:45 -0000	1.54
+++ configure.in	9 Mar 2003 17:11:13 -0000
@@ -308,8 +308,12 @@
 ALLEGRO_ACTEST_SUPPORT_XWINDOWS
 if test "$allegro_support_xwindows" = yes; then
   ALLEGRO_MAYBE_XWINDOWS_FILES=ALLEGRO_SRC_X_FILES
+  ALLEGRO_MAYBE_LIB_X_EXE_SOURCES=ALLEGRO_LIB_X_EXE_SOURCES
+  ALLEGRO_MAYBE_LIB_X_EXES=ALLEGRO_LIB_X_EXES
 else
   ALLEGRO_MAYBE_XWINDOWS_FILES=ALLEGRO_EMPTY_LIST
+  ALLEGRO_MAYBE_LIB_X_EXE_SOURCES=ALLEGRO_EMPTY_LIST
+  ALLEGRO_MAYBE_LIB_X_EXES=ALLEGRO_EMPTY_LIST
 fi
 AC_SUBST(ALLEGRO_MAYBE_XWINDOWS_FILES)
 AC_SUBST(ALLEGRO_XWINDOWS_LIBDIR)
Index: makefile.lst
===================================================================
RCS file: /cvsroot/alleg/allegro/makefile.lst,v
retrieving revision 1.77
diff -u -r1.77 makefile.lst
--- makefile.lst	28 Jan 2003 11:08:50 -0000	1.77
+++ makefile.lst	9 Mar 2003 17:11:14 -0000
@@ -395,6 +395,9 @@
 	tools/rgbmap.c \
 	tools/textconv.c
 
+ALLEGRO_LIB_X_EXE_SOURCES = \
+	tools/x11/xkeymap.c
+
 ALLEGRO_LIB_EXES = \
 	demo/demo \
 	setup/keyconf \
@@ -416,6 +419,9 @@
 	tools/pack \
 	tools/rgbmap \
 	tools/textconv
+	
+ALLEGRO_LIB_X_EXES = \
+	tools/x11/xkeymap
 
 ALLEGRO_DATAFILE_EXE_SOURCES = \
 	tools/dat.c \
Index: tools/x11/xkeymap.c
===================================================================
RCS file: /cvsroot/alleg/allegro/tools/x11/xkeymap.c,v
retrieving revision 1.1
diff -u -r1.1 xkeymap.c
--- tools/x11/xkeymap.c	27 Nov 2002 16:40:07 -0000	1.1
+++ tools/x11/xkeymap.c	9 Mar 2003 17:11:14 -0000
@@ -218,15 +218,15 @@
 }
 
 static DIALOG keymap_dialog[] = {
-   /* 0 */{d_clear_proc,    0,   0, 250, 230, 0,   0,   0, 0,      0, 0, 0},
-   /* 1 */{d_ctext_proc,  125,  10,   0,  16, 0, 255,   0, 0,      0, 0, "Select Keycode:"},
-   /* 2 */{d_my_list_proc, 10,  32, 230,  92, 0, 255,   0, D_EXIT, 0, 0, (void *)keycode_getter},
-   /* 3 */{d_ctext_proc,  125, 142,   0,  16, 0, 255,   0, 0,      0, 0, unicode_description},
-   /* 4 */{d_button_proc,  10, 164, 230,  16, 0, 255,   0, D_EXIT, 0, 0, "Define &X Key !"},
-   /* 5 */{d_button_proc,  10, 186, 110,  16, 0, 255,  27, D_EXIT, 0, 0, "&Cancel"},
-   /* 6 */{d_button_proc, 130, 186, 110,  16 , 0, 255,  0, D_EXIT, 0, 0, "&Done"},
-   /* 7 */{d_ctext_proc,  125, 208, 0,  16, 0, 255,   0, 0,      0, 0, ""},
-   /* 8 */{NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+   /* 0 */{d_clear_proc,    0,   0, 250, 230, 0,   0,   0, 0,      0, 0, 0, NULL, NULL},
+   /* 1 */{d_ctext_proc,  125,  10,   0,  16, 0, 255,   0, 0,      0, 0, "Select Keycode:", NULL, NULL},
+   /* 2 */{d_my_list_proc, 10,  32, 230,  92, 0, 255,   0, D_EXIT, 0, 0, (void *)keycode_getter, NULL, NULL},
+   /* 3 */{d_ctext_proc,  125, 142,   0,  16, 0, 255,   0, 0,      0, 0, unicode_description, NULL, NULL},
+   /* 4 */{d_button_proc,  10, 164, 230,  16, 0, 255,   0, D_EXIT, 0, 0, "Define &X Key !", NULL, NULL},
+   /* 5 */{d_button_proc,  10, 186, 110,  16, 0, 255,  27, D_EXIT, 0, 0, "&Cancel", NULL, NULL},
+   /* 6 */{d_button_proc, 130, 186, 110,  16 , 0, 255,  0, D_EXIT, 0, 0, "&Done", NULL, NULL},
+   /* 7 */{d_ctext_proc,  125, 208, 0,    16, 0, 255,   0, 0,      0, 0, "", NULL, NULL},
+   /* 8 */{NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL},
 };
 
 /* handle the setup command */
@@ -387,7 +387,7 @@
 }
 
 /* handle the load command */
-int static load_keyconfig(void)
+static int load_keyconfig(void)
 {
    char buf[FILENAME_LENGTH] = "";
 
@@ -437,14 +437,14 @@
 }
 
 static DIALOG main_dialog[] = {
-   /* 0 */{d_clear_proc,   0,   0, 250, 102, 0,   0,   0, 0,      0, 0, 0},
-   /* 1 */{d_ctext_proc, 120,  10,   0,  16, 0, 255, 'c', 0,      0, 0, current_mapping_string},
-   /* 2 */{d_button_proc, 10,  32, 230,  16, 0, 255,   0, D_EXIT, 0, 0, "&Change Allegro key mappings"},
-   /* 3 */{d_button_proc, 10,  54, 230,  16, 0, 255, 'm', D_EXIT, 0, 0, "Setup X key &mappings"},
-   /* 4 */{d_button_proc, 10,  76, 230,  16, 0, 255, 't', D_EXIT, 0, 0, "&Test X key mappings"},
-   /* 5 */{d_button_proc, 10,  98, 230,  16, 0, 255, 's', D_EXIT, 0, 0, "&Save and exit"},
-   /* 6 */{d_button_proc, 10, 120, 230,  16, 0, 255,  27, D_EXIT, 0, 0, "E&xit"},
-   /* 7 */{NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+   /* 0 */{d_clear_proc,   0,   0, 250, 102, 0,   0,   0, 0,      0, 0, 0, NULL, NULL},
+   /* 1 */{d_ctext_proc, 120,  10,   0,  16, 0, 255, 'c', 0,      0, 0, current_mapping_string, NULL, NULL},
+   /* 2 */{d_button_proc, 10,  32, 230,  16, 0, 255,   0, D_EXIT, 0, 0, "&Change Allegro key mappings", NULL, NULL},
+   /* 3 */{d_button_proc, 10,  54, 230,  16, 0, 255, 'm', D_EXIT, 0, 0, "Setup X key &mappings", NULL, NULL},
+   /* 4 */{d_button_proc, 10,  76, 230,  16, 0, 255, 't', D_EXIT, 0, 0, "&Test X key mappings", NULL, NULL},
+   /* 5 */{d_button_proc, 10,  98, 230,  16, 0, 255, 's', D_EXIT, 0, 0, "&Save and exit", NULL, NULL},
+   /* 6 */{d_button_proc, 10, 120, 230,  16, 0, 255,  27, D_EXIT, 0, 0, "E&xit", NULL, NULL},
+   /* 7 */{NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL},
 };
 
 static void show_main_dialog(void)


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/