Revision: 6942
Author: nogu.dev
Date: Sat Feb 12 04:49:42 2011
Log: * configure.ac
- (AC_CONFIG_FILES): Add gtk3/immodule/Makefile.
* gtk/gtk-im-uim.c
- (layout_candwin): Follow change of gdk_window_get_geometry() in GTK+3.
- (handle_key_on_toplevel):
Comment out codes where need_im_reset is set directly in GTK+3.
* gtk/uim-cand-win-gtk.c
- (uim_cand_win_gtk_create_sub_window):
Follow change of gdk_window_get_geometry() in GTK+3.
* gtk3/Makefile.am
- (SUBDIRS): Add immodule.
* gtk3/immodule/Makefile.am
- New file.
http://code.google.com/p/uim/source/detail?r=6942
Added:
/trunk/gtk3/immodule
/trunk/gtk3/immodule/Makefile.am
Modified:
/trunk/configure.ac
/trunk/gtk/gtk-im-uim.c
/trunk/gtk/uim-cand-win-gtk.c
/trunk/gtk3/Makefile.am
=======================================
--- /dev/null
+++ /trunk/gtk3/immodule/Makefile.am Sat Feb 12 04:49:42 2011
@@ -0,0 +1,88 @@
+uim_gtk3_im_module_path = $(libdir)/gtk-3.0
+uim_gtk3_im_module_file = $(DESTDIR)$(sysconfdir)/gtk-3.0/gtk.immodules
+
+moduledir = $(uim_gtk3_im_module_path)/@GTK_BINARY_VERSION@/immodules
+
+if GTK3
+im_uim_la = im-uim.la
+im_uim_la_CPPFLAGS = -I$(top_srcdir) -I$(top_builddir)
+im_uim_la_CFLAGS = @GTK3_CFLAGS@
+module_LTLIBRARIES = $(im_uim_la)
+
+
+im_uim_la_SOURCES = $(IM_UIM_SOURCES)
+im_uim_la_LDFLAGS = -module -avoid-version @GTK3_LIBS@
+im_uim_la_LIBADD = $(top_builddir)/uim/libuim-scm.la \
+ $(top_builddir)/uim/libuim.la
+if LIBUIM_X_UTIL
+im_uim_la_LIBADD += $(top_builddir)/uim/libuim-x-util.la
+endif
+
+
+IM_UIM_SOURCES = \
+ ../../gtk/gtk-im-uim.c ../../gtk/gtk-im-uim.h \
+ ../../gtk/key-util-gtk.c ../../gtk/key-util-gtk.h \
+ ../../gtk/uim-cand-win-gtk.c ../../gtk/uim-cand-win-gtk.h \
+ ../../gtk/uim-cand-win-tbl-gtk.c ../../gtk/uim-cand-win-tbl-gtk.h \
+ ../../gtk/caret-state-indicator.c ../../gtk/caret-state-indicator.h \
+ ../../gtk/compose.c ../../gtk/compose.h \
+ ../../gtk/text-util.c ../../gtk/text-util.h
+
+noinst_PROGRAMS = gtk3-rc-get-immodule-file
+gtk3_rc_get_immodule_file_SOURCES = ../../gtk/gtk-rc-get-immodule-file.c
+gtk3_rc_get_immodule_file_CFLAGS = @GTK3_CFLAGS@
+gtk3_rc_get_immodule_file_LDADD = @GTK3_LIBS@
+GTK3_RC_GET_IMMODULE_FILE =
$(top_builddir)/gtk3/immodule/gtk3-rc-get-immodule-file
+QUERY_COMMAND = gtk-query-immodules-3.0
+
+install-data-hook: gtk3-rc-get-immodule-file
+ if test -z $(DESTDIR); then \
+ if test $(libdir) = $(GTK3_LIBDIR); then \
+ if type $(QUERY_COMMAND) > /dev/null 2>&1; then \
+ $(QUERY_COMMAND) > `$(GTK3_RC_GET_IMMODULE_FILE)`; \
+ echo "*** \"`$(GTK3_RC_GET_IMMODULE_FILE)`\" is updated. ***"; \
+ else \
+ echo "********************** Warning ***********************"; \
+ echo " $(QUERY_COMMAND) not found"; \
+ echo " Please make sure to update"; \
+ echo " \"`$(GTK3_RC_GET_IMMODULE_FILE)`\""; \
+ echo " manually."; \
+ echo "******************************************************"; \
+ fi \
+ else \
+ if type $(QUERY_COMMAND) > /dev/null 2>&1; then \
+ $(mkinstalldirs) $(sysconfdir)/gtk-3.0; \
+ GTK3_PATH=$(uim_gtk3_im_module_path) $(QUERY_COMMAND) >
$(uim_gtk3_im_module_file); \
+ echo "******************************************************"; \
+ echo " You need to set"; \
+ echo " GTK3_IM_MODULE_FILE=$(uim_gtk3_im_module_file)"; \
+ echo " environment variable to use this module."; \
+ echo "******************************************************"; \
+ else \
+ echo "********************** Warning ***********************"; \
+ echo " $(QUERY_COMMAND) not found"; \
+ echo " Please make sure to update"; \
+ echo " \"$(uim_gtk3_im_module_file)\""; \
+ echo " manually, and set"; \
+ echo " GTK3_IM_MODULE_FILE=$(uim_gtk3_im_module_file)"; \
+ echo " environment variable to use this module."; \
+ echo "******************************************************"; \
+ fi \
+ fi \
+ fi
+uninstall-hook:
+ if test -z $(DESTDIR); then \
+ if type $(QUERY_COMMAND) > /dev/null 2>&1; then \
+ if test $(libdir) = $(GTK3_LIBDIR); then \
+ $(QUERY_COMMAND) > `$(GTK3_RC_GET_IMMODULE_FILE)`; \
+ else \
+ GTK3_PATH=$(uim_gtk3_im_module_path) $(QUERY_COMMAND) >
$(uim_gtk3_im_module_file); \
+ fi \
+ fi \
+ fi
+else
+install-data-hook:
+
+uninstall-hook:
+
+endif
=======================================
--- /trunk/configure.ac Sat Feb 12 03:32:23 2011
+++ /trunk/configure.ac Sat Feb 12 04:49:42 2011
@@ -1863,6 +1863,7 @@
gtk3/Makefile
gtk3/candwin/Makefile
gtk3/dict/Makefile
+ gtk3/immodule/Makefile
gtk3/pad/Makefile
gtk3/pref/Makefile
gtk3/switcher/Makefile
=======================================
--- /trunk/gtk/gtk-im-uim.c Thu Jan 6 18:09:56 2011
+++ /trunk/gtk/gtk-im-uim.c Sat Feb 12 04:49:42 2011
@@ -487,12 +487,20 @@
static void
layout_candwin(IMUIMContext *uic)
{
+#if GTK_CHECK_VERSION(2, 90, 0)
+ gint x, y, width, height;
+#else
gint x, y, width, height, depth;
+#endif
g_return_if_fail(uic);
if (uic->win && uic->cwin) {
+#if GTK_CHECK_VERSION(2, 90, 0)
+ gdk_window_get_geometry(uic->win, &x, &y, &width, &height);
+#else
gdk_window_get_geometry(uic->win, &x, &y, &width, &height, &depth);
+#endif
gdk_window_get_origin(uic->win, &x, &y);
uim_cand_win_gtk_layout(uic->cwin, x, y, width, height);
}
@@ -1628,14 +1636,16 @@
if (rv)
return FALSE;
+#if !GTK_CHECK_VERSION(2, 90, 0)
/* FIXME: Can't compile with GSEAL_ENABLE */
if (GTK_IS_TEXT_VIEW(uic->widget))
GTK_TEXT_VIEW(uic->widget)->need_im_reset = TRUE;
else if (GTK_IS_ENTRY(uic->widget)) {
- /* FIXME: Can't compile with GSEAL_ENABLE */
+ /* FIXME: Can't compile with GSEAL_ENABLE */
if (gtk_editable_get_editable(GTK_EDITABLE(uic->widget)))
- GTK_ENTRY(uic->widget)->need_im_reset = TRUE;
- }
+ GTK_ENTRY(uic->widget)->need_im_reset = TRUE;
+ }
+#endif
return TRUE;
}
=======================================
--- /trunk/gtk/uim-cand-win-gtk.c Thu Jan 6 18:09:56 2011
+++ /trunk/gtk/uim-cand-win-gtk.c Sat Feb 12 04:49:42 2011
@@ -914,7 +914,11 @@
static void
uim_cand_win_gtk_layout_sub_window(UIMCandWinGtk *cwin)
{
+#if GTK_CHECK_VERSION(2, 90, 0)
+ gint x, y, w, h, sw, sh, x2, y2, w2, h2;
+#else
gint x, y, w, h, d, sw, sh, x2, y2, w2, h2, d2;
+#endif
GdkRectangle rect;
GtkTreePath *path;
GtkTreeViewColumn *focus_column;
@@ -926,14 +930,24 @@
gtk_tree_view_get_cell_area(GTK_TREE_VIEW(cwin->view), path, NULL,
&rect);
gtk_tree_path_free(path);
+#if GTK_CHECK_VERSION(2, 90, 0)
+ gdk_window_get_geometry(gtk_widget_get_window(GTK_WIDGET(cwin)),
+ &x, &y, &w, &h);
+#else
gdk_window_get_geometry(gtk_widget_get_window(GTK_WIDGET(cwin)),
&x, &y, &w, &h, &d);
+#endif
gdk_window_get_origin(gtk_widget_get_window(GTK_WIDGET(cwin)), &x, &y);
sw = gdk_screen_get_width (gdk_screen_get_default ());
sh = gdk_screen_get_height (gdk_screen_get_default ());
+#if GTK_CHECK_VERSION(2, 90, 0)
+ gdk_window_get_geometry(gtk_widget_get_window(cwin->sub_window.window),
+ &x2, &y2, &w2, &h2);
+#else
gdk_window_get_geometry(gtk_widget_get_window(cwin->sub_window.window),
&x2, &y2, &w2, &h2, &d2);
+#endif
if (x + w + w2 > sw)
x = x - w2;
else
=======================================
--- /trunk/gtk3/Makefile.am Sat Feb 12 03:32:23 2011
+++ /trunk/gtk3/Makefile.am Sat Feb 12 04:49:42 2011
@@ -1,1 +1,1 @@
-SUBDIRS = candwin dict pad pref switcher test toolbar
+SUBDIRS = candwin dict immodule pad pref switcher test toolbar