diff options
author | Kaleb Keithley <kaleb@freedesktop.org> | 2004-02-24 20:26:32 +0000 |
---|---|---|
committer | Kaleb Keithley <kaleb@freedesktop.org> | 2004-02-24 20:26:32 +0000 |
commit | 1f42e6ce18e72eabf5fe02a3a693fca58267dfd3 (patch) | |
tree | 19030ba231b18b83e16d447618a7df13de6b99de | |
parent | 11fc1fad02c3008217dd6dc1c1a7fc4c97f42aeb (diff) |
bug #216 provide better compatibility semantics in Xlib for people who are compiling or linking against older Xlibs that have XFree86's UTF-8 functions.XORG-RELEASE-1-BASE
This goes away if Sun's I18N people recommend adopting the functions and the xorg_arch list agree, but for now we have this hackery to deal with third parties who scribbled non-standard functions in our API.
-rw-r--r-- | include/X11/Xlib.h | 26 | ||||
-rw-r--r-- | include/X11/Xutil.h | 9 | ||||
-rw-r--r-- | src/xlibi18n/ICWrap.c | 41 | ||||
-rw-r--r-- | src/xlibi18n/lcWrap.c | 25 | ||||
-rw-r--r-- | src/xlibi18n/utf8WMProps.c | 18 | ||||
-rw-r--r-- | src/xlibi18n/utf8Wrap.c | 92 |
6 files changed, 200 insertions, 11 deletions
diff --git a/include/X11/Xlib.h b/include/X11/Xlib.h index bc24ced5..e16413e9 100644 --- a/include/X11/Xlib.h +++ b/include/X11/Xlib.h @@ -1,4 +1,4 @@ -/* $XdotOrg: lib/X11/include/X11/Xlib.h,v 1.1.4.6 2003-12-20 00:28:22 kaleb Exp $ */ +/* $XdotOrg: lib/X11/include/X11/Xlib.h,v 1.1.4.7 2004-02-24 20:26:32 kaleb Exp $ */ /* $Xorg: Xlib.h,v 1.6 2001/02/09 02:03:38 xorgcvs Exp $ */ /* @@ -3659,6 +3659,9 @@ extern int XFree86utf8TextEscapement( _Xconst char* /* text */, int /* bytes_text */ ); +#ifndef NOXFREE86COMPAT +#define Xutf8TextEscapement XFree86utf8TextEscapement +#endif extern int XmbTextExtents( XFontSet /* font_set */, @@ -3683,6 +3686,9 @@ extern int XFree86utf8TextExtents( XRectangle* /* overall_ink_return */, XRectangle* /* overall_logical_return */ ); +#ifndef NOXFREE86COMPAT +#define Xutf8TextExtents XFree86utf8TextExtents +#endif extern Status XmbTextPerCharExtents( XFontSet /* font_set */, @@ -3719,6 +3725,9 @@ extern Status XFree86utf8TextPerCharExtents( XRectangle* /* overall_ink_return */, XRectangle* /* overall_logical_return */ ); +#ifndef NOXFREE86COMPAT +#define Xutf8TextPerCharExtents XFree86utf8TextPerCharExtents +#endif extern void XmbDrawText( Display* /* display */, @@ -3749,6 +3758,9 @@ extern void XFree86utf8DrawText( XmbTextItem* /* text_items */, int /* nitems */ ); +#ifndef NOXFREE86COMPAT +#define Xutf8DrawText XFree86utf8DrawText +#endif extern void XmbDrawString( Display* /* display */, @@ -3782,6 +3794,9 @@ extern void XFree86utf8DrawString( _Xconst char* /* text */, int /* bytes_text */ ); +#ifndef NOXFREE86COMPAT +#define Xutf8DrawString XFree86utf8DrawString +#endif extern void XmbDrawImageString( Display* /* display */, @@ -3815,6 +3830,9 @@ extern void XFree86utf8DrawImageString( _Xconst char* /* text */, int /* bytes_text */ ); +#ifndef NOXFREE86COMPAT +#define Xutf8DrawImageString XFree86utf8DrawImageString +#endif extern XIM XOpenIM( Display* /* dpy */, @@ -3870,6 +3888,9 @@ extern char *XmbResetIC( extern char *XFree86utf8ResetIC( XIC /* ic */ ); +#ifndef NOXFREE86COMPAT +#define Xutf8ResetIC XFree86utf8ResetIC +#endif extern char *XSetICValues( XIC /* ic */, ... @@ -3914,6 +3935,9 @@ extern int XFree86utf8LookupString( KeySym* /* keysym_return */, Status* /* status_return */ ); +#ifndef NOXFREE86COMPAT +#define Xutf8LookupString XFree86utf8LookupString +#endif extern XVaNestedList XVaCreateNestedList( int /*unused*/, ... diff --git a/include/X11/Xutil.h b/include/X11/Xutil.h index 2bcd2b0a..0450f78e 100644 --- a/include/X11/Xutil.h +++ b/include/X11/Xutil.h @@ -683,6 +683,9 @@ extern void XFree86utf8SetWMProperties( XWMHints* /* wm_hints */, XClassHint* /* class_hints */ ); +#ifndef NOXFREE86COMPAT +#define Xutf8SetWMProperties XFree86utf8SetWMProperties +#endif extern void XSetWMSizeHints( Display* /* display */, @@ -751,6 +754,9 @@ extern int XFree86utf8TextListToTextProperty( XICCEncodingStyle style, XTextProperty* text_prop_return ); +#ifndef NOXFREE86COMPAT +#define Xutf8TextListToTextProperty XFree86utf8TextListToTextProperty +#endif extern void XwcFreeStringList( wchar_t** list @@ -782,6 +788,9 @@ extern int XFree86utf8TextPropertyToTextList( char*** list_return, int* count_return ); +#ifndef NOXFREE86COMPAT +#define Xutf8TextPropertyToTextList XFree86utf8TextPropertyToTextList +#endif extern int XUnionRectWithRegion( XRectangle* /* rectangle */, diff --git a/src/xlibi18n/ICWrap.c b/src/xlibi18n/ICWrap.c index db466a20..57a0ad55 100644 --- a/src/xlibi18n/ICWrap.c +++ b/src/xlibi18n/ICWrap.c @@ -391,8 +391,7 @@ XwcResetIC(ic) } char * -XFree86utf8ResetIC(ic) - XIC ic; +XFree86utf8ResetIC(XIC ic) { if (ic->core.im) { if (ic->methods->utf8_reset) @@ -403,6 +402,15 @@ XFree86utf8ResetIC(ic) return (char *)NULL; } +#ifndef NOXFREE86COMPAT +#undef Xutf8ResetIC +char * +Xutf8ResetIC(XIC ic) +{ + return XFree86utf8ResetIC(ic); +} +#endif + int XmbLookupString(ic, ev, buffer, nbytes, keysym, status) XIC ic; @@ -434,13 +442,13 @@ XwcLookupString(ic, ev, buffer, nchars, keysym, status) } int -XFree86utf8LookupString(ic, ev, buffer, nbytes, keysym, status) - XIC ic; - register XKeyEvent *ev; - char *buffer; - int nbytes; - KeySym *keysym; - Status *status; +XFree86utf8LookupString( + XIC ic, + register XKeyEvent *ev, + char *buffer, + int nbytes, + KeySym *keysym, + Status *status) { if (ic->core.im) { if (ic->methods->utf8_lookup_string) @@ -452,3 +460,18 @@ XFree86utf8LookupString(ic, ev, buffer, nbytes, keysym, status) } return XLookupNone; } + +#ifndef NOXFREE86COMPAT +#undef Xutf8LookupString +int +Xutf8LookupString( + XIC ic, + register XKeyEvent *ev, + char *buffer, + int nbytes, + KeySym *keysym, + Status *status) +{ + return XFree86utf8LookupString(ic, ev, buffer, nbytes, keysym, status); +} +#endif diff --git a/src/xlibi18n/lcWrap.c b/src/xlibi18n/lcWrap.c index 69d073ac..3af14080 100644 --- a/src/xlibi18n/lcWrap.c +++ b/src/xlibi18n/lcWrap.c @@ -420,6 +420,18 @@ XFree86utf8TextPropertyToTextList( return (*lcd->methods->utf8_text_prop_to_list)(lcd, dpy, text_prop, list_ret, count_ret); } +#ifndef NOXFREE86COMPAT +#undef Xutf8TextPropertyToTextList +int +Xutf8TextPropertyToTextList( + Display *dpy, + const XTextProperty *text_prop, + char ***list_ret, + int *count_ret) +{ + return XFree86utf8TextPropertyToTextList(dpy, text_prop, list_ret, count_ret); +} +#endif int XmbTextListToTextProperty( @@ -471,6 +483,19 @@ XFree86utf8TextListToTextProperty( return (*lcd->methods->utf8_text_list_to_prop)(lcd, dpy, list, count, style, text_prop); } +#ifndef NOXFREE86COMPAT +#undef Xutf8TextListToTextProperty +int +Xutf8TextListToTextProperty( + Display *dpy, + char **list, + int count, + XICCEncodingStyle style, + XTextProperty *text_prop) +{ + return XFree86utf8TextListToTextProperty(dpy, list, count, style, text_prop); +} +#endif void XwcFreeStringList( diff --git a/src/xlibi18n/utf8WMProps.c b/src/xlibi18n/utf8WMProps.c index 93fb552b..4923ae98 100644 --- a/src/xlibi18n/utf8WMProps.c +++ b/src/xlibi18n/utf8WMProps.c @@ -88,3 +88,21 @@ XFree86utf8SetWMProperties ( /* Note: The WM_LOCALE_NAME property is set by XSetWMProperties. */ } +#ifndef NOXFREE86COMPAT +#undef Xutf8SetWMProperties +void +Xutf8SetWMProperties ( + Display *dpy, + Window w, + _Xconst char *windowName, + _Xconst char *iconName, + char **argv, + int argc, + XSizeHints *sizeHints, + XWMHints *wmHints, + XClassHint *classHints) +{ + XFree86utf8SetWMProperties (dpy, w, windowName, iconName, argv, argc, + sizeHints, wmHints, classHints); +} +#endif diff --git a/src/xlibi18n/utf8Wrap.c b/src/xlibi18n/utf8Wrap.c index 54603235..9ecc7225 100644 --- a/src/xlibi18n/utf8Wrap.c +++ b/src/xlibi18n/utf8Wrap.c @@ -109,6 +109,21 @@ XFree86utf8DrawText( x += esc; } } +#ifndef NOXFREE86COMPAT +#undef Xutf8DrawText +void +Xutf8DrawText( + Display *dpy, + Drawable d, + GC gc, + int x, + int y, + XmbTextItem *text_items, + int nitems) +{ + XFree86utf8DrawText(dpy, d, gc, x, y, text_items, nitems); +} +#endif void XFree86utf8DrawString( @@ -124,7 +139,22 @@ XFree86utf8DrawString( (void)(*font_set->methods->utf8_draw_string) (dpy, d, font_set, gc, x, y, (char *)text, text_len); } - +#ifndef NOXFREE86COMPAT +#undef Xutf8DrawString +void +Xutf8DrawString( + Display *dpy, + Drawable d, + XFontSet font_set, + GC gc, + int x, + int y, + _Xconst char *text, + int text_len) +{ + XFree86utf8DrawString(dpy, d, font_set, gc, x, y, text, text_len); +} +#endif void XFree86utf8DrawImageString( @@ -140,6 +170,22 @@ XFree86utf8DrawImageString( (*font_set->methods->utf8_draw_image_string) (dpy, d, font_set, gc, x, y, (char *)text, text_len); } +#ifndef NOXFREE86COMPAT +#undef Xutf8DrawImageString +void +Xutf8DrawImageString( + Display *dpy, + Drawable d, + XFontSet font_set, + GC gc, + int x, + int y, + _Xconst char *text, + int text_len) +{ + XFree86utf8DrawImageString(dpy, d, font_set, gc, x, y, text, text_len); +} +#endif int XFree86utf8TextEscapement( @@ -150,6 +196,17 @@ XFree86utf8TextEscapement( return (*font_set->methods->utf8_escapement) (font_set, (char *)text, text_len); } +#ifndef NOXFREE86COMPAT +#undef Xutf8TextEscapement +int +Xutf8TextEscapement( + XFontSet font_set, + _Xconst char *text, + int text_len) +{ + return XFree86utf8TextEscapement(font_set, text, text_len); +} +#endif int XFree86utf8TextExtents( @@ -164,6 +221,20 @@ XFree86utf8TextExtents( overall_ink_extents, overall_logical_extents); } +#ifndef NOXFREE86COMPAT +#undef Xutf8TextExtents +int +Xutf8TextExtents( + XFontSet font_set, + _Xconst char *text, + int text_len, + XRectangle *overall_ink_extents, + XRectangle *overall_logical_extents) +{ + return XFree86utf8TextExtents(font_set, text, text_len, + overall_ink_extents, overall_logical_extents); +} +#endif Status XFree86utf8TextPerCharExtents( @@ -182,3 +253,22 @@ XFree86utf8TextPerCharExtents( ink_extents_buffer, logical_extents_buffer, buffer_size, num_chars, max_ink_extents, max_logical_extents); } +#ifndef NOXFREE86COMPAT +#undef Xutf8TextPerCharExtents +Status +Xutf8TextPerCharExtents( + XFontSet font_set, + _Xconst char *text, + int text_len, + XRectangle *ink_extents_buffer, + XRectangle *logical_extents_buffer, + int buffer_size, + int *num_chars, + XRectangle *max_ink_extents, + XRectangle *max_logical_extents) +{ + return XFree86utf8TextPerCharExtents(font_set, text, text_len, + ink_extents_buffer, logical_extents_buffer, buffer_size, + num_chars, max_ink_extents, max_logical_extents); +} +#endif |