From 1335d8f6479994910dbef71e880a5663994e6876 Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Fri, 18 Jun 2010 18:03:32 +0900 Subject: [PATCH] Add --disable-eekboard configure option. --- configure.ac | 11 ++++++++--- src/Makefile.am | 23 ++++++++++++++++++++--- src/eekboard.c | 11 ++++++++++- 3 files changed, 38 insertions(+), 7 deletions(-) diff --git a/configure.ac b/configure.ac index 88bf1577..dbe78d17 100644 --- a/configure.ac +++ b/configure.ac @@ -40,8 +40,14 @@ PKG_CHECK_MODULES([LIBXKLAVIER], [libxklavier x11], , [AC_MSG_ERROR([Libxklavier not found])]) PKG_CHECK_MODULES([LIBFAKEKEY], [libfakekey], , [AC_MSG_ERROR([libfakekey not found])]) -PKG_CHECK_MODULES([ATK], [atk], , - [AC_MSG_ERROR([ATK not found])]) + +AC_MSG_CHECKING([whether you enable eekboard]) +AC_ARG_ENABLE(eekboard, + AS_HELP_STRING([--enable-eekboard=no/yes], + [Build standalone application "ekboard" default=yes]),, + enable_eekboard=yes) +AC_MSG_RESULT($enable_eekboard) +AM_CONDITIONAL(ENABLE_EEKBOARD, [test x$enable_eekboard = xyes]) AC_MSG_CHECKING([whether you enable Clutter]) AC_ARG_ENABLE(clutter, @@ -54,7 +60,6 @@ if test x$enable_clutter = xyes; then PKG_CHECK_MODULES([CLUTTER], [clutter-1.0], , [AC_MSG_ERROR([Clutter not found])]) AC_DEFINE([HAVE_CLUTTER], [1], [Define if Clutter is found]) - enable_clutter_gtk=no PKG_CHECK_MODULES([CLUTTER_GTK], [clutter-gtk-0.90], [enable_clutter_gtk=yes]) if test x$enable_clutter_gtk = xno; then diff --git a/src/Makefile.am b/src/Makefile.am index df04438a..05f5480c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -16,9 +16,25 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 USA +if ENABLE_EEKBOARD bin_PROGRAMS = eekboard -eekboard_CFLAGS = -I$(top_srcdir) $(GOBJECT2_CFLAGS) $(GTK2_CFLAGS) $(XKB_CFLAGS) $(LIBXKLAVIER_CFLAGS) $(LIBFAKEKEY_CFLAGS) $(ATK_CFLAGS) -eekboard_LDFLAGS = $(top_builddir)/eek/libeek.la $(top_builddir)/eek/libeek-xkl.la $(top_builddir)/eek/libeek-gtk.la $(GOBJECT2_LIBS) $(GTK2_CFLAGS) $(XKB_LIBS) $(LIBXKLAVIER_LIBS) $(LIBFAKEKEY_LIBS) $(ATK_LIBS) +eekboard_CFLAGS = \ + -I$(top_srcdir) \ + $(GOBJECT2_CFLAGS) \ + $(GTK2_CFLAGS) \ + $(XKB_CFLAGS) \ + $(LIBXKLAVIER_CFLAGS) \ + $(LIBFAKEKEY_CFLAGS) + +eekboard_LDFLAGS = \ + $(top_builddir)/eek/libeek.la \ + $(top_builddir)/eek/libeek-xkl.la \ + $(top_builddir)/eek/libeek-gtk.la \ + $(GOBJECT2_LIBS) \ + $(GTK2_CFLAGS) \ + $(XKB_LIBS) \ + $(LIBXKLAVIER_LIBS) \ + $(LIBFAKEKEY_LIBS) if HAVE_CLUTTER eekboard_CFLAGS += $(CLUTTER_CFLAGS) @@ -28,4 +44,5 @@ endif if HAVE_CLUTTER_GTK eekboard_CFLAGS += $(CLUTTER_GTK_CFLAGS) eekboard_LDFLAGS += $(top_builddir)/eek/libeek-clutter.la $(CLUTTER_GTK_LIBS) -endif \ No newline at end of file +endif +endif diff --git a/src/eekboard.c b/src/eekboard.c index 92b54c9c..b2b5b9fe 100644 --- a/src/eekboard.c +++ b/src/eekboard.c @@ -29,7 +29,9 @@ #include #include #include +#if 0 #include +#endif #include #include @@ -99,9 +101,11 @@ typedef struct _LayoutCallbackData LayoutCallbackData; static void on_about (GtkAction *action, GtkWidget *window); +#if 0 static void on_monitor_key_event_toggled (GtkToggleAction *action, GtkWidget *window); +#endif static GtkWidget *create_widget (Eekboard *eekboard, gint initial_width, gint initial_height); @@ -144,10 +148,12 @@ static const GtkActionEntry action_entry[] = { {"About", GTK_STOCK_ABOUT, NULL, NULL, NULL, G_CALLBACK (on_about)} }; +#if 0 static const GtkToggleActionEntry toggle_action_entry[] = { {"MonitorKeyEvent", NULL, N_("Monitor Key Typing"), NULL, NULL, G_CALLBACK(on_monitor_key_event_toggled), FALSE} }; +#endif static void on_about (GtkAction * action, GtkWidget *window) @@ -170,10 +176,10 @@ on_about (GtkAction * action, GtkWidget *window) "wrap-license", TRUE, NULL); } +#if 0 static gint key_snoop (AtkKeyEventStruct *event, gpointer func_data) { - g_debug ("key_snoop"); return FALSE; } @@ -195,6 +201,7 @@ on_monitor_key_event_toggled (GtkToggleAction *action, eekboard->key_event_listener = 0; } } +#endif static void on_key_pressed (EekKeyboard *keyboard, @@ -385,9 +392,11 @@ create_menus (Eekboard *eekboard, gtk_action_group_add_actions (action_group, action_entry, G_N_ELEMENTS (action_entry), window); +#if 0 gtk_action_group_add_toggle_actions (action_group, toggle_action_entry, G_N_ELEMENTS (toggle_action_entry), window); +#endif gtk_ui_manager_insert_action_group (ui_manager, action_group, 0); gtk_ui_manager_add_ui_from_string (ui_manager, ui_description, -1, NULL);