diff options
author | 2006-02-17 14:36:44 +0000 | |
---|---|---|
committer | 2006-02-17 14:36:44 +0000 | |
commit | d1a42183d2a901d98c0c7d66de6ac3c1b3ba3b37 (patch) | |
tree | f48e5d93ee7db698a6da7af3838ff8c35a0ca86f /x11-wm/sawfish/files | |
parent | Added built_with_use check on cdinstall for quake3-data for bug #123148. (diff) | |
download | gentoo-2-d1a42183d2a901d98c0c7d66de6ac3c1b3ba3b37.tar.gz gentoo-2-d1a42183d2a901d98c0c7d66de6ac3c1b3ba3b37.tar.bz2 gentoo-2-d1a42183d2a901d98c0c7d66de6ac3c1b3ba3b37.zip |
Add patch for utf8 rendering with xft #121722
(Portage version: 2.1_pre4-r1)
Diffstat (limited to 'x11-wm/sawfish/files')
-rw-r--r-- | x11-wm/sawfish/files/digest-sawfish-1.3.20050816-r1 | 3 | ||||
-rw-r--r-- | x11-wm/sawfish/files/sawfish-xft-menu-utf8.patch | 243 |
2 files changed, 246 insertions, 0 deletions
diff --git a/x11-wm/sawfish/files/digest-sawfish-1.3.20050816-r1 b/x11-wm/sawfish/files/digest-sawfish-1.3.20050816-r1 new file mode 100644 index 000000000000..ace9f6842fec --- /dev/null +++ b/x11-wm/sawfish/files/digest-sawfish-1.3.20050816-r1 @@ -0,0 +1,3 @@ +MD5 ce418e61e0388e9ab45b06cd68a966df sawfish-1.3.20050816.tar.bz2 1145082 +RMD160 e15e222baa1f1f52f085f4658abc3d8a37d6c8e8 sawfish-1.3.20050816.tar.bz2 1145082 +SHA256 2b4954f1605e985dba5d71fafd57c4d2914bd7e0b19941c3b937915772fc98f3 sawfish-1.3.20050816.tar.bz2 1145082 diff --git a/x11-wm/sawfish/files/sawfish-xft-menu-utf8.patch b/x11-wm/sawfish/files/sawfish-xft-menu-utf8.patch new file mode 100644 index 000000000000..b7afb0d13f18 --- /dev/null +++ b/x11-wm/sawfish/files/sawfish-xft-menu-utf8.patch @@ -0,0 +1,243 @@ +--- config.h.in 2006-02-05 21:42:27.000000000 -0500 ++++ config.h.in 2006-02-05 21:48:46.000000000 -0500 +@@ -151,4 +151,7 @@ + #undef HAVE_PANGO_X + #undef HAVE_PANGO_XFT + ++/* Define if you have glib */ ++#undef HAVE_GLIB ++ + #endif /* SAWMILL_CONFIG_H */ +--- configure.in 2006-02-05 21:42:27.000000000 -0500 ++++ configure.in 2006-02-05 21:48:46.000000000 -0500 +@@ -127,7 +127,14 @@ + + CPPFLAGS="${_cppflags}" + +-dnl Checks for pango ++dnl Checks for pango. Disabled by default ++ ++AC_ARG_WITH(pango, ++ [ --with-pango Enable pango font rendering engine ++ --without-pango], [], ++ [with_pango=no]) ++ ++if test "${with_pango}" = "yes"; then + PKG_CHECK_MODULES(PANGO, pango >= 1.2.0, + [if $PKG_CONFIG --exists pangoxft; then + AC_DEFINE(HAVE_PANGO_XFT, 1) +@@ -142,6 +149,7 @@ + PANGO_LIBS=`$PKG_CONFIG --libs $PANGO_MODULES` + PANGO_CFLAGS=`$PKG_CONFIG --cflags $PANGO_MODULES` + fi], [: nothing]) ++fi + + dnl Check for librep + AM_PATH_REP(0.14) +@@ -247,6 +255,17 @@ + AC_DEFINE(HAVE_ESD) + fi + ++AC_ARG_WITH(glib, ++ [ --with-glib Use glib for locale -> utf8 ++ --without-glib], [], [with_glib=yes]) ++ ++if test "$with_glib" = "yes"; then ++ PKG_CHECK_MODULES(GLIB, glib-2.0 > 2.0) ++ AC_SUBST(GLIB_LIBS) ++ AC_SUBST(GLIB_CFLAGS) ++ AC_DEFINE(HAVE_GLIB) ++fi ++ + AC_ARG_ENABLE(capplet, + [ --enable-capplet Build the sawfish GNOME capplet [default] + --disable-capplet Don't built the capplet], [], +--- lisp/sawfish/wm/ext/beos-window-menu.jl 2006-02-05 21:42:27.000000000 -0500 ++++ lisp/sawfish/wm/ext/beos-window-menu.jl 2006-02-05 21:49:07.000000000 -0500 +@@ -25,6 +25,7 @@ + (export beos-window-menu) + + (open rep ++ rep.regexp + sawfish.wm.windows + sawfish.wm.misc + sawfish.wm.custom +@@ -38,9 +39,16 @@ + + (define (abbreviate name #!optional len) + (unless len (setq len 20)) +- (if (> (length name) len) +- (concat (substring name 0 len) "...") +- name)) ++ (setq name (locale-to-utf8 name)) ++ (let ((namelen (length name))) ++ (let loop ((idx len)) ++ (cond ((>= idx namelen) ++ name) ++ ((string-match "[\200-\277]" (substring name idx (1+ idx))) ++ ;; move to utf-8 mbchar boundary ++ (loop (1+ idx))) ++ (t ++ (concat (substring name 0 idx) "...")))))) + + (define (make-label w) + (let ((name (window-name w)) +--- src/fonts.c 2006-02-05 21:42:27.000000000 -0500 ++++ src/fonts.c 2006-02-05 21:49:22.000000000 -0500 +@@ -42,14 +42,18 @@ + #include <X11/Xlocale.h> + #include <ctype.h> + ++#ifdef HAVE_GLIB ++# include<glib.h> ++#endif ++ + #ifdef HAVE_X11_XFT_XFT_H + # include <X11/Xft/Xft.h> + #else + # undef HAVE_PANGO + #endif + ++ + #ifdef HAVE_PANGO +-# include <glib.h> + # define PANGO_ENABLE_BACKEND + # include <pango/pango.h> + # undef PANGO_ENABLE_BACKEND +@@ -364,9 +368,22 @@ + xft_measure (Lisp_Font *f, u_char *string, size_t length) + { + XGlyphInfo info; +- +- XftTextExtents8 (dpy, f->font, string, length, &info); +- ++#ifdef HAVE_GLIB ++ gsize r, w; ++ u_char *utf8str; ++ utf8str = g_locale_to_utf8 (string, length, &r, &w, NULL); ++ if (utf8str != NULL){ ++ string = utf8str; ++ length = w; ++ } ++ ++ XftTextExtentsUtf8 (dpy, f->font, string, length, &info); ++ ++ g_free(utf8str); ++#else ++ XftTextExtents8 (dpy, f->font, string, length, &info); ++#endif ++ + return info.xOff; + } + +@@ -375,6 +392,10 @@ + Window id, GC gc, Lisp_Color *fg, int x, int y) + { + static XftDraw *draw; ++#ifdef HAVE_GLIB ++ gsize r, w; ++ u_char *utf8str; ++#endif + + XftColor xft_color; + +@@ -389,8 +410,21 @@ + xft_color.color.blue = fg->blue; + xft_color.color.alpha = fg->alpha; + ++#ifdef HAVE_GLIB ++ utf8str = g_locale_to_utf8 (string, length, &r, &w, NULL); ++ if (utf8str != NULL){ ++ string = utf8str; ++ length = w; ++ } ++ ++ XftDrawStringUtf8 (draw, &xft_color, f->font, ++ x, y, string, length); ++ g_free(utf8str); ++#else + XftDrawString8 (draw, &xft_color, f->font, + x, y, string, length); ++#endif ++ + } + + static const Lisp_Font_Class xft_class = { +--- src/functions.c 2006-02-05 21:42:27.000000000 -0500 ++++ src/functions.c 2006-02-05 21:49:27.000000000 -0500 +@@ -43,7 +43,9 @@ + #include "sawmill.h" + #include <string.h> + #include <X11/Xatom.h> +- ++#ifdef HAVE_GLIB ++#include <glib.h> ++#endif + /* Number of outstanding server grabs made; only when this is zero is + the server ungrabbed. */ + static int server_grabs; +@@ -1340,6 +1342,37 @@ + } + } + ++DEFUN("locale-to-utf8", Flocale_to_utf8, Slocale_to_utf8, ++ (repv src), rep_Subr1) ++{ ++#ifdef HAVE_GLIB ++ gsize r, w; ++ u_char *utf8str; ++ repv res; ++ ++ rep_DECLARE1 (src, rep_STRINGP); ++ ++ utf8str = g_locale_to_utf8 (rep_STR (src), -1, &r, &w, NULL); ++ if (utf8str == NULL) { ++ return src; ++ } ++ ++ res = rep_make_string (w + 1); ++ if (!res) ++ return rep_mem_error (); ++ ++ strncpy (rep_STR (res), utf8str, w); ++ rep_STR (res)[w] = '\0'; ++ ++ g_free (utf8str); ++ return res; ++#else ++ return src; ++#endif ++} ++ ++ ++ + + /* initialisation */ + +@@ -1380,6 +1413,7 @@ + rep_ADD_SUBR(Shead_dimensions); + rep_ADD_SUBR(Shead_offset); + rep_ADD_SUBR(Sdisplay_message); ++ rep_ADD_SUBR(Slocale_to_utf8); + rep_pop_structure (tem); + + tem = rep_push_structure ("sawfish.wm.events"); +--- src/Makefile.in 2006-02-05 21:42:27.000000000 -0500 ++++ src/Makefile.in 2006-02-05 21:53:35.000000000 -0500 +@@ -38,14 +38,14 @@ + sawfish/wm/util/play-sample.la + DL_DIRS = sawfish/wm/util + +-override CFLAGS := $(CFLAGS) $(REP_CFLAGS) $(IMAGE_CFLAGS) $(X11_CFLAGS) $(ESD_CFLAGS) $(PANGO_CFLAGS) ++override CFLAGS := $(CFLAGS) $(REP_CFLAGS) $(IMAGE_CFLAGS) $(X11_CFLAGS) $(ESD_CFLAGS) $(PANGO_CFLAGS) $(GLIB_CFLAGS) + + all : sawfish libclient.o $(DL_OBJS) .libexec gtk-style + + sawfish : $(OBJS) $(LIBOBJS) + $(rep_LIBTOOL) --mode=link --tag=CC $(CC) -export-dynamic $(LDFLAGS) \ + -o sawfish $(OBJS) $(LIBOBJS) $(REP_LIBS) $(PANGO_LIBS) \ +- $(IMAGE_LIBS) $(X11_LIBS) $(EXTRA_X11_LIBS) $(LIBS) ++ $(IMAGE_LIBS) $(X11_LIBS) $(EXTRA_X11_LIBS) $(LIBS) $(GLIB_LIBS) + + %.la : %.lo + $(rep_DL_LD) $(LDFLAGS) -o $@ $< |