[uim-commit] r1137 - in trunk: helper xim

ekato at freedesktop.org ekato at freedesktop.org
Sat Aug 6 18:24:13 EST 2005


Author: ekato
Date: 2005-08-06 01:24:10 -0700 (Sat, 06 Aug 2005)
New Revision: 1137

Modified:
   trunk/helper/helper-candwin-gtk.c
   trunk/xim/canddisp.cpp
   trunk/xim/canddisp.h
   trunk/xim/convdisp.cpp
   trunk/xim/ximserver.cpp
Log:
* helper/helper-candwin-gtk.c (caret_state_hide) : New.
(str_parse) : Handle "hide_caret_state" message.
* xim/ximserver.cpp (XimServer::customContext) : Check
  "bridge-show-input-state?".
* xim/convdisp.cpp (ConvdispOv::update_icxatr) : Ditto.
* xim/canddisp.cpp (Canddisp::hide_caret_state) : New.
* xim/canddisp.h (class Canddisp) : Add hide_caret_state().


Modified: trunk/helper/helper-candwin-gtk.c
===================================================================
--- trunk/helper/helper-candwin-gtk.c	2005-08-06 06:54:49 UTC (rev 1136)
+++ trunk/helper/helper-candwin-gtk.c	2005-08-06 08:24:10 UTC (rev 1137)
@@ -531,6 +531,12 @@
   caret_state_indicator_update(cwin->caret_state_indicator, cwin->pos_x, cwin->pos_y, NULL);
 }
 
+static void
+caret_state_hide()
+{
+  gtk_widget_hide(cwin->caret_state_indicator);
+}
+
 static void str_parse(gchar *str)
 {
   gchar **tmp;
@@ -556,6 +562,8 @@
       caret_state_show(tmp);
     } else if (strcmp("update_caret_state", command) == 0) {
       caret_state_update();
+    } else if (strcmp("hide_caret_state", command) == 0) {
+      caret_state_hide();
     }
   }
   g_strfreev(tmp);

Modified: trunk/xim/canddisp.cpp
===================================================================
--- trunk/xim/canddisp.cpp	2005-08-06 06:54:49 UTC (rev 1136)
+++ trunk/xim/canddisp.cpp	2005-08-06 08:24:10 UTC (rev 1137)
@@ -199,6 +199,15 @@
     check_connection();
 }
 
+void Canddisp::hide_caret_state()
+{
+    if (!candwin_w)
+	return;
+    fprintf(candwin_w, "hide_caret_state\n\n");
+    fflush(candwin_w);
+    check_connection();
+}
+
 void Canddisp::check_connection()
 {
     if (errno == EBADF || errno == EPIPE) {

Modified: trunk/xim/canddisp.h
===================================================================
--- trunk/xim/canddisp.h	2005-08-06 06:54:49 UTC (rev 1136)
+++ trunk/xim/canddisp.h	2005-08-06 08:24:10 UTC (rev 1137)
@@ -48,6 +48,7 @@
     void move(int x, int y);
     void show_caret_state(const char *str, int timeout);
     void update_caret_state();
+    void hide_caret_state();
 private:
     void check_connection();
 };

Modified: trunk/xim/convdisp.cpp
===================================================================
--- trunk/xim/convdisp.cpp	2005-08-06 06:54:49 UTC (rev 1136)
+++ trunk/xim/convdisp.cpp	2005-08-06 08:24:10 UTC (rev 1137)
@@ -1135,7 +1135,9 @@
 {
 
     if (m_atr->is_changed(ICA_SpotLocation)) {
-	update_caret_state();
+	uim_bool  show_caret_state = uim_scm_symbol_value_bool("bridge-show-input-state?");
+	if (show_caret_state == UIM_TRUE)
+	    update_caret_state();
 	m_atr->unset_change_mask(ICA_SpotLocation);
     }
 

Modified: trunk/xim/ximserver.cpp
===================================================================
--- trunk/xim/ximserver.cpp	2005-08-06 06:54:49 UTC (rev 1136)
+++ trunk/xim/ximserver.cpp	2005-08-06 08:24:10 UTC (rev 1137)
@@ -153,6 +153,13 @@
     if (!strcmp(custom, "uim-xim-xft-font-name"))
 	update_default_xftfont();
 #endif
+
+    if (!strcmp(custom, "bridge-show-input-state?") &&
+		    !uim_scm_symbol_value_bool("bridge-show-input-state?")) {
+	    Canddisp *disp = canddisp_singleton();
+	    disp->hide_caret_state();
+    }
+
 }
 
 bool



More information about the uim-commit mailing list