Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 1 | From 62005ad019d6afb81da100b3113292a16472d241 Mon Sep 17 00:00:00 2001 |
| 2 | From: Changqing Li <changqing.li@windriver.com> |
| 3 | Date: Mon, 10 Sep 2018 09:08:27 +0800 |
| 4 | Subject: [PATCH] Stub out x18n |
| 5 | |
| 6 | Update patch to version 1.6.6 |
| 7 | Signed-off-by: Changqing Li <changqing.li@windriver.com> |
| 8 | Upstream-Status: Inappropriate [configuration] |
| 9 | --- |
| 10 | src/Makefile.am | 5 +- |
| 11 | src/X18NCMSstubs.c | 426 +++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| 12 | src/imConv.c | 5 +- |
| 13 | src/locking.c | 4 + |
| 14 | 4 files changed, 438 insertions(+), 2 deletions(-) |
| 15 | create mode 100644 src/X18NCMSstubs.c |
| 16 | |
| 17 | diff --git a/src/Makefile.am b/src/Makefile.am |
| 18 | index f8c476d..cdbcbbd 100644 |
| 19 | --- a/src/Makefile.am |
| 20 | +++ b/src/Makefile.am |
| 21 | @@ -336,13 +336,16 @@ if THRSTUBS |
| 22 | libX11_la_SOURCES+=UIThrStubs.c |
| 23 | endif |
| 24 | |
| 25 | +libX11_la_SOURCES+=X18NCMSstubs.c |
| 26 | + |
| 27 | x11datadir = @X11_DATADIR@ |
| 28 | x11data_DATA = XErrorDB |
| 29 | |
| 30 | EXTRA_DIST = \ |
| 31 | $(x11data_DATA) \ |
| 32 | os2Stubs.c \ |
| 33 | - UIThrStubs.c |
| 34 | + UIThrStubs.c \ |
| 35 | + X18NCMSstubs.c |
| 36 | |
| 37 | libX11_xcb_la_SOURCES = x11_xcb.c Xxcbint.h |
| 38 | libX11_xcb_la_LDFLAGS = -version-number 1:0:0 -no-undefined |
| 39 | diff --git a/src/X18NCMSstubs.c b/src/X18NCMSstubs.c |
| 40 | new file mode 100644 |
| 41 | index 0000000..429cb31 |
| 42 | --- /dev/null |
| 43 | +++ b/src/X18NCMSstubs.c |
| 44 | @@ -0,0 +1,426 @@ |
| 45 | + /* - Provides stubs and dummy funcs needed when Xcms and XLocale stuff removed |
| 46 | + * |
| 47 | + * Copyright © 2003 Matthew Allum |
| 48 | + * |
| 49 | + * Permission to use, copy, modify, distribute, and sell this software and its |
| 50 | + * documentation for any purpose is hereby granted without fee, provided that |
| 51 | + * the above copyright notice appear in all copies and that both that |
| 52 | + * copyright notice and this permission notice appear in supporting |
| 53 | + * documentation, and that the name of Matthew Allum not be used in |
| 54 | + * advertising or publicity pertaining to distribution of the software without |
| 55 | + * specific, written prior permission. Keith Packard and Compaq makes no |
| 56 | + * representations about the suitability of this software for any purpose. It |
| 57 | + * is provided "as is" without express or implied warranty. |
| 58 | + * |
| 59 | + * MATTHEW ALLUM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS |
| 60 | + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, |
| 61 | + * IN NO EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR |
| 62 | + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, |
| 63 | + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 64 | + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 65 | + * PERFORMANCE OF THIS SOFTWARE. |
| 66 | + */ |
| 67 | + |
| 68 | +#include <stdlib.h> |
| 69 | +#include "Xlibint.h" |
| 70 | +#include "Xlcint.h" |
| 71 | +#include <X11/Xlocale.h> |
| 72 | +#include <X11/Xos.h> |
| 73 | +#ifdef WIN32 |
| 74 | +#undef close |
| 75 | +#endif |
| 76 | +#include <X11/Xutil.h> |
| 77 | +#include "XlcPubI.h" |
| 78 | + |
| 79 | +#include "Xcmsint.h" /* for XcmsCCC type */ |
| 80 | +#include "XlcPubI.h" /* for XLCd type */ |
| 81 | +#include "config.h" |
| 82 | + |
| 83 | +#if ! XLOCALE |
| 84 | + |
| 85 | +Bool |
| 86 | +XSupportsLocale() |
| 87 | +{ |
| 88 | + return False; |
| 89 | +} |
| 90 | + |
| 91 | +char * |
| 92 | +XSetLocaleModifiers( |
| 93 | + const char *modifiers) |
| 94 | +{ |
| 95 | + return NULL; |
| 96 | +} |
| 97 | + |
| 98 | +XLCd |
| 99 | +_XOpenLC( |
| 100 | + char *name) |
| 101 | +{ |
| 102 | + return NULL; |
| 103 | +} |
| 104 | + |
| 105 | +XLCd |
| 106 | +_XlcCurrentLC() |
| 107 | +{ |
| 108 | + return NULL; |
| 109 | +} |
| 110 | + |
| 111 | +void |
| 112 | +_XlcVaToArgList( |
| 113 | + va_list var, |
| 114 | + int count, |
| 115 | + XlcArgList *args_ret) |
| 116 | +{ |
| 117 | + return; |
| 118 | +} |
| 119 | + |
| 120 | +void |
| 121 | +_XlcCountVaList( |
| 122 | + va_list var, |
| 123 | + int *count_ret) |
| 124 | +{ |
| 125 | + return; |
| 126 | +} |
| 127 | + |
| 128 | +void |
| 129 | +_XCloseLC( |
| 130 | + XLCd lcd) |
| 131 | +{ |
| 132 | + return; |
| 133 | +} |
| 134 | + |
| 135 | +int |
| 136 | +_XlcConvert( |
| 137 | + XlcConv conv, |
| 138 | + XPointer *from, |
| 139 | + int *from_left, |
| 140 | + XPointer *to, |
| 141 | + int *to_left, |
| 142 | + XPointer *args, |
| 143 | + int num_args) |
| 144 | +{ |
| 145 | + return 0; |
| 146 | +} |
| 147 | + |
| 148 | +/* XIM Stubs */ |
| 149 | + |
| 150 | +XPointer |
| 151 | +_XimGetLocaleCode ( _Xconst char* encoding_name ) |
| 152 | +{ |
| 153 | + return NULL; |
| 154 | +} |
| 155 | + |
| 156 | +int |
| 157 | +_XimGetCharCode ( |
| 158 | + XPointer ucs_conv, |
| 159 | + KeySym keysym, |
| 160 | + unsigned char* buf, |
| 161 | + int nbytes) |
| 162 | +{ |
| 163 | + return 0; |
| 164 | +} |
| 165 | + |
| 166 | +/* Xrm Stubs */ |
| 167 | + |
| 168 | +XrmMethods |
| 169 | +_XrmInitParseInfo( |
| 170 | + XPointer *state) |
| 171 | +{ |
| 172 | + return (XrmMethods) NULL; |
| 173 | +} |
| 174 | + |
| 175 | +/* Xwc Stubs */ |
| 176 | + |
| 177 | +int |
| 178 | +XwcTextExtents( |
| 179 | + XFontSet font_set, |
| 180 | + _Xconst wchar_t *text, |
| 181 | + int text_len, |
| 182 | + XRectangle *overall_ink_extents, |
| 183 | + XRectangle *overall_logical_extents) |
| 184 | +{ |
| 185 | + return 0; |
| 186 | +} |
| 187 | + |
| 188 | +void |
| 189 | +XwcDrawString(Display *display, |
| 190 | + Drawable d, |
| 191 | + XFontSet font_set, |
| 192 | + GC gc, |
| 193 | + int x, int y, |
| 194 | + _Xconst wchar_t *string, |
| 195 | + int num_wchars) |
| 196 | +{ |
| 197 | + ; |
| 198 | +} |
| 199 | + |
| 200 | +void |
| 201 | +XwcDrawText( |
| 202 | + Display *dpy, |
| 203 | + Drawable d, |
| 204 | + GC gc, |
| 205 | + int x, |
| 206 | + int y, |
| 207 | + XwcTextItem *text_items, |
| 208 | + int nitems) |
| 209 | +{ |
| 210 | + ; |
| 211 | +} |
| 212 | + |
| 213 | +void |
| 214 | +XwcDrawImageString( |
| 215 | + Display *dpy, |
| 216 | + Drawable d, |
| 217 | + XFontSet font_set, |
| 218 | + GC gc, |
| 219 | + int x, |
| 220 | + int y, |
| 221 | + _Xconst wchar_t *text, |
| 222 | + int text_len) |
| 223 | +{ |
| 224 | + ; |
| 225 | +} |
| 226 | + |
| 227 | +int |
| 228 | +XwcTextEscapement( |
| 229 | + XFontSet font_set, |
| 230 | + _Xconst wchar_t *text, |
| 231 | + int text_len) |
| 232 | +{ |
| 233 | + return 0; |
| 234 | +} |
| 235 | + |
| 236 | +Status |
| 237 | +XwcTextPerCharExtents( |
| 238 | + XFontSet font_set, |
| 239 | + _Xconst wchar_t *text, |
| 240 | + int text_len, |
| 241 | + XRectangle *ink_extents_buffer, |
| 242 | + XRectangle *logical_extents_buffer, |
| 243 | + int buffer_size, |
| 244 | + int *num_chars, |
| 245 | + XRectangle *max_ink_extents, |
| 246 | + XRectangle *max_logical_extents) |
| 247 | +{ |
| 248 | + return(XcmsFailure); |
| 249 | +} |
| 250 | + |
| 251 | +int |
| 252 | +XwcTextPropertyToTextList( |
| 253 | + Display *dpy, |
| 254 | + const XTextProperty *text_prop, |
| 255 | + wchar_t ***list_ret, |
| 256 | + int *count_ret) |
| 257 | +{ |
| 258 | + return 0; |
| 259 | +} |
| 260 | + |
| 261 | +int |
| 262 | +XwcTextListToTextProperty( |
| 263 | + Display *dpy, |
| 264 | + wchar_t **list, |
| 265 | + int count, |
| 266 | + XICCEncodingStyle style, |
| 267 | + XTextProperty *text_prop) |
| 268 | +{ |
| 269 | + return 0; |
| 270 | +} |
| 271 | + |
| 272 | +void |
| 273 | +XwcFreeStringList(wchar_t **list) |
| 274 | +{ |
| 275 | + return; |
| 276 | +} |
| 277 | + |
| 278 | + |
| 279 | +void XmbSetWMProperties ( /* Actually from mbWMProps.c */ |
| 280 | + Display *dpy, |
| 281 | + Window w, |
| 282 | + _Xconst char *windowName, |
| 283 | + _Xconst char *iconName, |
| 284 | + char **argv, |
| 285 | + int argc, |
| 286 | + XSizeHints *sizeHints, |
| 287 | + XWMHints *wmHints, |
| 288 | + XClassHint *classHints) |
| 289 | +{ |
| 290 | + return; |
| 291 | +} |
| 292 | + |
| 293 | +int |
| 294 | +XmbTextPropertyToTextList( |
| 295 | + Display *dpy, |
| 296 | + const XTextProperty *text_prop, |
| 297 | + char ***list_ret, |
| 298 | + int *count_ret) |
| 299 | +{ |
| 300 | + return XLocaleNotSupported; |
| 301 | +} |
| 302 | + |
| 303 | +int |
| 304 | +XmbTextListToTextProperty( |
| 305 | + Display *dpy, |
| 306 | + char **list, |
| 307 | + int count, |
| 308 | + XICCEncodingStyle style, |
| 309 | + XTextProperty *text_prop) |
| 310 | +{ |
| 311 | + return XLocaleNotSupported; |
| 312 | +} |
| 313 | + |
| 314 | +int |
| 315 | +XmbTextExtents( |
| 316 | + XFontSet font_set, |
| 317 | + _Xconst char *text, |
| 318 | + int text_len, |
| 319 | + XRectangle *overall_ink_extents, |
| 320 | + XRectangle *overall_logical_extents) |
| 321 | +{ |
| 322 | + return 0; |
| 323 | +} |
| 324 | + |
| 325 | +void |
| 326 | +XmbDrawText( |
| 327 | + Display *dpy, |
| 328 | + Drawable d, |
| 329 | + GC gc, |
| 330 | + int x, |
| 331 | + int y, |
| 332 | + XmbTextItem *text_items, |
| 333 | + int nitems) |
| 334 | +{ |
| 335 | + ; |
| 336 | +} |
| 337 | + |
| 338 | +void |
| 339 | +XmbDrawString( |
| 340 | + Display *dpy, |
| 341 | + Drawable d, |
| 342 | + XFontSet font_set, |
| 343 | + GC gc, |
| 344 | + int x, |
| 345 | + int y, |
| 346 | + _Xconst char *text, |
| 347 | + int text_len) |
| 348 | +{ |
| 349 | + ; |
| 350 | +} |
| 351 | + |
| 352 | +void |
| 353 | +XmbDrawImageString( |
| 354 | + Display *dpy, |
| 355 | + Drawable d, |
| 356 | + XFontSet font_set, |
| 357 | + GC gc, |
| 358 | + int x, |
| 359 | + int y, |
| 360 | + _Xconst char *text, |
| 361 | + int text_len) |
| 362 | +{ |
| 363 | + ; |
| 364 | +} |
| 365 | + |
| 366 | +int |
| 367 | +XmbTextEscapement( |
| 368 | + XFontSet font_set, |
| 369 | + _Xconst char *text, |
| 370 | + int text_len) |
| 371 | +{ |
| 372 | + return 0; |
| 373 | +} |
| 374 | + |
| 375 | +Status |
| 376 | +XmbTextPerCharExtents( |
| 377 | + XFontSet font_set, |
| 378 | + _Xconst char *text, |
| 379 | + int text_len, |
| 380 | + XRectangle *ink_extents_buffer, |
| 381 | + XRectangle *logical_extents_buffer, |
| 382 | + int buffer_size, |
| 383 | + int *num_chars, |
| 384 | + XRectangle *max_ink_extents, |
| 385 | + XRectangle *max_logical_extents) |
| 386 | +{ |
| 387 | + return 0; |
| 388 | +} |
| 389 | + |
| 390 | +unsigned int |
| 391 | +KeySymToUcs4(KeySym keysym) |
| 392 | +{ |
| 393 | + return 0; |
| 394 | +} |
| 395 | + |
| 396 | +#endif |
| 397 | + |
| 398 | +#if ! XCMS |
| 399 | + |
| 400 | +XcmsCCC |
| 401 | +XcmsCCCOfColormap(dpy, cmap) |
| 402 | + Display *dpy; |
| 403 | + Colormap cmap; |
| 404 | +{ |
| 405 | + return NULL; |
| 406 | +} |
| 407 | + |
| 408 | +Status |
| 409 | +_XcmsResolveColorString ( |
| 410 | + XcmsCCC ccc, |
| 411 | + const char **color_string, |
| 412 | + XcmsColor *pColor_exact_return, |
| 413 | + XcmsColorFormat result_format) |
| 414 | +{ |
| 415 | + return(XcmsFailure); |
| 416 | +} |
| 417 | + |
| 418 | +void |
| 419 | +_XcmsUnresolveColor( |
| 420 | + XcmsCCC ccc, |
| 421 | + XcmsColor *pColor) |
| 422 | +{ |
| 423 | + return; |
| 424 | +} |
| 425 | + |
| 426 | +void |
| 427 | +_XUnresolveColor( |
| 428 | + XcmsCCC ccc, |
| 429 | + XColor *pXColor) |
| 430 | +{ |
| 431 | + return; |
| 432 | +} |
| 433 | + |
| 434 | +XcmsCmapRec * |
| 435 | +_XcmsAddCmapRec(dpy, cmap, windowID, visual) |
| 436 | + Display *dpy; |
| 437 | + Colormap cmap; |
| 438 | + Window windowID; |
| 439 | + Visual *visual; |
| 440 | +{ |
| 441 | + return NULL; |
| 442 | +} |
| 443 | + |
| 444 | +void |
| 445 | +_XcmsRGB_to_XColor( |
| 446 | + XcmsColor *pColors, |
| 447 | + XColor *pXColors, |
| 448 | + unsigned int nColors) |
| 449 | +{ |
| 450 | + return; |
| 451 | +} |
| 452 | + |
| 453 | +XcmsCmapRec * |
| 454 | +_XcmsCopyCmapRecAndFree( |
| 455 | + Display *dpy, |
| 456 | + Colormap src_cmap, |
| 457 | + Colormap copy_cmap) |
| 458 | +{ |
| 459 | + return NULL; |
| 460 | +} |
| 461 | + |
| 462 | +void |
| 463 | +_XcmsDeleteCmapRec( |
| 464 | + Display *dpy, |
| 465 | + Colormap cmap) |
| 466 | +{ |
| 467 | + return; |
| 468 | +} |
| 469 | + |
| 470 | +#endif |
| 471 | diff --git a/src/imConv.c b/src/imConv.c |
| 472 | index c3c1974..04ecc81 100644 |
| 473 | --- a/src/imConv.c |
| 474 | +++ b/src/imConv.c |
| 475 | @@ -80,6 +80,7 @@ static const struct SubstRec SubstTable[] = { |
| 476 | * from UCS char to specified charset char. |
| 477 | * This converter is needed for _XimGetCharCode subroutine. |
| 478 | */ |
| 479 | +#ifdef XLOCALE |
| 480 | XPointer |
| 481 | _XimGetLocaleCode ( |
| 482 | _Xconst char* encoding_name) |
| 483 | @@ -93,7 +94,7 @@ _XimGetLocaleCode ( |
| 484 | } |
| 485 | return cvt; |
| 486 | } |
| 487 | - |
| 488 | +#endif |
| 489 | /* |
| 490 | * Returns the locale dependent representation of a keysym. |
| 491 | * The locale's encoding is passed in form of pointer to UCS convertor. |
| 492 | @@ -105,6 +105,7 @@ _XimGetLocaleCode ( |
| 493 | * locale |
| 494 | */ |
| 495 | /*ARGSUSED*/ |
| 496 | +#ifdef XLOCALE |
| 497 | int |
| 498 | _XimGetCharCode ( |
| 499 | XPointer ucs_conv, |
| 500 | @@ -133,6 +134,7 @@ _XimGetCharCode ( |
| 501 | buf[count]= '\0'; |
| 502 | return count; |
| 503 | } |
| 504 | +#endif |
| 505 | |
| 506 | #ifdef XKB |
| 507 | static int lookup_string( |
| 508 | diff --git a/src/locking.c b/src/locking.c |
| 509 | index 9f4fe06..e6967ee 100644 |
| 510 | --- a/src/locking.c |
| 511 | +++ b/src/locking.c |
| 512 | @@ -65,7 +65,9 @@ in this Software without prior written authorization from The Open Group. |
| 513 | #define NUM_FREE_CVLS 4 |
| 514 | |
| 515 | /* in lcWrap.c */ |
| 516 | +#ifdef XLOCALE |
| 517 | extern LockInfoPtr _Xi18n_lock; |
| 518 | +#endif |
| 519 | |
| 520 | #ifdef WIN32 |
| 521 | static DWORD _X_TlsIndex = (DWORD)-1; |
| 522 | @@ -597,9 +599,11 @@ Status XInitThreads(void) |
| 523 | _Xglobal_lock = &global_lock; |
| 524 | xmutex_init(_Xglobal_lock->lock); |
| 525 | xmutex_set_name(_Xglobal_lock->lock, "Xlib global"); |
| 526 | +#ifdef XLOCALE |
| 527 | _Xi18n_lock = &i18n_lock; |
| 528 | xmutex_init(_Xi18n_lock->lock); |
| 529 | xmutex_set_name(_Xi18n_lock->lock, "Xlib i18n"); |
| 530 | +#endif |
| 531 | _XLockMutex_fn = _XLockMutex; |
| 532 | _XUnlockMutex_fn = _XUnlockMutex; |
| 533 | _XCreateMutex_fn = _XCreateMutex; |
| 534 | -- |
| 535 | 2.7.4 |
| 536 | |