[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

rpms/iiimf/devel iiimgcf-deadkey.patch, NONE, 1.1 iiimf.spec, 1.65, 1.66



Author: tagoh

Update of /cvs/dist/rpms/iiimf/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv12496

Modified Files:
	iiimf.spec 
Added Files:
	iiimgcf-deadkey.patch 
Log Message:
* Fri Jul 22 2005 Akira TAGOH <tagoh redhat com> - 1:12.2-9
- iiimgcf-deadkey.patch: applied to get the dead key working. (#130851)

iiimgcf-deadkey.patch:
 gtkimcontextiiim.c |   56 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
 gtkimcontextiiim.h |    1 
 2 files changed, 56 insertions(+), 1 deletion(-)

--- NEW FILE iiimgcf-deadkey.patch ---
diff -ruN -x .libs -x .deps -x '*~' -x '*o' -x '*a' -x Makefile iiimf-12.2.orig/iiimgcf/gtkimcontextiiim.c iiimf-12.2/iiimgcf/gtkimcontextiiim.c
--- iiimf-12.2.orig/iiimgcf/gtkimcontextiiim.c	2005-07-21 12:12:31.000000000 +0900
+++ iiimf-12.2/iiimgcf/gtkimcontextiiim.c	2005-07-22 17:05:03.000000000 +0900
@@ -29,6 +29,7 @@
 #include <gtk/gtk.h>
 #include <gtk/gtkimmodule.h>
 #include <gtk/gtkinvisible.h>
+#include <gtk/gtkimcontextsimple.h>
 #include <gdk/gdkproperty.h>
 #include <gdk/gdkselection.h>
 #include <stdlib.h>
@@ -46,6 +47,28 @@
 #define DEBUG_DO(x)
 #endif
 
+#define _IS_DEAD_KEY(keyval,sym)	((keyval) == GDK_dead_ ## sym)
+#define IS_DEAD_KEY(keyval)			\
+  (_IS_DEAD_KEY(keyval, grave) ||		\
+   _IS_DEAD_KEY(keyval, acute) ||		\
+   _IS_DEAD_KEY(keyval, circumflex) ||		\
+   _IS_DEAD_KEY(keyval, tilde) ||		\
+   _IS_DEAD_KEY(keyval, macron) ||		\
+   _IS_DEAD_KEY(keyval, breve) ||		\
+   _IS_DEAD_KEY(keyval, abovedot) ||		\
+   _IS_DEAD_KEY(keyval, diaeresis) ||		\
+   _IS_DEAD_KEY(keyval, abovering) ||		\
+   _IS_DEAD_KEY(keyval, doubleacute) ||		\
+   _IS_DEAD_KEY(keyval, caron) ||		\
+   _IS_DEAD_KEY(keyval, cedilla) ||		\
+   _IS_DEAD_KEY(keyval, ogonek) ||		\
+   _IS_DEAD_KEY(keyval, iota) ||		\
+   _IS_DEAD_KEY(keyval, voiced_sound) ||	\
+   _IS_DEAD_KEY(keyval, semivoiced_sound) ||	\
+   _IS_DEAD_KEY(keyval, belowdot) ||		\
+   _IS_DEAD_KEY(keyval, hook) ||		\
+   _IS_DEAD_KEY(keyval, horn))
+
 typedef struct _CandidateWindow CandidateWindow;
 
 /* Style for gtk input method preedit/status */
@@ -1530,6 +1553,16 @@
 }
 
 static void
+im_context_iiim_commit_cb(GtkIMContext *context,
+			  const gchar  *string,
+			  GtkIMContextIIIM *context_iiim)
+{
+  g_return_if_fail(string != NULL);
+
+  g_signal_emit_by_name(context_iiim, "commit", string);
+}
+
+static void
 im_context_iiim_init (GtkIMContextIIIM * im_context_iiim)
 {
   im_context_iiim->context = NULL;
@@ -1541,6 +1574,11 @@
   im_context_iiim->has_focus = FALSE;
   im_context_iiim->in_toplevel = FALSE;
 
+  /* for the dead key */
+  im_context_iiim->slave = g_object_new(GTK_TYPE_IM_CONTEXT_SIMPLE, NULL);
+  g_signal_connect(G_OBJECT(im_context_iiim->slave), "commit",
+		   G_CALLBACK(im_context_iiim_commit_cb), im_context_iiim);
+
   memset(&im_context_iiim->saved_key, 0, sizeof(im_context_iiim->saved_key));
 
   bindtextdomain (GETTEXT_PACKAGE, IIIMGCFLOCALEDIR);
@@ -1690,10 +1728,11 @@
   IIIMCF_keyevent kev;
   IIIMCF_event ev;
   gint store_key = 0;
+  static gboolean was_dead_key = FALSE;
 
   /* IIIMF doesn't recognize */
   if (event->type == GDK_KEY_RELEASE)
-    return FALSE;
+    return gtk_im_context_filter_keypress(context_iiim->slave, event);
 
   if (current_setting_enabled &&
       current_setting.im_enabled == IM_OFF)
@@ -1745,6 +1784,15 @@
     return FALSE;
 
  commit_this_event:
+  if (IS_DEAD_KEY(event->keyval)) {
+    /* don't send the dead key with the commit event! */
+    was_dead_key = TRUE;
+    return gtk_im_context_filter_keypress(context_iiim->slave, event);
+  } else if (was_dead_key == TRUE) {
+    was_dead_key = FALSE;
+    return gtk_im_context_filter_keypress(context_iiim->slave, event);
+  }
+  was_dead_key = FALSE;
   if (event->state &
       (gtk_accelerator_get_default_mod_mask () & ~GDK_SHIFT_MASK))
     return FALSE;
@@ -1828,8 +1876,14 @@
   g_free (context_iiim->current_language);
 
   iiim_keylist_free (context_iiim);
+
+  g_signal_handlers_disconnect_by_func(context_iiim->slave,
+				       (gpointer)im_context_iiim_commit_cb,
+				       context_iiim);
+
   DEBUG_DO (g_message ("im_context_iiim_finalize"));
 
+  G_OBJECT_CLASS(parent_class)->finalize(obj);
 }
 
 static void
diff -ruN -x .libs -x .deps -x '*~' -x '*o' -x '*a' -x Makefile iiimf-12.2.orig/iiimgcf/gtkimcontextiiim.h iiimf-12.2/iiimgcf/gtkimcontextiiim.h
--- iiimf-12.2.orig/iiimgcf/gtkimcontextiiim.h	2005-07-21 12:12:31.000000000 +0900
+++ iiimf-12.2/iiimgcf/gtkimcontextiiim.h	2005-07-22 16:45:40.000000000 +0900
@@ -66,6 +66,7 @@
 struct _GtkIMContextIIIM
 {
   GtkIMContext object;
+  GtkIMContext *slave;
 
   GtkIIIMInfo *iiim_info;
   GdkWindow *client_window;


Index: iiimf.spec
===================================================================
RCS file: /cvs/dist/rpms/iiimf/devel/iiimf.spec,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -r1.65 -r1.66
--- iiimf.spec	22 Jul 2005 03:21:58 -0000	1.65
+++ iiimf.spec	22 Jul 2005 08:43:55 -0000	1.66
@@ -36,7 +36,7 @@
 Version: 12.2
 ## for builds suffixed with the svn release please only increment the leading release number when updating
 # append .svn%{revision} for snapshots
-Release: 8
+Release: 9
 License: Distributable
 Source: %{name}-src-%{srclabel}.tar.bz2
 Source2: iiimd-init.d
@@ -80,6 +80,7 @@
 Patch301: iiimgcf-event-status-done.patch
 Patch302: iiimgcf-fix-memory-leak-r2660.patch
 Patch303: iiimgcf-fix-hang-r2757.patch
+Patch304: iiimgcf-deadkey.patch
 ### RH-specific (+50~)
 Patch350: iiimgcf-revert-to-r2562-for-slowness-workaround.patch
 
@@ -425,6 +426,7 @@
 %patch301 -p1 -b .301-status_end
 %patch302 -p0 -b .302-memleak
 %patch303 -p0 -b .303-fix-hang
+%patch304 -p1 -b .304-deadkey
 ### RH-specific (+50~)
 %patch350 -p0 -R -b .350-revert-to-r2562
 ## IIIMJCF patches (400-)
@@ -1017,6 +1019,9 @@
 %endif
 
 %changelog
+* Fri Jul 22 2005 Akira TAGOH <tagoh redhat com> - 1:12.2-9
+- iiimgcf-deadkey.patch: applied to get the dead key working. (#130851)
+
 * Thu Jul 21 2005 Akira TAGOH <tagoh redhat com>
 - xiiimp-pango.patch: updated.
   - fixed to spot the correct location for the lookup window at the OverTheSpot.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]