[uim-commit] r848 - in trunk: . uim xim

ekato at freedesktop.org ekato at freedesktop.org
Mon May 30 19:49:56 PDT 2005


Author: ekato
Date: 2005-05-30 19:49:53 -0700 (Mon, 30 May 2005)
New Revision: 848

Modified:
   trunk/configure.ac
   trunk/uim/context.h
   trunk/xim/convdisp.cpp
   trunk/xim/main.cpp
   trunk/xim/xim.h
   trunk/xim/ximic.cpp
   trunk/xim/ximserver.cpp
   trunk/xim/ximtrans.cpp
Log:
* configure.ac : Fix typo in use_gtk2_4.  Thanks to Mamoru
  KOMACHI.

* uim/context.h : Fix bug #3252 in correct handling of return
  vaule of bind_textdomain_codeset().

* xim/xim.h : Remove unused parameters in definition of
  Connection::xim_disconnect(), Connection::xim_sync_reply(),
  icxatr::set_atr().
* xim/ximtrans.cpp : Remove unused parameter in
  Connection::xim_disconnect(), Connection::xim_sync_reply().
* xim/ximic (icxatr::set_atr) : Remove unused parameter.
  Terminate string appropriately.
* xim/ximserver.cpp (print_ustring) : Fix compiler warning.
* xim/main.cpp (X_ErrorHandler) : Show detailed error message.
(X_IOErrorHandler) : Ditto.
(init_supported_locales) : Fix indentation.
* xim/convdisp.cpp (create_default_fontset) : Remove unused
  parameter.
(choose_default_fontset) : Ditto.
(PeWin::expose) : Fix compiler warning.


Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac	2005-05-25 19:10:48 UTC (rev 847)
+++ trunk/configure.ac	2005-05-31 02:49:53 UTC (rev 848)
@@ -232,7 +232,7 @@
       ;;
       yes|*)
         PKG_CHECK_MODULES(GTK2, gtk+-2.0 >= 2.2.0, use_gtk2="yes",use_gtk2="no")
-        PKG_CHECK_MODULES(GTK2_4, gtk+-2.0 >= 2.4.0, use_gtk2.4="yes",use_gtk2.4="no")
+        PKG_CHECK_MODULES(GTK2_4, gtk+-2.0 >= 2.4.0, use_gtk2_4="yes",use_gtk2_4="no")
       ;;
     esac
   ],

Modified: trunk/uim/context.h
===================================================================
--- trunk/uim/context.h	2005-05-25 19:10:48 UTC (rev 847)
+++ trunk/uim/context.h	2005-05-31 02:49:53 UTC (rev 848)
@@ -122,13 +122,16 @@
 
 #ifdef ENABLE_NLS
 #define UIM_PREPARE_SAVING_TEXTDOMAIN_CODESET() \
-    const char *orig_encoding, *client_encoding;
+    char *enc, *orig_encoding = NULL; \
+    const char *client_encoding;
 #define UIM_SWITCH_TEXTDOMAIN_CODESET(uc) \
-  orig_encoding = bind_textdomain_codeset(GETTEXT_PACKAGE, NULL); \
+  if ((enc = bind_textdomain_codeset(GETTEXT_PACKAGE, NULL))) \
+    orig_encoding = strdup(enc); \
   client_encoding = (uc) ? ((struct uim_context_ *)uc)->encoding : uim_last_client_encoding; \
   bind_textdomain_codeset(GETTEXT_PACKAGE, client_encoding);
 #define UIM_RESTORE_TEXTDOMAIN_CODESET() \
-  bind_textdomain_codeset(GETTEXT_PACKAGE, orig_encoding);
+  bind_textdomain_codeset(GETTEXT_PACKAGE, orig_encoding); \
+  free(orig_encoding);
 #else  /* ENABLE_NLS */
 #define UIM_PREPARE_SAVING_TEXTDOMAIN_CODESET()
 #define UIM_SWITCH_TEXTDOMAIN_CODESET(uc)

Modified: trunk/xim/convdisp.cpp
===================================================================
--- trunk/xim/convdisp.cpp	2005-05-25 19:10:48 UTC (rev 847)
+++ trunk/xim/convdisp.cpp	2005-05-31 02:49:53 UTC (rev 848)
@@ -68,7 +68,7 @@
 
 
 static XFontSet
-create_default_fontset(const char *im_lang, const char *encoding, const char *locale) {
+create_default_fontset(const char *im_lang, const char *locale) {
     char *orig_locale;
     const char *name;
     XFontSet ret;
@@ -99,8 +99,8 @@
 }
 
 static XFontSet
-choose_default_fontset(const char *im_lang, const char *encoding, const char *locale) {
-    return create_default_fontset(im_lang, encoding, locale);
+choose_default_fontset(const char *im_lang, const char *locale) {
+    return create_default_fontset(im_lang, locale);
 }
 
 struct char_ent {
@@ -294,7 +294,7 @@
     add_window_watch(mWin, this, EXPOSE_MASK|STRUCTURE_NOTIFY_MASK);
     mIsMapped = false; //not mapped now
     
-    mFontset = choose_default_fontset(im_lang, encoding, locale);
+    mFontset = choose_default_fontset(im_lang, locale);
     mEncoding = encoding;
     
     XFlush(XimServer::gDpy);
@@ -329,7 +329,7 @@
 
 void PeWin::expose(Window w)
 {
-    XCopyArea(XimServer::gDpy, mPixmap, mWin, mGC,
+    XCopyArea(XimServer::gDpy, mPixmap, w, mGC,
 	      0, 0, mWidth, mHeight, 0, 0);
 
     XFlush(XimServer::gDpy);
@@ -994,7 +994,7 @@
 	m_atr->area.y = 0;
     }
     if (!m_atr->has_atr(ICA_FontSet))
-	m_atr->font_set = choose_default_fontset(mIMLang, mEncoding, mLocaleName);
+	m_atr->font_set = choose_default_fontset(mIMLang, mLocaleName);
     else {
 	if (!m_initial_fontset && !m_lang_changed)
 	    m_initial_fontset = m_atr->font_set;

Modified: trunk/xim/main.cpp
===================================================================
--- trunk/xim/main.cpp	2005-05-25 19:10:48 UTC (rev 847)
+++ trunk/xim/main.cpp	2005-05-31 02:49:53 UTC (rev 848)
@@ -214,8 +214,13 @@
 static int
 X_ErrorHandler(Display *d, XErrorEvent *e)
 {
-    if (g_option_mask & OPT_TRACE)
-	printf("X error occured.\n");
+    if (g_option_mask & OPT_TRACE) {
+	if (e->error_code) {
+	    char buf[64];
+	    XGetErrorText(d, e->error_code, buf, 63);
+	    printf("X error occured. %s\n", buf);
+	}
+    }
 
     return 0;
 }
@@ -223,6 +228,7 @@
 static int
 X_IOErrorHandler(Display *d)
 {
+    fprintf(stderr, "%s: X IO error.\n", DisplayString(d));
     return 0;
 }
 
@@ -409,8 +415,8 @@
     supported_locales = (char *)realloc(supported_locales,
 		    sizeof(char) * len + 1);
     if (!supported_locales) {
-        fprintf(stderr, "Error: failed to register supported_locales. Aborting....");
-        exit(1);
+	fprintf(stderr, "Error: failed to register supported_locales. Aborting....");
+	exit(1);
     }
 
     strcat(supported_locales, locales);

Modified: trunk/xim/xim.h
===================================================================
--- trunk/xim/xim.h	2005-05-25 19:10:48 UTC (rev 847)
+++ trunk/xim/xim.h	2005-05-31 02:49:53 UTC (rev 848)
@@ -135,7 +135,7 @@
     bool mIsCloseWait; // true when the last packet has handled
 private:
     void xim_connect(RxPacket *);
-    void xim_disconnect(RxPacket *);
+    void xim_disconnect();
     void xim_open(RxPacket *);
     void xim_query_extension(RxPacket *);
     void xim_encoding_negotiation(RxPacket *);
@@ -152,7 +152,7 @@
     void xim_reset_ic(RxPacket *);
 
     void xim_forward_event(RxPacket *);
-    void xim_sync_reply(RxPacket *);
+    void xim_sync_reply();
     void xim_preedit_start_reply(RxPacket *);
     void xim_error(RxPacket *);
 
@@ -234,7 +234,7 @@
 public:
     icxatr();
     ~icxatr();
-    void set_atr(int id, C8 *v, int len, int byte_order);
+    void set_atr(int id, C8 *v, int byte_order);
     bool has_atr(int id);
     bool is_changed(int id);
     void unset_change_mask(int id);

Modified: trunk/xim/ximic.cpp
===================================================================
--- trunk/xim/ximic.cpp	2005-05-25 19:10:48 UTC (rev 847)
+++ trunk/xim/ximic.cpp	2005-05-31 02:49:53 UTC (rev 848)
@@ -175,7 +175,7 @@
     return atr_mask & (1 << id);
 }
 
-void icxatr::set_atr(int id, C8 *val, int len, int o)
+void icxatr::set_atr(int id, C8 *val, int o)
 {
     switch (id) {
     case ICA_InputStyle:
@@ -201,7 +201,7 @@
     {
 	int len = readC16(val, o);
 	char *new_fsn = (char *)alloca(len + 1);
-	new_fsn[len] = 0;
+	new_fsn[len] = '\0';
 	memcpy(new_fsn, &val[2], len);
 	if (font_set_name && !strcmp(font_set_name, new_fsn))
 	    break;
@@ -551,7 +551,7 @@
     if (id == ICA_PreeditAttribute || id == ICA_StatusAttributes)
 	setICAttrs(val, len); // list of attribute
     else
-	m_xatr.set_atr(id, val, len, mConn->byte_order());
+	m_xatr.set_atr(id, val, mConn->byte_order());
 
     if (mConvdisp)
 	mConvdisp->update_icxatr();

Modified: trunk/xim/ximserver.cpp
===================================================================
--- trunk/xim/ximserver.cpp	2005-05-25 19:10:48 UTC (rev 847)
+++ trunk/xim/ximserver.cpp	2005-05-31 02:49:53 UTC (rev 848)
@@ -75,7 +75,7 @@
 void print_ustring(uString *s)
 {
     uString::iterator i;
-    printf("length=%d : ", s->size());
+    printf("length=%d : ", (int)s->size());
     uchar ch;
     char utf8[6];
     int nbyte;

Modified: trunk/xim/ximtrans.cpp
===================================================================
--- trunk/xim/ximtrans.cpp	2005-05-25 19:10:48 UTC (rev 847)
+++ trunk/xim/ximtrans.cpp	2005-05-31 02:49:53 UTC (rev 848)
@@ -267,7 +267,7 @@
 	    xim_close(p);
 	    break;
 	case XIM_DISCONNECT:
-	    xim_disconnect(p);
+	    xim_disconnect();
 	    break;
 	case XIM_GET_IM_VALUES:
 	    xim_get_im_values(p);
@@ -297,7 +297,7 @@
 	    xim_forward_event(p);
 	    break;
 	case XIM_SYNC_REPLY:
-	    xim_sync_reply(p);
+	    xim_sync_reply();
 	    break;
 	case XIM_RESET_IC:
 	    xim_reset_ic(p);
@@ -463,7 +463,7 @@
 	printf("accept xim connection.\n");
 }
 
-void Connection::xim_disconnect(RxPacket *p)
+void Connection::xim_disconnect()
 {
     TxPacket *t;
     t = createTxPacket(XIM_DISCONNECT_REPLY, 0);
@@ -715,7 +715,7 @@
 	im->forward_event(p);
 }
 
-void Connection::xim_sync_reply(RxPacket *p)
+void Connection::xim_sync_reply()
 {
     if (hasSyncFlag()) {
 	unsetSyncFlag();



More information about the uim-commit mailing list