Revision: 6939
Author: nogu.dev
Date: Fri Feb 11 20:09:56 2011
Log: * configure.ac
- (AC_CONFIG_FILES): Add gtk3/pref/Makefile.
* gtk/key-util-gtk.c
- include gdk/gdkkeysyms-compat.h instead of gdk/gdkkeysyms.h in GTK+3.
* gtk3/Makefile.am
- (SUBDIRS): Add pref.
* gtk3/pref/Makefile.am
- New file.
* helper/pref-gtk-custom-widgets.c
- (sync_value_choice): Use gtk_combo_box_text_append_text() instead of
gtk_combo_box_append_text().
- (add_custom_type_choice): Use gtk_combo_box_text_new() instead of
gtk_combo_box_new_text().
* helper/pref-gtk.c
- (main)
* Don't call gtk_set_locale()
because gtk_init() automatically does what gtk_set_locale() does.
* Replace GtkFunction with GSourceFunc in g_idle_add().
http://code.google.com/p/uim/source/detail?r=6939
Added:
/trunk/gtk3/pref
/trunk/gtk3/pref/Makefile.am
Modified:
/trunk/configure.ac
/trunk/gtk/key-util-gtk.c
/trunk/gtk3/Makefile.am
/trunk/helper/pref-gtk-custom-widgets.c
/trunk/helper/pref-gtk.c
=======================================
--- /dev/null
+++ /trunk/gtk3/pref/Makefile.am Fri Feb 11 20:09:56 2011
@@ -0,0 +1,19 @@
+if GTK3
+if PREF
+bin_PROGRAMS = uim-pref-gtk3
+uim_pref_gtk3_SOURCES = ../../helper/pref-gtk.c \
+ ../../helper/pref-gtk-custom-widgets.c \
+ ../../helper/pref-gtk-custom-widgets.h \
+ ../../helper/pref-gtk-keytab.h \
+ ../../gtk/key-util-gtk.c ../../gtk/key-util-gtk.h
+uim_pref_gtk3_LDADD = @GTK3_LIBS@ $(top_builddir)/uim/libuim-custom.la \
+ $(top_builddir)/uim/libuim-scm.la \
+ $(top_builddir)/uim/libuim.la
+if LIBUIM_X_UTIL
+uim_pref_gtk3_LDADD += $(top_builddir)/uim/libuim-x-util.la
+endif
+uim_pref_gtk3_CPPFLAGS = $(helper_defs) -I$(top_srcdir) -I$(top_builddir) \
+ -I../../helper
+uim_pref_gtk3_CFLAGS = @GTK3_CFLAGS@
+endif
+endif
=======================================
--- /trunk/configure.ac Fri Feb 11 19:07:35 2011
+++ /trunk/configure.ac Fri Feb 11 20:09:56 2011
@@ -1862,6 +1862,7 @@
gtk/test/test.sh
gtk3/Makefile
gtk3/pad/Makefile
+ gtk3/pref/Makefile
gtk3/switcher/Makefile
gtk3/toolbar/Makefile
qt/Makefile
=======================================
--- /trunk/gtk/key-util-gtk.c Thu Jan 6 18:09:56 2011
+++ /trunk/gtk/key-util-gtk.c Fri Feb 11 20:09:56 2011
@@ -39,7 +39,11 @@
#include <glib.h>
#include <gtk/gtk.h>
-#include <gdk/gdkkeysyms.h>
+#if GTK_CHECK_VERSION(2, 90, 0)
+# include <gdk/gdkkeysyms-compat.h>
+#else
+# include <gdk/gdkkeysyms.h>
+#endif
#ifdef GDK_WINDOWING_X11
#include <gdk/gdkx.h>
#include <X11/Xlib.h>
=======================================
--- /trunk/gtk3/Makefile.am Fri Feb 11 19:07:35 2011
+++ /trunk/gtk3/Makefile.am Fri Feb 11 20:09:56 2011
@@ -1,2 +1,2 @@
#SUBDIRS = candwin chardict edittest immodule pref toolbar
-SUBDIRS = pad switcher toolbar
+SUBDIRS = pad pref switcher toolbar
=======================================
--- /trunk/helper/pref-gtk-custom-widgets.c Thu Jan 6 18:09:56 2011
+++ /trunk/helper/pref-gtk-custom-widgets.c Fri Feb 11 20:09:56 2011
@@ -602,7 +602,12 @@
default_symbol = custom->value->as_choice->symbol;
while (*item) {
+#if GTK_CHECK_VERSION(2, 24, 0)
+ gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combobox),
+ (*item)->label);
+#else
gtk_combo_box_append_text(GTK_COMBO_BOX(combobox), (*item)->label);
+#endif
if (!strcmp(default_symbol, (*item)->symbol))
default_index = i;
i++;
@@ -638,7 +643,11 @@
label = gtk_label_new(custom->label);
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, TRUE, 0);
+#if GTK_CHECK_VERSION(2, 24, 0)
+ combobox = gtk_combo_box_text_new();
+#else
combobox = gtk_combo_box_new_text();
+#endif
gtk_box_pack_start (GTK_BOX (hbox), combobox, FALSE, TRUE, 0);
g_object_set_data_full(G_OBJECT(combobox),
=======================================
--- /trunk/helper/pref-gtk.c Thu Jan 6 18:09:56 2011
+++ /trunk/helper/pref-gtk.c Fri Feb 11 20:09:56 2011
@@ -34,7 +34,12 @@
#include <config.h>
#include <glib.h>
-#include <gdk/gdkkeysyms.h>
+#include <gtk/gtk.h>
+#if GTK_CHECK_VERSION(2, 90, 0)
+# include <gdk/gdkkeysyms-compat.h>
+#else
+# include <gdk/gdkkeysyms.h>
+#endif
#include <string.h>
#include <stdlib.h>
@@ -612,7 +617,6 @@
textdomain(PACKAGE);
bind_textdomain_codeset(PACKAGE, "UTF-8");
- gtk_set_locale();
gtk_init(&argc, &argv);
if (uim_init() < 0) {
@@ -624,7 +628,7 @@
GtkWidget *pref;
im_uim_init_modifier_keys();
- g_idle_add((GtkFunction) check_dot_uim_file, NULL);
+ g_idle_add((GSourceFunc) check_dot_uim_file, NULL);
pref = create_pref_window();
gtk_widget_show_all(pref);