? .FBCIndex ? .FBCLockFolder ? unx/source/gdi/diff.diff Index: unx/source/app/i18n_im.cxx =================================================================== RCS file: /cvs/gsl/vcl/unx/source/app/i18n_im.cxx,v retrieving revision 1.16.2.1.2.1 diff -u -r1.16.2.1.2.1 i18n_im.cxx --- unx/source/app/i18n_im.cxx 21 Nov 2002 22:51:27 -0000 1.16.2.1.2.1 +++ unx/source/app/i18n_im.cxx 11 Dec 2002 00:46:56 -0000 @@ -254,14 +254,25 @@ p_inlocale = aLocaleString.GetBuffer(); } } -#endif - + p_outlocale = p_inlocale; + + // FIXME + // setlocale() doesn't do much on Darwin 5 or 6. Here, since setlocale() is + // #defined to _Xsetlocale() by our , it still doesn't work. + // Bypass it for MacOS X and Darwin. + // NOTE: On MacOS X, we can't set the locale anyway because its set in + // the System Preferences application, under the International control panel. + // Thus, the locale that we get from osl_getProcessLocale() is always valid as + // its the locale that's already set. + // NOTE 2: This setlocale() is still valid for Darwin though. +#else if ( (p_outlocale = setlocale(LC_ALL, p_inlocale)) == NULL ) { fprintf( stderr, "I18N: Operating system doesn't support locale \"%s\"\n", p_inlocale ); } +#endif return p_outlocale; } @@ -458,64 +469,73 @@ { if ( getenv("USE_XOPENIM") == NULL ) { - mbMultiLingual = True; // set ml-input flag to create input-method - maMethod = XvaOpenIM(pDisplay, NULL, NULL, NULL, + mbMultiLingual = True; // set ml-input flag to create input-method + maMethod = XvaOpenIM(pDisplay, NULL, NULL, NULL, XNMultiLingualInput, mbMultiLingual, /* dummy */ 0); - // get ml-input flag from input-method - if ( maMethod == (XIM)NULL ) - mbMultiLingual = False; + // get ml-input flag from input-method + if ( maMethod == (XIM)NULL ) + mbMultiLingual = False; #if !defined(LINUX) - else - if ( XGetIMValues(maMethod, - XNMultiLingualInput, &mbMultiLingual, NULL ) != NULL ) - mbMultiLingual = False; - if( mbMultiLingual ) - { - XIMUnicodeCharacterSubsets* subsets; - if( XGetIMValues( maMethod, - XNQueryUnicodeCharacterSubset, &subsets, NULL ) == NULL ) - { + else + if ( XGetIMValues(maMethod, + XNMultiLingualInput, &mbMultiLingual, NULL ) != NULL ) + mbMultiLingual = False; + + #ifdef MACOSX + // FIXME + // For whatever reason, the XvaOpenIM call always returns NULL + // on MacOS X/Darwin. We know we've got multi-lingual support + // anyway so hack it to true so we can type international characters. + mbMultiLingual = True; + #endif + + if( mbMultiLingual ) + { + XIMUnicodeCharacterSubsets* subsets; + if( XGetIMValues( maMethod, + XNQueryUnicodeCharacterSubset, &subsets, NULL ) == NULL ) + { #ifdef DEBUG - fprintf( stderr, "IM reports %d subsets: ", subsets->count_subsets ); + fprintf( stderr, "IM reports %d subsets: ", subsets->count_subsets ); #endif - I18NStatus& rStatus( I18NStatus::get() ); - rStatus.clearChoices(); - for( int i = 0; i < subsets->count_subsets; i++ ) - { + I18NStatus& rStatus( I18NStatus::get() ); + rStatus.clearChoices(); + for( int i = 0; i < subsets->count_subsets; i++ ) + { #ifdef DEBUG - fprintf( stderr,"\"%s\" ", subsets->supported_subsets[i].name ); + fprintf( stderr,"\"%s\" ", subsets->supported_subsets[i].name ); #endif - rStatus.addChoice( String( subsets->supported_subsets[i].name, RTL_TEXTENCODING_UTF8 ), &subsets->supported_subsets[i] ); - } + rStatus.addChoice( String( subsets->supported_subsets[i].name, RTL_TEXTENCODING_UTF8 ), &subsets->supported_subsets[i] ); + } #ifdef DEBUG - fprintf( stderr, "\n" ); + fprintf( stderr, "\n" ); #endif - } + } #ifdef DEBUG - else - fprintf( stderr, "query subsets failed\n" ); + else + fprintf( stderr, "query subsets failed\n" ); #endif - } + } #else - mbMultiLingual = False; + mbMultiLingual = False; #endif - } + } else - { - maMethod = XOpenIM(pDisplay, NULL, NULL, NULL); - mbMultiLingual = False; - } + { + maMethod = XOpenIM(pDisplay, NULL, NULL, NULL); + mbMultiLingual = False; + } - if ((maMethod == (XIM)NULL) && (getenv("XMODIFIERS") != NULL)) - { + if ((maMethod == (XIM)NULL) && (getenv("XMODIFIERS") != NULL)) + { putenv ("XMODIFIERS"); XSetLocaleModifiers(""); maMethod = XOpenIM(pDisplay, NULL, NULL, NULL); - mbMultiLingual = False; - } + mbMultiLingual = False; + } - if ( maMethod != (XIM)NULL ) + if ( maMethod != (XIM)NULL ) { if ( XGetIMValues(maMethod, XNQueryInputStyle, &mpStyles, NULL) != NULL) @@ -537,10 +557,10 @@ fprintf(stderr, "input method creation failed\n"); #endif - maDestroyCallback.callback = (XIMProc)IM_IMDestroyCallback; - maDestroyCallback.client_data = (XPointer)this; - if (mbUseable && maMethod != NULL) - XSetIMValues(maMethod, XNDestroyCallback, &maDestroyCallback, NULL); + maDestroyCallback.callback = (XIMProc)IM_IMDestroyCallback; + maDestroyCallback.client_data = (XPointer)this; + if (mbUseable && maMethod != NULL) + XSetIMValues(maMethod, XNDestroyCallback, &maDestroyCallback, NULL); return mbUseable; } Index: unx/source/app/i18n_xkb.cxx =================================================================== RCS file: /cvs/gsl/vcl/unx/source/app/i18n_xkb.cxx,v retrieving revision 1.2 diff -u -r1.2 i18n_xkb.cxx --- unx/source/app/i18n_xkb.cxx 19 Dec 2000 00:25:06 -0000 1.2 +++ unx/source/app/i18n_xkb.cxx 11 Dec 2002 00:46:56 -0000 @@ -62,7 +62,7 @@ #include -#if defined(LINUX) || defined(FREEBSD) // should really check for xfree86 or for X11R6.1 and higher +#if defined(LINUX) || defined(FREEBSD) || defined(MACOSX) // should really check for xfree86 or for X11R6.1 and higher #define __XKeyboardExtension__ 1 #else #define __XKeyboardExtension__ 0 Index: unx/source/gdi/salgdi3.cxx =================================================================== RCS file: /cvs/gsl/vcl/unx/source/gdi/salgdi3.cxx,v retrieving revision 1.70.8.4.4.1 diff -u -r1.70.8.4.4.1 salgdi3.cxx --- unx/source/gdi/salgdi3.cxx 22 Aug 2002 06:33:15 -0000 1.70.8.4.4.1 +++ unx/source/gdi/salgdi3.cxx 11 Dec 2002 00:46:57 -0000 @@ -1897,7 +1897,12 @@ #ifdef USE_BUILTIN_RASTERIZER aX11GlyphPeer.SetDisplay( maGraphicsData.GetXDisplay(), maGraphicsData.GetDisplay()->GetVisual()->GetVisual() ); +#ifdef MACOSX + // For some reason this allows us to load TrueType fonts on OS X/Darwin + GlyphCache::EnsureInstance( aX11GlyphPeer ); +#else GlyphCache::EnsureInstance( aX11GlyphPeer, false ); +#endif GlyphCache& rGC = GlyphCache::GetInstance(); #ifdef USE_PSPRINT