[789] in BarnOwl Developers

home help back first fref pref prev next nref lref last post

[D-O-H] r793 - branches/barnowl_unicode/owl

daemon@ATHENA.MIT.EDU (asedeno@MIT.EDU)
Thu Oct 29 18:09:44 2009

Resent-From: nelhage@mit.edu
Resent-To: barnowl-dev-mtg@charon.mit.edu
To: dirty-owl-hackers@mit.edu
From: asedeno@MIT.EDU
Reply-to: dirty-owl-hackers@MIT.EDU
Date: Wed,  2 Jan 2008 13:56:34 -0500 (EST)

Author: asedeno
Date: 2008-01-02 13:56:33 -0500 (Wed, 02 Jan 2008)
New Revision: 793

Added:
   branches/barnowl_unicode/owl/glib_compat.c
Modified:
   branches/barnowl_unicode/owl/Makefile.in
   branches/barnowl_unicode/owl/owl.c
Log:
unicode / glib branch
* set min glib version to 2.12.0
 - first to support Unicode 5.0

* added glib_compat.c with our own implementation of
  g_unicode_ismark() for glib < 2.14



Modified: branches/barnowl_unicode/owl/Makefile.in
===================================================================
--- branches/barnowl_unicode/owl/Makefile.in	2008-01-02 07:42:05 UTC (rev 792)
+++ branches/barnowl_unicode/owl/Makefile.in	2008-01-02 18:56:33 UTC (rev 793)
@@ -25,7 +25,7 @@
      regex.c history.c view.c dict.c variable.c filterelement.c pair.c \
      keypress.c keymap.c keybinding.c cmd.c context.c zcrypt.c \
      aim.c buddy.c buddylist.c timer.c style.c stylefunc.c errqueue.c \
-     zbuddylist.c muxevents.c popexec.c obarray.c wcwidth.c
+     zbuddylist.c muxevents.c popexec.c obarray.c wcwidth.c glib_compat.c
 OWL_SRC = owl.c
 TESTER_SRC = tester.c
 

Added: branches/barnowl_unicode/owl/glib_compat.c
===================================================================
--- branches/barnowl_unicode/owl/glib_compat.c	                        (rev 0)
+++ branches/barnowl_unicode/owl/glib_compat.c	2008-01-02 18:56:33 UTC (rev 793)
@@ -0,0 +1,18 @@
+#include <owl.h>
+
+#if (GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION < 14)
+/* Our own implementation of g_unichar_is_mark for glib versions that
+   are too old to have one. */
+int g_unichar_ismark(gunichar ucs)
+{
+  GUnicodeType t = g_unichar_type(ucs);
+  switch (t) {
+  case G_UNICODE_NON_SPACING_MARK:
+  case G_UNICODE_COMBINING_MARK:
+  case G_UNICODE_ENCLOSING_MARK:
+       return 1;
+  default:
+       return 0;
+  }
+}
+#endif

Modified: branches/barnowl_unicode/owl/owl.c
===================================================================
--- branches/barnowl_unicode/owl/owl.c	2008-01-02 07:42:05 UTC (rev 792)
+++ branches/barnowl_unicode/owl/owl.c	2008-01-02 18:56:33 UTC (rev 793)
@@ -85,6 +85,9 @@
 #if OWL_STDERR_REDIR
   int newstderr;
 #endif
+  
+  if (!GLIB_CHECK_VERSION (2, 12, 0))
+    g_error ("GLib version 2.12.0 or above is needed.");
 
   argcsave=argc;
   argvsave=argv;


home help back first fref pref prev next nref lref last post