[packages/scim-anthy] - added no-rpath,gtk3 patches from Debian; now it builds with gtk+3-based scim 1.4.x
qboosh
qboosh at pld-linux.org
Wed Sep 12 19:47:47 CEST 2012
commit dd638296b617243f7bff9e8f741fc02ed6f21edf
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Wed Sep 12 19:48:24 2012 +0200
- added no-rpath,gtk3 patches from Debian; now it builds with gtk+3-based scim 1.4.x
scim-anthy-gtk3.patch | 2260 +++++++++++++++++++++++++++++++++++++++++++++
scim-anthy-no-rpath.patch | 28 +
scim-anthy.spec | 33 +-
3 files changed, 2315 insertions(+), 6 deletions(-)
---
diff --git a/scim-anthy.spec b/scim-anthy.spec
index e91168e..7dacd0e 100644
--- a/scim-anthy.spec
+++ b/scim-anthy.spec
@@ -1,4 +1,5 @@
Summary: SCIM IMEngine for anthy for Japanese input
+Summary(pl.UTF-8): Silnik IM SCIM dla metody wprowadzania znaków japońskich Anthy
Name: scim-anthy
Version: 1.2.7
Release: 1
@@ -6,11 +7,18 @@ License: GPL v2+
Group: Libraries
Source0: http://osdn.dl.sourceforge.jp/scim-imengine/37309/%{name}-%{version}.tar.gz
# Source0-md5: 8d06bfd46839c771401b9f176be8818f
+Patch0: %{name}-no-rpath.patch
+Patch1: %{name}-gtk3.patch
URL: http://scim-imengine.sourceforge.jp/
BuildRequires: anthy-devel >= 6700b-1
-BuildRequires: gtk+2-devel
-BuildRequires: scim-devel
-Requires: scim
+BuildRequires: autoconf >= 2.59
+BuildRequires: automake >= 1:1.9
+BuildRequires: gettext-devel
+BuildRequires: libstdc++-devel
+BuildRequires: libtool
+BuildRequires: pkgconfig
+BuildRequires: scim-devel >= 1.2.0
+Requires: scim >= 1.2.0
Requires: kasumi
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -18,11 +26,24 @@ BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
Scim-anthy is a SCIM IMEngine module for anthy to support Japanese
input.
+%description -l pl.UTF-8
+Scim-anthy to moduł silnika IM SCIM umożliwiający wprowadzanie znaków
+japońskich poprzez system Anthy.
+
%prep
%setup -q
+%patch0 -p1
+%patch1 -p1
%build
-%configure
+%{__gettextize}
+%{__libtoolize}
+%{__aclocal} -I m4
+%{__autoconf}
+%{__autoheader}
+%{__automake}
+%configure \
+ --disable-static
%{__make}
@@ -32,7 +53,7 @@ rm -rf $RPM_BUILD_ROOT
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT
-%{__rm} $RPM_BUILD_ROOT%{_libdir}/scim-1.0/*/*/*.{la,a}
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/scim-1.0/*/*/*.la
%find_lang %{name}
@@ -46,4 +67,4 @@ rm -rf $RPM_BUILD_ROOT
%attr(755,root,root) %{_libdir}/scim-1.0/*/IMEngine/anthy.so
%attr(755,root,root) %{_libdir}/scim-1.0/*/SetupUI/anthy-imengine-setup.so
%{_datadir}/scim/Anthy
-%{_datadir}/scim/icons/*.png
+%{_datadir}/scim/icons/scim-anthy*.png
diff --git a/scim-anthy-gtk3.patch b/scim-anthy-gtk3.patch
new file mode 100644
index 0000000..9718c48
--- /dev/null
+++ b/scim-anthy-gtk3.patch
@@ -0,0 +1,2260 @@
+diff --git a/configure.ac b/configure.ac
+index 5f5ba1d..082818f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -60,14 +60,18 @@ PKG_CHECK_MODULES(SCIM_GTKUTILS,[scim-gtkutils >= $SCIM_VERSION],
+ AC_SUBST(SCIM_VERSION)
+
+ AM_CONDITIONAL(SCIM_BUILD_SETUP, [test "$SCIM_HAS_GTKUTILS" = "yes"])
++AM_CONDITIONAL(SCIM_BUILD_HELPER, [test "$SCIM_HAS_GTKUTILS" = "yes"])
+
+ if test "$SCIM_HAS_GTKUTILS" = "yes"; then
+ SCIM_BUILD_SETUP=1
++ SCIM_BUILD_HELPER=1
+ else
+ SCIM_BUILD_SETUP=0
++ SCIM_BUILD_HELPER=0
+ fi
+
+ AC_SUBST(SCIM_BUILD_SETUP)
++AC_SUBST(SCIM_BUILD_HELPER)
+
+ # Checks for header files.
+ AC_HEADER_STDC
+@@ -84,21 +88,6 @@ ANTHY_CFLAGS=""
+ AC_SUBST(ANTHY_LIBS)
+ AC_SUBST(ANTHY_CFLAGS)
+
+-# Check gtk2
+-PKG_CHECK_MODULES(GTK2, [gtk+-2.0 >= 2.4.0],
+- [HAS_GTK=yes],
+- [HAS_GTK=no])
+-
+-AM_CONDITIONAL(SCIM_BUILD_HELPER, [test "$HAS_GTK" = "yes"])
+-
+-if test "$HAS_GTK" = "yes"; then
+- SCIM_BUILD_HELPER=1
+-else
+- SCIM_BUILD_HELPER=0
+-fi
+-
+-AC_SUBST(SCIM_BUILD_HELPER)
+-
+ # libtool option to control which symbols are exported
+ # right now, symbols starting with _ are not exported
+ LIBTOOL_EXPORT_OPTIONS='-export-symbols-regex "^[[^_]].*"'
+diff --git a/src/Makefile.am b/src/Makefile.am
+index aac7849..3f48b3b 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -127,15 +127,15 @@ helpermoduledir = @SCIM_MODULEDIR@/Helper
+ helpermodule_LTLIBRARIES = $(HELPER_MODULE)
+
+ anthy_imengine_helper_la_SOURCES = scim_anthy_helper.cpp
+-anthy_imengine_helper_la_CFLAGS = @GTK2_CFLAGS@ \
++anthy_imengine_helper_la_CFLAGS = @SCIM_GTKUTILS_CFLAGS@ \
+ @SCIM_CFLAGS@ \
+ @SCIM_DEBUG_FLAGS@
+-anthy_imengine_helper_la_CXXFLAGS = @GTK2_CFLAGS@ \
++anthy_imengine_helper_la_CXXFLAGS = @SCIM_GTKUTILS_CFLAGS@ \
+ @SCIM_CFLAGS@ \
+ @SCIM_DEBUG_FLAGS@
+ anthy_imengine_helper_la_LDFLAGS = -avoid-version \
+ -module \
+ @LIBTOOL_EXPORT_OPTIONS@ \
+- @GTK2_LIBS@ \
++ @SCIM_GTKUTILS_LIBS@ \
+ @INTLLIBS@ \
+ @SCIM_LIBS@
+diff --git a/src/scim_anthy_color_button.cpp b/src/scim_anthy_color_button.cpp
+index 841c9aa..7606523 100644
+--- a/src/scim_anthy_color_button.cpp
++++ b/src/scim_anthy_color_button.cpp
+@@ -58,9 +58,14 @@ typedef enum
+ static void scim_anthy_color_button_class_init (ScimAnthyColorButtonClass *klass);
+ static void scim_anthy_color_button_init (ScimAnthyColorButton *object);
+
++#if GTK_CHECK_VERSION(3, 0, 0)
++static void scim_anthy_color_button_destroy (GtkWidget *object);
++static gboolean scim_anthy_color_button_draw (GtkWidget *widget, cairo_t *cr);
++#else
+ static void scim_anthy_color_button_destroy (GtkObject *object);
+ static gboolean scim_anthy_color_button_expose (GtkWidget *widget,
+ GdkEventExpose *eevent);
++#endif
+ static gboolean scim_anthy_color_button_button_press (GtkWidget *widget,
+ GdkEventButton *bevent);
+ static gboolean scim_anthy_color_button_button_release (GtkWidget *widget,
+@@ -100,7 +105,6 @@ scim_anthy_color_button_get_type (void)
+ static void
+ scim_anthy_color_button_class_init (ScimAnthyColorButtonClass *klass)
+ {
+- GtkObjectClass *gtk_object_class = GTK_OBJECT_CLASS (klass);
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+
+ parent_class = (GtkDrawingAreaClass *) g_type_class_peek_parent (klass);
+@@ -114,9 +118,15 @@ scim_anthy_color_button_class_init (ScimAnthyColorButtonClass *klass)
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
++#if GTK_CHECK_VERSION(3, 0, 0)
++ widget_class->destroy = scim_anthy_color_button_destroy;
++ widget_class->draw = scim_anthy_color_button_draw;
++#else
++ GtkObjectClass *gtk_object_class = GTK_OBJECT_CLASS (klass);
+ gtk_object_class->destroy = scim_anthy_color_button_destroy;
+-
+ widget_class->expose_event = scim_anthy_color_button_expose;
++#endif
++
+ widget_class->button_press_event = scim_anthy_color_button_button_press;
+ widget_class->button_release_event = scim_anthy_color_button_button_release;
+ }
+@@ -125,8 +135,13 @@ static void
+ scim_anthy_color_button_init (ScimAnthyColorButton *object)
+ {
+ /*set default color */
++#if GTK_CHECK_VERSION(3, 0, 0)
++ gdk_rgba_parse (&object->fg_color, "#000000");
++ gdk_rgba_parse (&object->bg_color, "#ffffff");
++#else
+ gdk_color_parse ("#000000", &object->fg_color);
+ gdk_color_parse ("#ffffff", &object->bg_color);
++#endif
+
+ gtk_widget_add_events (GTK_WIDGET (object),
+ GDK_BUTTON_PRESS_MASK |
+@@ -135,7 +150,11 @@ scim_anthy_color_button_init (ScimAnthyColorButton *object)
+
+
+ static void
++#if GTK_CHECK_VERSION(3, 0, 0)
++scim_anthy_color_button_destroy (GtkWidget *object)
++#else
+ scim_anthy_color_button_destroy (GtkObject *object)
++#endif
+ {
+ ScimAnthyColorButton *button = SCIM_ANTHY_COLOR_BUTTON (object);
+
+@@ -150,19 +169,38 @@ scim_anthy_color_button_destroy (GtkObject *object)
+ button->swap_icon = NULL;
+ }
+
++#if GTK_CHECK_VERSION(3, 0, 0)
++ GTK_WIDGET_CLASS (parent_class)->destroy (object);
++#else
+ GTK_OBJECT_CLASS (parent_class)->destroy (object);
++#endif
+ }
+
+ static void
+ scim_anthy_color_button_draw_rect (ScimAnthyColorButton *button,
++#if GTK_CHECK_VERSION(3, 0, 0)
++ GdkWindow *drawable,
++ cairo_t *cr,
++#else
+ GdkDrawable *drawable,
+ GdkGC *gc,
++#endif
+ gint x,
+ gint y,
+ gint width,
+ gint height,
+- GdkColor *color)
++#if GTK_CHECK_VERSION(3, 0, 0)
++ GdkRGBA *color
++#else
++ GdkColor *color
++#endif
++ )
+ {
++#if GTK_CHECK_VERSION(3, 0, 0)
++ gdk_cairo_set_source_rgba (cr, color);
++ cairo_rectangle (cr, x, y, width, height);
++ cairo_fill (cr);
++#else
+ gint rowstride;
+ guchar r, g, b;
+ gint xx, yy;
+@@ -201,23 +239,38 @@ scim_anthy_color_button_draw_rect (ScimAnthyColorButton *button,
+ GDK_RGB_DITHER_MAX,
+ button->render_buf,
+ rowstride);
++#endif
+ }
+
+ static gboolean
++#if GTK_CHECK_VERSION(3, 0, 0)
++scim_anthy_color_button_draw (GtkWidget *widget,
++ cairo_t *cr)
++#else
+ scim_anthy_color_button_expose (GtkWidget *widget,
+ GdkEventExpose *eevent)
++#endif
+ {
+ ScimAnthyColorButton *button = SCIM_ANTHY_COLOR_BUTTON (widget);
+ gint width, height;
+ gint swap_w = 0, swap_h = 0;
+ gint rect_w, rect_h;
+
++#if GTK_CHECK_VERSION(2, 18, 0)
++ if (!gtk_widget_is_drawable (widget))
++#else
+ if (!GTK_WIDGET_DRAWABLE (widget))
++#endif
+ return FALSE;
+-
++
++#if GTK_CHECK_VERSION(3, 0, 0)
++ width = gdk_window_get_width(gtk_widget_get_window (widget));
++ height = gdk_window_get_height(gtk_widget_get_window (widget));
++#else
+ width = widget->allocation.width;
+ height = widget->allocation.height;
+-
++#endif
++
+ /* draw the swap colors pixbuf */
+ if (!button->swap_icon) {
+ button->swap_icon
+@@ -231,9 +284,14 @@ scim_anthy_color_button_expose (GtkWidget *widget,
+ }
+
+ if (swap_w < width / 2 && swap_h < height / 2) {
++#if GTK_CHECK_VERSION(3, 0, 0)
++ gdk_cairo_set_source_pixbuf (cr, button->swap_icon, width - swap_w, 0);
++ cairo_paint (cr);
++#else
+ gdk_draw_pixbuf (widget->window, NULL, button->swap_icon,
+ 0, 0, width - swap_w, 0, swap_w, swap_h,
+ GDK_RGB_DITHER_NORMAL, 0, 0);
++#endif
+ } else {
+ swap_w = swap_h = 0;
+ }
+@@ -249,37 +307,78 @@ scim_anthy_color_button_expose (GtkWidget *widget,
+ button->rect_width = rect_w;
+ button->rect_height = rect_h;
+
+-
+ /* draw the background area */
+ scim_anthy_color_button_draw_rect (button,
++#if GTK_CHECK_VERSION(2, 14, 0)
++ gtk_widget_get_window (widget),
++#else
+ widget->window,
++#endif
++#if GTK_CHECK_VERSION(3, 0, 0)
++ cr,
++#else
+ widget->style->fg_gc[0],
++#endif
+ (width - rect_w),
+ (height - rect_h),
+ rect_w, rect_h,
+ &button->bg_color);
+
+- gtk_paint_shadow (widget->style, widget->window, GTK_STATE_NORMAL,
++#if GTK_CHECK_VERSION(3, 0, 0)
++ GtkStyleContext *style = gtk_widget_get_style_context(widget);
++ gtk_style_context_save (style);
++ gtk_style_context_set_state (style, GTK_STATE_FLAG_NORMAL);
++ gtk_render_frame (style, cr, width - rect_w, height - rect_h, rect_w, rect_h);
++#else
++ gtk_paint_shadow (widget->style,
++#if GTK_CHECK_VERSION(2, 14, 0)
++ gtk_widget_get_window (widget),
++#else
++ widget->window,
++#endif
++ GTK_STATE_NORMAL,
+ GTK_SHADOW_IN,
+ NULL, widget, NULL,
+ (width - rect_w),
+ (height - rect_h),
+ rect_w, rect_h);
+-
++#endif
+
+ /* draw the foreground area */
+ scim_anthy_color_button_draw_rect (button,
++#if GTK_CHECK_VERSION(2, 14, 0)
++ gtk_widget_get_window (widget),
++#else
+ widget->window,
++#endif
++#if GTK_CHECK_VERSION(3, 0, 0)
++ cr,
++#else
+ widget->style->fg_gc[0],
++#endif
+ 0, 0,
+ rect_w, rect_h,
+ &button->fg_color);
+
+- gtk_paint_shadow (widget->style, widget->window, GTK_STATE_NORMAL,
+- GTK_SHADOW_IN,
+- NULL, widget, NULL,
+- 0, 0,
+- rect_w, rect_h);
++#if GTK_CHECK_VERSION(3, 0, 0)
++ style = gtk_widget_get_style_context(widget);
++ gtk_style_context_save (style);
++ gtk_style_context_set_state (style, GTK_STATE_FLAG_NORMAL);
++ gtk_render_frame (style, cr, 0, 0, rect_w, rect_h);
++#else
++ gtk_paint_shadow (
++ widget->style,
++#if GTK_CHECK_VERSION(2, 14, 0)
++ gtk_widget_get_window (widget),
++#else
++ widget->window,
++#endif
++ GTK_STATE_NORMAL,
++ GTK_SHADOW_IN,
++ NULL, widget, NULL,
++ 0, 0,
++ rect_w, rect_h);
++#endif
+
+ return TRUE;
+ }
+@@ -289,11 +388,16 @@ scim_anthy_color_button_target (ScimAnthyColorButton *button,
+ gint x,
+ gint y)
+ {
++#if GTK_CHECK_VERSION(3, 0, 0)
++ gint width = gdk_window_get_width(gtk_widget_get_window (GTK_WIDGET(button)));
++ gint height = gdk_window_get_height(gtk_widget_get_window (GTK_WIDGET(button)));
++#else
+ gint width = GTK_WIDGET (button)->allocation.width;
+ gint height = GTK_WIDGET (button)->allocation.height;
++#endif
+ gint rect_w = button->rect_width;
+ gint rect_h = button->rect_height;
+-
++
+ if (x > 0 && x < rect_w && y > 0 && y < rect_h)
+ return FOREGROUND_AREA;
+ else if (x > (width - rect_w) && x < width &&
+@@ -314,7 +418,11 @@ scim_anthy_color_button_open_color_dialog (ScimAnthyColorButton *button, gboolea
+ {
+ GtkWidget *dialog;
+ const gchar *title;
++#if GTK_CHECK_VERSION(3, 0, 0)
++ GdkRGBA *color;
++#else
+ GdkColor *color;
++#endif
+ gint result;
+
+ title = fg ? _("Foreground color") : _("Background color");
+@@ -322,16 +430,38 @@ scim_anthy_color_button_open_color_dialog (ScimAnthyColorButton *button, gboolea
+
+ dialog = gtk_color_selection_dialog_new (title);
+
+- gtk_color_selection_set_current_color (GTK_COLOR_SELECTION (GTK_COLOR_SELECTION_DIALOG (dialog)->colorsel),
+- color);
++#if GTK_CHECK_VERSION(3, 0, 0)
++ gtk_color_selection_set_current_rgba (
++ GTK_COLOR_SELECTION (gtk_color_selection_dialog_get_color_selection (GTK_COLOR_SELECTION_DIALOG (dialog))),
++ color);
++#else
++ gtk_color_selection_set_current_color (
++#if GTK_CHECK_VERSION(2, 14, 0)
++ GTK_COLOR_SELECTION (gtk_color_selection_dialog_get_color_selection (GTK_COLOR_SELECTION_DIALOG (dialog))),
++#else
++ GTK_COLOR_SELECTION (GTK_COLOR_SELECTION_DIALOG (dialog)->colorsel),
++#endif
++ color);
++#endif
+ gtk_widget_show (dialog);
+
+ result = gtk_dialog_run (GTK_DIALOG (dialog));
+
+ switch (result) {
+ case GTK_RESPONSE_OK:
+- gtk_color_selection_get_current_color (GTK_COLOR_SELECTION (GTK_COLOR_SELECTION_DIALOG (dialog)->colorsel),
+- color);
++#if GTK_CHECK_VERSION(3, 0, 0)
++ gtk_color_selection_get_current_rgba (
++ GTK_COLOR_SELECTION (gtk_color_selection_dialog_get_color_selection (GTK_COLOR_SELECTION_DIALOG (dialog))),
++ color);
++#else
++ gtk_color_selection_get_current_color (
++#if GTK_CHECK_VERSION(2, 14, 0)
++ GTK_COLOR_SELECTION (gtk_color_selection_dialog_get_color_selection (GTK_COLOR_SELECTION_DIALOG (dialog))),
++#else
++ GTK_COLOR_SELECTION (GTK_COLOR_SELECTION_DIALOG (dialog)->colorsel),
++#endif
++ color);
++#endif
+ g_signal_emit (button, button_signals[COLOR_CHANGED], 0);
+ break;
+ default:
+@@ -345,6 +475,11 @@ scim_anthy_color_button_open_color_dialog (ScimAnthyColorButton *button, gboolea
+ static void
+ scim_anthy_color_button_swap_color (ScimAnthyColorButton *button)
+ {
++#if GTK_CHECK_VERSION(3, 0, 0)
++ GdkRGBA tmp = button->fg_color;
++ button->fg_color = button->bg_color;
++ button->bg_color = tmp;
++#else
+ GdkColor tmp;
+ tmp.red = button->fg_color.red;
+ tmp.green = button->fg_color.green;
+@@ -357,6 +492,7 @@ scim_anthy_color_button_swap_color (ScimAnthyColorButton *button)
+ button->bg_color.red = tmp.red;
+ button->bg_color.green = tmp.green;
+ button->bg_color.blue = tmp.blue;
++#endif
+ g_signal_emit (button, button_signals[COLOR_CHANGED], 0);
+ }
+
+@@ -447,14 +583,29 @@ scim_anthy_color_button_get_colors (ScimAnthyColorButton *button,
+
+ g_snprintf (fg_color_str, G_N_ELEMENTS (fg_color_str),
+ "#%02X%02X%02X",
++#if GTK_CHECK_VERSION(3, 0, 0)
++ static_cast<unsigned int>(255*button->fg_color.red),
++ static_cast<unsigned int>(255*button->fg_color.green),
++ static_cast<unsigned int>(255*button->fg_color.blue)
++#else
+ ((button->fg_color.red)>>8),
+ ((button->fg_color.green)>>8),
+- ((button->fg_color.blue)>>8));
++ ((button->fg_color.blue)>>8)
++#endif
++ );
+ g_snprintf (bg_color_str, G_N_ELEMENTS (bg_color_str),
+ "#%02X%02X%02X",
++#if GTK_CHECK_VERSION(3, 0, 0)
++ static_cast<unsigned int>(255*button->bg_color.red),
++ static_cast<unsigned int>(255*button->bg_color.green),
++ static_cast<unsigned int>(255*button->bg_color.blue)
++#else
+ ((button->bg_color.red)>>8),
+ ((button->bg_color.green)>>8),
+- ((button->bg_color.blue)>>8));
++ ((button->bg_color.blue)>>8)
++#endif
++ );
++
+ *fg_value = String (fg_color_str);
+ *bg_value = String (bg_color_str);
+
+@@ -466,6 +617,10 @@ scim_anthy_color_button_set_colors (ScimAnthyColorButton *button,
+ const String &fg_value,
+ const String &bg_value)
+ {
++#if GTK_CHECK_VERSION(3, 0, 0)
++ gdk_rgba_parse (&button->fg_color, fg_value.c_str());
++ gdk_rgba_parse (&button->bg_color, bg_value.c_str());
++#else
+ GdkColor fg_color, bg_color;
+ gdk_color_parse (fg_value.c_str (), &fg_color);
+ gdk_color_parse (bg_value.c_str (), &bg_color);
+@@ -476,6 +631,7 @@ scim_anthy_color_button_set_colors (ScimAnthyColorButton *button,
+ button->bg_color.red = bg_color.red;
+ button->bg_color.green = bg_color.green;
+ button->bg_color.blue = bg_color.blue;
++#endif
+
+ return TRUE;
+ }
+diff --git a/src/scim_anthy_color_button.h b/src/scim_anthy_color_button.h
+index f55083a..8d96ae7 100644
+--- a/src/scim_anthy_color_button.h
++++ b/src/scim_anthy_color_button.h
+@@ -53,8 +53,13 @@ struct _ScimAnthyColorButton
+ gint rect_height;
+ gint click_target;
+
++#if GTK_CHECK_VERSION(3, 0, 0)
++ GdkRGBA fg_color;
++ GdkRGBA bg_color;
++#else
+ GdkColor fg_color;
+- GdkColor bg_color;
++ GdkColor bg_color;
++#endif
+ };
+
+ struct _ScimAnthyColorButtonClass
+diff --git a/src/scim_anthy_helper.cpp b/src/scim_anthy_helper.cpp
+index a0c0d30..5925d70 100644
+--- a/src/scim_anthy_helper.cpp
++++ b/src/scim_anthy_helper.cpp
+@@ -175,9 +175,9 @@ slot_imengine_event (const HelperAgent *agent, int ic,
+ if (!reader.get_data (id) || !reader.get_data (time_msec))
+ break;
+ TimeoutContext *ctx = new TimeoutContext (ic, uuid, id);
+- guint timeout_id = gtk_timeout_add_full (time_msec,
++ guint timeout_id = g_timeout_add_full (G_PRIORITY_DEFAULT,
++ time_msec,
+ timeout_func,
+- NULL,
+ (gpointer) ctx,
+ timeout_ctx_destroy_func);
+ timeout_ids[ic][id] = timeout_id;
+@@ -191,7 +191,7 @@ slot_imengine_event (const HelperAgent *agent, int ic,
+ timeout_ids[ic].find (id) != timeout_ids[ic].end ())
+ {
+ guint tid = timeout_ids[ic][id];
+- gtk_timeout_remove (tid);
++ g_source_remove (tid);
+ }
+ break;
+ }
+@@ -234,8 +234,8 @@ run (const String &display, const ConfigPointer &config)
+ char **argv = new char * [4];
+ int argc = 3;
+
+- argv [0] = "anthy-imengine-helper";
+- argv [1] = "--display";
++ argv [0] = const_cast<char*> ("anthy-imengine-helper");
++ argv [1] = const_cast<char*> ("--display");
+ argv [2] = const_cast<char *> (display.c_str ());
+ argv [3] = 0;
+
+diff --git a/src/scim_anthy_prefs.cpp b/src/scim_anthy_prefs.cpp
+index 7d58ef1..596f990 100644
+--- a/src/scim_anthy_prefs.cpp
++++ b/src/scim_anthy_prefs.cpp
+@@ -95,6 +95,7 @@ BoolConfigData config_bool_common [] =
+ N_("A_llow spliting romaji on editing preedit string"),
+ NULL,
+ N_("If this check is enabled, you can delete each letter."),
++ NULL,
+ false,
+ },
+ {
+@@ -104,6 +105,7 @@ BoolConfigData config_bool_common [] =
+ N_("_Entering the pseudo ASCII input mode with capital letters."),
+ NULL,
+ N_("If this check is enabled, capital letters will becomes a trigger to enter the pseudo ASCII input mode."),
++ NULL,
+ false,
+ },
+ {
+@@ -113,6 +115,7 @@ BoolConfigData config_bool_common [] =
+ N_("Insert a _blank with a blank key."),
+ NULL,
+ N_("If this check is enabled, a blank key will works to insert a blank when entering the pseudo ASCII input mode."),
++ NULL,
+ false,
+ },
+ {
+@@ -122,6 +125,7 @@ BoolConfigData config_bool_common [] =
+ N_("_Show predicted candidates while inputting letters"),
+ NULL,
+ NULL,
++ NULL,
+ false,
+ },
+ {
+@@ -131,6 +135,7 @@ BoolConfigData config_bool_common [] =
+ N_("Use _direct select keys while predicting"),
+ NULL,
+ NULL,
++ NULL,
+ false,
+ },
+ {
+@@ -215,8 +220,8 @@ BoolConfigData config_bool_common [] =
+ },
+ {
+ NULL,
+- "",
+- "",
++ false,
++ false,
+ NULL,
+ NULL,
+ NULL,
+@@ -273,6 +278,7 @@ IntConfigData config_int_common [] =
+ NULL,
+ NULL,
+ NULL,
++ NULL,
+ false,
+ },
+ };
+diff --git a/src/scim_anthy_setup.cpp b/src/scim_anthy_setup.cpp
+index 942e852..2ee5358 100644
+--- a/src/scim_anthy_setup.cpp
++++ b/src/scim_anthy_setup.cpp
+@@ -174,7 +174,10 @@ static GtkWidget * __widget_key_filter_button = NULL;
+ static GtkWidget * __widget_key_theme_menu = NULL;
+ static GtkWidget * __widget_key_list_view = NULL;
+ static GtkWidget * __widget_choose_keys_button = NULL;
++#if GTK_CHECK_VERSION(3, 0, 0)
++#else
+ static GtkTooltips * __widget_tooltips = NULL;
++#endif
+
+ static String __config_key_theme = SCIM_ANTHY_CONFIG_KEY_THEME_DEFAULT;
+ static String __config_key_theme_file = SCIM_ANTHY_CONFIG_KEY_THEME_FILE_DEFAULT;
+@@ -295,7 +298,7 @@ static ComboConfigCandidate preedit_style[] =
+ };
+
+
+-static void setup_key_theme_menu (GtkOptionMenu *omenu);
++static void setup_key_theme_menu (GtkWidget *omenu);
+ static void setup_widget_value (void);
+
+ static void on_default_editable_changed (GtkEditable *editable,
+@@ -308,15 +311,15 @@ static void on_default_key_selection_clicked (GtkButton *button,
+ gpointer user_data);
+ static void on_default_combo_changed (GtkEditable *editable,
+ gpointer user_data);
+-static void on_default_option_menu_changed (GtkOptionMenu *omenu,
++static void on_default_option_menu_changed (GtkWidget *omenu,
+ gpointer user_data);
+-static void on_preedit_style_menu_changed (GtkOptionMenu *omenu,
++static void on_preedit_style_menu_changed (GtkWidget *omenu,
+ gpointer user_data);
+ static void on_key_filter_selection_clicked (GtkButton *button,
+ gpointer user_data);
+ static void on_dict_menu_label_toggled (GtkToggleButton *togglebutton,
+ gpointer user_data);
+-static void on_key_category_menu_changed (GtkOptionMenu *omenu,
++static void on_key_category_menu_changed (GtkWidget *omenu,
+ gpointer user_data);
+ static gboolean on_key_list_view_key_press (GtkWidget *widget,
+ GdkEventKey *event,
+@@ -324,7 +327,7 @@ static gboolean on_key_list_view_key_press (GtkWidget *widget,
+ static gboolean on_key_list_view_button_press (GtkWidget *widget,
+ GdkEventButton *event,
+ gpointer user_data);
+-static void on_key_theme_menu_changed (GtkOptionMenu *omenu,
++static void on_key_theme_menu_changed (GtkWidget *omenu,
+ gpointer user_data);
+ static void on_key_list_selection_changed (GtkTreeSelection *selection,
+ gpointer data);
+@@ -364,11 +367,19 @@ create_check_button (const char *config_key)
+ entry);
+ gtk_widget_show (GTK_WIDGET (entry->widget));
+
++#if GTK_CHECK_VERSION(3, 0, 0)
++#else
+ if (!__widget_tooltips)
+ __widget_tooltips = gtk_tooltips_new();
++#endif
+ if (entry->tooltip)
++#if GTK_CHECK_VERSION(3, 0, 0)
++ gtk_widget_set_tooltip_text (GTK_WIDGET (entry->widget),
++ _(entry->tooltip));
++#else
+ gtk_tooltips_set_tip (__widget_tooltips, GTK_WIDGET (entry->widget),
+ _(entry->tooltip), NULL);
++#endif
+
+ return GTK_WIDGET (entry->widget);
+ }
+@@ -389,7 +400,11 @@ create_spin_button (const char *config_key, GtkTable *table, int idx)
+ 4, 4);
+ gtk_widget_show (GTK_WIDGET (label));
+
++#if GTK_CHECK_VERSION(3, 0, 0)
++ GtkWidget *hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
++#else
+ GtkWidget *hbox = gtk_hbox_new (FALSE, 0);
++#endif
+ gtk_table_attach (GTK_TABLE (table), GTK_WIDGET (hbox),
+ 1, 2, idx, idx + 1,
+ (GtkAttachOptions) GTK_FILL,
+@@ -417,11 +432,18 @@ create_spin_button (const char *config_key, GtkTable *table, int idx)
+ gtk_widget_show (GTK_WIDGET (label));
+ }
+
++#if GTK_CHECK_VERSION(3, 0, 0)
++#else
+ if (!__widget_tooltips)
+ __widget_tooltips = gtk_tooltips_new();
++#endif
+ if (entry->tooltip)
++#if GTK_CHECK_VERSION(3, 0, 0)
++ gtk_widget_set_tooltip_text (GTK_WIDGET (entry->widget), _(entry->tooltip));
++#else
+ gtk_tooltips_set_tip (__widget_tooltips, GTK_WIDGET (entry->widget),
+ _(entry->tooltip), NULL);
++#endif
+
+ return GTK_WIDGET (entry->widget);
+ }
+@@ -453,11 +475,18 @@ create_entry (const char *config_key, GtkTable *table, int idx)
+ (GtkAttachOptions) (GTK_FILL|GTK_EXPAND),
+ (GtkAttachOptions) (GTK_FILL), 4, 4);
+
++#if GTK_CHECK_VERSION(3, 0, 0)
++#else
+ if (!__widget_tooltips)
+ __widget_tooltips = gtk_tooltips_new();
++#endif
+ if (entry->tooltip)
++#if GTK_CHECK_VERSION(3, 0, 0)
++ gtk_widget_set_tooltip_text (GTK_WIDGET (entry->widget), _(entry->tooltip));
++#else
+ gtk_tooltips_set_tip (__widget_tooltips, GTK_WIDGET (entry->widget),
+ _(entry->tooltip), NULL);
++#endif
+
+ return GTK_WIDGET (entry->widget);
+ }
+@@ -480,12 +509,31 @@ create_combo (const char *config_key, gpointer candidates_p,
+ (GtkAttachOptions) (GTK_FILL), 4, 4);
+ gtk_widget_show (label);
+
++#if GTK_CHECK_VERSION(2, 24, 0)
++ entry->widget = gtk_combo_box_text_new_with_entry ();
++ GtkWidget *combo_box_entry = gtk_bin_get_child (GTK_BIN (entry->widget));
++ gtk_label_set_mnemonic_widget (GTK_LABEL (label), combo_box_entry);
++ gtk_editable_set_editable (GTK_EDITABLE (combo_box_entry), FALSE);
++
++ gtk_widget_show (GTK_WIDGET (entry->widget));
++ gtk_table_attach (GTK_TABLE (table), GTK_WIDGET (entry->widget),
++ 1, 2, idx, idx + 1,
++ (GtkAttachOptions) (GTK_FILL|GTK_EXPAND),
++ (GtkAttachOptions) (GTK_FILL), 4, 4);
++ g_object_set_data (G_OBJECT (combo_box_entry),
++ DATA_POINTER_KEY,
++ (gpointer) candidates_p);
++
++ g_signal_connect (G_OBJECT (combo_box_entry), "changed",
++ G_CALLBACK (on_default_combo_changed),
++ entry);
++#else
+ entry->widget = gtk_combo_new ();
+ gtk_label_set_mnemonic_widget (GTK_LABEL (label),
+ GTK_COMBO (entry->widget)->entry);
+ gtk_combo_set_value_in_list (GTK_COMBO (entry->widget), TRUE, FALSE);
+ gtk_combo_set_case_sensitive (GTK_COMBO (entry->widget), TRUE);
+- gtk_entry_set_editable (GTK_ENTRY (GTK_COMBO (entry->widget)->entry),
++ gtk_editable_set_editable (GTK_EDITABLE (GTK_COMBO (entry->widget)->entry),
+ FALSE);
+ gtk_widget_show (GTK_WIDGET (entry->widget));
+ gtk_table_attach (GTK_TABLE (table), GTK_WIDGET (entry->widget),
+@@ -499,13 +547,22 @@ create_combo (const char *config_key, gpointer candidates_p,
+ g_signal_connect ((gpointer) GTK_COMBO (entry->widget)->entry, "changed",
+ G_CALLBACK (on_default_combo_changed),
+ entry);
++#endif
+
++#if GTK_CHECK_VERSION(3, 0, 0)
++#else
+ if (!__widget_tooltips)
+ __widget_tooltips = gtk_tooltips_new();
++#endif
+ if (entry->tooltip)
++#if GTK_CHECK_VERSION(3, 0, 0)
++ gtk_widget_set_tooltip_text (
++ gtk_bin_get_child (GTK_BIN (entry->widget)), _(entry->tooltip));
++#else
+ gtk_tooltips_set_tip (__widget_tooltips,
+ GTK_WIDGET (GTK_COMBO (entry->widget)->entry),
+ _(entry->tooltip), NULL);
++#endif
+
+ return GTK_WIDGET (entry->widget);
+ }
+@@ -528,6 +585,29 @@ create_option_menu (const char *config_key, gpointer candidates_p,
+ (GtkAttachOptions) (GTK_FILL), 4, 4);
+ gtk_widget_show (label);
+
++#if GTK_CHECK_VERSION(2, 24, 0)
++ entry->widget = gtk_combo_box_text_new ();
++ gtk_label_set_mnemonic_widget (GTK_LABEL (label),
++ GTK_WIDGET (entry->widget));
++ gtk_widget_show (GTK_WIDGET (entry->widget));
++ gtk_table_attach (GTK_TABLE (table), GTK_WIDGET (entry->widget),
++ 1, 2, idx, idx + 1,
++ (GtkAttachOptions) (GTK_FILL),
++ (GtkAttachOptions) (GTK_FILL), 4, 4);
++ g_object_set_data (G_OBJECT (entry->widget),
++ DATA_POINTER_KEY,
++ (gpointer) candidates_p);
++
++ for (unsigned int i = 0; data[i].label; i++) {
++ gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (entry->widget), _(data[i].label));
++ }
++
++ gtk_combo_box_set_active (GTK_COMBO_BOX (entry->widget), 0);
++
++ g_signal_connect (G_OBJECT (entry->widget), "changed",
++ G_CALLBACK (on_default_option_menu_changed),
++ entry);
++#else
+ entry->widget = gtk_option_menu_new ();
+ gtk_label_set_mnemonic_widget (GTK_LABEL (label),
+ GTK_WIDGET (entry->widget));
+@@ -555,12 +635,20 @@ create_option_menu (const char *config_key, gpointer candidates_p,
+ g_signal_connect ((gpointer) GTK_OPTION_MENU (entry->widget), "changed",
+ G_CALLBACK (on_default_option_menu_changed),
+ entry);
++#endif
+
++#if GTK_CHECK_VERSION(3, 0, 0)
++#else
+ if (!__widget_tooltips)
+ __widget_tooltips = gtk_tooltips_new();
++#endif
+ if (entry->tooltip)
++#if GTK_CHECK_VERSION(3, 0, 0)
++ gtk_widget_set_tooltip_text (GTK_WIDGET (entry->widget), _(entry->tooltip));
++#else
+ gtk_tooltips_set_tip (__widget_tooltips, GTK_WIDGET (entry->widget),
+ _(entry->tooltip), NULL);
++#endif
+
+ return GTK_WIDGET (entry->widget);
+ }
+@@ -590,7 +678,11 @@ create_color_button (const char *config_key)
+ if (!entry)
+ return NULL;
+
++#if GTK_CHECK_VERSION(3, 0, 0)
++ GtkWidget *hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
++#else
+ GtkWidget *hbox = gtk_hbox_new (FALSE, 0);
++#endif
+ gtk_container_set_border_width (GTK_CONTAINER (hbox), 4);
+ gtk_widget_show (hbox);
+
+@@ -614,11 +706,18 @@ create_color_button (const char *config_key)
+ gtk_label_set_mnemonic_widget (GTK_LABEL (label),
+ GTK_WIDGET (entry->widget));
+
++#if GTK_CHECK_VERSION(3, 0, 0)
++#else
+ if (!__widget_tooltips)
+ __widget_tooltips = gtk_tooltips_new();
++#endif
+ if (entry->tooltip)
++#if GTK_CHECK_VERSION(3, 0, 0)
++ gtk_widget_set_tooltip_text (GTK_WIDGET (entry->widget), _(entry->tooltip));
++#else
+ gtk_tooltips_set_tip (__widget_tooltips, GTK_WIDGET (entry->widget),
+ _(entry->tooltip), NULL);
++#endif
+
+ return hbox;
+ }
+@@ -701,9 +800,15 @@ key_list_view_popup_key_selection (GtkTreeView *treeview)
+ gtk_list_store_set (GTK_LIST_STORE (model), &iter,
+ COLUMN_VALUE, data->value.c_str(),
+ -1);
++#if GTK_CHECK_VERSION(2, 24, 0)
++ gtk_combo_box_set_active(
++ GTK_COMBO_BOX (__widget_key_theme_menu),
++ KEY_THEME_INDEX_USER_DEFINED);
++#else
+ gtk_option_menu_set_history (
+ GTK_OPTION_MENU (__widget_key_theme_menu),
+ KEY_THEME_INDEX_USER_DEFINED);
++#endif
+ data->changed = true;
+ __config_changed = true;
+ }
+@@ -718,7 +823,11 @@ create_common_page (void)
+ {
+ GtkWidget *vbox, *table, *widget;
+
++#if GTK_CHECK_VERSION(3, 0, 0)
++ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
++#else
+ vbox = gtk_vbox_new (FALSE, 0);
++#endif
+ gtk_widget_show (vbox);
+
+ table = gtk_table_new (7, 2, FALSE);
+@@ -753,7 +862,11 @@ create_symbols_page (void)
+ {
+ GtkWidget *vbox, *table, *widget;
+
++#if GTK_CHECK_VERSION(3, 0, 0)
++ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
++#else
+ vbox = gtk_vbox_new (FALSE, 0);
++#endif
+ gtk_widget_show (vbox);
+
+ table = gtk_table_new (7, 2, FALSE);
+@@ -793,10 +906,18 @@ create_keyboard_page (void)
+ {
+ GtkWidget *vbox, *hbox;
+
++#if GTK_CHECK_VERSION(3, 0, 0)
++ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
++#else
+ vbox = gtk_vbox_new (FALSE, 0);
++#endif
+ gtk_widget_show (vbox);
+
++#if GTK_CHECK_VERSION(3, 0, 0)
++ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
++#else
+ hbox = gtk_hbox_new (FALSE, 0);
++#endif
+ gtk_container_set_border_width (GTK_CONTAINER (hbox), 4);
+ gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
+ gtk_widget_show(hbox);
+@@ -806,6 +927,28 @@ create_keyboard_page (void)
+ gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 2);
+ gtk_widget_show (label);
+
++#if GTK_CHECK_VERSION(2, 24, 0)
++ GtkWidget *omenu = gtk_combo_box_text_new ();
++ __widget_key_categories_menu = omenu;
++ gtk_box_pack_start (GTK_BOX (hbox), omenu, FALSE, FALSE, 2);
++ gtk_widget_show (omenu);
++
++ gtk_label_set_mnemonic_widget (GTK_LABEL (label), omenu);
++
++ gtk_combo_box_text_append_text
++ (GTK_COMBO_BOX_TEXT (omenu),
++ _("All"));
++
++ for (unsigned int i = 0; i < __key_conf_pages_num; i++) {
++ gtk_combo_box_text_append_text
++ (GTK_COMBO_BOX_TEXT (omenu),
++ _(__key_conf_pages[i].label));
++ }
++
++ gtk_combo_box_text_append_text
++ (GTK_COMBO_BOX_TEXT (omenu),
++ _("Search by key"));
++#else
+ GtkWidget *omenu = gtk_option_menu_new ();
+ __widget_key_categories_menu = omenu;
+ gtk_box_pack_start (GTK_BOX (hbox), omenu, FALSE, FALSE, 2);
+@@ -833,10 +976,11 @@ create_keyboard_page (void)
+
+ gtk_option_menu_set_menu (GTK_OPTION_MENU (omenu), menu);
+ gtk_widget_show (menu);
++#endif
+
+ GtkWidget *entry = gtk_entry_new ();
+ __widget_key_filter = entry;
+- gtk_entry_set_editable (GTK_ENTRY (entry), FALSE);
++ gtk_editable_set_editable (GTK_EDITABLE (entry), FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 2);
+ gtk_widget_show(entry);
+
+@@ -905,7 +1049,11 @@ create_keyboard_page (void)
+ g_signal_connect (G_OBJECT (selection), "changed",
+ G_CALLBACK (on_key_list_selection_changed), treeview);
+
++#if GTK_CHECK_VERSION(3, 0, 0)
++ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
++#else
+ hbox = gtk_hbox_new (FALSE, 0);
++#endif
+ gtk_container_set_border_width (GTK_CONTAINER (hbox), 4);
+ gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
+ gtk_widget_show(hbox);
+@@ -915,7 +1063,11 @@ create_keyboard_page (void)
+ gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 2);
+ gtk_widget_show (label);
+
++#if GTK_CHECK_VERSION(2, 24, 0)
++ omenu = gtk_combo_box_text_new ();
++#else
+ omenu = gtk_option_menu_new ();
++#endif
+ __widget_key_theme_menu = omenu;
+ g_signal_connect (G_OBJECT (omenu), "changed",
+ G_CALLBACK (on_key_theme_menu_changed), NULL);
+@@ -945,10 +1097,18 @@ create_learning_page ()
+ GtkWidget *vbox, *vbox2, *hbox, *alignment, *table;
+ GtkWidget *widget, *label;
+
++#if GTK_CHECK_VERSION(3, 0, 0)
++ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
++#else
+ vbox = gtk_vbox_new (FALSE, 0);
++#endif
+ gtk_widget_show (vbox);
+
++#if GTK_CHECK_VERSION(3, 0, 0)
++ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
++#else
+ hbox = gtk_hbox_new (FALSE, 0);
++#endif
+ gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 4);
+ gtk_widget_show (hbox);
+
+@@ -962,7 +1122,11 @@ create_learning_page ()
+ gtk_box_pack_start (GTK_BOX (vbox), alignment, FALSE, FALSE, 0);
+ gtk_widget_show (alignment);
+
++#if GTK_CHECK_VERSION(3, 0, 0)
++ vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
++#else
+ vbox2 = gtk_vbox_new (FALSE, 0);
++#endif
+ gtk_container_add (GTK_CONTAINER (alignment), vbox2);
+ gtk_widget_show (vbox2);
+
+@@ -975,7 +1139,11 @@ create_learning_page ()
+ gtk_box_pack_start (GTK_BOX (vbox2), widget, FALSE, FALSE, 4);
+
+ /* key preference */
++#if GTK_CHECK_VERSION(3, 0, 0)
++ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
++#else
+ hbox = gtk_hbox_new (FALSE, 0);
++#endif
+ gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 4);
+ gtk_widget_show (hbox);
+
+@@ -1008,7 +1176,7 @@ create_learning_page ()
+ {
+ StringConfigData *entry = entries[i];
+ widget = create_entry (entry->key, GTK_TABLE (table), i);
+- gtk_entry_set_editable (GTK_ENTRY (widget), FALSE);
++ gtk_editable_set_editable (GTK_EDITABLE (widget), FALSE);
+ create_key_select_button (entry->key, GTK_TABLE (table), i);
+ }
+
+@@ -1020,7 +1188,11 @@ create_prediction_page ()
+ {
+ GtkWidget *vbox, *widget;
+
++#if GTK_CHECK_VERSION(3, 0, 0)
++ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
++#else
+ vbox = gtk_vbox_new (FALSE, 0);
++#endif
+ gtk_widget_show (vbox);
+
+ /* predict while inputting */
+@@ -1084,7 +1256,11 @@ create_candidates_window_page (void)
+ {
+ GtkWidget *vbox, *widget, *table;
+
++#if GTK_CHECK_VERSION(3, 0, 0)
++ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
++#else
+ vbox = gtk_vbox_new (FALSE, 0);
++#endif
+ gtk_widget_show (vbox);
+
+ /* show candidates label */
+@@ -1115,7 +1291,11 @@ create_toolbar_page (void)
+ {
+ GtkWidget *vbox, *hbox, *label, *widget;
+
++#if GTK_CHECK_VERSION(3, 0, 0)
++ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
++#else
+ vbox = gtk_vbox_new (FALSE, 0);
++#endif
+ gtk_widget_show (vbox);
+
+ /* show/hide toolbar label */
+@@ -1141,7 +1321,11 @@ create_toolbar_page (void)
+ NULL);
+ gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE, FALSE, 2);
+
++#if GTK_CHECK_VERSION(3, 0, 0)
++ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
++#else
+ hbox = gtk_hbox_new (FALSE, 0);
++#endif
+ gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 2);
+ gtk_widget_show (hbox);
+ label = gtk_label_new (" ");
+@@ -1166,7 +1350,11 @@ create_appearance_page (void)
+ {
+ GtkWidget *vbox, *table, *omenu, *widget, *hbox;
+
++#if GTK_CHECK_VERSION(3, 0, 0)
++ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
++#else
+ vbox = gtk_vbox_new (FALSE, 0);
++#endif
+ gtk_widget_show (vbox);
+
+ table = gtk_table_new (2, 3, FALSE);
+@@ -1178,7 +1366,11 @@ create_appearance_page (void)
+ &preedit_style, GTK_TABLE (table), 0);
+
+ /* preedit color */
++#if GTK_CHECK_VERSION(3, 0, 0)
++ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
++#else
+ hbox = gtk_hbox_new (FALSE, 0);
++#endif
+ gtk_widget_show (hbox);
+ widget = create_color_button (SCIM_ANTHY_CONFIG_PREEDIT_FG_COLOR);
+ gtk_box_pack_start (GTK_BOX (hbox), widget, FALSE, FALSE, 0);
+@@ -1187,15 +1379,24 @@ create_appearance_page (void)
+ (GtkAttachOptions) (GTK_FILL), 4, 4);
+ gtk_widget_set_sensitive (hbox, FALSE);
+
++#if GTK_CHECK_VERSION(2, 24, 0)
++ g_signal_connect (G_OBJECT (omenu), "changed",
++ G_CALLBACK (on_preedit_style_menu_changed), hbox);
++#else
+ g_signal_connect ((gpointer) GTK_OPTION_MENU (omenu), "changed",
+ G_CALLBACK (on_preedit_style_menu_changed), hbox);
++#endif
+
+ /* conversion style */
+ omenu = create_option_menu (SCIM_ANTHY_CONFIG_CONVERSION_STYLE,
+ &preedit_style, GTK_TABLE (table), 1);
+
+ /* conversion color */
++#if GTK_CHECK_VERSION(3, 0, 0)
++ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
++#else
+ hbox = gtk_hbox_new (FALSE, 0);
++#endif
+ gtk_widget_show (hbox);
+ widget = create_color_button (SCIM_ANTHY_CONFIG_CONVERSION_FG_COLOR);
+ gtk_box_pack_start (GTK_BOX (hbox), widget, FALSE, FALSE, 0);
+@@ -1204,15 +1405,24 @@ create_appearance_page (void)
+ (GtkAttachOptions) (GTK_FILL), 4, 4);
+ gtk_widget_set_sensitive (hbox, FALSE);
+
++#if GTK_CHECK_VERSION(2, 24, 0)
++ g_signal_connect (G_OBJECT (omenu), "changed",
++ G_CALLBACK (on_preedit_style_menu_changed), hbox);
++#else
+ g_signal_connect ((gpointer) GTK_OPTION_MENU (omenu), "changed",
+ G_CALLBACK (on_preedit_style_menu_changed), hbox);
++#endif
+
+ /* selected segment style */
+ omenu = create_option_menu (SCIM_ANTHY_CONFIG_SELECTED_SEGMENT_STYLE,
+ &preedit_style, GTK_TABLE (table), 2);
+
+ /* selected segment color */
++#if GTK_CHECK_VERSION(3, 0, 0)
++ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
++#else
+ hbox = gtk_hbox_new (FALSE, 0);
++#endif
+ gtk_widget_show (hbox);
+ widget = create_color_button (SCIM_ANTHY_CONFIG_SELECTED_SEGMENT_FG_COLOR);
+ gtk_box_pack_start (GTK_BOX (hbox), widget, FALSE, FALSE, 0);
+@@ -1221,8 +1431,13 @@ create_appearance_page (void)
+ (GtkAttachOptions) (GTK_FILL), 4, 4);
+ gtk_widget_set_sensitive (hbox, FALSE);
+
++#if GTK_CHECK_VERSION(2, 24, 0)
++ g_signal_connect (G_OBJECT (omenu), "changed",
++ G_CALLBACK (on_preedit_style_menu_changed), hbox);
++#else
+ g_signal_connect ((gpointer) GTK_OPTION_MENU (omenu), "changed",
+ G_CALLBACK (on_preedit_style_menu_changed), hbox);
++#endif
+
+ return vbox;
+ }
+@@ -1233,7 +1448,11 @@ create_about_page ()
+ GtkWidget *vbox, *label;
+ gchar str[256];
+
++#if GTK_CHECK_VERSION(3, 0, 0)
++ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
++#else
+ vbox = gtk_vbox_new (FALSE, 0);
++#endif
+ gtk_widget_show (vbox);
+
+ g_snprintf (
+@@ -1355,8 +1574,24 @@ create_setup_window (void)
+ }
+
+ static void
+-setup_combo_value (GtkCombo *combo, const String & str)
++setup_combo_value (GtkWidget *combo, const String & str)
+ {
++#if GTK_CHECK_VERSION(2, 24, 0)
++ ComboConfigCandidate *data
++ = static_cast<ComboConfigCandidate*>
++ (g_object_get_data (G_OBJECT (gtk_bin_get_child (GTK_BIN (combo))),
++ DATA_POINTER_KEY));
++
++ gint default_index = -1;
++ for (unsigned int i = 0; data[i].label; i++) {
++ gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _(data[i].label));
++ if (!strcmp (data[i].data, str.c_str ()))
++ default_index = i;
++ }
++
++ if (default_index != -1)
++ gtk_combo_box_set_active (GTK_COMBO_BOX (combo), default_index);
++#else
+ GList *list = NULL;
+ const char *defval = NULL;
+
+@@ -1371,15 +1606,16 @@ setup_combo_value (GtkCombo *combo, const String & str)
+ defval = _(data[i].label);
+ }
+
+- gtk_combo_set_popdown_strings (combo, list);
++ gtk_combo_set_popdown_strings (GTK_COMBO (combo), list);
+ g_list_free (list);
+
+ if (defval)
+- gtk_entry_set_text (GTK_ENTRY (combo->entry), defval);
++ gtk_entry_set_text (GTK_ENTRY (GTK_COMBO(combo)->entry), defval);
++#endif
+ }
+
+ static void
+-setup_option_menu_value (GtkOptionMenu *omenu, const String & str)
++setup_option_menu_value (GtkWidget *omenu, const String & str)
+ {
+ ComboConfigCandidate *data
+ = static_cast<ComboConfigCandidate*>
+@@ -1387,15 +1623,55 @@ setup_option_menu_value (GtkOptionMenu *omenu, const String & str)
+
+ for (unsigned int i = 0; data[i].label; i++) {
+ if (!strcmp (data[i].data, str.c_str ())) {
+- gtk_option_menu_set_history (omenu, i);
++#if GTK_CHECK_VERSION(2, 24, 0)
++ gtk_combo_box_set_active (GTK_COMBO_BOX (omenu), i);
++#else
++ gtk_option_menu_set_history (GTK_OPTION_MENU (omenu), i);
++#endif
+ return;
+ }
+ }
+ }
+
+ static void
+-setup_key_theme_menu (GtkOptionMenu *omenu)
++setup_key_theme_menu (GtkWidget *omenu)
+ {
++#if GTK_CHECK_VERSION(2, 24, 0)
++ gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (omenu), _("User defined"));
++ gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (omenu), _("Default"));
++
++ gint active_index = KEY_THEME_INDEX_DEFAULT;
++ bool check_list = false;
++ if (__config_key_theme_file == __user_style_file.get_file_name () ||
++ __config_key_theme == __user_style_file.get_title ()) {
++ active_index = KEY_THEME_INDEX_USER_DEFINED;
++ } else {
++ check_list = true;
++ }
++
++ StyleFiles::iterator it;
++ gint i;
++ for (i = 0, it = __style_list.begin ();
++ it != __style_list.end ();
++ i++, it++)
++ {
++ const char *section_name = "KeyBindings";
++ StyleLines section;
++ if (!it->get_entry_list (section, section_name))
++ continue;
++
++ gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (omenu), _(it->get_title().c_str()));
++
++ if (check_list) {
++ if (it->get_file_name () == __config_key_theme_file) {
++ active_index = i + 2; // 2: user-define + default
++ check_list = false;
++ }
++ }
++ }
++
++ gtk_combo_box_set_active (GTK_COMBO_BOX (omenu), active_index);
++#else
+ GtkWidget *menu = gtk_menu_new ();
+ gtk_option_menu_set_menu (GTK_OPTION_MENU (omenu),
+ menu);
+@@ -1459,6 +1735,7 @@ setup_key_theme_menu (GtkOptionMenu *omenu)
+ g_signal_handlers_unblock_by_func (G_OBJECT (omenu),
+ (gpointer) (on_key_theme_menu_changed),
+ NULL);
++#endif
+ }
+
+ static void
+@@ -1480,12 +1757,22 @@ setup_widget_value (void)
+
+ for (unsigned int i = 0; config_string_common[i].key; i++) {
+ StringConfigData &entry = config_string_common[i];
++#if GTK_CHECK_VERSION(2, 24, 0)
++ if (entry.widget && GTK_IS_COMBO_BOX (entry.widget)) {
++ if (gtk_combo_box_get_has_entry (GTK_COMBO_BOX (entry.widget))) {
++ setup_combo_value (GTK_WIDGET (entry.widget), entry.value);
++ } else {
++ setup_option_menu_value (GTK_WIDGET (entry.widget), entry.value);
++ }
++ }
++#else
+ if (entry.widget && GTK_IS_OPTION_MENU (entry.widget)) {
+- setup_option_menu_value (GTK_OPTION_MENU (entry.widget),
+- entry.value);
++ setup_option_menu_value (GTK_WIDGET (entry.widget), entry.value);
+ } else if (entry.widget && GTK_IS_COMBO (entry.widget)) {
+- setup_combo_value (GTK_COMBO (entry.widget), entry.value);
+- } else if (entry.widget && GTK_IS_ENTRY (entry.widget)) {
++ setup_combo_value (GTK_WIDGET (entry.widget), entry.value);
++ }
++#endif
++ else if (entry.widget && GTK_IS_ENTRY (entry.widget)) {
+ gtk_entry_set_text (GTK_ENTRY (entry.widget),
+ entry.value.c_str ());
+ }
+@@ -1509,9 +1796,15 @@ setup_widget_value (void)
+ }
+ }
+
++#if GTK_CHECK_VERSION(2, 24, 0)
++ gtk_combo_box_set_active
++ (GTK_COMBO_BOX (__widget_key_categories_menu),
++ KEY_CATEGORY_INDEX_ALL);
++#else
+ gtk_option_menu_set_history
+ (GTK_OPTION_MENU (__widget_key_categories_menu),
+ KEY_CATEGORY_INDEX_ALL);
++#endif
+ GtkTreeView *treeview = GTK_TREE_VIEW (__widget_key_list_view);
+ GtkListStore *store = GTK_LIST_STORE (gtk_tree_view_get_model (treeview));
+ gtk_list_store_clear (store);
+@@ -1521,7 +1814,7 @@ setup_widget_value (void)
+ gtk_widget_set_sensitive (__widget_key_filter_button, FALSE);
+
+ // setup option menu
+- setup_key_theme_menu (GTK_OPTION_MENU (__widget_key_theme_menu));
++ setup_key_theme_menu (__widget_key_theme_menu);
+ }
+
+ bool operator < (const StyleFile &left, const StyleFile &right)
+@@ -1822,7 +2115,7 @@ on_default_combo_changed (GtkEditable *editable,
+ }
+
+ static void
+-on_default_option_menu_changed (GtkOptionMenu *omenu, gpointer user_data)
++on_default_option_menu_changed (GtkWidget *omenu, gpointer user_data)
+ {
+ StringConfigData *entry = static_cast<StringConfigData*> (user_data);
+ ComboConfigCandidate *data = static_cast<ComboConfigCandidate*>
+@@ -1833,7 +2126,11 @@ on_default_option_menu_changed (GtkOptionMenu *omenu, gpointer user_data)
+ if (!data) return;
+
+ for (int i = 0; data[i].label; i++) {
+- if (i == gtk_option_menu_get_history (omenu)) {
++#if GTK_CHECK_VERSION(2, 24, 0)
++ if (i == gtk_combo_box_get_active (GTK_COMBO_BOX (omenu))) {
++#else
++ if (i == gtk_option_menu_get_history (GTK_OPTION_MENU (omenu))) {
++#endif
+ entry->value = data[i].data;
+ entry->changed = true;
+ __config_changed = true;
+@@ -1843,11 +2140,15 @@ on_default_option_menu_changed (GtkOptionMenu *omenu, gpointer user_data)
+ }
+
+ static void
+-on_preedit_style_menu_changed (GtkOptionMenu *omenu, gpointer user_data)
++on_preedit_style_menu_changed (GtkWidget *omenu, gpointer user_data)
+ {
+ GtkWidget *widget = GTK_WIDGET (user_data);
+
+- gint idx = gtk_option_menu_get_history (omenu);
++#if GTK_CHECK_VERSION(2, 24, 0)
++ gint idx = gtk_combo_box_get_active (GTK_COMBO_BOX (omenu));
++#else
++ gint idx = gtk_option_menu_get_history (GTK_OPTION_MENU (omenu));
++#endif
+
+ for (int i = 0; preedit_style[i].data && i <= idx; i++) {
+ if (i == idx &&
+@@ -1879,14 +2180,18 @@ on_dict_menu_label_toggled (GtkToggleButton *togglebutton,
+ }
+
+ static void
+-on_key_category_menu_changed (GtkOptionMenu *omenu, gpointer user_data)
++on_key_category_menu_changed (GtkWidget *omenu, gpointer user_data)
+ {
+ GtkTreeView *treeview = GTK_TREE_VIEW (user_data);
+ GtkListStore *store = GTK_LIST_STORE (gtk_tree_view_get_model (treeview));
+
+ gtk_list_store_clear (store);
+
+- gint idx = gtk_option_menu_get_history (omenu);
++#if GTK_CHECK_VERSION(2, 24, 0)
++ gint idx = gtk_combo_box_get_active (GTK_COMBO_BOX (omenu));
++#else
++ gint idx = gtk_option_menu_get_history (GTK_OPTION_MENU (omenu));
++#endif
+
+ bool use_filter = false;
+
+@@ -1911,10 +2216,14 @@ on_key_category_menu_changed (GtkOptionMenu *omenu, gpointer user_data)
+ }
+
+ static void
+-on_key_theme_menu_changed (GtkOptionMenu *omenu, gpointer user_data)
++on_key_theme_menu_changed (GtkWidget *omenu, gpointer user_data)
+ {
+- gint idx = gtk_option_menu_get_history (omenu);
+- GtkWidget *menu = gtk_option_menu_get_menu (omenu);
++#if GTK_CHECK_VERSION(2, 24, 0)
++ gint idx = gtk_combo_box_get_active (GTK_COMBO_BOX (omenu));
++ gint theme_idx = idx - 2; // user definad and default
++#else
++ gint idx = gtk_option_menu_get_history (GTK_OPTION_MENU (omenu));
++ GtkWidget *menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (omenu));
+ GList *list = gtk_container_get_children (GTK_CONTAINER (menu));
+ GtkWidget *menuitem = GTK_WIDGET (g_list_nth_data (list, idx));
+
+@@ -1923,6 +2232,7 @@ on_key_theme_menu_changed (GtkOptionMenu *omenu, gpointer user_data)
+
+ gint theme_idx = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (menuitem),
+ INDEX_KEY));
++#endif
+
+ // clear all key bindings
+ if (idx != 0) {
+@@ -1974,9 +2284,15 @@ on_key_theme_menu_changed (GtkOptionMenu *omenu, gpointer user_data)
+
+ // sync widgets
+ if (idx != KEY_THEME_INDEX_USER_DEFINED) {
++#if GTK_CHECK_VERSION(2, 24, 0)
++ gtk_combo_box_set_active
++ (GTK_COMBO_BOX (__widget_key_categories_menu),
++ KEY_CATEGORY_INDEX_ALL);
++#else
+ gtk_option_menu_set_history
+ (GTK_OPTION_MENU (__widget_key_categories_menu),
+ KEY_CATEGORY_INDEX_ALL);
++#endif
+ gtk_widget_set_sensitive (__widget_key_filter, FALSE);
+ gtk_widget_set_sensitive (__widget_key_filter_button, FALSE);
+ GtkTreeModel *model;
+@@ -2041,8 +2357,13 @@ on_key_list_view_key_press (GtkWidget *widget, GdkEventKey *event,
+ GtkTreeView *treeview = GTK_TREE_VIEW (widget);
+
+ switch (event->keyval) {
++#if GTK_CHECK_VERSION(3, 0, 0)
++ case GDK_KEY_Return:
++ case GDK_KEY_KP_Enter:
++#else
+ case GDK_Return:
+ case GDK_KP_Enter:
++#endif
+ key_list_view_popup_key_selection (treeview);
+ break;
+ }
+diff --git a/src/scim_anthy_setup_kana.cpp b/src/scim_anthy_setup_kana.cpp
+index 1cc4740..4d3c2cc 100644
+--- a/src/scim_anthy_setup_kana.cpp
++++ b/src/scim_anthy_setup_kana.cpp
+@@ -65,15 +65,15 @@ static GtkWidget *create_kana_window (GtkWindow *pare
+ static GtkWidget *create_nicola_window (GtkWindow *parent);
+
+ static void setup_kana_page (void);
+-static void setup_kana_layout_menu (GtkOptionMenu *omenu);
+-static void setup_nicola_layout_menu (GtkOptionMenu *omenu);
++static void setup_kana_layout_menu (GtkWidget *omenu);
++static void setup_nicola_layout_menu (GtkWidget *omenu);
+ static void setup_kana_window_value (ScimAnthyTableEditor *editor);
+ static void setup_nicola_window_value (ScimAnthyTableEditor *editor);
+
+ static bool load_kana_layout (void);
+ static bool load_nicola_layout (void);
+
+-static void on_kana_layout_menu_changed (GtkOptionMenu *omenu,
++static void on_kana_layout_menu_changed (GtkWidget *omenu,
+ gpointer user_data);
+ static void on_kana_customize_button_clicked (GtkWidget *button,
+ gpointer data);
+@@ -85,7 +85,7 @@ static void on_kana_table_editor_remove_entry (ScimAnthyTableEditor *edit
+ gpointer data);
+ static void on_kana_table_editor_removed_entry (ScimAnthyTableEditor *editor,
+ gpointer data);
+-static void on_nicola_layout_menu_changed (GtkOptionMenu *omenu,
++static void on_nicola_layout_menu_changed (GtkWidget *omenu,
+ gpointer user_data);
+ static void on_nicola_customize_button_clicked (GtkWidget *button,
+ gpointer data);
+@@ -103,11 +103,19 @@ kana_page_create_ui (void)
+ {
+ GtkWidget *vbox;
+
++#if GTK_CHECK_VERSION(3, 0, 0)
++ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
++#else
+ vbox = gtk_vbox_new (FALSE, 0);
++#endif
+ gtk_widget_show (vbox);
+
+ // JIS Kana Layout
++#if GTK_CHECK_VERSION(3, 0, 0)
++ GtkWidget *hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
++#else
+ GtkWidget *hbox = gtk_hbox_new (FALSE, 0);
++#endif
+ gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 4);
+ gtk_widget_show (hbox);
+
+@@ -122,7 +130,11 @@ kana_page_create_ui (void)
+ gtk_widget_show (alignment);
+
+ /* kana table */
++#if GTK_CHECK_VERSION(3, 0, 0)
++ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
++#else
+ hbox = gtk_hbox_new (FALSE, 0);
++#endif
+ gtk_container_set_border_width (GTK_CONTAINER (hbox), 4);
+ gtk_container_add (GTK_CONTAINER (alignment), hbox);
+ gtk_widget_show(hbox);
+@@ -131,7 +143,11 @@ kana_page_create_ui (void)
+ gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 2);
+ gtk_widget_show (label);
+
++#if GTK_CHECK_VERSION(2, 24, 0)
++ GtkWidget *omenu = gtk_combo_box_text_new ();
++#else
+ GtkWidget *omenu = gtk_option_menu_new ();
++#endif
+ __widget_kana_layout_menu = omenu;
+ g_signal_connect (G_OBJECT (omenu), "changed",
+ G_CALLBACK (on_kana_layout_menu_changed), NULL);
+@@ -148,7 +164,11 @@ kana_page_create_ui (void)
+
+
+ // Thumb Shift Layout
++#if GTK_CHECK_VERSION(3, 0, 0)
++ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
++#else
+ hbox = gtk_hbox_new (FALSE, 0);
++#endif
+ gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 4);
+ gtk_widget_show (hbox);
+
+@@ -162,12 +182,20 @@ kana_page_create_ui (void)
+ gtk_box_pack_start (GTK_BOX (vbox), alignment, FALSE, FALSE, 0);
+ gtk_widget_show (alignment);
+
++#if GTK_CHECK_VERSION(3, 0, 0)
++ GtkWidget *vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
++#else
+ GtkWidget *vbox2 = gtk_vbox_new (FALSE, 0);
++#endif
+ gtk_container_add (GTK_CONTAINER (alignment), vbox2);
+ gtk_widget_show (vbox2);
+
+ /* nicola table */
++#if GTK_CHECK_VERSION(3, 0, 0)
++ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
++#else
+ hbox = gtk_hbox_new (FALSE, 0);
++#endif
+ gtk_container_set_border_width (GTK_CONTAINER (hbox), 4);
+ gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0);
+ gtk_widget_show(hbox);
+@@ -176,7 +204,11 @@ kana_page_create_ui (void)
+ gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 2);
+ gtk_widget_show (label);
+
++#if GTK_CHECK_VERSION(2, 24, 0)
++ omenu = gtk_combo_box_text_new ();
++#else
+ omenu = gtk_option_menu_new ();
++#endif
+ __widget_nicola_layout_menu = omenu;
+ g_signal_connect (G_OBJECT (omenu), "changed",
+ G_CALLBACK (on_nicola_layout_menu_changed), NULL);
+@@ -192,7 +224,11 @@ kana_page_create_ui (void)
+ gtk_widget_show (button);
+
+ /* thumb shift keys */
++#if GTK_CHECK_VERSION(3, 0, 0)
++ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
++#else
+ hbox = gtk_hbox_new (FALSE, 0);
++#endif
+ gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0);
+ gtk_widget_show (hbox);
+
+@@ -203,14 +239,14 @@ kana_page_create_ui (void)
+ // left
+ GtkWidget *widget = create_entry (SCIM_ANTHY_CONFIG_LEFT_THUMB_SHIFT_KEY,
+ GTK_TABLE (table), 0);
+- gtk_entry_set_editable (GTK_ENTRY (widget), FALSE);
++ gtk_editable_set_editable (GTK_EDITABLE (widget), FALSE);
+ widget = create_key_select_button (SCIM_ANTHY_CONFIG_LEFT_THUMB_SHIFT_KEY,
+ GTK_TABLE (table), 0);
+
+ // right
+ widget = create_entry (SCIM_ANTHY_CONFIG_RIGHT_THUMB_SHIFT_KEY,
+ GTK_TABLE (table), 1);
+- gtk_entry_set_editable (GTK_ENTRY (widget), FALSE);
++ gtk_editable_set_editable (GTK_EDITABLE (widget), FALSE);
+ widget = create_key_select_button (SCIM_ANTHY_CONFIG_RIGHT_THUMB_SHIFT_KEY,
+ GTK_TABLE (table), 1);
+
+@@ -270,27 +306,50 @@ create_kana_window (GtkWindow *parent)
+ _("Customize kana layout table"));
+
+ // option menu area
++#if GTK_CHECK_VERSION(3, 0, 0)
++ GtkWidget *hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
++#else
+ GtkWidget *hbox = gtk_hbox_new (FALSE, 0);
++#endif
+ gtk_container_set_border_width (GTK_CONTAINER (hbox), 4);
++#if GTK_CHECK_VERSION(3, 0, 0)
++ gtk_box_pack_start
++ (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))),
++ hbox, FALSE, FALSE, 0);
++ gtk_box_reorder_child
++ (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))),
++ hbox, 0);
++#else
+ gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox,
+ FALSE, FALSE, 0);
+ gtk_box_reorder_child (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox, 0);
++#endif
+ gtk_widget_show(hbox);
+
+ GtkWidget *label = gtk_label_new_with_mnemonic (_("Layout _table:"));
+ gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 2);
+ gtk_widget_show (label);
+
++#if GTK_CHECK_VERSION(2, 24, 0)
++ GtkWidget *omenu = gtk_combo_box_text_new ();
++#else
+ GtkWidget *omenu = gtk_option_menu_new ();
++#endif
+ __widget_kana_layout_menu2 = omenu;
+ g_object_add_weak_pointer (G_OBJECT (omenu),
+ (gpointer*) &__widget_kana_layout_menu2);
+ gtk_box_pack_start (GTK_BOX (hbox), omenu, FALSE, FALSE, 2);
+- setup_kana_layout_menu (GTK_OPTION_MENU (omenu));
++ setup_kana_layout_menu (omenu);
++#if GTK_CHECK_VERSION(2, 24, 0)
++ gtk_combo_box_set_active (
++ GTK_COMBO_BOX (omenu),
++ gtk_combo_box_get_active (GTK_COMBO_BOX (__widget_kana_layout_menu)));
++#else
+ gtk_option_menu_set_history
+ (GTK_OPTION_MENU (omenu),
+ gtk_option_menu_get_history (
+ GTK_OPTION_MENU (__widget_kana_layout_menu)));
++#endif
+ gtk_widget_show (omenu);
+
+ gtk_label_set_mnemonic_widget (GTK_LABEL(label), omenu);
+@@ -342,27 +401,50 @@ create_nicola_window (GtkWindow *parent)
+ _("Customize thumb shift layout table"));
+
+ // option menu area
++#if GTK_CHECK_VERSION(3, 0, 0)
++ GtkWidget *hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
++#else
+ GtkWidget *hbox = gtk_hbox_new (FALSE, 0);
++#endif
+ gtk_container_set_border_width (GTK_CONTAINER (hbox), 4);
++#if GTK_CHECK_VERSION(3, 0, 0)
++ gtk_box_pack_start
++ (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))),
++ hbox, FALSE, FALSE, 0);
++ gtk_box_reorder_child
++ (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))),
++ hbox, 0);
++#else
+ gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox,
+ FALSE, FALSE, 0);
+ gtk_box_reorder_child (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox, 0);
++#endif
+ gtk_widget_show(hbox);
+
+ GtkWidget *label = gtk_label_new_with_mnemonic (_("Layout _table:"));
+ gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 2);
+ gtk_widget_show (label);
+
++#if GTK_CHECK_VERSION(2, 24, 0)
++ GtkWidget *omenu = gtk_combo_box_text_new ();
++#else
+ GtkWidget *omenu = gtk_option_menu_new ();
++#endif
+ __widget_nicola_layout_menu2 = omenu;
+ g_object_add_weak_pointer (G_OBJECT (omenu),
+ (gpointer*) &__widget_nicola_layout_menu2);
+ gtk_box_pack_start (GTK_BOX (hbox), omenu, FALSE, FALSE, 2);
+- setup_nicola_layout_menu (GTK_OPTION_MENU (omenu));
++ setup_nicola_layout_menu (omenu);
++#if GTK_CHECK_VERSION(2, 24, 0)
++ gtk_combo_box_set_active (
++ GTK_COMBO_BOX (omenu),
++ gtk_combo_box_get_active (GTK_COMBO_BOX (__widget_nicola_layout_menu)));
++#else
+ gtk_option_menu_set_history
+ (GTK_OPTION_MENU (omenu),
+ gtk_option_menu_get_history (
+ GTK_OPTION_MENU (__widget_nicola_layout_menu)));
++#endif
+ gtk_widget_show (omenu);
+
+ gtk_label_set_mnemonic_widget (GTK_LABEL(label), omenu);
+@@ -397,13 +479,48 @@ create_nicola_window (GtkWindow *parent)
+ static void
+ setup_kana_page (void)
+ {
+- setup_kana_layout_menu (GTK_OPTION_MENU (__widget_kana_layout_menu));
+- setup_nicola_layout_menu (GTK_OPTION_MENU (__widget_nicola_layout_menu));
++ setup_kana_layout_menu (__widget_kana_layout_menu);
++ setup_nicola_layout_menu (__widget_nicola_layout_menu);
+ }
+
+ static void
+-setup_kana_layout_menu (GtkOptionMenu *omenu)
++setup_kana_layout_menu (GtkWidget *omenu)
+ {
++#if GTK_CHECK_VERSION(2, 24, 0)
++ gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (omenu), _("User defined"));
++ gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (omenu), _("Default"));
++
++ gint active_index = KANA_LAYOUT_INDEX_DEFAULT;
++ bool check_list = false;
++ if (__config_kana_layout_file == __user_style_file.get_file_name ()) {
++ active_index = KANA_LAYOUT_INDEX_USER_DEFINED;
++ } else {
++ check_list = true;
++ }
++
++ StyleFiles::iterator it;
++ gint i;
++ for (i = 0, it = __style_list.begin ();
++ it != __style_list.end ();
++ i++, it++)
++ {
++ StyleLines section;
++ if (!it->get_entry_list (section, __kana_fund_table))
++ continue;
++
++ gtk_combo_box_text_append_text
++ (GTK_COMBO_BOX_TEXT (omenu), _(it->get_title().c_str()));
++
++ if (check_list) {
++ if (it->get_file_name () == __config_kana_layout_file) {
++ active_index = i + 2; // 2: user-define + default
++ check_list = false;
++ }
++ }
++ }
++
++ gtk_combo_box_set_active (GTK_COMBO_BOX (omenu), active_index);
++#else
+ GtkWidget *menu = gtk_menu_new ();
+ gtk_option_menu_set_menu (GTK_OPTION_MENU (omenu),
+ menu);
+@@ -466,11 +583,47 @@ setup_kana_layout_menu (GtkOptionMenu *omenu)
+ G_OBJECT (omenu),
+ (gpointer) (on_kana_layout_menu_changed),
+ NULL);
++#endif
+ }
+
+ static void
+-setup_nicola_layout_menu (GtkOptionMenu *omenu)
++setup_nicola_layout_menu (GtkWidget *omenu)
+ {
++#if GTK_CHECK_VERSION(2, 24, 0)
++ gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (omenu), _("User defined"));
++ gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (omenu), _("Default"));
++
++ gint active_index = NICOLA_LAYOUT_INDEX_DEFAULT;
++ bool check_list = false;
++ if (__config_nicola_layout_file == __user_style_file.get_file_name ()) {
++ active_index = NICOLA_LAYOUT_INDEX_USER_DEFINED;
++ } else {
++ check_list = true;
++ }
++
++ StyleFiles::iterator it;
++ gint i;
++ for (i = 0, it = __style_list.begin ();
++ it != __style_list.end ();
++ i++, it++)
++ {
++ StyleLines section;
++ if (!it->get_entry_list (section, __nicola_fund_table))
++ continue;
++
++ gtk_combo_box_text_append_text (
++ GTK_COMBO_BOX_TEXT (omenu), _(it->get_title().c_str()));
++
++ if (check_list) {
++ if (it->get_file_name () == __config_nicola_layout_file) {
++ active_index = i + 2; // 2: user-define + default
++ check_list = false;
++ }
++ }
++ }
++
++ gtk_combo_box_set_active (GTK_COMBO_BOX (omenu), active_index);
++#else
+ GtkWidget *menu = gtk_menu_new ();
+ gtk_option_menu_set_menu (GTK_OPTION_MENU (omenu),
+ menu);
+@@ -533,6 +686,7 @@ setup_nicola_layout_menu (GtkOptionMenu *omenu)
+ G_OBJECT (omenu),
+ (gpointer) (on_nicola_layout_menu_changed),
+ NULL);
++#endif
+ }
+
+ static void
+@@ -647,6 +801,10 @@ setup_default_nicola_table (void)
+ static bool
+ load_kana_layout (void)
+ {
++#if GTK_CHECK_VERSION(2, 24, 0)
++ gint idx = gtk_combo_box_get_active (GTK_COMBO_BOX (__widget_kana_layout_menu));
++ gint theme_idx = idx - 2; // user definad and default
++#else
+ GtkOptionMenu *omenu = GTK_OPTION_MENU (__widget_kana_layout_menu);
+ gint idx = gtk_option_menu_get_history (omenu);
+ GtkWidget *menu = gtk_option_menu_get_menu (omenu);
+@@ -658,6 +816,7 @@ load_kana_layout (void)
+
+ gint theme_idx = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (menuitem),
+ INDEX_KEY));
++#endif
+
+ // set new kana table
+ if (idx == KANA_LAYOUT_INDEX_USER_DEFINED) {
+@@ -707,6 +866,10 @@ load_kana_layout (void)
+ static bool
+ load_nicola_layout (void)
+ {
++#if GTK_CHECK_VERSION(2, 24, 0)
++ gint idx = gtk_combo_box_get_active (GTK_COMBO_BOX (__widget_nicola_layout_menu));
++ gint theme_idx = idx - 2; // user definad and default
++#else
+ GtkOptionMenu *omenu = GTK_OPTION_MENU (__widget_nicola_layout_menu);
+ gint idx = gtk_option_menu_get_history (omenu);
+ GtkWidget *menu = gtk_option_menu_get_menu (omenu);
+@@ -718,6 +881,7 @@ load_nicola_layout (void)
+
+ gint theme_idx = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (menuitem),
+ INDEX_KEY));
++#endif
+
+ // set new NICOLA table
+ if (idx == NICOLA_LAYOUT_INDEX_USER_DEFINED) {
+@@ -785,7 +949,7 @@ has_voiced_consonant (String str)
+ }
+
+ static void
+-on_kana_layout_menu_changed (GtkOptionMenu *omenu, gpointer user_data)
++on_kana_layout_menu_changed (GtkWidget *omenu, gpointer user_data)
+ {
+ bool success;
+
+@@ -794,9 +958,15 @@ on_kana_layout_menu_changed (GtkOptionMenu *omenu, gpointer user_data)
+ G_OBJECT (__widget_kana_layout_menu),
+ (gpointer) (on_kana_layout_menu_changed),
+ NULL);
++#if GTK_CHECK_VERSION(2, 24, 0)
++ gtk_combo_box_set_active (
++ GTK_COMBO_BOX (__widget_kana_layout_menu),
++ gtk_combo_box_get_active (GTK_COMBO_BOX (omenu)));
++#else
+ gtk_option_menu_set_history (
+ GTK_OPTION_MENU (__widget_kana_layout_menu),
+- gtk_option_menu_get_history (omenu));
++ gtk_option_menu_get_history (GTK_OPTION_MENU (omenu)));
++#endif
+ g_signal_handlers_unblock_by_func (
+ G_OBJECT (__widget_kana_layout_menu),
+ (gpointer) (on_kana_layout_menu_changed),
+@@ -844,9 +1014,15 @@ static void
+ on_kana_table_editor_added_entry (ScimAnthyTableEditor *editor, gpointer data)
+ {
+ // change menu item to "User defined"
++#if GTK_CHECK_VERSION(2, 24, 0)
++ gtk_combo_box_set_active (
++ GTK_COMBO_BOX (__widget_kana_layout_menu2),
++ KANA_LAYOUT_INDEX_USER_DEFINED);
++#else
+ gtk_option_menu_set_history (
+ GTK_OPTION_MENU (__widget_kana_layout_menu2),
+ KANA_LAYOUT_INDEX_USER_DEFINED);
++#endif
+
+ __style_changed = true;
+ }
+@@ -865,15 +1041,21 @@ static void
+ on_kana_table_editor_removed_entry (ScimAnthyTableEditor *editor, gpointer data)
+ {
+ // change menu item to "User deined"
++#if GTK_CHECK_VERSION(2, 24, 0)
++ gtk_combo_box_set_active (
++ GTK_COMBO_BOX (__widget_kana_layout_menu2),
++ KANA_LAYOUT_INDEX_USER_DEFINED);
++#else
+ gtk_option_menu_set_history (
+ GTK_OPTION_MENU (__widget_kana_layout_menu2),
+ KANA_LAYOUT_INDEX_USER_DEFINED);
++#endif
+
+ __style_changed = true;
+ }
+
+ static void
+-on_nicola_layout_menu_changed (GtkOptionMenu *omenu, gpointer user_data)
++on_nicola_layout_menu_changed (GtkWidget *omenu, gpointer user_data)
+ {
+ bool success;
+
+@@ -882,9 +1064,15 @@ on_nicola_layout_menu_changed (GtkOptionMenu *omenu, gpointer user_data)
+ G_OBJECT (__widget_nicola_layout_menu),
+ (gpointer) (on_nicola_layout_menu_changed),
+ NULL);
++#if GTK_CHECK_VERSION(2, 24, 0)
++ gtk_combo_box_set_active (
++ GTK_COMBO_BOX (__widget_nicola_layout_menu),
++ gtk_combo_box_get_active (GTK_COMBO_BOX (omenu)));
++#else
+ gtk_option_menu_set_history (
+ GTK_OPTION_MENU (__widget_nicola_layout_menu),
+- gtk_option_menu_get_history (omenu));
++ gtk_option_menu_get_history (GTK_OPTION_MENU (omenu)));
++#endif
+ g_signal_handlers_unblock_by_func (
+ G_OBJECT (__widget_nicola_layout_menu),
+ (gpointer) (on_nicola_layout_menu_changed),
+@@ -928,9 +1116,15 @@ static void
+ on_nicola_table_editor_added_entry (ScimAnthyTableEditor *editor, gpointer data)
+ {
+ // change menu item to "User defined"
++#if GTK_CHECK_VERSION(2, 24, 0)
++ gtk_combo_box_set_active (
++ GTK_COMBO_BOX (__widget_nicola_layout_menu2),
++ NICOLA_LAYOUT_INDEX_USER_DEFINED);
++#else
+ gtk_option_menu_set_history (
+ GTK_OPTION_MENU (__widget_nicola_layout_menu2),
+ NICOLA_LAYOUT_INDEX_USER_DEFINED);
++#endif
+
+ __style_changed = true;
+ }
+@@ -949,9 +1143,15 @@ static void
+ on_nicola_table_editor_removed_entry (ScimAnthyTableEditor *editor, gpointer data)
+ {
+ // change menu item to "User deined"
++#if GTK_CHECK_VERSION(2, 24, 0)
++ gtk_combo_box_set_active (
++ GTK_COMBO_BOX (__widget_nicola_layout_menu2),
++ NICOLA_LAYOUT_INDEX_USER_DEFINED);
++#else
+ gtk_option_menu_set_history (
+ GTK_OPTION_MENU (__widget_nicola_layout_menu2),
+ NICOLA_LAYOUT_INDEX_USER_DEFINED);
++#endif
+
+ __style_changed = true;
+ }
+diff --git a/src/scim_anthy_setup_romaji.cpp b/src/scim_anthy_setup_romaji.cpp
+index 5739c57..6ead177 100644
+--- a/src/scim_anthy_setup_romaji.cpp
++++ b/src/scim_anthy_setup_romaji.cpp
+@@ -55,14 +55,14 @@ static String __config_romaji_theme_file = SCIM_ANTHY_CONFIG_ROMAJI_THEME_FILE_D
+ static GtkWidget *create_romaji_window (GtkWindow *parent);
+
+ static void setup_romaji_page (void);
+-static void setup_romaji_theme_menu (GtkOptionMenu *omenu);
++static void setup_romaji_theme_menu (GtkWidget *omenu);
+ static void setup_romaji_window_value (ScimAnthyTableEditor *editor);
+
+ static bool load_romaji_theme (void);
+
+ static void on_romaji_pseudo_ascii_mode_toggled(GtkToggleButton *togglebutton,
+ gpointer user_data);
+-static void on_romaji_theme_menu_changed (GtkOptionMenu *omenu,
++static void on_romaji_theme_menu_changed (GtkWidget *omenu,
+ gpointer user_data);
+ static void on_romaji_customize_button_clicked (GtkWidget *button,
+ gpointer data);
+@@ -80,7 +80,11 @@ romaji_page_create_ui (void)
+ {
+ GtkWidget *vbox, *widget, *hbox, *label;
+
++#if GTK_CHECK_VERSION(3, 0, 0)
++ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
++#else
+ vbox = gtk_vbox_new (FALSE, 0);
++#endif
+ gtk_widget_show (vbox);
+
+ /* romaji splitting */
+@@ -103,7 +107,11 @@ romaji_page_create_ui (void)
+ gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE, FALSE, 4);
+
+ /* pseudo ascii: blank behavior */
++#if GTK_CHECK_VERSION(3, 0, 0)
++ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
++#else
+ hbox = gtk_hbox_new (FALSE, 0);
++#endif
+ gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 4);
+ gtk_widget_show (hbox);
+ label = gtk_label_new (" ");
+@@ -116,7 +124,11 @@ romaji_page_create_ui (void)
+ on_romaji_pseudo_ascii_mode_toggled (GTK_TOGGLE_BUTTON (widget), NULL);
+
+ /* romaji table */
++#if GTK_CHECK_VERSION(3, 0, 0)
++ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
++#else
+ hbox = gtk_hbox_new (FALSE, 0);
++#endif
+ gtk_container_set_border_width (GTK_CONTAINER (hbox), 4);
+ gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
+ gtk_widget_show(hbox);
+@@ -125,7 +137,11 @@ romaji_page_create_ui (void)
+ gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 2);
+ gtk_widget_show (label);
+
++#if GTK_CHECK_VERSION(2, 24, 0)
++ GtkWidget *omenu = gtk_combo_box_text_new ();
++#else
+ GtkWidget *omenu = gtk_option_menu_new ();
++#endif
+ __widget_romaji_theme_menu = omenu;
+ g_signal_connect (G_OBJECT (omenu), "changed",
+ G_CALLBACK (on_romaji_theme_menu_changed), NULL);
+@@ -185,27 +201,52 @@ create_romaji_window (GtkWindow *parent)
+ _("Customize romaji table"));
+
+ // option menu area
++#if GTK_CHECK_VERSION(3, 0, 0)
++ GtkWidget *hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
++#else
+ GtkWidget *hbox = gtk_hbox_new (FALSE, 0);
++#endif
++
+ gtk_container_set_border_width (GTK_CONTAINER (hbox), 4);
++
++#if GTK_CHECK_VERSION(3, 0, 0)
++ gtk_box_pack_start
++ (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))),
++ hbox, FALSE, FALSE, 0);
++ gtk_box_reorder_child
++ (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))),
++ hbox, 0);
++#else
+ gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox,
+ FALSE, FALSE, 0);
+ gtk_box_reorder_child (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox, 0);
++#endif
++
+ gtk_widget_show(hbox);
+
+ GtkWidget *label = gtk_label_new_with_mnemonic (_("Romaji _table:"));
+ gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 2);
+ gtk_widget_show (label);
+
++#if GTK_CHECK_VERSION(2, 24, 0)
++ GtkWidget *omenu = gtk_combo_box_text_new ();
++#else
+ GtkWidget *omenu = gtk_option_menu_new ();
++#endif
+ __widget_romaji_theme_menu2 = omenu;
+ g_object_add_weak_pointer (G_OBJECT (omenu),
+ (gpointer*) &__widget_romaji_theme_menu2);
+ gtk_box_pack_start (GTK_BOX (hbox), omenu, FALSE, FALSE, 2);
+- setup_romaji_theme_menu (GTK_OPTION_MENU (omenu));
++ setup_romaji_theme_menu (omenu);
++#if GTK_CHECK_VERSION(2, 24, 0)
++ gtk_combo_box_set_active (GTK_COMBO_BOX (omenu),
++ gtk_combo_box_get_active (GTK_COMBO_BOX (__widget_romaji_theme_menu)));
++#else
+ gtk_option_menu_set_history
+ (GTK_OPTION_MENU (omenu),
+ gtk_option_menu_get_history (
+ GTK_OPTION_MENU (__widget_romaji_theme_menu)));
++#endif
+ gtk_widget_show (omenu);
+
+ gtk_label_set_mnemonic_widget (GTK_LABEL(label), omenu);
+@@ -240,12 +281,47 @@ create_romaji_window (GtkWindow *parent)
+ static void
+ setup_romaji_page (void)
+ {
+- setup_romaji_theme_menu (GTK_OPTION_MENU (__widget_romaji_theme_menu));
++ setup_romaji_theme_menu (__widget_romaji_theme_menu);
+ }
+
+ static void
+-setup_romaji_theme_menu (GtkOptionMenu *omenu)
++setup_romaji_theme_menu (GtkWidget *omenu)
+ {
++#if GTK_CHECK_VERSION(2, 24, 0)
++ gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (omenu), _("User defined"));
++ gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (omenu), _("Default"));
++
++ gint active_index = ROMAJI_THEME_INDEX_DEFAULT;
++ bool check_list = false;
++ if (__config_romaji_theme_file == __user_style_file.get_file_name ()) {
++ active_index = ROMAJI_THEME_INDEX_USER_DEFINED;
++ } else {
++ check_list = true;
++ }
++
++ StyleFiles::iterator it;
++ unsigned int i;
++ for (i = 0, it = __style_list.begin ();
++ it != __style_list.end ();
++ i++, it++)
++ {
++ StyleLines section;
++ if (!it->get_entry_list (section, __romaji_fund_table))
++ continue;
++
++ gtk_combo_box_text_append_text
++ (GTK_COMBO_BOX_TEXT (omenu), _(it->get_title().c_str()));
++
++ if (check_list) {
++ if (it->get_file_name () == __config_romaji_theme_file) {
++ active_index = i + 2; // 2: user-define + default
++ check_list = false;
++ }
++ }
++ }
++
++ gtk_combo_box_set_active (GTK_COMBO_BOX (omenu), active_index);
++#else
+ GtkWidget *menu = gtk_menu_new ();
+ gtk_option_menu_set_menu (GTK_OPTION_MENU (omenu),
+ menu);
+@@ -308,6 +384,7 @@ setup_romaji_theme_menu (GtkOptionMenu *omenu)
+ G_OBJECT (omenu),
+ (gpointer) (on_romaji_theme_menu_changed),
+ NULL);
++#endif
+ }
+
+ static void
+@@ -367,6 +444,11 @@ setup_default_romaji_table (void)
+ static bool
+ load_romaji_theme (void)
+ {
++#if GTK_CHECK_VERSION(2, 24, 0)
++ GtkWidget *omenu = __widget_romaji_theme_menu;
++ gint idx = gtk_combo_box_get_active (GTK_COMBO_BOX (omenu));
++ gint theme_idx = idx - 2; // 2: user-defined + default
++#else
+ GtkOptionMenu *omenu = GTK_OPTION_MENU (__widget_romaji_theme_menu);
+ gint idx = gtk_option_menu_get_history (omenu);
+ GtkWidget *menu = gtk_option_menu_get_menu (omenu);
+@@ -378,6 +460,7 @@ load_romaji_theme (void)
+
+ gint theme_idx = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (menuitem),
+ INDEX_KEY));
++#endif
+
+ // set new romaji table
+ if (idx == ROMAJI_THEME_INDEX_USER_DEFINED) {
+@@ -437,7 +520,7 @@ on_romaji_pseudo_ascii_mode_toggled (GtkToggleButton *togglebutton,
+ }
+
+ static void
+-on_romaji_theme_menu_changed (GtkOptionMenu *omenu, gpointer user_data)
++on_romaji_theme_menu_changed (GtkWidget *omenu, gpointer user_data)
+ {
+ bool success;
+
+@@ -446,9 +529,15 @@ on_romaji_theme_menu_changed (GtkOptionMenu *omenu, gpointer user_data)
+ G_OBJECT (__widget_romaji_theme_menu),
+ (gpointer) (on_romaji_theme_menu_changed),
+ NULL);
++#if GTK_CHECK_VERSION(2, 24, 0)
++ gtk_combo_box_set_active (
++ GTK_COMBO_BOX (__widget_romaji_theme_menu),
++ gtk_combo_box_get_active (GTK_COMBO_BOX (omenu)));
++#else
+ gtk_option_menu_set_history (
+ GTK_OPTION_MENU (__widget_romaji_theme_menu),
+- gtk_option_menu_get_history (omenu));
++ gtk_option_menu_get_history (GTK_OPTION_MENU (omenu)));
++#endif
+ g_signal_handlers_unblock_by_func (
+ G_OBJECT (__widget_romaji_theme_menu),
+ (gpointer) (on_romaji_theme_menu_changed),
+@@ -492,9 +581,15 @@ static void
+ on_table_editor_added_entry (ScimAnthyTableEditor *editor, gpointer data)
+ {
+ // change menu item to "User defined"
++#if GTK_CHECK_VERSION(2, 24, 0)
++ gtk_combo_box_set_active (
++ GTK_COMBO_BOX (__widget_romaji_theme_menu2),
++ ROMAJI_THEME_INDEX_USER_DEFINED);
++#else
+ gtk_option_menu_set_history (
+ GTK_OPTION_MENU (__widget_romaji_theme_menu2),
+ ROMAJI_THEME_INDEX_USER_DEFINED);
++#endif
+
+ __style_changed = true;
+ }
+@@ -515,9 +610,15 @@ static void
+ on_table_editor_removed_entry (ScimAnthyTableEditor *editor, gpointer data)
+ {
+ // change menu item to "User deined"
++#if GTK_CHECK_VERSION(2, 24, 0)
++ gtk_combo_box_set_active (
++ GTK_COMBO_BOX (__widget_romaji_theme_menu2),
++ ROMAJI_THEME_INDEX_USER_DEFINED);
++#else
+ gtk_option_menu_set_history (
+ GTK_OPTION_MENU (__widget_romaji_theme_menu2),
+ ROMAJI_THEME_INDEX_USER_DEFINED);
++#endif
+
+ __style_changed = true;
+ }
+diff --git a/src/scim_anthy_table_editor.cpp b/src/scim_anthy_table_editor.cpp
+index 1a70123..cdc660d 100644
+--- a/src/scim_anthy_table_editor.cpp
++++ b/src/scim_anthy_table_editor.cpp
+@@ -132,10 +132,20 @@ scim_anthy_table_editor_init (ScimAnthyTableEditor *editor)
+ GTK_WIN_POS_CENTER_ON_PARENT);
+
+ // edit area
++#if GTK_CHECK_VERSION(3, 0, 0)
++ GtkWidget *hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
++#else
+ GtkWidget *hbox = gtk_hbox_new (FALSE, 0);
++#endif
+ gtk_container_set_border_width (GTK_CONTAINER (hbox), 5);
++#if GTK_CHECK_VERSION(3, 0, 0)
++ gtk_box_pack_start
++ (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (editor))),
++ hbox, TRUE, TRUE, 0);
++#else
+ gtk_box_pack_start (GTK_BOX (GTK_DIALOG (editor)->vbox), hbox,
+ TRUE, TRUE, 0);
++#endif
+ gtk_widget_show (hbox);
+
+ // tree view area
+@@ -162,7 +172,11 @@ scim_anthy_table_editor_init (ScimAnthyTableEditor *editor)
+ gtk_tree_view_set_headers_clickable (GTK_TREE_VIEW (treeview), TRUE);
+
+ // button area
++#if GTK_CHECK_VERSION(3, 0, 0)
++ GtkWidget *vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
++#else
+ GtkWidget *vbox = gtk_vbox_new (FALSE, 0);
++#endif
+ editor->button_area = vbox;
+ gtk_box_pack_start (GTK_BOX (hbox), vbox, FALSE, FALSE, 5);
+ gtk_widget_show (vbox);
diff --git a/scim-anthy-no-rpath.patch b/scim-anthy-no-rpath.patch
new file mode 100644
index 0000000..b5ab2cf
--- /dev/null
+++ b/scim-anthy-no-rpath.patch
@@ -0,0 +1,28 @@
+Description: remove rpath
+Author: Osamu Aoki <osamu at debian.org>
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -76,7 +76,6 @@
+
+ anthy_la_LDFLAGS = \
+ -avoid-version \
+- -rpath $(moduledir) \
+ -module \
+ @LIBTOOL_EXPORT_OPTIONS@ \
+ @SCIM_LIBS@ \
+@@ -111,7 +110,6 @@
+ @SCIM_CFLAGS@ \
+ @SCIM_DEBUG_FLAGS@
+ anthy_imengine_setup_la_LDFLAGS = -avoid-version \
+- -rpath $(setupmoduledir) \
+ -module \
+ @LIBTOOL_EXPORT_OPTIONS@ \
+ @SCIM_GTKUTILS_LIBS@ \
+@@ -136,7 +134,6 @@
+ @SCIM_CFLAGS@ \
+ @SCIM_DEBUG_FLAGS@
+ anthy_imengine_helper_la_LDFLAGS = -avoid-version \
+- -rpath $(setupmoduledir) \
+ -module \
+ @LIBTOOL_EXPORT_OPTIONS@ \
+ @GTK2_LIBS@ \
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/scim-anthy.git/commitdiff/dd638296b617243f7bff9e8f741fc02ed6f21edf
More information about the pld-cvs-commit
mailing list